branch_name
stringclasses
22 values
content
stringlengths
18
81.8M
directory_id
stringlengths
40
40
languages
listlengths
1
36
num_files
int64
1
7.38k
repo_language
stringclasses
151 values
repo_name
stringlengths
7
101
revision_id
stringlengths
40
40
snapshot_id
stringlengths
40
40
refs/heads/master
<file_sep># FirstCommit Test Purpose
1d6f7b18811fa4bbb739331f99adbfc291ff61d4
[ "Markdown" ]
1
Markdown
Surabhi3/FirstCommit
5f46c86153aaf0c431ab9907c739b54796b13e54
fae2d66b02979e71c949817556aaf284673b4f30
refs/heads/master
<file_sep># country-selector react("15.6.1") component which can select country for window show up svg image in , other devices show to emoji in <file_sep>export const FilterName = 'country'; <file_sep>import React from 'react'; import { shallow } from 'enzyme'; import intl from '_comsave/mocks/intl'; import PickListObj from '../PickListObj'; const minProps = { onClick: jest.fn(), selected: 'first', items: { nl: { flag: '🇳🇱', fieldGuide: { zipcode: '1012VN', houseNumber: '179', houseNumberExtra: 'A', }, intl: { CountryPickList: { id: 'app.components.CountryPickList.nl', defaultMessage: 'Netherlands', }, OfferSearchBox: { id: 'app.containers.OfferSearchBox.nl', defaultMessage: 'Netherlands', }, }, }, uk: { flag: '🇬🇧', fieldGuide: { zipcode: 'W1B5AN', }, intl: { CountryPickList: { id: 'app.components.CountryPickList.uk', defaultMessage: 'United Kingdom', }, OfferSearchBox: { id: 'app.containers.OfferSearchBox.uk', defaultMessage: 'United Kingdom', }, }, }, }, }; const maxProps = { onClick: () => {}, selected: 'first', items: { nl: { flag: '🇳🇱', fieldGuide: { zipcode: '1012VN', houseNumber: '179', houseNumberExtra: 'A', }, intl: { CountryPickList: { id: 'app.components.CountryPickList.nl', defaultMessage: 'Netherlands', }, OfferSearchBox: { id: 'app.containers.OfferSearchBox.nl', defaultMessage: 'Netherlands', }, }, }, uk: { flag: '🇬🇧', fieldGuide: { zipcode: 'W1B5AN', }, intl: { CountryPickList: { id: 'app.components.CountryPickList.uk', defaultMessage: 'United Kingdom', }, OfferSearchBox: { id: 'app.containers.OfferSearchBox.uk', defaultMessage: 'United Kingdom', }, }, }, }, childLocation: 'end', }; describe('<PickListObj />', () => { it('expect to match snapshot first', () => { const wrapper = shallow(<PickListObj {...minProps} />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot second', () => { const wrapper = shallow(<PickListObj {...minProps} selected="second" />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot second', () => { const wrapper = shallow(<PickListObj {...maxProps} selected="second" />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot max first', () => { const wrapper = shallow(<PickListObj {...maxProps} selected="first" />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot first children', () => { const wrapper = shallow( <PickListObj {...minProps} selected="first"> childtest </PickListObj>, { context: { intl } }, ); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot selected ,children', () => { const wrapper = shallow( <PickListObj {...maxProps} selected="first"> childtest </PickListObj>, { context: { intl } }, ); expect(wrapper).toMatchSnapshot(); }); it('should call props onclick function on li click', () => { minProps.onClick.mockClear(); const wrapper = shallow(<PickListObj {...minProps} selected="second" />, { context: { intl }, }); wrapper .find('PickListItem') .first() .simulate('click'); expect(minProps.onClick).toHaveBeenCalled(); }); }); <file_sep>import React from 'react'; import PropTypes from 'prop-types'; import { Field } from 'redux-form/immutable'; import { CountrySettings } from '_comsave/countries'; import { FilterName } from './constants'; import messages from './messages'; import MobilePickListWrapper from './MobilePickListWrapper'; export class MobilePickList extends React.PureComponent { onClick = (e, key) => { e.preventDefault(); this.props.onSelect(key); }; render() { const { selected, label } = this.props; const { intl: { formatMessage }, } = this.context; return ( <MobilePickListWrapper {...this.props}> {label && <label htmlFor={label}> {label} :</label>} <div className="select-wrapper"> <Field name={FilterName} className={selected} selected={selected} component="select" onChange={this.onClick}> {Object.keys(CountrySettings) .sort((a, b) => (formatMessage(messages[a]) > formatMessage(messages[b]) ? 1 : -1)) .map(key => ( <option value={key} key={`picklist-item-${key}`} className={selected === key ? 'active' : null}> &nbsp;{CountrySettings[key].flag} &nbsp;&nbsp; {formatMessage(messages[key])} </option> ))} </Field> <span className="down-icon" aria-hidden="true" /> </div> </MobilePickListWrapper> ); } } MobilePickList.contextTypes = { intl: PropTypes.object.isRequired, }; MobilePickList.defaultProps = { selected: 'nl', }; MobilePickList.propTypes = { selected: PropTypes.string.isRequired, onSelect: PropTypes.func.isRequired, label: PropTypes.string, }; export default MobilePickList; <file_sep>import styled from 'styled-components'; import { colors, screen } from '_comsave/global-style-variables'; import { CountrySettings } from '_comsave/countries'; const flagCss = () => { let css = ''; Object.keys(CountrySettings).forEach(key => { css += `&.${key}::before { content: '${CountrySettings[key].flag}'; }`; }); return css; }; export default styled.li` color: ${colors.darkBlue}; flex: 1; ${({ isWindows }) => (isWindows ? 'padding: 7px 36px 6px 14px' : 'padding: 7px 36px 6px 43px')}; position: relative; border-bottom: 1px solid ${colors.silverGray}; .flag-icon { margin-right: 11px; } ${({ isWindows }) => isWindows ? '' : `&:before { position: absolute; top: 9px; left: 13px; width: 25px; height: 25px; content: '🗺️'; } ${flagCss()} `}; @media screen and (max-width: ${screen.default}) { margin: auto; } &:hover { background: #aeaeae47; color: ${colors.orange}; } `; <file_sep>import PropTypes from 'prop-types'; import styled from 'styled-components'; import { CountrySettings } from '_comsave/countries'; import { colors, screen } from '_comsave/global-style-variables'; import arrowDown from '_comsave/assets/images/icons/arrow-down-black.svg'; function flagCss() { let css = ''; Object.keys(CountrySettings).forEach(key => { css += `&.${key}::before { content: '${CountrySettings[key].flag}'; }`; }); return css; } const PickListWrapper = styled.div` position: relative; border: 0; display: inline-flex; padding: 0; position: relative; flex-direction: column; vertical-align: top; -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Old versions of Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */ margin-top: 10px; label { text-align: left; display: block; font-size: 12px; height: 19px; font-weight: 600; color: white; } .picklist-content { cursor: pointer; position: relative; display: inline-block; text-align: center; border-radius: 6px; box-sizing: border-box; margin-top: 5px; transition: all 0.4s linear; @media screen and (max-width: ${screen.small}) { margin-top: 22px; } position: relative; border: 0; padding: 0; min-width: auto; min-width: max-content; @media screen and (max-width: ${screen.semiSmall}) { width: 100%; transition: all 0.4s linear; } &.bottom-squared { border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; } height: 45px; color: ${colors.carbonBlack}; background: #ffffff; font-size: 14px; font-weight: 600; text-align: left; line-height: 26px; .selected { transition: all 0.4s linear; text-align: left; height: 100%; width: 100%; outline: none; ${({ isWindows }) => (isWindows ? 'padding: 11px 36px 6px 14px' : 'padding: 11px 36px 6px 40px')}; @media screen and (max-width: ${screen.small}) { ${({ isWindows }) => (isWindows ? 'padding: 15px 36px 12px 14px' : 'padding: 15px 38px 12px')}; } position: relative; background: url(${arrowDown}) no-repeat center right 13px; .flag-icon { margin-right: 11px; } ${({ isWindows }) => isWindows ? '' : ` &:before { position: absolute; top: 12px; @media screen and (max-width: ${screen.small}) { top: 15px; } left: 12px; width: 25px; height: 25px; } ${flagCss()}`}; } .options { text-align: left; display: block; max-height: none; ul { ${({ shortLetters }) => (shortLetters ? 'max-width: 505px;' : 'max-width: 635px;')} display: flex; flex-wrap: wrap; box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.08), 0px 1px 0px rgba(0, 0, 0, 0.08); li { &.space { @media screen and (max-width: ${screen.default}) { display: none; } &:hover { background: white; cursor: default; } } line-height: 160%; min-width: 158px; ${({ isWindows }) => (isWindows ? 'padding: 5px' : 'padding: 7px 0px 6px 35px')}; @media screen and (max-width: ${screen.small}) { ${({ isWindows }) => (isWindows ? 'padding: 15px 36px 12px 14px' : 'padding: 7px 0px 6px 35px')}; } margin: 5px; border-bottom: none; &:hover { background: #f6f6f6; border-radius: 4px; font-size: 14px; color: #172439; } &:before { left: 8px; } flex: 1 1 0; } @media screen and (max-width: ${screen.default}) { max-width: initial; width: 100%; li { min-width: 230px; } } } overflow-y: scroll; position: absolute; z-index: 3; background: #ffffff; line-height: 30px; left: 0; min-width: max-content; transition: all 0.4s linear; box-sizing: border-box; border-radius: 8px; margin-top: 4px; border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 0px, rgba(0, 0, 0, 0.1) 0px 2px 6px, rgba(0, 0, 0, 0.1) 0px 10px 20px; @media screen and (max-width: ${screen.small}) { line-height: 23px; padding-top: 5px; } } @media screen and (max-width: ${screen.small}) { height: 46px; line-height: 16px; top: 1px; &:after { top: 18px; } } } `; PickListWrapper.defaultProps = { small: false, uppercase: false, }; PickListWrapper.propTypes = { small: PropTypes.bool, uppercase: PropTypes.bool, }; export default PickListWrapper; <file_sep>import { defineMessages } from 'react-intl'; export default defineMessages({ nl: { id: 'app.components.CountryPickList.nl', defaultMessage: 'Netherlands', }, be: { id: 'app.components.CountryPickList.be', defaultMessage: 'Belgium', }, ch: { id: 'app.components.CountryPickList.ch', defaultMessage: 'Switzerland', }, de: { id: 'app.components.CountryPickList.de', defaultMessage: 'Germany', }, fr: { id: 'app.components.CountryPickList.fr', defaultMessage: 'France', }, lu: { id: 'app.components.CountryPickList.lu', defaultMessage: 'Luxembourg', }, uk: { id: 'app.components.CountryPickList.uk', defaultMessage: 'United Kingdom', }, es: { id: 'app.components.CountryPickList.es', defaultMessage: 'Spain', }, pl: { id: 'app.containers.OfferSearchBox.pl', defaultMessage: 'Poland', }, cz: { id: 'app.containers.OfferSearchBox.cz', defaultMessage: 'Czech Republic', }, it: { id: 'app.containers.OfferSearchBox.it', defaultMessage: 'Italy', }, }); <file_sep>import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Field } from 'redux-form/immutable'; import { makeSelectLocale } from 'containers/LanguageProvider/selectors'; import FlagImg from 'components/UI/FlagImg'; import { CountrySettings } from '_comsave/countries'; import { FilterName } from './constants'; import PickListWrapper from './PickListWrapper'; import PickListObj from './PickListObj'; import messages from './messages'; export const HiddenInput = ({ input: { ...input }, selected }) => <input type="hidden" value={selected} />; HiddenInput.propTypes = { input: PropTypes.object.isRequired, selected: PropTypes.string, }; export const checkLanguage = lang => lang === 'en' || lang === 'es'; export class DesktopPickList extends React.PureComponent { constructor(props) { super(props); this.state = { open: false, isWindows: navigator.platform.indexOf('Win') > -1, }; } onToggle = () => { document.querySelector('#content-box-wrapper').classList.toggle('reset-content-box'); this.setState({ open: !this.state.open, }); }; onClick = (e, key) => { e.preventDefault(); this.props.onSelect(key); this.onToggle(); }; render() { const { selected, name, children, childLocation, label, locale } = this.props; const { open, isWindows } = this.state; const { intl: { formatMessage }, } = this.context; const picklistClassName = name ? `${name} picklist-content` : 'picklist-content'; return ( <PickListWrapper {...this.props} isWindows={isWindows} shortLetters={checkLanguage(locale)} > {label && <label htmlFor={label}> {label} :</label>} <div className={picklistClassName}> <div className={`selected ${selected}`} onClick={this.onToggle} role="button" tabIndex="0"> {isWindows && <FlagImg country={selected} />} {formatMessage(messages[selected])} </div> {open && ( <PickListObj selected={selected} items={CountrySettings} onClick={this.onClick} childLocation={childLocation} isWindows={isWindows} > {children} </PickListObj> )} </div> <Field name={FilterName} selected={selected} component={HiddenInput} /> </PickListWrapper> ); } } DesktopPickList.contextTypes = { intl: PropTypes.object.isRequired, }; DesktopPickList.defaultProps = { selected: 'nl', }; export const mapStateToProps = state => ({ locale: makeSelectLocale()(state), }); const withConnect = connect( mapStateToProps, null, ); DesktopPickList.propTypes = { selected: PropTypes.string.isRequired, onSelect: PropTypes.func.isRequired, name: PropTypes.string, childLocation: PropTypes.string, children: PropTypes.node, label: PropTypes.string, locale: PropTypes.string, }; export default withConnect(DesktopPickList); <file_sep>import React from 'react'; import PropTypes from 'prop-types'; import FlagImg from 'components/UI/FlagImg'; import messages from './messages'; import PickListItem from './PickListItem'; export const PickListObj = ({ selected, items, onClick, childLocation, isWindows, children }, { intl: { formatMessage } }) => ( <div className="options"> {children && childLocation !== 'end' ? children : ''} <ul> {Object.keys(items) .sort((a, b) => (formatMessage(messages[a]) > formatMessage(messages[b]) ? 1 : -1)) .map(key => ( <PickListItem isWindows={isWindows} key={`picklist-item-${key}`} className={selected === key ? `active ${selected}` : key} onClick={e => onClick(e, key)} > {isWindows && <FlagImg country={key} />} {formatMessage(messages[key])} </PickListItem> ))} {Object.keys(items).length % 3 !== 0 && <li className="space" />} {Object.keys(items).length % 3 === 1 && <li className="space" />} </ul> {children && childLocation === 'end' ? children : ''} </div> ); PickListObj.defaultProps = { isWindows: false, }; PickListObj.contextTypes = { intl: PropTypes.object.isRequired, }; PickListObj.propTypes = { selected: PropTypes.string.isRequired, items: PropTypes.object.isRequired, onClick: PropTypes.func.isRequired, childLocation: PropTypes.string, children: PropTypes.node, isWindows: PropTypes.bool, }; export default PickListObj; <file_sep>import React from 'react'; import { shallow } from 'enzyme'; import 'jest-styled-components'; import PickListItem from '../PickListItem'; describe('<PickListItem />', () => { it('expect to match snapshot', () => { expect(shallow(<PickListItem>child</PickListItem>)).toMatchSnapshot(); }); it('expect to match snapshot', () => { expect(shallow(<PickListItem isWindows>child</PickListItem>)).toMatchSnapshot(); }); }); <file_sep>import styled from 'styled-components'; import { colors, screen } from '_comsave/global-style-variables'; import arrowDown from '_comsave/assets/images/icons/arrow-down-black.svg'; const PickListWrapper = styled.div` position: relative; border: 0; display: inline-flex; padding: 0; position: relative; min-width: auto; flex-direction: column; vertical-align: top; margin-top: 10px; label { text-align: left; display: block; font-size: 12px; font-weight: 600; color: white; } .select-wrapper{ position: relative; box-sizing: border-box; select { display: block; background: hsla(0,0%,100%,.8); background-clip: padding-box; cursor: pointer; position: relative; display: inline-block; text-align: left; border-radius: 6px; box-sizing: border-box; margin-top: 5px; -webkit-appearance: none; position: relative; border: 0; padding: 7px 35px 6px 15px; min-width: auto; width: 100%; &.bottom-squared { border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; } height: 45px; color: ${colors.carbonBlack}; background: #ffffff; font-size: 16px; font-weight: 600; text-align: left; line-height: 26px; } select:focus{font-size: 16px; } option{ font-size: 14px; text-align: left; text-align: -moz-left; text-align: -webkit-left; } .down-icon{ top: 15px; right: 12px; display: block; pointer-events: none; color: #888; font-size: 21px; font-weight: 300; line-height: 0; position: absolute; &:after{ content: ""; width: 25px; height: 25px; background: url(${arrowDown}) no-repeat center center; color: inherit; display: inline-block; font-style: normal; font-weight: inherit; font-size: inherit; line-height: 1; text-decoration: underline; position: relative; z-index: 1; alt: ""; text-decoration: none; } } } @media screen and (max-width: ${screen.small}) { height: 68x; line-height: 16px; top: 1px; } } `; export default PickListWrapper; <file_sep>import React from 'react'; import { shallow } from 'enzyme'; import { fromJS } from 'immutable'; import intl from '_comsave/mocks/intl'; import { mapStateToProps, HiddenInput, checkLanguage, DesktopPickList } from '../DesktopPickList'; const minProps = { onSelect: () => {}, selected: 'uk', items: { nl: 'First', uk: 'Second', }, }; const HiddenInputProps = { input: {}, selected: '1' }; const maxProps = { onSelect: jest.fn(), selected: 'nl', items: { nl: 'First', uk: 'Second', }, name: 'Account', label: 'name', }; describe('<DesktopPickList />', () => { let userAgentGetter; beforeEach(() => { userAgentGetter = jest.spyOn(window.navigator, 'userAgent', 'get'); }); it('should match the expected output for mapStateToProps', () => { const state = fromJS({ language: { locale: 'nl', }, }); const expectedResult = { locale: 'nl', }; expect(mapStateToProps(state)).toEqual(expectedResult); }); it('expect to match snapshot first', () => { userAgentGetter.mockReturnValue('Mac'); const wrapper = shallow(<DesktopPickList {...minProps} />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot window', () => { userAgentGetter.mockReturnValue('Win'); const wrapper = shallow(<DesktopPickList {...minProps} />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match snapshot input', () => { expect(shallow(<HiddenInput {...HiddenInputProps} />)).toMatchSnapshot(); }); it('expect to match snapshot max props', () => { const wrapper = shallow(<DesktopPickList {...maxProps} />, { context: { intl }, }); expect(wrapper).toMatchSnapshot(); }); it('expect to match checkLanguage', () => { const country = 'nl'; expect(checkLanguage(country)).toEqual(false); }); it('expect to match checkLanguage', () => { const country = 'es'; expect(checkLanguage(country)).toEqual(true); }); }); <file_sep>import React from 'react'; import { shallow } from 'enzyme'; import CountryPickList from '../index'; const maxProps = { onClick: () => {}, selected: 'first', items: { first: 'First', second: 'Second', }, childLocation: 'end', }; describe('<CountryPickList />', () => { let userAgentGetter; beforeEach(() => { userAgentGetter = jest.spyOn(window.navigator, 'userAgent', 'get'); }); it('should do thing 1', () => { userAgentGetter.mockReturnValue('Android'); expect(shallow(<CountryPickList {...maxProps} />)).toMatchSnapshot(); }); it('should do thing 1', () => { userAgentGetter.mockReturnValue('Window'); expect(shallow(<CountryPickList {...maxProps} />)).toMatchSnapshot(); }); });
19a951d4e3f03dbeb40176e404a3de28468c704f
[ "Markdown", "JavaScript" ]
13
Markdown
blee-nl/country-selector
6a0ef7c05e3b4155f4a87aa7a75c4244a6d56a21
5725796a856563a69db56c84e1d0b7a4ff1dc5a5
refs/heads/master
<repo_name>MrLalev/graphql-demo<file_sep>/README.md # graphql-demo *GraphQL demo application for mastering best practices of the technology.* ## Environment setup and configuration: - Docker - Create .env file based on .dist.env - Make sure you use allowed and not used ports for SERVER_PORT and DB_URL ## Build process: - docker-compose build - docker-compose up - open GraphQL Playground on http://localhost:${SERVER_PORT}/graphql for testing <file_sep>/src/server.js console.log('server works!');
3466d83a77a2592551b4898d8c86574d9983a6c2
[ "Markdown", "JavaScript" ]
2
Markdown
MrLalev/graphql-demo
f4149cb381a9dc617837d5d82ba63be46cce4ec6
20567b970be2f25398e15330ac116f114dd8410b
refs/heads/master
<repo_name>Bob1993/SwipeRefreshwithLoadmore<file_sep>/README.md # SwipeRefreshwithLoadmore 给官方的下拉刷新控件添加触底加载功能。。。更应该说给触底加载的listview添加下拉刷新功能(其实也就是二者的组合) <file_sep>/src/main/java/com/bob/loadmore/MainActivity.java package com.bob.loadmore; import com.bob.loadmore.widgets.LoadMoreListView; import com.bob.loadmore.widgets.LoadMoreListView.OnLoadMoreListener; import android.app.Activity; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import android.os.AsyncTask; import android.os.Bundle; /** * 分析开源项目 */ public class MainActivity extends Activity implements OnRefreshListener, OnLoadMoreListener { private SwipeRefreshLayout swipeLayout; //系统带的下拉刷新控件 private LoadMoreListView listView; //具有上拉加载的ListView private MyAdapter adapter; //数据适配器 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); swipeLayout = (SwipeRefreshLayout) this.findViewById(R.id.swipe_refresh); swipeLayout.setOnRefreshListener(this);//下拉组件的事件监听 // set style for swipeRefreshLayout swipeLayout.setColorSchemeResources(android.R.color.holo_red_light, android.R.color.holo_green_light, android.R.color.holo_blue_bright, android.R.color.holo_orange_light); listView = (LoadMoreListView) this.findViewById(R.id.listview); listView.setOnLoadMoreListener(this);//为listView添加加载监听 adapter = new MyAdapter(); listView.setAdapter(adapter);//设置数据适配器 } @Override public void onRefresh() {//下拉监听 new AsyncTask<Void, Void, Void>() {//创建一个异步任务 @Override protected Void doInBackground(Void... params) {//在子线程中的任务逻辑处理功能 try { Thread.sleep(3 * 1000); //sleep 3 seconds } catch (InterruptedException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) {//任务处理结束后的UI更新方法,此时运行在主线程中 adapter.count = 15; adapter.notifyDataSetChanged(); swipeLayout.setRefreshing(false); listView.setCanLoadMore(adapter.count < 45); super.onPostExecute(result); } }.execute(); } @Override public void onLoadMore() {//上拉监听 new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { Thread.sleep(3 * 1000); //sleep 3 seconds } catch (InterruptedException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) { adapter.count += 15; adapter.notifyDataSetChanged(); listView.setCanLoadMore(adapter.count < 45); listView.onLoadMoreComplete(); super.onPostExecute(result); } }.execute(); } private class MyAdapter extends BaseAdapter { public int count = 5; @Override public int getCount() { return count; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null;//灵感来自《第一行代码》 if (convertView == null) { holder = new ViewHolder(); convertView = LayoutInflater.from(MainActivity.this).inflate(android.R.layout.simple_list_item_1, null); holder.textV = (TextView) convertView.findViewById(android.R.id.text1); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.textV.setText("This is " + (position + 1) + " line."); return convertView; } private class ViewHolder { TextView textV; } } }
5408ea41b767582f400e545c556966ffa2782b7a
[ "Java", "Markdown" ]
2
Java
Bob1993/SwipeRefreshwithLoadmore
70a75dd539b8d5a0714971f77320db484fb8a3d0
ee3d8a03facbe5dc63e706676dc0e3b46dc27b59
refs/heads/master
<file_sep><template> <div class="header"> <div class="seller-info"> <div class="avatar"><img width="64" height="64" src="http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg"></div> <div class="content"> <div class="title"> <span class="brand"></span> <span class="name">粥品香坊(回龙观)</span> </div> <p class="desc">蜂鸟专送/38分钟送达</p> <p class="support"><span class="icon decrease"></span><span class="text">在线支付满28减5</span></p> </div> <div class="support-count"><span class="count">5个</span><i class="icon-arrow-right"></i></div> </div> <div class="bulletin-wrapper"> <span class="icon-bulletin"></span> <span class="bulletin-content">粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。坚守纯天然、0添加的良心品质深得消费者青睐,发展至今成为粥类的引领品牌。是2008年奥运会和2013年园博会指定餐饮服务商。</span> <span class="icon-arrow-right"></span> </div> <div class="background"><img src="http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg" alt="background"></div> </div> </template> <style> .header{ position: relative; overflow: hidden; background: rgba(7,17,27,0.5); color: #fff; } .header .seller-info{ position: relative; z-index: 11; padding: 24px 12px 18px 24px; background: rgba(7,17,27,0.4); } .header .seller-info .avatar{ display: inline-block; vertical-align: top; } .header .seller-info .content{ display: inline-block; margin-left: 16px; } .header .seller-info .content .title{ margin: 2px 0 8px 0; } .header .seller-info .content .title .name{ margin-left: 6px; font-size: 16px; line-height: 18px; font-weight: bold; } .header .seller-info .content .desc{ margin-bottom: 10px; line-height: 12px; font-size: 12px; } .header .seller-info .content .support { line-height: 12px; font-size: 10px; } .header .seller-info .support-count{ position: absolute; right: 12px; bottom: 14px; padding: 0 8px; height: 24px; line-height: 24px; border-radius: 14px; background: rgba(0,0,0,0.2); text-align: center; } .header .seller-info .support-count .count{ vertical-align: top; font-size: 10px; } .header .background{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; -webkit-filter: blur(10px); filter: blur(10px); } .header .background img{ width: 100%; height: 100%; } .header .bulletin-wrapper{ position: relative; z-index: 11; height: 28px; line-height: 28px; padding: 0 22px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(7,17,27,0.5); } .header .bulletin-wrapper .bulletin-content{ vertical-align: top; margin: 0 4px; font-size: 10px; } </style><file_sep>/* * @Author: anchen * @Date: 2016-11-23 18:02:22 * @Last Modified by: anchen * @Last Modified time: 2016-11-23 19:48:33 */ (function(win){ window.onload = function(){ var prev = document.getElementById('prev'), next = document.getElementById('next'), slide = document.getElementById('slide'), rotateNum = 0; prev.onclick = function(){ rotateNum += 40; slide.style.transform = 'rotateY(' + rotateNum + 'deg)'; } next.onclick = function(){ rotateNum -= 40; slide.style.transform = 'rotateY(' + rotateNum + 'deg)'; } } })(window || {})<file_sep><div ms-include="'assets/tpl/front/list.tpl'" data-include-cache="true"></div><file_sep><div ms-controller="front"> <div ms-include="template" data-include-cache="true"></div> </div> <file_sep>var loading = (function(){ function Progressbar(){ this.width = 0; this.height = 0; this.hue = 0; } function start(){ } return start; })();<file_sep># math 解决数据加减乘除精度丢失问题 <file_sep><template> <div id="app"> <v-header></v-header> <div class="tab"> <div class="item"> <router-link to="/goods" v-bind:class="">商品</router-link> </div> <div class="item"> <router-link to="/ratings" v-bind:class="">评论</router-link> </div> <div class="item"> <router-link to="/seller" v-bind:class="">商家</router-link> </div> </div> <router-view></router-view> </div> </template> <script> import header from './components/header'; export default { components: { 'v-header': header } } </script> <style> /*重设浏览器样式*/ a, body, div, header, html, img, p, span, ul{ border: none; margin: 0;padding: 0; border: 0;outline:0; -webkit-text-size-adjust: none; -webkit-tap-highlight-color: rgba(0,0,0,0); } html, body{ height: 100%; font-family: 'PingFang SC', 'STHeitiSC-Light', 'Helvetica-Light', arial, sans-serif; color: #4f5050; background: #fff; } .tab{ display: -webkit-box; display: -ms-flexbox; display: flex; width: 100%; height: 40px; line-height: 40px; position: relative; } .tab:after{ display: block; position: absolute; left: 0; bottom: 0; width: 100%; border-top: 1px solid rgba(7,17,27,0.1); content: ' '; } .tab .item{ -webkit-box-flex: 1; -ms-flex: 1; flex: 1; text-align: center; } .tab .item > a{ display: block; font-size: 14px; color: #4d555d; } .tab .item > a.active{ color: #f01414; } </style> <file_sep>//index.js var util = require('../../utils/util.js'); //获取应用实例 var app = getApp() Page({ data: { voices: [] }, //按下开始录音 startRecorder: function() { var _this = this; console.log('开始录音'); wx.startRecord({ success: function(res){ // success //临时路径,下次进入小程序时无法正常使用 var tempFilePath = res.tempFilePath console.log("tempFilePath: " + tempFilePath) //持久保存 wx.saveFile({ tempFilePath: tempFilePath, success: function (res) { //持久路径 //本地文件存储的大小限制为 100M var savedFilePath = res.savedFilePath; } }) wx.showToast({ title: '恭喜!录音成功', icon: 'success', duration: 1000 }); wx.getSavedFileList({ success: function(res){ // success console.log('获取列表'); var voices = [], len = res.fileList.length; for(var i = 0; i<len; i++){ //格式化时间 var createTime = util.formatTime(new Date(res.fileList[i].createTime)); //将音频大小B转为KB var size = (res.fileList[i].size / 1024).toFixed(2); var voice = { filePath: res.fileList[i].filePath, createTime: createTime, size: size }; voices = voices.concat(voice); _this.setData({ voices: voices }); } } }) }, fail: function() { // fail wx.showModal({ title: '提示', content: '录音的姿势不对!', showCancel: false, success: function (res) { if (res.confirm) { console.log('用户点击确定') return } } }) } }) }, stopRecorder: function(){ console.log('结束录音'); wx.stopRecord(); }, gotoPlay: function (e) { var filePath = e.currentTarget.dataset.key; //点击开始播放 wx.showToast({ title: '开始播放', icon: 'success', duration: 1000 }) wx.playVoice({ filePath: filePath, success: function () { wx.showToast({ title: '播放结束', icon: 'success', duration: 1000 }) } }) }, onLoad: function () { var _this = this; // wx.getSavedFileList({ // success: function(res){ // // success // var voices = [], // len = res.fileList.length; // for(var i = 0; i<len; i++){ // //格式化时间 // var createTime = new Date(res.fileList[i].createTime); // //将音频大小B转为KB // var size = (res.fileList[i].size / 1024).toFixed(2); // var voice = { filePath: res.fileList[i].filePath, createTime: createTime, size: size }; // voices = voices.concat(voice); // _this.setData({ // voices: voices // }); // } // } // }) wx.getSavedFileList({ success: function(res) { for(var i = 0; i< res.fileList.length > 0; i++){ wx.removeSavedFile({ filePath: res.fileList[i].filePath, complete: function(res) { console.log(res) } }) } } }) } }) <file_sep>$(document).ready(function(){ var $p1 = $('.p1'), $p2 = $('.p2'), $p3 = $('.p3'), $p4 = $('.p4'); //第一页动画 var pageOne = function(index){ $p1.find('div.v-line:odd').animate({'height': '100%'},800); $p1.find('div.h-line:odd').animate({'width': '100%'},800); $p1.find('div.v-line:even').delay(400).animate({'height': '100%'},1200); $p1.find('div.h-line:even').delay(400).animate({'width': '100%'},1200); $p1.find('.h-wrap img').delay(1500).animate({'opacity': 1},400); $p1.find('.arrow-wrap .next').delay(2000).animate({'opacity': 1},400); } //第二页动画 var pageTwo = function(index){ //第一部分 $p2.find('.v-line .line1').animate({'height': '100%'},200); $p2.find('.h-line .line5').delay(100).animate({'width': '100%'},200); $p2.find('.v-line .line10').delay(200).animate({'height': '100%'},200); $p2.find('.h-line .line6').delay(300).animate({'width': '100%'},200); $p2.find('.rect-wrap .rect1').delay(400).animate({'opacity': 0.1},200); //第二部分 $p2.find('.v-line .line2').delay(400).animate({'height': '100%'},200); $p2.find('.h-line .line1').delay(500).animate({'width': '100%'},200); $p2.find('.v-line .line9').delay(600).animate({'height': '100%'},200); $p2.find('.h-line .line10').delay(700).animate({'width': '100%'},200); $p2.find('.rect-wrap .rect2').delay(800).animate({'opacity': 0.1},200); //第三部分 $p2.find('.v-line .line3').delay(800).animate({'height': '100%'},200); $p2.find('.h-line .line4').delay(900).animate({'width': '100%'},200); $p2.find('.v-line .line8').delay(1000).animate({'height': '100%'},200); $p2.find('.h-line .line7').delay(1100).animate({'width': '100%'},200); $p2.find('.rect-wrap .rect3').delay(1200).animate({'opacity': 0.1},200); //第四部分 $p2.find('.v-line .line4').delay(1200).animate({'height': '100%'},200); $p2.find('.h-line .line3').delay(1300).animate({'width': '100%'},200); $p2.find('.v-line .line7').delay(1400).animate({'height': '100%'},200); $p2.find('.h-line .line8').delay(1500).animate({'width': '100%'},200); $p2.find('.rect-wrap .rect4').delay(1600).animate({'opacity': 0.1},200); //第五部分 $p2.find('.v-line .line5').delay(1600).animate({'height': '100%'},300); $p2.find('.h-line .line2').delay(1700).animate({'width': '100%'},300); $p2.find('.v-line .line6').delay(1800).animate({'height': '100%'},300); $p2.find('.h-line .line9').delay(1900).animate({'width': '100%'},300); $p2.find('.rect-wrap .rect5').delay(2000).animate({'opacity': 0.1},300); //第六部分(合字部分) $p2.find('.pro-item1 .circle').delay(2000).animate({'opacity': 1},500); $p2.find('.pro-item1 .txt').delay(2200).animate({'opacity': 1},300); $p2.find('.pro-item1 .line').delay(2400).animate({'width': '100%'},300); $p2.find('.pro-item2 .circle').delay(2600).animate({'opacity': 1},500); $p2.find('.pro-item2 .txt').delay(2800).animate({'opacity': 1},300); $p2.find('.pro-item2 .line').delay(3000).animate({'width': '100%'},300); $p2.find('.pro-item3 .circle').delay(3200).animate({'opacity': 1},500); $p2.find('.pro-item3 .txt').delay(3400).animate({'opacity': 1},300); $p2.find('.pro-item3 .line').delay(3800).animate({'width': '100%'},300); $p2.find('.pro-item4 .circle').delay(4000).animate({'opacity': 1},500); $p2.find('.pro-item4 .txt').delay(4200).animate({'opacity': 1},300); $p2.find('.project .bg').delay(4600).animate({'opacity': 1},500); } //第三页动画 var pageThree = function(index){ //第一部分 $p3.find('.v-wrap .line:odd').animate({'height': '100%'},800); $p3.find('.h-wrap .line:odd').animate({'width': '100%'},800); //第二部分 $p3.find('.v-wrap .line:even').delay(400).animate({'height': '100%'},1200); $p3.find('.h-wrap .line:even').delay(400).animate({'width': '100%'},1200); //第三部分 $p3.find('.diamond-wrap .diamond1').delay(1500).animate({'opacity': 1},600); $p3.find('.diamond-wrap .diamond2').delay(1800).animate({'opacity': 1},600); $p3.find('.diamond-wrap .diamond3').delay(2100).animate({'opacity': 1},600); $p3.find('.diamond-wrap .diamond4').delay(2400).animate({'opacity': 1},600); $p3.find('.diamond-wrap .diamond5').delay(2700).animate({'opacity': 1},600); $p3.find('.diamond-wrap .diamond6').delay(3000).animate({'opacity': 1},600); } //第三页动画 var pageFour = function(){ //第一部分 $p4.find('.v-wrap .line:odd').animate({'height': '100%'},800); $p4.find('.h-wrap .line:odd').animate({'width': '100%'},800); //第二部分 $p4.find('.v-wrap .line:even').delay(400).animate({'height': '100%'},1200); $p4.find('.h-wrap .line:even').delay(400).animate({'width': '100%'},1200); //第三部分 $p4.find('.btn-wrap .qrCode').delay(1500).animate({'opacity': 1},600); $p4.find('.btn-wrap .btn-syb').delay(1800).animate({'opacity': 1},600); $p4.find('.btn-wrap .btn-more').delay(2100).animate({'opacity': 1},600); } //设置p3 v-wrap 位置修正 var setVerticalWrap = function(){ var winWidth = $(window).width(), initWidth = 1920, moz = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 ? true : false; $('.p3 .h-wrap').css({'left': -(initWidth - winWidth)/1.8}); //竖线框位置不正确,和其他浏览器不一致(仅firefox) if(moz){ $('.p3 .v-wrap').css({'top': -480}); } } $(window).resize(function(){ setVerticalWrap(); }); //全屏滚动插件初始化 $('#main').fullpage({ afterLoad: function(anchorLink, index){ switch(index){ case 1: pageOne(); break; case 2: pageTwo(); break; case 3: pageThree(); break; case 4: pageFour(index); break; //default } }, afterRender: function(){ setVerticalWrap(); }, }); //首屏点击跳到下一页 $('a.next').on('click', function(){ $.fn.fullpage.moveSectionDown(); }); //点击出现创业者弹窗 $('.btn-syb').on('click', function(){ $('.popup').show(); }); //点击表单以外区域弹窗消失 $('.popup .mask').on('click', function(){ $('.popup').hide(); }); //我是创业者hover $('.btn-syb').hover( function(){ $(this).find('img').attr('src','assets/images/btn-syb-hover.png'); }, function(){ $(this).find('img').attr('src','assets/images/btn-syb.png'); }); //了解更多hover $('.btn-more').hover( function(){ $(this).find('img').attr('src','assets/images/btn-more-hover.png'); }, function(){ $(this).find('img').attr('src','assets/images/btn-more.png'); }); //获得焦点placeholder消失 var placeholderText = ''; $('.popup input, .popup textarea').focus(function(){ placeholderText = $(this).attr('placeholder'); $(this).attr('placeholder', ''); }); //失去焦点placeholder显示 $('.popup input, .popup textarea').blur(function(){ $(this).attr('placeholder', placeholderText); }); });<file_sep>(function(){ window.onload = function(){ var cube = document.getElementById('cube'), startX = 0, startY = 0, endX = 0, endY = 0, distanceX = 0, distanceY = 0, rotateY = 0, rotateX = 0, rotateZ = 0; var getDistance = function(distanceX, distanceY){ return Math.sqrt(Math.pow(distanceX, 2) + Math.pow(distanceY, 2)); } cube.addEventListener('touchstart', function(e){ startX = e.touches[0].clientX; startY = e.touches[0].clientY; }); cube.addEventListener('touchmove', function(e){ endX = e.touches[0].clientX; endY = e.touches[0].clientY; distanceX = endX - startX; distanceY = endY - startY; }); cube.addEventListener('touchend', function(e){ if(distanceX > 0 && Math.abs(distanceX) > Math.abs(distanceY)){ //向右滑动 rotateY += 90; } if(distanceX < 0 && Math.abs(distanceX) > Math.abs(distanceY)){ //向左滑动 rotateY -= 90; } if(distanceY < 0 && Math.abs(distanceY) > Math.abs(distanceX)){ //向上滑动 rotateX += 90; } if(distanceY > 0 && Math.abs(distanceY) > Math.abs(distanceX)){ //向下滑动 rotateX -= 90; } this.style.transform = 'rotateX('+ rotateX +'deg) rotateY('+ rotateY + 'deg) rotateZ('+ rotateZ +'deg)'; }); } })(); <file_sep>@charset "utf-8"; html, body{ position: relative; width: 100%; max-width: 750px; height: 100%; } @media screen and (max-width: 320px) { html { font-size: 42.8px } } @media screen and (min-width: 320px) { html { font-size: 42.67px } } @media screen and (min-width: 360px) { html { font-size: 48px } } @media screen and (min-width: 375px) { html { font-size: 50px } } @media screen and (min-width: 385px) { html { font-size: 51.33px } } @media screen and (min-width: 400px) { html { font-size: 53.33px } } @media screen and (min-width: 414px) { html { font-size: 55.2px } } @media screen and (min-width: 450px) { html { font-size: 60px } } @media screen and (min-width: 480px) { html { font-size: 64px } } @media screen and (min-width: 540px) { html { font-size: 72px } } @media screen and (min-width: 600px) { html { font-size: 80px } } @media screen and (min-width: 640px) { html { font-size: 85.33px } } @media screen and (min-width: 750px) { html { font-size: 100px } } /*--------------------功能: 重设浏览器默认样式 START--------------------*/ a, body, dd, dl, div, dt, em, form, h1, h2, h3, h4, h5, h6, header, html,i, img, label, li, ol, p, small, span, strong, table, tbody, tfoot, thead, th, tr, tt, u, ul{ border: none; margin: 0;padding: 0; border: 0;outline:0; -webkit-text-size-adjust: none; -webkit-tap-highlight-color: rgba(0,0,0,0); } table, table td { padding: 0; border: none;} img {border: 0;} ul, li, ol, dl, dd{ list-style-type: none;} input, textarea, select { outline: none; padding: 0; margin: 0;} h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight:bold; } body { text-align: left;color: #434343;overflow-x: hidden; background-color: #eee; } html,body{ font-family: "microsoft yahei"; color: #434343; } a{text-decoration: none; color: #434343; } input,input[type="button"], input[type="submit"], input[type="reset"],input[type="number"] {-webkit-appearance: none; border: none; box-sizing: border-box; -webkit-box-sizing: border-box; } input::-webkit-inner-spin-button { -webkit-appearance: none; } input::-webkit-outer-spin-button { -webkit-appearance: none; } img { border: none; display: block; } /* img 搭车:让链接里的 img 无边框 */<file_sep># md5 加密组件 可对普通字符串和文件计算其对应的md5值。 组件符合AMD规范, 可使用require引入 ### demo: ```javascript require(['./md5'], function(SparkMD5){ var Spark = new SparkMD5() var md5 = function(cont){ return Spark.sign.call(Spark, cont) } var file = /*...*/ //文件表单获取 var fs = new FileReader() // Chrome, IE9+, FF, Safari fs.readAsBinaryString(file) fs.onload = function(){ // 计算该文件的md5签名 var sign = md5(this.result) } }) ``` <file_sep>/** * @author zenghongcong * api配置 */ import axios from 'axios'; let url = 'static/data.json'; export default { getData: function(cb){ axios.get(url).then(function(res){ if(res.status >= 200 && res.status < 300){ cb(res.data) } }).catch((error) => { return Promise.reject(error) }) } } <file_sep>;(function(win){ function Slider(elemId) { this.curPage = 1; this.elem = document.querySelector(elemId); this.tipsElem = document.querySelectorAll('#tips li'); this.slider = this.elem.querySelector('.slider'); this.elemWidth = this.elem.offsetWidth; this.timeInterval = Date.now(); this.timer = null; this.init(); } Slider.prototype.init = function() { this.setDom(); this.bindEvent(); } Slider.prototype.setDom = function() { var items = this.slider.querySelectorAll('li'), len = items.length, firstChild = items[0].cloneNode(true), lastChild = items[len - 1].cloneNode(true); this.nodeLength = len; this.slider.style.width = (len + 2) * this.elemWidth + 'px'; this.slider.insertBefore(lastChild, items[0]); this.slider.appendChild(firstChild); this.slider.style.transform = 'translateX(' + -this.elemWidth + 'px)'; } Slider.prototype.bindEvent = function() { var prev = document.querySelector('#prev'), next = document.querySelector('#next'), tips = this.tipsElem, _this = this; if(prev) { prev.addEventListener('click', function(e) { _this.prev(); }) } if(next) { next.addEventListener('click', function(e) { _this.next(); }) } if(tips.length > 0) { tips.forEach(function(item, index) { item.addEventListener('click', function(e) { _this.toPage(index + 1); }); }); } } Slider.prototype.toPage = function(page) { if(this.nodeLength < page) { return console.warn('要跳转的页面不存在!'); } this.curPage = page; this.slider.classList.add('transition'); this.slider.style.transform = 'translateX(' + -this.elemWidth * this.curPage + 'px)'; } Slider.prototype.next = function() { var _this = this; if(Date.now() - this.timeInterval < 500) { if(this.curPage === this.nodeLength + 1) { return; } clearTimeout(this.timer); } this.timeInterval = Date.now(); this.slider.classList.add('transition'); this.curPage++; this.slider.style.transform = 'translateX(' + -this.elemWidth * this.curPage + 'px)'; if(this.curPage === this.nodeLength + 1) { this.timer = setTimeout(function() { _this.slider.classList.remove('transition'); _this.slider.style.transform = 'translateX(' + -_this.elemWidth + 'px)'; _this.curPage = 1; this.timeInterval = Date.now(); }, 500) } } Slider.prototype.prev = function() { var _this = this; if(Date.now() - this.timeInterval < 500) { if(this.curPage === 0) { return; } clearTimeout(this.timer); } this.timeInterval = Date.now(); this.slider.classList.add('transition'); this.curPage--; this.slider.style.transform = 'translateX(' + -this.elemWidth * this.curPage + 'px)'; if(this.curPage === 0) { this.timer = setTimeout(function() { _this.slider.classList.remove('transition'); _this.slider.style.transform = 'translateX(' + -_this.elemWidth * _this.nodeLength + 'px)'; _this.curPage = _this.nodeLength; }, 500) } } win.Slider = Slider; })(window); <file_sep>'use strict' define(['avalon','css!./alertui'],function(av){ var layer var offset av.component('ms:alert',{ $replace: true, title: '', html: '', type: 4, layerId: '', $callback: {}, yes: av.noop, close: av.noop, $template: '<div><div id="layer" class="do-ui-layer" ms-if="type <= 2"><span class="do-ui-layer-title do-fn-noselect">{{title}}<a class="do-ui-layer-close iconfont" href="javascript:;" ms-click="close">╳</a></span><div class="do-ui-layer-content do-fn-noselect" id="layer-content" ms-html="html"></div><div class="do-ui-layer-group-btn do-fn-noselect" ms-if="type == 2"><a href="javascript:;" class="do-ui-layer-btn do-ui-layer-yes" ms-click="yes">确定</a><a href="javascript:;" class="do-ui-layer-btn do-ui-layer-no" ms-click="close">取消</a></div></div><div class="do-ui-layer-shade" ms-if="type <= 3" ms-click="close"></div><div ms-if="type == 3" class="do-ui-layer-loading"><span class="point point1"></span><span class="point point2"></span><span class="point point3"></span><span class="point point4"></span></div><div>', $construct: function(opts, config, other){ var vm = av.mix(config, other) return av.mix(opts, vm) }, $init: function(vm, ele){ vm.alert = function(html,callback){ vm.type = 1 vm.html = html vm.$callback['no'] = callback ? callback : null } vm.confirm = function(html,yes,no){ vm.type = 2 vm.html = html vm.$callback['yes'] = yes ? yes : null vm.$callback['no'] = no ? no : null } vm.loading = function(callback){ vm.type = 3 vm.$callback.callback = callback } vm.close = function(ev){ vm.html = '' if(vm.$callback['no']){ vm.$callback['no']() delete vm.$callback['no'] } vm.$callback = {} vm.type = vm.type == 3 ? 3 : 4 } vm.yes = function(){ vm.$callback['yes'] && vm.$callback['yes']() vm.$callback['yes'] = null } vm.$watch('type',function(t){ if(t <= 2) getLayerPosition() }) window.onresize = function(){ getLayerPosition() } function getLayerPosition(){ av.nextTick(function(){ var vw,vh,x,y layer = document.getElementById('layer') if(vm.type <= 2){ vw = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth vh = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight x = (vw - layer.offsetWidth) / 2 y = (vh - layer.offsetHeight) / 2 } layer.style.transform = 'translate(' + x + 'px,' + y + 'px)' }) } } }) function move(ev){ if(ev.type != 'contextmenu'){ var mx = ev.pageX - av(layer).data('ox') var my = ev.pageY - av(layer).data('oy') var curLeft = mx + (offset[0] >> 0) var curTop = my + (offset[1] >> 0) layer.style.transform = 'translate(' + curLeft + 'px,' + curTop + 'px)' } } document.addEventListener('mousedown',function(ev){ if(ev.type != 'contextmenu'){ layer = ev.target.offsetParent if(layer && /do-ui-layer-title/.test(ev.target.className)){ offset = layer.style.transform.replace(/[^\d,.]/g,'').split(',') av(layer).data('ox',ev.pageX) av(layer).data('oy',ev.pageY) document.addEventListener('mousemove',move) } } }) document.addEventListener('mouseup',function(){ document.removeEventListener('mousemove',move) offset = layer = null }) document.addEventListener('contextmenu',function(){ document.removeEventListener('mousemove',move) offset = layer = null }) return av })<file_sep>/** * @author Insect * @description javascript常用算法 */ //冒泡排序 function bubbleSort(arr){ var len = arr.length, temp, i = 0, j; for(; i < len; i++){ for(j = 0; j < len - i; j++){ if(arr[j] > arr[j+1]){ temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; } } } return arr; } //选择排序 function selectionSort(arr){ var i = 0, j, len = arr.length, temp, minIndex; for(; i < len-1; i++){ minIndex = i; for(j = i+1; j < len; j++){ if(arr[minIndex] > arr[j]){ minIndex = j; } } temp = arr[i]; arr[i] = arr[minIndex]; arr[minIndex] = temp; } return arr; } //插入排序 //function insertionSort(arr){ // var i = 0, j, temp; // for(;;){ // for(;;){ // // } // } // return arr; //} //字符串中出现次数最多的单个字符 function findMaxDuplicateChar(str){ var len = str.length, paramObj = {}, i = 0, maxStr = '', maxValue = 1; if(len <= 1){ return str } for(; i < len; i++){ if(!paramObj[str.substr(i,1)]){ paramObj[str.substr(i,1)] = 1; }else{ paramObj[str.substr(i,1)]++ } } for(var k in paramObj){ if(paramObj[k] > maxValue){ maxValue = paramObj[k]; maxStr = k; } } return maxStr } <file_sep>Zepto(document).ready(function(){ var $p1 = $('.p1'), $p2 = $('.p2'), $p3 = $('.p3'), $p4 = $('.p4'); //第一页动画 var pageOne = function(){ //第一部分 $p1.find('.v-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'height': '100%', 'transition-duration': '0.8s'}); }else{ //even $(this).css({'height': '100%', 'transition-duration': '0.8s', 'transition-delay': '0.5s'}); } }); //第二部分 $p1.find('.h-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'width': '100%', 'transition-duration': '0.6s'}); }else{ //even $(this).css({'width': '100%', 'transition-duration': '0.6s', 'transition-delay': '0.5s'}); } }); $p1.find('.logo').css({'opacity': 1, 'transition-duration': '0.4s', 'transition-delay': '1.1s'}); $p1.find('.btn-next').css({'opacity': 1, 'transition-duration': '0.4s', 'transition-delay': '1.4s'}); } //第二页动画 var pageTwo = function(){ //第一部分 $p2.find('.v-line .line1').css({'height': '100%', 'transition-duration': '0.3s'}); $p2.find('.h-line .line3').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.1s'}); $p2.find('.v-line .line6').css({'height': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.2s'}); $p2.find('.h-line .line4').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.3s'}); $p2.find('.rect-wrap .rect1').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '0.4s'}); //第二部分 $p2.find('.v-line .line2').css({'height': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.4s'}); $p2.find('.h-line .line2').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.5s'}); $p2.find('.v-line .line5').css({'height': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.6s'}); $p2.find('.h-line .line5').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.7s'}); $p2.find('.rect-wrap .rect2').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '0.8s'}); //第三部分 $p2.find('.v-line .line3').css({'height': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.8s'}); $p2.find('.h-line .line1').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '0.9s'}); $p2.find('.v-line .line4').css({'height': '100%', 'transition-duration': '0.3s', 'transition-delay': '1s'}); $p2.find('.h-line .line6').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '1.1s'}); $p2.find('.rect-wrap .rect3').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '1.2s'}); //第四部分(合字部分) $p2.find('.item1 .circle').css({'opacity': '1', 'transition-duration': '0.5s', 'transition-delay': '1.2s'}); $p2.find('.item1 .txt').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '1.4s'}); $p2.find('.item1 .line').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '1.6s'}); $p2.find('.item2 .circle').css({'opacity': '1', 'transition-duration': '0.5s', 'transition-delay': '1.8s'}); $p2.find('.item2 .txt').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '2s'}); $p2.find('.item2 .line').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '2.2s'}); $p2.find('.item3 .circle').css({'opacity': '1', 'transition-duration': '0.5s', 'transition-delay': '2.4s'}); $p2.find('.item3 .txt').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '2.6s'}); $p2.find('.item3 .line').css({'width': '100%', 'transition-duration': '0.3s', 'transition-delay': '2.8s'}); $p2.find('.item4 .circle').css({'opacity': '1', 'transition-duration': '0.5s', 'transition-delay': '3s'}); $p2.find('.item4 .txt').css({'opacity': '1', 'transition-duration': '0.3s', 'transition-delay': '3.2s'}); $p2.find('.project .bg').css({'opacity': '1', 'transition-duration': '0.5s', 'transition-delay': '3.6s'}); } //第三页 var pageThree = function(){ //第一部分 $p3.find('.v-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'height': '100%', 'transition-duration': '0.6s'}); }else{ //even $(this).css({'height': '100%', 'transition-duration': '0.6s', 'transition-delay': '0.5s'}); } }); //第二部分 $p3.find('.h-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'width': '100%', 'transition-duration': '0.6s'}); }else{ //even $(this).css({'width': '100%', 'transition-duration': '0.6s', 'transition-delay': '0.5s'}); } }); //第三部分 $p3.find('.diamond-wrap .diamond1').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1s'}); $p3.find('.diamond-wrap .diamond2').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1.3s'}); $p3.find('.diamond-wrap .diamond3').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1.6s'}); $p3.find('.diamond-wrap .diamond4').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1.9s'}); $p3.find('.diamond-wrap .diamond5').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '2.2s'}); $p3.find('.diamond-wrap .diamond6').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '2.5s'}); } //第四页 var pageFour = function(){ //第一部分 $p4.find('.v-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'height': '100%', 'transition-duration': '0.6s'}); }else{ //even $(this).css({'height': '100%', 'transition-duration': '0.6s', 'transition-delay': '0.5s'}); } }); //第二部分 $p4.find('.h-wrap .line').each(function(index){ if((index+1)%2 == 1){ //odd $(this).css({'width': '100%', 'transition-duration': '0.6s'}); }else{ //even $(this).css({'width': '100%', 'transition-duration': '0.6s', 'transition-delay': '0.5s'}); } }); //第三部分 $p4.find('.btn-wrap .qrCode').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1s'}); $p4.find('.btn-wrap .btn-syb').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1.3s'}); $p4.find('.btn-wrap .btn-more').css({'opacity': '1', 'transition-duration': '0.6s', 'transition-delay': '1.6s'}); } //全屏滑动组件初始化 var swiper = new Swiper('.swiper-container', { pagination: '.swiper-pagination', paginationClickable: true, direction: 'vertical', onSlideChangeEnd: function(swiper){ //切换完成后执行 switch(swiper.activeIndex){ case 0: pageOne(); break; case 1: pageTwo(); break; case 2: pageThree(); break; case 3: pageFour(); break; //default } }, onInit: function(swiper){ //Swiper初始化完成 pageOne(); } }); //首屏点击箭头跳到第二页 $('.p1 .btn-next').bind('tap',function(){ swiper.slideNext(); }); //我是创业者 $('.p4 .btn-syb').bind('tap',function(){ $('.p4 .popup').show(); }); //隐藏弹窗 $('.p4 .popup .mask').bind('tap',function(){ $('.p4 .popup').hide(); }); //获得焦点placeholder消失 var placeholderText = ''; $('.popup input, .popup textarea').focus(function(){ placeholderText = $(this).attr('placeholder'); $(this).attr('placeholder', ''); }); //失去焦点placeholder显示 $('.popup input, .popup textarea').blur(function(){ $(this).attr('placeholder', placeholderText); }); }); <file_sep># CSS动画优化原则 1.除了透明度(opacity)和切换(transform),不要改变任何属性! 比如,你想让某个元素小,你可以使用 transform:scale(),而不是改变宽度;如果你想移动它,你可以使用简单的 transform:translateX 或者 transform:translateY,从而替代乱糟糟的外补白(margin)或者内补白(padding) — 那些需要重建每一帧的页面布局。 2.用非常清楚的方式隐藏内容(使用 pointer-events 属性:仅仅利用透明度隐藏元素) CSS 中的 pointer-events 属性(尽管已经存在很长时间,但是不经常使用)只是让元素失去了点击和交互的响应,就好像它们不存在一样。它能通过 CSS 控制显示或隐藏,不会打断动画也不会影响页面的渲染或可见性。 除了将 opacity 设置为零,它和将 display 设置为 none 具有相同的效果,但是不会触发新的渲染机制。需要隐藏元素的时候,我会将它的 opacity 设置为 0 并将 pointer-events 设置为 off,然后就任由其自生自灭啦。 这样做尤其适用于绝对定位的元素,因为你能够自信满满地说他们绝对不会影响到页面中的其他元素。 它有时也会剑走偏锋,因为动画的时机并不总那么完美 — 比如一个元素在不可见状态下仍然可以点击或者覆盖了其他内容,或者只有当元素淡入显示完全的时候才可以点击,但是不要灰心,会有办法解决的。(请关注下文) 3.不要一次给所有内容都设置动画(用动作编排加以替代) 单一的动画会很流畅,但是和其他许多动画一起也许就完全乱套了。编写一个流畅的全员动画的例子很简单,但当数量级上升到整个网站时性能就很难维持了。因此,合理安排好每个元素非常重要。 你需要将所有的时间节点安排好,来避免所有的动画内容同时开始或进行。典型的例子,2 或 3 个动画同时进行可能不会出现卡慢的现象,尤其是在它们开始的时间略有不同的情况下。但是超过这个数量,动画就可能发生滞缓。 理解动作编排这个概念非常重要,除非你的页面真的只有一个元素。它貌似是舞蹈领域的东西,但是在动画界它同样的重要。每个内容都要在合适的方向和时机出现,即使它们相互分离,但是它们要给人一种按部就班的感觉。 4.适当增加切换延时能够更简单地编排动作 动画的编排非常重要,同时也会做大量的试验和测试才能恰如其分。然而,动画编排的代码并不会非常复杂。 我通常会改变一个父元素(通常是 body)的 class 值来触发一系列的改变,这些改变有着各不相同的切换延时以便能够适时展现。单从代码来看,你只需要关心状态的变化,而不用担心一堆时间节点的维持。 交错安排一系列的元素是动画编排的一种简单易行的方法,这种方法很有效,因为它在性能良好的同时还好看—但请记住你本想让几个动画同时发生的。你想把这些动画分布开来,让每个都表现地流畅,而不是一下子太多动画从而显得特别慢。适当部分的重叠会看起来连续流畅而不是链式的单独动画。 5.在慢动作中使用增量设计(过后再加快动画的速度) 尤其是做非常复杂的动画分析,或者解决非常棘手的性能瓶颈,慢动作查看元素会非常的有用。 重要的一点就是,在慢动作下你会将非常多的细节优化地完美,当动画加速之后它将会给人完美无瑕的感觉。尽管这些都显得微不足道,但是用户会注意到动画效果的流畅和细节的。 6.给你的用户界面录个像,并且在重复播放中得到一个有价值的第三人视角的看法。 在视频中一次次地观看慢动作的动画能够让一切问题都暴露地非常明显。 7.网络活动可能会造成延迟。(应该预加载或者延迟处理非常大的 HTTP 请求) 8.不要直接绑定滚动事件。(貌似是个好主意,其实不然) 基于滚动的动画在前些年一段时间非常火爆,尤其是涉及视差或者其他特效的内容里。它们的设计模式是好是坏仍有待考证,但是在技术上有着良莠不齐的实现方法。 基于滚动的动画中有一种非常流行的处理方式,即将滚动一定距离作为事件处理同时触发动画内容。除非你对自己的行为了如指掌,否则我会建议不要使用这种方式,因为它真的很容易出错并且很难维护。 更糟糕的情况是自定义滚动条功能,而不用默认的功能—又名 scrolljacking 。请不要这么想不开。 在这十项准则中,这项尤其适用于移动开发,另外可能也是理想用户体验的好的实践。 如果你确实要求独特的体验并且你希望它基于滚动或者其他的特殊事件,我建议创建一个快速原型来实现,而不是费力不讨好地去设计事件形式。 9.尽早并且经常地在移动设备上的测试 10.经常在不同的设备上测试(不同屏幕尺寸、分辨率,或者有着各种样式的设备) <file_sep># Font-End 前端收集 <file_sep><ul> <li ms-repeat="listData">{{el.name}}</li> </ul><file_sep><template> <div class="cartcontrol"> <div class="cart-decrease"></div> <div class="cart-count"></div> <div class="cart-add"></div> </div> </template> <script> export default{ } </script><file_sep><template> <div class="shopcart"> <div class="content"> <div class="content-left"> <div class="logo-wrapper"> <div class="logo"> <i class="icon-shopping-cart"></i> </div> <div class="num">0</div> </div> <div class="price">¥0</div> <div class="desc">另需配送费¥4元</div> </div> <div class="content-right"> <div class="pay not-enough"> ¥20元起送 </div> </div> </div> <!--<div class="ball-container"> <div class="ball drop-transition"> <div class="inner inner-hook"></div> </div><div class="ball drop-transition"> <div class="inner inner-hook"></div> </div><div class="ball drop-transition"> <div class="inner inner-hook"></div> </div><div class="ball drop-transition"> <div class="inner inner-hook"></div> </div><div class="ball drop-transition"> <div class="inner inner-hook"></div> </div> </div> <div class="shopcart-list fold-transition"> <div class="list-header"> <h1 class="title">购物车</h1> <span class="empty">清空</span> </div> <div class="list-content"> <ul> </ul> </div> </div>--> </div> </template> <script> export default{ } </script> <style> .shopcart{ position: fixed; left: 0; bottom: 0; z-index: 50; width: 100%; height: 48px; } .shopcart .content{ display: -webkit-box; display: -ms-flexbox; display: flex; background: #141d27; font-size: 0; color: rgba(255,255,255,0.4); } .shopcart .content .content-left{ -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } .shopcart .content .content-right{ -webkit-box-flex: 0; -ms-flex: 0 0 105px; flex: 0 0 105px; width: 105px; } .shopcart .content .content-left .logo-wrapper{ display: inline-block; vertical-align: top; position: relative; top: -10px; margin: 0 12px; padding: 6px; width: 56px; height: 56px; box-sizing: border-box; border-radius: 50%; background: #141d27; } .shopcart .content .content-left .price{ display: inline-block; vertical-align: top; margin-top: 12px; line-height: 24px; padding-right: 12px; box-sizing: border-box; border-right: 1px solid rgba(255,255,255,0.1); font-size: 16px; font-weight: 700; } .shopcart .content .content-left .desc{ display: inline-block; vertical-align: top; margin: 12px 0 0 12px; line-height: 24px; font-size: 10px; } .shopcart .content .content-right .pay{ height: 48px; line-height: 48px; text-align: center; font-size: 12px; font-weight: 700; } .shopcart .content .content-right .pay.not-enough{ background: #2b333b; } </style> <file_sep><template> <div class="goods"> <div class="menu-wrapper"> <ul> <li v-for="good in goods"> <span>{{good.name}}</span> </li> </ul> </div> <div class="foods-wrapper"> <ul> <li v-for="good in goods"> <h3>{{good.name}}</h3> <ul> <li class="food-item" v-for="food in good.foods"> <div class="icon"><img width="57" height="57" v-bind:src="food.icon"/></div> <div class="content"> <h4 class="name">{{food.name}}</h4> <p class="desc">{{food.description}}</p> <div class="extra"><span class="count">月售{{food.sellCount}}份</span><span>好评率{{food.rating}}</span></div> <div class="price"><span class="now">¥{{food.price}}</span><span class="old" v-if="food.oldPrice != ''">¥{{food.oldPrice}}</span></div> </div> <v-cart></v-cart> </li> </ul> </li> </ul> </div> <v-shopCart></v-shopCart> </div> </template> <script> import API from '../api'; import cartcontrol from './cartcontrol'; import shopCart from './shopCart'; export default { name: 'goods', created(){ API.getData(d => { this.goods = d.goods; }); }, data () { return { goods: [] } }, components: { 'v-cart': cartcontrol, 'v-shopCart': shopCart } } </script> <!-- Add "scoped" attribute to limit CSS to this component only --> <style scoped> ::-webkit-scrollbar{ width: 0; } .goods{ display: -webkit-box; display: -ms-flexbox; display: flex; position: absolute; top: 174px; bottom: 46px; width: 100%; overflow: hidden; } .goods .menu-wrapper,.goods .foods-wrapper{ overflow-y: auto; -webkit-overflow-scrolling: touch; } .goods .menu-wrapper{ -webkit-box-flex: 0; -ms-flex: 0 0 80px; flex: 0 0 80px; width: 80px; background: #f3f5f7; } .goods .foods-wrapper{ -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } .goods .menu-wrapper li{ display: table; height: 54px; width: 56px; padding: 0 12px; line-height: 14px; } .goods .menu-wrapper li span{ display: table-cell; width: 56px; vertical-align: middle; position: relative; font-size: 12px; } .goods .foods-wrapper h3{ padding-left: 14px; height: 26px; line-height: 26px; border-left: 2px solid #d9dde1; font-size: 12px; color: #93999f; background: #f3f5f7; } .goods .foods-wrapper .food-item{ display: -webkit-box; display: -ms-flexbox; display: flex; margin: 18px; padding-bottom: 18px; position: relative; } .goods .foods-wrapper .food-item .icon{ -webkit-box-flex: 0; -ms-flex: 0 0 57px; flex: 0 0 57px; margin-right: 10px; } .goods .foods-wrapper .food-item:after{ display: block; position: absolute; left: 0; bottom: 0; width: 100%; border-top: 1px solid rgba(7,17,27,0.1); content: ' '; -webkit-transform: scaleY(0.5); transform: scaleY(0.5); } .goods .foods-wrapper .food-item:last-child:after{ border: none; } .goods .foods-wrapper .food-item .name{ margin: 2px 0 8px 0; height: 14px; line-height: 14px; font-size: 14px; color: #07111b; } .goods .foods-wrapper .food-item .desc,.goods .foods-wrapper .food-item .extra{ line-height: 10px; font-size: 10px; color: #93999f; } .goods .foods-wrapper .food-item .desc{ line-height: 12px; margin-bottom: 8px; } .goods .foods-wrapper .food-item .extra .count{ margin-right: 12px; } .goods .foods-wrapper .food-item .price{ font-weight: 700; line-height: 24px; } .goods .foods-wrapper .food-item .price .now{ margin-right: 8px; font-size: 14px; color: #f01414; } .goods .foods-wrapper .food-item .price .old{ text-decoration: line-through; font-size: 10px; color: #93999f; } </style> <file_sep>/* * @Author: anchen * @Date: 2016-11-25 17:36:54 * @Last Modified by: anchen * @Last Modified time: 2016-11-25 17:37:20 */ (function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function () { var clientWidth = docEl.clientWidth, clientHeight = docEl.clientHeight, designWidth = 640, designHeight = 1136; if (!clientWidth) return; docEl.style.fontSize = 100 * (clientWidth / 640) * clientHeight / (designHeight * clientWidth / designWidth) + 'px'; }; if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false); })(document, window);<file_sep>/** * @解决数据加减乘除精度丢失问题 */ var math = { //不固定参数加法 add: function(){ var result = 0, argLength = arguments.length; if(argLength == 0){ return result } for(var i = 0; i < argLength; i++){ result = this.accAdd(result, arguments[i]); } return result; }, //不固定参数减法 sub: function(){ var result = arguments[0], argLength = arguments.length; if(argLength == 0){ return 0 } for(var i = 1; i < argLength; i++){ result = this.accSub(result, arguments[i]); } return result; }, //不固定参数乘法 mul: function(){ var result = 1, argLength = arguments.length; if(argLength == 0){ return 0 } for(var i = 0; i < argLength; i++){ result = this.accMul(result, arguments[i]); } return result; }, //不固定参数除法 div: function(){ var result = arguments[0], argLength = arguments.length; if(argLength == 0){ return 0 } for(var i = 1; i < argLength; i++){ result = this.accDiv(result, arguments[i]); } return result; }, //精确加法(核心算法) accAdd: function(arg1, arg2) { var r1, r2, m; try{ r1 = arg1.toString().split('.')[1].length; }catch(e){ r1 = 0; } try{ r2 = arg2.toString().split('.')[1].length; }catch(e){ r2 = 0; } m = Math.pow(10, Math.max(r1, r2)); return (arg1 * m + arg2 * m) / m; }, //精确减法(核心算法) accSub: function(arg1, arg2) { var r1, r2, m; try { r1 = arg1.toString().split(".")[1].length; } catch(e) { r1 = 0; } try { r2 = arg2.toString().split(".")[1].length; } catch(e) { r2 = 0; } m = Math.pow(10, Math.max(r1, r2)); //动态控制精度长度 return (arg1 * m - arg2 * m) / m; }, //精确乘法(核心算法) accMul: function(arg1, arg2) { var r1, r2, m; try { r1 = arg1.toString().split('.')[1].length; } catch(e) { r1 = 0; } try { r2 = arg2.toString().split('.')[1].length; } catch(e) { r2 = 0; } m = Math.pow(10, r1+r2); //动态控制精度长度 return Number(arg1.toString().replace('.', '')) * Number(arg2.toString().replace('.', '')) / m; }, //精确除法(核心算法) accDiv: function(arg1, arg2) { var r1, r2, m; try { r1 = arg1.toString().split('.')[1].length } catch(e) { r1 = 0; } try { r2 = arg2.toString().split('.')[1].length } catch(e) { r2 = 0; } m = Math.pow(10, r1 - r2) //动态控制精度长度 return Number(arg1.toString().replace('.', '')) / Number(arg2.toString().replace('.', '')) / m; }, }; <file_sep>/* * @Author: Insect * @Date: 2016-12-07 14:51:27 * @Last Modified time: 2016-12-07 16:56:30 */ 'use strict'; define(['avalon', 'tool/router.min', 'tool/ajax/ajax.min'], function(av){ window.global = av.define({ $id: 'global', mod: '', init: function(){ }, $computed: { template: { get: function(){ if(this.mod !== ''){ return 'assets/tpl/' + this.mod + '.tpl'; } } } }, //获取列表 getList: function(url, data){ var result = {}; av.post(url, data, function(json){ result = json; }); } }); av.router.on('/', function(){ global.mod = 'index' }) av.router.on('/:id', function(mod){ global.mod = mod require(['../' + mod, 'css!../../css/' + mod], function(m){ m.init && m.init() }) }) av.router.on('/:id/:id', function(mod,menu){ global.mod = mod require(['../' + mod, 'css!../../css/' + mod], function(m){ m.init && m.init(menu) }) }) av.scan(); return window.global; }); <file_sep>/* * @Author: Insect * @Date: 2016-12-07 16:13:21 * @Last Modified time: 2016-12-07 16:40:28 */ 'use strict'; define(['avalon', 'tool/ajax/ajax.min', 'tool/pages/pages.min'], function(av){ var front = av.define({ $id: 'front', menu: '', init: function(menu){ this.menu = menu || 'js'; }, $computed: { template: { get: function(){ if(this.menu !== ''){ return 'assets/tpl/front/' + this.menu + '.tpl'; } } }, listData: { get: function(){ if(this.menu === 'html'){ return [{name: 'html'}]; } if(this.menu === 'css'){ return [{name: 'css'}]; } if(this.menu === 'js'){ return [{name: 'js'}]; } } } } }); av.scan(); return front; })
492a68be71ff9ea5aba8a42d5f88dd1d438e1542
[ "Markdown", "Smarty", "Vue", "JavaScript", "CSS" ]
27
Markdown
zenghongcong/Front-End
4410cf42527b00666c7728f64a2c296458deedbc
b8d4b27057cd9b85077895b41182658a27ff7b4a
refs/heads/master
<file_sep>from pony.orm import * from datetime import datetime class BeerReview(db.Entity): brewery_id = Required(int) brewery_name = Required(unicode) review_time = Required(datetime) overall = Required(float) aroma = Required(float) appearance = Required(float) profilename = Optional(unicode) beer_style = Required(unicode) palate = Required(float) taste = Required(float) beer_name = Required(unicode) # Got no idea what _abv is...not required either beer_abv = Optional(float) beer_id = Required(int) <file_sep># DataPipelines This repository holds source-code for a sample application, specifically extracting, converting and outputting a dataset. Technologies employed - MySQL - Python - Apache AirFlow - PonyORM ## Intended exercise Setup and run an Airflow workflow, containing the following steps: 1. Ingest ("load") the data as-is from the provided csv file into a database table 2. Transform the loaded data (from step 1.) in the following way: *Use dbt to create a new table, or view, with the columns; “brewery_name”, “beer_name”, and a new calculated column “avg_review_overall” (derived from average “review_overall”)* ## Current progress - Ingestion of raw data into database - Currently bothered by a unicode-parsing error when ingesting csv-file - Transformation of data into desired format - Implementation not begun ## Current issues - During import memory consumption increases monotonically to about ~4 GB. ## Realize the following - and avoid frustration! - The database used by AirFlow (in-memory or persisted) backs AirFlow itself, *but has nothing to do with the storage of the input to / output of the the data-tasks (if any) carried out by workflows managed by AirFlow*. - Hence, if one plans to setup workflows that persists data to a database, two separate / unrelated databases should come into play: - one for the AirFlow application / server (always needed) - the "airflow database" This database only holds data used to support AirFlow - data going in and out of workflows is *not* to be persisted in this database. - (optional, depending on need of workflow) another database for data-storage / manipulation, to be used by workflow tasks - the "data database". - AirFlow provides a `MySQLOperator`; that operator allows you to run sql-queries against the "data-database". I suggest one forgets about the eixstence of and/or does *not* use `MySQLOperator` to interact with the database, but rather use an ORM, for instance [PonyORM](https://docs.ponyorm.org), to interact with the database. - AirFlow really is two things: A) a python package, and B) a server that runs / monitor submitted workflows. ## Dataset Download beer-reviews dataset in local folder `data` ```bash mkdir data/ cd data curl https://s3.eu-west-2.amazonaws.com/tgtg-public-data/beer_reviews.csv.zip -o beer_reviews.csv.zip unzip beer_reviews.csv.zip ``` ### Learnings on dataset - The following fields cannot be assumed to be present in dataset - `brewery_name` - `beer_abv` - `profile_name` ## Create database to back AirFlow application Essential steps 1. Create database (i.e. named `AirFlowSupport`) to back AirFlow application 2. Create user (i.e. `AirFlowClient`, with password `<PASSWORD>$$` ) for that database that Airflow will use when connecting to database 1. Grant user all rights 3. Update `~/airflow/airflow.cfg`, specifically the `executor` and `sql_alchemy_conn` variables: ``` # The executor class that airflow should use. Choices include # SequentialExecutor, LocalExecutor, CeleryExecutor, DaskExecutor, KubernetesExecutor executor = LocalExecutor # The SqlAlchemy connection string to the metadata database. # SqlAlchemy supports many different database engine, more information # their website sql_alchemy_conn = mysql+mysqlconnector://AirFlowClient:sinceJyllandAlgebra812$$@localhost:3306/AirFlowSupport ``` 4. From shell, run ```bash airflow initdb ``` Verify that `AirFlowSupport` database now holds multiple tables. ### Steps: GUI (Sequel Pro) TODO! ### Steps: Command-line TODO! ### ## Create database for data storage / manipulation TODO! ## Installing dependencies ```bash export AIRFLOW_GPL_UNIDECODE=yes pip install apache-airflow pip install mysql-connector-python pip install pony pip install PyMySQL pip ist ``` Configure MySQL `explicit_defaults_for_timestamp=1`: 1. First, locate `my.cnf`(MySQL configuration): ```bash mysql --help|grep -B 3 -A 3 following ``` 2. Add / ensure the following the line is present in `my.cnf`: ```bash explicit_defaults_for_timestamp=1 ``` # Resources [Getting Started with AirFlow](https://towardsdatascience.com/getting-started-with-apache-airflow-df1aa77d7b1b) [Stackoverflow: SQLAlchemy + MYSQL + Apache Airflow](https://stackoverflow.com/questions/53225462/apache-airflow-python-3-6-local-executor-mysql-as-a-metadata-database)<file_sep>from airflow import DAG from airflow.operators.python_operator import PythonOperator from datetime import datetime from dataloader import read_csv_file default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2015, 6, 1), 'email': ['<EMAIL>'], 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': datetime.timedelta(minutes=5), # 'queue': 'bash_queue', # 'pool': 'backfill', # 'priority_weight': 10, # 'end_date': datetime(2016, 1, 1), } containing_workflow = DAG('Import CSV', default_args=default_args, schedule_interval=datetime.timedelta(days=1)) firstTask = PythonOperator( task_id='Load_CSV_rows', python_callable=read_csv_file, dag=containing_workflow ) <file_sep>import unicodecsv from database import connect from pony import db_session from pony.orm import commit from beer_review import BeerReview from datetime import datetime batch_size = 2000 @db_session def read_csv_file(filepath): with open(filepath) as csv_file: csv_reader = unicodecsv.reader(csv_file) # Skip first line -> header next(csv_reader) counter = 0 for row in csv_reader: brewery_id = int(row[0]) brewery_name = row[1] epoch_duration = int(row[2]) review_date = parse_datetime(epoch_duration) overall_rating = float(row[3]) aroma_rating = float(row[4]) appearance_rating = float(row[5]) profilename = row[6] beer_style = row[7] palate_rating = float(row[8]) taste_rating = float(row[9]) beer_name = row[10] # Have no clue what this describes beer_abv = None if row[11].strip(): beer_abv = float(row[11]) beer_id = int(row[12]) try: BeerReview(brewery_id=brewery_id, brewery_name=brewery_name, review_time=review_date, overall=overall_rating, aroma=aroma_rating, appearance=appearance_rating, profilename=profilename, beer_style=beer_style, palate=palate_rating, taste=taste_rating, beer_name=beer_name, beer_abv=beer_abv, beer_id=beer_id) except Exception as e: print('Error occured for' + str(row) + ' , exception: ' + str(e)) if counter % batch_size == 0: print('Committing, current count: ' + str(counter)) commit() counter = counter + 1 def parse_datetime(epoch_duration): try: return datetime.utcfromtimestamp(epoch_duration) except Exception as e: print(str(e)) return None <file_sep>from pony.orm import * from datetime import datetime def connect(): db = Database() db.bind(provider='mysql', host='127.0.0.1', user="BaverageImporter", passwd='<PASSWORD>!', db='Beverages') return db def create_mapping_for_entities(): db.generate_mapping(create_tables=True)
32379e164ecef06e20813147f00f464576ef459e
[ "Markdown", "Python" ]
5
Markdown
mortenalbertsen/DataPipelines
3cf14d726def5aba7370aa2adf12239426e73967
4f6c338be7c99106aa1a1d70f72cae37726a80c0
refs/heads/master
<file_sep># -*- coding: utf-8 -*- import numpy as np import cv2 from sys import argv from mnist import MNIST from math import sqrt from sklearn.decomposition import PCA from time import time from skimage.feature import corner_harris, corner_peaks, BRIEF h, w = 28, 28 path = './MNIST' if len(argv) > 1: path = argv[1] # calculate PCA # source: http://scikit-learn.org/stable/auto_examples/applications/face_recognition.html def get_pca(train, test): n_components = 50 print("Extracting the top %d eigenfaces" % n_components) t0 = time() pca = PCA(n_components=n_components, svd_solver='randomized', whiten=True).fit(train) print("done in %0.3fs" % (time() - t0)) print("Projecting the input data on the eigenfaces orthonormal basis") t0 = time() train_pca_result = pca.transform(train) test_pca_result = pca.transform(test) print("done in %0.3fs" % (time() - t0)) return train_pca_result, test_pca_result def dumb(img): horizontal = np.append(img[9], img[18]) vertical = [] for j in range(len(img[14])): vertical.append(img[14][j]) return tuple(np.append(horizontal, vertical)) # not working correctly def harris(img): img2 = np.float32(img) dst = cv2.cornerHarris(img2, 2, 3, 0.04) dst = cv2.dilate(dst, None) return dst # not working correctly def brief(img): keypoints = corner_peaks(corner_harris(img), min_distance=1) extractor = BRIEF(descriptor_size=64, patch_size=12) extractor.extract(img, keypoints) print extractor.descriptors return extractor.descriptors def get_features(img, func): if func is None: return img return func(img) def convert_mnistraw_to_nparray(mnistraw): nparrays = [] for entry in mnistraw: nparrays.append(np.reshape(np.asarray(entry), (h, w))) return nparrays def dist(p, q): # print p, q sum = 0 for i, val in enumerate(p): sum += (val - q[i])**2 return sqrt(sum) def process(train_data, test_data, func, name): # dict of feature vectors for all 10 classes train_classes = {key: [] for key in range(10)} # print classes # assign feature vectors of train data to classes for index, label in enumerate(train_labels): # print index, label features = get_features(train_data[index], func) train_classes[label].append(features) # determine centroids centroids = {} for clazz, feature_vectors in train_classes.items(): feature_size = len(feature_vectors[0]) count = float(len(feature_vectors)) centroid = [0 for i in range(feature_size)] for vector in feature_vectors: for feature, value in enumerate(vector): centroid[feature] += value for i in range(feature_size): centroid[i] /= count centroids[clazz] = tuple(centroid) # print centroids # assign indices of test data to centroids test_labelassignments = [] for index, image in enumerate(test_data): vector = get_features(image, func) distances = {} for clazz, centroid in centroids.items(): distances[dist(centroid, vector)] = clazz # print distances # print sorted(distances) min_dist = min(distances) # print min_dist nearest_centroid = distances[min_dist] # print nearest_centroid # test_classes[nearest_centroid] = index test_labelassignments.append(nearest_centroid) # print test_classes print test_labelassignments print test_labels right = 0 for index, label in enumerate(test_labels): if label == test_labelassignments[index]: right += 1 precision = float(right) / len(test_labels) print name+':', 'precision =', right, '/', len(test_labels), '=', precision # load raw mnist data mndata = MNIST(path) mndata.load_training() mndata.load_testing() # convert raw mnist images to numpy arrays train_np1D = np.asarray(mndata.train_images) train_np2D = convert_mnistraw_to_nparray(mndata.train_images) train_labels = mndata.train_labels test_np1D = np.asarray(mndata.test_images) test_np2D = convert_mnistraw_to_nparray(mndata.test_images) test_labels = mndata.test_labels # process different feature sets process(train_np2D, test_np2D, dumb, 'dumb') train_pca, test_pca = get_pca(train_np1D, test_np1D) process(train_pca, test_pca, None, 'pca') # process(train_np2D, test_np2D, harris, 'harris') # process(train_np2D, test_np2D, brief, 'BRIEF') <file_sep># Next Centroid Classifier for MNIST A naive, experimental next-centroid-classifier for the MNIST dataset. The path to the folder with the MNIST dataset can be set as an parameter. In order to import the MNIST dataset the external module [mnist](https://pypi.python.org/pypi/python-mnist/) is required. #### Feature extraction: - **dumb:** A simple feature vector consisting of two image-rows and one image-column. Accuracy ~70%. - **pca:** Projects the images to a 50 dimensional feature vector. Accuracy ~85%. #### Distance measure: - euclidean norm. Additional experiments with alternative feature types (Harris, BRIEF) have been conducted, but their binary feature vectors are unsuited for metrical distance measures.
d049836701c62ed70f9129f4b45250266fd37d7b
[ "Markdown", "Python" ]
2
Markdown
andifunke/next-centroid-classifier-mnist
f838721282365e743b54c5410e68c2e9cd9f4307
1313cfafe0b1780aeefce6a863742330ef1b6d5d
refs/heads/master
<repo_name>dslowik44/Students<file_sep>/utility.cpp #include "utility.h" #include <stdexcept> #include <algorithm> std::istream& read_hw(std::istream& is, std::vector<double>& hw) { if (is) { hw.clear(); double x; while (is >> x) hw.push_back(x); is.clear(); } return is; } double grade(double midterm, double final, double median_hw) { return 0.2 * midterm + 0.4 * final + 0.4 * median_hw; } double grade(double midterm, double final, std::vector<double> hw) { if (!hw.size()) throw std::domain_error("No homework for grade."); std::vector<double>::size_type mid_n = hw.size()/2; std::nth_element(hw.begin(), hw.begin() + mid_n, hw.end()); double median = hw[mid_n]; if (hw.size() % 2 == 0) { std::nth_element(hw.begin(), hw.begin() + mid_n - 1, hw.end()); median = (median + hw[mid_n - 1]) / 2; } return grade(midterm, final, median); } <file_sep>/students2/students2.pro TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt DEFINES -= UNICODE QT_LARGEFILE_SUPPORT QMAKE_CXXFLAGS += -std=c++11 SOURCES += include(deployment.pri) qtcAddDeployment() <file_sep>/utility.h #ifndef UTILITY_H #define UTILITY_H // Global functions used by methods of Core and Grad classes. #include <istream> #include <vector> std::istream& read_hw(std::istream& is, std::vector<double>& hw); double grade(double midterm, double final, std::vector<double> hw); #endif // UTILITY_H <file_sep>/core.h #ifndef CORE_H #define CORE_H #include <string> #include <vector> #include <iostream> class Core { public: Core() : midterm(0), final(0) { std::cout << "Core() ctor\n"; } Core(std::istream&); virtual ~Core() { std::cout << "~Core() dtor\n"; } std::string name() const { return _name; } virtual std::istream& read(std::istream& is); virtual double grade() const; protected: std::istream& read_common(std::istream& is); double midterm, final; std::vector<double> hw; private: std::string _name; }; bool compare(const Core&, const Core&); bool compare_ptrs(const Core*, const Core*); #endif // CORE_H <file_sep>/grad.cpp #include "grad.h" #include "utility.h" #include <algorithm> Grad::Grad(std::istream& is) { std::cout << "Grad(istream &) ctor\n"; read(is); } std::istream& Grad::read(std::istream& is) { read_common(is); is >> thesis; read_hw(is, hw); return is; } double Grad::grade() const { return std::min(Core::grade(), thesis); } <file_sep>/core.cpp #include "core.h" #include "utility.h" Core::Core(std::istream& is) { std::cout << "Core(istream &) ctor\n"; read(is); } std::istream& Core::read(std::istream& is) { read_common(is); read_hw(is, hw); return is; } std::istream& Core::read_common(std::istream& is) { is >> _name >> midterm >> final; return is; } double Core::grade() const { return ::grade(midterm, final, hw); } bool compare(const Core& c1, const Core& c2) { return c1.name() < c2.name(); } bool compare_ptrs(const Core* cp1, const Core* cp2) { return cp1->name() < cp2->name(); } <file_sep>/main.cc #include <iostream> #include <vector> #include <string> #include <algorithm> #include "core.h" #include "grad.h" using std::cout; using std::cin; using std::endl; using std::vector; using std::string; using std::max; using std::sort; int main() { vector<Core*> students; Core* record; char ch; string::size_type maxlen{0}; while (cin >> ch) { if (ch == 'U') record = new Core; else record = new Grad; record->read(cin); maxlen = max(maxlen, record->name().size()); students.push_back(record); } sort(students.begin(), students.end(), compare_ptrs); using stdnt_itr = vector<Core*>::const_iterator; stdnt_itr itr_end = students.end(); cout << " Name " << " Grade\n"; for (stdnt_itr itr = students.begin(); itr != itr_end; ++itr) { double grade = (*itr)->grade(); cout << (*itr)->name() << string(maxlen + 1 - (*itr)->name().size(), ' ') << grade << endl; delete *itr; } return 0; }
6d44b31966439c834a5c6679efd1fbdf459aa805
[ "C++", "QMake" ]
7
C++
dslowik44/Students
fe1c4f3ca23ce81a77ea9694eb97ae0f6ec1c747
7f1b83e0beaba30ab375e486bca97a5cbbe02097
refs/heads/master
<file_sep> /** * boost read io data push rosimu msgs */ #include <iostream> #include <boost/asio.hpp> #include <boost/bind.hpp> #include <stdio.h> #include <math.h> //ros include file #include "ros/ros.h" #include <sensor_msgs/Imu.h> using namespace std; using namespace boost::asio; //buffer angle double a[3],w[3],Angle[3],T; double g = 9.8; /** * DecodeIMudata * @param chrTemp * @return */ void DecodeIMUData(unsigned char chrTemp[]) { switch(chrTemp[1]) { case 0x51: a[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*16 * g; a[1] = (short(chrTemp[5]<<8|chrTemp[4]))/32768.0*16 * g; a[2] = (short(chrTemp[7]<<8|chrTemp[6]))/32768.0*16 * g; T = (short(chrTemp[9]<<8|chrTemp[8]))/340.0+36.25; printf("a = %4.3f\t%4.3f\t%4.3f\t\r\n",a[0],a[1],a[2]); break; case 0x52: w[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*2000; w[1] = (short(chrTemp[5]<<8|chrTemp[4]))/32768.0*2000; w[2] = (short(chrTemp[7]<<8|chrTemp[6]))/32768.0*2000; T = (short(chrTemp[9]<<8|chrTemp[8]))/340.0+36.25; printf("w = %4.3f\t%4.3f\t%4.3f\t\r\n",w[0],w[1],w[2]); break; // case 0x53: // Angle[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*180; // Angle[1] = (short(chrTemp[5]<<8|chrTemp[4]))/32768.0*180; // Angle[2] = (short(chrTemp[7]<<8|chrTemp[6]))/32768.0*180; // T = (short(chrTemp[9]<<8|chrTemp[8]))/340.0+36.25; // printf("Angle = %4.2f\t%4.2f\t%4.2f\tT=%4.2f\r\n",Angle[0],Angle[1],Angle[2],T); // break; } } /** * 填存imu_msgs */ sensor_msgs::Imu push_info_to_imu_msgs(void) { sensor_msgs::Imu imu_data; double deg2rad = M_PI / 180; imu_data.header.stamp = ros::Time::now(); imu_data.header.frame_id = "imu_link"; //angle_velocity rad imu_data.angular_velocity.x = w[0] * deg2rad ; imu_data.angular_velocity.y = w[1] * deg2rad ; imu_data.angular_velocity.z = w[2] * deg2rad ; //liear_acceleration imu_data.linear_acceleration.x = - a[0] ; imu_data.linear_acceleration.y = - a[1] ; imu_data.linear_acceleration.z = - a[2] ; return imu_data ; } int main(int argc , char ** argv) { /** * ros node and node name */ ros::init(argc,argv,"Wit_imu"); //node name ros::NodeHandle n; ros::Publisher wit_pub = n.advertise<sensor_msgs::Imu>("imu",1000); //ros::Rate loop_rate(100);; //while rate //create sensor_msgs/IMU_msgs sensor_msgs::Imu imu_data_msgs; /** * set boost io */ boost::asio::io_service iosev_; //io object boost::asio::serial_port serial_port_object(iosev_, "/dev/ttyUSB0"); serial_port_object.set_option(boost::asio::serial_port::baud_rate(230400)); serial_port_object.set_option(boost::asio::serial_port::flow_control(boost::asio::serial_port::flow_control::none)); serial_port_object.set_option(serial_port::parity(serial_port::parity::none)); serial_port_object.set_option(serial_port::stop_bits(serial_port::stop_bits::one)); serial_port_object.set_option(serial_port::character_size(8)); int flage_num_count = 0; while(1) { //-------------------------------------- unsigned char chrBuffer[100] = {0}; unsigned char chrTemp[100] = {0}; unsigned short usRxLength = 100; /* every once read 100 Bytes*/ read(serial_port_object, buffer(chrBuffer)); /** * 解析UART data */ while (usRxLength >= 11) { memcpy(chrTemp, chrBuffer, usRxLength); //copy usRxLength size come char Buffer 到chrTemp if (!((chrTemp[0] == 0x55) & ((chrTemp[1] == 0x51) | (chrTemp[1] == 0x52) /*| (chrTemp[1] == 0x53)*/ ))) { for (int i = 1; i < usRxLength; i++) chrBuffer[i - 1] = chrBuffer[i]; //整体前进左移,丢弃一个 usRxLength--; continue; } DecodeIMUData(chrTemp); flage_num_count ++; if(flage_num_count = 2) { //pushlish_msgs flage 两次push_data once wit_pub.publish( push_info_to_imu_msgs() ); flage_num_count = 0; } //减去前面11个 for (int i = 11; i < usRxLength; i++) chrBuffer[i - 11] = chrBuffer[i]; usRxLength -= 11; ros::spinOnce(); //loop_rate.sleep(); } //other thread operation iosev_.run(); } return 0; } <file_sep># RosWitDriver ros package of wit imu
2ffeff0a9b529b3c63c702e8baf43400f93008f4
[ "Markdown", "C++" ]
2
Markdown
Rmargin/RosWitDriver
d5aab609c694574d1a945dbba52fd6693a019932
b1dd0d873cd89dafe7915f5c8b81edafcb0ce5e5
refs/heads/master
<file_sep># EC2-PEMS
8aa944efd0e13bfa1f633fb1b75fd5445d56c32f
[ "Markdown" ]
1
Markdown
ytimocin/EC2-PEMS
7867a90e5f9c0475caf3c6a0326f1e278a272a23
52368faf5a17b69b23e9fbfaab5334522b33ec1d
refs/heads/master
<repo_name>Targitaika/hello-world<file_sep>/README.md # hello-world Hi, Humans My name is Konstantin, I'm young front-end developer. I'm just study now, but I want, to create something great!
8967cc28f5d2af00863b03655c98ace851cc44b1
[ "Markdown" ]
1
Markdown
Targitaika/hello-world
2100d898cae1ad168896921e1201012b6453e85c
2f0c9c49d1f0b767992e8afb0c869d4e4e0956a2
refs/heads/main
<file_sep><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Premier League Football</title> <!--StyleSheet Add--> <link rel="stylesheet" href="style.css"> <!--FontAwesome Kit Add--> <script src="https://kit.fontawesome.com/cdb795047f.js" crossorigin="anonymous"></script> </head> <body> <!--Header Section Start--> <header> <div class="title"> <h1 class="header-title">Premier League 2021</h1> <button>Watch Live <i class="fas fa-arrow-right"></i></button> </div> <div class="banner"> <img src="images/banner.jpg" alt="english premier league"> </div> </header> <!--Header Section End--> <!--Players List Section Start--> <main> <section class="top-players"> <div class="players"> <div class="player"> <img src="images/players/player-one.jpg" alt=""> <h3><NAME></h3> <p><NAME> is a Belgian professional footballer who plays as a midfielder for Premier League club Manchester City.</p> </div> <div class="player"> <img src="images/players/player-two.jpeg" alt=""> <h3><NAME></h3> <p>The Portuguese left-back has arrived from Benfica, having produced seven assists in 41 appearances across all competitions for the club.</p> </div> <div class="player"> <img src="images/players/player-three.jpg" alt=""> <h3><NAME></h3> <p>The north London club start their campaign at home to champions Manchester City, while they also face Chelsea and Arsenal in the first six Gameweeks.</p> </div> <div class="player"> <img src="images/players/player-four.jpg" alt=""> <h3><NAME></h3> <p><NAME> is an Argentine professional footballer who plays as a centre-back for Premier League club NU.</p> </div> <div class="player"> <img src="images/players/player-five.jpg" alt=""> <h3><NAME></h3> <p><NAME> is a French professional footballer who currently plays for Premier League side Norwich City as an attacking midfielder.</p> </div> <div class="player"> <img src="images/players/player-six.jpg" alt=""> <h3><NAME></h3> <p><NAME> is a Norwegian professional footballer who plays as a forward for Premier League club Watford and the Norway national team. </p> </div> <div class="player"> <img src="images/players/player-seven.jpg" alt=""> <h3><NAME></h3> <p>Oghene<NAME> is a Nigerian professional footballer who plays as a midfielder for Watford on loan from Stoke City and the Nigerian national team.</p> </div> <div class="player"> <img src="images/players/player-eight.jpg" alt=""> <h3><NAME>ya-Mebude</h3> <p><NAME>ya-Mebude is a Scottish professional footballer who plays as a striker for Watford. </p> </div> <div class="player"> <img src="images/players/player-nine.jpg" alt=""> <h3><NAME></h3> <p><NAME> "Cucho" <NAME> is a Colombian footballer who plays for Watford. Mainly a striker, he can also play as a winger.</p> </div> <div class="player"> <img src="images/players/player-ten.jpg" alt=""> <h3><NAME></h3> <p><NAME> is a French professional footballer who plays as a left-back for Premier League club Wolverhampton Wanderers.</p> </div> <div class="player"> <img src="images/players/player-eleven.jpeg" alt=""> <h3><NAME></h3> <p><NAME> is a Norwegian professional footballer who plays as a striker for Bundesliga club Borussia Dortmund and the Norway national team.</p> </div> <div class="player"> <img src="images/players/player-twelve.jpg" alt=""> <h3><NAME></h3> <p><NAME> MBE is an English professional footballer who plays as a striker for Premier League club Tottenham Hotspur and captains the England national team.</p> </div> </div> </section> <!--Players List Section End --> <!--Player Transfer Table Start--> <section class="transfer-table"> <table> <caption> <h2>Players added to FPL</h2> </caption> <thead> <tr> <th>Player</th> <th>Club</th> <th>Position</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td class="player-name"><NAME></td> <td>ARS</td> <td>DEF</td> <td>£4.5m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>NEW</td> <td>DEF</td> <td>£4.5m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>NOR</td> <td>MID</td> <td>£5.0m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>WAT</td> <td>FWD</td> <td>£5.5m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>WAT</td> <td>MID</td> <td>£4.5m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>WAT</td> <td>FWD</td> <td>£4.5m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>WAT</td> <td>FWD</td> <td>£5.0m</td> </tr> <tr> <td class="player-name"><NAME></td> <td>WOL</td> <td>DEF</td> <td>£4.5m</td> </tr> </tbody> </table> </section> <!--Player Transfer Table End--> <!--Latest News Section Start--> <h2>Latest News</h2> <section class="latest-news"> <article class="news-box"> <img src="images/news/news-one.jpg" alt=""> <p>Transfer</p> <h3>Summer 2021 Latest Transfer & News</h3> <a href="#">Read More</a> </article> <article class="news-box"> <img src="images/news/news-two.jpg" alt=""> <p>Feature</p> <h3>Club Step Up Pre-Season Preparation</h3> <a href="#">Read More</a> </article> <article class="news-box"> <img src="images/news/news-three.jpeg" alt=""> <p>News</p> <h3>Premier League Club Summber Friendly Fixtures</h3> <a href="#">Read More</a> </article> </section> </main> <!--Footer Section Start--> <footer> <div class="footer-logo"> <img src="images/football.png" alt=""> <h3><i>Football</i></h3> </div> <div class="font-icon"> <i class="fab fa-instagram shadow"></i> <i class="fas fa-baseball-ball shadow"></i> <i class="fab fa-twitter shadow"></i> <i class="fab fa-youtube shadow"></i> </div> <div class="copy-right"> <h3>Copyright &copy; 2022 Football</h3> </div> </footer> </body> </html>
09bad364c8fab89b5938dcef3b8ada0ba87e3236
[ "HTML" ]
1
HTML
sanjit43/football-responsive
ab3317b1863d007e8544edbd41d406cccd3b8f93
789ccf0982e1f4907055d2c35db55b4ba59dd85a
refs/heads/master
<file_sep># GAM gilet aide malvoyant programme
b3a7395a0817eabc98e4dc253726b50257b155e9
[ "Markdown" ]
1
Markdown
ccsolen/GAM
febcee12df270b680a54bea230600bba8f85b936
4bef027bd930e300392fa1cbdced5f2092e0671f
refs/heads/master
<file_sep>import React, { useContext } from "react"; import * as FontAwesomeIcons from "react-icons/fa"; import * as Ionicons4 from "react-icons/io"; import { NavLink as Link } from "react-router-dom"; import { NavigationContext } from "../../contexts/NavigationContext"; import ChicodeLogo from "../../source/chicodeLogo.PNG"; const Navbar = () => { const { sidebarToggle } = useContext(NavigationContext); return ( <nav id='navbar-container' className='relative h-14'> <div className='fixed flex flex-row justify-between items-center bg-white px-5 h-14 shadow-sm w-full z-10'> <div id='left' className='flex flex-row items-center justify-items-start'> <span onClick={sidebarToggle} className='text-2xl mr-2 cursor-pointer'> <Ionicons4.IoMdMenu /> </span> <span> <Link to='/'> <img src={ChicodeLogo} alt='Chicode Logo' className='h-8 w-10' /> </Link> </span> </div> <div id='right'> <ul className='flex flex-row items-center justify-end text-gray-500'> <li className='text-xl'> <Link to='/'> <FontAwesomeIcons.FaBell /> </Link> </li> <li className='text-4xl mx-4'> <Link to='/'> <FontAwesomeIcons.FaCircle /> </Link> </li> <li className='text-xl'> <Link to='/'> <FontAwesomeIcons.FaAngleDown /> </Link> </li> </ul> </div> </div> </nav> ); }; export default Navbar; <file_sep>import React, { useContext } from "react"; import * as FontAwesomeIcons from "react-icons/fa"; import * as BootstrapIcons from "react-icons/bs"; import * as Ionicons4 from "react-icons/io"; import { NavigationContext } from "../../contexts/NavigationContext"; import ChicodeLogo from "../../source/chicodeLogo.PNG"; const Sidebar = () => { const { sidebarToggle, sidebarActive } = useContext(NavigationContext); return ( <div id='sidebar-container' className={`fixed top-0 left-0 bg-white h-full shadow-lg z-20 overflow-hidden ${ sidebarActive ? "p-5 w-56" : "p-0 w-0" }`}> <div className='flex flex-row items-center justify-between mb-3'> <span> <img src={ChicodeLogo} alt='Chicode Logo' className='h-8 w-10' /> </span> <span onClick={sidebarToggle} className='text-xl cursor-pointer'> <Ionicons4.IoMdClose /> </span> </div> <div className='mb-3'> <span className='uppercase text-lg'>Manage</span> </div> <div> <ul> <li className='sidebar-item'> <div className='mr-2'> <FontAwesomeIcons.FaUser /> </div> <div>Users</div> </li> <li className='sidebar-item'> <div className='mr-2'> <FontAwesomeIcons.FaSun /> </div> <div>Skill</div> </li> <li className='sidebar-item'> <div className='mr-2'> <Ionicons4.IoIosStats /> </div> <div>Reports</div> </li> <li className='sidebar-item'> <div className='mr-2'> <BootstrapIcons.BsGraphUp /> </div> <div>Analytics</div> </li> <li className='sidebar-item'> <div className='mr-2'> <BootstrapIcons.BsInfoCircleFill /> </div> <div>Announcements</div> </li> </ul> </div> </div> ); }; export default Sidebar; <file_sep>import { Line } from "react-chartjs-2"; import React from "react"; const GraphDataDisplayPerCountry = () => { const data = { labels: [ "Monday", "Tuesday", "Wednesday", "Thursday ", "Friday", "Saturday", "Sunday", ], datasets: [ { data: [65, 59, 80, 81, 56, 55, 40], fill: false, borderColor: "rgb(56,123,255)", tension: 0.1, }, ], }; const options = { plugins: { legend: { display: false, }, }, }; return ( <> <Line data={data} options={options} /> </> ); }; export default GraphDataDisplayPerCountry; <file_sep>import React, { useContext } from "react"; import GraphDataDisplayTopDeath from "./GraphDataDisplayTopDeath"; import { v4 as uuidv4 } from "uuid"; import { Covid19Context } from "../../contexts/Covid19Context"; import NumberFormat from "react-number-format"; const DataDisplayTopDeath = () => { const { totalDeaths, topDeathCountry } = useContext(Covid19Context); return ( <div id='data-display-top-death-container'> <div className='flex flex-col justify-center items-start mb-2'> <span>Total Global Patient Deaths</span> <span className='text-4xl'> <NumberFormat value={totalDeaths} thousandSeparator={true} displayType={"text"} /> </span> </div> <div className='mb-5'> <GraphDataDisplayTopDeath topDeathCountry={topDeathCountry} /> </div> <div id='table-top-death' className='overflow-y-scroll'> <div className='flex flex-row justify-between items-center border-white border-b-2 pb-1'> <span className='font-semibold capitalize'> Top death cases country </span> <span className='font-semibold capitalize'>Death patient</span> </div> <div className='divide-y-2'> {topDeathCountry.map((item) => ( <div key={uuidv4()} className='top-deaths-cases-item'> <span>{item.countryRegion}</span> <span> <NumberFormat value={item.deaths} thousandSeparator={true} displayType={"text"} /> </span> </div> ))} </div> </div> </div> ); }; export default DataDisplayTopDeath; <file_sep>import React from "react"; import { Bar } from "react-chartjs-2"; const GraphDataDisplayTopDeath = ({ topDeathCountry }) => { const options = { scales: { y: { beginAtZero: true, display: false, }, x: { display: false, }, }, plugins: { legend: { display: false, }, }, }; const data = { labels: topDeathCountry.map((item) => item.countryRegion), datasets: [ { data: topDeathCountry.map((item) => item.deaths), backgroundColor: "rgba(255,255,255,0.8)", }, ], }; return ( <> <Bar data={data} options={options} /> </> ); }; export default GraphDataDisplayTopDeath; <file_sep>import React, { useContext, useState } from "react"; import GraphDataDisplayTopCountry from "./GraphDataDisplayTopCountry"; import { Covid19Context } from "../../contexts/Covid19Context"; const DataDisplayTopCountry = () => { const { topDeathCountry, topRecoveredCountry, topConfirmedCountry } = useContext(Covid19Context); const [dataType, setDataType] = useState("confirmed"); return ( <> <div className='flex-1 mb-5'> <span className='capitalize text-lg font-semibold text-gray-800'> countries with the highest number of cases </span> </div> <div className='bg-white flex-1 w-full overflow-hidden'> <div className='w-full flex flex-row items-start mb-3'> <div onClick={() => setDataType("confirmed")} className={`cursor-pointer p-2 border-t-4 ${ dataType === "confirmed" ? "border-green-500" : "border-transparent" }`}> <span>Confirmed</span> </div> <div onClick={() => setDataType("deaths")} className={`cursor-pointer mx-2 p-2 border-t-4 ${ dataType === "deaths" ? "border-green-500" : "border-transparent" }`}> <span>Deaths</span> </div> <div onClick={() => setDataType("recovered")} className={`cursor-pointer p-2 border-t-4 ${ dataType === "recovered" ? "border-green-500" : "border-transparent" }`}> <span>Recovered</span> </div> </div> <div className='px-3 mb-3'> <GraphDataDisplayTopCountry casesData={ dataType === "confirmed" ? topConfirmedCountry : dataType === "deaths" ? topDeathCountry : topRecoveredCountry } dataType={dataType} /> </div> <div className='border-t-2 border-gray-400 p-2'> <select name='time_span' id='time_span' className='focus:outline-none cursor-pointer'> <option value='last7days'>Last 7 days</option> <option value='last7days'>Last 30 days</option> </select> </div> </div> </> ); }; export default DataDisplayTopCountry; <file_sep>import React from "react"; import Navbar from "./components/Navbar"; import Sidebar from "./components/Sidebar"; import { BrowserRouter as Router } from "react-router-dom"; import DataDisplayPerCountry from "./components/DataDisplayPerCountry"; import DataDisplayTopDeath from "./components/DataDisplayTopDeath"; import DataDisplayTopRecovered from "./components/DataDisplayTopRecovered"; import DataDisplayTopConfirmed from "./components/DataDisplayTopConfirmed"; import DataDisplayTopCountry from "./components/DataDisplayTopCountry"; const App = () => { return ( <Router> <Navbar /> <div id='main-and-sidebar-container' className='flex flex-row'> <Sidebar /> <main id='main-content-container'> <div className='flex-1 mb-2'> <span className='text-lg font-semibold text-gray-800'> Chicode Home </span> </div> <div className='flex flex-col justify-center items-center md:flex-row md:justify-between md:items-start mb-5'> <DataDisplayPerCountry /> <DataDisplayTopDeath /> </div> <div className='flex flex-col justify-center items-center md:flex-row md:justify-between md:items-start mb-5'> <DataDisplayTopRecovered /> <DataDisplayTopConfirmed /> </div> <div id='data-display-top-country'> <DataDisplayTopCountry /> </div> </main> </div> </Router> ); }; export default App; <file_sep># Project Description :bread: This is a website created to meet the tests given by Chicode Development. This website is used to calculate the total cases of the Covid 19 virus outbreak, such as the number of cases of death, cases of recovery, and confirmed cases. <img src="./covid_tracker_interview_chicode-test-demo.gif" width="100%" height="500px"/> # Project Link :link: You can see the results of this project by opening the following link [https://interview-chicode-test-covid-tracker.vercel.app/](https://interview-chicode-test-covid-tracker.vercel.app/) # Tools :hammer_and_wrench: The applications used in this project are as follows : - Visual Studio Code - Postman # Language :computer: The language used in this project is as follows : - HTML - CSS - Javascript # Framework and API :triangular_ruler: The framework and API used in this project is as follows : - React Js - Context API - Tailwindcss - [COVID19.MATHDROID](https://covid19.mathdro.id/api/) <file_sep>import React, { createContext, useState } from "react"; export const NavigationContext = createContext(); const NavigationContextProvider = (props) => { const [sidebarActive, setSidebarActive] = useState(false); const sidebarToggle = () => { setSidebarActive(!sidebarActive); }; return ( <NavigationContext.Provider value={{ sidebarActive, sidebarToggle }}> {props.children} </NavigationContext.Provider> ); }; export default NavigationContextProvider;
abffdc2b07f29ef594ddf5ede983b6d484f73bb2
[ "Markdown", "JavaScript" ]
9
Markdown
AwangPraja01/interview_chicode_test_covid_tracker
9af8c286e96b80d16cf382c80dbde719d9c18155
9d2cc1b43e03b797d7f9590f5fcd7598951ed36f
refs/heads/main
<repo_name>callistusikeata/stock-analysis<file_sep>/README.md Purpose The purpose of this project is to refactor a Microsoft Excel VBA code to collect total volume stock information in the year 2017 and 2018 and determine whether the stocks are worth investing. This process was initially executed in a similar format, but the goal is editing the previous code to improve the efficiency in the recent one. The Data Data presented contains two charts with stock information on 12 different stocks. The stock information contains a ticker value, the date the stock was issued, the opening, closing and adjusted closing price, the highest and lowest price, and the volume of the stock. The aim is to retrieve the ticker, the total daily volume, and the return on each stock. Results I started by copying the code needed to create the input box, chart headers and ticker array. Activate the appropriate worksheet and followed the steps listed to set the refactoring structure. See below instruction and code as written in the file: '1a) Create a ticker Index tickerIndex = 0 '1b) Create three output arrays Dim tickerVolumes(12) As Long Dim tickerStartingPrices(12) As Single Dim tickerEndingPrices(12) As Single ''2a) Create a for loop to initialize the tickerVolumes to zero. For i = 0 To 11 tickerVolumes(i) = 0 tickerStartingPrices(i) = 0 tickerEndingPrices(i) = 0 Next i ''2b) Loop over all the rows in the spreadsheet. Worksheets("2017").Activate For i = 2 To RowCount '3a) Increase volume for current ticker tickerVolumes(tickerIndex) = tickerVolumes(tickerIndex) + Cells(i, 8).Value '3b) Check if the current row is the first row with the selected tickerIndex. 'If Then If Cells(i, 1).Value = tickers(tickerIndex) And Cells(i - 1, 1).Value <> tickers(tickerIndex) Then tickerStartingPrices(tickerIndex) = Cells(i, 6).Value End If '3c) check if the current row is the last row with the selected ticker 'If Then If Cells(i, 1).Value = tickers(tickerIndex) And Cells(i + 1, 1).Value <> tickers(tickerIndex) Then tickerEndingPrices(tickerIndex) = Cells(i, 6).Value End If '3d Increase the tickerIndex. If Cells(i, 1).Value = tickers(tickerIndex) And Cells(i + 1, 1).Value <> tickers(tickerIndex) Then tickerIndex = tickerIndex + 1 End If 'End If Next i '4) Loop through your arrays to output the Ticker, Total Daily Volume, and Return. For i = 0 To 11 Cells(4 + i, 1).Value = tickers(i) Cells(4 + i, 2).Value = tickerVolumes(i) Cells(4 + i, 3).Value = tickerEndingPrices(i) / tickerStartingPrices(i) - 1 Next i According to findings, 2017 was a better year for most of the stock compared to 2018. Despite poor stock performances for 2018, few stocks like ENPH and RUN still maintained profitability with RUN being the most appreciated and profitable stock for the year. TERP stock continuous to experience further decline. Consequently, it is advised that the stock is taken off the books. Pros and Cons of Refactoring Code Refactoring helps make our code readable, organized and easily understandable. A few advantages of an organized and clean code entails design and software improvement, debugging, and faster programming. It also benefits other users who view projects on a later date as it is easier to read, more concise and straightforward. The cons of refactoring code includes introduction of bugs that may complicated the code and make it hard to debug, and also it can be time consuming. The Advantage of Refactoring Stock Analysis The most significant advantage of the refactoring was a decrease in macro run time. The original analysis took approximately one second to run, whereas our new analysis only took about a four of the time (approximately 0.25 seconds) to run.
b50d86afb35676aa75e9fee891327563e77869dd
[ "Markdown" ]
1
Markdown
callistusikeata/stock-analysis
605246493b1cd17aa3433fd8bbade6c6f1f80073
4703fcdc409571e005df373915cf456f8fdb2e3b
refs/heads/master
<repo_name>roubingxiong/roubingxiong<file_sep>/LearnPython/learning.py # -*- coding: UTF-8 -*- import sys print "ella" a=['a', 'b', 'c'] print a[1] print "你好" if True : print "Answer" print "True" else : print "Answer" # 没有严格缩进,在执行时保持 print "False" print 'hello' print "hello" \ "dhf" b=(1,1) ''' ddffa dsasfj ''' ##dfdaf fdf #Name=raw_input('type in your name: ') #print(Name);PWD=raw_input('type in your password:');print(PWD) # data type a=b=c=1 d,e,f=4,5,'abce' print a + b + c #+ f print f[2:3] + f[1:2] #del a print a dict = {} tinydict = {'name': 'john','code':6734, 'dept': 'sales'} print tinydict del tinydict['name'] print tinydict name_list = ['Robin', 'Elaine'] print name_list copyright()
25b7bd41da2c8f5404a26ea2ff7e72c066526e8a
[ "Python" ]
1
Python
roubingxiong/roubingxiong
3d6113ec8fda2273f84f1f7b541f0efa9ae5a84e
9271fe69eef08d8ea1e9214ea997ec7650b66f1f
refs/heads/main
<repo_name>Vadiok/innopolis-test-task<file_sep>/src/App.vue <template> <div id="app"> <validate-component ref="validator" > <some-component> <div> <validate-component /> </div> </some-component> <some-component> <validate-component> <validate-component /> </validate-component> </some-component> <validate-component /> </validate-component> <p> <button type="button" @click.prevent="validate"> Validate </button> </p> </div> </template> <script> import ValidateComponent from './components/ValidateComponent.vue'; import SomeComponent from './components/SomeComponent.vue'; export default { name: 'App', components: { ValidateComponent, SomeComponent, }, methods: { validate() { // eslint-disable-next-line no-unused-expressions this.$refs.validator?.validate?.(); }, }, }; </script> <style> #app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #2c3e50; max-width: 1024px; margin: 60px auto; } #app .header { margin: 8px 0 16px; font-size: 1.2em; font-weight: bold; } </style> <file_sep>/src/components/SomeComponent.vue <template> <div class="component"> <div class="header">Some Component</div> <div class="children"> <slot /> </div> </div> </template> <script> export default { name: 'SomeComponent', }; </script> <style scoped> .component { border: 1px solid #d80; padding: 4px; margin-bottom: 4px; } .children { margin: 4px 4px 4px 16px; border: 1px solid #840; padding: 4px; } </style> <file_sep>/src/components/ValidateComponent.vue <template> <div class="component"> <div class="header">Validate Component</div> <div> Validated: {{ validated }} </div> <div class="children"> <slot /> </div> </div> </template> <script> const COMPONENT_NAME = 'ValidateComponent'; export default { name: COMPONENT_NAME, data: () => ({ validated: 0, }), methods: { validate() { this.validated += 1; const validateOrCheckChildren = (node) => { if (node.componentInstance?.$options?.name === COMPONENT_NAME) { node.componentInstance?.validate?.(); return; } node.children?.forEach((nodeChild) => validateOrCheckChildren(nodeChild)); if (node.componentInstance?.$slots) { Object.keys(node.componentInstance?.$slots).forEach((slotName) => { node.componentInstance.$slots[slotName] ?.forEach((slotNode) => validateOrCheckChildren(slotNode)); }); } }; this.$slots.default?.forEach((node) => validateOrCheckChildren(node)); }, }, }; </script> <style scoped> .component { border: 1px solid #0d8; padding: 4px; margin-bottom: 4px; } .children { margin: 4px 4px 4px 16px; border: 1px solid #084; padding: 4px; } </style>
ca9ee1073d1b0667325644121aca6f56da1d2e84
[ "Vue" ]
3
Vue
Vadiok/innopolis-test-task
16c1958190a6f146bf44d1d25fe65c1851a34028
3d599b37314996b18eb95da0f8ba37c5e6926c84
refs/heads/master
<repo_name>cybersquirrel/itpolicycontent<file_sep>/content/code-of-connection-standard.md --- title: Code of connection standard --- This standard is designed to help protect MoJ ICT systems by providing a standard for the connection of a 3rd party ICT system to a MoJ ICT system. ## Overview ### Introduction A Code of Connection (CoCo) is designed to provide a mechanism to record a formal agreement between a 3rd party organisation and the MoJ on the security measures to be applied by that 3rd party prior to and during any electronic connection with a MoJ ICT system, for example, to facilitate the exchange of data between two case management systems. <a href=https://www.gov.uk/government/publications/security-policy-framework/hmg-security-policy-framework>HMG Security Policy Framework (SPF)</a> mandatory requirements state that: <blockquote>Departments and Agencies must put in place an appropriate range of technical controls for all ICT systems, proportionate to the value, importance and sensitivity of the information held and the requirements of any interconnected systems.</blockquote> In order to meet these requirements, the SPF stipulates that ICT systems must: <blockquote>Comply with the requirements of any codes of connection, multilateral or bilateral international agreements and community or shared services security policies to which they are signatories (e.g. Government Secure Intranet).</blockquote> Policy statements on connecting 3rd party ICT systems and the requirements for a CoCo are covered in IT Security – Technical Controls Policy, while this document sets out the MoJ standard for its implementation. ### Scope This guide applies to all MoJ ICT systems including ICT systems hosted by third party suppliers on behalf of the MoJ where there is a valid business requirement to connect to a 3rd party system. ### Demonstration of Compliance The CESG Information Assurance Maturity Model (IAMM) sets out the minimum maturity level Government departments should attain. Maintaining secure connections is captured as a basic requirement in Level 1 of this model, which the MoJ will need to demonstrate compliance with in their IAMM return to the Cabinet Office. ## Code of Connection ### Context A Code of Connection (CoCo) is designed to provide evidence to the MoJ that a connecting 3rd party understands the security controls and procedures required to connect to a MoJ ICT system and that those controls and procedures have been implemented. The aim here is to ensure that the risks associated with connecting ICT systems together are sufficiently mitigated in the technical solution and managed on an ongoing basis during live operation. <strong>Note:</strong> This standard is based on connecting a RESTRICTED-IL3 MoJ ICT system with an Accredited 3rd party RESTRICTED-IL3 ICT system where all electronic communication is over an Accredited RESTRICTED-IL3 network/s and/or RESTRICTED-IL3 communications channel. Where this is not the case, advice must be sort from the IT Security Officer (ITSO) and system Accreditor. A generic CoCo (based on the note above) is provided in Appendix A; it is split into two sections: * basic requirement (see section A.1) – The section outlines the base set of CoCo requirement which need to be met by the connecting 3rd party * supporting compliance statement (see section A.2) – This section contains a series of compliance statements based on ISO 27001 and the IAS 1&2 Baseline Controls Set (BCS) [Ref, 5]. It is designed to provide a mechanism for a connecting 3rd party to supply compliance evidence to the system Accreditor. Section 3.2 provides details on how this compliance statement should be applied. <strong>Note:</strong> A signed CoCo between the MoJ and the connecting 3rd party is required before the connection can go into live operation. ### Managing the risk of connectivity In order to ensure that the connectivity and sharing of electronic data between a MoJ ICT system and a 3rd party ICT system does not cause undue risk from one participating organisation to another, each organisation must reasonably comply with the code of connection to ensure any risks are managed effectively. The need for a CoCo and its application will be determined by the MoJ system Accreditor who will consider the risks involved, this may require the production of a technical risk assessment and/or RMADS for the connection (further details on RMADS can be found in the Accreditation Framework, [Ref, 7]). The CoCo condition and compliance statement contained within the generic CoCo document (see A.1.3) provide a good platform to judge whether the assurance level of the connecting 3rd party ICT system is sufficient rather than just relying on its accreditation status. A risk based approach must be taken to the application of security controls associated with the connection. The generic CoCo (see Appendix A) provides a baseline by which a 3rd party ICT system’s connection to a MoJ ICT system will be assessed. The MoJ system Accreditor will provide a steer as to how this should be applied, where the default steer is that the guidance provided in IAS 1&2 Baseline Controls Set (BCS) [Ref, 5] at the DETER level should be applied. It is highly likely that the connection between the two systems will be over the GSi. If so, the 3rd party organisation is likely to have completed the GSi Code of Connection for that system connection. The information requested in the generic CoCo is similar to that required for the GSi CoCo and as such should be readily available. <strong>Note:</strong> Depending on the protocols being used, the GSi authority may need to be contacted. ### Completing a Code of Connection The IT System Manager and/or ITSO for the connecting 3rd party organisation must review CoCo and submit the supporting compliance statement to the MoJ system Accreditor along with any supporting documentation. In completing the CoCo statement, the connecting 3rd party organisation confirms that they have implemented all the controls required, it should be noted that the adoption of these controls will not totally mitigate all the risks involved whether to the 3rd party’s own ICT system or to the connecting MoJ ICT system. Where the connecting 3rd party ICT system does not comply with the controls outlined in the CoCo, the IT System Manager and/or ITSO must provide supporting comments including a high-level plan that outlines the expected timeline to meet them. An approval from the MoJ system Accreditor is required prior to the connection going into live operation. <file_sep>/ReviewList.md --- title: Review list --- # Ministry of Justice Last updated: 1 Nov 2017 ## **Draft** IT Policy Content | Title | GitHub Draft | Intranet preview | |---|---|---| | Acceptable use | <https://ministryofjustice.github.io/itpolicycontent/content/acceptable-use.html> | <https://intranet.justice.gov.uk/?page_id=106474> | | Forensic Readiness Policy | <https://ministryofjustice.github.io/itpolicycontent/content/forensic-readiness-policy.html> | <https://intranet.justice.gov.uk/?page_id=106576> | | Forensic Readiness Standard | <https://ministryofjustice.github.io/itpolicycontent/content/forensic-readiness-standard.html> | <https://intranet.justice.gov.uk/?page_id=106621> | | Forensic Readiness Guide | <https://ministryofjustice.github.io/itpolicycontent/content/forensic-readiness-guide.html> | <https://intranet.justice.gov.uk/?page_id=106976> | | IT Incident Management Policy | <https://ministryofjustice.github.io/itpolicycontent/content/it-incident-management-policy.html> | <https://intranet.justice.gov.uk/?page_id=107825> | | Principles for IT Policy and Guidance | <https://ministryofjustice.github.io/itpolicycontent/content/principles-for-it-policy-and-guidance.html> | <https://intranet.justice.gov.uk/?page_id=106453> | | BYOD | <https://ministryofjustice.github.io/itpolicycontent/content/using-your-own-smartphone-laptop-tablet-or-pc-for-work.html> | <https://intranet.justice.gov.uk/?page_id=108816> | ## **Draft** Migrated Policy Content, Confluence -> Intranet | Title | GitHub Draft | Intranet preview | |---|---|---| | Code of Connection Standard | <https://ministryofjustice.github.io/itpolicycontent/content/code-of-connection-standard.html> | <https://intranet.justice.gov.uk/?page_id=107373> | | Data Handling and Information Sharing Guide | <https://ministryofjustice.github.io/itpolicycontent/content/data-handling-and-information-sharing-guide.html> | <https://intranet.justice.gov.uk/?page_id=106420> | | ICT Security Policy | <https://ministryofjustice.github.io/itpolicycontent/content/ict-security-policy.html> | <https://intranet.justice.gov.uk/?page_id=108966> | | HMG Cryptography Business Continuity Management Standard | <https://ministryofjustice.github.io/itpolicycontent/content/hmg-cryptography-business-continuity-management-standard.html> | <https://intranet.justice.gov.uk/?page_id=109705> | | System Test Standard | <https://ministryofjustice.github.io/itpolicycontent/content/system-test-standard.html> | <https://intranet.justice.gov.uk/?page_id=109963> | <file_sep>/content/hmg-cryptography-business-continuity-management-standard.md --- title: HMG Cryptography Business Continuity Management Standard --- All HMG encryption is procured from CESG which is the National Technical Authority for Information Assurance and is based in GCHQ. It is typically produced to support a CAPS product which means that it has gone through rigorous testing to give HMG assurance that it is secure. HMG Cryptography is produced under special circumstances to provide additional assurance and that process, distribution and storage of this material is protected and secure. HMG has specific standards on the management of Crypto and other associated products called the HMG IS4, it is the policy of the MoJ to follow and comply with HMG IS4 and this document is intended to support and augment that standard. ## Encryption Media ### Types of encryption and how they are distributed Key Variables are typically loaded onto Floppy discs, or CD. #### Hard disc encryption Products such as Becrypt, Eclypt and Bitlocker are procured and distributed to by suppliers through the MoJ Crypto Custodian and transferred to them to deploy and manage for the lifetime of the key variable which is determined by the CESG Security Operating Procedures (SyOPs). #### Transmission encryption Products such as XKryptor, Datacryptor and Ultra AEP are procured and managed by the MoJ Crypto Custodian and distributed to suppliers as and when necessary and returned to the MoJ Crypto Custodian for storage. ### Segregation and supersession Key variables that are issued from CESG are typically issued with two editions. The first is for immediate deployment and the second is for emergency supersession. In the case of hard disc encryption the supplier holds the live edition and the MoJ Crypto Custodian holds any others. All supplier crypto deployment environments are not at the same site as the MoJ Crypto Custodian and this provides natural segregation of the editions. Eclypt uses a lifetime key variable and does not have more than one edition, In the event of compromise, the usual CINRAS report and request to CESG for emergency replacement of the key variable will be required. ## Protection of Key Variables All encryption is stored in a CPNI Class 4 safe which also has a certified 2 hour burning time. Above the safe is a fire suppressant sprinkler system. Access to the safe is strictly limited to the MoJ Crypto Custodian and the Alternate Crypto Custodian. A copy of the master code for the safe is stored with the Departmental Security Officer. Only the DSO or ITSO are permitted to open the safe in the event of an emergency. ### Work ethic with key variables The area that the MoJ Custodian works is open plan in an accredited IL3 environment. The DSO has further accredited the immediate area surrounding the MoJ Crypto Custodian in 5.31 of 102 Petty France for Crypto Management on the understanding that the personnel surrounding him are SC cleared and because there are desks immediately by the safe to allow a clear line of site from the Custodian’s desk to the safe. All key variables must be kept in the safe and only removed when specific action is required on a key variable. ## Emergency procedures for evacuation and invacuation Applicable to anyone who has access to any of the safes: 1. If the alarms sound return all encryption that is out and in use to the fireproof safe. 2. **Lock and check** all safes are secure. 3. Leave by the nearest exit in accordance with Fire Evacuation procedures. ## Post action to emergency evacuation and invacuation If there has been any damage to any of the encryption stored at the MoJ: * Notify CESG immediately on 01242 221491 extension 31950 notifying them of the event and request an immediate record of holdings list. * A CINRAS report must be generated and issued to [<EMAIL>](mailto:<EMAIL>) and a copy to [<EMAIL>](mailto:<EMAIL>) * A muster of all key variables and a check against the record of holding list undertaken and an order to CESG raised of any replacement key variables. * Upon receipt of a replacement key variable emergency plans to change the key variable of the associated product must begin.<file_sep>/content/offshoring-guide.md --- title: Offshoring Guide --- ## Introduction ### Document Purpose This document is the MoJ ICT Information Assurance (IA) Policy and Guidance for offshoring of MoJ Information Systems, development, or other support services. The document states the IA requirements that must be complied with for offshore developments, and presents considerations to be taken into account when deciding whether to offshore an element of MoJ capability. This document has not been developed in isolation. It draws heavily and intentionally on other guidance, particularly HMG Good Practice Guide (GPG) 6: Outsourcing & Offshoring: Managing the Security Risks. This document collates the high-level points from the CESG and CPNI guidance, and interprets these in the context of the MoJ. The target audience for this document includes MoJ personnel with a requirement to make offshoring decisions; and MoJ suppliers who are considering, or currently engaged in, delivery of MoJ capabilities with an offshore element. ### Background #### General Some suppliers are keen to offshore elements of IT service delivery, due to a perception that this will reap strong financial benefits. Reasons often cited for offshoring decisions include: cost savings in wages and other business expenses relative to the domestic (UK) market; access to specific specialist technical skills; and access to a large labour pool to support peak loading or large-scale projects. Offshoring is not, however, without its potential issues. Badly managed offshoring of a project can lead to over-runs in project costs and timescales which eclipse any anticipated benefits. In the worst cases, project over-spend, over-run and quality issues can lead to project failure. Also, there are a number of scenarios where offshoring would introduce unmanageable risks; and/or result in a direct breach of UK law; and/or result in unexpected financial exposure for the MoJ. These risks are not necessarily a blocker to offshoring, but must be balanced carefully against the anticipated benefits. #### Quality, Cost and Time Offshoring presents a range of ubiquitous project risks which must be considered. There can be a tendency to over-estimate the savings that can be made, and to underestimate the potential configuration management and integration issues. Much of the cost saving from offshore development comes from the labour-cost-differential between the UK and favoured offshore locations. High levels of inflation as those economies expand, often through development as offshore centres, can shrink or even overwhelm any predicted cost savings. This may make the supplier's position untenable. Cultural differences can also exaggerate normal project stress points that occur during integration and handover of outsourced elements. Customers and suppliers often fail to fully appreciate increased incidental costs, e.g. due to the additional testing overhead incurred. The long delivery chain can also become a difficulty to manage. In some less stable locations, risks due to war, civil uprising and the availability of Critical National Infrastructure also lead to unique business continuity issues. #### Legal Risk Offshore projects may also fall foul of more pedestrian but no less severe risks due to local laws at the offshore location. It is important to ask questions such as: to what extent are the contractual conditions legally binding for an offshore company in a proposed location; how difficult and expensive would it be to mount a legal challenge in the case of contract breach, and is this any less likely to be successful; and who would have priority over information and other assets in the event of a dispute. This is not just an issue which the MoJ will face when engaging an offshore supplier directly; it is also an issue that MoJ's suppliers will face, but may not be aware of, when subcontracting elements of delivery. #### Risk to "UK PLC" Many MoJ information systems handle HMG Protectively Marked and/or personal and sensitive personal data. These add a number of specific risks over-and-above the more usual project risks. Local data protection laws may not provide an appropriate level of legal protection, for the data or data subjects involved, against rogue individuals and criminal groups who misappropriate personal data. This may be more of a problem for countries outside of the European Economic Area (EEA), where the legal framework may not be familiar. Commercially sensitive information may be similarly at risk. Political instability may lead to facilities being over-run, which as well as having business continuity implications may also have severe consequences from potential disclosure of Protectively Marked information. Also, organised criminals are able to operate more actively and openly in some overseas jurisdictions. Such activity may be driven by political or economic advantage. It is not only the physical site but also application development that can present a risk to data. A vulnerability or backdoor, engineered into an application either maliciously or inadvertently, could be used to leak information over an extended period or even indefinitely without being identified. The Open Web Application Security Project (OWASP)[1] presents a list of common vulnerabilities that occur due to careless programming and ineffectual testing. Deliberately engineered vulnerabilities and backdoors are considerably more difficult to identify and address. #### Personnel Risks Most people are reliable and honest. However, for work on systems which will handle sensitive Government information, a small number of unreliable or dishonest individuals can cause a disproportionate amount of harm. It is critical, therefore, to identify such high-risk individuals. Pre-employment screening is a critical element in helping to do this, along with aftercare to balance risks identified during screening, and monitor changes to an individual's status that may affect their reliability. Similarly, legal defences provide a complementary means to deter inappropriate behaviour. ### Scope This document covers offshoring of MoJ business activities. Offshoring is defined here to include development or provision of services, from outside the UK or otherwise using non-UK resources, for domestic (UK) consumption. The scope of offshoring is a broad one. This may involve, for example: - Development of applications, and/or provision of second-line and/or third-line support for these applications, from non-UK locations and/or by non-UK Nationals. - Follow-the-sun technical support for commercial products, so that suitable technical resources are available at times when domestic support would be unsociable. - Remote managed services for wholesale provision of MoJ capabilities from non-UK locations and/or by non-UK Nationals. - Other provision of support to the MoJ from non-UK locations and/or by non-UK Nationals. The scenarios which are to be treated as offshoring are set out in the bulleted list below. This is not necessarily an exhaustive list; in case of uncertainty please contact MoJ ICT IA for advice. - Near-shoring: covers scenarios where development is to be transferred to other countries within the European Economic Area (EEA), where legislation on key issues such as data protection, electronic communications and human rights is broadly aligned with UK legislation. It should be noted that although key legislation is broadly aligned across the EEA by a requirement to meet common EU Directives, the legislation that has been implemented by different EEC nations in order to comply with these directives has some important differences. - Far-shoring: covers scenarios where development is to be transferred to locations outside of the EEA. Far-shoring may enable more cost-effective development than near-shoring, or may enable access to specific technical skills. However, far-shoring may require additional National Security and/or legislative considerations to be taken into account relative to near-shoring. - Landed resources: covers scenarios where resources from outside the UK are brought to the UK. This may be, for example, to provide: low-cost labour, specialised skill-sets, and/or support for peak loads. Use of landed resources makes it possible to obtain considerably more control over the working environment of non-UK Nationals on HMG programmes, and can enable a more robust screening and aftercare regime for personnel, traded off against increased development costs. - Captive centres: refers to an office that forms part of a Government department but is physically located outside the UK. - Any other activity using non-UK locations and/or non-UK Nationals to deliver elements of HMG capability. ### Exclusions from Scope Exclusion 1: This document does not address UK or overseas legislation. The MoJ legal team, the MoJ Data Access and Compliance Unit (DACU), and the MoJ Data Protection EU and International Policy Teams must be consulted on legal issues. Exclusion 2: This document also does not address protection of individuals' personal data, except within the context of HMG Security Policy. The Data Access and Compliance Unit (DACU) must be consulted on personal data, the DPA, and related issues. With the exception of Landed Resources, deployment to locations within the UK does not count as offshoring and is therefore beyond the scope of this document. It is noted, however, that there will be other geographical factors to be taken into account even within the UK. For example, there are special security arrangements for Northern Ireland, and different freedom of information legislation between England and Scotland. These differences should in no way be considered as a justification not to outsource to other UK locations, but would need to be addressed in the local controls deployed. Outsourcing is beyond the scope of this document, except insofar as outsourcing arrangements are directly related to offshoring requirements (e.g. contractual obligations to be included in supplier contracts and subcontracts). Outsourcing is defined by HMG GPG6 [Ref, A] as: *"a contractual relationship with an external vendor that is usually characterised by the transfer of assets, such as facilities, staff or hardware. It can include facilities management (for data centres or networks), application development and maintenance functions, end-user computing, or business process services."* ### Document Overview The remainder of this document is structured as follows: - The relevant [IA Constraints and Considerations](#ia-constraints-and-considerations) for offshoring. - A checklist of [assessment activities](#assessment-activities) at different points in the development lifecycle. <a id="ia-constraints-and-considerations"></a> ## IA Constraints and Considerations ### General There are a number of specific IA Constraints which must be satisfied by any MoJ offshoring arrangements. There are also a number of key considerations that must be borne in mind in deciding whether to offshore a particular capability or service. This section of the document sets out the general IA requirements and constraints that must be complied with when offshoring MoJ capabilities. This document is derived from some of the good but generic CESG and CPNI documentation on the subject, outlined in the Further Reading section. This guidance should not be used as a substitute for engagement with the MoJ Accreditor or with MoJ ICT IA, who will be able to provide tailored guidance to support individual decisions; it is intended more as general guidance on MoJ policy, to support initial decision-making and project planning. ### Accountability The development or management of a capability can be outsourced, however, ultimate accountability and responsibility for a capability remains with the end-customer for that capability: in this case the MoJ. The MoJ remains accountable for work performed by third parties on its behalf, whereas outsourcing and offshoring can make it difficult to directly identify and manage information risks and issues. Strong governance and clear lines of accountability and responsibility are required to address this. <a id="requirement-1"></a> [REQUIREMENT 1](#requirement-1-assessment): The MoJ remains ultimately responsible for the security and overall delivery of offshore application development and other services. All supplier and subcontractor contracts must ensure that the MoJ retains overall control over all security-relevant elements of the delivery. The enforceability of supplier and subcontractor contracts in overseas jurisdictions must be ratified by MoJ legal experts. If a capability is delivered late, is substandard, fails completely or is compromised, then the MoJ will need to put measures into place to ensure business continuity while a remedial plan is developed and worked through, otherwise essential public services may not be deliverable in the interim. In some cases, the MoJ may find itself financially or legally liable for shortcomings in supplier subcontracts. Also, the MoJ rather than the supplier will almost certainly suffer the brunt of any bad publicity. The core function of the MoJ is to deliver services for the general good, rather than commercial commodities. As such, the impact of failure is not quantifiable in purely financial terms. Failure or compromise of MoJ services cannot therefore be fully remedied through financial penalties in supplier contracts, although financial penalty clauses can nonetheless serve as a motivation for suppliers to deliver on time and to quality. The responsibility of the MoJ for its own security and overall delivery is reinforced within the HMG SPF [Ref, A], at Paragraph 7, under Roles and Responsibilities: *"Accounting Officers (e.g. Head of Department/Permanent Secretary) have overall responsibility for ensuring that information risks are assessed and mitigated to an acceptable level. This responsibility must be supported by a Senior Information Risk Owner (SIRO) and the day-to-day duties may be delegated to the Departmental Security Officer (DSO), IT Security Officer (ITSO), Information Asset Owners (IAOs), supported by the Lead Accreditor."* <a id="requirement-2"></a> [REQUIREMENT 2](#requirement-2-assessment): The MoJ SIRO remains accountable for information risks, including risks to Protectively Marked and personal data, in an offshore context. These risks must be documented and presented to the SIRO, and must be explicitly agreed to before any contract with an offshore element is accepted. In some cases, a submission to the Cabinet Office IA Delivery Group may be necessary. The MoJ Accreditor, MoJ ICT IA, DACU and Legal experts must be engaged by the project team as soon as a potential offshoring requirement is identified, to enable identification of these information risks. Close engagement with these Special Interest Groups must be maintained for the delivery lifetime. This engagement must be formally set out in the delivery plan. The MoJ will bear the main impact of any compromise of the Confidentiality, Integrity and/or Availability of public services that are delivered or managed on its behalf. The ultimate decision on whether the IA risk of outsourcing is acceptable will therefore be made by the SIRO, as advised by the IAO and the MoJ Accreditor. HMG security policy [Ref, A] requires that the SIRO must personal approve all large-scale information-related outsourcing and offshoring decisions. The SIRO is also required to approve the offshoring of personal data sets and, in some cases, submit plans for scrutiny by the Cabinet Office IA Delivery Group. The MoJ Accreditor, MoJ IA function and SIRO must be involved as soon as a potential offshoring proposal is identified, so that a decision on whether the proposal presents an acceptable level of information risk can be made at the earliest opportunity. This limits the likelihood of nugatory work by the project team. The requirement for early and ongoing engagement with the MoJ Accreditor and MoJ IA function is reinforced by HMG GPG6 [Ref, B]: *"The risk assessment and treatment plan must be reviewed by the Accreditor and presented to the SIRO at each stage of the procurement process."* ### Risk Assessment Before any sensible dialogue can be had around whether or not offshoring is acceptable, the value of the assets to be offshored and the threats for the offshore location and/or personnel must be properly understood. Asset valuation and threat assessment must therefore be conducted as an upfront activity for any proposal, and will require early engagement with all interested parties. Risk assessment must be conducted as an initial activity, and regularly revisited as the project progresses. All threat assessment and risk assessment activities will need to be conducted in collaboration between the supplier as risk manager, and the MoJ as the owner of the threat and the risk. <a id="requirement-3"></a> [REQUIREMENT 3](#requirement-3-assessment): All MoJ assets and/or activities to be offshored must be identified, and a Threat Assessment for those assets/activities at the proposed offshore location carried out. This includes not only physical and software assets but also information and service assets. The value and business impact of compromise for each information asset must be determined against the HMG Business Impact Table and MoJ Business Impact guidelines [Ref, G]; valuations must be agreed with the Information Asset Owner for each asset. A Privacy Impact Assessment (PIA) is also required, as discussed further in [Requirement 5](#requirement-5) below. The set of assets to be offshored not only includes any specific capabilities to be developed or managed, but will also include any incidental assets which are required to support these activities. For example: - Development will require test data and schemas which may in themselves attract a Protective Marking or have other particular sensitivities. - Some development activities may be deemed to require real or anonymised data[2], rather than fully synthetic test data, to ensure the robustness of critical applications or to test revised applications against historical data from extant capabilities. - Effective application development may require knowledge of real configuration information to support pre-integration-testing activities, or of broader MoJ network infrastructure designs in order to tailor and optimise development. Some of this information may attract a Protective Marking or have other particular sensitivities. The information shared with offshore developers should be minimised to the fullest extent that is possible. - Poor coding practices often result in sensitive information such as network configuration information, user and administrator credentials, and other sensitive details being hard-coded into applications. Support for development, for third-line support and application maintenance, and for upgrades to MoJ IT capabilities may therefore necessitate some unavoidable access to sensitive information for which there is no specific need-to-know by the development or maintenance team. <a id="requirement-4"></a> [REQUIREMENT 4](#requirement-4-assessment): Sensitive MoJ assets and/or activities should not be offshored to Countries where Special Security Regulations Apply, or to Countries in which there is a Substantial Security Threat to British Interests. It is the policy of the MoJ that Protectively Marked or otherwise sensitive MoJ assets, and development or support activities relating to these assets, should not be offshored to Countries where Special Security Regulations Apply, or to Countries in which there is a Substantial Security Threat to British Interests. The MoJ ITSO can provide further details of these, on a need-to-know basis, in response to specific requests. It is the policy of the MoJ that activities involving Protectively Marked or otherwise sensitive MoJ information should not be offshored to these locations. In cases where there is an exceptionally compelling business case for offshoring to one of these locations, the MoJ ITSO must be consulted and will advise the business on suitability, weighing up all of the relevant factors and assessing the extent to which the proposed compensating controls mitigate the risk. <a id="requirement-5"></a> [REQUIREMENT 5](#requirement-5-assessment): MoJ assets and/or activities should not be offshored to countries where political stability, practical considerations and/or legal issues (e.g. compliance with the DPA) may result in a significantly-above-baseline risk to the confidentiality, integrity and/or availability of Protectively Marked or other sensitive data, or where there is not an adequate level of protection for the rights of data subjects in relation to their personal data. Not all countries which have issues with political and/or economic instability are listed as CSSRA or Substantial Security Threat countries. There are several other countries that are not on the list which nonetheless present a high risk for offshore development and operations. These countries should be avoided on the general principle of avoiding development environments where the local threat is significantly above baseline. Also, as discussed above, the CSSRA and the list of Substantial Security Threat countries change from time to time. By not offshoring in unstable locations, the risk of outsourcing to a country that subsequently ends up on one of these lists is reduced. In addition to the above, there are some politically stable locations where it is nonetheless difficult or impossible to meet other essential requirements for the handling of Protectively Marked or other sensitive data (e.g. personal data). Inability to assure the identity and history of personnel, and local legislation on disclosure of data (for example, in response to local FoI or law enforcement obligations), are common examples which can lead to issues with screening and with retaining control of information. In addition to countries with political and/or economic issues, as discussed above, there may also be threats and risks as a result of other nations' legal systems. Legal constraints in some countries may: - Conflict with IA requirements under the HMG SPF and supporting guidance; - Conflict with requirements under the Data Protection Act (DPA) and/or other UK Law;[3] and - Expose the MoJ to untenable legal liabilities in the event that something goes wrong. Legal advice must be engaged, separately to IA advice, to identify any potential legal issues in advance of making any offshoring decision. <a id="requirement-6"></a> [REQUIREMENT 6](#requirement-6-assessment): An information risk assessment for each offshore location must be conducted by the Offshoring Company or organisation. This risk assessment must be subject to review and acceptance by MoJ IA. This should include an IS1 Risk Assessment, an assessment against ISO27001 controls, and a "Delta Assessment" setting out any HMG requirements that may be unenforceable, any variations to HMG policy that may be required, and how it is proposed to address these Deltas. A Privacy Impact Assessment (PIA), taking into account local legal considerations at the offshore location, must also be conducted. The risks, and the costs of mitigating the risks, must be balanced against the benefits to be gained from outsourcing. A Risk Management Plan must be developed and maintained to identify the mitigations required to address offshoring risks and estimate the costs of implementing these mitigations. An information risk assessment for the offshore location must be conducted. This must include an IS1 Risk Assessment in line with current HMG guidance. It must also include an assessment of physical, procedural, personnel and technical measures at the offshore location set against the ISO27001 requirements and highlighting the additional controls in place to address the concerns set out within HMG Good Practice Guide 6 [Ref, B] for specific ISO27001 controls. It must also include a "Delta Assessment" setting out any HMG requirements that may be unenforceable, any variations to HMG policy that may be required, and how it is proposed to address these deltas. The high-level information risk assessment is required at the proposal stage, prior to contract negotiations. This must be developed incrementally into a more detailed risk assessment as the project progresses. This risk assessment must take into account all assets to be offshored and the specific Threat Assessment for the offshore location and/or personnel. The risk assessment must meet the requirements of both HMG IS1 [Ref, G] and HMG GPG6 [Ref, B]. The requirements of HMG IS6 [Ref, C] relating to personal data can be more difficult to meet in an offshore context, so particular care must be taken to ensure that the PIA takes the offshore location into account and offshore elements of the contract are compliant with IS6. A Risk Management Plan is essential to address the risks identified through offshoring. As well as providing evidence that the supplier has adequately considered these risks, this will also provide the basis for estimating the cost overhead of mitigating offshoring risks, enabling a more accurate assessment of whether offshoring truly represents value for money. For example, the cost of provisioning a suitably segregated technical environment to support offshore development work; combined with the cost of providing a suitably secure link to enable remote access for offshore workers; and the cost of sending out suitably trained personnel for regular inspections of an overseas site; may significantly erode any cost savings. ### Supplier Arrangements <a id="requirement-7"></a> [REQUIREMENT 7](#requirement-7-assessment): IA constraints and requirements for offshoring must be made clear to suppliers prior to contract award and explicitly set out in contractual arrangements with suppliers to the MoJ. These constraints and requirements must be flowed down to all subcontractors along the chain of supply. Conversely, Intellectual Property Rights must flow up contractually from the offshore supplier or suppliers to the MoJ. IA requirements must be determined as an integral part of the initial requirements for any capability, and an assessment of competing solutions against IA requirements must be a critical part of supplier selection during the tender process. Offshoring is no exception to this. Offshoring constraints and requirements must be made clear to suppliers prior to contract award, so that there can be no ambiguity during costing for any solution to be delivered to the MoJ. There will almost certainly be additional time, effort and cost involved to implement the required physical controls, testing and decommissioning activities required to meet IA requirements in an offshore development environment. Some suppliers with UK bases may wish to offshore and/or subcontract elements of their contracts with the MoJ. If elements of a contract have been offshored to a subcontractor working in one location, that subcontractor may themselves wish to offshore elements of their subcontract to a different offshore location. IA constraints and requirements must be applicable to all of those who are party to the contract.[4]. The MoJ is responsible for all offshore activities that are being conducted on its behalf, and must retain oversight of these activities. This requirement must be enforced within supplier contracts, through robustly worded requirements for contractual flow-down of IA responsibilities through the supplier chain. The MoJ must be given both visibility and an over-riding right of approval or veto for subcontractor arrangements. A right of audit without warning must be maintained by the MoJ, including full access to all physical sites, logical capabilities, accounting logs, etc. Ownership of all information assets, and all Intellectual Property Rights, developed as part of MoJ contracts must flow up to the MoJ. All MoJ information, including vestidual information, which is held on a supplier's physical assets, must be erased and/or disposed of to the satisfaction of MoJ ICT IA during decommissioning. Again, legal limitations on the enforceability of contractual conditions in some locations must be taken into account and specialist legal advice will be required to ensure that all necessary contractual conditions are enforceable at offshore development locations. The above issues with contractual flow-down of responsibilities and flow-up of ownership are best managed if the MoJ retains control of the subcontract chain. Ideally, wherever practicable, MoJ supplier contracts should only allow further subcontracts to be let with the explicit permission of the MoJ. This enables the cost and complexity of due-diligence checking and contractual enforcement, not just for offshoring considerations but also more generally, to be more effectually bounded and controlled. <a id="requirement-8"></a> [REQUIREMENT 8](#requirement-8-assessment): Suppliers must ensure that offshore development is conducted according to UK and other relevant IA standards and legislation. The requirements of the HMG SPF [Ref, A] must be adhered to for offshore development. This may require significant changes to local working practices in some cases. The requirements of other relevant British and International standards must also be adhered to. Most notably for IA considerations, this specifically includes ISO27001 (Information Security Management System) [Ref, H] and ISO25999 (Business Continuity) [Ref, I]. Offshore sites and processes must be demonstrably compliant with ISO27001, and must be subject to a combination of scheduled and snap audits to ensure this. In addition to all of the usual ISO27001 conditions, particular considerations for offshore development are set out within HMG GPG6 [Ref, B]. Any issues found during audit must be addressed over timescales that are agreeable to MoJ ICT IA, with formal progress tracking of issues as they are addressed and resolved. Business Continuity can introduce particular issues in some offshore contexts, where events such as natural disasters, pandemics, criminal activity, acts of war, etc. may be sufficiently probable to merit more rigorous mitigations than for UK development. Factors such as staff turnover may also present particular issues in an offshore context, particularly where Landed Resources are used. <a id="requirement-9"></a> [REQUIREMENT 9](#requirement-9-assessment): The robustness of development and integration testing activities must be reconfirmed. Regular development and integration testing activities by the System Integrator are particularly essential for offshoring, where there will potentially be less visibility or direct control over the development environment. Additional code review must also be conducted to a level that is agreed by MoJ ICT IA to be commensurate with the value of the information that will be handled by the live application, or otherwise accessible to the live application. <a id="requirement-10"></a> [REQUIREMENT 10](#requirement-10-assessment): Security Enforcing Functionality elements of MoJ applications must not be offshored. For other elements of application code which process, store and transmit sensitive MoJ information assets, an onshore security code review must be conducted. This should be to a level that is agreed by MoJ ICT IA to be commensurate with the value of the information handled by the live application, or otherwise accessible to the live application. This is likely to include a combination of manual and automated testing, and should be supplemented by a more comprehensive ITHC scope where appropriate. The basic principle of ensuring thorough testing during every stage of application development must be reinforced where elements of development and/or maintenance are to be offshored. Requirements for testing against internationally recognised standards (e.g. the OWASP standard for secure code development) must be secured in supplier contracts and flowed down to offshore and other subcontractors. A test data strategy must be agreed prior to contract award. A high-level test strategy must also be agreed prior to contract award, and should be developed and maintained as a living plan as the project evolves. There should be assurance that provision for testing is adequate to mitigate the Information Assurance and other System Integration risks identified. Testing, including security testing, must be conducted at every stage of the development (unit testing, integration testing, acceptance testing, etc). The MoJ must retain executive control over the testing process, maintaining visibility of all test results and progress on remedial activities. This includes control by MoJ ICT IA over security elements of testing. The MoJ must be contractually able to exert control over testing, through clauses to reject as substandard any delivery where test scopes are not agreed by the MoJ, where results are not fully disclosed or where remedial activities are deemed to be insufficient. Some applications which are deemed to be relatively low value in themselves may be used to handle information with a significantly higher value, or may be able to easily access sensitive information (for example, other information within the same business domain or information that is directly accessible from connections to servers in other business domains). Additional code review must also be conducted as part of the development testing of these applications, with particular emphasis on Security Enforcing elements of the application. In some cases, the MoJ Accreditor and the IA Team may require the use of automated test tools and/or line-by-line code review for elements of the application to be conducted by UK Security Cleared personnel at onshore locations. In some cases, the additional testing overhead required will outweigh the benefits gained by offshoring. This is most likely for particularly complex and/or sensitive applications. Back-doors and vulnerabilities become increasingly easy to engineer (either deliberately or accidentally) for complex applications, and increasingly difficult to identify. Based on experience, it is likely that suppliers will underestimate the true time and expense that would be necessary to test complex applications. It is important that supplier proposals are realistic about the benefits of any offshoring elements of the proposals, and have accommodated realistic costs for testing to address offshoring risks. Where test costs are not realistic, this does not represent a cost saving for the MoJ. If the supplier is not making an acceptable profit on a contract, then relationships between the supplier and the MoJ will undoubtedly deteriorate. The supplier is likely to try to recoup losses by streamlining test processes (driving operational risk); by reclaiming costs from elsewhere (driving project cost); or by delivering below expectations or not at all (driving project risk). Such unrealistic proposals should be either corrected or rejected during supplier selection and contract award. ### Use of Landed Resources <a id="requirement-11"></a> [REQUIREMENT 11](#requirement-11-assessment): Where landed resources are used to support project activities they must be vetted to a level appropriate for the value of the information assets and collateral assets that will potentially be available to them. Where it is not possible to meet some BPSS evidence requirements, suitable alternative evidence must be obtained and compensating controls such as technical lockdown, supervision and monitoring must be applied. If it is not possible to lock down the physical environment to the satisfaction of MoJ ICT IA then landed resources must not be used. For higher levels of clearance such as SC, if a landed resource cannot achieve the required level of clearance or if there are prohibitive conditions on the individual's clearance, then that landed resource must not be used. The most basic level of Government security checking, the Baseline Personnel Security Standard (BPSS) check [Ref, F], is designed to provide an assessment of three key features of the individual to be vetted: their identity; their right to work; and the reliability, integrity and honesty of those individuals. The BPSS requires that an individual's identity be confirmed, by matching some evidence of identity such as a passport or drivers licence, with evidence of address and activity in the community such as bills and bank statements. This provides a level of information that can be followed up for UK applicants if an individual raises any particular concerns. Further checks can be cheaply and easily conducted, to provide additional evidence that an individual with the asserted identity and address exists, and to confirm that the individual asserting that identity and address is not attempting identity theft. Where individuals originate from outside of the UK, and have not been in the UK for a suitably[5] long period of time, it can be more difficult to obtain a suitably reliable history for those individuals (long-term footprint) to support effective screening. Even confirming an individual's true identity may be problematic in some non-EU locations, where proofs of identity may be non-existent or considerably less reliable. It should also be noted that, for countries where record-keeping is managed locally rather than centrally, engagement at a local level to support checks can very quickly become prohibitively expensive for a moderately-sized workforce and/or where there is a high rate of staff turnover. Personal and employers' references are used, partly to support confirmation of identity, and partly to enable checking of an individual's reliability, integrity and honesty. Criminal records declarations and supporting criminal records checks are also used as part of BPSS clearance. Criminal record checks for UK citizens are generally comprehensive and accurate. However, the accuracy of police and criminal records checks varies widely between different countries. The CPNI has compiled information on such checks for a reasonably broad set of overseas jurisdictions.[6] The CPNI documentation also provides useful information on the reliability of identify checks overseas. A risk-balance decision by the SIRO is likely to be required on whether to accept the additional BPSS vetting risk for the offshore workforce. To compensate for any shortcomings or uncertainty in vetting, landed resources brought to the UK are likely to require a heightened level of monitoring and supervision, as well as additional technical measures to limit and audit their physical and logical access to HMG information systems. HMG information systems to which landed resources have access must be locked down and supported by tight access controls over-and-above the usual HMG baseline. Where higher levels of clearance such as SC are required it may not be possible for a specific landed resource to achieve the required level of clearance, or there may be prohibitive conditions on the individual's clearance. In those cases, the specific landed resource must not be used. For example, a non-UK National who has been within the UK for a sufficiently long period of time may be able to obtain an SC clearance. However, if a role requires handling of UK Eyes Only material, then the prohibitions on the SC clearance for that non-UK national would make them inappropriate to use for that role. In exceptional circumstances, the use of landed resources from countries where Special Security Regulations Apply, or to countries in which there is a Substantial Security Threat to British Interests, depending on why that specific country is on the list. The MoJ ITSO should be consulted in such cases and will advise the business on suitability, weighing up all of the relevant factors and assessing the extent to which the proposed compensating controls mitigate the risk. <a id="assessment-activities"></a> ## Assessment Activities Every offshoring decision must be made on a case-by-case basis, after balancing all of the facts of the situation. The project activities required to ensure this are set out below. <a id="requirement-1-assessment"></a> <a id="requirement-2-assessment"></a> ### [REQUIREMENT 1](#requirement-1) and [REQUIREMENT 2](#requirement-2) #### Project Scoping & Supplier Selection MoJ Project Team: - Ensure that the MoJ SIRO, MoJ Accreditor, MoJ ICT IA and MoJ Central IA are engaged from project conception. - Ensure that any contracts which may require personal data to be offshored outside of the EEA include suitable contractual clauses developed from reliable templates.[7] Consider whether additional contractual clauses are required to mitigate risk and avoid legal problems arising from local laws and jurisdictional issues. - Ensure that offshoring elements of all Invitation To Tender (ITT) or other supplier requirements documentation are developed in consultation with MoJ Legal functions, DACU, and the MoJ Accreditor and MoJ ICT IA. Ensure that these parties are key reviewers for all tender requirements. - On the advice of the Accreditor, DACU, MoJ ICT IA, and MoJ Central IA, present and obtain approval for a SIRO Submission comprehensively setting out the risks and mitigations of any offshoring proposals. - Understand and advise the SIRO of any requirement that may exist for a submission to the Cabinet Office IA Delivery Group. Prepare any required submission on behalf of the SIRO, for approval. - Ensure that the operational assessment and investment appraisal of competing supplier proposals factors in the additional MoJ ICT IA effort requirement to address offshore elements of the proposal, as per [Requirement 11](#requirement-11-assessment) below. - Reject any bids that do not meet IA, DACU or Legal requirements for offshoring. MoJ Accreditor/IA[8]: - Develop the elements of tender requirements which cover offshoring constraints and requirements. - Review outsourcing elements of supplier bids and other proposals. - Advise the MoJ Project Team on the suitability of offshoring proposals. #### Contract Award MoJ Project Team: - Ensure that offshoring requirements and constraints are worked up to a robust level of detail within the final supplier contract, and subject to a further round of review by the MoJ Accreditor and MoJ ICT IA prior to acceptance and contract award. - Update any SIRO Submissions and submissions to the Cabinet Office IA Delivery Group to reflect the changes in the information risk between project scoping and contract award. Obtain acceptance for any changes from the SIRO prior to acceptance and contract award. Engage MoJ ICT IA to advise and liaise with the SIRO. MoJ Accreditor/IA: - Provide review support and remedial input to the MoJ Project Team. #### Development MoJ Project Team: - Use supplier audit as a mechanism to ensure that contractual requirements are being met. Where supplier indiscretions are found enforce remedial action. - Where remedial action is not implemented, or ineffectually implemented, invoke contractual penalty clauses. - Add and maintain any submissions to the SIRO and the Cabinet Office IA Delivery Group as necessary. Engage MoJ ICT IA to advise and liaise with the SIRO. MoJ Accreditor/IA: - Provide review support, remedial input and recommendations to the MoJ Project Team. #### In-Service & Beyond MoJ Service Management: - Use supplier audit as a mechanism to ensure that contractual requirements are being met. Where supplier indiscretions are found enforce remedial action. - Where remedial action is not implemented, or ineffectually implemented, invoke contractual penalty clauses. - Add and maintain any submissions to the SIRO and the Cabinet Office IA Delivery Group as necessary. Engage MoJ ICT IA to advise and liaise with the SIRO. MoJ Accreditor/IA: - Provide review support, remedial input and recommendations to the MoJ Project Team. <file_sep>/README.md # Draft and Review versions of MoJ IT Policy content. These documents are about MoJ policy regarding IT resources. The documents are not anything to do with the functional aspects of MoJ work, such as the judiciary, courts, Legal Aid, and so on. Many aspects of MoJ IT Policy inherit from, or are guided by, higher or broader policy statements, for example from the Cabinet Office. **Note:** None of the content in this repository is necessarily complete or correct, because it is intended for draft or review purpose.
a77a1d86e1c3a2e41072d75e56946baa3ff2d4c4
[ "Markdown" ]
5
Markdown
cybersquirrel/itpolicycontent
0bce488aa31081f1af80047ddc5447f49d8b2477
4218f0ada4f6765ab99d7cdf306aa52cfecd783d
refs/heads/master
<file_sep> import java.util.Scanner; public class salesreceiptv6 { //all global variables static final int maxProduct = 5; static int totalArrayCounter = 0; static int[] serialNo=new int[maxProduct]; static String[] productName = new String[maxProduct]; static double[] quantityPurchased = new double[maxProduct]; static double[] productPrice = new double[maxProduct]; static double[] subTotal=new double [maxProduct]; static double[] grandTotal=new double [maxProduct]; static double[] cash=new double [maxProduct] ; static double[] change=new double [maxProduct]; //module 1 welcome public static void welcome() { System.out.println("========welcome to my store========"); System.out.println(); } //module 2 getting input public static void getinput(int arrayCounter) { boolean isValid = false; serialNo [arrayCounter]= arrayCounter; System.out.println("Product no : " + serialNo [arrayCounter]); //product name Scanner myscanner = new Scanner(System.in); System.out.println(); System.out.print("Enter product name= "); productName[arrayCounter] = myscanner.nextLine(); //product quantity boolean pp=false; while (pp==false) { try { Scanner pscan = new Scanner(System.in); System.out.print("Enter number of product purchased= "); quantityPurchased[arrayCounter]= pscan.nextDouble(); if (quantityPurchased[arrayCounter]>0 && quantityPurchased[arrayCounter]<=100) { pp=true; } else { pp=false; System.out.println("*ERROR...please enter valid input[1-100]* "); System.out.println(); } } catch(Exception e) { pp= false; System.out.println("*ERROR...please enter number only* "); System.out.println(); } } //product price boolean pprice=false; while (pprice==false) { try { Scanner ppscan = new Scanner(System.in); System.out.print("Enter product price= "); productPrice[arrayCounter] = ppscan.nextDouble(); if (productPrice[arrayCounter]>=1 && productPrice[arrayCounter]<=500) { pprice=true; } else { pprice=false; System.out.println("*ERROR...please enter valid input[1-500]* "); System.out.println(); } } catch(Exception e) { pprice=false; System.out.println("*ERROR...please enter number only* "); System.out.println(); } } //cash try { Scanner cashscan = new Scanner(System.in); System.out.print("Enter amount of cash recieved= "); cash[arrayCounter] = cashscan.nextDouble(); } catch(Exception e) { System.out.println("*ERROR...please enter number only* "); System.out.println(); } } //module 3 edit data public static void editData(int arrayCounter ) { Scanner editscan = new Scanner(System.in); System.out.print("Edit By Serial No. (Type SN) or By Product Name (type PN) : "); String cMenueSelection = editscan.nextLine(); switch(cMenueSelection) { case "SN" : System.out.println(""); System.out.print("Enter Serial No to EDIT : "); String sSerialNo = editscan.nextLine(); for(int i=0;i<totalArrayCounter;i++) { if(serialNo[i]==Integer.parseInt(sSerialNo) ) { getinput(i); calculateTotal(i); displayoutput(i); break; } } case "PN" : System.out.println(""); System.out.print("Enter Product Name to EDIT : "); String pName = editscan.nextLine(); break; default: System.out.println("[" + cMenueSelection + "] is not a valid.]"); editData(arrayCounter) ; } } //module 4 calculate total public static void calculateTotal(int arrayCounter) { subTotal[arrayCounter] = calculatesubTotal(arrayCounter); grandTotal[arrayCounter] = calculateGrandTotal(arrayCounter); change(arrayCounter); discount(arrayCounter); } //module 5 sub total public static double calculatesubTotal (int arrayCounter ) { return quantityPurchased[arrayCounter] * productPrice[arrayCounter]; } //module 6 grand total public static double calculateGrandTotal(int arrayCounter) { double tempGT = 0; if (subTotal[arrayCounter]>=100 && subTotal[arrayCounter]<200) { tempGT= subTotal[arrayCounter] * (1-.10); } else if (subTotal[arrayCounter]>=200 && subTotal[arrayCounter]<300) { tempGT= subTotal[arrayCounter] * (1- .15); } else if (subTotal[arrayCounter]>=300 && subTotal[arrayCounter]<400) { tempGT= subTotal[arrayCounter] * (1- .18); } else if (subTotal[arrayCounter]>=400 && subTotal[arrayCounter]<500) { tempGT= subTotal[arrayCounter] * (1- .20); } else if (subTotal[arrayCounter]>=500) { tempGT= subTotal[arrayCounter] * (1- .25); } else { System.out.println(" something went wrong "); } return tempGT; } //module 7 discount public static double discount(int arrayCounter) { double discount = grandTotal[arrayCounter] - subTotal[arrayCounter] ; return discount; } //module 8 change public static void change(int arrayCounter) { change[arrayCounter] = cash[arrayCounter] - grandTotal[arrayCounter]; } //module 9 display output public static void displayoutput(int arrayCounter) { System.out.println(""); System.out.println("*********** Sales Receipt ************"); System.out.println(""); System.out.println(" Product name is: " + productName[arrayCounter]); System.out.println(" Number of product purchased is: " + quantityPurchased[arrayCounter]); System.out.println(" Product price is: " + productPrice[arrayCounter]); System.out.println(""); System.out.println("========================================"); System.out.println(); System.out.println(" Sub Total is: " + subTotal[arrayCounter]); System.out.println(" Total discount is: " + discount(arrayCounter)); System.out.println(" Grand Total after discount is: " + grandTotal[arrayCounter]); System.out.println(" Total amount of cash received: " + cash[arrayCounter]); System.out.println(" Total change is: " + change[arrayCounter]); System.out.println(); } //module 10 table head public static void displayTableHead() { System.out.println("----------------------------------------------------------------------------------------------------------------"); System.out.printf("%10s %10s %10s %10s %10s %10s %12s %10s %10s","SerialNo" ,"ProductName", "productpurchased", "Productprice", "subTotal", "discount", "grandTotal", "cash", "change"); System.out.println(); System.out.println("----------------------------------------------------------------------------------------------------------------"); } //module 11 table data public static void displayTableData(int arrayCounter) { System.out.format("%5s %10s %15s %15s %13s %10s %10s %15s %10s",serialNo[arrayCounter],productName[arrayCounter], quantityPurchased[arrayCounter], productPrice[arrayCounter], subTotal[arrayCounter], discount(arrayCounter), grandTotal[arrayCounter], cash[arrayCounter], change[arrayCounter] ); System.out.println(); } //module 12 display table public static void displayTable() { displayTableHead(); for(int i=0; i<=totalArrayCounter;i++) { if(productName[i]!=null) { displayTableData(i); } } } //module 13 display menu selection public static void displayMenueSelection(int arrayCounter) { Scanner scan = new Scanner(System.in); System.out.print("Select an Action [ Add = A | Edit = E | Delete = D ] : "); String cMenueSelection = scan.nextLine(); switch(cMenueSelection) { case "A" : System.out.println(); System.out.println("Enter Product Name, product Purchased & Product Price "); getinput(arrayCounter); calculateTotal(arrayCounter); displayoutput(arrayCounter); displayTable(); totalArrayCounter++; break; case "E" : System.out.println("Edit Infomration : "); editData(arrayCounter); displayTable(); break; case "D" : System.out.println("Delete Infomration : "); break; default: System.out.println(" [" + cMenueSelection + "] Invalid Entry !!!!]"); displayMenueSelection(arrayCounter) ; } } //module 14 ask to continue public static boolean doYouWantToContinue() { Scanner scan = new Scanner(System.in); System.out.println(""); System.out.print("Do you want to continue? [No = N | Yes = Y] : "); char cContinue = scan.next().charAt(0); if(Character.toUpperCase(cContinue)=='Y') { return true; } return false; } //main module public static void main(String[] args) { welcome(); do { displayMenueSelection(totalArrayCounter); if(doYouWantToContinue()==false) break; } while (true); System.out.println("*Thanks for shopping with us*"); } } <file_sep>import java.util.Scanner; public class salesreceiptv1 { public static void main(String[] args) { String customername; double quantitypurchased; double productprice; double totalprice; System.out.println("===Sales Calculator v1.0==="); System.out.println("*please follow the instruction*"); Scanner myscanner = new Scanner(System.in); System.out.println("Enter customer name= "); customername = myscanner.nextLine(); System.out.println("Enter number of product purchased= "); quantitypurchased= myscanner.nextDouble(); System.out.println("Enter product price= "); productprice = myscanner.nextDouble(); totalprice = quantitypurchased * productprice ; System.out.println(""); System.out.println("*** Sales Receipt ***"); System.out.println("Customer name is " + customername); System.out.println("Number of product purchased is " + quantitypurchased); System.out.println("Product price is " + productprice); System.out.println("==================================="); System.out.println("Total price is " + totalprice); } }
c792160202f331460e9b3c73c71068f744215409
[ "Java" ]
2
Java
rifatzakaria/sales-calculator
cc72df7826f66ddf4d523f4991a609e618b97314
bcd8c2914b9e4ee78021279631d76157b68aab8a
refs/heads/master
<repo_name>Priyansh247Joshi/openCV<file_sep>/openCV18.py # Adaptive Thresholding # A method where the threshold value is calculated for the smaller region means # the threshold value is not global for all pixels. So there will be different threshold # value for different region. import cv2 as cv import numpy as np img=cv.imread('sudoku.png',0) _,th1=cv.threshold(img,127,255,cv.THRESH_BINARY) th2=cv.adaptiveThreshold(img,255,cv.ADAPTIVE_THRESH_MEAN_C,cv.THRESH_BINARY,11,2) th3=cv.adaptiveThreshold(img,255,cv.ADAPTIVE_THRESH_GAUSSIAN_C,cv.THRESH_BINARY,11,2) cv.imshow('Image',img) #cv.imshow('th1',th1) cv.imshow('th2',th2) cv.imshow('th3',th3) cv.waitKey(0) cv.destroyAllWindows()<file_sep>/openCV14.py # HOW TO BIND TRACKBAR TO OPENCV WINDOWS EXAMPLE 2 # TRACKBAR IS USED WHENEVER YOU WANT TO CHANGE SOME VALUE IN YOUR IMAGE DYNAMICALLY AT RUNTIME. import numpy as np import cv2 as cv def nothing(x): print(x) cv.namedWindow('image') cv.createTrackbar('CP','image',10,400,nothing) # Adding switch using a trackbar switch='color/gray' cv.createTrackbar(switch,'image',0,1,nothing) while(1): # load an image img = cv.imread('lena.jpg') pos = cv.getTrackbarPos('CP', 'image') font=cv.FONT_HERSHEY_SCRIPT_SIMPLEX cv.putText(img,str(pos),(50,150),font,5,(153,153,252),10) k = cv.waitKey(1) & 0xFF if k==27 : break s= cv.getTrackbarPos(switch, 'image') if s==0: pass else: img=cv.cvtColor(img,cv.COLOR_BGR2GRAY) img=cv.imshow('image',img) cv.destroyAllWindows()<file_sep>/openCV9.py # Various functions in OpenCV #cv.split() , cv.merge(), cv.resize() , cv.add() , cv.addWeighted() , ROI import numpy as np import cv2 img= cv2.imread('messi5.jpg') print(img.shape) # returns a tuple of number of rows , columns , and channels print(img.size) # returns total number of pixels is accessed print(img.dtype) # returns the data-type of image b , g , r = cv2.split(img) img = cv2.merge((b,g,r)) # Now copy the ball to another place using ROI(Region of interest) ball =img[280:340 , 330: 390] img[273:333,100:160]=ball cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV8.py # More mouse event example in OpenCV Python 2 # Read the image and click at any point on image and then show the color # of points on which I clicked using second window. import numpy as np import cv2 def click_event(event,x,y,flags,param): if event==cv2.EVENT_LBUTTONDOWN: blue= img[x,y,0] green = img[x,y,1] red = img[x,y,2] cv2.circle(img,(x,y),3,(0,0,255),-1) mycolorImage=np.zeros((512,512,3),np.uint8) mycolorImage[:]=[blue,green,red] cv2.imshow('color',mycolorImage) img=cv2.imread('lena.jpg',1) cv2.imshow('image',img) cv2.setMouseCallback('image',click_event) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV10.py # Add more Images # we do it by add() method. # resize() method is to resize the image import numpy as np import cv2 img= cv2.imread('messi5.jpg') img2=cv2.imread('opencv-logo.png') print(img.shape) # returns a tuple of number of rows , columns , and channels print(img.size) # returns total number of pixels is accessed print(img.dtype) # returns the data-type of image b , g , r = cv2.split(img) img = cv2.merge((b,g,r)) # Now copy the ball to another place using ROI(Region of interest) ball =img[280:340 , 330: 390] img[273:333,100:160]=ball img=cv2.resize(img,(512,512)) img2=cv2.resize(img2,(512,512)) dest_img=cv2.add(img,img2) cv2.imshow('image',dest_img) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV25.py # Image Pyramid with python and OPENCV import cv2 import numpy as np img=cv2.imread('lena.jpg') layer=img.copy() gp=[layer] for i in range(6): layer=cv2.pyrDown(layer) gp.append(layer) # cv2.imshow(str(i),layer) layer=gp[5] cv2.imshow('Upper Level Gaussian Pyramid',layer) lp=[layer] for i in range(5,0,-1): gaussian_extended=cv2.pyrUp(gp[i]) laplacian=cv2.subtract(gp[i-1],gaussian_extended) cv2.imshow(str(i),laplacian) cv2.imshow('Original Image',img) #lr1=cv2.pyrDown(img) #lr2=cv2.pyrDown(lr1) #hr1=cv2.pyrUp(lr2) #cv2.imshow('pyrDown1 Image',lr1) #cv2.imshow('pyrDown2 Image',lr2) #cv2.imshow('pyrUp1 Image',hr1) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV6.py # Handle Mouse Events in OpenCV import numpy as np import cv2 #events= [i for i in dir(cv2) if 'EVENT' in i] #print(events) def click_event(event,x,y,flags,param): if event==cv2.EVENT_LBUTTONDOWN: print(x,',',y) font=cv2.FONT_HERSHEY_SCRIPT_SIMPLEX strXY=str(x) + ',' + str(y) cv2.putText(img,strXY,(x,y),font,1,(0,250,0),2) cv2.imshow('image',img) if event== cv2.EVENT_RBUTTONDOWN: blue=img[y,x,0] green = img[y, x, 1] red = img[y, x, 2] font = cv2.FONT_HERSHEY_SCRIPT_SIMPLEX strBGR = str(blue) + ',' + str(green) + ',' + str(red) cv2.putText(img, strBGR, (x, y), font, 0.5, (250, 0, 0), 2) cv2.imshow('image', img) img=cv2.imread('lena.jpg',1) cv2.imshow('image',img) cv2.setMouseCallback('image',click_event) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV3.py # Draw Geometric Shape on Images using Python openCV import numpy as np import cv2 # Create image using numpy zeros method #img=np.zeros([512,512,3],np.uint8) img=cv2.imread('lena.jpg',1) # Now lets draw a line on image that we read from imread function img=cv2.line(img,(0,0),(255,255),(67,70,150),10) # Now lets draw an arrowed line on image that we read from imread function img=cv2.arrowedLine(img,(0,250),(255,0),(67,70,150),10) # Now Create Rectangle img=cv2.rectangle(img,(384,0),(510,128),(200,45,89),5) # Create Circle img=cv2.circle(img,(447,63),63,(100,34,67),-1) # Put Text into image font=cv2.FONT_ITALIC img=cv2.putText(img,'Hey lena Here',(1,340),font,1.6,(34,56,78),3,cv2.LINE_4) cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows() <file_sep>/openCV7.py # More mouse event example in OpenCV Python # Drawing points and then connecting those points using line. import numpy as np import cv2 def click_event(event,x,y,flags,param): if event==cv2.EVENT_LBUTTONDOWN: cv2.circle(img,(x,y),3,(58,87,69),-1) points.append((x,y)) if(len(points) >=2): cv2.line(img,points[-1],points[-2],(255,0,0),5) cv2.imshow('image',img) img=cv2.imread('lena.jpg',1) cv2.imshow('image',img) points=[] cv2.setMouseCallback('image',click_event) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV2.py import cv2 # Capture live stream from your default camera cap = cv2.VideoCapture(0) fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('output.avi',fourcc,20.0,(640,480)) while(True): ret,frame=cap.read() if(ret==True): print(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) print(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) out.write(frame) # Convert frame to grey grey= cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) cv2.imshow('frame_window',grey) if cv2.waitKey(1) & 0xFF == ord('q'): break else: break cap.release() out.release() cv2.destroyAllWindows()<file_sep>/openCV20.py #Simple Image Thresholding with matplotlib import cv2 as cv import matplotlib.pyplot as plt import numpy as np img=cv.imread('gradient.png',0) _,th1=cv.threshold(img,127,255,cv.THRESH_BINARY) _,th2=cv.threshold(img,127,255,cv.THRESH_BINARY_INV) _,th3=cv.threshold(img,127,255,cv.THRESH_TRUNC) _,th4=cv.threshold(img,127,255,cv.THRESH_TOZERO) _,th5=cv.threshold(img,127,255,cv.THRESH_TOZERO_INV) titles=['Original Images','BINARY','BINARY_INV','TRUNC','TOZERO','TOZERO_INV'] images=[img,th1,th2,th3,th4,th5] for i in range(6): plt.subplot(2,3,i+1) plt.imshow(images[i],'gray') plt.title(titles[i]) plt.xticks([]) , plt.yticks([]) plt.show()<file_sep>/openCV24.py # Canny Edge detection in OPENCV import cv2 import numpy as np import matplotlib.pyplot as plt img=cv2.imread('lena.jpg') img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) canny=cv2.Canny(img,100,200) titles=['image','canny'] images=[img,canny] for i in range(2): plt.subplot(1,2,i+1) plt.imshow(images[i],'gray') plt.title(titles[i]) plt.xticks([]) plt.yticks([]) plt.show()<file_sep>/openCV12.py # BITWISE OPERATIONS import cv2 import numpy as np img1=np.zeros((300,400,3),np.uint8) img1=cv2.rectangle(img1,(200,0),(300,100),(255,255,255),-1) img2=cv2.imread('pic1.png') # BITWISE AND OPERATION #bitAnd= cv2.bitwise_and(img2,img1) # BITWISE OR OPERATION #bitwiseOr=cv2.bitwise_or(img2,img1) # BITWISE XOR OPERATION #bitwiseXOR=cv2.bitwise_xor(img2,img1) # BITWISE NOT OPERATION bitNot1=cv2.bitwise_not(img1) bitNot2=cv2.bitwise_not(img2) cv2.imshow('img1',img1) cv2.imshow('img2',img2) #cv2.imshow('bitAnd',bitwiseAnd) #cv2.imshow('bitOr',bitwiseOr) #cv2.imshow('bitXOR',bitwiseXOR) cv2.imshow('bitNot1',bitNot1) cv2.imshow('bitNot2',bitNot2) cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV5.py # Show Date and Time on Videos using OpenCV Python import cv2 import datetime cap=cv2.VideoCapture(0) print(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) print(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) cap.set(3,1280) cap.set(4,720) print(cap.get(3)) print(cap.get(4)) while(cap.isOpened()): ret,frame=cap.read() if ret==True: font=cv2.FONT_HERSHEY_SCRIPT_SIMPLEX text='Width :' + str(cap.get(3)) + ' Height :' + str(cap.get(4)) date_obj=str(datetime.datetime.now()) frame= cv2.putText(frame, date_obj, (10,50),font,1,(34,67,35),2,cv2.LINE_AA) cv2.imshow('frame',frame) if cv2.waitKey(1) & 0xFF == ord('p'): break else: break cap.release() cv2.destroyAllWindows()<file_sep>/openCV17.py # Simple Image Thresholding # Thresholding is a segmentation technique used for separating an object from its background. import cv2 as cv import numpy as np img=cv.imread('gradient.png',0) _,th1=cv.threshold(img,127,255,cv.THRESH_BINARY) _,th2=cv.threshold(img,127,255,cv.THRESH_BINARY_INV) _,th3=cv.threshold(img,127,255,cv.THRESH_TRUNC) _,th4=cv.threshold(img,127,255,cv.THRESH_TOZERO) _,th5=cv.threshold(img,127,255,cv.THRESH_TOZERO_INV) cv.imshow('Image',img) cv.imshow('th1',th1) cv.imshow('th2',th2) cv.imshow('th3',th3) cv.imshow('th4',th4) cv.imshow('th5',th5) cv.waitKey(0) cv.destroyAllWindows()<file_sep>/opencv1.py import cv2 #Read image img=cv2.imread('lena.jpg',0) print(img) # Display Image cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows() # Writing an image to a file using imwrite function cv2.imwrite('lena_copy.png',img) <file_sep>/README.md # openCV code for openCV <file_sep>/openCV19.py # matplotlib with openCV import cv2 import matplotlib.pyplot as plt img=cv2.imread('lena.jpg',-1) cv2.imshow('image',img) img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) plt.imshow(img) plt.xticks([]) , plt.yticks([]) plt.show() cv2.waitKey(0) cv2.destroyAllWindows()<file_sep>/openCV13.py # HOW TO BIND TRACKBAR TO OPENCV WINDOWS EXAMPLE 1 # TRACKBAR IS USED WHENEVER YOU WANT TO CHANGE SOME VALUE IN YOUR IMAGE DYNAMICALLY AT RUNTIME. import numpy as np import cv2 as cv def nothing(x): print(x) # create a black image in a window img=np.zeros((300,512,3),np.uint8) cv.namedWindow('image') # This trackbar will change the BGR value of the image cv.createTrackbar('B','image',0,255,nothing) cv.createTrackbar('G','image',0,255,nothing) cv.createTrackbar('R','image',0,255,nothing) # Adding switch using a trackbar switch='0 : OFF\n 1 : ON' cv.createTrackbar(switch,'image',0,1,nothing) while(1): cv.imshow('image',img) k=cv.waitKey(1) & 0xFF if k==27 : break # To get the current position of trackbar b=cv.getTrackbarPos('B','image') g = cv.getTrackbarPos('G', 'image') r = cv.getTrackbarPos('R', 'image') s= cv.getTrackbarPos(switch, 'image') if s==0: img[:]=0 else: # Set these value to our image img[:]=[b,g,r] cv.destroyAllWindows()
e126f872284c8d2f3d3d4196a298aa09b3631242
[ "Markdown", "Python" ]
19
Markdown
Priyansh247Joshi/openCV
ed085248e1f9d8f70326532cb45bd7adf9a61197
ba60c12f03909625bfd3113b9c72ab4e2228a073
refs/heads/master
<file_sep>from os.path import join, dirname, abspath #Getting filepath of input file named 'icont.txt' data_folder = join(dirname(dirname(abspath(__file__))), "input") file_to_open = join(data_folder, "itcont.txt") #drug_providers stores drug name key to set of provider names. Example - 'AMBIEN' : ('<NAME>', '<NAME>') drug_providers = {} #total_vost stores drug name key to total integer value of costs. Example - 'AMBIEN' : 1500 drug_total_cost = {} #Return a list split from string input seperated by comma def listify_line(line): return line.split(",") with open(file_to_open) as f: #Skip file headers next(f) for line in f: line = line.strip() line = listify_line(line) #Concatenate first and last name of provider. Example - '<NAME>' provider = line[1] + " " + line[2] drug = line[3] cost = int(line[4]) if drug not in drug_providers: drug_providers[drug] = set([provider]) drug_total_cost[drug] = cost else: #Since drug_provider values are sets, can use add method and repeat names will not be added drug_providers[drug].add(provider) drug_total_cost[drug] += cost #Used to create a list of sets of drug and cost. Example - [(1500, 'AMBIEN), (3000, 'BENZTROPINE MESYLATE')] all_drugs_cost = [] for drug, total_cost in drug_total_cost.items(): all_drugs_cost.append((total_cost, drug)) #Sort drug price ascending, if tie, sort drug name ascending all_drugs_cost.sort(key=lambda x: x[0], reverse=True) #Create filepath for output text file output_data_folder = join(dirname(dirname(abspath(__file__))), "output") #Output to top_drug_cost.txt. Example (one line of file) - CHLROPROMAZINE,2,3000 with open(join(output_data_folder, 'top_cost_drug.txt'), 'w') as drug_cost: drug_cost.write('drug_name,num_prescriber,total_cost\n') for item in all_drugs_cost: drug = item[1] cost_of_drug = item[0] providers_total = len(drug_providers[drug]) drug_cost.write(drug + "," + str(providers_total) + "," + str(cost_of_drug) + "\n") <file_sep>#!/bin/bash cd src python3 pharmacycounting.py<file_sep># Thanks for taking the time to review my project! I used Python to write the logic for this project. My main goals for this project was to store the data memory efficiently and keep O(n) costs to a minimum. The area of most concern was an efficient sorting procedure for desc drug prices and asc name. There is still some work to do by adding another testing suite and refactoring the pharmacycounting.py file. I had a great time working on this project. Thank you for your consideration. Please use a virtual environment to ensure Python 3.6.5 is used as testing and module imports may not work with earlier versions of python **In root directory:** Install pip: `python3 -m pip install --user virtualenv` Create virutal env: `python3 -m virtualenv env` Start virtual env: `source env/bin/activate` <file_sep>import unittest from os.path import join, dirname, abspath import sys root_directory = abspath(join(dirname(__file__), '..', '..', '..', 'src')) sys.path += [root_directory] class TestSortingMethods(unittest.TestCase): data_folder = abspath(join(dirname(__file__), '..', '..', '..', 'output')) file_to_open = join(data_folder, "top_cost_drug.txt") answer_folder = join(dirname(dirname(abspath(__file__))), "test_2", "output") answer_file_to_open = join(answer_folder, "top_cost_drug.txt") def test_first_line(self): with open(self.file_to_open) as f: f.readline() first_line = f.readline() with open(self.answer_file_to_open) as a: a.readline() answer_first_line = a.readline() self.assertEqual(first_line.strip(), answer_first_line.strip()) if __name__ == '__main__': unittest.main()
488aa07f1761eb6873e08c53ab1363dc17e2928b
[ "Markdown", "Shell", "Python" ]
4
Markdown
elizabethlarkinnelson/PharmacyCounting
23165809a71ed298decc5ddc351dad8aebade88f
9603a69d32a05618207f44dfa5c18cfe24a64e11
refs/heads/master
<file_sep>var url; function submit(){ var reason = document.getElementsByTagName("textarea")[0].value; var json = {"reason":reason,"url":url}; window.location = "submit.html?"+JSON.stringify(json); } window.onload=function(){ var search = decodeURI(window.location.search.substring(1)) search = JSON.parse(search); url = search.url; document.getElementById("url").innerHTML=search.url; } <file_sep>var thisURL = "teak1.github.io/Dynablock/blocker.js"; function exec(){ var search = ""; var scr = document.getElementsByTagName("script"); alert(scr.length); for(var i = 0;i<scr.length;i++){ try{ document.body.innerHTML+=scr[i].src; if(scr[i].src.split("?").includes(thisURL)){ search=scr[i].src; } }catch(e){ document.body.innerHTML=e; } } var interp = JSON.parse(search.split("").shift().join("")); var s = confirm("request whitelist?"); if(s){ var url = window.location.origin; window.location="https://teak1.github.io/Dynablock/?"+JSON.stringify({"url":url}); } } setTimeout(exec,1000);
425958a8adaa7d6609615e482cb4db7e49501b8c
[ "JavaScript" ]
2
JavaScript
teak1/Dynablock
de26fb182880488c98dd7e8db65fcbf055dabd98
677718fd8c63a1470707d5cf04e0e3368c1c464d
refs/heads/master
<file_sep>package com.coronosafe.approval.constants; public interface DigiConstants { String MISSION_DIRECTOR_ROLE="Mission Director"; String INSTITUTION_ROLE ="Institution"; String OFFICIAL_ROLE ="Government Official"; } <file_sep>package com.coronosafe.approval.service.impl; import com.coronosafe.approval.service.DigiUserService; import com.coronosafe.approval.jdbc.DigiUserRepository; import com.coronosafe.approval.jdbc.data.DigiUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class DigiUserServiceImpl implements DigiUserService { @Autowired DigiUserRepository digiUserRepository; @Override public DigiUser findUser(String userName) { return digiUserRepository.findByUserName(userName); } } <file_sep>package com.coronosafe.approval.service; import com.coronosafe.approval.dto.DigiUploadDto; import com.coronosafe.approval.jdbc.data.DigiUploads; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; public interface DigiUploadService { void saveFile(MultipartFile file, LocalDateTime uploadDate, String userName) throws IOException; List<DigiUploadDto> retrieveDigiUploads(); void updateSanctions(int uploadId); }
3c55993fe26a2774db145d3f1f486f9f76a07000
[ "Java" ]
3
Java
vipinvkmenon/digital_authorization
125dbefab840d8b751f020ed791477483f84a961
d565a234eeee6efdbe9601de83e9031c20a4580a
refs/heads/master
<file_sep> player = {} bullets = {} gunshot = love.audio.newSource("boom.mp3", "static") -- Create player function player.create() -- Sprite with player player.img = love.graphics.newImage("player.png") -- Coordinates X & Y - center of screen local x, y = love.graphics.getDimensions() x = x / 2 y = y /2 -- Shape & body player.shape = love.physics.newCircleShape(24) -- circle with radius 24 player.body = love.physics.newBody(world, x, y, "kinematic") -- Fixture shape with body and set mass 5 player.fix = love.physics.newFixture(player.body, player.shape, 5) -- This time will be used for delay between shots player.shoot_time = love.timer.getTime() end -- Draw player, this function will be called from love.draw() function player.draw() -- Local image point 0,0 is in left-top corner, -- that mean it's need to move image left to 1/4 width and move down to 1/2 -- height. In this way center of human on image will be at center of player -- body. local draw_x, draw_y = player.body:getWorldPoint(-21.25, -26.5) -- When drawing angle image like body's angle love.graphics.draw(player.img, draw_x, draw_y, player.body:getAngle()) end -- Shooting function player.shoot() -- Man on player sprite angle to right. -- Get point that will be little right and below man's center local x, y = player.body:getWorldPoint(65, 5) -- Bullet's direction vector coordinates local lx, ly = player.body:getWorldVector(400, 0) -- Index for new bullet in bullets table local i = #bullets + 1 -- Create bullet bullets[i] = BulletClass:new(x, y, lx, ly) bullets[i]:create() end -- Update player, function will be called from love.update(dt) function player.update(dt) -- Local vars for easy access to functions local is_down_kb = love.keyboard.isDown local is_down_m = love.mouse.isDown -- Get current player's position local x, y = player.body:getPosition() -- Moving -- Because local center of player placed in center of player's body, -- limit for moving by X are (0 + player's width/2) and -- (screen's width - player's width / 2) if is_down_kb("a") and (x > 26) then x = x - 100*dt -- left elseif is_down_kb("d") and (x < love.graphics.getWidth() - 26) then x = x + 100*dt -- right end if is_down_kb("w") and (y > 42) then y = y - 100*dt -- up elseif is_down_kb("s") and (y < love.graphics.getHeight() - 42) then y = y + 100*dt -- down end -- Update position player.body:setPosition(x, y) -- Angle player to mouse cursor position local direction = math.atan2(love.mouse.getY() - y, love.mouse.getX() - x) player.body:setAngle(direction) -- Shooting if is_down_m(1) then -- If last show was second ago or more then shoot if math.floor(love.timer.getTime() - player.shoot_time) >= 1 then player.shoot() player.shoot_time = love.timer.getTime() pitchMod = 0.8 + love.math.random(0, 10)/25 gunshot:setPitch(pitchMod) gunshot:play() end end end -- Bullet BulletClass = {} -- At object creating it got attributes x & y with position and attributes -- lx & ly with coordinates for vector of bullet's moving direction function BulletClass:new(x, y, lx, ly) local new_obj = {x = x, y = y, lx = lx, ly = ly} self.__index = self return setmetatable(new_obj, self) end -- In this method creates body, shape and fixture function BulletClass:create() -- Body self.body = love.physics.newBody(world, self.x, self.y, "dynamic") self.body:setBullet(true) -- mark that is's bullet -- Shape self.shape = love.physics.newCircleShape(5) -- Fixture body with shape and set mass 0.1 self.fix = love.physics.newFixture(self.body, self.shape, 0.1) -- Set fixture's user data "bullet" self.fix:setUserData("bullet") -- Start bullet's moving by setting it's linear velocity self.body:setLinearVelocity(self.lx, self.ly) end -- This method will be called from love.update() function BulletClass:update(dt) -- Bullet position local x, y = self.body:getPosition() -- If bullet leave screen or collides with other body, delete it -- Because bullet's local point 0,0 in center of body, in 0,0 point half of -- bullet will be still on screen. Bullet fully leave screen -- at -(bullet's radius) or (screen width/height + bullet's radius) point, -- bullet's radius is 5. if x < - 5 or x > (love.graphics.getWidth() + 5) or y < -5 or y > (love.graphics.getHeight() + 5) or not self.fix:getUserData() then self:destroy() end end -- This method will be called from love.draw() function BulletClass:draw() -- Draw filled circle love.graphics.circle("fill", self.body:getX(), self.body:getY(), self.shape:getRadius()) end -- Destroy bullet function BulletClass:destroy() -- Make object = nil will destroy object -- Using "for" loop with step = 1, because it's work faster then ipairs for i = 1, #bullets, 1 do if self == bullets[i] then bullets[i] = nil end end end<file_sep># Top-Down-Shooter Love2D Top-Down-Shooter <file_sep> -- Import anim8 local anim8 = require("anim8") death = love.audio.newSource("zombieDeath.mp3", "static") -- Load zombie sprite enemy_sprite = love.graphics.newImage("zombie-animation.png") -- Create animation grid with frame's width 123, frame's height 80 and -- grid's width/height as sprite's width/height enemy_grid = anim8.newGrid(123, 80, enemy_sprite:getWidth(), enemy_sprite:getHeight()) enemies = {} -- Enemy class EnemyClass = {} function EnemyClass:new() local new_obj = {} self.__index = self return setmetatable(new_obj, self) end function EnemyClass:create() -- Position local x, y -- We need to check distance between zomie and player becase -- zombie must be created not too close to player local near_player = true while near_player do -- Random coordinates x = love.math.random(0, love.graphics.getWidth()) y = love.math.random(0, love.graphics.getHeight()) -- Distance between player and zombie by X local dist_x = math.abs(player.body:getX() - x) -- Distance between player and zombie by Y local dist_y = math.abs(player.body:getY() - y) -- If distance > 100 by X and Y then quit loop if dist_x > 100 and dist_y > 100 then near_player = false end end -- Body, shape, fixture self.body = love.physics.newBody(world, x, y, "dynamic") self.shape = love.physics.newCircleShape(25) self.fix = love.physics.newFixture(self.body, self.shape, 5) self.fix:setUserData("enemy") -- Self-destroy function. Declared as table element (not as method). -- When you create animation you can set which function will be executed -- on animation playing end. With method (self:method()) you will get -- an error, but with function as table element it work fine. self.destroy = function () for i = 1, #enemies, 1 do if self == enemies[i] then enemies[i] = nil end end end -- Enemy animation -- Moving - set grid and frames from 1 to 6 in 1st row with -- playing speed 0.2 self.anm_walk = anim8.newAnimation(enemy_grid("1-6", 1), 0.2) -- Enemy death - set grid and frames from 1 to 6 in 2nd row with playing -- speed 0.2. On animation playing end will be executed self.destroy() self.anm_death = anim8.newAnimation(enemy_grid("1-6", 2), 0.2, self.destroy) -- Set moving as default animation self.anm = self.anm_walk end function EnemyClass:draw() -- Because we need frame's with body's center in one point -- get coordinates moved above and left to half of frame width or -- height local draw_x, draw_y = self.body:getWorldPoint(-40, -40) -- Draw animation self.anm:draw(enemy_sprite, draw_x, draw_y, self.body:getAngle()) end function EnemyClass:update(dt) -- Position local x, y = self.body:getPosition() -- Play animation self.anm:update(dt) -- If fixture's userData is false, -- enemy was killed, show death animation. if not self.fix:getUserData() then death:play() self.anm = self.anm_death -- Else move enemy to player else -- X coordinate -- Coordinates are float (not integer), we need to floor (round) -- it, else enemy can do "convulsice tweeches" because to the -- difference in tenths if math.floor(player.body:getX() - x) ~= 0 then -- If difference < 0 than player to the left of enemy -- Move enemy to left if (player.body:getX() - x) < 0 then x = x - 20*dt -- Else move enemy to right else x = x + 20*dt end end -- Y coordinate if math.floor(player.body:getY() - y) ~= 0 then -- If difference < 0 than, move enemy to top if (player.body:getY() - y) < 0 then y = y - 20*dt -- Else move enemy to bottom else y = y + 20*dt end end -- Angle enemy to player local direction = math.atan2(player.body:getY() - y, player.body:getX() - x) self.body:setAngle(direction) -- Update enemy position self.body:setPosition(x, y) end end<file_sep>require("player") require("enemies") ------------------------------------------------------------------------------- -- Main callbacks ------------------------------------------------------------------------------- function love.load() -- Create world and set callbacks for it world = love.physics.newWorld(0, 0, true) world:setCallbacks(beginContact, endContact, preSolve, postSolve) cursor = love.mouse.newCursor("crosshair.png", 5, 5) love.mouse.setCursor(cursor) -- Load background backgroundImage = love.graphics.newImage("background.png") -- Create player player.create() -- Load and play ambient music music = love.audio.newSource("ambient.mp3", "static") music:setLooping(true) music:play() -- Time for calculating delay betweeb enemies creation -- We will create new enemy per 5 seconds time = love.timer.getTime() -- Killed enemies killed = 0 end function love.update(dt) -- Update world world:update(dt) -- Update player player.update(dt) -- Create new enemy per 5 seconds if math.floor(love.timer.getTime() - time) >= 4 then -- Add enemy to enimes table with index = table length + 1 enemies[#enemies + 1] = EnemyClass:new() -- Once enemy added to table he has last index in table = table length enemies[#enemies]:create() -- Update time for calculation new 5 seconds delay time = love.timer.getTime() end -- Update enemies for _, enemy in pairs(enemies) do enemy:update(dt) end -- Update bullets for _, bullet in pairs(bullets) do bullet:update(dt) end end function love.draw() --Draw background love.graphics.draw(backgroundImage, 0, 0) -- Draw player player.draw() -- Draw enemies for _, enemy in pairs(enemies) do enemy:draw() end -- Draw bullets for _, bullet in pairs(bullets) do bullet:draw() end -- Print how much enemies were killed love.graphics.print("Killed: "..killed, 30, 30) end ------------------------------------------------------------------------------- -- Physics world callbacks ------------------------------------------------------------------------------- function beginContact(a, b, coll) local enemy, bullet -- Check what objects colliding if a:getUserData() == "enemy" then enemy = a elseif b:getUserData() == "enemy" then enemy = b end if a:getUserData() == "bullet" then bullet = a elseif b:getUserData() == "bullet" then bullet = b end -- If enemy collides with bullet if bullet and enemy then -- Set false to both userDatas. That will execute self:destroy() in -- bullet object and set animation to self.anm_death in enemy object, -- after animation playing end will executed self.destroy() for enemy bullet:setUserData(false) enemy:setUserData(false) killed = killed + 1 end -- Else one of variables will nil and colliding will not processed end function endContact(a, b, coll) -- end function preSolve(a, b, coll) -- end function postSolve(a, b, coll, normalimpulse1, tangentimpulse1, normalimpulse2, tangentimpulse2) -- end<file_sep>-- Bullet BulletClass = {} -- At object creating it got attributes x & y with position and attributes -- lx & ly with coordinates for vector of bullet's moving direction function BulletClass:new(x, y, lx, ly) local new_obj = {x = x, y = y, lx = lx, ly = ly} self.__index = self return setmetatable(new_obj, self) end -- In this method creates body, shape and fixture function BulletClass:create() -- Body self.body = love.physics.newBody(world, self.x, self.y, "dynamic") self.body:setBullet(true) -- mark that is's bullet -- Shape self.shape = love.physics.newCircleShape(5) -- Fixture body with shape and set mass 0.1 self.fix = love.physics.newFixture(self.body, self.shape, 0.1) -- Set fixture's user data "bullet" self.fix:setUserData("bullet") -- Start bullet's moving by setting it's linear velocity self.body:setLinearVelocity(self.lx, self.ly) end -- This method will be called from love.update() function BulletClass:update(dt) -- Bullet position local x, y = self.body:getPosition() -- If bullet leave screen or collides with other body, delete it -- Because bullet's local point 0,0 in center of body, in 0,0 point half of -- bullet will be still on screen. Bullet fully leave screen -- at -(bullet's radius) or (screen width/height + bullet's radius) point, -- bullet's radius is 5. if x < - 5 or x > (love.graphics.getWidth() + 5) or y < -5 or y > (love.graphics.getHeight() + 5) or not self.fix:getUserData() then self:destroy() end end -- This method will be called from love.draw() function BulletClass:draw() -- Draw filled circle love.graphics.circle("fill", self.body:getX(), self.body:getY(), self.shape:getRadius()) end -- Destroy bullet function BulletClass:destroy() -- Make object = nil will destroy object -- Using "for" loop with step = 1, because it's work faster then ipairs for i = 1, #bullets, 1 do if self == bullets[i] then bullets[i] = nil end end end
36eb578e089c0b81b4c2d395acc9dd2a79b14188
[ "Markdown", "Lua" ]
5
Markdown
LordKyky/Top-Down-Shooter
170e769f17dbb75bbb9bdfb2e5f9d051ff192f99
594962b6683d9372cf86211465ac9e9dd2654e90
refs/heads/master
<file_sep>/*$(function() { $('body form').each(function(){ var id = $(this).attr('id'); borraAlertas(id); }); });*/ function borraAlertas(form){ $('#'+form+' :input').each(function(){ if( $(this).attr('oblig')==1 ) { name=$(this).attr('name'); //alert(name); $('#err_'+name).html('&nbsp;'); } }); } function valida(me){ var ok=1; var form = me.id; $('#'+form+' :input').each(function(){ tipo=$(this).attr('type'); if ( $(this).attr('oblig')==1&&tipo!="radio"&&tipo!="button"&&tipo!="checkbox"&&tipo!="submit" ) { val=$(this).val(); name=$(this).attr('name'); //alert('Tipo:'+tipo+' Name:'+name+' Val:'+val); if(val=="" || val==" " || val==null || val=='0'){ $('#err_'+name).html('Favor de llenar'); ok=0; }else{ $('#err_'+name).html('&nbsp;'); if(tx_contains(name,'xxemail')){ //deshabilitado temporalmente por conflico con mis rutinas de laravel var atpos=val.indexOf("@"); var dotpos=val.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=val.length){ $('#err_'+name).html("Email inválido"); ok=0; } } } } }); $('#'+form+' input[type=checkbox]').each(function(){ var name = $(this).attr('name'); if($(this).attr('oblig')==1 && !this.checked){ $('#err_'+name).html('Debe aceptar'); ok=0; }else{ $('#err_'+name).html('&nbsp;'); } }); $('#'+form+' input[type=radio]').each(function(){ var name = $(this).attr('name'); var ok_rad = $("input[name="+name+"]:checked").attr('name'); if(ok_rad){ $('#err_'+name).html('&nbsp;'); }else{ $('#err_'+name).html('Seleccione una opción'); ok=0; } }); //var submit_name = $('#'+form+' [name=submit]').attr('name'); if(ok){ $('#'+form+' .submit_a').html("Un momento por favor..."); return true; }else{ $('#'+form+' .submit_a').html("Revise errores por favor"); return false; } } function tx_contains(str,buscar){ ind = str.indexOf(buscar); if(ind == -1) return 0; else return 1; } function block_key(evt,type){ var theEvent = evt || window.event; var keyCode = theEvent.keyCode || theEvent.which; var key = String.fromCharCode(keyCode); var bloquea = 0; console.log('Type:'+type+' evt.keyCode:'+evt.keyCode+' key:'+key); //Solo puede tener.. if(type == 'integer')regex = /[0-9]/; if(type == 'time')regex = /[0-9]|\:/; if(type == 'tel')regex = /[0-9]|\(|\)|\-|\ /; if(type == 'numeric')regex = /[0-9]|\./; if(type == 'alpha_dash')regex = /[0-9]|[a-z]|[A-Z]|\_|\-/; if(type == 'user')regex = /[0-9]|[a-z]|[A-Z]|\.|\_|\-/; //primer parte del email //Solo bloquea.. if(type == 'email')regex = /\ /; // if(evt.keyCode != 8 && evt.keyCode != 9){ //delete y tab if(type == 'email'){ if( regex.test(key) )bloquea = 1; }else{ if( !regex.test(key) )bloquea = 1; } if(bloquea){ theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } }<file_sep>function ini_audio_capture() { if(window.cordova){ //navigator.splashscreen.hide(); no jala en iOS captureApp = new captureApp(); captureApp.run(); }else{ id('bt_record').addEventListener("click", function() { alert('Esta versión es para app movil.'); }); } } function captureApp() {} captureApp.prototype = { pictureSource:null, destinationType:null, run:function() { var that = this; id('bt_record').addEventListener("click", function() { that._capureAudio.apply(that, arguments); }); /*id('captureVideo').addEventListener("click", function() { that._captureVideo.apply(that, arguments); }); id('captureImage').addEventListener("click", function() { that._captureImage.apply(that, arguments); });*/ }, _capureAudio:function() { var that = this; navigator.device.capture.captureAudio(function() { that._captureSuccess.apply(that, arguments); }, function() { captureApp._captureError.apply(that, arguments);//Adroid no funciona duration; en iOS limit siempre es 1 }, {duration: (60*15)}); //limit:1, }, /*_captureVideo:function() { var that = this; navigator.device.capture.captureVideo(function() { that._captureSuccess.apply(that, arguments); }, function() { captureApp._captureError.apply(that, arguments); }, {limit:1}); }, _captureImage:function() { var that = this; navigator.device.capture.captureImage(function() { that._captureSuccess.apply(that, arguments); }, function() { captureApp._captureError.apply(that, arguments); }, {limit:1}); },*/ _captureSuccess:function(capturedFiles) { if(capturedFiles.length == 1){ var mediaFile = capturedFiles[0], path = mediaFile.fullPath, name = mediaFile.name; ext = path.substr(path.lastIndexOf('.') + 1); if(ext != 'wav' && ext != '3gpp' && ext != 'm4a') { navigator.notification.alert(trans_js('movil.no_compatible1')+ext+trans_js('movil.no_compatible2'), null, trans_js('movil.advertencia')); //alert('Archivo: '+ path +'; '+ name+'; '+ mediaFile.type+'; '+ mediaFile.size); } localStorage['path_audio_temp_'+get_url_page()] = path; localStorage['path_audio_temp_size'+get_url_page()] = mediaFile.size; $('#audio').attr('src', path).show(); //$('#audio')[0].play(); //mediaFile.getFormatData(media_suc,media_err); //this._ajax_upload(path); }else navigator.notification.alert('ERROR: Se registro más de un archivo.', null, trans_js('movil.alerta')); }, /*_ajax_upload:function(url){ alert('Subiendo: ' + url); },*/ _captureError:function(error) { //var msg = 'An error occurred during capture: ' + error.code; //alert(msg); var msg = trans_js('custom.mns_no_audio'); navigator.notification.alert(msg, null, trans_js('movil.alerta')); }, } function id(element) {return document.getElementById(element);} /* Not yet supported function media_suc(MediaFileData){ alert('Codecs:'+MediaFileData.codecs+'; '+'Bitrate:'+MediaFileData.bitrate+'; '+'Duration:'+MediaFileData.duration); } function media_err(){ alert('Media File Data no reconocida.'); }*/ /*Mis funciones************************************************************/ function ajax_record_form(){ if(get_url_page() == 'grabar_cuentos.html')var route = 'cuento'; else var route = 'chiste'; $.ajax({ type: 'POST', crossDomain: true, url: url_server + 'movil/form-grabar', data: {route:route}, success: function(str) { $('#result').html(str); ini_audio_capture(); key_enter(); fix_boton_cancel(); if(window.cordova){ if(localStorage['path_audio_temp_'+get_url_page()]){ $("#audio").attr('src', localStorage['path_audio_temp_'+get_url_page()]).show(); } }//else $("#audio").attr('src', 'http://cuento.app:8000/uploads/cuento/2.ogg').show(); $('#modal_loading').modal('hide'); }, error: function(xhr, textStatus, thrownError) { //console.log(xhr); //alert('Error send form login: '+textStatus+'; '+thrownError+'; '+xhr.responseText); alert('Error'); $('#modal_loading').modal('hide'); } }); } function key_enter(){ $("input").keypress(function(event) { if (event.which == 13) { event.preventDefault(); class_form_boton(); //misma fn del bt guardar } }); } function fix_boton_cancel(){ $('#submit_btns_cancel').attr('onclick','window.location = "escuchar_cuentos.html";'); } function modal_show(msg){ $('#modal_no_audio_body').text(msg); $('#modal_no_audio').modal('show'); } function boton(nc,id){ if( !$('#audio').attr('src') )modal_show(trans_js('custom.error_no_audio_recorded')); else if( !$('#nombre').val() || !$('#idioma' ).val() )modal_show(trans_js('custom.error_no_fields')); else upload_audio(); } function upload_audio(){ $('#modal_loading').modal('show'); if(get_url_page() == 'grabar_cuentos.html')var model = 'Cuento'; else var model = 'Chiste'; var fileURL = localStorage['path_audio_temp_'+get_url_page()]; var options = new FileUploadOptions(); options.fileKey="file"; options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1); //options.mimeType="audio/3gp"; var params = {}; params.model = model; params.nombre = $('#nombre').val(); params.idioma = $('#idioma').val(); params.size_mb = localStorage['path_audio_temp_size'+get_url_page()]/1024/1024; params.ext = fileURL.substr(fileURL.lastIndexOf('.') + 1); options.params = params; options.chunkedMode = false; var ft = new FileTransfer(); ft.upload(fileURL, encodeURI(url_server + 'movil/upload'), win, fail, options, true); } function win(r) { $('#modal_loading').modal('hide'); //r.bytesSent, r.responseCode var data = JSON.parse(r.response); if(data.success){ //alert(data.msg); var end_url = (get_url_page() == 'grabar_cuentos.html') ? 'mis_cuentos.html':'mis_chistes.html'; localStorage['path_audio_temp_'+get_url_page()] = ''; window.location = end_url; }else{ navigator.notification.alert(data.msg, null, trans_js('movil.alerta')); } } function fail(error) { //si borran el archivo llega aquí $('#modal_loading').modal('hide'); var msg = "An error has occurred: Code = " + error.code +' | '+ error.source +' | '+ error.target; navigator.notification.alert(dmsg, null, trans_js('movil.alerta')); //console.log("upload error source " + error.source); //console.log("upload error target " + error.target); } <file_sep>//Prototypes Storage.prototype.setObj = function(key, obj){ return this.setItem(key, JSON.stringify(obj)) } Storage.prototype.getObj = function(key){ if(this.getItem(key))return JSON.parse(this.getItem(key)); else return ''; } if(typeof String.prototype.endsWith != 'function'){ //'Hello'.endsWith('lo') = 1 String.prototype.endsWith = function(str) { return this.indexOf(str, this.length - str.length) !== -1; }; } if(typeof String.prototype.startsWith != 'function'){ //'Hello'.startsWith('He') = 1 String.prototype.startsWith = function (str){ return this.indexOf(str) == 0; }; } //alert('pre:'+sessionStorage.session); //Inicial values if(sessionStorage.session){ url_base = localStorage.url_base; }else{ //alert('Nueva sessión'); //if(bowser.ios)localStorage.user = ''; //Creo que solo en el simulador cambia el URL por lo que si puede recordar el login url_base = localStorage.url_base = get_url_base(); //en iOS cada que se abre la app cambia el url localStorage['path_audio_temp_grabar_cuentos.html'] = ''; localStorage['path_audio_temp_grabar_chistes.html'] = ''; sessionStorage.session = 1; } user_str = localStorage.user; //sirve para comparar el valor antes y despues del login url_server = get_url_server(); //alert(url_server); if(!localStorage.language)localStorage.language = config_js('app.locale'); //Internet Conection if(location.href != url_base + 'sin_conexion.html'){ if(doesConnectionExist()){ localStorage.online = 1; //console.log('Si hay conexión'); }else{ localStorage.online = ''; console.log('No conexión'); window.location = 'sin_conexion.html'; } } function get_url_page(){ var url = location.href; var n = url.lastIndexOf('/'); var pag_y_query = url.substring(n+1); n = pag_y_query.indexOf('?'); if(n > -1)return pag_y_query.substring(0,n); else return pag_y_query; } function get_url_base(){ var url = location.href; var n = url.lastIndexOf('/'); var res = url.substring(0, n+1); return res; } function get_url_server(){ var prot = location.protocol+'//'; var host = location.host; //puede o no llevar www. if( host.indexOf('dev.karaokeplus.com.mx') == 0 )return prot+host+'/cuento/public/'; if( host.indexOf('cuento.app') == 0 || host.indexOf('historiasenfamilia.com') == 0)return prot+host+'/'; return 'http://historiasenfamilia.com/'; } function config_js(str){ var config; config = {'app':'','site':''} config.app = {'locale':'es'} config.site = {'titulo_front':'Historias en Familia'} // var div2 = str.split('.'); if(div2.length != 2)return 'ERROR: Argumento incorrecto en función config: '+str; if( config.hasOwnProperty(div2[0]) ){ if( config[div2[0]].hasOwnProperty(div2[1]) )return config[div2[0]][div2[1]]; } return 'ERROR: No se encontró este valor en la librería config: '+str; } function doesConnectionExist() { var xhr = new XMLHttpRequest(); var file = url_server + 'img/favicon.png'; var randomNum = Math.round(Math.random() * 10000); xhr.open('HEAD', file + "?rand=" + randomNum, false); try{ xhr.send(); if(xhr.status >= 200 && xhr.status < 304)return true; else return false; }catch(e){ return false; } }<file_sep>//Translations trans_js('site.mo_tit_conection'); //console.log('1 language.js'); function trans_js(str){ var lan = localStorage.language; var lang = { 'en':{}, 'es':{}, } lang.en.custom = { 'paq_vitalicia':'Life Membership', 'search':'SEARCH', 'home':'Home', 'record':'Record', 'record_cuento':'Record Tale', 'record_chiste':'Record Joke', 'listen':'Listen', 'listen_cuento':'Listen Tale', 'listen_chiste':'Listen Joke', 'instructions':'Instructions', 'pay':'Sign up here', 'mis_cuentos':'My Tales', 'mis_chistes':'Mis Jokes', 'logout':'Logout', 'signup_login':'Sign Up-Login', 'signup_btn':'Sign up here', 'contact':'Contact', 'spanish':'Spanish', 'english':'English', 'fi_lang':'Language', 'fi_user':'User', 'fi_title':'Title', 'fi_date':'Recorded from', 'mns_no_audio':'ERROR: No recorded audio found.', 'mns_save_audio':'Audio file successfully saved.', 'bt_record':'RECORD', 'bt_stop':'FINISH', 'bt_pause_resume1':'PAUSE', 'bt_pause_resume2':'CONTINUE', 'recording':'RECORDING', 'recording_stop':'RECORDING HALT IN', 'seconds':'secs.', 'minutes':'min.', 'msg_duration':'Sorry but the recording limit has been reached: ', 'error_mobile':'error_mobile', 'error_browser':'error_browser', 'error_no_audio_recorded':'No recording was registered, please press the "RECORD" button.', 'error_no_fields':'Please complete the fields: "Title" and "Language".', 'tip_browser':'', 'bt_play':'PLAY', 'bt_play_all':'PLAY ALL', 'bt_pause':'PAUSE', 'bt_stop2':'STOP', 'estatus':'Status', 'title':'Title', 'language':'Language', 'user':'User', 'uploaded':'Recorded in', 'playing':'Playing: ', 'playing_all':'Playing ', 'pie_email':'<p>Any questions please reply to this email.</p><p class="pie">--<br>Sincerely "Historias En Familia" support team.<br><a href="http://www.historiasenfamilia.com">www.historiasenfamilia.com</a></p>', 'status_0':'In Review', 'status_1':'Published', 'status_2':'Rejected', 'status_0_desc':'Our moderators are reviewing your recorded material.', 'status_1_desc':'Your tale or joke has been published.', 'status_2_desc':'Your tale or joke has been rejected and wont be published because the content or language is not appropriate for this site.', 'contrato':'Terms Historias en Familia.pdf' } lang.en.site = { 'pag_of':' of ', 'bt_signup2':'I´m a New User', 'bt_login':'Login', 'bt_pago':'Pay Membership', 'lab_email_user':'Email or User Name', 'lab_pass':'<PASSWORD>', 'mo_tit_conection':'Connection error, please try again.' } lang.en.movil = { 'alerta':'Alert', 'advertencia':'Warning', 'no_compatible1':'Your device records in audio format "', 'no_compatible2':'" and it may not be compatible with the application.', } lang.es.custom = { 'paq_vitalicia':'Membresía Vitalicia', 'search':'BUSCAR', 'home':'Inicio', 'record':'Grabar', 'record_cuento':'Grabar Cuentos', 'record_chiste':'Grabar Chistes', 'listen':'Escuchar', 'listen_cuento':'Escuchar Cuentos', 'listen_chiste':'Escuchar Chistes', 'instructions':'Instrucciones', 'pay':'Regístrate Aquí', 'mis_cuentos':'Mis Cuentos', 'mis_chistes':'Mis Chistes', 'logout':'Salir', 'signup_login':'Registro-Ingreso', 'signup_btn':'Regístrate Aquí', 'contact':'Contacto', 'spanish':'Español', 'english':'Inglés', 'fi_lang':'Idioma', 'fi_user':'Usuario', 'fi_title':'Título', 'fi_date':'Grabado desde', 'mns_no_audio':'ERROR: No se encontró el audio grabado.', 'mns_save_audio':'Archivo de audio guardado exitosamente.', 'bt_record':'GRABAR', 'bt_stop':'TERMINAR', 'bt_pause_resume1':'PAUSAR', 'bt_pause_resume2':'CONTINUAR', 'recording':'GRABANDO', 'recording_stop':'GRABACIÓN DETENIDA EN', 'seconds':'segs.', 'minutes':'min.', 'msg_duration':'Lo sentimos pero se alcanzo el límite de grabación: ', 'error_mobile':'error_mobile', 'error_browser':'error_browser', 'error_no_audio_recorded':'No se registró ninguna grabación, por favor presione el botón "GRABAR".', 'error_no_fields':'Favor de llenar los campos: "Título" e "Idioma".', 'tip_browser':'', 'bt_play':'REPRODUCIR', 'bt_play_all':'TODOS', 'bt_pause':'PAUSA', 'bt_stop2':'DETENER', 'estatus':'Estatus', 'title':'Título', 'language':'Idioma', 'user':'Usuario', 'uploaded':'Grabado en', 'playing':'Reproduciendo: ', 'playing_all':'Reproduciendo ', 'pie_email':'<p>Cualquier duda favor de responder este email.</p><p class="pie">--<br>Atte. Soporte "Historias En Familia".<br><a href="http://www.historiasenfamilia.com">www.historiasenfamilia.com</a></p>', 'status_0':'Por revisar', 'status_1':'Publicado', 'status_2':'Rechazado', 'status_0_desc':'Pronto nuestros moderadores revisarán el material.', 'status_1_desc':'Su cuento o chiste ha sido publicado.', 'status_2_desc':'Su cuento o chiste ha sido rechazado debido a lenguaje o contenido no apto para este sitio.', 'contrato':'Terminos Historias en Familia.pdf' } lang.es.site = { 'pag_of':' de ', 'bt_signup2':'Soy Usuario Nuevo', 'bt_login':'Ingresar', 'bt_pago':'Pagar Membresía', 'lab_email_user':'Correo web o Nombre de usuario', 'lab_pass':'<PASSWORD>', 'mo_tit_conection':'Error de conexión, por favor vuelva a intentar.' } lang.es.movil = { 'alerta':'Alerta', 'advertencia':'Advertencia', 'no_compatible1':'Su dispositivo graba en formato "', 'no_compatible2':'" y puede no ser compatible con la aplicación.', } // var div2 = str.split('.'); if(div2.length != 2)return 'ERROR: Argumento incorrecto en función trans: '+str; if( lang.hasOwnProperty(lan) ){ if( lang[lan].hasOwnProperty(div2[0]) ){ if( lang[lan][div2[0]].hasOwnProperty(div2[1]) )return lang[lan][div2[0]][div2[1]]; } } return 'ERROR: No se encontró esta palabra en librería de idiomas: '+str; }<file_sep>//console.log('2 interfaz.js'); function crea_btns(){ var user = localStorage.getObj('user'); var btns = [ ['home','color1','index'], ['record',[ ['record_cuento','color2','grabar_cuentos'], ['record_chiste','color2','grabar_chistes'] ]], ['listen',[ ['listen_cuento','color3','escuchar_cuentos'], ['listen_chiste','color3','escuchar_chistes'] ]] ]; if(user)btns.push( ['user_name',[ ['mis_cuentos','color5','mis_cuentos'], ['mis_chistes','color5','mis_chistes'], ['logout','color5','logout()'] ]] ); else btns.push( ['signup_login','color5','auth'] ); var html = ''; for(c in btns){ if(typeof btns[c][1] == 'object'){ var arr = btns[c][1]; var label = (btns[c][0] == 'user_name') ? user.user:trans_js('custom.'+btns[c][0]); var clas2 = drop_selected(arr); var clase = arr[0][1]+' '+clas2; clase = clase.trim(); html += '<li class="dropdown">'; html += '<a href="#" class="'+clase+'" data-toggle="dropdown">'; html += label+' <span class="caret"></span></a>'; html += '<ul class="dropdown-menu">'; //si quito esta clase funcion en "roll-over" pero ya no jala en la tablet for(i in arr){ html += '<li>'+nav_li(trans_js('custom.'+arr[i][0]), arr[i][1], arr[i][2], 'sub')+'</li>'; } html += '</ul></li>'; }else{ html += '<li>'+nav_li(trans_js('custom.'+btns[c][0]), btns[c][1], btns[c][2], 'main')+'</li>'; } } html += '<div class="clearfix"></div>'; html += '<div>'; html += '<a href="javascript:language(\'es\')">'+trans_js('custom.spanish')+' <img src="img/Esp.png"></a>'; html += '&nbsp;&nbsp;&nbsp;'; html += '<a href="javascript:language(\'en\')">'+trans_js('custom.english')+' <img src="img/Ing.png"></a>'; html += '</div>'; return html; } function nav_li(lab, clas1, url, tipo){ var url_full, clas2; if( url.endsWith('()') ){ url_full = 'javascript:'+url; clas2 = ''; }else{ url_full = url_base+url+'.html'; clas2 = (location.href == url_full) ? 'select':''; } //if(tipo == 'sub')clas1 = ''; var clase = clas1+' '+clas2; clase = clase.trim(); //if(clase)clase += ' botonera'; //else clase = 'botonera'; if(tipo == 'sub')clase = ''; return '<a href="'+(url_full)+'" class="'+clase+'">'+lab+'</a>'; } function drop_selected(arr){ var url_full, url; for(i in arr){ url = arr[i][2]; url_full = url_base+url+'.html'; if(location.href == url_full)return 'select'; } return ''; }<file_sep>@charset "utf-8"; /*@import url(http://fonts.googleapis.com/css?family=Audiowide);*/ .audio_ios{ width: 100%; height: 70px; } .record_btns{ border-style: solid; padding: 8px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; font: large Audiowide, serif; background-color: #86B3FE; cursor: pointer; } .record_btns:hover{ background-color: #ecc800; } #audio_titulo{ font-weight: bold; font-size: x-large; color: #86B3FE; } .record_btns{ background-color: #ffd800; } .disab{ opacity: 0.5; cursor: default; } #grabando{ background-color: #FB0313; border-style: solid; padding: 3px; font: x-large Audiowide, serif; margin-bottom: 20px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; display: none; }<file_sep>//console.log('3 global.js'); $(function() { //alert('ini_global'); //loading screen modal_loading_init(); //BS $('#modal_loading').modal({ backdrop: 'static', show: false }); $('#modal_loading').modal('show'); $(document).ajaxStart(function(){$('#modal_loading').modal('show'); //alert('start: '+url_base); }); /*$(document).ajaxComplete(function(){$('#modal_loading').modal('hide'); //alert('finish'); }); */ //$('.botonera').click(function(){ $('#modal_loading').modal('show'); }); //Ini event if(window.cordova)document.addEventListener("deviceready", onDeviceReady0, false); else onDeviceReady0(); }); function modal_loading_init() { //desactivar: $('#div_modal_loading').html(''); $("body").prepend('<div id="div_modal_loading"><div class="modal fade" style="z-index: 1051" id="modal_loading" tabindex="-1"><img style="position: absolute;top: 50%;left: 50%;margin-top: -18px;margin-left: -18px;" src="packages/bootstrap/loading.gif" width="37" height="37"></div></div>'); } function onDeviceReady0(){ if(typeof(Storage) !== 'undefined') { onDeviceReady(); if(localStorage.online){ login_data(); } } else { alert('Sorry! No Web Storage support'); } } //Funciones function language(str){ localStorage.language = str; ajax_language(str); } function ajax_language(lan){ $.ajax({ type: "POST", crossDomain: true, url: url_server + 'movil/language', data: { lan:lan }, error: function(x, t, m) { console.log(x); } }).done(function() { location.reload(); }); } function login_data(){ //alert('login_data: ' + url_server + 'movil/checklogin'); $.ajax({ type: 'POST', crossDomain: true, url: url_server + 'movil/checklogin', cache: false, dataType: 'json', success: function(data) { //alert(user_str+' = '+ JSON.stringify(data)); var ruta_si = (get_url_page() != 'auth.html') ? 1:0; if(data.success){ //alert('success'); localStorage.setObj('user',data); if(user_str != localStorage.user)location.reload(); if(!data.pagado && ruta_si)$('.sin_pago_'+localStorage.language).show(); login_data_exe(data); }else{ //alert('failed'); //en iOS cada que se abre la app se pierde el log porque cambia el url localStorage.user = ''; if(user_str)location.reload(); else{ if(ruta_si)$('.sin_pago_'+localStorage.language).show(); login_data_exe(''); } } }, error: function(xhr, textStatus, thrownError) { //console.log(xhr); //debug.error(xhr); //para cordova en xcode //alert('Error login_data(): '+textStatus+'; '+thrownError+'; '+xhr.responseText); location.reload(); } }); } function logout(){ //alert('logout: '+url_server+'movil/logout'); $.ajax({ type: 'POST', crossDomain: true, url: url_server + 'movil/logout', dataType: 'json', success: function(data) { if(data.success){ localStorage.user = ''; window.location = 'index.html'; } }, error: function(xhr, textStatus, thrownError) { //console.log(xhr); //alert('Error send form login: '+textStatus+'; '+thrownError+'; '+xhr.responseText); $('#modal_loading').modal('hide'); alert( trans_js('site.mo_tit_conection') ); } }); } //autoria /*function do_login(id){ $.ajax({ type: 'POST', crossDomain: true, url: url_server + 'movil/dologin', data: {id:id}, success: function(data) { alert('Se hizo login de:'+data); }, error: function(xhr, textStatus, thrownError) { //console.log(xhr); //alert('Error send form login: '+textStatus+'; '+thrownError+'; '+xhr.responseText); alert('Error'); $('#modal_loading').modal('hide'); } }); }*/ function class_form_boton(nc){ //solo por compatibilidad //$('#boton').val(nc); boton(nc,0); } function open_pdf(nom){ //Para movil lo usa el plug inappbrowser //alert( encodeURI(urlserver + nom + '.pdf') ); window.open(encodeURI(url_server + nom + '.pdf'), '_system'); //https://github.com/apache/cordova-plugin-inappbrowser/blob/8ce6b497fa803936784629187e9c66ebaddfbe1b/doc/index.md //_blank abre en InAppBrowser; _system abre en el navegador default del sistema //location yes: (para InAppBrowser), muestra la barra de location } function open_html(url){ //Para movil lo usa el plug inappbrowser if(window.cordova){ url += '?movil=1'; //Para brincarse el bloqueo window.open(encodeURI(url), '_blank', 'location=yes,enableViewportScale=yes'); //enableViewportScale: solo para ios; default es “no”; android funciona como “si” }else window.location = url; } //iframe var player_disp = 0; function resizeIframe(obj) { var doc = obj.contentWindow.document; if($('iframe').attr('height') != doc.body.offsetHeight){ $('iframe').attr('height',doc.body.offsetHeight); //alert('resize'); $('#modal_loading').modal('hide'); } } /*function iframe_con_player(){ //no jalo porque en movil no llegan los mensajes del iframe //alert('iframe_con_player'); if(!player_disp){ var height = $('iframe').attr('height'); $('iframe').attr('height', Number(height)+220); player_disp = 1; } }*/ function iframe_interval(){ //work around para Android (checar en iOS) //if(window.cordova){ setInterval(function(){ var iframe = document.getElementById('myIFrame'); console.log(iframe.contentWindow.document.body.offsetHeight + '; '+(new Date().getTime())); resizeIframe(iframe); },2000); //}else $('#modal_loading').modal('hide'); }
027f1950baed86b5f1851a70d3590226ccdd8792
[ "JavaScript", "CSS" ]
7
JavaScript
ebelendez/cuento
56b99d77f6f4a2795a1e27b4eeb1538a4895c301
949b116da0622cfc34c807a2527bbb254eeefd8f
refs/heads/main
<repo_name>gnarendra89/cloud-config-server<file_sep>/application.properties end.point.server.city.url=http://localhost:8090/v1/getCities
8c40408b486dbbd18fcd8b73d76788baa278c614
[ "INI" ]
1
INI
gnarendra89/cloud-config-server
d4af4ad939b159b460a281584389ccf9cebe8f2e
2f11393573535c43d865c31c00e0fbd17ba7757e
refs/heads/master
<file_sep>Imports System.Data.OleDb Imports System.Net.Sockets Imports PeddersPrint.MinimalisticTelnet Public Class Main Dim Full_Stop As String = "" Dim TelnetClient As New TcpClient Public host As String = "192.168.0.15" Public Shared SpringPath As String Public MessageChecked As Boolean = False Public Shared ReadOnly Property MyDocuments As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments Private Sub btSelect_Click(sender As Object, e As EventArgs) Handles btSelect.Click If txBarcode.Text = "" Then MsgBox("ProductName Code must be Entered",, "Error") txBarcode.Focus() Return End If Me.Cursor = Cursors.WaitCursor 'If Length > 11 then assume barcode has been entered Dim ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & SpringPath & "';Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';" Dim cn As New OleDbConnection(ConnStr) Dim ct As String If Len(txBarcode.Text) > 11 And IsNumeric(txBarcode.Text) Then ct = "Select [Part No], [Spec Code], Colour,[Free Hgt], [Pedders Barcode Number] from [Spring M-Spec$] where [Pedders Barcode Number] = " & txBarcode.Text Else ct = "Select [Part No], [Spec Code], Colour,[Free Hgt], [Pedders Barcode Number] from [Spring M-Spec$] where [Part No] = '" & txBarcode.Text & "'" End If Dim cm As New OleDb.OleDbCommand(ct, cn) cn.Open() Dim reader As OleDbDataReader = cm.ExecuteReader() If reader.HasRows Then reader.Read() If reader.Item("Colour") = "Red" Then txProduct.ForeColor = Color.IndianRed Else txProduct.ForeColor = Color.Gray End If txProduct.Text = reader.Item("Part No").ToString txSpec.Text = reader.Item("Spec Code").ToString txBarcode.Text = reader.Item("Pedders Barcode Number").ToString Else Me.Cursor = Cursors.Default MsgBox("Product not found in spreadsheet") 'txBarcode.Text = "" txBarcode.Focus() Return End If reader.Close() cn.Close() If txBarcode.Text = "" Then MsgBox("Product " & txProduct.Text & " has no Barcode Cannot Proceeed",, "Error") txBarcode.Focus() Return End If txProduct.BackColor = Color.WhiteSmoke txSpec.BackColor = Color.WhiteSmoke Me.AcceptButton = btPrint btPrint.Enabled = True btCancel.Enabled = True btSelect.Enabled = False btPrint.Focus() txBarcode.ReadOnly = True NudMM.ReadOnly = False NudMM.Enabled = True NudYY.ReadOnly = False NudYY.Enabled = True LblPrintMessage.Text = "" Me.Cursor = Cursors.Default End Sub Private Sub btPrint_Click(sender As Object, e As EventArgs) Handles btPrint.Click host = My.Settings.PrinterIP5300 Dim TCPClient As New TcpClient Dim str As String Dim MessageCode As String Me.Cursor = Cursors.WaitCursor LblPrintMessage.Text = "Connecteing to Ci3500 at " & host & vbCr 'Connect to telnet Try 'create a new telnet connection to hostname host on port "3028" Dim tc As New TelnetConnection(host, 3028) If tc.IsConnected Then ' First time check that messages are loaded into printer. If Not MessageChecked Then 'First check that messages are loaded in Printer. tc.WriteLine("ML") 'Wait 0.5 sec System.Threading.Thread.Sleep(500) ' Read Return from Printer str = tc.Read() 'Check that LOGO message is in printer. If InStr(str, "LOGO") < 1 Then MessageBox.Show("Printer is missing the LOGO message. Reload from Backup") End If 'Check that TEXT message is in printer. ' If InStr(str, "TEXT") = -1 Then ' MessageBox.Show("Printer is missing the LOGObatch message. Reload from Backup") ' End If MessageChecked = True End If LblPrintMessage.Text = "Sending message to Ci3500" & vbCr 'If Logo then Print SMLogo else SMTEXT If cbPrintLogo.CheckState Then MessageCode = "SMLOGO" Else MessageCode = "SMTEXT" LblPrintMessage.Text = LblPrintMessage.Text & MessageCode & vbCr tc.WriteLine(MessageCode) If tc.Read() <> "" Then MessageBox.Show("Error Message not sent successfully", "Connection Error") If cbPrintLogo.CheckState Then LblPrintMessage.Text = LblPrintMessage.Text & "MD,," & txProduct.Text & " " & txSpec.Text & " " & NudMM.Value & "/" & NudYY.Value tc.WriteLine("MD,," & txProduct.Text & " " & txSpec.Text & " " & NudMM.Value & "/" & NudYY.Value) Else LblPrintMessage.Text = LblPrintMessage.Text & "MD," & txProduct.Text & " " & txSpec.Text & " " & NudMM.Value & "/" & NudYY.Value tc.WriteLine("MD," & txProduct.Text & " " & txSpec.Text & " " & NudMM.Value & "/" & NudYY.Value) End If If tc.Read() <> "" Then MessageBox.Show("Error Message not sent successfully", "Connection Error") Else MessageBox.Show("Error connecting to Ci3500, ensure it is powered up, and connection cable is secure") End If Catch ex As Exception MessageBox.Show("Error connecting to Ci3500, ensure it is powered up, and connection cable is secure" & vbCr & ex.Message, "Connection Error") Me.Cursor = Cursors.Default txBarcode.Focus() Return End Try 'Clear Barcode and Prepare for new code to be scanned. txBarcode.Text = "" If cbManualEntry.Checked Then btSelect.Enabled = False txBarcode.Enabled = False txProduct.ReadOnly = False txProduct.Focus() txSpec.ReadOnly = False btCancel.Enabled = True btPrint.Enabled = True Me.AcceptButton = btPrint Else txBarcode.ReadOnly = False txBarcode.Focus() NudMM.Enabled = False NudYY.Enabled = False btSelect.Enabled = True Me.AcceptButton = btSelect btPrint.Enabled = False btCancel.Enabled = False End If Me.Cursor = Cursors.Default TelnetClient.Close() End Sub Private Sub NudBatchNo_Leave(sender As Object, e As EventArgs) End Sub Private Sub btCancel_Click(sender As Object, e As EventArgs) Handles btCancel.Click btPrint.Enabled = False btCancel.Enabled = False txBarcode.Text = "" NudMM.ReadOnly = True NudMM.Enabled = False NudYY.ReadOnly = True NudYY.Enabled = False txBarcode.ReadOnly = False txProduct.Text = "" txSpec.Text = "" cbManualEntry_CheckedChanged(Me, e) End Sub Private Sub btSettings_Click(sender As Object, e As EventArgs) Handles btSettings.Click If My.Settings.PrinterIP3500 <> "" Then Settings.txPrinterIP3500.Text = My.Settings.PrinterIP3500 Else Settings.txPrinterIP3500.Text = "192.168.0.181" End If If My.Settings.PrinterIP5300 <> "" Then Settings.txPrinterIP5300.Text = My.Settings.PrinterIP5300 Else Settings.txPrinterIP5300.Text = "192.168.0.180" End If ' Settings.txPath.Text = My.Settings.SpreadsheetPath Settings.cbLogo.Text = My.Settings.Logo Settings.ShowDialog() End Sub Private Sub cbManualEntry_CheckedChanged(sender As Object, e As EventArgs) Handles cbManualEntry.CheckedChanged If cbManualEntry.Checked Then btSelect.Enabled = False txBarcode.Enabled = False txProduct.ReadOnly = False txProduct.Focus() txSpec.ReadOnly = False NudMM.Enabled = True NudYY.Enabled = True btCancel.Enabled = True btPrint.Enabled = True Me.AcceptButton = btPrint Else btSelect.Enabled = True txBarcode.Enabled = True txProduct.ReadOnly = True txSpec.ReadOnly = True NudMM.Enabled = False NudYY.Enabled = False txBarcode.ReadOnly = False txBarcode.Focus() Me.AcceptButton = btSelect btPrint.Enabled = False btCancel.Enabled = False txBarcode.Text = "" txProduct.Text = "" txSpec.Text = "" End If End Sub Private Sub txProduct_ModifiedChanged(sender As Object, e As EventArgs) Handles txSpec.ModifiedChanged, txProduct.ModifiedChanged If cbManualEntry.Checked Then If txSpec.Text <> "" And txProduct.Text <> "" Then btPrint.Enabled = True Else btPrint.Enabled = False End If End If End Sub Private Sub ExitMI_Click(sender As Object, e As EventArgs) Handles ExitMI.Click End End Sub Private Sub BackupMI_Click(sender As Object, e As EventArgs) Handles BackupMI.Click Dim str As String 'Connect to telnet Try 'create a new telnet connection to hostname host on port "23" Dim tc As New TelnetConnection(host, 3028) If tc.IsConnected Then 'First check that messages are loaded in Printer. tc.WriteLine("BB") 'Wait 1 sec System.Threading.Thread.Sleep(1000) ' Read Return from Printer str = tc.Read() 'Write Back to file If str <> "" Then Dim file As System.IO.StreamWriter file = My.Computer.FileSystem.OpenTextFileWriter(My.Settings.SpreadsheetPath & "\Ci3500Backup.xml", False) file.WriteLine(str) file.Close() MessageBox.Show("Backup sucessful file ci3500Backup.xml saved in directory " & My.Settings.SpreadsheetPath, "Backup Success", MessageBoxButtons.OK) Else MessageBox.Show("Backup Failed", "Error") End If End If Catch ex As Exception MessageBox.Show("Error connecting to Ci3500, ensure it is powered up, and connection cable is secure" & vbCr & ex.Message, "Connection Error") Me.Cursor = Cursors.Default Return End Try End Sub Private Sub Main_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim version As String = System.Windows.Forms.Application.ProductVersion Me.Text = Me.Text & " Version : " & version Me.Icon = My.Resources.PedderIcon cbManualEntry.Checked = False ' Set Both Printers to On. cbCi3500.Checked = True cbCi5300.Checked = True 'Define Spreadsheet Path If My.Settings.SpreadsheetPath = "" Then SpringPath = MyDocuments & "\Spring.xls" Else SpringPath = My.Settings.SpreadsheetPath & "\Spring.xls" End If 'Set Logo from Settings If My.Settings.Logo = "Pedders" Then PictureBox1.Image = My.Resources.PeddersLogo Else PictureBox1.Image = My.Resources.easyprintLogo End If txBarcode.Text = "" txProduct.Text = "" txSpec.Text = "" NudMM.Value = Month(Now) NudYY.Value = Convert.ToInt32(Now.ToString("yy")) Me.AcceptButton = btSelect LblPrintMessage.Text = "" txBarcode.Focus() txBarcode.Select(0, 0) End Sub End Class <file_sep>Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("PeddersPrint 1.1.0.8")> <Assembly: AssemblyDescription("Printing Pedders springs codes to Ci3500 Printer")> <Assembly: AssemblyCompany("<NAME>")> <Assembly: AssemblyProduct("PeddersPrint")> <Assembly: AssemblyCopyright("Copyright © <NAME> 0403 200 640 <EMAIL>")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("79802b04-1735-4b29-93e5-48d968a2fe91")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.1.0.9")> <Assembly: AssemblyFileVersion("1.1.0.9")> <file_sep>' minimalistic telnet implementation ' conceived by <NAME> on 2007/06/06 for codeproject ' ' http://www.corebvba.be Imports System.Text Imports System.Net.Sockets Namespace MinimalisticTelnet Enum Verbs WILL = 251 WONT = 252 [DO] = 253 DONT = 254 IAC = 255 End Enum Enum Options SGA = 3 End Enum Class TelnetConnection Private tcpSocket As TcpClient Private TimeOutMs As Integer = 100 Public Sub New(Hostname As String, Port As Integer) tcpSocket = New TcpClient(Hostname, Port) End Sub Public Function Login(Username As String, Password As String, LoginTimeOutMs As Integer) As String Dim oldTimeOutMs As Integer = TimeOutMs TimeOutMs = LoginTimeOutMs Dim s As String = Read() If Not s.TrimEnd().EndsWith(":") Then Throw New Exception("Failed to connect : no login prompt") End If WriteLine(Username) s += Read() If Not s.TrimEnd().EndsWith(":") Then Throw New Exception("Failed to connect : no password prompt") End If WriteLine(Password) s += Read() TimeOutMs = oldTimeOutMs Return s End Function Public Sub WriteLine(cmd As String) Write(cmd & Convert.ToString(vbLf)) End Sub Public Sub Write(cmd As String) If Not tcpSocket.Connected Then Return End If Dim buf As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(cmd.Replace(vbNullChar & "xFF", vbNullChar & "xFF" & vbNullChar & "xFF")) tcpSocket.GetStream().Write(buf, 0, buf.Length) End Sub Public Function Read() As String If Not tcpSocket.Connected Then Return Nothing End If Dim sb As New StringBuilder() Do ParseTelnet(sb) System.Threading.Thread.Sleep(TimeOutMs) Loop While tcpSocket.Available > 0 Return sb.ToString() End Function Public ReadOnly Property IsConnected() As Boolean Get Return tcpSocket.Connected End Get End Property Private Sub ParseTelnet(sb As StringBuilder) While tcpSocket.Available > 0 Dim input As Integer = tcpSocket.GetStream().ReadByte() Select Case input Case -1 Exit Select Case CInt(Verbs.IAC) ' interpret as command Dim inputverb As Integer = tcpSocket.GetStream().ReadByte() If inputverb = -1 Then Exit Select End If Select Case inputverb Case CInt(Verbs.IAC) 'literal IAC = 255 escaped, so append char 255 to string sb.Append(inputverb) Exit Select Case CInt(Verbs.[DO]), CInt(Verbs.DONT), CInt(Verbs.WILL), CInt(Verbs.WONT) ' reply to all commands with "WONT", unless it is SGA (suppres go ahead) Dim inputoption As Integer = tcpSocket.GetStream().ReadByte() If inputoption = -1 Then Exit Select End If tcpSocket.GetStream().WriteByte(CByte(Verbs.IAC)) If inputoption = CInt(Options.SGA) Then tcpSocket.GetStream().WriteByte(If(inputverb = CInt(Verbs.[DO]), CByte(Verbs.WILL), CByte(Verbs.[DO]))) Else tcpSocket.GetStream().WriteByte(If(inputverb = CInt(Verbs.[DO]), CByte(Verbs.WONT), CByte(Verbs.DONT))) End If tcpSocket.GetStream().WriteByte(CByte(inputoption)) Exit Select Case Else Exit Select End Select Exit Select Case Else sb.Append(ChrW(input)) Exit Select End Select End While End Sub End Class End Namespace '======================================================= 'Service provided by Telerik (www.telerik.com) 'Conversion powered by NRefactory. 'Twitter: @telerik 'Facebook: facebook.com/telerik '=======================================================
1d34fcddefcc4065bc769913fa81a4c71274bdbb
[ "Visual Basic .NET" ]
3
Visual Basic .NET
runnaln/Pedders-Print-Solution
8abf4ea7b5d315f819396a5217d07727addf3bb7
b00b979ee411f5b281fba17246e6936589a39d27
refs/heads/master
<repo_name>St-coder/public_actions<file_sep>/.github/workflows/juejin_helper.yml name: JueJin_Helper on: # push: # branches: # - main schedule: - cron: '30 22 * * *' # 该时间为UTC时间,比北京时间晚8个小时,每天早上6点半自动执行 workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 - run: npm ci send: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 registry-url: https://npm.pkg.github.com/ - name: Run Project env: COOKIE: ${{ secrets.COOKIE }} PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }} SUOHA: ${{ secrets.SUOHA }} run: npm ci && node index.js "${COOKIE}" "${PUSH_PLUS_TOKEN}" "${SUOHA}" <file_sep>/pushPlus.js const fetch = require('node-fetch'); const pushPlus = async (data) => { const body = { token: process.env.push_plus_token, title: `${data.title}`, content: `${data.content}`, }; try { const pushPlusRes = await fetch('https://www.pushplus.plus/send', { headers: { 'Content-Type': ' application/json' }, method: 'POST', body: JSON.stringify(body), credentials: 'include', }).then((res) => res.json()); if (pushPlusRes.code === 200) { console.log(`push+发送一对多通知消息完成。\n`); } else { console.log(`push+发送一对多通知消息失败:${pushPlusRes.msg}\n`); } } catch (error) { console.log(`push+发送一对多通知消息失败!!\n`); console.error(error); } }; //test // let awad = { // bug: 10, // 抱枕: 10, // 其他: 10, // }; // pushPlus({ // title: '掘金', // content: ` // <h1 style="text-align: center">自动签到通知</h1> // <p style="text-indent: 2em">签到结果:success</p> // <p style="text-indent: 2em">梭哈结果:${JSON.stringify(awad)}</p> // <p style="text-indent: 2em">当前积分:10000</p><br/> // `, // }).catch(console.error); module.exports = pushPlus; <file_sep>/README.md # 定时任务脚本 - 掘金自动签到 签到后会获得一次免费抽奖机会,自动触发免费抽奖。 - 执行结束发送PUSHPLUS通知签到结果。 - 增加梭哈选项 ![大佬](https://ghproxy.com/https://raw.githubusercontent.com/xiaojia21190/my_blog/main/images/wallhaven-8oky1j.jpg) *** >使用方法:fork 本仓库 >打开浏览器,登陆掘金,F12 查看 Network 面板,复制 cookie *** 打开 github 仓库的 Setting,选择 Secrets,新建下列 3 个仓库 Secret | key | value | | --------------- | ----------------------------------- | | COOKIE | 值为上面复制掘金的 cookie | | PUSH_PLUS_TOKEN | PUSH PLUS TOKEN | | SUOHA | 是否梭哈 1梭哈 0 不梭哈 默认是0 | `注意:掘金的cookie大概有一个月的有效期,所以需要定期更新Secret`
e1601d91b27ae936877972a937846ce043d1602e
[ "Markdown", "JavaScript", "YAML" ]
3
Markdown
St-coder/public_actions
326c4764049e003d2a45e5f51ecdb3354d190586
bfbf4f8fe2f0750f52b7fcdbe35fd0a429da215b
refs/heads/master
<file_sep># dev-dojo-springboot <file_sep>package br.com.devdojo.springboot.persistence.model; import javax.persistence.Entity; import javax.persistence.ManyToOne; import javax.validation.constraints.NotEmpty; import io.swagger.annotations.ApiModelProperty; /** *@author <NAME> */ @Entity public class Course extends AbstractEntity{ private static final long serialVersionUID = 1L; @NotEmpty(message="The field name is cannot be empty") @ApiModelProperty(notes = "The name of the course") private String name; @ManyToOne(optional=false) private Professor professor; } <file_sep>package br.com.devdojo.springboot.javaclient; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import org.apache.tomcat.util.http.fileupload.IOUtils; public class JavaClient { public static void main(String[] args) { HttpURLConnection connect = null; BufferedReader reader = null; //String user = "josemberg"; //String password = "<PASSWORD>"; try { URL url = new URL("http://localhost:8080/v1/protected/students/5"); connect = (HttpURLConnection) url.openConnection(); connect.setRequestMethod("GET"); //connect.addRequestProperty("Authorization", "Basic " + encodingUsernamePassword(user, password)); connect.addRequestProperty("Authorization", "Basic am9zZW1iZXJnOmpzNzI0NDYwNjY"); //System.out.println(encodingUsernamePassword(user, password)); reader = new BufferedReader(new InputStreamReader(connect.getInputStream()));//retorna o valor StringBuilder jsonSB = new StringBuilder();//para adicinar a resposta String line; while((line = reader.readLine()) != null) { jsonSB.append(line); } System.out.println(jsonSB.toString()); }catch (Exception e) { e.printStackTrace(); }finally { IOUtils.closeQuietly(reader); if (connect != null) { connect.disconnect(); } } } /*private static String encodingUsernamePassword(String user, String password) { String userPassword = user + " : " + password; return new String(Base64.encodeBase64(userPassword.getBytes())); }*/ } <file_sep>package br.com.devdojo.springboot.util; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import org.springframework.stereotype.Component; /** * * @author <NAME> * */ @Component public class DateUtil { public String formatLocalDateTimeToDatabaseStyle(LocalDateTime localDateTime) { return DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS").format(localDateTime); } } <file_sep>spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update spring.datasource.driverClassName=org.postgresql.Driver spring.datasource.maxActive=20 spring.datasource.maxIdle=5 spring.datasource.minIdle=2 spring.datasource.initialSize=5 spring.datasource.removeAbandoned=true <file_sep>package br.com.devdojo.springboot.persistence.repository; import org.springframework.data.repository.PagingAndSortingRepository; import br.com.devdojo.springboot.persistence.model.Course; /*** * * @author Josemberg * */ public interface CourseRepository extends PagingAndSortingRepository<Course, Long>{ } <file_sep>package br.com.devdojo.springboot.endpoint.v1; import java.util.List; import java.util.Optional; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import br.com.devdojo.springboot.error.ResourceNotFoundException; import br.com.devdojo.springboot.persistence.model.Student; import br.com.devdojo.springboot.persistence.repository.StudentRepository; /* * Ponto de acesso a API pelas aplicações cliente * */ @RestController @RequestMapping("v1/students") public class StudentEndpoint { private final StudentRepository studentDAO; //Injeção de dependência @Autowired public StudentEndpoint(StudentRepository studentDAO) { this.studentDAO = studentDAO; } @GetMapping(path = "/list") public ResponseEntity<?> listAll(Pageable pageable){ return new ResponseEntity<Iterable<Student>>(studentDAO.findAll(pageable), HttpStatus.OK); } @GetMapping(path = "protected/students/{id}") public ResponseEntity<?> getStudentById(@PathVariable("id") Long id, //Authentication authentication){ @AuthenticationPrincipal UserDetails userDetails){ //System.out.println(authentication); verifyIfStudentsExistis(id); Optional<Student> student = studentDAO.findById(id); return new ResponseEntity<Optional<Student>>(student, HttpStatus.OK); } @GetMapping(path = "protected/students/findByName/{name}") public ResponseEntity<?> getStudentByName(@PathVariable String name){ return new ResponseEntity<List<Student>>(studentDAO.findByNameIgnoreCaseContaining(name) ,HttpStatus.OK); } @PostMapping(path = "admin/students") @Transactional(rollbackFor = Exception.class) //Excessão do tipo cheked public ResponseEntity<?> save(@Valid @RequestBody Student student){ return new ResponseEntity<Student>(studentDAO.save(student), HttpStatus.CREATED); } @DeleteMapping(path="admin/students/{id}") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<?> delete(@PathVariable Long id){ verifyIfStudentsExistis(id); studentDAO.deleteById(id); return new ResponseEntity<Object>(HttpStatus.OK); } @PutMapping(path = "admin/students") @Transactional(rollbackFor = Exception.class) public ResponseEntity<?> update(@Valid @RequestBody Student student){ verifyIfStudentsExistis(student.getId()); studentDAO.save(student); return new ResponseEntity<Student>(student, HttpStatus.OK); } //Verifica se o id já existe private void verifyIfStudentsExistis(Long id) { if(!studentDAO.existsById(id)) { throw new ResourceNotFoundException("Student not found for ID: " + id); } } } <file_sep>package br.com.devdojo.springboot.docs; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("br.com.devdojo.springboot.endpoint.v1")) .build() .apiInfo(metaData()); } private ApiInfo metaData() { return new ApiInfoBuilder() .title("Exam Generator by DevDojo") .description("Software to generate exams based on questions") .version("1.0-Beta") .contact(new Contact("<NAME>", "dnsti.com.br","<EMAIL>")) .license("Apache License version 2.0") .licenseUrl("https://apache.org/licenses/LICENSE-2.0") .build(); } } <file_sep>package br.com.devdojo.springboot.handler; import java.util.Date; import java.util.List; import java.util.stream.Collectors; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.lang.Nullable; import org.springframework.validation.FieldError; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import br.com.devdojo.springboot.error.ErrorDetails; import br.com.devdojo.springboot.error.ResourceNotFoundDetails; import br.com.devdojo.springboot.error.ResourceNotFoundException; import br.com.devdojo.springboot.error.ValidationErrorDetails; @ControllerAdvice //Permite usar a camada RestException Handler através das camadas do spring public class RestExceptionHandler extends ResponseEntityExceptionHandler{ @ExceptionHandler(ResourceNotFoundException.class) public ResponseEntity<?> handlerResourceNotFoundException(ResourceNotFoundException rfnException){ ResourceNotFoundDetails rfnDetails = ResourceNotFoundDetails.Builder .newBuilder() .timestamp(new Date().getTime()) .status(HttpStatus.NOT_FOUND.value()) .title("Resource not found") .details("Resource not found " + rfnException.getMessage()) .developerMessage(rfnException.getClass().getName()) .build(); return new ResponseEntity<>(rfnDetails, HttpStatus.NOT_FOUND); } //@ExceptionHandler(MethodArgumentNotValidException.class) // como extendeu a classe ResponseEntityExceptionHandler, public ResponseEntity<?> handleMethodArgumentNotValidException( MethodArgumentNotValidException manvException) { List<FieldError> filedErrors = manvException.getBindingResult().getFieldErrors(); String fields = filedErrors.stream().map(FieldError::getField).collect(Collectors.joining(",")); String fieldMessage = filedErrors.stream().map(FieldError::getDefaultMessage).collect(Collectors.joining(",")); ValidationErrorDetails rfnDetails = ValidationErrorDetails.Builder .newBuilder() .timestamp(new Date().getTime()) .status(HttpStatus.BAD_REQUEST.value()) .title("Field Validation Error") .details("Field Validation Error") .developerMessage(manvException.getClass().getName()) .field(fields) .fieldMessage(fieldMessage) .build(); return new ResponseEntity<>(rfnDetails, HttpStatus.BAD_REQUEST); } /*@Override protected ResponseEntity<Object> handleHttpMessageNotReadable( HttpMessageNotReadableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { ErrorDetails errorDetails = ErrorDetails.Builder .newBuilder() .timestamp(new Date().getTime()) .status(HttpStatus.NOT_FOUND.value()) .title("Resource not found") .details(ex.getMessage()) .developerMessage(ex.getClass().getName()) .build(); return new ResponseEntity<Object>(errorDetails, HttpStatus.BAD_REQUEST); }*/ @Override protected ResponseEntity<Object> handleExceptionInternal( Exception ex, @Nullable Object body, HttpHeaders headers, HttpStatus status, WebRequest request) { ErrorDetails errorDetails = ErrorDetails.Builder .newBuilder() .timestamp(new Date().getTime()) .status(status.value()) .title("Exception Internal") .details(ex.getMessage()) .developerMessage(ex.getClass().getName()) .build(); return new ResponseEntity<>(errorDetails, headers, status); } } <file_sep>package br.com.devdojo.springboot.endpoint.v1; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import br.com.devdojo.springboot.persistence.model.Professor; import br.com.devdojo.springboot.persistence.model.Student; import br.com.devdojo.springboot.persistence.repository.ProfessorRepository; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @RestController @RequestMapping("v1/professor") @Api public class ProfessorEndPoint { private final ProfessorRepository repository; @Autowired public ProfessorEndPoint(ProfessorRepository repository) { this.repository = repository; } @RestController class HelloWord{ @GetMapping("/") String hello() { return "Olá professores"; } } @RequestMapping(path = "{id}") @ApiOperation (value = "Find professor by his ID", notes = "We have to make this method better", response = Professor.class) public ResponseEntity<?> getProfessorById(@PathVariable Long id){ Optional<Professor> professor = repository.findById(id); return new ResponseEntity<Optional<Professor>>(professor,HttpStatus.OK); } @GetMapping(path = "/list") public ResponseEntity<?> listAll(Pageable pageable){ return new ResponseEntity<Iterable<Professor>>(repository.findAll(pageable), HttpStatus.OK); } } <file_sep>package br.com.devdojo.springboot; import javax.validation.Valid; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import br.com.devdojo.springboot.persistence.model.Student; import br.com.devdojo.springboot.persistence.repository.StudentRepository; @RunWith(SpringRunner.class) @SpringBootTest public class InsertStudentTest { @Autowired StudentRepository repository; @Test public void test() { for(int i = 1; i == 100; i++) { Student student = new Student(); student.setName("Student" + i); student.setEmail("student" + i +"@" + "student" + i); save(student); } } @PostMapping @Transactional(rollbackFor = Exception.class) //Excessão do tipo cheked public ResponseEntity<?> save(@Valid @RequestBody Student student){ return new ResponseEntity<Student>(repository.save(student), HttpStatus.CREATED); } } <file_sep>#Fri May 24 16:36:20 GFT 2019 org.eclipse.core.runtime=2 org.eclipse.platform=4.11.0.v20190307-0500
42b6c6290df939aebd41a3be27fc201a31583725
[ "Java", "Markdown", "INI" ]
12
Java
josembergsd/dev-dojo-springboot
c03e0319fff9482e4884c872466ab2a34fb9123a
a2626ee94f116f354d6196fe7be57d4dac3a875f
refs/heads/master
<repo_name>lakshay13/Morse-Translator<file_sep>/src/test/java/com/MorseTestPackage/MorseTranslationTest.java package com.MorseTestPackage; import com.MorsePackage.MorseTranslator; import org.junit.Test; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.logging.Logger; import static org.junit.Assert.assertEquals; /** * Implementation Notes: * * Step 1: Obtain the word list from dictionary * Step 2: Obtain the morse input from the file specified. * Step 3: Obtain the matching words in dictionary for the morse input * Step 4: Check word obtained is the same as expected. * * Created by @LakshaySuri (<EMAIL>) on 05/11/16. */ public class MorseTranslationTest { private static final Logger LOGGER = Logger.getLogger(MorseTranslationTest.class.toString()); /** * Test Morse translation for the word "and" * * @throws IOException if morse input could not be read from file. */ @Test public void testMorseTranslation1() throws IOException { List<String> dictionaryWordList = MorseTranslator.getWordsFromFile(); String path = "src/test/java/com/MorseTestPackage/fixtures/morsedtest1.txt"; List<String> morsedInput = getMorsedInputFromFile(path); List<String> listOfWordsObtained = MorseTranslator.getMatchedHumanWords(dictionaryWordList, morsedInput); LOGGER.info("Found Morse Translation===>" + listOfWordsObtained.get(0)); assertEquals(1, listOfWordsObtained.size()); assertEquals("and", listOfWordsObtained.get(0)); LOGGER.info("Test Morse Translation 1 finished"); } /** * Test Morse translation for the word "the" * * @throws IOException if morse input could not be read from file. */ @Test public void testMorseTranslation2() throws IOException { List<String> dictionaryWordList = MorseTranslator.getWordsFromFile(); String path = "src/test/java/com/MorseTestPackage/fixtures/morsedtest2.txt"; List<String> morsedInput = getMorsedInputFromFile(path); List<String> listOfWordsObtained = MorseTranslator.getMatchedHumanWords(dictionaryWordList, morsedInput); LOGGER.info("Found Morse Translation===>" + listOfWordsObtained.get(0)); assertEquals(1, listOfWordsObtained.size()); assertEquals("the", listOfWordsObtained.get(0)); LOGGER.info("Test Morse Translation 2 finished"); } private static List<String> getMorsedInputFromFile(String path) throws IOException { Path filePath = new File(path).toPath(); Charset charset = Charset.defaultCharset(); List<String> list = null; try { list = Files.readAllLines(filePath, charset); } catch (IOException e) { LOGGER.info("Exception raised while reading from file" + e.getMessage()); } return list; } } <file_sep>/README.md # Morse-Translator A very simple Morse Translator Algorithm that converts a predefined morsed input into human understandable word. This class is used to compute the human words from a given dictionary that matches the given morsed input. The following steps are involved: Step 1 Get the list of words from dictionary Step 2 Get the morse input. Step 3 Obtain the map of dictionary words and their morsed values Step 4 Search the morse input in the map obtained. To know more about me, visit my blog https://lakshaysuri.wordpress.com/blog/
0fc67bffe5e9990c007ed0e5dfc2a061a2a8444d
[ "Java", "Markdown" ]
2
Java
lakshay13/Morse-Translator
9f5a95f8b7db8eabac0a28edffa5f89d9d7db6b8
3b9104ae9e5c741e5a3593d0da63d82275b4d249
refs/heads/master
<file_sep>import { FormatDescriptionPipe } from './format-description.pipe'; describe('FormatDescriptionPipe', () => { it('create an instance', () => { const pipe = new FormatDescriptionPipe(); expect(pipe).toBeTruthy(); }); }); <file_sep>import { DescriptionPipePipe } from './description-pipe.pipe'; describe('DescriptionPipePipe', () => { it('create an instance', () => { const pipe = new DescriptionPipePipe(); expect(pipe).toBeTruthy(); }); }); <file_sep>import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { trigger, transition, animate, style } from '@angular/animations'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { JobService } from '../../job.service'; @Component({ selector: 'app-results', templateUrl: './results.component.html', styleUrls: ['./results.component.scss'] }) export class ResultsComponent implements OnInit { ascendingOrder = true; fullDescription = false; page = 1; data: Array<any> = []; data2: Array<any> = []; constructor( private jobService: JobService, private ref: ChangeDetectorRef, // public ngProgress: NgProgress // to style progress bar - not necessary ) { } ngOnInit() { // this.ngProgress.start(); // to style progress bar - not necessary this.getData(); } getData(): void { this.jobService.jobs.subscribe((r) => { if (r) { this.data = r; this.addExcerpt(this.data); // console.log('STACK OVERFLOW:'); // console.log(r); // console.log('-------------------------'); } }); } addExcerpt(arr): void { const data = arr.map(x => x.description); const a = []; for (let i = 0; i < data.length; i++) { a.push(data[i][0]); } for (let i = 0; i < arr.length; i++) { this.data[i].excerpt = a[i].substring(0, 250) + '...'; this.data[i].showDescription = false; } } toggleDescription(job, el): void { job.showDescription = !job.showDescription; if (job.showDescription) { el.srcElement.innerHTML = 'Short description...'; } else { el.srcElement.innerHTML = 'Full description...'; } } } <file_sep>#!/bin/bash if [[ $# -eq 0 ]] ; then echo 'Please provide a port number as first argument' exit 0 fi LOCALIP="$(ip route get 8.8.8.8 | awk '{print $NF; exit}')" PORT=$1 echo "Starting server on ${LOCALIP}:$PORT | For mock API type: npm run start-mockapi" ng serve --port="${PORT}" --host="${LOCALIP}" --open <file_sep>import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { catchError, map, tap } from 'rxjs/operators'; import { of } from 'rxjs/observable/of'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import 'rxjs/add/operator/map'; import { forkJoin } from 'rxjs/observable/forkJoin'; import * as parser from 'xml2js'; @Injectable() export class JobService { // DATA private data = new BehaviorSubject<any>([]); jobs = this.data.asObservable(); infoJobs = this.data.asObservable(); allJobs = this.data.asObservable(); // CORS PROXY private _corsProxy = 'https://cors-anywhere.herokuapp.com/'; // STACK OVERFLOW private _stackOverflowUrl = 'https://stackoverflow.com/jobs/feed?'; // INFOJOBS private _infoJobsUrl = 'https://api.infojobs.net/api/1/offer'; private _infoJobsAutorization = '<KEY>'; constructor(private http: HttpClient) { } // Error handling private log(message: string): void { console.log('Log: ' + message); } private handleError<T>(operation = 'operation', result?: T) { return (error: any): Observable<T> => { console.error(error); // log to console instead this.log(`${operation} failed: ${error.message}`); // Let the app keep running by returning an empty result. return of(result as T); }; } // Search search(query): void { console.log('searched'); this.getStackOverflow(query); this.getInfoJobs(query); } getStackOverflow(query: string): Observable<any> { if (query) { query = `q=${query}&`; } const q2 = 'l=Europa&u=Km&d=20&r=true'; const response = this.http.get( this._corsProxy + this._stackOverflowUrl + query + q2, { responseType: 'text' } ) .map((res) => { parser.parseString(res, (e, r) => { const data = r.rss.channel['0'].item; if (data) { this.updateJobs(data); } else { this.updateJobs([]); } }); }) .pipe( tap(() => this.log(`fetched jobs from StackOverflow`)), catchError(this.handleError('getStackOverflow', [])) ); return response; } getInfoJobs(query: string): Observable<any> { const response = this.http.get( this._corsProxy + this._infoJobsUrl + '?q=' + query, { headers: new HttpHeaders({ 'Authorization': `Basic ${this._infoJobsAutorization}` }) } ) .pipe( tap(() => this.log(`fetched jobs from InfoJobs`)), catchError(this.handleError('getInfoJobs', [])) ); return response; } updateJobs(data): void { this.data.next(data); } sortByDateAscending(arr): Array<any> { function c(a, b) { a = Date.parse(a.pubDate); b = Date.parse(b.pubDate); return b - a; } return arr.sort(c); } sortByDateDescending(arr): Array<any> { function c(a, b) { a = Date.parse(a.pubDate); b = Date.parse(b.pubDate); return a - b; } return arr.sort(c); } } <file_sep>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'formatDescription' }) export class FormatDescriptionPipe implements PipeTransform { transform(description: any): any { // Strip <br> tags console.log(description); const html = description[0].replace(/(<|&lt;)br\s*\/*(>|&gt;)/g , ''); return [html]; } } <file_sep>import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; import { NgProgress } from 'ngx-progressbar'; import * as $ from 'jquery'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class AppComponent implements OnInit { constructor() { } ngOnInit() { this.scrollToTop(); } scrollToTop(): void { const $top = $('#to-top'); const $html = $('html,body'); const $footer = $('footer'); const $window = $(window); $(window).scroll(function() { // if ($(this).scrollTop() >= $html.height() / 2) if ($(this).scrollTop() >= 800) { $top.fadeIn(200); } else { $top.fadeOut(200); } if ( ($window.scrollTop() + $window.height()) - ($top.height() / 2) >= $footer.position().top) { $top.css('background', '#1f1a50'); } else { $top.css('background', 'inherit'); } }); $top.click(function(){ $html.animate({ scrollTop: $('#search').position().top }, 200); return false; }); } } <file_sep>@import "../../CONSTANTS"; #search { width: 100%; height: $xl; padding: 0 $sm; border-radius: 3px 0 0 3px; } #search input { width: 80%; height: $xl; padding: $md; margin: 0; float: left; border: 3px solid $primary-color; letter-spacing: 2px; border-radius: 3px 0 0 3px; @include phone { width: 75%; } } .search-active { // box-shadow: 0 0 0 0.2rem rgba(247,143,30, 0.5); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); } #search input:focus { outline: none; box-shadow: 0; } .btn { width: 20%; height: $xl; background: $primary-color; color: #fff; letter-spacing: 5px; font-weight: bold; border-radius: 0 3px 3px 0; @include phone { width: 25%; } } .btn:focus, .form-control:focus { // box-shadow: 0 0 0 0.2rem rgba(247, 143, 30, 0.25); } .form-active { // border-color: rgba(247, 143, 30, 0.35); } .btn-lg { width: 100%; } .btn>img { max-width: 30px; } #search-info { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 0 $sm; @include phone { display: block; } } #search-info>div { width: calc(50% - 1px); @include phone { width: 100%; } } .search-dropdown { margin: 2px 0; border: 1px solid #ced4da; } .form-control { border: 0; padding: $sm; } #search-length, #search-query, #search-time, #no-results, .check-label { color: $gray-600; font-style: italic; text-align: right; // display: block; line-height: 20px; } .check-label { display: inline-block; margin: 0; } .checkbox-option { width: 18px; margin-top: 1px; height: 100%; } .check-container { display: flex; justify-content: space-between; width: 160px; margin: 0; height: 36.5px; background: white; padding: 8px; margin: 2px; border: 1px solid #ced4da; } .search-info-query { font-weight: 800; font-size: 18px; color: $primary-color; } #no-results { margin-left: $sm; } hr { margin: 2rem 0 0; } // OPTIONS .dropdown-wrapper { position: relative; margin: 2px 0; border: 1px solid #ced4da; } .selectBox { position: relative; } .selectBox select, .checkboxes label { width: 100%; font-size: 0.9375rem; line-height: 1.5; color: #495057; background: $white; padding: $sm; border: 0; } .overSelect { position: absolute; left: 0; right: 0; top: 0; bottom: 0; } .checkboxes { display: none; border: 1px #dadada solid; position: absolute; width: 100%; background: $white; z-index: 99; } .checkboxes label { display: block; padding: $sm; position: relative; margin: 0; cursor: pointer; } .checkboxes label:hover { background-color: $secondary-color; } .checkboxes label input { position: absolute; right: $sm; top: 0; height: 100%; width: 20px; cursor: pointer; } .check-all { font-weight: 800; }<file_sep>@import "~bootswatch/dist/cosmo/variables"; @import "../../CONSTANTS"; .title { font-size: 20px; font-weight: 800; display: inline-block; margin-bottom: $md; width: calc(100% - 48px); @include tablet { width: 100%; } } .pagination-wrapper { display: flex; justify-content: center; } /deep/ .ngx-pagination { padding: 0; } /deep/ .ngx-pagination a { color: $gray-600 !important; } /deep/ #pagination>pagination-template>ul>li.current { background: $secondary-color; font-weight: 800; border-radius: 3px; } /deep/ .pagination-previous::before, /deep/ .pagination-previous a::before, /deep/ .pagination-next a::after, /deep/ .pagination-next.disabled::after { content: '' !important; } // RESULTS----- #results { padding: 0; list-style-type: none; } #results>li:not(:last-child) { margin-bottom: $lg; } .job { background: $gray-700; padding: $lg; color: #fff; position: relative; border-radius: 3px; box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); @include phone { border-radius: 0px; padding: $lg $sm; } } .date { position: absolute; right: $md; top: $sm; font-style: italic; color: $gray-600; cursor: default; @include phone { right: $sm; } } .description { overflow-y: auto; cursor: default; padding-top: $md; border-top: 1px solid $gray-600; } .info { margin: 0; display: flex; align-items: baseline; justify-content: space-between; } .categories { margin-right: $sm; @include tablet { margin-right: 0; } } .info span { margin-left: 8px; margin-bottom: 8px; cursor: default; padding: 3px 6px; border: 1px solid #fff; border-radius: 3px; display: inline-block; } .apply { background: 0; outline: none; border: 3px solid $teal; color: #fff; border-radius: $sm; padding: 10px; cursor: pointer; font-weight: bold; @include tablet { display: none; } } .apply:hover { background: $teal; color: #fff; border: 3px solid #fff; } .full-description:hover { color: $secondary-color; border-top: 3px solid $secondary-color; } .full-description { width: 75%; display: block; padding: 8px; margin: 0 auto; margin-bottom: 16px; border: 0; border-top: 1px solid $secondary-color; background: 0; outline: none; color: $secondary-color; border-radius: 3px; cursor: pointer; // font-weight: bold; }<file_sep>@import "~bootswatch/dist/cosmo/variables"; @import "~bootstrap/scss/bootstrap"; @import "~bootswatch/dist/cosmo/bootswatch"; // @import "~materialize-css/dist/css/materialize.min.css"; $sm: 8px; $md: 16px; $lg: 32px; $hover: rgba(32, 201, 151, 0.75); $white: #fff !default; $gray-100: #f8f9fa !default; $gray-200: #e9ecef !default; $gray-300: #dee2e6 !default; $gray-400: #ced4da !default; $gray-500: #adb5bd !default; $gray-600: #868e96 !default; $gray-700: #495057 !default; $gray-800: #373a3c !default; $gray-900: #212529 !default; $black: #000 !default; $blue: #2780E3 !default; $indigo: #6610f2 !default; $purple: #613d7c !default; $pink: #e83e8c !default; $red: #FF0039 !default; $orange: #f0ad4e !default; $yellow: #FF7518 !default; $green: #3FB618 !default; $teal: #20c997 !default; $cyan: #9954BB !default; $primary: $blue !default; $secondary: $gray-800 !default; $success: $green !default; $info: $cyan !default; $warning: $yellow !default; $danger: $red !default; $light: $gray-100 !default; $dark: $gray-800 !default; $primary-color: #1f1a50 !default; @mixin phone { @media (max-width: 575px) { @content; } } body { background: $gray-100; position: relative; } .transition { transition: 0.15s; } a { color: $teal; } a:hover { color: $hover; text-decoration: none; } .hr-h { height: 3px; background: $gray-700; width: 33%; position: absolute; bottom: -1.25px; right: $sm; border-radius: 16px 3px; } .center { display: flex; justify-content: center; align-items: center; } .hide { display: none !important; } .show { dispay: block !important; }<file_sep>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'sliceString' }) // Pipe to slice off Stack overflow title ending export class SliceStringPipe implements PipeTransform { transform(arr: any, end: number): string { if (arr[0].endsWith('() (allows remote)')) { return arr[0].slice(0, end).trim(); } return arr[0]; } } <file_sep>import { Component, OnInit } from '@angular/core'; import { JobService } from '../../job.service'; import * as parser from 'xml2js'; import * as $ from 'jquery'; import 'rxjs/add/operator/finally'; @Component({ selector: 'app-search', templateUrl: './search.component.html', styleUrls: ['./search.component.scss'] }) export class SearchComponent implements OnInit { noSearch = true; noResults = true; searchTime = 0; ascendingOrder = true; orderByList = []; optionsExpanded = false; searchActive = ''; searchString = ''; data: Array<any> = []; data2: Array<any> = []; constructor(private jobService: JobService) { } ngOnInit() { this.populateOrderBy(); // this.search('angular'); this.getData(); // this.getInfoJobs(); } getData(): void { this.jobService.jobs.subscribe((res) => { // console.log(res); if (res.length) { this.data = res; this.noResults = false; } else { this.noResults = true; } }); } getInfoJobs(): void { const info = this.jobService.getInfoJobs('angular').subscribe(); const stack = this.jobService.getStackOverflow('angular').subscribe(); // forkJoin(info, stack).subscribe(res => console.log(res)); } search(query: string): void { const now = new Date().getTime(); this.jobService.search(query); this.jobService.getStackOverflow(query) .finally(() => { this.noSearch = false; this.searchTime = this.getSearchTime(now); if (!this.noResults) { this.sort(); } }) .subscribe((res) => { this.searchString = this.setSearchString(query); }); } populateOrderBy(): void { this.orderByList = [ { name: 'Newest', val: true }, { name: 'Oldest', val: false } ]; } orderByMenu(val): void { if (val === 'false') { this.ascendingOrder = false; } else { this.ascendingOrder = true; } this.sort(); } sort(): void { if (this.ascendingOrder && !this.noResults) { this.jobService.updateJobs(this.sortByDateAscending(this.data)); } else { this.jobService.updateJobs(this.sortByDateDescending(this.data)); } } sortByDateAscending(arr): Array<any> { function c(a, b) { a = Date.parse(a.pubDate); b = Date.parse(b.pubDate); return b - a; } return arr.sort(c); } sortByDateDescending(arr): Array<any> { function c(a, b) { a = Date.parse(a.pubDate); b = Date.parse(b.pubDate); return a - b; } return arr.sort(c); } getSearchTime(start: number): number { const later = new Date().getTime(); return (later - start) / 1000; } setSearchString(query: string): string { if (!query) { return 'empty'; } return query; } searchFocus(): void { this.searchActive = 'search-active'; } searchFocusOut(): void { this.searchActive = ''; } showDropdown(e1, e2): void { const list = document.getElementById(e1); const dropdown = document.getElementById(e2); const open = () => { list.style.display = 'block'; this.optionsExpanded = true; }; const close = () => { list.style.display = 'none'; this.optionsExpanded = false; }; !this.optionsExpanded ? open() : close(); function clickedOutside(e) { if (!dropdown.contains(e.target)) { close(); window.removeEventListener('click', clickedOutside); } } window.addEventListener('click', clickedOutside); } checkAll(e, el): void { const options = $(document.getElementById(el)).children(); const check = () => { for (let i = 0; i < options.length; i++) { options[i].children[0].checked = true; } }; const unCheck = () => { for (let i = 0; i < options.length; i++) { options[i].children[0].checked = false; } }; e.target.checked ? check() : unCheck(); } showScroll(e): void { if (e.target.checked) { // this.showScrollTop = true; köra ng if på #to-top i appcomponent istället för jquery?? $('#to-top').removeClass('hide'); } else { // this.showScrollTop = false; $('#to-top').addClass('hide'); } } } <file_sep>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'descriptionPipe' }) export class DescriptionPipePipe implements PipeTransform { transform(arr: any, param: any): any { if(param === 'h') { return arr[0]; } else { return arr[0].substring(0, 250) + '...'; } } }
7d912e44ed1f2837d8f274ddc7bf46568fb2c88c
[ "SCSS", "TypeScript", "Shell" ]
13
SCSS
borjesbordell/tDD
4cf64360cd5cb63bbce9254c6cf325c05eb0de76
06aa4db3f32f984464d9df9eef21c320b6aab667
refs/heads/main
<file_sep># Diccionario-de-datos
3c2f03492c83a4579328d3bf2379d4326a1bf914
[ "Markdown" ]
1
Markdown
Yamidmisena/Diccionario-de-datos
f26a9e6f1a107d936d364af401d0acedf79fee43
db8388aeefdf63b2b845226569b9c71958a0ebd1
refs/heads/main
<file_sep>import { useNavigation } from '@react-navigation/core'; import React from 'react'; import { View, Text, Button } from 'react-native'; export const HomeScreen = () => { const navigation = useNavigation(); return ( <View> <Text>HomeScreen</Text> <Button title = "Press" onPress = { () => navigation.navigate('LoginScreen') } /> </View> ) } <file_sep>import React, { useContext, useEffect, useState } from 'react'; import { View, Text, ScrollView, StyleSheet, TextInput, Button, Image, Alert } from 'react-native'; import {launchCamera, launchImageLibrary} from 'react-native-image-picker'; import { ProductsStackParams } from '../navigator/ProductsNavigator'; import { StackScreenProps } from '@react-navigation/stack'; import { useCategories } from '../hooks/useCategories'; import { useForm } from '../hooks/useForm'; import { ProductsContext } from '../context/ProductsContext'; import { Picker } from '@react-native-picker/picker'; interface Props extends StackScreenProps<ProductsStackParams, 'ProductScreen'>{} export const ProductScreen = ({route, navigation}: Props) => { const { id = '', name = '' } = route.params; const [tempUri, setTempUri] = useState<string>(''); const { categories } = useCategories(); const { loadProductById, addProduct, updateProduct, deleteProduct, uploadImage } = useContext(ProductsContext); const { _id, categoriaId, nombre, img, onChange, setFormValue } = useForm({ _id: id, categoriaId: '', nombre: name, img: '' }); useEffect(() => { navigation.setOptions({ title: (nombre) ? nombre : 'Nuevo producto' }); }, [nombre]); useEffect(() => { loadProducto(); }, []) const loadProducto = async() => { if( id.length === 0 ) return; const product = await loadProductById( id ); setFormValue({ _id: id, categoriaId: product.categoria._id, img: product.img || '', nombre: product.nombre }); } const saveOrUpdate = async() => { if( _id.length > 0 ){ console.log('Actualizar'); updateProduct( categoriaId, nombre, id ); }else{ //Actualizar /* if ( categoriaId.length === 0 ){ onChange( categories[0]._id, 'categoriaId' ); } */ const tempCategoriaId = categoriaId || categories[0]._id; const newProduct = await addProduct( tempCategoriaId, nombre ); onChange( newProduct._id, '_id'); } } const deleteItem = async () => { if( _id.length > 0 ){ await deleteProduct(_id); } } const takePhoto = () => { launchCamera({ mediaType: 'photo', quality: 0.5 }, (resp) => { if ( resp.didCancel ) return; if( !resp.uri ) return; setTempUri( resp.uri ); uploadImage( resp, _id ) }); } const takePhotoFromGallery = () => { launchImageLibrary({ mediaType: 'photo', quality: 0.5 },(resp) => { if ( resp.didCancel ) return; if( !resp.uri ) return; setTempUri( resp.uri ); uploadImage( resp, _id ); }) } return ( <View style = { styles.container }> <ScrollView> <Text style = { styles.label} >Nombre del producto:</Text> <TextInput placeholder = "Producto" style = { styles.textInput } value = { nombre } onChangeText = { (value) => onChange(value,'nombre') } /> <Text style = { styles.label} >Selecciona categoria:</Text> <Picker selectedValue={ categoriaId } onValueChange={( value) => onChange(value, 'categoriaId') } > { categories.map( c => ( <Picker.Item label = { c.nombre } value = { c._id } key = { c._id } /> )) } </Picker> <Button title = "Guardar" onPress = { saveOrUpdate } color = "#5856D6" /> { (_id.length > 0) && ( <View> <View style = {{ flex: 1, flexDirection: 'row', justifyContent: 'center', marginTop: 10 }}> <Button title = "Camara" onPress = { takePhoto } color = "#5856D6" /> <View style = {{ width: 10 }} /> <Button title = "Galeria" onPress = { takePhotoFromGallery } color = "#5856D6" /> </View> <View style = {{ flex: 1, justifyContent: 'flex-end', marginTop: 10 }}> <Button title = "Eliminar" onPress = { deleteItem } color = "red" /> </View> </View> ) } { (img.length > 0) && ( <Image source = {{ uri: img }} style = {{ marginTop: 20, width: '100%', height: 300 }} /> ) } {/* Imagen temporal */} { (tempUri.length > 0) && ( <Image source = {{ uri: tempUri }} style = {{ marginTop: 20, width: '100%', height: 300 }} /> ) } </ScrollView> </View> ) } const styles = StyleSheet.create({ container: { flex: 1, marginTop: 10, marginHorizontal: 20 }, label: { fontSize: 18 }, textInput: { borderWidth: 1, paddingHorizontal: 10, paddingVertical: 5, borderRadius: 20, borderColor: 'rgba(0,0,0,0.2)', height: 45, marginTop: 5, marginBottom: 10 } });<file_sep>import React, { useContext, useEffect, useRef, useState } from 'react'; import { View, Text, FlatList, StyleSheet, TouchableOpacity } from 'react-native'; import { ProductsContext } from '../context/ProductsContext'; import { StackScreenProps } from '@react-navigation/stack'; import { ProductsStackParams } from '../navigator/ProductsNavigator'; interface Props extends StackScreenProps<ProductsStackParams, 'ProductsScreen'>{} export const ProductsScreen = ({navigation}: Props) => { const { products, loadProducts } = useContext(ProductsContext); const [isLoadingRefresh, setIsLoadingRefresh] = useState(false) const isRefreshing = useRef(false); useEffect(() => { navigation.setOptions({ headerRight: () => ( <TouchableOpacity activeOpacity = { 0.8 } style = {{ marginRight: 10 }} onPress = { () => navigation.navigate('ProductScreen',{ name: 'Nuevo Producto' }) } > <Text>Agregar</Text> </TouchableOpacity> ) }) }, []); const loadProductsFromBackend = async () => { setIsLoadingRefresh(true); await loadProducts(); setIsLoadingRefresh(false); } return ( <View style = {{ flex: 1, marginHorizontal: 10 }}> <FlatList data = { products } keyExtractor = { (p) => p._id } renderItem = { ({ item }) => ( <TouchableOpacity activeOpacity = { 0.8 } onPress = { () => navigation.navigate('ProductScreen',{ id: item._id, name: item.nombre }) } > <Text style = { styles.productName }>{ item.nombre }</Text> </TouchableOpacity> ) } ItemSeparatorComponent = { () => ( <View style={ styles.itemSeparator} /> )} refreshing = { isLoadingRefresh } onRefresh = {() => { loadProductsFromBackend(); }} /> </View> ) } const styles = StyleSheet.create({ productName: { fontSize: 20 }, itemSeparator: { borderBottomWidth: 5, marginVertical: 5, borderBottomColor: 'rgba(0,0,0,0.1)' } });<file_sep>import React from 'react'; import { View, Text } from 'react-native'; export const Background = () => { return ( <View style = {{ position: 'absolute', backgroundColor: '#5956D6', top: -250, width: 800, height: 900, transform: [ { rotate: '-70deg' } ] }} /> ) }
a687aa8ed31e3245b770fe8e3060669b3ca1cdd0
[ "TSX" ]
4
TSX
afuenzalidap/productos-app
7b4751307b773e30bcd5bba28f812ea9440b8b5c
3dbcef554663f7c40d2db9a27db7701cd106b0dc
refs/heads/master
<file_sep>import React, { useState, useRef, useEffect } from "react"; import styled from "styled-components"; const Title = styled.span` font-size: 1.5em; text-align: center; padding: 0.5rem; font-family: "Titillium Web", sans-serif; color: black; &:hover { border-bottom: 0.2rem dotted black; /* border: 1px solid #3a3939; border-radius: 0.75rem; */ } `; const TitleInput = styled.input` font-size: 1.5em; line-height: 1; background-color: transparent; padding: 0.5rem; color: black; border-top: none; border-right: none; border-left: none; border-bottom: 0.2rem dotted black; font-family: "Titillium Web", sans-serif; &:focus, &:active { outline: none; } `; const TitleContainer = styled.div` position: relative; display: flex; justify-content: center; align-items: center; width: 30%; `; function EditableTitle() { const [title, setTitle] = useState("My Awesome Title"); const [isLabel, setIsLabel] = useState(true); const inputRef = useRef(null); const handleLabelClick = () => { setIsLabel(false); }; const handleTitleChange = (e) => { setTitle(e.target.value); }; const handleTitleKeyUp = (e) => { if (e.keyCode === 13) { setIsLabel(true); } }; const handleTitleBlur = () => { setIsLabel(true); }; useEffect(() => { if (!isLabel) { inputRef.current.focus(); } }, [isLabel]); return ( <TitleContainer> {isLabel ? ( <Title onClick={handleLabelClick}>{title}</Title> ) : ( <TitleInput value={title} onChange={handleTitleChange} onKeyUp={handleTitleKeyUp} onBlur={handleTitleBlur} ref={inputRef} focus /> )} </TitleContainer> ); } export default EditableTitle; <file_sep>package main import ( "fmt" "io" "log" "math/rand" "net/http" "os" "time" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "github.com/go-redis/redis" "github.com/zmb3/spotify" "golang.org/x/oauth2" ) const ( redirectURI = "http://localhost:8080/callback" letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ) // RandStringBytesRmndr - used to create state - uniuqe 10 characters func RandStringBytesRmndr(n int) string { b := make([]byte, n) for i := range b { b[i] = letterBytes[rand.Int63()%int64(len(letterBytes))] } return string(b) } var ( auth = spotify.NewAuthenticator(redirectURI, spotify.ScopePlaylistModifyPrivate, spotify.ScopeUserReadPrivate, spotify.ScopePlaylistModifyPublic) spotifyClient *spotify.Client redisClient *redis.Client ) func init() { // inits the rand time rand.Seed(time.Now().UnixNano()) } func main() { // Logging to a file. logFile, _ := os.Create("app.log") gin.DefaultWriter = io.MultiWriter(logFile, os.Stdout) router := gin.Default() router.Use(cors.New(cors.Config{ AllowOrigins: []string{"http://localhost:3000"}, AllowMethods: []string{"GET", "POST"}, AllowHeaders: []string{"Origin", "spotify-access-token", "Content-Type"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true, MaxAge: 12 * time.Hour, })) router.GET("/callback", completeAuth) router.GET("/login", login) router.GET("/search", searchSpotify) router.POST("/playlist", createPlaylist) router.Run(":8080") } func completeAuth(c *gin.Context) { queryState := c.Query("state") storedCockie, _ := c.Cookie("state") fmt.Printf("Query %s \n Stored %s", queryState, storedCockie) // check if the current request has the same context if queryState != storedCockie { c.JSON(http.StatusNotFound, gin.H{"error": "State mismatch"}) log.Fatalf("State does not exist: Query - %s Stored - %s\n", queryState, storedCockie) } tok, err := auth.Token(queryState, c.Request) if err != nil { log.Fatal(err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) } c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("http://localhost:3000/#access_token=%s", tok.AccessToken)) // c.JSON(http.StatusOK, gin.H{"accessToken": tok.AccessToken}) } func login(c *gin.Context) { state := RandStringBytesRmndr(10) url := auth.AuthURL(state) c.SetCookie("state", state, 1, "/", "localhost", false, false) c.Redirect(http.StatusTemporaryRedirect, url) } func searchSpotify(c *gin.Context) { token := c.GetHeader("spotify-access-token") if token == "" { c.JSON(http.StatusUnauthorized, gin.H{"error": "No token provided."}) } client := auth.NewClient(&oauth2.Token{AccessToken: token}) results, err := client.Search(c.Query("term"), spotify.SearchTypeArtist) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } c.JSON(http.StatusOK, gin.H{"results": results}) } /* User should send post request with body as follow: { artists: [{artist: ID, tophits: true/false}], name: NAME, public: true/fales } if TopHits is true only the top hits will be added otherwise all tracks will be added */ func createPlaylist(c *gin.Context) { type Artist struct { ID spotify.ID `json:"id" binding:"required"` TopHits bool `json:"tophits" binding:"required"` } type PlaylistBody struct { Name string `json:"name" binding:"required"` IsPublic bool `json:"ispublic" binding:"required"` Artists []Artist `json:"artists" binding:"required"` } token := c.GetHeader("spotify-access-token") if token == "" { c.JSON(http.StatusUnauthorized, gin.H{"error": "No token provided."}) } client := auth.NewClient(&oauth2.Token{AccessToken: token}) var body PlaylistBody c.Bind(&body) currentUesr, err := client.CurrentUser() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } playlist, err := client.CreatePlaylistForUser(currentUesr.ID, body.Name, body.IsPublic) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } // Adds the tracks to the playlist for _, artist := range body.Artists { if artist.TopHits { tracks, err := client.GetArtistsTopTracks(artist.ID, currentUesr.Country) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } var ids []spotify.ID for _, track := range tracks { ids = append(ids, track.ID) } client.AddTracksToPlaylist(currentUesr.ID, playlist.ID, ids...) } else { // gets the albums albums, err := client.GetArtistAlbums(artist.ID) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } for hasMore := true; hasMore; hasMore = albums.Next != "" { for _, album := range albums.Albums { var ids []spotify.ID tracks, err := client.GetAlbumTracks(album.ID) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err}) panic(err) } // TODO: handle tbe tracks page for _, track := range tracks.Tracks { ids = append(ids, track.ID) } client.AddTracksToPlaylist(currentUesr.ID, playlist.ID, ids...) } } } } c.JSON(http.StatusOK, gin.H{"playlist": playlist}) } <file_sep>import React from 'react'; import './index.css' function Artist({artist, changeType}) { return ( <article className="media artist-card"> <figure className="media-left"> <p className="image is-64x64"> <img src={artist.images[1].url} alt={artist.name} /> </p> </figure> <div className="media-content"> <div className="content"> {artist.name} </div> </div> <div className="media-right"> <label className="checkbox"> <input type="checkbox" value="1" onChange={(e) => {console.log(e); changeType(artist, e.target.checked)}}/> All Albums </label> </div> </article> ) }; export default ({artists, changeType}) => { return <div> {artists.map(artist => <Artist key={artist.id} artist={artist} changeType={changeType} />)} </div> }
25d5b99b969462f1f9aba1ac9aecc08a8c8afae5
[ "JavaScript", "Go" ]
3
JavaScript
adirshaban/spotifyplaylists
d0fb33171e0755bc6bc93552b8e76219b634b439
487bc645a81fcc236087564a2e2eefe90f165ef9
refs/heads/master
<file_sep># accenterate Accenterate: hack for NSBE Hacks. Authors: <NAME>, <NAME>, <NAME>, <NAME>. Web app that identifies accents from a voice files <file_sep># Simple Recorder.js demo A simple HTML5/JS demo that uses [Recorder.js](https://github.com/mattdiamond/Recorderjs) to record audio as wav and pause/resume the recording process. Update: I've added the ability to upload/POST the file using a plain `XMLHttpRequest`. I've seen many demos using `$.ajax()` but you need jQuery for that. The demo works on both mobile - including Safari 11 - and desktop browsers. I've taken great care to make the demo easy to use on both screens types. Blog post: [https://addpipe.com/blog/using-recorder-js-to-capture-wav-audio-in-your-html5-web-site/](https://addpipe.com/blog/using-recorder-js-to-capture-wav-audio-in-your-html5-web-site/) Live demo: [https://addpipe.com/simple-recorderjs-demo/](https://addpipe.com/simple-recorderjs-demo/)
e64bf3d0c24b71f8e3a253ffb9459669c21a0b4d
[ "Markdown" ]
2
Markdown
AungKMin/accenterate
629642d6b9c089b5d98cd56f4ea90ea441f388fe
0ddd0fad60a5a00983372be9066381399450d780
refs/heads/main
<repo_name>baric6/ReactPokemonApi<file_sep>/README.md # ReactPokemonApi Created with CodeSandbox
13154344adbd50552c76f926b104e98bc427153a
[ "Markdown" ]
1
Markdown
baric6/ReactPokemonApi
975d620bbcc5442780436f6e38720b4541a2f62b
06f74e946b9c92ee6cb547334e1f8f8a9cfee88f
refs/heads/master
<repo_name>dissapointingcode/for-school<file_sep>/background_color_change/background_color_change.pde void setup() { size(1600,900); } color bg = 255; // starts off white void draw() { background(bg); } void mouseClicked() { if (bg == 255) //white to red bg = 16737380; else if (bg == 16737380)//red to yellow bg = 16777060; else if (bg == 16777060) //yellow to green bg = 6618980; else if (bg == 6618980) //green to light blue bg = 6619135; else if (bg == 6619135) //light blue to purplish blue bg = 6579455; else if (bg == 6579455) // lightblue to purple color bg = 16737535; else if (bg == 16737535) // reset bg = 255; } <file_sep>/fibb_spiral/fibb_spiral.pde //<NAME> //make a spiral using a for loop using fibbonacci sequence int fibb[] = new int[6]; //array containing int values void setup() { background(0); size(400,600); frameRate(30); //fills array with fibb sequence for(int i = 0; i < fibb.length; i++) { if (i == 0 || i == 1) fibb[i] = 40; else fibb[i] = fibb[i-1] + fibb[i-2]; } } void draw() { //variable that determines the starting angle of each line float startAngle = 0; float lineLength = 1; //determines length float lastX = 0; float lastY = 0; float newX = 0; float newY = 0; for(int k = 0; k < 6; k++) { lineLength = fibb[k]; if (k == 0) { stroke(255); line(width/2,height/2,(width / 2) + lineLength,height / 2); lastX = (width / 2) + lineLength; lastY = (height / 2); startAngle++; } else { if (startAngle % 4 == 0) { newY = lastY; newX = lastX + lineLength; } else if (startAngle % 3 == 0 && startAngle % 4 != 0) { newY = lastY +lineLength; newX = lastX; } else if (startAngle % 2 == 0 && startAngle % 3 != 0 && startAngle % 4 != 0) { newY = lastY; newX = lastX - lineLength; } else if (startAngle % 2 != 0 && startAngle % 3 != 0 && startAngle % 4 != 0) { newY = lastY - lineLength; newX = lastX; } stroke(255); line(lastX,lastY,newX,newY); lastX = newX; lastY = newY; startAngle++; } } } <file_sep>/moving_barcode/thebars.pde class bars { int the_y; void calculate() { } void display() { float randy = the_y + random(-5.5,5.5); float randy2 = the_y + random(-5.5,5.5); float randy3 = the_y + random(-5.5,5.5); float randy4 = the_y + random(-5.5,5.5); float randy5 = the_y + random(-5.5,5.5); float randy6 = the_y + random(-5.5,5.5); float randy7 = the_y + random(-5.5,5.5); float randy8 = the_y + random(-5.5,5.5); float randy9 = the_y + random(-5.5,5.5); float randy10 = the_y + random(-5.5,5.5); float randy11 = the_y + random(-5.5,5.5); float randy12 = the_y + random(-5.5,5.5); float randy13 = the_y + random(-5.5,5.5); float randy14 = the_y + random(-5.5,5.5); float randy15 = the_y + random(-5.5,5.5); float randy16 = the_y + random(-5.5,5.5); stroke(0); beginShape(); //make a line with 16 points line(100,randy,113,randy2); line(113,randy2,125,randy3); line(125,randy3,137,randy4); line(137,randy4,150,randy5); line(150,randy5,163,randy6); line(163,randy6,175,randy7); line(175,randy7,187,randy8); line(187,randy8,200,randy9); line(200,randy9,213,randy10); line(213,randy10,225,randy11); line(225,randy11,237,randy12); line(237,randy12,250,randy13); line(250,randy13,267,randy14); line(267,randy14,275,randy15); line(275,randy15,288,randy16); line(288,randy16,300,randy); endShape(); } } <file_sep>/random_rain/rainbow/rainbow.pde //make a rainbow //255,0,0 //255,255,0 //0,255,0 //0,255,255 //0,0,255 makerainbow rainbow = new makerainbow(); void setup() { size(1600,900); background (250); } void draw() { } <file_sep>/flashoflightning/flashoflightning.pde // flash the background like lightning thelightning lightning = new thelightning(); void setup () { size(1600,900); frameRate(300); } color bg = 255; int k = 0; void draw() { background(bg); int chance = int(random(200)); if (chance == 1) { background(0); } } <file_sep>/grid/grid.pde //draw a grid void setup() { size(1600,960); int scale = 64; for (int gridx = 0;gridx < width;) { for (int gridy = 0;gridy < height;) { noFill(); rect(gridx,gridy,scale,scale); gridy += scale; } gridx += scale; } } void draw() { } <file_sep>/endless_runner/endless_runner.pde //this is an endless running platformer float temp_X = 0; int gridy = 0; int scale = 64; // how big each grid should be int gridCounter = width / scale; float screenspeed = 1; float maxjump = scale + 47; playerClass player = new playerClass(); platforms squares[] = new platforms[20]; void setup() { size(1024,896); squares[0] = new platforms(); for (int i = 1; i < squares.length; i++){ squares[i] = new platforms(squares[i-1]); } } float currentground = (896 - 2 * scale); void draw() { background(255); grid(temp_X); player.updateLocal(currentground); player.display(); temp_X -= screenspeed; screenspeed += .001; maxjump = ((47 * screenspeed) + scale); for (int i = 0; i < squares.length; i++){ squares[i].display(i); } } void grid(float temp_x) { //this function makes a grid according to the variable scale and the pre assigned width and height, if you change the screen resolution or the scale with graph will still cooperate for (float gridx = temp_x;gridx < width;) { for (float gridy = 0;gridy < height;) { noFill(); rect(gridx,gridy,scale,scale); gridy += scale; } gridx += scale; } } <file_sep>/moving_barcode/moving_barcode.pde //<NAME> october 30th //generative art mimicing a barcode but moving bars[] thebar = new bars[12]; void setup() { size(400,600); background(0); frameRate(24); for (int k = 0; k < thebar.length; k++){ thebar[k] = new bars(); thebar[k].the_y = (80 + (40 * k)); background(0); } } void draw() { background(0, 128, 0, 30); for (int k = 0; k < thebar.length; k++){ thebar[k].calculate(); thebar[k].display(); } } <file_sep>/rain_and_lightning/rain_and_lightning.pde raindrop[] rd = new raindrop[200]; void setup () { size(1600,900); frameRate(300); for (int k = 0; k< rd.length; k++) rd[k] = new raindrop(); } color bg = 255; int k = 0; void draw() { background(bg); int chance = int(random(200)); if (chance == 1) { background(0); } for (int k = 0; k< rd.length; k++) { rd[k].rain(); rd[k].drop(); } } <file_sep>/endless_runner/playerobj.pde class playerClass { float y = 6*scale; float x = 4 * scale; float velocity = scale / 50; float gravity = 0; void updateLocal(float currentground) {//update location float ground = currentground; //will do gravity and check if there is a need to stop ( ground ) //checking for collision in checkcollision function player.jump(); // do gravity y += gravity; if (gravity <= scale) // give it terminal velocity gravity += velocity; for (int i = 0; i < squares.length; i++){ squares[i].checkCollision(this); } if (y >= ground) { //check if there is ground y = ground; gravity = 0; } } void display() { fill(0); rect(x,y,scale,scale); //draw player } void jump() { if (keyPressed) { if ( key == 'w' || keyCode == UP) { if (gravity == 0) { gravity = -16; if (gravity == -16) gravity -= 4.1; } } } } } <file_sep>/README.md # for-school <file_sep>/random_rain/random_rain.pde //<NAME> //generate rain raindrop[] rd = new raindrop[300]; void setup() { //runs once size(1600,900); frameRate(300); for (int k = 0; k< rd.length; k++) rd[k] = new raindrop(); } void draw() { //runs forever // random number generator background(249,249,249); //generate a plygon at an angle, purple colored, given a random float for (int k = 0; k< rd.length; k++) { rd[k].rain(); rd[k].drop(); } } <file_sep>/flashoflightning/thelightning.pde class thelightning { int k = 0; boolean on=true; void strike() { if(millis() % 100== 0) { if(on) { background(0); } else background(255); on = !on; } } } <file_sep>/rainlightningandcolorchange/rainlightningandcolorchange.pde raindrop[] rd = new raindrop[200]; void setup () { size(1600,900); frameRate(300); for (int k = 0; k< rd.length; k++) rd[k] = new raindrop(); } color bg = 255; int cr = 255; int cg = 255; int cb = 255; int k = 0; void mouseClicked() { if (cr == 255 && cg ==255 && cb ==255) { cr = 255; cg = 100; cb = 100; } else if (cr == 255 && cg ==100 && cb ==100) { cr = 255; cg = 255; cb = 100; } else if (cr == 255 && cg ==255 && cb ==100) { cr = 100; cg = 255; cb = 100; } else if (cr == 100 && cg ==255 && cb ==100) { cr = 100; cg = 255; cb = 255; } else if (cr == 100 && cg ==255 && cb ==255) { cr = 100; cg = 100; cb = 255; } else if (cr == 100 && cg ==100 && cb ==255) { cr = 255; cg = 100; cb = 255; } else if (cr == 255 && cg ==100 && cb ==255) { cr = 255; cg = 255; cb = 255; } } void draw() { background(bg); int chance = int(random(200)); if (chance == 1) { background(0); } for (int k = 0; k< rd.length; k++) { rd[k].rain(); rd[k].drop(cr,cg,cb); } } /* if (cr == && cg == && cb ==) */ <file_sep>/endless_runner/platforms.pde class platforms { float x; int y; int counter = 0; float displayX = 0; platforms() { x = width; y = int(random(height - (3 * scale + scale),height)); displayX = x; } platforms(platforms other) { y = other.y + int(random(-3 * scale,3 * scale)); x = other.x + int(random(scale,maxjump)); displayX = x; } void display(int currentsquare) { fill(200,125,255); displayX -= screenspeed; rect(displayX,y,scale,scale); if (displayX < -10) { if (currentsquare != 0) squares[currentsquare] = new platforms(squares[currentsquare - 1]); if (currentsquare == 0) squares[currentsquare] = new platforms(); } } void checkCollision(playerClass player) { if(this.displayX <= player.x + scale && this.displayX >= player.x - scale){ if((player.y + scale) >= this.y - 3 && (player.y + scale) <= this.y + 3){ player.gravity = 0; } } } } //if(this.displayX <= player.x + scale && this.displayX >= player.x - scale){ // if(player.y + scale <= this // } <file_sep>/random_rain/rainbow/makerainbow.pde //makeing of the rainbow class makerainbow { void generate() { } } <file_sep>/rainlightningandcolorchange/rainclass.pde public class raindrop{ float y = random(-500,0); float x = random(2100); float dropspeed = random(.5,3); void rain() { y = y+ dropspeed; x = x - (dropspeed / 3); if (y > 900) { y = y - 1000; x = random(2100); } } void drop(int clrr,int clrg,int clrb) { strokeWeight(3.0); stroke(clrr,clrg,clrb); beginShape(); vertex(x,y); //top left, top right, bottom right, bottom left, start point. vertex(x+3,y); vertex(x,y + 10); vertex(x-3,y + 10); vertex(x,y); endShape(); } }
83373256e0b04f761e86c4345f142faa2be90ba4
[ "Processing", "Markdown" ]
17
Processing
dissapointingcode/for-school
806a63e319cc8a205c34d8155484440e817e2cea
36a79ae537a2265ea2eca62dede217661c81e49c
refs/heads/master
<file_sep>// // Created by <NAME> on 24.04.15. // #ifndef ALGO_ALGO_H #define ALGO_ALGO_H #endif //ALGO_ALGO_H <file_sep> cmake_minimum_required(VERSION 3.1) project(ALGO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES ScalanieZbiorow.cpp ) set(SOURCE_TEST ) add_executable(ScalanieZbiorow ${SOURCE_FILES}) <file_sep>cmake_minimum_required(VERSION 3.1) project(ALGO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES Nawiasy.cpp ) set(SOURCE_TEST ) add_executable(Nawiasy.cpp ${SOURCE_FILES} ) <file_sep>#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; class Node{ public: int key; int origin; Node(int nKey, int nOrigin){ key = nKey; origin = nOrigin; } Node(){ key = 0; origin = 0; } }; class Heap{ public: int currentNumberOfItems; int size; Node* array; Heap(int newSize){ currentNumberOfItems=0; size = newSize; array = new Node[size]; } Node getMinElement(){ Node value = array[0]; currentNumberOfItems--; array[0]=array[currentNumberOfItems]; heapifyMin(0); return value; } int getParent(int index){ return (index-1)/2; } int getLeft(int index){ return index*2+1; } int getRight(int index){ return index*2+2; } int getCurrentNumberOfItems() { return currentNumberOfItems; } void heapifyMin(int index){ int minIndex=index; int currentMin=array[index].key; if(getLeft(index) < getCurrentNumberOfItems() && array[getLeft(index)].key < array[index].key){ currentMin = array[getLeft(index)].key; minIndex = getLeft(index); } if (getRight(index)<getCurrentNumberOfItems() && array[getRight(index)].key<currentMin) { minIndex = getRight(index); } if (minIndex!=index){ swap(array[minIndex], array[index]); heapifyMin(minIndex); } } void insert(Node value) { array[currentNumberOfItems]=value; currentNumberOfItems++; int parent = currentNumberOfItems - 1; while (array[getParent(parent)].key > array[parent].key) { swap(array[getParent(parent)],array[parent]); parent = getParent(parent); } } }; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int numberOfArrays; cin>> numberOfArrays; int * arrays[numberOfArrays]; int key; int numberOfEntries; Heap myHeap(numberOfArrays); // Iterate arrays for(int i=0; i<numberOfArrays; i++){ cin>> numberOfEntries; // Scan first element of array cin>>key; Node myNode(key,i); myHeap.insert(myNode); arrays[i]=new int[numberOfEntries]; // Scan all other elements of array arrays[i][0]=numberOfEntries-1; for(int j=numberOfEntries-1; j>0; j--){ cin>> key; arrays[i][j]=key; } } int original; int placeInArrays; while(myHeap.currentNumberOfItems!=0){ Node newNode = myHeap.getMinElement(); cout<<newNode.key<<" "; original = newNode.origin; placeInArrays = arrays[original][0]; if(placeInArrays>0){ Node tempNode(arrays[original][placeInArrays],original); arrays[original][0]--; myHeap.insert(tempNode); } } return 0; } <file_sep>// // Created by <NAME> on 24.04.15. // #ifndef ALGO_SCALANIELISTTEST_H #define ALGO_SCALANIELISTTEST_H #endif //ALGO_SCALANIELISTTEST_H <file_sep>#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; class Node{ public: int key; Node* next; Node(int k){ key=k; next=this; } Node(){ key=-1; next=this; } }; Node* find(Node* x){ if(x->next==x){ return x; } x->next=find(x->next); return x->next; } void unionSets(Node* x, Node* y) { find(x)->next=find(y); } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; int m; cin>> n; cin>> m; //inialize containers int* coordinates; coordinates = new int[n*m]; Node * nodes; nodes = new Node[n*m]; //scan the priorities int currentPriority; for (int i = 0; i < n * m; i++) { cin>>currentPriority; coordinates[currentPriority - 1] = i; } int currentNumber = 0; int currentKey; Node* currentNode; for (int i = 0; i < n * m; i++) { currentNumber++; currentKey = coordinates[i]; currentNode = new Node(currentKey); nodes[currentKey] = *currentNode; //left if (currentKey % n != 0 && nodes[currentKey - 1].key != -1) { if (find(currentNode) != find(&nodes[currentKey - 1])) { currentNumber--; unionSets(currentNode, &nodes[currentKey - 1]); } } //right if (currentKey % n != n - 1 && nodes[currentKey + 1].key != -1) { if (find(currentNode) != find(&nodes[currentKey + 1])) { currentNumber--; unionSets(currentNode, &nodes[currentKey + 1]); } } //down if (currentKey - n >= 0 && nodes[currentKey - n].key != -1) { if (find(currentNode) != find(&nodes[currentKey - n])) { currentNumber--; unionSets(currentNode, &nodes[currentKey - n]); } } //up if (currentKey + n < n * m && nodes[currentKey + n].key != -1) { if (find(currentNode) != find(&nodes[currentKey + n])) { currentNumber--; unionSets(currentNode, &nodes[currentKey + n]); } } cout<< currentNumber<<" "; } } <file_sep>cmake_minimum_required(VERSION 3.1) project(ALGO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES ALGO.h ALGO.cpp) set(SOURCE_TEST ) add_executable(ALGO ${SOURCE_FILES} ) add_subdirectory(ScalanieWieluList) add_subdirectory(ScalanieWieluListTest) add_subdirectory(ScalanieZbiorow) add_subdirectory(Nawiasy) <file_sep>cmake_minimum_required(VERSION 3.1) project(ALGO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES ScalanieList.cpp ) set(SOURCE_TEST ) add_executable(ScalanieWieluList ${SOURCE_FILES}) <file_sep>cmake_minimum_required(VERSION 3.1) project(ALGO) ADD_SUBDIRECTORY (gtest-1.7.0) enable_testing() include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") enable_testing() set(SOURCE_FILES ScalanieListTest.h ScalanieListTest.cpp ) add_executable(ScalanieWieluListTest ${SOURCE_FILES} ) target_link_libraries(ScalanieWieluListTest gtest gtest_main) add_test( ScalanieWieluListTest runUnitTests )<file_sep>#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; void change(char* c, int index, int & nplus, int & nminus){ if(c[index-1]== ')'){ nminus--; nplus++; c[index-1]='('; return; } nplus--; nminus++; c[index-1]=')'; } bool check(char *c, int size, int nplus, int nminus){ if (nplus!=nminus){ return false; } int control = 0; for (int i=0; i<size; i++){ if(c[i]==')'){ control--; }else{ control++; } if(control<0){ return false; } } if(control==0){ return true; } return false; } int main() { int n; int m; cin>>n; char * slowo; slowo = new char[n]; int nplus=0; int nminus=0; char c; for(int i=0; i<n; i++){ cin>>c; if(c==')'){ nminus++; }else{ nplus++; } slowo[i]=c; } cin>>m; int tmp; while(m>0){ m--; cin>>tmp; if(tmp==0){ if(check(slowo, n, nplus,nminus)){ cout<<"TAK"<<endl; }else{ cout<<"NIE"<<endl; } } else{ change(slowo,tmp, nplus, nminus); } } return 0; } <file_sep>// // Created by <NAME> on 24.04.15. // #include "ALGO.h" <file_sep>// // Created by <NAME> on 24.04.15. // #include "ScalanieListTest.h"
2d131595fa9b3146eee28853de6689475f3f5a43
[ "C++", "C", "CMake" ]
12
C++
jan-osch/AlgoStartLato2015
9d351527f0c753d2ad713966ec010148f51f77ad
f9912eb3b3f75bd6daec90eb3e6782d74c81bf9b
refs/heads/master
<file_sep>create table student(studentid int,firstname varchar(50),lastname varchar(50)) create table studentdesc(studentid int, stud_desc varchar(50)) GO CREATE TRIGGER stu_insert ON student AFTER INSERT AS BEGIN INSERT into studentdesc(studentid, stud_desc) VALUES (3, 'customer') END GO drop trigger stu_insert insert into student values(3,'mita','chowdhury') select * from studentdesc select * from student go create view studentview as select a.studentid,b.stud_desc from student a join studentdesc b on a.studentid=b.studentid go select * from studentview go create trigger view_trig on studentview instead of insert as begin insert into student values(4,'manoj','tiwari') --go insert into studentdesc values(4,'buyer') end insert into studentview values(5,'seller') drop table studentdesc<file_sep>declare @CompanyID int , @EndDt DateTime , @StartDt DateTime select @CompanyID = 1065, @EndDt = '2012/01/17', @StartDt = '2012/01/16' CREATE TABLE #OfferWork (OfferCode varchar(15), CouponID int, CoupDesc varchar(200), CampDesc varchar(200)) CREATE TABLE #PinWork (PIN varchar(100), OfferCode varchar(15), PID varchar(15), couponid int, attempted int, CoupType varchar(10), Summary varchar(200), MidLevel varchar(200), CampDesc varchar(200), coupdesc varchar(200) null, printcount int, firstprint datetime, --redemption columns redeemed int,firstredeem datetime, deny_dev int, deny_pin int, deny_fraud int, deny_network int, deny_platform int,RetailerID varchar(10) null, --end of redemption columns shutoff datetime, expiry datetime, RollingDays int, PrintRunLimit int, GroupLimit int,deviceid int) CREATE TABLE #RdmWork (PIN varchar(100), OfferCode varchar(15), PID varchar(15), couponid int, attempted int, CoupType varchar(10), Summary varchar(200), MidLevel varchar(200), CampDesc varchar(200), coupdesc varchar(200) null, printcount int, firstprint datetime, redeemed int, firstredeem datetime, deny_dev int, deny_pin int, deny_fraud int, deny_network int, deny_platform int, userid int, RetailerID varchar(10) null, shutoff datetime, expiry datetime, RollingDays int, PrintRunLimit int, GroupLimit int, lastprint datetime null, lastredeem datetime null, deviceid int) -- Standard load for Bricks (Standard PIN reports) INSERT INTO #OfferWork SELECT DISTINCT cm1.OfferCode, cm1.CouponID, cm1.CampDesc, cm0.CampDesc FROM Campaign_master cm1 join Campaign_Master cm0 on cm1.campaignid = cm0.campaignid and cm0.camp_seq = 0 WHERE cm1.CompanyID = 1065 and cm1.CouponID > 0 and (cm1.OfferCode ='' or cm1.OfferCode=null) INSERT INTO #PinWork(PIN,OfferCode,PID,couponid,attempted,CoupType,Summary,MidLevel,CampDesc,CoupDesc,printcount,firstprint, shutoff, expiry ,deviceid,redeemed, GroupLimit ,RollingDays, PrintRunLimit ) SELECT t.BID,'','',t.CouponID,1, 'Web', c.Summary,c.MidLevel, o.CampDesc, o.CoupDesc, t.TransCount,t.AddDate,c.shutoff,c.expiry, t.deviceid,0,isnull(gl.OriginalLimit,0), case when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,4,1) = '}' then convert(int, substring(c.disclaimer,2,2)) when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,5,1) = '}' then convert(int, substring(c.disclaimer,2,3)) when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,3,1) = '}' then convert(int, substring(c.disclaimer,2,1)) else 0 end, -- fix later for rolling days case when prl.Lim is null and c.printrunlimit is null then 0 when prl.lim = 9999999 then 0 else prl.lim end as PrintRunLimit FROM Distribution.dbo.TransactionMaster t (nolock) join coupon_tbl c (nolock) on t.couponid = c.couponid -- change to eliminate non-manufacturer prints from DFSI info join #OfferWork o on t.couponid = o.couponid and o.offercode = '' left outer join printrunlimits prl (nolock) on t.couponid = prl.couponid left outer join Coupons.dbo.GPL_Census gc (nolock) on t.couponid = gc.couponid left outer join Coupons.dbo.GPL_Limits gl (nolock) on gc.groupid = gl.groupid WHERE t.TransType = 1 AND t.AddDate >= '2012/01/16' and t.AddDate < '2012/01/17' and t.Channel not in ('15237','15292','15293','15294') select * from #PinWork INSERT INTO #RdmWork(PIN , OfferCode , PID , couponid , attempted ,CoupType , Summary , MidLevel ,CampDesc , coupdesc , printcount , firstprint , redeemed , firstredeem , deny_dev , deny_pin ,deny_fraud , deny_network , deny_platform , userid , RetailerID , shutoff , expiry , RollingDays , PrintRunLimit , GroupLimit , lastprint , lastredeem , deviceid ) SELECT dp.bid, '','', r.couponid, 1, 'web', c.summary, c.MidLevel, o.CampDesc, o.CoupDesc, -- fix brick later to differentiate brick and PnM dp.TransCount, dp.AddDate, 1, r.RdmDate, 0, 0, 0, 0, 0, dp.userid, null, c.Shutoff, c.Expiry, case when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,4,1) = '}' then convert(int, substring(c.disclaimer,2,2)) when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,5,1) = '}' then convert(int, substring(c.disclaimer,2,3)) when substring(c.disclaimer,1,1) = '{' and substring(c.disclaimer,3,1) = '}' then convert(int, substring(c.disclaimer,2,1)) else 0 end, -- fix later for rolling days case when prl.Lim is null and c.printrunlimit is null then 0 when prl.lim = 9999999 then 0 else prl.lim end as PrintRunLimit, isnull(gl.OriginalLimit,0), null, null, dp.deviceid FROM UniqueRedeem r JOIN Distribution.dbo.TransactionMaster dp with (nolock) on r.couponid = dp.couponid and r.userid = dp.deviceid and r.printcount = dp.TransCount and dp.TransType = 1 left outer JOIN eb_email e with (nolock) ON e.userid = dp.deviceid AND e.couponid = dp.couponid AND e.printcount = dp.TransCount JOIN #OfferWork o on dp.couponid = o.couponid join coupon_tbl c (nolock) on dp.couponid = c.couponid left outer join printrunlimits prl (nolock) on prl.couponid = dp.couponid left outer join Coupons.dbo.GPL_Census gc (nolock) on gc.couponid = dp.couponid left outer join Coupons.dbo.GPL_Limits gl (nolock) on gc.groupid = gl.groupid WHERE dp.TransType = 1 and dp.Channel not in ('15237','15292','15293','15294') AND r.RdmDate >= '2012/01/16' AND r.RdmDate < '2012/01/17' insert into #PinWork(PIN , OfferCode , PID , couponid , attempted ,CoupType , Summary , MidLevel , CampDesc , coupdesc , printcount , firstprint, redeemed ,firstredeem , deny_dev , deny_pin ,deny_fraud , deny_network , deny_platform ,RetailerID,shutoff , expiry, RollingDays , PrintRunLimit , GroupLimit ,deviceid ) select PIN , OfferCode , PID , couponid , attempted , CoupType , Summary , MidLevel , CampDesc , coupdesc , printcount , firstprint, redeemed ,firstredeem , deny_dev , deny_pin ,deny_fraud , deny_network , deny_platform ,RetailerID,shutoff , expiry, RollingDays , PrintRunLimit , GroupLimit ,deviceid from #RdmWork UPDATE #PinWork SET deny_dev = e.dev_deny,deny_pin = e.pin_deny,deny_fraud = e.fraud_deny,deny_network = e.coup_limit, deny_platform = e.platform_deny, attempted = CASE WHEN e.Clicks > 0 then 1 else 0 END FROM #PinWork p JOIN eb_validation e with (nolock) on e.email = p.pin and e.offercd = p.OfferCode SELECT top 500 SUBSTRING( (hashbytes('sha1',(CONVERT(varchar(10),firstprint,101)+CONVERT(varchar(10),deviceid)+CONVERT(varchar(2),printcount)))),3,100) as uniqueid, PIN, OfferCode, CouponID, PrintCount, firstprint as PrintDate, Redeemed, case when firstredeem is null then '' else convert(varchar(10), firstredeem, 101) end as RedeemDate, isnull(Deny_Dev,'') as Deny_Dev, isnull(Deny_Pin,'') as Deny_PIN,isnull(Deny_Fraud,'') as Deny_Fraud,isnull(Deny_Network,'')as Deny_Network, isnull(Deny_Platform,'') as Deny_Platform, isnull(RetailerID,'') as RetailerID, PID, CoupType, Summary, MidLevel, CampDesc, CoupDesc, shutoff, expiry, RollingDays, PrintRunLimit, GroupLimit FROM #PinWork ORDER BY couponid, OfferCode, PIN, PrintCount drop table #OfferWork drop table #PinWork drop table #RdmWork <file_sep>--exec dbo.FCC_GetHeinzPinByOfferDetails2 '71107','07/02/2010','07/09/2010' /*Create Table #Tmp_OfferCode ( OfferCode varchar(15), CouponID int) CREATE clustered INDEX OC ON #Tmp_OfferCode (OfferCode, CouponID) Create Table #Tmp_eb_email ( UserID int, CouponID int, PrintCount int, Email varchar(50), LastChanged datetime, OfferCode varchar(50)) CREATE clustered INDEX UCP1 ON #Tmp_eb_email (UserID, CouponID, PrintCount) Create table #Tmp_UniqueRedeem (PIN varchar(100), UserID int, CouponID int, PrintCount int, RdmDate datetime, OfferCode varchar(15), PrtDate datetime) create clustered index UR on #Tmp_UniqueRedeem (UserID, CouponID, PrintCount) Create table #Tmp_UniqueRedeem2 (PIN varchar(100), CouponID int, RdmCount int, RdmDate datetime, OfferCode varchar(15), FirstPrint char(10)) create table #PinWork (PIN varchar(100), OfferCode varchar(15), couponid int, attempted int, prints int, firstprint char(10), redeemed int, deny_dev int, deny_pin int, deny_fraud int, deny_network int, deny_platform int, redemptiondate datetime null) create clustered index PW on #PinWork(PIN) --create index PW2 on #PinWork(OfferCode,couponid) CREATE TABLE #TmpDP (PIN varchar(100), OfferCode varchar(15), CouponID int, Prints int, FirstPrinted varchar(10)) CREATE TABLE #Tmp_Offer_Distinct (OfferCode varchar(15)) Insert into #Tmp_OfferCode(OfferCode, CouponID) SELECT DISTINCT OfferCode, CouponID FROM Campaign_master (nolock) WHERE CompanyID = @CompanyID AND OfferCode > ' ' INSERT INTO #Tmp_Offer_Distinct SELECT DISTINCT OfferCode FROM #Tmp_OfferCode Insert into #Tmp_eb_email Select e.UserID, e.CouponID, e.PrintCount, e.Email, e.LastChanged, e.OfferCode From eb_email e with (nolock) inner join #Tmp_OfferCode oc with (nolock) on oc.OfferCode = e.OfferCode and oc.couponid = e.couponid*/ --SELECT * INTO #Destination FROM #Tmp_UniqueRedeem WHERE 1=2 /*Insert into #Tmp_UniqueRedeem SELECT DISTINCT em.Email, rc.UserID AS UserID, rc.CouponID AS CouponID, rc.PrintCount, rc.RdmDate AS RdmDate, rc.OfferCode, t.adddate FROM dbo.UniqueRedeem rc with (nolock) inner join #Tmp_eb_email em with (nolock) on rc.UserID = em.userID and rc.CouponID = em.CouponID and rc.PrintCount = em.PrintCount JOIN Distribution.dbo.TransactionMaster t on rc.userid = t.deviceid and rc.couponid = t.couponid and rc.printcount = t.transcount WHERE rc.RdmDate >= '07/02/2010' and rc.RdmDate < '07/09/2010'*/ /*insert into #PinWork select eb.email, eb.offerCD, 0, CASE WHEN eb.Clicks > 0 then 1 else 0 END, 0, ' ', 0, isnull(eb.dev_deny,0), isnull(eb.pin_deny,0), isnull(eb.fraud_deny,0), isnull(eb.coup_limit,0), isnull(eb.platform_deny,0), null from eb_validation eb with (nolock) inner join #Tmp_Offer_Distinct oc with (nolock)on oc.OfferCode = eb.offercd where eb.LastChanged >= '07/02/2010' AND eb.LastChanged < '07/09/2010'*/ /*SELECT * INTO #Destination FROM #PinWork WHERE 1=2 SET ANSI_WARNINGS OFF INSERT INTO #Destination select eb.email, eb.offerCD, 0, CASE WHEN eb.Clicks > 0 then 1 else 0 END, 0, ' ', 0, isnull(eb.dev_deny,0), isnull(eb.pin_deny,0), isnull(eb.fraud_deny,0), isnull(eb.coup_limit,0), isnull(eb.platform_deny,0), null from eb_validation eb with (nolock) inner join #Tmp_Offer_Distinct oc with (nolock)on oc.OfferCode = eb.offercd where eb.LastChanged >= '07/02/2010' AND eb.LastChanged < '07/09/2010'*/ /*SET ANSI_WARNINGS ON select eb.email, eb.offerCD, 0, CASE WHEN eb.Clicks > 0 then 1 else 0 END, 0, ' ', 0, isnull(eb.dev_deny,0), isnull(eb.pin_deny,0), isnull(eb.fraud_deny,0), isnull(eb.coup_limit,0), isnull(eb.platform_deny,0), null from eb_validation eb with (nolock) inner join #Tmp_Offer_Distinct oc with (nolock)on oc.OfferCode = eb.offercd where eb.LastChanged >= '07/02/2010' AND eb.LastChanged < '07/09/2010' EXCEPT SELECT * FROM #Destination */ <file_sep>select a12.groupon_campaign_skey , sum(((((a11.line_sale_amt + a11.line_ship_amt) + a11.line_tax_amt) - a11.line_ord_cpn_disc_amt) + a11.groupon_price)) revenue_including_groupon, sum(a11.groupon_price) groupon_revenue,a15.calendar_date as order_dt,a16.short_desc,a16.product_type_no,a17.calendar_date as offer_start_dt, count(distinct a11.order_no) order_count from salesitem_fact a11 join groupon_fact a12 on (a11.groupon_fact_skey = a12.groupon_fact_skey) join salesorder_fact a13 on (a11.salesorder_fact_skey = a13.salesorder_fact_skey) join groupon_campaign_dim a14 on (a12.groupon_campaign_skey = a14.groupon_campaign_skey) join date_dim a15 on (a11.order_date_skey = a15.date_skey) join product_type_dim a16 on a11.product_type_skey=a16.product_type_skey join date_dim a17 on (a14.offer_start_date_skey = a17.date_skey) where (a13.order_status_skey in (7, 10, 5, 20, 11, 8, 14) and (not a13.payment_type_skey in (3, 4, 10)) and a11.sale_source_skey not in (3, 2) and a14.groupon_site_skey in (1) and a15.calendar_date between '2012-06-01' and '2012-07-13') group by a12.groupon_campaign_skey ,a15.calendar_date,a16.short_desc,a16.product_type_no,a17.calendar_date order by a15.calendar_date <file_sep>SELECT lis.cup_user AS reviewer , create_date_skey , count(*) as total , sum(case when image_status_no = 1 then 1 else 0 end ) as passed_total , sum(case when image_status_no = -1 then 1 else 0 end ) as pended_total FROM log_image_status lis where lis.cup_user is not null group by lis.cup_user, create_date_skey order by lis.cup_user, create_date_skey <file_sep>create table #temp1(couponid int, offercode int) create table #temp2(couponid int, offercode int) insert into #temp1(couponid , offercode ) values(155343, 1000) insert into #temp1(couponid , offercode ) values(155344, 2000) insert into #temp2(couponid , offercode ) values(155345, 3000) insert into #temp2(couponid , offercode ) values(155343, 1000) insert into #temp1(couponid , offercode ) values(155346, 5000) insert into #temp2(couponid , offercode ) values(155346, 1000) select * from #temp1 select * from #temp2 delete #temp2 from #temp2 o join (select couponid, offercode from #temp1) as r on o.couponid = r.couponid and o.offercode=r.offercode <file_sep>SELECT COUNT(groupon_deal_id),groupon_deal_id FROM groupon_campaign GROUP BY groupon_deal_id HAVING COUNT(groupon_deal_id)>3 SELECT * FROM dbo.groupon_campaign WHERE groupon_deal_id ='canvas-on-demand-115-wilmington-newark' SELECT gc1.groupon_deal_id_custom, gc2.groupon_deal_id_custom, gc1.groupon_campaign_id FROM dbo.groupon_campaign gc1 JOIN groupon_campaign gc2 ON SUBSTRING(gc1.groupon_deal_id_custom, 1, LEN(gc1.groupon_deal_id_custom) - 2) = SUBSTRING(gc2.groupon_deal_id_custom, 1, LEN(gc2.groupon_deal_id_custom) - 2) AND gc1.groupon_deal_id_custom != gc2.groupon_deal_id_custom WHERE SUBSTRING(gc1.groupon_deal_id_custom, LEN(gc1.groupon_deal_id_custom) - 1, 2) = '00' <file_sep>create table #Tmp1 (ManID varchar(10), couponid int, ocr varchar(7), company varchar(150), activedate datetime, expiry datetime, CouponDesc varchar(250), totprints int, GS1Data varchar(100) null) insert into #Tmp1 select manufacturerid, couponid, ocr, company, activedate, expiry, ' ', 0, GS1Data from cpnocr where clearinghouse = 'cms' and ((ocr > '00000' and isnumeric(ocr) = 1) or gs1data > ' ') and company not like '%test%' order by ocr, expiry update #Tmp1 set ocr = case when substring(gs1data,5,1) = 1 then substring(gs1data,13,6) when substring(gs1data,5,1) = 0 then substring(gs1data,12,6) when substring(gs1data,5,1) = 2 then substring(gs1data,14,6) else substring(gs1data,5,1) end where (gs1data is not null and isnumeric(substring(gs1data,5,1)) <> 0) and (ocr = '' or ocr is null) --drop table #Tmp1 select * from #Tmp1 where GS1Data ='Not a coupon' <file_sep>GO SELECT t.name AS table_name, c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE c.name LIKE '%_ABS%' <file_sep>declare @pid int, @startdate datetime, @enddate datetime, @Email_Coup varchar(10), @Email_Promo varchar(10), @email_custom varchar(10) select @pid = 15005, @startdate='06/30/2010', @enddate = '07/13/2010', @email_custom = 10, @Email_Coup = null, @Email_Promo = null declare @sql varchar (8000) declare @Email_CoupL varchar(10), @Email_PromoL varchar(10) select @Email_CoupL = convert(varchar(10),@Email_Coup),@Email_PromoL = convert(varchar(10),@Email_Promo) --common to all cases set @sql = 'SELECT UserID as UserID,SyndicateID as SyndicateID,Email as Email, FirstName as FirstName,LastName as LastName,Addr1 as Addr1,Addr2 as Addr2, City as City,State as State,Zip as Zip,Email_Coup as Email_Coup,Email_Promo as Email_Promo, Pets as Pets,Add_Date as Add_Date,Chg_Date as Chg_Date,IsDeleted as IsDeleted,LastLogin as LastLogin, SessionCnt as SessionCnt,Email_Custom as Email_Custom FROM dbo.UserReg (nolock) WHERE syndicateid = ' + convert(varchar(5),@pid) + ' and add_date >= ''' + convert(varchar(20),@startdate) + ''' and add_date < ''' + convert(varchar(20),@enddate) + '''' if @Email_CoupL is not null begin if @Email_CoupL=0 set @sql = @sql + ' and (Email_Coup = ''' + @Email_CoupL + ''' or Email_Coup is null)' else set @sql = @sql + ' and Email_Coup = ''' + @email_CoupL + '''' end if @Email_Promo is not null begin if @Email_Promo=0 set @sql = @sql + ' and (Email_Promo = ''' + @email_PromoL + ''' or Email_Promo is null)' else set @sql = @sql + ' and Email_Promo = ''' + @email_PromoL + '''' end if @email_custom is not null begin if @email_custom=0 set @sql = @sql + ' and (email_custom = ''' + @email_custom + ''' or email_custom is null)' else set @sql = @sql + ' and email_custom = ''' + @email_custom + '''' end --print @sql exec (@sql)<file_sep>SELECT sif.order_no , sif.company_skey FROM dbo.salesitem_fact sif JOIN dbo.salesorder_fact sof ON sif.salesorder_fact_skey = sof.salesorder_fact_skey JOIN dbo.traffic_source_dim ts ON sif.traffic_source_skey = ts.traffic_source_skey WHERE sif.company_skey = 3 AND ( ts.traffic_source_name NOT LIKE '%groupon~_%' ESCAPE '~' AND ts.traffic_source_name NOT LIKE '%amazon%' AND traffic_source_name NOT LIKE '%living%' AND (traffic_source_name NOT LIKE '%shopsocial%' or traffic_source_name LIKE '%localshopsocially%') AND traffic_source_name NOT LIKE '%google%' AND traffic_source_name NOT LIKE '%plum%' ) AND sif.groupon_fact_skey IS NULL AND sof.order_no = 1443344 AND sof.charge_date_skey >= 105734 AND sif.order_no NOT IN ( SELECT DISTINCT order_no FROM dbo.salesitem_fact WHERE groupon_fact_skey > 0 AND company_skey = 3 ) UNION SELECT axo.order_no , 3 AS company_skey FROM promotionDB..axready_override axo WHERE axo.dw_lastupdate_date > GETDATE() - 3 <file_sep>--database:db --author:<EMAIL> --approved: SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON SET CONCAT_NULL_YIELDS_NULL ON SET NUMERIC_ROUNDABORT OFF SET QUOTED_IDENTIFIER ON SET ARITHABORT ON GO BEGIN TRANSACTION INSERT INTO dbo.SALES_COMMISSION_METHOD_DEF(SALES_COMMISSION_METHOD_NO,SALES_COMMISSION_METHOD_NAME,SALES_COMMISSION_METHOD_RULE) VALUES(2,'no commission member','0'),(3,'no commission sample orders','0'),(4,'no commission producttypeno','0'),(5,'create and buy','0') GO UPDATE dbo.SALES_COMMISSION_METHOD_DEF SET SALES_COMMISSION_METHOD_RULE='(SP-discount) * SalesCommisionPercentage' WHERE SALES_COMMISSION_METHOD_No=1 COMMIT TRANSACTION <file_sep> SELECT lis.image_no , lis.image_status_no , lis.image_status_reason_no FROM dbo.log_image_status lis JOIN ( SELECT MAX(log_skey) AS log_skey FROM dbo.log_image_status WHERE create_date_skey = 105634 AND cup_user = 10 GROUP BY image_no ) t ON lis.log_skey = t.log_skey
9b041fe857fa10a04f6df6a0177f81d11e4cec89
[ "TSQL", "SQL" ]
13
TSQL
GitAmrita/sql
f51e7646b5d7eb68c81323d16ee8a4b013cff0e2
e0e6dac04fe8245dc9dc27c1ab2313e634d9e8b4
refs/heads/master
<file_sep>class TowerOfHanoi # initiliazing everything we need def initialize( blocks ) @blocks = blocks @board = [blocks,0,0] @has_won = false @blocks_one, @blocks_two, @blocks_three = Array.new(3) { [] } @all_blocks = [@blocks_one, @blocks_two, @blocks_three] end # printing the instructions at the beginning def instructions puts "" puts "Welcome to Tower of Hanoi!" puts "Instructions:" puts "Enter where you'd like to move from and to" puts "in the format [1,3]. Enter 'q' to quit." puts "" end # filling position 1 with however many blocks were passed by user def block_init( blocks_one ) @blocks.downto(1) do |i| @blocks_one << i end end # checks to see if 3 blocks are stacked in the third position def determine_win( board ) if @board[2] == @blocks @has_won = true end end # prompts user for their move, passes input to check validity # if input is not, tells user and quits # if nputt is valid, passes the move to check validity def move_prompt puts "Your move?" puts ">" from_to = gets.chomp if from_to == "q" exit else from_to = from_to.split(",") input_error_checking( from_to ) from_to = from_to.map(&:to_i) fix_move_positions( from_to ) move_error_checking( from_to ) end end # fixes move indexes def fix_move_positions( from_to ) from_to.map! { |i| i -= 1 } end # checks for errors in move input formatting def input_error_checking( from_to ) if from_to.length < 2 || from_to.length > 2 puts "Wrong number of moves! Please try again." exit end from_to.each do |i| if i == "0" puts "You entered 0 for a to or from position! Please try again." exit elsif i.to_i == 0 puts "You entered a non-integer! Please try again." exit end end end # checks for errors in the actual move def move_error_checking( from_to ) move_block_check = @all_blocks[from_to[0]][@all_blocks[from_to[0]].length - 1] if @all_blocks[from_to[0]].empty? puts "" puts "Tried to move from position with no blocks!" puts "" elsif !@all_blocks[from_to[1]].empty? && move_block_check > @all_blocks[from_to[1]][0] puts "" puts "Can't do that!" puts "" else move_block( from_to ) end end # moves the block if it is valid def move_block( from_to ) move_block = @all_blocks[from_to[0]].pop @board[from_to[0]] -= 1 @board[from_to[1]] += 1 @all_blocks[from_to[1]].push(move_block) determine_win( @board ) end # prints out the current state of the board def render puts "" puts "Current board:" puts "" count = @blocks while count >= 0 puts "o" * nil_check(@blocks_one[count]) + "\t" + "o" * nil_check(@blocks_two[count]) + "\t" + "o" * nil_check(@blocks_three[count]) count -= 1 end puts "" puts "One\tTwo\tThree" puts "" end # check if we're trying to display a block where there isn't one # if so, print 'o' zero times, effectively making that space blank def nil_check ( block ) if block == nil return 0 else return block end end # main loop for the game def play block_init( @blocks_one ) instructions while !@has_won render move_prompt if @has_won render puts "You won!" puts "" end end end end t = TowerOfHanoi.new(4) t.play
c112ef693cad3d16fcf441d0da9846c42c5e1be8
[ "Ruby" ]
1
Ruby
99z/assignment_toh
2468d8908aaefb0c8a0dfad4508e2a25da8935cd
058c3d345472b51fe2d345aa7e57d3c984aaac16
refs/heads/master
<repo_name>dyl25/caviste<file_sep>/src/Controllers/Controller.php <?php namespace Src\Controllers; use \Psr\Http\Message\ResponseInterface; /** * Description of Controller * */ class Controller { private $container; public function __construct($container) { $this->container = $container; } public function render(ResponseInterface $response, $file, $args=null) { $this->container->view->render($response, $file, $args); } public function loadModel($modelName) { return $this->container->$modelName; } }<file_sep>/README.md # Qu'est-ce que le projet Caviste? _Caviste_ est le nom du présent dépôt. Il s'agit aussi du nom de code du projet. Toutefois le **projet Caviste** consiste en la réalisation de trois applications: _MonCellier_, _Caviste Catalogue_ et _Caviste Webservice_. Le présent dépôt ne concerne que la partie de développement des applications _Caviste Catalogue_ et _Caviste Webservice_. # Qu'est-ce que _Caviste Webservice_? _Caviste Webservice_ est une API RESTFul d'un service Web (implémenté côté serveur en PHP/MySQL) qui distribue et donne accès aux données d'un catalogue de bouteilles de vin. Toute application cliente pourra: * consulter la liste des vins (lister), * afficher le détail de chaque bouteille de vins (sélectionner), * modifier les données d'une bouteille de vins (mettre à jour), * supprimer une bouteille de vin (supprimer), * ajouter une bouteille de vin au catalogue (insérer). Tous ces services seront disponibles sans nécéssité d'_authentification_ ni d'_autorisation_. # Qu'est-ce que _Caviste Catalogue_? _Caviste Catalogue_ est une application Web qui permet de consulter une base de données de bouteilles de vins sous la forme d'une page Web de type Catalogue. _Caviste Catalogue_ comporte une partie de développement côté serveur (PHP/MySQL), ainsi qu'une partie de développement côté client (HTML5/CSS3/JS). Tout internaute, sans nécéssité de connexion, pourra: * consulter la liste des vins (lister), * trier la liste des vins (sort), * filtrer la liste des vins (filter), * paginer la liste des vins (paginate), * afficher le détail de chaque bouteille de vins (sélectionner). # Technologies utilisées La réalisation des applications _Caviste Webservice_ et _Caviste Catalogue_ nécessitent l'exploitation des langages, outils et technologies suivantes: * _Caviste Webservice_ * Slim framework (framework PHP) * Twig (moteur de template) - _facultatif_ * RedBeanPHP (ORM – mapping objet-relationnel) - _alternative: PDO_ * _Caviste Catalogue_ * Slim framework (framework PHP) * Twig (moteur de template) * RedBeanPHP (ORM – mapping objet-relationnel) * Zurb Foundation (framework HTML, CSS, JS) * jQuery et jQueryUI (librairies JS) * Slim-Twig-Flash (extension Twig / middleware Slim) * Slim-Csrf (middleware Slim) * Git & GitHub (système de contrôle de versions & solution d’hébergement) * Trello (gestionnaire de projet) ___ # Projet caviste - partie backend ## Arborescence * Fichier de route: src/routes.php * Dossier de controller: src/Controller * Dossier de vue: src/views * Dossier du modèle: src/Models ##A l'importation du projet * composer dump-autoload * Redémarer serveur * Vider le cache du browser * Si ça ne marche toujours pas composer update ## Objectifs ### Fonctionnalités du Webservice JSON * GET /api/wines Retrouve tous les vins de la base de données * GET /api/wines/search/Chateau Recherche les vins dont le nom contient ‘Chateau’ * PUT /api/wines/10 Modifie les données du vin dont l'id == 10 * DELETE /api/wines/10 Supprime le vin dont l'id == 10 ### Présentation du Catalogue Interface montrant tous les vins de la base de donnée avec son type (Bordeaux, Bourgogne,...), son label (Château Arnes), son prix et une description.<file_sep>/src/container.php <?php // Get container $container = $app->getContainer(); /* Redbean connection */ \R::setup('mysql:host=localhost;dbname=cavavin', 'root', 'root'); // Register component on container $container['view'] = function ($container) { $dir = dirname(__DIR__); $view = new \Slim\Views\Twig($dir . '/src/views', [ 'cache' => false, //$dir . '/tmp/cache' 'debug' => true ]); // Instantiate and add Slim specific extension $basePath = rtrim(str_ireplace('index.php', '', $container['request']->getUri()->getBasePath()), '/'); $view->addExtension(new Slim\Views\TwigExtension($container['router'], $basePath)); $view->addExtension(new Twig_Extension_Debug()); return $view; }; $container['pdo'] = function($container) { $pdo = new PDO('mysql:dbname=cavavin;host=localhost', 'root', ''); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $pdo; }; /*$container['db'] = function($container) { return $container->pdo); };*/ $container['winesModel'] = function($container) { return new Src\Models\WinesModel($container); };<file_sep>/src/Controllers/WinesController.php <?php namespace Src\Controllers; use \Psr\Http\Message\RequestInterface; use \Psr\Http\Message\ResponseInterface; /** * Description of WinesController * * @author admin */ class WinesController extends Controller { /** * Affiche au format JSON tous les vins de la DB si il n'y a pas d'argument * sinon si un id est sp�cifi� le vin avec cet id sera renvoy� * @param RequestInterface $request * @param ResponseInterface $response * @param type $args */ public function index(RequestInterface $request, ResponseInterface $response, $args) { if (empty($args)) { $model = $this->loadModel('winesModel'); $result = $model->search(); $result = json_encode($result); //$this->render($response, 'wines/index.html.twig', ['wineData' => $result]); $response->getBody()->write($result); } else { $model = $this->loadModel('winesModel'); $result = $model->search_by_id($args['id']); $result = json_encode($result); $response->getBody()->write($result); } } public function home(RequestInterface $request, ResponseInterface $response) { $model = $this->loadModel('winesModel'); $result = $model->get_all(); $this->render($response, 'wines/home.html.twig', ['wines' => $result]); } /** * Recherche un vin en particulier * @param RequestInterface $request * @param ResponseInterface $response * @param type $args */ public function search(RequestInterface $request, ResponseInterface $response, $args) { $model = $this->loadModel('winesModel'); $result = $model->search($args['name']); $result = json_encode($result); $response->getBody()->write($result); //$this->render($response, 'wines/search.html.twig', ['wineData' => $result]); } /** * R�ception de donn�e au format json vie $_POST, les r�cup�r�e et ins�rer * dans la DB et echo un boolean pour dire si l'insertion s'est bien pass�e * @param RequestInterface $request * @param ResponseInterface $response */ public function add(RequestInterface $request, ResponseInterface $response) { if (isset($_SERVER['HTTP_REFERER'])) { if ($_SERVER['HTTP_REFERER'] == "moncellier.localhost") { $name = $_POST['name']; $year = $_POST['year']; $grapes = $_POST['grapes']; $country = $_POST['country']; $region = $_POST['region']; $description = $_POST['description']; $picture = $_POST['picture']; //envoi vers le modele $model = $this->loadModel('winesModel'); return $model->add_wines($name, $year, $grapes, $country, $region, $description, $picture); //} } } } /** * Modifie les information d'un vin. * @param int $id L'id du vin � modifier. * @return boolean True si le vin a bien �t� modifi� sinon false */ public function put($id) { if (isset($_SERVER['HTTP_REFERER'])) { if ($_SERVER['HTTP_REFERER'] == 'moncellier.localhost') { $name = $_POST['name']; $year = $_POST['year']; $grapes = $_POST['grapes']; $country = $_POST['country']; $region = $_POST['region']; $description = $_POST['description']; $picture = $_POST['picture']; // //envoi vers le modele $model = $this->loadModel('winesModel'); return $model->update_wine($id, $name, $year, $grapes, $country, $region, $description, $picture); //} } } } /** * Supprime un vin. * @param int $id L'id du vin � supprimer. * @return boolean True si le vin a bien �t� supprim� sinon false */ public function delete($id) { if (isset($_SERVER['HTTP_REFERER'])) { if ($_SERVER['HTTP_REFERER'] == 'moncellier.localhost') { $model = $this->loadModel('winesModel'); return $model->delete_wine($id); } } } }<file_sep>/src/Models/WinesModel.php <?php namespace Src\Models; /** * Description of WinesModel * * @author admin */ class WinesModel { private $container; public function __construct($container) { $this->container = $container; } /** * Vérifie les données d'un vin. * @param string $name Le nom du vin. * @param int $year L'année du vin. * @param string $grapes La grape du vin. * @param string $country Le pays du vin. * @param string $region La region du vin. * @param string $description La description du vin. * @param string $picture L'image associée au vin. * @return boolean True si les données sont valide sinon false. */ public function dataVerify($name, $year, $grapes, $country, $region, $description, $picture) { if (!is_string($name)) { return false; } if (!is_int($year)) { return false; } if (!is_string($grapes)) { return false; } if (!is_string($country)) { return false; } if (!is_string($region)) { return false; } if (!is_string($description)) { return false; } if (!is_string($picture)) { return false; } return true; } public function get_all() { $res = \R::findAll('wine'); if ($res) { return $res; } return false; } /** * Cherche un vin en particulier si le nom est défini sinon tous les vins * @param string $name Le nom du vin * @return mixed false si pas de résultat sinon un tableau de résultat */ public function search($name = null) { //Recherche de tout les vins if (!$name) { $res = \R::findAll('wine'); if ($res) { return $res; } return false; } //Recherche d'un vin en particulier $result = \R::findLike('wine', ['name' => [$name]]); if ($result) { return $result; } return false; } /** * Recherche un vin grâce à son id * @param type $id L'id du vin * @return mixed False si pas de résultat sinon un tableau de résultat */ public function search_by_id($id = null) { if ($id > 0) { $result = \R::findOne('wine', 'id = ' . $id); return $result; } return false; } /** * Ajoute un vin * @param string $name Le nom du vin. * @param int $year L'année du vin. * @param string $grapes La grape du vin. * @param string $country Le pays du vin. * @param string $region La region du vin. * @param string $description La description du vin. * @param string $picture L'image associée au vin. * @return boolean True si le vin a bien été ajouté sinon false. */ public function add_wines($name, $year, $grapes, $country, $region, $description, $picture) { if (!$this->dataVerify($name, $year, $grapes, $country, $region, $description, $picture)) { return false; } $wine = \R::dispense('wine'); $wine->name = $name; $wine->year = $year; $wine->grapes = $grapes; $wine->country = $country; $wine->region = $region; $wine->description = $description; $wine->picture = $picture; //si l'opération c'est bien passée Redbean renvoi l'id de l'objet inséré. $result = \R::store($wine); return $result; } /** * Modifie les informations sur un vin * @param int $id L'id du vin. * @param string $name Le nom du vin. * @param int $year L'année du vin. * @param string $grapes La grape du vin. * @param string $country Le pays du vin. * @param string $region La region du vin. * @param string $description La description du vin. * @param string $picture L'image associée au vin. * @return boolean True si le vin a bien été modifié sinon false. */ public function update_wine($id, $name, $year, $grapes, $country, $region, $description, $picture) { if (!is_int($id) || !$this->dataVerify($name, $year, $grapes, $country, $region, $description, $picture)) { return false; } //chargement du vin à modifier $wine = \R::load('wine', $id); $wine->name = $name; $wine->year = $year; $wine->grapes = $grapes; $wine->country = $country; $wine->region = $region; $wine->description = $description; $wine->picture = $picture; $result = \R::Store($wine); return $result > 0; } /** * Supprime les informations sur un vin * @param int $id L'id du vin. * @return boolean True si le vin a bien été supprimé sinon false. */ public function delete_wine($id) { if (!is_int($id)) { return false; } $wine = \R::load('wine', $id); $result = \R::trash($wine); return $result > 0; } } <file_sep>/src/views/wines/index.html.twig {{ wineData|json_encode(constant('JSON_PRETTY_PRINT')) }} <file_sep>/src/views/wines/search.html.twig {{ wineData }} <file_sep>/src/views/layout.html.twig <!doctype html> <html lang="fr"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Caviste</title> <link rel="stylesheet" href="https://dhbhdrzi4tiry.cloudfront.net/cdn/sites/foundation.min.css"> <link href="https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel='stylesheet' type='text/css'> <link rel="stylesheet" href="http://localhost/caviste/public/style/perso.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <script src="https://dhbhdrzi4tiry.cloudfront.net/cdn/sites/foundation.js"></script> </head> <body> <nav class="top-bar"> <div class="row"> <div class="top-bar-left"> <ul class="menu"> <li class="menu-text">Caviste</li> <li class="menu-text">Menu 1</li> <li class="menu-text">Menu 2</li> <li class="menu-text">Menu 3</li> </ul> </div> <div class="top-bar-right"> <ul class="menu"> <li> <form> <div class="input-group"> <input type="text" name="wineSearch" class="input-group-field"> <div class="input-group-button"> <input type="submit" class="button" value="Rechercher"> </div> </div> </form> </li> </ul> </div> </div> </nav> {% block content %}{% endblock %} </body> </html> <file_sep>/src/views/wines/home.html.twig {% extends "layout.html.twig" %} {% block content %} <div class="off-canvas-wrapper"> <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper> <!--<div class="off-canvas position-left reveal-for-large" id="my-info" data-off-canvas data-position="left"> <div class="row column"> <br> <img class="thumbnail" src="https://placehold.it/550x350"> </div> </div>--> <div class="off-canvas-content" data-off-canvas-content> <div class="callout"> <div class="row column"> <h1>Dashboard projet Caviste</h1> <p class="lead">Voici tous nos vins de la base de donnée</p> <div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit> <ul class="orbit-container"> <button class="orbit-previous" aria-label="previous"><span class="show-for-sr">Previous Slide</span>&#9664;</button> <button class="orbit-next" aria-label="next"><span class="show-for-sr">Next Slide</span>&#9654;</button> {% for wine in wines|slice(0,2) %} <li class="orbit-slide is-active"> <img src="http://localhost/caviste/public/vins/{{wine.picture}}"> </li> {% endfor %} </ul> </div> </div> </div> <div class="row small-up-2 medium-up-3 large-up-5"> {% for wine in wines %} <div class="column fiche"> <img class="thumbnail" src="http://localhost/caviste/public/vins/{{wine.picture}}"> <p class="wine-type">{{wine.region}}</p> <p>{{wine.name}}</p> <p class="wine-price">5 &euro;</p> </div> {% endfor %} </div> </div> </div> </div> {% endblock %} <file_sep>/src/routes.php <?php // Routes //Affichage d'un vin grâce à nom $app->get('/api/wines/search/{name}', Src\Controllers\WinesController::class . ':search')->setName('search'); //Affichage d'un vin grâce à son id $app->get('/api/wines/{id}', Src\Controllers\WinesController::class . ':index')->setName('index'); //Affichage de tous les vins disponiblent $app->get('/api/wines', Src\Controllers\WinesController::class . ':index')->setName('index'); //Ajout de vin $app->post('/api/wines', Src\Controllers\WinesController::class . ':add')->setName('addWines'); $app->get('/home', Src\Controllers\WinesController::class . ':home')->setName('home'); $app->put('/api/wines/{id}', Src\Controllers\WinesController::class . ':put'); $app->delete('/api/wines/{id}', Src\Controllers\WinesController::class . ':delete'); $app->get('/test', Src\Controllers\WinesController::class . ':test');
caae17912b93844cffb855ca94209f5286207f12
[ "Markdown", "Twig", "PHP" ]
10
Markdown
dyl25/caviste
5599eb0ee42a2a8d62ce5d9410180f0b245068db
e10cf7a38be0c89a518d08373a82d7a698c45678
refs/heads/master
<file_sep>#define _CRT_SECURE_NO_WARNINGS #include <omp.h> #include "Eigen\Core" #include <array> #include <time.h> #include <assert.h> //#include <cuda.h> using namespace Eigen; using namespace std; #define INPUT_DIMENSION 4 #define SAMPLES_SIZE 1000 #define NUMBER_OF_TESTS 10000 //so we can easily control precission typedef double MReal; typedef Matrix<MReal, INPUT_DIMENSION, 1> PVector; typedef Matrix<MReal, 1, INPUT_DIMENSION> PVectorT; typedef Matrix<MReal, Dynamic,1> ObservationsVector; typedef Matrix<MReal, INPUT_DIMENSION, INPUT_DIMENSION> HessianMatrix; typedef Matrix<MReal, Dynamic, INPUT_DIMENSION > PVMatrix; typedef Matrix<MReal, INPUT_DIMENSION, Dynamic > PVMatrixT; class FunctionLogLikelyhood { PVMatrix allx; PVMatrixT allxT; ObservationsVector y; public: PVector TestBetas; // don't forget, first value of x (or last) needs to be 1 void GenerateTestData() { allx = PVMatrix(SAMPLES_SIZE, INPUT_DIMENSION); y = ObservationsVector(SAMPLES_SIZE,1); TestBetas = PVector::Random(); for (unsigned int i = 0; i < SAMPLES_SIZE; i++) { PVector genvec = PVector::Random(); genvec(0, 0) = 1.f; y(i) = probabilityFunction(genvec, TestBetas); allx.row(i) = genvec; } allxT = allx.transpose(); } // populate allx and y void Load() { } //p = e^(x * beta)/(1 + e^(x * beta)) MReal inline probabilityFunction(const PVector& x, const PVector& betas){return 1. / (1.f + exp(-x.dot(betas)));} //get the log likelyhood at Beta MReal inline Eval(const PVector& betas){return (1.0 / (1.0 + exp(-(allx * betas).array())) - y.array()).matrix().squaredNorm();} //get log likelyhood gradient at beta void Gradient(const PVector& beta, PVector& gradientOut) { const ObservationsVector Values = (1.0 / (exp(-(allx *beta).array()) + 1.0)).matrix() - y; gradientOut = allxT*Values; } }; FunctionLogLikelyhood g_function; MReal line_searchAlpha(const PVector& dir, const PVector& betas) { //new xk test MReal c1 = 0.0001; MReal alpha = 1.0f; MReal tau = 0.5f; MReal valueAtNXK = 0.f; MReal Wolf1Condition = 0.f; do { PVector gradientOut; valueAtNXK = g_function.Eval(betas + alpha * dir); g_function.Gradient(betas, gradientOut); PVectorT gradientTrans = gradientOut.transpose(); MReal temp = gradientTrans * dir; Wolf1Condition = g_function.Eval(betas) + c1*alpha*(temp); if (valueAtNXK < Wolf1Condition) break; alpha = alpha * tau; } while (valueAtNXK > Wolf1Condition); return alpha; } void main() { omp_set_num_threads(16); Eigen::initParallel(); srand(time(NULL)); FILE * f = fopen("tests.txt", "w+"); unsigned int test = 0; unsigned int fails = 0; for (; test < NUMBER_OF_TESTS; test++) { g_function.GenerateTestData(); PVector results; HessianMatrix BKinv = HessianMatrix::Identity(); // we start with a random initial estimation PVector Betas = PVector::Random(); const unsigned int MAX_NUM_ITERATIONS = 100; MReal gradientNorm = 1.f; MReal firstStepAlpha = 0.05f; unsigned int iter = 0; for (; iter < MAX_NUM_ITERATIONS && gradientNorm >= 0.001; iter++) { PVector GradientK; g_function.Gradient(Betas, GradientK); assert(GradientK.allFinite()); gradientNorm = GradientK.norm(); //Compute the search direction PVector PK = -1 * BKinv * GradientK; MReal phi = GradientK.dot(PK); if (phi > 0) // hessian not positive definite { BKinv = HessianMatrix::Identity(); PK = -1 * GradientK; } MReal alpha = (iter==0)? firstStepAlpha : line_searchAlpha(PK, Betas); //Update estimation of beta Betas = Betas + alpha * PK; assert(Betas.allFinite()); // get the sk -> this is Betas_(k+1) - Betas_k PVector SK = alpha * PK; PVector GradientK1; g_function.Gradient(Betas, GradientK1); assert(GradientK1.allFinite()); // get YK -> this is Gradient_(k+1) - Gradient_k PVector YK = GradientK1 - GradientK; PVectorT YKT = YK.transpose(); PVectorT SKT = SK.transpose(); //Update BK MReal YKT_SK = YKT.dot(SK); if (YKT_SK == 0.0f) continue; //Update BKinv MReal SKT_YK = SKT*YK; MReal SKT_YKSQ = SKT_YK* SKT_YK; BKinv = BKinv + ((SKT_YK + (YKT*BKinv)*YK)*(SK*SKT)) / (SKT_YK*SKT_YK) - (((BKinv*YK)*SKT) + ((SK*YKT)*BKinv)) / SKT_YK; } if (iter == MAX_NUM_ITERATIONS) fails++; printf("----------------# %d #---------------\n", test); fprintf(f, "----------------# %d #---------------\n",test); fprintf(f, "iter:%d error: %f\n", iter, (g_function.TestBetas - Betas).norm()); } fprintf(f, "NUMBER OF FAILS: %d", fails); fclose(f); }<file_sep># LeafDetection Check the tutorial out here: http://www.raduangelescu.com/bfgsoptimisation.html
49bd68d84aba114fb67a7e4c0ffd0f0c12d58448
[ "Markdown", "C++" ]
2
Markdown
raduangelescu/LeafDetection
7a9e48e2f7b2cc10f74a3dbbd0f44dd79db9faa6
72f2b7d3cf12daf2290ece1f5f7fe31b33b63160
refs/heads/master
<repo_name>wpatyna/tsp-experiment<file_sep>/main.cpp #include <iostream> #include <vector> #include "src/parsing/Parser.h" #include "src/testing/Benchmark.h" #include <ctime> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> using namespace std; int main(int argc, char const *argv[]) { /* initialize random seed: */ srand (time(NULL)); Parser *parser = new Parser(); vector<string> file_names = { "kroA100.tsp", "kroA150.tsp" }; vector<Problem*> problems; for (int i = 0; i < file_names.size(); i++) { string path = "./resources/tsp/"; path.append(file_names[i]); problems.push_back(parser->load(path)); } Benchmark* benchmark = new Benchmark(); // benchmark->test_heuristics(problems); // benchmark->test_local_search(problems); benchmark->test_iterated_local_search(problems); // benchmark->test_evolutionary(problems); }<file_sep>/src/solvers/heuristics/NNeighbourSolver.h // // Created by wojtek on 10.01.19. // #ifndef TSP_NNEIGHBOURSOLVER_H #define TSP_NNEIGHBOURSOLVER_H #include "../Solver.h" class NNeighbourSolver : public Solver { Solution* solve(Problem&); }; #endif //TSP_NNEIGHBOURSOLVER_H <file_sep>/src/parsing/Metric.h #ifndef METRIC_H #define METRIC_H #include "Node.h" #include <string> using namespace std; class Metric{ private: string type; public: Metric(string&); float get_distance(Node&, Node&); }; #endif<file_sep>/src/solvers/heuristics/NNeighbourCycleSolver.h // // Created by wojtek on 10.01.19. // #ifndef TSP_NNEIGHBOURCYCLESOLVER_H #define TSP_NNEIGHBOURCYCLESOLVER_H #include "../Solver.h" #include "../../Solution.h" class NNeighbourCycleSolver: public Solver { Solution* solve(Problem&); }; #endif //TSP_NNEIGHBOURCYCLESOLVER_H <file_sep>/src/solvers/local-search/LocalSearchHelper.h // // Created by wojtek on 11.01.19. // #ifndef TSP_LOCALSEARCHHELPER_H #define TSP_LOCALSEARCHHELPER_H #include "../../Solution.h" #include "../../Problem.h" class LocalSearchHelper { public: int* compute_solution(int*, Problem&); void compute_solution_inplace(int*, Problem&); private: bool is_the_same_cycle(int, int, int); float compute_cost_symmetric_change(int*, float **, int, int, int); float compute_cost_asymmetric_change(int*, float**, int, int, int); void reverseSequence(int *array, int from, int to); }; #endif //TSP_LOCALSEARCHHELPER_H <file_sep>/src/parsing/Parser.h #ifndef PARSER_H #define PARSER_H #include "Metric.h" #include "Node.h" #include "../Problem.h" #include <iostream> #include <stdlib.h> /* srand, rand */ #include <time.h> /* time */ #include <vector> #include <map> #include <fstream> using namespace std; class Parser{ private: vector<Node*> load_nodes(ifstream &reader); float** get_distace_matrix(vector<Node*>&, Metric&); vector<string> split(string, char); public: Problem* load(string &); }; #endif<file_sep>/src/solvers/evolutionary/EvolutionarySolver.h // // Created by wojtek on 12.01.19. // #ifndef TSP_EVOLUTIONARYSOLVER_H #define TSP_EVOLUTIONARYSOLVER_H #include "../Solver.h" #include "../local-search/LocalSearchHelper.h" #include "../local-search/IteratedLocalSearchSteepestSolver.h" class EvolutionarySolver: public Solver { public: EvolutionarySolver(LocalSearchHelper&, MS); Solution* solve(Problem&); private: LocalSearchHelper *local_search_helper; MS runtime; }; #endif //TSP_EVOLUTIONARYSOLVER_H <file_sep>/src/SolutionInitializer.cpp // // Created by wojtek on 11.01.19. // #include "SolutionInitializer.h" SolutionInitializer::SolutionInitializer(Solver &solver) { this->solver = &solver; } Solution *SolutionInitializer::initialize(Problem &problem) { return this->solver->solve(problem); }<file_sep>/src/SolutionInitializer.h // // Created by wojtek on 11.01.19. // #ifndef TSP_SOLUTIONINITIALIZER_H #define TSP_SOLUTIONINITIALIZER_H #include "solvers/Solver.h" class SolutionInitializer { public: SolutionInitializer(Solver &); virtual Solution *initialize(Problem &problem); private: Solver* solver; }; #endif //TSP_SOLUTIONINITIALIZER_H <file_sep>/src/Solution.h #ifndef SOLUTION_H #define SOLUTION_H #include <string> #include <vector> #include "TSPSolution.h" #include "Problem.h" using namespace std; class Solution{ public: double time; double mean_time; double stdev_time; float score; float initial_score; double effectivencess; double stdev_effectivencess; double mean_effectivencess; double mean_steps_count; double stdev_steps_count; double mean_seen_solutions_count; double stdev_seen_solutions_count; vector<int> entry_solution; int *solution; int size; // TSPSolution tsp_solution; bool compare(Solution&, Problem&); Solution(int, int*/*, float, float, TSPSolution&*/); float getScore(); }; #endif<file_sep>/src/testing/Similarity.cpp // // Created by wojtek on 20.01.19. // #include "Similarity.h" #include <algorithm> #include <iterator> int Similarity::check_cycle(int *solution1, int size1, int *solution2, int size2) { int sum = 0; for (int i = 0; i < size1; i++) { if ( this->is_pair_the_same( solution1[i], solution1[(i + 1) % size1], solution2[i], solution2[(i + 1) % size2] ) || this->is_pair_the_same( solution1[(size1 - i) % size1], solution1[size1 - (i + 1)], solution2[(size2 - i) % size2], solution2[size2 - (i + 1)] ) ) { sum += 1; } } return sum; }; bool Similarity::is_pair_the_same(int s10, int s11, int s20, int s21) { return (s10 == s20 && s11 == s21) || (s10 == s21 && s11 == s20); } float Similarity::similarity(int size, int *s1, int *s2) { int *firstTravellerFirstSequence = new int[size / 2]; std::copy(s1, s1 + size / 2, firstTravellerFirstSequence); int *secondTravellerFirstSequence = new int[size / 2]; std::copy(s1 + size / 2, s1 + size, secondTravellerFirstSequence); int *firstTravellerSecondSequence = new int[size / 2]; std::copy(s2, s2 + size / 2, firstTravellerSecondSequence); int *secondTravellerSecondSequence = new int[size / 2]; std::copy(s2 + size / 2, s2 + size, secondTravellerSecondSequence); return max( this->check_cycle(firstTravellerFirstSequence, size / 2, firstTravellerSecondSequence, size / 2) + this->check_cycle(secondTravellerFirstSequence, size / 2, secondTravellerSecondSequence, size / 2), this->check_cycle(firstTravellerFirstSequence, size / 2, secondTravellerSecondSequence, size / 2) + this->check_cycle(secondTravellerFirstSequence, size / 2, firstTravellerSecondSequence, size / 2) ) / (float)size; } vector<SimilarityPoint> Similarity::get_similarity_points(vector<Solution *> &solutions, Problem &problem) { Solution *best_solution = solutions[0]; for (int i = 0; i < solutions.size(); i++) { best_solution = best_solution->compare(*solutions[i], problem) ? solutions[i] : best_solution; } vector<SimilarityPoint> points; for (int i = 0; i < solutions.size(); i++) { SimilarityPoint similarityPoint = SimilarityPoint(); similarityPoint.similarity = this->similarity(problem.size, solutions[i]->solution, best_solution->solution); similarityPoint.score = problem.cost_of_path(solutions[i]->solution); points.push_back(similarityPoint); } return points; }<file_sep>/src/testing/Benchmark.cpp // // Created by wojtek on 10.01.19. // #include "Benchmark.h" #include "../solvers/RandomSolver.h" #include "../SolutionInitializer.h" #include "../solvers/local-search/LocalSearchSteepestSolver.h" #include "../solvers/heuristics/NNeighbourSolver.h" #include "../solvers/local-search/IteratedLocalSearchSteepestSolver.h" #include "../solvers/evolutionary/EvolutionarySolver.h" #include "Similarity.h" void Benchmark::test_heuristics(vector<Problem *> &problems) { NNeighbourSolver *nn_solver = new NNeighbourSolver(); NNeighbourSolver *nn_cycle_solver = new NNeighbourSolver(); for (int i = 0; i < problems.size(); i++) { BenchmarkResult *nn_result = test(*nn_solver, *problems[i], 10); BenchmarkResult *nn_cycle_result = test(*nn_cycle_solver, *problems[i], 10); } } void Benchmark::test_local_search(vector<Problem *> &problems) { LocalSearchHelper *ls_helper = new LocalSearchHelper(); RandomSolver *random = new RandomSolver(); SolutionInitializer *random_initializer = new SolutionInitializer(*random); LocalSearchSteepestSolver *ls_solver_with_random_input = new LocalSearchSteepestSolver(*random_initializer, *ls_helper); NNeighbourSolver *nn_solver = new NNeighbourSolver(); SolutionInitializer *nn_initializer = new SolutionInitializer(*nn_solver); LocalSearchSteepestSolver *ls_solver_with_heuristic_input = new LocalSearchSteepestSolver(*nn_initializer, *ls_helper); for (int i = 0; i < problems.size(); i++) { BenchmarkResult *result_with_random_input = test(*ls_solver_with_random_input, *problems[i], 10); BenchmarkResult *result_with_heuristic_input = test(*ls_solver_with_heuristic_input, *problems[i], 10); cout << problems[i]->name << ": " << problems[i]->cost_of_path(result_with_random_input->best_solution->solution) << ", " << problems[i]->cost_of_path(result_with_heuristic_input->best_solution->solution) << endl; } } void Benchmark::test_iterated_local_search(vector<Problem *> &problems) { int count_of_ils = 10; LocalSearchHelper *ls_helper = new LocalSearchHelper(); RandomSolver *random = new RandomSolver(); SolutionInitializer *random_initializer = new SolutionInitializer(*random); LocalSearchSteepestSolver *ls_solver_with_random_input = new LocalSearchSteepestSolver(*random_initializer, *ls_helper); IteratedLocalSearchSteepestSolver *ils_solver_with_random_input = nullptr; for (int i = 0; i < problems.size(); i++) { BenchmarkResult *ls_result = test(*ls_solver_with_random_input, *problems[i], 1000); int time_ms = int(ls_result->computation_sec_time * 1000 / count_of_ils); MS runtime(time_ms); ils_solver_with_random_input = new IteratedLocalSearchSteepestSolver(*random_initializer, *ls_helper, runtime); BenchmarkResult *ils_result = test(*ils_solver_with_random_input, *problems[i], count_of_ils); cout << problems[i]->name << ": " << problems[i]->cost_of_path(ls_result->best_solution->solution) << ", " << problems[i]->cost_of_path(ils_result->best_solution->solution) << endl; } } void Benchmark::test_evolutionary(vector<Problem *> &problems) { LocalSearchHelper *ls_helper = new LocalSearchHelper(); RandomSolver *random = new RandomSolver(); SolutionInitializer *random_initializer = new SolutionInitializer(*random); LocalSearchSteepestSolver *ls_solver_with_random_input = new LocalSearchSteepestSolver(*random_initializer, *ls_helper); IteratedLocalSearchSteepestSolver *ils_solver_with_random_input = nullptr; EvolutionarySolver *evolutionarySolver = nullptr; for (int i = 0; i < problems.size(); i++) { BenchmarkResult *ls_result = test(*ls_solver_with_random_input, *problems[i], 100); // int time_ms = int(ls_result->computation_sec_time * 1000); MS runtime(time_ms); // ils_solver_with_random_input = new IteratedLocalSearchSteepestSolver(*random_initializer, *ls_helper, runtime); BenchmarkResult *ils_result = test(*ils_solver_with_random_input, *problems[i], 1); evolutionarySolver = new EvolutionarySolver(*ls_helper, runtime); BenchmarkResult *evolutonary_result = test(*evolutionarySolver, *problems[i], 1); cout << problems[i]->name << ": " << problems[i]->cost_of_path(ls_result->best_solution->solution) << ", " << problems[i]->cost_of_path(ils_result->best_solution->solution) << ", " << problems[i]->cost_of_path(evolutonary_result->best_solution->solution) << endl; } }; BenchmarkResult *Benchmark::test(Solver &solver, Problem &problem, int fire_times) { Similarity* similarity = new Similarity(); int count = 0; struct timespec start, finish; double elapsed = 0; double current_time = 0; vector<Solution *> solutions; Solution *best_solution = nullptr; do { clock_gettime(CLOCK_MONOTONIC, &start); Solution *solution = solver.solve(problem); clock_gettime(CLOCK_MONOTONIC, &finish); count++; current_time = (finish.tv_sec - start.tv_sec); current_time += (finish.tv_nsec - start.tv_nsec) / 1000000000.0; solution->time = current_time; elapsed += (finish.tv_sec - start.tv_sec); elapsed += (finish.tv_nsec - start.tv_nsec) / 1000000000.0; solutions.push_back(solution); if (!best_solution) { best_solution = solution; } else { best_solution = best_solution->compare(*solution, problem) ? solution : best_solution; } // cout << count << endl; } while (count < fire_times); double* times = new double[fire_times]; for (int i=0;i < fire_times; i++){ times[i] = solutions[i]->time; } float* scores = new float[fire_times]; for (int i=0;i < fire_times; i++){ scores[i] = problem.cost_of_path(solutions[i]->solution); } vector<SimilarityPoint> points = similarity->get_similarity_points(solutions, problem); return new BenchmarkResult( *best_solution, solutions, elapsed, times, scores, points ); }<file_sep>/src/Solution.cpp #include "Solution.h" Solution::Solution(int size, int *solution /*, float score, float initial_distance_from_optimum, TSPSolution& tsp_solution*/){ this->solution = solution; this->size = size; // this->score = score; // this->initial_score = initial_distance_from_optimum; // this->tsp_solution = tsp_solution; } bool Solution::compare(Solution &solution2, Problem& problem){ return problem.cost_of_path(this->solution) > problem.cost_of_path(solution2.solution); } float Solution::getScore(){ return this->score; }<file_sep>/src/testing/BenchmarkResult.cpp // // Created by wojtek on 11.01.19. // #include "BenchmarkResult.h" BenchmarkResult::BenchmarkResult(Solution &best_solution, vector<Solution *> &solutions, double computation_sec_time, double* times, float* scores, vector<SimilarityPoint> points) { this->best_solution = &best_solution; this->solutions = &solutions; this->computation_sec_time = computation_sec_time; this->times = times; this->scores = scores; this->similarity_points = points; } <file_sep>/src/solvers/heuristics/NNeighbourCycleSolver.cpp // // Created by wojtek on 10.01.19. // #include <limits> #include "NNeighbourCycleSolver.h" void compute_nn_cycle_path(int *values, Problem &problem, int offset) { int index = rand() % problem.size - offset; swap(values[offset], values[offset + index]); for (int i = offset; i < offset + problem.size / 2 - 1; i++) { float best = numeric_limits<float>::max(); for (int j = i + 1; j < problem.size; j++) { float tmp_dist = problem.distance_matrix[values[offset]][values[j]] + problem.distance_matrix[values[i]][values[j]]; if (tmp_dist < best) { best = tmp_dist; index = j; } } swap(values[i + 1], values[index]); } } Solution *NNeighbourCycleSolver::solve(Problem &problem) { int offset = 0; int *values = new int[problem.size]; for (int i = 0; i < problem.size; i++) { values[i] = i; } compute_nn_cycle_path(values, problem, offset); offset = problem.size / 2; compute_nn_cycle_path(values, problem, offset); return new Solution(problem.size, values); }<file_sep>/src/testing/TestResult.cpp // // Created by wojtek on 13.01.19. // #include "TestResult.h" <file_sep>/src/solvers/Solver.h // // Created by wojtek on 10.01.19. // #ifndef TSP_SOLVER_H #define TSP_SOLVER_H #include "../Solution.h" #include "../Problem.h" class Solver { public: virtual Solution* solve(Problem&) = 0; }; #endif //TSP_SOLVER_H <file_sep>/src/solvers/local-search/LocalSearchSteepestSolver.h // // Created by wojtek on 10.01.19. // #ifndef TSP_LOCALSEARCHGREEDYSOLVER_H #define TSP_LOCALSEARCHGREEDYSOLVER_H #include "../Solver.h" #include "../../SolutionInitializer.h" #include "LocalSearchHelper.h" class LocalSearchSteepestSolver : public Solver { private: SolutionInitializer *solution_initializer; LocalSearchHelper *helper; public: LocalSearchSteepestSolver(SolutionInitializer &, LocalSearchHelper &); Solution *solve(Problem &); }; #endif //TSP_LOCALSEARCHGREEDYSOLVER_H <file_sep>/src/testing/Benchmark.h // // Created by wojtek on 10.01.19. // #ifndef TSP_BENCHMARK_H #define TSP_BENCHMARK_H #include "BenchmarkResult.h" #include "../solvers/Solver.h" class Benchmark { public: BenchmarkResult* test(Solver&, Problem&, int); void test_heuristics(vector<Problem*>&); void test_local_search(vector<Problem*>&); void test_iterated_local_search(vector<Problem *> &); void test_evolutionary(vector<Problem *> &); }; #endif //TSP_BENCHMARK_H <file_sep>/src/testing/Similarity.h // // Created by wojtek on 20.01.19. // #ifndef TSP_SIMILARITY_H #define TSP_SIMILARITY_H #include "../Solution.h" struct SimilarityPoint{ float similarity; float score; }; class Similarity { public: float similarity(int, int*, int*); vector<SimilarityPoint> get_similarity_points(vector<Solution *> &, Problem &); private: bool is_pair_the_same(int, int, int, int); int check_cycle(int*, int, int*, int); }; #endif //TSP_SIMILARITY_H <file_sep>/src/solvers/RandomSolver.h // // Created by wojtek on 11.01.19. // #ifndef TSP_RANDOMSOLVER_H #define TSP_RANDOMSOLVER_H #include "Solver.h" class RandomSolver: public Solver { Solution* solve(Problem&); }; #endif //TSP_RANDOMSOLVER_H <file_sep>/src/Problem.h #ifndef PROBLEM_H #define PROBLEM_H #include <string> #include <vector> using namespace std; class Problem { public: string name; int size; float **distance_matrix; Problem(string &, int, float **); float cost_of_path(int *); // Solution* solve(TSPSolution* (*algorithm)(int*, float**, double, int), double); }; #endif<file_sep>/src/solvers/RandomSolver.cpp // // Created by wojtek on 11.01.19. // #include "RandomSolver.h" Solution* RandomSolver::solve(Problem & problem) { int *solution = new int[problem.size]; for (int i = 0; i < problem.size; i++) { solution[i] = i; } int temp = 0; for (int i = problem.size - 1; i > 0; i--) { /* generate index between 0-i to swap with ith element */ int index = rand() % (i + 1); temp = solution[index]; solution[index] = solution[i]; solution[i] = temp; // swap(solution[index], solution[i]); } return new Solution(problem.size,solution); }<file_sep>/src/parsing/Node.cpp #include "Node.h" Node::Node(int id, float x, float y){ this->id = id; this->x = x; this->y = y; } int Node::getId(){ return this->id; } float Node::getX(){ return this->x; } float Node::getY(){ return this->y; }<file_sep>/src/solvers/evolutionary/process/Selection.h // // Created by wojtek on 12.01.19. // #ifndef TSP_SELECTION_H #define TSP_SELECTION_H class Selection { }; #endif //TSP_SELECTION_H <file_sep>/src/solvers/local-search/IteratedLocalSearchSteepestSolver.h // // Created by wojtek on 10.01.19. // #ifndef TSP_ITERATEDLOCALSEARCHSTEEPESTSOLVER_H #define TSP_ITERATEDLOCALSEARCHSTEEPESTSOLVER_H #include <chrono> #include "../Solver.h" #include "../../SolutionInitializer.h" #include "LocalSearchHelper.h" typedef chrono::system_clock SYS_CLOCK; typedef chrono::milliseconds MS; typedef chrono::time_point<chrono::system_clock> TIME_PT; class IteratedLocalSearchSteepestSolver: public Solver { public: IteratedLocalSearchSteepestSolver(SolutionInitializer&, LocalSearchHelper&, MS); Solution* solve(Problem&); private: SolutionInitializer* solution_initializer; LocalSearchHelper* helper; MS runtime; }; #endif //TSP_ITERATEDLOCALSEARCHSTEEPESTSOLVER_H <file_sep>/src/testing/TestResult.h // // Created by wojtek on 13.01.19. // #ifndef TSP_TESTRESULT_H #define TSP_TESTRESULT_H #include "../Solution.h" class TestResult { public: Solution* solution; }; #endif //TSP_TESTRESULT_H <file_sep>/src/SolutionMetadata.cpp // // Created by wojtek on 10.12.18. // enum SolutionMetadata { FIRST_COST, STEPS_COUNT, SEEN_SOLUTIONS_COUNT };<file_sep>/src/solvers/evolutionary/EvolutionarySolver.cpp // // Created by wojtek on 12.01.19. // #include <limits> #include <bits/stdc++.h> #include "EvolutionarySolver.h" #include "../RandomSolver.h" #include "../../SolutionInitializer.h" struct Strategy{ int* solution; float score; }; Strategy* get_best_solution(vector<int *> &generation, Problem &problem) { Strategy* strategy = new Strategy(); strategy->score = numeric_limits<float>::max(); strategy->solution = nullptr; for (int i = 0; i < generation.size(); i++) { float current = problem.cost_of_path(generation[i]); if (current < strategy->score) { strategy->score = current; strategy->solution = generation[i]; } } return strategy; } void populate(std::vector<int *> &empty_generation, Problem& problem) { RandomSolver randomSolver = RandomSolver(); SolutionInitializer *random_initializer = new SolutionInitializer(randomSolver); for (int i=0; i < empty_generation.size(); i ++){ empty_generation[i] = random_initializer->initialize(problem)->solution; } } void mutate(int *path, int *new_path, int start, int end){ int min, max; do { min = rand() % (end-start); max = rand() % (end-start); } while (min == max); if (min > max) { swap(min, max); } int iter = start; for (int i = start; i < min + start; i++) { new_path[iter] = path[i]; iter++; } for (int i = max + start; i >= min + start; i--) { new_path[iter] = path[i]; iter++; } for (int i = max + 1 + start; i < end; i++) { new_path[iter] = path[i]; iter++; } } int *mutate(int *path, int size) { int *new_path = new int[size]; mutate(path, new_path,0, size/2); mutate(path, new_path,size/2, size); return new_path; } int *crossover(int *parent1, int *parent2, int size) { int *child = new int[size]; unordered_set<int> visited; int iter = 0; for (int i = 0; i < size; i++) { if (visited.find(parent1[i]) == visited.end()) { child[iter] = parent1[i]; visited.insert(parent1[i]); iter++; } if (visited.find(parent2[i]) == visited.end()) { child[iter] = parent2[i]; visited.insert(parent2[i]); iter++; } } return child; } int *tournament_select(std::vector<int *> &generation, Problem &problem) { int pool_size = rand() % ((int) generation.size() - 2) + 2; std::vector<int *> pool; pool.resize((unsigned long) pool_size); for(int i = 0; i < pool.size(); i ++){ pool[i] = generation[random() % generation.size()]; } return get_best_solution(pool, problem)->solution; } void update(std::vector<int *> &generation, int* child, Problem &problem){ int worst_solution_index = 0; float worst_solution_score = 0; for (int i = 0; i < generation.size() ;i++){ float tmp_score = problem.cost_of_path(generation[i]); if (worst_solution_score < tmp_score){ worst_solution_index = i; worst_solution_score = tmp_score; } } if (worst_solution_score > problem.cost_of_path(child)){ generation[worst_solution_index] = child; } }; EvolutionarySolver::EvolutionarySolver(LocalSearchHelper &helper, MS runtime) { this->local_search_helper = &helper; this->runtime = runtime; } Solution *EvolutionarySolver::solve(Problem &problem) { int population_size = int(problem.size * 0.2); std::vector<int *> generation; generation.resize((unsigned long) population_size); populate(generation, problem); TIME_PT end = SYS_CLOCK::now() + runtime; while (SYS_CLOCK::now() < end) { int parent1_id, parent2_id; do { parent1_id = rand() % population_size; parent2_id = rand() % population_size; }while (parent1_id == parent2_id); int *random_parent1 = generation[parent1_id]; int *random_parent2 = generation[parent2_id]; int *child = crossover(random_parent1, random_parent2, problem.size); this->local_search_helper->compute_solution_inplace(child, problem); update(generation,child, problem); // for (int j = 0; j < new_generation.size(); j++) { // int *tournament_parent1 = tournament_select(generation, problem); // int *tournament_parent2 = tournament_select(generation, problem); // // int *tournament_child = crossover(tournament_parent1, tournament_parent2, problem.size); // this->local_search_helper->compute_solution_inplace(tournament_child, problem); // new_generation[j] = tournament_child ; // } // for (int j = 0; j < new_generation.size(); j++) { // double normalized_rand = ((double) rand() / (RAND_MAX)); // if (normalized_rand < 0.3) { // new_generation[j] = mutate(new_generation[j], problem.size); //@TODO change mutate for inplace // this->local_search_helper->compute_solution_inplace(new_generation[j], problem); // } // } // Strategy* generation_best_strategy = get_best_solution(new_generation, problem); // if (generation_best_strategy->score < best_strategy->score){ // best_strategy = generation_best_strategy; // cout << best_strategy->score << endl; // } } Strategy *best_strategy = get_best_solution(generation, problem); return new Solution(problem.size, best_strategy->solution); }<file_sep>/src/parsing/Node.h #ifndef NODE_H #define NODE_H #include <iostream> using namespace std; class Node{ private: int id; float x; float y; public: int getId(); float getX(); float getY(); Node(int, float, float); }; #endif<file_sep>/src/TSPSolution.cpp #include "TSPSolution.h" TSPSolution::TSPSolution(map<SolutionMetadata, float> &metadata) { this->metadata = &metadata; } <file_sep>/src/solvers/local-search/LocalSearchSteepestSolver.cpp // // Created by wojtek on 10.01.19. // #include "LocalSearchSteepestSolver.h" LocalSearchSteepestSolver::LocalSearchSteepestSolver(SolutionInitializer &solution_initializer, LocalSearchHelper &helper){ this->solution_initializer = &solution_initializer; this->helper = &helper; } Solution *LocalSearchSteepestSolver::solve(Problem &problem) { int *solution = this->solution_initializer->initialize(problem)->solution; this->helper->compute_solution_inplace(solution,problem); return new Solution(problem.size, solution); }<file_sep>/src/solvers/evolutionary/process/Selection.cpp // // Created by wojtek on 12.01.19. // #include "Selection.h" <file_sep>/src/solvers/Solver.cpp // // Created by wojtek on 10.01.19. // #include "../Solution.h" class Solver { public: virtual Solution solve() = 0; }; <file_sep>/src/solvers/local-search/IteratedLocalSearchSteepestSolver.cpp // // Created by wojtek on 10.01.19. // #include <random> #include "IteratedLocalSearchSteepestSolver.h" #include "LocalSearchHelper.h" int *perturb(int *tour, int size) { // Create the random number generator int *solution = new int[size]; random_device rd; default_random_engine rng(rd()); int current_index = 0; for (int offset = 0; offset < size; offset += size / 2) { uniform_int_distribution<int> random_offset(1, size / 2 / 4); // Determine random positions int pos1 = random_offset(rng); int pos2 = pos1 + random_offset(rng); int pos3 = pos2 + random_offset(rng); int intervals[4][2] = { {0, pos1}, {pos1, pos2}, {pos2, pos3}, {pos3, size / 2}, }; for (int i = 4 - 1; i >= 0; i--) { int index = rand() % (i + 1); swap(intervals[index], intervals[i]); for (int j = intervals[i][0] + offset; j < intervals[i][1] + offset; j++) { solution[current_index] = tour[j]; current_index++; } } } return solution; } IteratedLocalSearchSteepestSolver::IteratedLocalSearchSteepestSolver(SolutionInitializer &solution_initializer, LocalSearchHelper &helper, MS runtime) { this->solution_initializer = &solution_initializer; this->runtime = runtime; this->helper = &helper; } Solution *IteratedLocalSearchSteepestSolver::solve(Problem &problem) { int *new_solution; int *current_solution = this->solution_initializer->initialize(problem)->solution; float current_solution_score = problem.cost_of_path(current_solution); TIME_PT end = SYS_CLOCK::now() + runtime; while (SYS_CLOCK::now() < end) { new_solution = perturb(current_solution, problem.size); new_solution = this->helper->compute_solution(new_solution, problem); float new_solution_score = problem.cost_of_path(new_solution); if (new_solution_score < current_solution_score) { current_solution = new_solution; current_solution_score = new_solution_score; } } return new Solution(problem.size, current_solution); }<file_sep>/src/Problem.cpp #include <iostream> #include "Problem.h" Problem::Problem(string &name, int size, float **distance_matrix) { this->name = name; this->size = size; this->distance_matrix = distance_matrix; } float Problem::cost_of_path(int *path) { int offset = size / 2; float score = 0; for (int i = 0; i < size / 2; i++) { score += distance_matrix[path[i]][path[(i + 1) % (size / 2)]]; } for (int i = 0; i < size / 2; i++) { score += distance_matrix[path[i + offset]][path[(i + 1) % (size / 2) + offset]]; } return score; } //Solution* Problem::solve(TSPSolution* (*algorithm)(int*, float**, double, int), double min_time){ // int *values = new int[this->size]; // for (int i = 0; i < this->size; i++) // { // values[i] = i; // } // Algorithm::randomTSP(values, this->distance_matrix, min_time, this->size); // float initial_score = 0; // for (int i = 0 ; i < this->size - 1; i++) { // // cout << values.at(i) << endl; // initial_score += this->distance_matrix[values[i]][values[i + 1]]; // } // TSPSolution* tsp_solution = algorithm(values, this->distance_matrix, min_time, this->size); // float score = 0; // for (int i = 0 ; i < this->size; i++){ // // cout << values.at(i) << endl; // score += this->distance_matrix[values[i]][values[(i+1) % size]]; // } // // // return new Solution(this->size, values, score, initial_score, *tsp_solution); //}<file_sep>/src/parsing/Metric.cpp #include "Metric.h" #include <math.h> #define earthRadiusKm 6371.0 Metric::Metric(string& type){ this->type = type; } // This function converts decimal degrees to radians double deg2rad(double deg) { return (deg * M_PI / 180); } // This function converts radians to decimal degrees double rad2deg(double rad) { return (rad * 180 / M_PI); } float Metric::get_distance(Node& node1, Node& node2){ float result = 0; if (this->type.compare("EUC_2D") == 0) { float xd = node1.getX() - node2.getX(); float yd = node1.getY() - node2.getY(); result = sqrt( xd*xd + yd*yd); }else if (this->type.compare("GEO") == 0){ double lat1r, lon1r, lat2r, lon2r, u, v; lat1r = deg2rad(node1.getX()); lon1r = deg2rad(node1.getY()); lat2r = deg2rad(node2.getX()); lon2r = deg2rad(node2.getY()); u = sin((lat2r - lat1r)/2); v = sin((lon2r - lon1r)/2); result = 2.0 * earthRadiusKm * asin(sqrt(u * u + cos(lat1r) * cos(lat2r) * v * v)); } return result; } <file_sep>/src/TSPSolution.h // // Created by wojtek on 10.12.18. // #ifndef TSP_TSPSOLUTION_H #define TSP_TSPSOLUTION_H #include <iostream> #include <map> enum class SolutionMetadata { FIRST_COST, STEPS_COUNT, SEEN_SOLUTIONS_COUNT }; using namespace std; class TSPSolution{ public: TSPSolution(map<SolutionMetadata,float>&); map< SolutionMetadata,float>* metadata; }; #endif //TSP_TSPSOLUTION_H <file_sep>/src/testing/BenchmarkResult.h // // Created by wojtek on 11.01.19. // #ifndef TSP_BENCHMARKRESULT_H #define TSP_BENCHMARKRESULT_H #include "../Solution.h" #include "Similarity.h" class BenchmarkResult { public: Solution* best_solution; vector<Solution*>* solutions; double* times; float* scores; double computation_sec_time; vector<SimilarityPoint> similarity_points; BenchmarkResult(Solution&, vector<Solution*>&, double, double*, float*, vector<SimilarityPoint>); }; #endif //TSP_BENCHMARKRESULT_H <file_sep>/src/solvers/local-search/LocalSearchHelper.cpp // // Created by wojtek on 11.01.19. // #include "LocalSearchHelper.h" bool LocalSearchHelper::is_the_same_cycle(int size, int i, int j) { return (i / (size / 2)) == j / ((size / 2)); } int get_cycled_index(int index, int size) { return ((index % size) + size) % size; } float LocalSearchHelper::compute_cost_symmetric_change(int *array, float **distance_matrix, int i, int j, int size) { int offset = (i / (size / 2)) * size / 2; float delta = 0; delta -= distance_matrix[array[get_cycled_index(i - 1, size / 2) + offset]][array[i]]; delta -= distance_matrix[array[j]][array[get_cycled_index(j + 1, size / 2) + offset]]; delta += distance_matrix[array[get_cycled_index(i - 1, size / 2) + offset]][array[j]]; delta += distance_matrix[array[i]][array[get_cycled_index(j + 1, size / 2) + offset]]; return delta; } float LocalSearchHelper::compute_cost_asymmetric_change(int *array, float **distance_matrix, int i, int j, int size) { int offset = size / 2; float delta = 0; delta -= distance_matrix[array[get_cycled_index(i - 1, size / 2)]][array[i]]; delta -= distance_matrix[array[get_cycled_index(i + 1, size / 2)]][array[i]]; delta += distance_matrix[array[get_cycled_index(i - 1, size / 2)]][array[j]]; delta += distance_matrix[array[get_cycled_index(i + 1, size / 2)]][array[j]]; delta -= distance_matrix[array[j]][array[get_cycled_index(j + 1, size / 2) + offset]]; delta -= distance_matrix[array[j]][array[get_cycled_index(j - 1, size / 2) + offset]]; delta += distance_matrix[array[i]][array[get_cycled_index(j + 1, size / 2) + offset]]; delta += distance_matrix[array[i]][array[get_cycled_index(j - 1, size / 2) + offset]]; return delta; } void LocalSearchHelper::reverseSequence(int *array, int from, int to) { int temp = 0; for (int k = from, l = to; k < l; k++, l--) { temp = array[k]; array[k] = array[l]; array[l] = temp; // swap(array[k], array[l]); } } void LocalSearchHelper::compute_solution_inplace(int *solution, Problem &problem) { bool flag = true; while (flag) { int best_i = 0, best_j = 0; float max_delta = 0; for (int i = 0; i < problem.size - 1; i++) { for (int j = i + 1; j < problem.size; j++) { float delta = 0; if (is_the_same_cycle(problem.size, i, j)) { delta = compute_cost_symmetric_change(solution, problem.distance_matrix, i, j, problem.size); } else { delta = compute_cost_asymmetric_change(solution, problem.distance_matrix, i, j, problem.size); } if (delta < max_delta) { max_delta = delta; best_i = i; best_j = j; } } } // cout << max_delta << endl; if (max_delta < -0.001 ){ if (is_the_same_cycle(problem.size, best_i, best_j)){ reverseSequence(solution, best_i, best_j); }else { swap(solution[best_i], solution[best_j]); } }else{ flag = false; } } } int *LocalSearchHelper::compute_solution(int *solution, Problem &problem) { int *new_solution = new int[problem.size]; copy(solution, solution + problem.size, new_solution); this->compute_solution_inplace(new_solution, problem); return new_solution; }<file_sep>/src/parsing/Parser.cpp #include "Parser.h" #include <map> #include <fstream> #include <string> #include <algorithm> #include <sstream> using namespace std; vector<string> Parser::split(std::string strToSplit, char delimeter) { std::stringstream ss(strToSplit); std::string item; std::vector<std::string> splittedStrings; while (getline(ss, item, delimeter)) { if (!item.empty()) { splittedStrings.push_back(item); } } return splittedStrings; } Problem *Parser::load(string &path) { map<string, string> header; ifstream infile(path); string line; while (getline(infile, line) && line.compare("NODE_COORD_SECTION") != 0) { line.erase(remove(line.begin(), line.end(), ' '), line.end()); vector<string> splited = split(line, ':'); header[splited.at(0)] = splited.at(1); } vector<Node *> nodes = load_nodes(infile); Metric *metric = new Metric(header["EDGE_WEIGHT_TYPE"]); float **distance_matrix = get_distace_matrix(nodes, *metric); int dimension = stoi(header["DIMENSION"]); return new Problem(header["NAME"], dimension, distance_matrix); }; float **Parser::get_distace_matrix(vector<Node *> &nodes, Metric &metric) { // vector<vector<float> > matrix; int size = int(nodes.size()); float **matrix = new float *[size]; for (int i = 0; i < size; i++) { matrix[i] = new float[size]; for (int j = 0; j < size; j++) { if (i != j) { matrix[i][j] = metric.get_distance(*nodes[i], *nodes[j]); } else { matrix[i][j] = numeric_limits<float>::max(); } } } return matrix; } vector<Node *> Parser::load_nodes(ifstream &reader) { string line; vector<Node *> node_list; while (getline(reader, line) && line.compare("EOF") != 0) { vector<string> raw_node = split(line, ' '); Node *node = new Node(stoi(raw_node.at(0)), stof(raw_node.at(1)), stof(raw_node.at(2))); node_list.push_back(node); } return node_list; } <file_sep>/src/solvers/heuristics/NNeighbourSolver.cpp // // Created by wojtek on 10.01.19. // #include <limits> #include "NNeighbourSolver.h" void compute_nn_path(int *values, Problem &problem, int offset){ int index = rand() % problem.size - offset; swap(values[offset],values[offset + index]); for (int i=offset; i < offset + problem.size / 2 - 1; i++){ float best = numeric_limits<float>::max(); for (int j = i + 1; j < problem.size; j++){ float distance = problem.distance_matrix[values[i]][values[j]]; if (distance < best){ best = distance; index = j; } } swap(values[i+1], values[index]); } } Solution* NNeighbourSolver::solve(Problem& problem) { int offset = 0; int *values = new int[problem.size]; for (int i = 0; i < problem.size; i++) { values[i] = i; } compute_nn_path(values, problem, offset); offset = problem.size / 2; compute_nn_path(values, problem, offset); return new Solution(problem.size,values); }
10e5ccc2d8078cec3caa66a4a5726ecb27d313ae
[ "C++" ]
42
C++
wpatyna/tsp-experiment
872077adb9ad6cb306ca2337a7bfbf5c0a9fb0a3
9273e096365ac81c8e8f4d761ac232409ed0ca33
refs/heads/master
<repo_name>crazy9001/mgdb<file_sep>/app1.js // 1. Include Packages const express = require('express'); const bodyParser = require('body-parser'); const mongoose = require('mongoose'); // 2. Include Configuration var config = require('./config'); // 3. Initialize the application const app = express(); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: false})); // 4. Force https in production if (app.get('env') === 'production') { app.use(function(req, res, next) { var protocol = req.get('x-forwarded-proto'); protocol == 'https' ? next() : res.redirect('https://' + req.hostname + req.url); }); } // 5. Connect to MongoDB mongoose.connect(config.MONGO_URI); mongoose.Promise = global.Promise; const db = mongoose.connection; db.on('error', console.error.bind(console, 'MongoDB connection error:')); // 6. Load app routes const product = require('./routes/product.route'); // Imports routes for the products app.use('/products', product); // 7. Start the server app.listen(config.LISTEN_PORT, function(){ console.log('listening on port ' + config.LISTEN_PORT); }); <file_sep>/controllers/product.controller.js const Product = require('../models/product.model'); exports.test = function (req, res) { res.json({"message": "Welcome to EasyNotes application. Take notes quickly. Organize and keep track of all your notes."}); }; exports.product_list = function (req, res) { var pageOptions = { pageId: req.query.page || 0, limit: req.query.limit || 10 }; Product.find() .select(['name', 'price', 'image', 'description', 'createdAt', 'updatedAt']) .skip(pageOptions.pageId*pageOptions.limit) .limit(parseInt(pageOptions.limit)) .sort({ createdAt: 'desc' }) .then(products => { return res.status(200).send({ message: "Success", products: products }); }).catch(err => { res.status(500).send({ message: err.message || "Some error occurred while retrieving product." }); }); }; exports.product_create = function (req, res) { if(!req.body.name) { return res.status(400).send({ message: "Product name can not be empty" }); } if(!req.body.price) { return res.status(400).send({ message: "Price product can not be empty" }); } let product = new Product( { name: req.body.name, price: req.body.price, image: req.body.image, description: req.body.description || 'Description product', } ); product.save() .then(product => { return res.status(200).send({ message: "Save success", product: product }); }).catch(err => { res.status(500).send({ message: err.message || "Some error occurred while creating the product." }); }); }; exports.product_details = function (req, res) { Product.findById(req.params.id) .then(product => { if(!product) { return res.status(404).send({ message: "Product not found" }); } res.send(product); }).catch(err => { if(err.kind === 'ObjectId') { return res.status(404).send({ message: "Note not found" }); } return res.status(500).send({ message: "Error retrieving product" }); }); }; exports.product_update = function (req, res) { Product.findByIdAndUpdate(req.params.id, {$set: req.body}, function (err, product) { if (err) return next(err); res.send('Product udpated.'); }); }; exports.product_delete = function (req, res) { Product.findByIdAndRemove(req.params.id) .then(product => { if(!product) { return res.status(404).send({ message: "Product not found" }); } res.send({message: "Product deleted successfully!"}); }).catch(err => { if(err.kind === 'ObjectId' || err.name === 'NotFound') { return res.status(404).send({ message: "Note not found" }); } return res.status(500).send({ message: "Could not delete product" }); }); };
c3aed2983dc849b39bd9ad45915b796bb8463b5d
[ "JavaScript" ]
2
JavaScript
crazy9001/mgdb
15ff66acec1ebb578a0f39e1ffd26be1b9672e6d
25e987ab8cb23111126704cd1ef11cd7ed9d71c7
refs/heads/master
<file_sep>Bookmarklets ============ ###qr.js:### ####QR Code from URL#### ```javascript:(function(){if(document.getElementById){var x=document.body;var o=document.createElement('script');if(typeof(o)!='object') o=document.standardCreateElement('script');o.setAttribute('src','https://raw.github.com/TheInsomniac/Bookmarklets/master/qr.js');o.setAttribute('type','text/javascript');x.appendChild(o);}})();``` ###asciToUnicode.js:### ####Convert Character to it's Unicode Equivalent#### ```javascript:prompt(%27Your unicode hex code:%27, (prompt(%27Enter a unicode character, please:%27)).charCodeAt(0).toString(16) )%3B``` ###contentEditable.js### ####HTML editor including live preview in the browser#### ```data:text/html,<pre onkeyup="(function(d,t){d[t]('iframe')[0].contentDocument.body.innerHTML = d[t]('pre')[0].textContent;})(document,'getElementsByTagName')" style="width:100%;height:48%;white-space:pre-wrap;overflow:auto;" contenteditable></pre><iframe style="width:100%;height:48%">``` ###jQuerify.js### ####Add jQuery to the currently opened page for easy tinkering#### ```javascript: (function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0];otherlib=false,msg='';el.style.position='fixed';el.style.height='32px';el.style.width='220px';el.style.marginLeft='-110px';el.style.top='0';el.style.left='50%';el.style.padding='5px 10px';el.style.zIndex=1001;el.style.fontSize='12px';el.style.color='#222';el.style.backgroundColor='#f99';if(typeof%20jQuery!='undefined'){msg='This%20page%20already%20using%20jQuery%20v'+jQuery.fn.jquery;return%20showMsg();}else%20if(typeof%20$=='function'){otherlib=true;}%20function%20getScript(url,success){var%20script=document.createElement('script');script.src=url;var%20head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script);}};head.appendChild(script);}%20getScript('http://code.jquery.com/jquery-latest.min.js',function(){if(typeof%20jQuery=='undefined'){msg='Sorry,%20but%20jQuery%20wasn\'t%20able%20to%20load';}else{msg='This%20page%20is%20now%20jQuerified%20with%20v'+jQuery.fn.jquery;if(otherlib){msg+='%20and%20noConflict().%20Use%20$jq(),%20not%20$().';}}%20return%20showMsg();});function%20showMsg(){el.innerHTML=msg;b.appendChild(el);window.setTimeout(function(){if(typeof%20jQuery=='undefined'){b.removeChild(el);}else{jQuery(el).fadeOut('slow',function(){jQuery(this).remove();});if(otherlib){$jq=jQuery.noConflict();}}},2500);}})();```
c774259aefb0bbf62d5e45884fb99cd3deb18fff
[ "Markdown" ]
1
Markdown
TheInsomniac/Bookmarklets
2aed37eae2aafb9420e657374df016ef65ec56f0
7366f59f4785b3416222102aacac068e20e9816a
refs/heads/master
<repo_name>divitha2468/research_paper_bandits<file_sep>/script.py from runtime import * import numpy as np import csv regret_arr = [] regret_ar = [] a = 100 fairness_arr = [] len_fairness = 0 result_fairness = [] temp_fairness = [] fairness_ar = [] result_fairness = [] for i in range(a): # debug = input("print or not/1 or 0") debug = 0 regret_arr, fairness_arr, time = call(debug) regret_ar.append(regret_arr) for i in range(len(fairness_arr)): result_fairness.append(fairness_arr[i]) # print(result_fairness) regret_a = [0]*len(regret_arr) result_f = [[0]*len(fairness_arr[0])for i in range(len(fairness_arr))] for i in range(len(result_fairness)): for j in range(len(fairness_arr[0])): result_f[i % 6][j] += result_fairness[i][j] for j in range(len(result_f)): for i in range(len(result_f[0])): result_f[j][i] = result_f[j][i]/a for i in range(a): for j in range(len(regret_arr)): regret_a[j] += regret_ar[i][j] for i in range(len(regret_arr)): regret_a[i] = regret_a[i]/a #print("regret_avg_array", regret_a) #print("fairness_avg_array", result_f) plt.scatter(time, regret_a) plt.xlabel("Time(Rounds)") plt.ylabel("Time-average regret") plt.ylim(-0.2, 1) plt.show() plt.scatter([math.log(i) for i in time], [math.log(i)for i in regret_a]) plt.ylim(-7.0, 10) plt.xlabel("logT") plt.ylabel("log(Time-average regret)") plt.show() color = ['r.', 'g.', 'b.', 'k.', 'y.', 'm.'] label = ['Arm 1', 'Arm 2', 'Arm 3', 'Arm 4', 'Arm 5', 'Arm 6'] for i in range(6): plt.plot(range(len(result_f[i])), result_f[i], color[i], label=label[i]) plt.ylim(0, 1) plt.xlabel("Rounds") plt.ylabel("Selection fraction") plt.legend(loc='lower right') plt.show() with open("array.csv", 'w')as myarray: wr = csv.writer(myarray, delimiter=",") wr.writerow([result_f]) <file_sep>/runtime.py # This is the common runtime file from agent import agent from environ import environment from tqdm import tqdm import math import matplotlib.pyplot as plt def call(debug): f = open("config.txt", 'r') algo = int(f.readline()) N = int(f.readline()) m = int(f.readline()) actual_mean = [float(i) for i in f.readline().split(',')] availability = [float(i) for i in f.readline().split(',')] fairness = [float(i) for i in f.readline().split(',')] iterations = int(f.readline()) curr_agent = agent(N, m, fairness) curr_env = environment(N, m, availability, actual_mean) print("Actual mean ", actual_mean) print("before running mean = ", curr_agent.mean_reward) regret_array = [] avail_counter = [0]*N arr1 = [] arr2 = [] arr3 = [] arr4 = [] arr5 = [] arr6 = [] counter_after_pause = [0]*N available_after_pause = [0]*N avail_counter_arr = [[] for i in range(N)] pick_counter_arr = [[] for i in range(N)] total_regret = 0 time = [] counter = 0 fairness_arr = [[] for i in range(N)] # print(selection_after_pause) for i in tqdm(range(iterations)): if i > 100 and i < 10000: available_arms = curr_env.available_arms(1) else: available_arms = curr_env.available_arms() for j in available_arms: avail_counter[j] += 1 arms_LFG = curr_agent.pick_arms(available_arms, algo) if i > 10000 and i < 11000: for j in available_arms: available_after_pause[j] += 1 avail_counter_arr[j].append(available_after_pause[j]) for j in arms_LFG: counter_after_pause[j] += 1 pick_counter_arr[j].append(counter_after_pause[j]) arr1.append(counter_after_pause[0]/(i-10000)) arr2.append(counter_after_pause[1]/(i-10000)) arr3.append(counter_after_pause[2]/(i-10000)) arr4.append(counter_after_pause[3]/(i-10000)) arr5.append(counter_after_pause[4]/(i-10000)) arr6.append(counter_after_pause[5]/(i-10000)) for i in range(N): if(available_after_pause[i] != 0): fairness_arr[i].append( counter_after_pause[i]/available_after_pause[i]) else: fairness_arr[i].append(0) (LFG_reward, regret) = curr_env.get_reward(arms_LFG, available_arms) curr_agent.update_mean(LFG_reward) total_regret += regret if((i % 1000 == 0 and i != 0) or (i == 100)): time.append(i) regret_array.append(total_regret/i) #total_regret = 0 print([len(i) for i in avail_counter_arr]) print("counter ", counter) if debug == '1': print("expected selection fraction ", fairness) print("achieved selection fraction ", [ i/iterations for i in curr_env.counter]) print("achieved selection fraction after 10k ", [ counter_after_pause[i]/10000 for i in range(N)]) print("actual selection fraction ", [ curr_env.counter[i]/avail_counter[i] for i in range(N)]) print("after running mean = ", curr_agent.mean_reward) #plt.ylim(-0.01, 0.2) #plt.scatter(time, regret_array) # plt.title("title") # plt.xlabel("Time") # plt.ylabel("Regret") # plt.show() # plt.scatter([math.log(i) for i in time], [math.log(i) # for i in regret_array]) # plt.ylim(-7.0, 10) # plt.xlabel("logT") # plt.ylabel("log(Regret)") # plt.show() count = 0 # print(len(selection_after_pause[0])) color = ['r.', 'g.', 'b.', 'k.', 'y.', 'm.'] # for i in range(N): # plt.plot(range(len(fairness_arr[i])), fairness_arr[i], color[i]) # plt.xlim(0,1000) # plt.show() plt.plot(range(len(arr1)), arr1, 'r.') plt.plot(range(len(arr2)), arr2, 'g.') plt.plot(range(len(arr3)), arr3, 'b.') plt.plot(range(len(arr4)), arr4, 'k.') plt.plot(range(len(arr5)), arr5, 'y.') plt.plot(range(len(arr6)), arr6, 'm.') plt.show() return regret_array, fairness_arr, time print("fairness_ar", result_f) <file_sep>/agent.py import random import math import numpy as np class agent(): def __init__(self, n, m, r): # number of arms self.n = n # max number arms that can be pulled self.m = m # mean reward #self.mean_reward_greedy = [1]*n self.mean_reward = [1]*n self.h = [0]*self.n self.r = r self.Q = [0]*self.n self.d = [0]*self.n self.t = 0 self.w = [1]*self.n self.eta = 1 self.beta_max = 0 self.bandit = 0 self.alpha = [1]*self.n self.beta = [1]*self.n self.availability = [1]*self.n self.iter = 0 def greedy_pick_arms(self, available_arms): greedy_selection = [] mean_list = [] for i in available_arms: mean_list.append((i, self.mean_reward[i])) mean_list = sorted(mean_list, key=lambda x: x[1], reverse=True) for i in range(self.m): if(i >= len(available_arms)): break greedy_selection.append(mean_list[0][0]) del mean_list[0] return greedy_selection def LFG_pick_arms(self, available_arms): local_mean_reward = [0]*self.n for i in range(self.n): if self.h[i] > 0: local_mean_reward[i] = min( self.mean_reward[i]+math.sqrt((3*math.log(self.t))/(2*self.h[i])), 1) else: local_mean_reward[i] = 1 self.Q[i] = max((self.Q[i]+self.r[i]-self.d[i]), 0) super_arm_dict = [] count = 0 for j in available_arms: super_arm_dict.append( (j, self.Q[j]+self.eta*self.w[j]*local_mean_reward[j])) super_arm_dict = sorted( super_arm_dict, key=lambda x: x[1], reverse=True) LFG_selection = [] # print(super_arm_dict) self.d = [0]*self.n for i in range(self.m): if count >= len(available_arms): break LFG_selection.append(super_arm_dict[0][0]) self.d[super_arm_dict[0][0]] = 1 del super_arm_dict[0] count += 1 self.t += 1 return LFG_selection def TS_pick_arms(self, available_arms): beta_distrib_list = [] for i in range(self.n): beta_distrib_list.append( np.random.beta(self.alpha[i], self.beta[i])) available_arms_dict = [] for i in available_arms: available_arms_dict.append( (i, (1/self.eta)*self.Q[i]+self.w[i]*beta_distrib_list[i])) available_arms_dict = sorted( available_arms_dict, key=lambda x: x[1], reverse=True) count = 0 TS_selection = [] for i in range(self.m): if count >= len(available_arms): break TS_selection.append(available_arms_dict[0][0]) self.d[available_arms_dict[0][0]] = 1 del available_arms_dict[0] count += 1 # d_sum = [] # for i in range(self.n): # d_sum[] += d[i] for i in range(self.n): self.Q[i] = max((self.t*self.r[i]-self.h[i]), 0) self.t += 1 return TS_selection def improved_LFG_pick_arms(self, available_arms): local_mean_reward = [0]*self.n self.iter += 1 for i in range(self.n): if self.h[i] > 0: local_mean_reward[i] = min( self.mean_reward[i]+math.sqrt((3*math.log(self.t))/(2*self.h[i])), 1) else: local_mean_reward[i] = 1 super_arm_dict = [] count = 0 for j in available_arms: a = self.r[j] if(self.availability[j]/self.iter > a): a = self.availability[j]/self.iter super_arm_dict.append( (j, (self.Q[j]/a)+self.eta*self.w[j]*local_mean_reward[j])) super_arm_dict = sorted( super_arm_dict, key=lambda x: x[1], reverse=True) LFG_selection = [] # print(super_arm_dict) self.d = [0]*self.n for i in range(self.m): if count >= len(available_arms): break LFG_selection.append(super_arm_dict[0][0]) self.d[super_arm_dict[0][0]] = 1 del super_arm_dict[0] count += 1 self.t += 1 for i in available_arms: self.Q[i] = max((self.Q[i]+(self.r[i]-self.d[i])), 0) for i in range(self.n): if(i in available_arms): self.availability[i] += 1 return LFG_selection def improved_TS_pick_arms(self, available_arms): beta_distrib_list = [] self.iter += 1 for i in range(self.n): if(i in available_arms): self.availability[i] += 1 for i in range(self.n): beta_distrib_list.append( np.random.beta(self.alpha[i], self.beta[i])) available_arms_dict = [] for i in available_arms: a = self.r[i] if(self.availability[i]/self.iter > a): a = self.availability[i]/self.iter available_arms_dict.append( (i, (self.Q[i]/a+self.eta*self.w[i]*beta_distrib_list[i]))) available_arms_dict = sorted( available_arms_dict, key=lambda x: x[1], reverse=True) count = 0 TS_selection = [] h = [0]*self.n for i in range(self.m): if count >= len(available_arms): break TS_selection.append(available_arms_dict[0][0]) h[available_arms_dict[0][0]] = 1 self.d[available_arms_dict[0][0]] = 1 del available_arms_dict[0] count += 1 for i in available_arms: self.Q[i] = max((self.Q[i]+(self.r[i]-self.d[i])), 0) # for i in available_arms: # self.Q[i] = max((self.t*self.r[i]-h[i]), 0) # self.t += 1 return TS_selection def pick_arms(self, available_arms, algo): if algo == 0: return self.greedy_pick_arms(available_arms) elif algo == 1: return self.LFG_pick_arms(available_arms) elif algo == 2: return self.TS_pick_arms(available_arms) elif algo == 3: return self.improved_LFG_pick_arms(available_arms) elif algo == 4: return self.improved_TS_pick_arms(available_arms) def update_mean(self, reward): for i in reward: self.mean_reward[i[0]] = ( self.mean_reward[i[0]]*self.h[i[0]]+i[1])/(self.h[i[0]]+1) self.h[i[0]] += 1 self.alpha[i[0]] += i[1] self.beta[i[0]] += 1-i[1]<file_sep>/environ.py import random class environment(): def __init__(self, k, m, avail, mean_reward): self.k = k # no.of arms self.m = m # maximum arms that can be pulled self.avail = avail # available probability self.mean_reward = mean_reward self.mean_max = mean_reward.index(max(mean_reward)) self.counter = [0]*self.k def available_arms(self, unavail=0): if unavail == 0: return [i for i in range(self.k) if random.random() < self.avail[i]] else: arr = [] for i in range(self.k): if i == self.mean_max: continue if i == 4 or i == 1: continue elif random.random() < self.avail[i]: arr.append(i) return arr def get_reward(self, arms_lfg, available_arms): rewards_sample = {} for i in available_arms: if(random.random() < self.mean_reward[i]): rewards_sample[i] = 1 else: rewards_sample[i] = 0 mean_rewards = [] for i in available_arms: mean_rewards.append((i, self.mean_reward[i])) mean_rewards = sorted(mean_rewards, key=lambda x: x[1], reverse=True) reward_greedy = 0 reward_lfg = 0 reward_array_lfg = [] for i in range(self.m): if(i >= len(available_arms)): break reward_greedy += rewards_sample[mean_rewards[0][0]] del mean_rewards[0] for i in arms_lfg: reward_array_lfg.append((i, rewards_sample[i])) reward_lfg += rewards_sample[i] self.counter[i] += 1 # if(reward_greedy - reward_lfg > 0): # print(reward_greedy - reward_lfg) return(reward_array_lfg, reward_greedy-reward_lfg)
0bf926d012ba1d95dfe206ba34490d51aa669235
[ "Python" ]
4
Python
divitha2468/research_paper_bandits
a502797bb1194fd70b9786d53b081a062e33a15c
2f2bd0692a7b3bb8822df0b01fa2f746101a9445
refs/heads/master
<file_sep># Quizapp1 Its a question app
efd348ecd7d1b6fab6756ad38bf89ceb0792d730
[ "Markdown" ]
1
Markdown
georgemwangi118/Quizapp1
6ab19a299dd25b2c2e6586363e269e1bd2d4659b
5d291164873ab3e8a136f85f3208d70313920ff6
refs/heads/master
<repo_name>themadrussian/osx-bootstrap<file_sep>/Brewfile ## Productive stuff ack httpie wget packer watch htop ## Programming stuff rbenv ruby-build ngrok nvm npm python git git-flow gcc r node ## Shell stuff zsh zsh-completions zsh-syntax-highlighting tmux tmate ## VPN stuff #tuntap #openconnect ## brew cask and more versions of casks caskroom/cask/brew-cask ## Pivotal CF cli #cloudfoundry-cli ## Time-waste stuff #fortune #cowsay #youtube-dl #sl ## Games #homebrew/games/ckan
4c600cbd2e47ef2dab001af66cf8a85c2749c8d3
[ "Ruby" ]
1
Ruby
themadrussian/osx-bootstrap
defea49b10f26de7de988bb045c967d7a2fc0664
178983a5ca689b540093caf05c8b364dbbb74091
refs/heads/master
<repo_name>WinterOrch/RRUTerminalDemo<file_sep>/src/Telnet/Runnable/TelnetWorker.py import sys import time import traceback from PyQt5 import QtCore from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.TelRepository import TelRepository class WorkerSignals(QtCore.QObject): """ Signals available from a running worker thread. """ TRAN_SIGNAL = 0 RECV_SIGNAL = 1 connectionLost = QtCore.pyqtSignal() finished = QtCore.pyqtSignal() error = QtCore.pyqtSignal(tuple) consoleDisplay = QtCore.pyqtSignal(int, str) result = QtCore.pyqtSignal(int, str) class TelnetWorker(QtCore.QRunnable): test_lock = False def __init__(self, case, s_cmd): super(TelnetWorker, self).__init__() self.case = case # Case Flag from RRUCmd.py self.cmd = s_cmd self.result = "" self.signals = WorkerSignals() def run(self) -> None: try: if TelRepository.connection_check(): self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) if self.case == RRUCmd.REBOOT: self.reboot(self.cmd) elif self.case == RRUCmd.VERSION: self.version(self.cmd) elif self.case == RRUCmd.GET_FREQUENCY: self.get_value(self.cmd) elif self.case == RRUCmd.SET_FREQUENCY: self.set_value(self.cmd) elif self.case == RRUCmd.GET_TX_ATTEN: self.get_value(self.cmd) elif self.case == RRUCmd.SET_TX_ATTEN: self.set_value(self.cmd) elif self.case == RRUCmd.GET_RX_GAIN: self.get_value(self.cmd) elif self.case == RRUCmd.SET_RX_GAIN: self.set_value(self.cmd) elif self.case == RRUCmd.GET_TDD_SLOT: self.get_value(self.cmd) elif self.case == RRUCmd.SET_TDD_SLOT: self.set_value(self.cmd) elif self.case == RRUCmd.GET_S_SLOT: self.get_value(self.cmd) elif self.case == RRUCmd.SET_S_SLOT: self.set_value(self.cmd) elif self.case == RRUCmd.GET_UL_OFFSET: self.get_value(self.cmd) elif self.case == RRUCmd.SET_UL_OFFSET: self.set_value(self.cmd) elif self.case == RRUCmd.GET_DL_OFFSET: self.get_value(self.cmd) elif self.case == RRUCmd.SET_DL_OFFSET: self.set_value(self.cmd) elif self.case == RRUCmd.GET_CPRI_STATUS: self.get_cpri(self.cmd) elif self.case == RRUCmd.SET_CPRI: self.set_cpri(self.cmd) elif self.case == RRUCmd.GET_AXI_OFFSET: self.get_value(self.cmd) elif self.case == RRUCmd.SET_AXI_OFFSET: self.get_value(self.cmd) elif self.case == RRUCmd.GET_CPRI_LOOP_MODE: self.get_value(self.cmd) elif self.case == RRUCmd.SET_CPRI_LOOP_MODE: self.set_value(self.cmd) elif self.case == RRUCmd.GET_AXI_REG: self.get_value(self.cmd) elif self.case == RRUCmd.SET_AXI_REG: self.set_value(self.cmd) elif self.case == RRUCmd.GET_IP_ADDR: self.get_value(self.cmd) elif self.case == RRUCmd.SET_IP_ADDR: self.set_value(self.cmd) else: if self.case == RRUCmd.CMD_TYPE_DEBUG: self._debug_test(self.cmd) else: self.signals.connectionLost.emit() except: traceback.print_exc() except_type, value = sys.exc_info()[:2] self.signals.error.emit((except_type, value, traceback.format_exc())) else: self.signals.result.emit(self.case, self.result) finally: self.signals.finished.emit() def reboot(self, cmd): # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) self.result = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(self.result) self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, res_display) def version(self, cmd): pass def _debug_test(self, cmd): while TelnetWorker.test_lock: time.sleep(0.1) TelnetWorker.test_lock = True # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) time.sleep(0.7) self.result = "OK, GOT IT " + cmd self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, self.result) TelnetWorker.test_lock = False def get_value(self, cmd): # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) self.result = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(self.result) self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, res_display) def set_value(self, cmd): # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) self.result = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(self.result) self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, res_display) def get_cpri(self, cmd): # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) self.result = TelRepository.telnet_instance.execute_command(cmd) self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, self.result) def set_cpri(self, cmd): # Execute and send Info to Sim-Console self.signals.consoleDisplay.emit(WorkerSignals.TRAN_SIGNAL, self.cmd) self.result = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(self.result) self.signals.consoleDisplay.emit(WorkerSignals.RECV_SIGNAL, res_display) <file_sep>/src/Telnet/Thread/MonitorThread.py import time from PyQt5 import QtCore from src.Telnet.TelRepository import TelRepository monitorInv = 5 class MonitorThread(QtCore.QThread): sinOut = QtCore.pyqtSignal() def __init__(self): super(MonitorThread, self).__init__() self.working = True def __del__(self): self.working = False def run(self) -> None: while self.working: time.sleep(monitorInv) if TelRepository.telnet_instance.isTelnetLogined: if not TelRepository.connection_check(): self.sinOut.emit() <file_sep>/src/Telnet/Runnable/ConnectionMonitor.py import time from PyQt5 import QtCore from src.Telnet.Config.TelnetConfig import TelnetConfig from src.Telnet.TelRepository import TelRepository class MonitorSignals(QtCore.QObject): """ Signals available from a running monitor thread. """ connectionLost = QtCore.pyqtSignal() class ConnectionMonitor(QtCore.QRunnable): def __init__(self): super(ConnectionMonitor, self).__init__() self.working = True self.signals = MonitorSignals() def __del__(self): self.working = False def run(self) -> None: while self.working: time.sleep(TelnetConfig.MonitorInterval) if TelRepository.telnet_instance.isTelnetLogined: if not TelRepository.connection_check(): self.signals.connectionLost.emit() self.working = False else: self.working = False <file_sep>/src/QtRep/NonQSSStyle.py from PyQt5.QtCore import Qt class NonQSSStyle: displayValueStyle = "color:blue" displayValueTempStyle = "color:red" warningStyle = "height: 22px; background-color:orange;" valueEditStyle = "height: 22px" setButtonBigStyle = "height: 90px" ChangedRowBackgroundInTable = Qt.yellow <file_sep>/src/QtRep/TabWidget/LoginTab.py from PyQt5 import QtWidgets valueEditStyle = "height: 22px" setButtonStyle = "height: 90px" pubSpacing = 10 mainSpacing = 20 class LoginTab: def __init__(self): def __init__(self, parent): super(LoginTab, self).__init__() self.parentWidget = parent self.hostnameLabel = QtWidgets.QLabel("Hostname") self.hostEdit = QtWidgets.QLineEdit() self.hostEdit.setStyleSheet(valueEditStyle) device_manage_layout = QtWidgets.QGridLayout() device_manage_layout.addWidget(self.hostnameLabel, 0, 0) device_manage_layout.addWidget(self.hostEdit, 0, 1) device_manage_layout.setSpacing(pubSpacing) userPwGroup = QtWidgets.QGroupBox("Save if Login Succeeded") userPwGroup.setCheckable(True) userPwGroup.setChecked(True) self.loginButton = QtWidgets.QPushButton("Login") self.loginButton.setStyleSheet(setButtonStyle) self.getTxGainLabel = QtWidgets.QLabel("Username") self.userEdit = QtWidgets.QLineEdit() self.userEdit.setStyleSheet(valueEditStyle) self.getRxGainLabel = QtWidgets.QLabel("Password") self.passwordEdit = QtWidgets.QLineEdit() self.passwordEdit.setStyleSheet(valueEditStyle) self.user_pw_layout = QtWidgets.QGridLayout() self.user_pw_layout.addWidget(self.getTxGainLabel, 0, 0) self.user_pw_layout.addWidget(self.userEdit, 0, 1) self.user_pw_layout.addWidget(self.getRxGainLabel, 1, 0) self.user_pw_layout.addWidget(self.passwordEdit, 1, 1) self.user_pw_layout.setSpacing(pubSpacing) self.vLineFrame = QtWidgets.QFrame() self.vLineFrame.setFrameStyle(QtWidgets.QFrame.VLine | QtWidgets.QFrame.Sunken) deviceLayout = QtWidgets.QGridLayout() deviceLayout.addLayout(self.user_pw_layout, 0, 0) deviceLayout.addWidget(self.vLineFrame, 0, 1) deviceLayout.addWidget(self.loginButton, 0, 2) userPwGroup.setLayout(deviceLayout) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addLayout(device_manage_layout) mainLayout.addWidget(userPwGroup) mainLayout.setContentsMargins(5, 5, 5, 5) mainLayout.setSpacing(mainSpacing) self.setLayout(mainLayout) <file_sep>/src/QtRep/TerminalWidget.py from PyQt5 import QtWidgets from PyQt5.QtWidgets import QPushButton, QVBoxLayout from src.QtRep.TerminalEdit import TerminalEdit class TerminalWidget(QtWidgets.QWidget): def __init__(self): super(TerminalWidget, self).__init__() with open('../Qss/TerminalEditQSS.qss', 'r') as file: str = file.readlines() str = ''.join(str).strip('\n') self.setStyleSheet(str) self._setup_ui() def _setup_ui(self): self.textEdit = TerminalEdit() self.buttonText = QPushButton('Clear') layout = QVBoxLayout() layout.addWidget(self.textEdit) layout.addWidget(self.buttonText) self.setLayout(layout) self.buttonText.clicked.connect(self.onclick_clear_text) def onclick_clear_text(self): self.textEdit.all_clear() def show_response(self, connect): self.textEdit.flush_response(connect) <file_sep>/src/QtRep/Component/ValueLabel.py from PyQt5 import QtWidgets from PyQt5 import QtCore from PyQt5 import QtGui class ValueLabel(QtWidgets.QLabel): refreshSig = QtCore.pyqtSignal(int) def __init__(self, txt, cmd): super().__init__(txt) self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.customContextMenuRequested.connect(self.pop_context_menu) self.cmd = cmd def pop_context_menu(self, pos): menu = QtWidgets.QMenu(self) menu.addAction(QtWidgets.QAction('Refresh', menu)) menu.triggered.connect(self.action_slot) menu.exec_(QtGui.QCursor.pos()) def action_slot(self, act): self.refreshSig.emit(self.cmd) def mousePressEvent(self, ev: QtGui.QMouseEvent) -> None: if ev.button() == QtCore.Qt.LeftButton: self.refreshSig.emit(self.cmd) <file_sep>/src/QtRep/TabWidget/AxiRegTab.py import typing from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSignal, QModelIndex, Qt, QVariant, QThreadPool from PyQt5 import QtCore from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QApplication from src.QtRep.NonQSSStyle import NonQSSStyle from src.Telnet import JsonRep from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.Runnable.TelnetWorker import WorkerSignals, TelnetWorker from src.Tool.ValidCheck import ValidCheck valueEditStyle = "height: 22px" setButtonStyle = "width: 30px; height: 90px" buttonWidth = 80 pubSpacing = 10 mainSpacing = 20 TEST = False class AxiRegTab(QtWidgets.QWidget): deviceTranSignal = pyqtSignal(str) deviceRvdSignal = pyqtSignal(str) warningSignal = pyqtSignal(str) connectionOutSignal = pyqtSignal() def __init__(self, parent): super(AxiRegTab, self).__init__() self.parentWidget = parent self._setup_ui() self._add_signal() self.set_cmd_pool = [] self.refresh_cmd_pool = [] self._init_cmd() def _setup_ui(self): if TEST: self.dataMap = { "header": ['Addr', 'Reg Value'], "data": [['0x40000002', '0x00000002'], ['0x40000003', '0x00000002'], ['0x40000004', '0x00000002'], ['0x40000005', '0x00000002'], ['0x40000006', '0x00000002'], ['0x40000007', '0x00000002']] } else: self.dataMap = { "header": ['Addr', 'Reg Value'], "data": [] } self.regModel = AxiEditModel(self.dataMap.get('data'), self.dataMap.get('header')) self.axiTableView = QtWidgets.QTableView() self.axiTableView.setModel(self.regModel) self.axiTableView.verticalHeader().hide() self.axiTableView.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) ''' icon_add = QtGui.QIcon() icon_add.addPixmap(QtGui.QPixmap('../../Icon/add.jpg')) icon_del = QtGui.QIcon() icon_del.addPixmap(QtGui.QPixmap('../../Icon/del.jpg')) icon_push = QtGui.QIcon() icon_push.addPixmap(QtGui.QPixmap('../../Icon/push.jpg')) icon_get = QtGui.QIcon() icon_get.addPixmap(QtGui.QPixmap('../../Icon/get.jpg.jpg')) ''' self.addButton = QtWidgets.QPushButton("ADD") self.addButton.setFlat(True) self.refreshButton = QtWidgets.QPushButton("REFRESH") self.refreshButton.setFlat(True) self.sendButton = QtWidgets.QPushButton("SEND") self.sendButton.setFlat(True) self.delButton = QtWidgets.QPushButton("DELETE") self.delButton.setFlat(True) self.buttonLayout = QtWidgets.QGridLayout() self.buttonLayout.addWidget(self.addButton, 0, 0) self.buttonLayout.addWidget(self.sendButton, 0, 1) self.buttonLayout.addWidget(self.delButton, 0, 2) self.buttonLayout.addWidget(self.refreshButton, 0, 3) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(self.axiTableView) mainLayout.addLayout(self.buttonLayout) mainLayout.addSpacing(pubSpacing) self.setLayout(mainLayout) def _add_signal(self): self.addButton.clicked.connect(self._add_axi) self.sendButton.clicked.connect(self._send_change) self.delButton.clicked.connect(self._del_row) if not TEST: self.refreshButton.clicked.connect(self.refresh_axi) else: self.refreshButton.clicked.connect(self.test) self.regModel.sigSendConfig.connect(self._store_change) self.regModel.sigWarning.connect(self.warning) self.refreshButton.clicked.connect(self.regModel.resort) def _init_cmd(self): self.set_cmd_pool.clear() self.regModel.addr_in_change.clear() self.sendButton.setEnabled(False) def _console_slot(self, case, msg): if case == WorkerSignals.TRAN_SIGNAL: self.deviceTranSignal.emit(msg) elif case == WorkerSignals.RECV_SIGNAL: self.deviceRvdSignal.emit(msg) def slot_connection_out_signal(self): self.connectionOutSignal.emit() @staticmethod def info(info): msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Info') msgBox.setIcon(QtWidgets.QMessageBox.Information) msgBox.setText(info) msgBox.exec() def warning(self, info): self.warningSignal.emit(info) def turn(self, switch, initialized=False): self._init_cmd() self.addButton.setEnabled(switch) self.delButton.setEnabled(switch) self.refreshButton.setEnabled(switch) if not switch: if not initialized: if 0 != len(self.regModel.axi_data): self.json_save() else: self.json_save() self.regModel.clear() else: self.regModel.clear() self.json_read() def json_read(self): json_data = JsonRep.AxiJson.read_axi() for ele in json_data: self.regModel.append_data([ele[JsonRep.AxiJson.AXI_ADDR], ele[JsonRep.AxiJson.AXI_REG]]) def json_save(self): json_data = [] for ele in self.regModel.axi_data: json_data.append({JsonRep.AxiJson.AXI_ADDR: take_addr(ele), JsonRep.AxiJson.AXI_REG: take_value(ele)}) JsonRep.AxiJson.save_axi(json_data) def test(self): """ self.regModel.addr_in_change.append('0x40000006') test_1 = "read axi reg 0x400000c0:0x00000005" self.get_resp_handler(RRUCmd.GET_AXI_REG, test_1) test_2 = "read axi reg 0x400000c4:0x00000006" self.get_resp_handler(RRUCmd.GET_AXI_REG, test_2) """ self.json_read() def _del_row(self): r = self.axiTableView.currentIndex().row() self.regModel.remove_row(r) def _store_change(self, change: list): addr = take_addr(change) i = 0 new_addr = True while i < len(self.set_cmd_pool): if take_addr(self.set_cmd_pool[i]) == addr: self.set_cmd_pool[i][1] = take_value(change) new_addr = False break else: i += 1 if new_addr: self.set_cmd_pool.append(change) self.sendButton.setEnabled(True) def _send_change(self): if len(self.set_cmd_pool) != 0: cmd = RRUCmd.set_axis_reg(self.parentWidget.get_option(), self.set_cmd_pool.pop(0)[1]) print("Generate CMD: " + cmd) thread = TelnetWorker(RRUCmd.SET_AXI_REG, cmd) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.result.connect(self.set_resp_handler) thread.signals.consoleDisplay.connect(self._console_slot) QThreadPool.globalInstance().start(thread) else: self.sendButton.setEnabled(False) def set_resp_handler(self, case, resp: str): if case == RRUCmd.SET_AXI_REG: if RespFilter.resp_check(resp): match = RespFilter.axi_read_filter(resp) if match is not None: res = match.group().split(":") addr = res[0] reg = res[1] n_addr = int(addr, 16) n_reg = int(reg, 16) found = False if addr in self.regModel.addr_in_change: self.regModel.addr_in_change.remove(addr) i = 0 while i < len(self.regModel.axi_data): if int(take_addr(self.regModel.axi_data[i]), 16) == n_addr: if not found: found = True if int(take_value(self.regModel.axi_data[i]), 16) == n_reg: self.info("内存 {addr} 成功写入为 {reg}".format(addr=addr, reg=reg)) else: self.regModel.change_value(i, reg) self.info( "内存 {addr} 未成功写入, 当前值为 {reg}".format(addr=addr, reg=reg)) else: self.regModel.remove_row(i) i += 1 if not found: self.regModel.append_data([addr, reg]) self.info("RegAddr {addr} Written Finished, Now Read as {reg}".format(addr=addr, reg=reg)) else: self.info("Axi Reg Config Complete But Value Cannot Be Read.") else: self.warning("Axi Reg Config Failed!") self._send_change() def _add_axi(self): addr, okPressed = QtWidgets.QInputDialog.getText(self, "Get Addr", "Axi Offset Addr:", QtWidgets.QLineEdit.Normal, "") match = ValidCheck.filter(ValidCheck.HEX_RE, addr) if okPressed and match is not None: cmd = RRUCmd.get_axis_reg(self.parentWidget.get_option(), match.group()) thread = TelnetWorker(RRUCmd.GET_AXI_REG, cmd) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.result.connect(self.get_resp_handler) thread.signals.consoleDisplay.connect(self._console_slot) QThreadPool.globalInstance().start(thread) elif okPressed and match is None: self.warning("Invalid Offset Address") def get_resp_handler(self, case, resp: str): if case == RRUCmd.GET_AXI_REG: if RespFilter.resp_check(resp): match = RespFilter.axi_read_filter(resp) if match is not None: res = match.group().split(":") addr = res[0] reg = res[1] if addr in self.regModel.addr_in_change: self.regModel.addr_in_change.remove(addr) i = 0 new_addr = True while i < len(self.regModel.axi_data): if take_addr(self.regModel.axi_data[i]) == addr: self.regModel.change_value(i, reg) new_addr = False break else: i += 1 if new_addr: self.regModel.append_data([addr, reg]) else: self.warning("Axi Reg cannot be read properly") self._pop_and_refresh() def refresh_axi(self): self.sendButton.setEnabled(False) self.set_cmd_pool.clear() self.regModel.addr_in_change.clear() self.regModel.resort() for ele in self.regModel.axi_data: self.refresh_cmd_pool.append(RRUCmd.get_axis_reg( self.parentWidget.get_option(), ValidCheck.addr_transfer(take_addr(ele), RRUCmd.SET_AXI_REG))) self.regModel.clear() self._pop_and_refresh() def _pop_and_refresh(self): if len(self.refresh_cmd_pool) != 0: cmd = self.refresh_cmd_pool.pop(0) thread = TelnetWorker(RRUCmd.GET_AXI_REG, cmd) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.result.connect(self.get_resp_handler) thread.signals.consoleDisplay.connect(self._console_slot) QThreadPool.globalInstance().start(thread) class AxiEditModel(QtCore.QAbstractTableModel): sigSendConfig = pyqtSignal(list) sigWarning = pyqtSignal(str) addr_in_change = [] dataCount = 0 editStart = False def __init__(self, data: list, header): super(AxiEditModel, self).__init__() self.axi_data = data self.header = header def clear(self): for i in range(self.rowCount()): self.remove_row(self.rowCount() - 1) def append_data(self, x): self.axi_data.append(x) self.layoutChanged.emit() def change_value(self, idx, s_value): self.axi_data[idx][1] = s_value self.layoutChanged.emit() def remove_row(self, row): if len(self.axi_data) != 0: self.axi_data.pop(row) self.layoutChanged.emit() def rowCount(self, parent=None, *args, **kwargs): return len(self.axi_data) def columnCount(self, parent=None, *args, **kwargs): if len(self.axi_data) > 0: return len(self.axi_data[0]) return 0 def fetch_data(self, index: QModelIndex): return self.axi_data[index.row()][index.column()] def data(self, index: QModelIndex, role=Qt.DisplayRole): if TEST: ''' print("data!" + str(self.dataCount)) self.dataCount += 1 print(role) ''' if role == Qt.EditRole: print('yeah') self.editStart = not self.editStart if self.editStart: print(role) if not index.isValid(): print("行或者列有问题") return QVariant() elif role != Qt.DisplayRole: if role == Qt.TextAlignmentRole: return Qt.AlignCenter elif role == Qt.BackgroundRole and take_addr(self.axi_data[index.row()]) in self.addr_in_change: return QColor(NonQSSStyle.ChangedRowBackgroundInTable) elif role == Qt.EditRole: # TODO 目前找不到修改表格编辑器内容的方法,因此将内容复制到剪切板先 clipboard = QApplication.clipboard() clipboard.setText(self.axi_data[index.row()][index.column()]) return QVariant() else: return QVariant() return QVariant(self.axi_data[index.row()][index.column()]) def headerData(self, section, orientation, role=Qt.DisplayRole): if role == Qt.DisplayRole and orientation == Qt.Horizontal: return self.header[section] return QtCore.QAbstractTableModel.headerData(self, section, orientation, role) def setData(self, index: QModelIndex, value: typing.Any, role: int = ...) -> bool: print("set data!") if role == Qt.EditRole: if index.column() == 1: if value != self.axi_data[index.row()][index.column()] \ and ValidCheck.filter(ValidCheck.HEX_RE, value) is not None: value = ValidCheck.reg_format(value) print("Origin:" + self.axi_data[index.row()][index.column()] + " to " + value + " Changed and valid") self.axi_data[index.row()][index.column()] = value self.dataChanged.emit(QtCore.QModelIndex(), QtCore.QModelIndex()) self.addr_in_change.append(take_addr(self.axi_data[index.row()])) self.sigSendConfig.emit([take_addr(self.axi_data[index.row()]), RRUCmd.change( ValidCheck.addr_transfer(self.axi_data[index.row()][0], RRUCmd.SET_AXI_REG), value)]) elif ValidCheck.filter(ValidCheck.HEX_RE, value) is None: self.sigWarning.emit("Input Should be in HEX format!") return False def flags(self, index: QModelIndex) -> Qt.ItemFlags: return Qt.ItemIsSelectable | Qt.ItemIsEditable | Qt.ItemIsEnabled def resort(self): self.axi_data.sort(key=take_addr) self.axi_data = remove_duplicated(self.axi_data) self.layoutChanged.emit() def take_addr(lis): return lis[0] def take_value(lis): return lis[1] def remove_duplicated(lis): resultList = [] for item in lis: flag = True for it in resultList: if take_addr(it) == take_addr(item): flag = False break if flag: resultList.append(item) return resultList <file_sep>/src/Telnet/TelRepository.py from src.Telnet.Telnet import Telnet class TelRepository: telnet_instance = Telnet() @staticmethod def connection_check(): if TelRepository.telnet_instance.isTelnetLogined: if TelRepository.telnet_instance.tap(): return True else: TelRepository.telnet_instance.terminate() return False else: return False <file_sep>/src/Telnet/JsonRep.py import json from src.Telnet.Telnet import Telnet def save_by_json(data_in_json): _write_json(Telnet.json_filename, data_in_json) def read_json(file_name): with open('../JSON/' + file_name + '.json', 'r') as f: return json.load(f) def _write_json(file_name, data): with open('../JSON/' + file_name + '.json', 'w') as f: json.dump(data, f) def login_by_json(self): data_in_json = read_json(self.json_filename) return self.login(data_in_json['host_ip'], data_in_json['username'], data_in_json['password']) class AxiJson: FILENAME = "AXI" AXI_ADDR = "ADDR" AXI_REG = "REG" @staticmethod def save_axi(data_in_json): _write_json(AxiJson.FILENAME, data_in_json) @staticmethod def read_axi(): try: return read_json(AxiJson.FILENAME) except: return [] <file_sep>/src/QtRep/OperateWidget.py import logging from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSignal, QThreadPool from src.QtRep.TabWidget.AxiRegTab import AxiRegTab from src.QtRep.TabWidget.OffsetTab import OffsetTab from src.QtRep.TerminalEdit import TerminalEdit from src.QtRep.TabWidget.DeviceTab import DeviceTab from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.Runnable.TelnetWorker import TelnetWorker, WorkerSignals from src.Telnet.TelRepository import TelRepository mainSpacing = 2 TEST = False class OperateWidget(QtWidgets.QWidget): operateSignal = pyqtSignal(str) connectionOutSignal = pyqtSignal() option = 0 def __init__(self): super(OperateWidget, self).__init__() with open('../Qss/OperatorQSS.qss', 'r') as f: self.list_style = f.read() '''MANAGE PANE''' device_manage_layout = QtWidgets.QGridLayout() self.optionLabel = QtWidgets.QLabel("Ant Num") self.optionComboBox = QtWidgets.QComboBox() for i in range(RRUCmd.ant_num[OperateWidget.option]): self.optionComboBox.addItem(str(i)) self.versionEdit = QtWidgets.QLineEdit() self.versionEdit.setEnabled(False) self.refreshButton = QtWidgets.QPushButton("Version") self.refreshButton.setDisabled(True) self.rebootButton = QtWidgets.QPushButton("Reboot") self.rebootButton.setDisabled(True) device_manage_layout.addWidget(self.optionLabel, 0, 0) device_manage_layout.addWidget(self.optionComboBox, 0, 1) device_manage_layout.addWidget(self.versionEdit, 0, 2) device_manage_layout.addWidget(self.refreshButton, 0, 4) device_manage_layout.addWidget(self.rebootButton, 0, 5) device_manage_layout.setContentsMargins(7, 7, 7, 7) '''END OF MANAGE PANE''' self.setStyleSheet(self.list_style) tab_widget = QtWidgets.QTabWidget() self.device_setting = DeviceTab(self) self.device_setting.setDisabled(not TEST) self.offset_setting = OffsetTab(self) self.offset_setting.setDisabled(not TEST) self.axi_reg_setting = AxiRegTab(self) self.axi_reg_setting.turn(TEST) # TODO False if not for DEBUG tab_widget.addTab(self.device_setting, "Device") tab_widget.addTab(self.offset_setting, "Offset") tab_widget.addTab(self.axi_reg_setting, "Axi Reg") self.browser = TerminalEdit() self.saveButton = QtWidgets.QPushButton("Save") self.saveButton.setFlat(True) self.delButton = QtWidgets.QPushButton("Clear") self.delButton.setFlat(True) self.browserButtonLayout = QtWidgets.QGridLayout() self.browserButtonLayout.addWidget(self.saveButton, 0, 0) self.browserButtonLayout.addWidget(self.delButton, 0, 2) self.delButton.clicked.connect(self.browser.all_clear) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addLayout(device_manage_layout) mainLayout.addWidget(tab_widget) mainLayout.addWidget(self.browser) mainLayout.addLayout(self.browserButtonLayout) mainLayout.setContentsMargins(1, 1, 1, 1) mainLayout.setSpacing(mainSpacing) self.setLayout(mainLayout) '''Slot''' self.optionComboBox.currentIndexChanged.connect(self.refresh_ant_num) self.rebootButton.clicked.connect(self.reboot) self.refreshButton.clicked.connect(self.refresh_version) self.device_setting.deviceRvdSignal.connect(self.emit_rvd_signal) self.device_setting.deviceTranSignal.connect(self.emit_trans_signal) self.offset_setting.deviceRvdSignal.connect(self.emit_rvd_signal) self.offset_setting.deviceTranSignal.connect(self.emit_trans_signal) self.axi_reg_setting.deviceRvdSignal.connect(self.emit_rvd_signal) self.axi_reg_setting.deviceTranSignal.connect(self.emit_trans_signal) self.device_setting.warningSignal.connect(self.send_warning) self.offset_setting.warningSignal.connect(self.send_warning) self.axi_reg_setting.warningSignal.connect(self.send_warning) self.device_setting.connectionOutSignal.connect(self.slot_connection_out_signal) self.offset_setting.connectionOutSignal.connect(self.slot_connection_out_signal) self.axi_reg_setting.connectionOutSignal.connect(self.slot_connection_out_signal) self.saveButton.clicked.connect(self.test) self.set_logger() @staticmethod def set_logger(): logging.basicConfig(filename='../log/' + __name__ + '.log', format='[%(asctime)s-%(filename)s-%(funcName)s-%(levelname)s:%(message)s]', level=logging.DEBUG, filemode='a', datefmt='%Y-%m-%d %I:%M:%S %p') def refresh_version(self): cmd = RRUCmd.get_version() self.emit_trans_signal(cmd) res = TelRepository.telnet_instance.execute_command(cmd) self.emit_rvd_signal(res) self.versionEdit.setText(res) def reboot(self): if self.warning("是否进行设备复位?"): cmd = RRUCmd.reboot(self.get_option()) self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.REBOOT, cmd) def _process_cmd(self, cmd_type: int, cmd_case: int, cmd: str): thread = TelnetWorker(cmd_case, cmd) thread.signals.consoleDisplay.connect(self._console_slot) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.error.connect(self.log_error) if cmd_type == RRUCmd.CMD_TYPE_GET: thread.signals.result.connect(self.get_resp_handler) elif cmd_type == RRUCmd.CMD_TYPE_SET: thread.signals.result.connect(self.set_resp_handler) QThreadPool.globalInstance().start(thread) def get_resp_handler(self, case, resp: str): pass def set_resp_handler(self, case, resp: str): if case == RRUCmd.REBOOT: if not RespFilter.resp_check(resp): self.warning("Frequency cannot be set properly") else: if self.warning("Reboot Finished, Press YES to Refresh All Value"): self.set_connected(True) def _console_slot(self, case, msg): if case == WorkerSignals.TRAN_SIGNAL: self.emit_trans_signal(msg) elif case == WorkerSignals.RECV_SIGNAL: self.emit_rvd_signal(msg) @staticmethod def log_error(t_error: tuple): s_error = "" for i in t_error: s_error += str(i) + " " logging.error(s_error) @staticmethod def warning(info): msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('Information') msgBox.setInformativeText(info) msgBox.addButton('Yes', QtWidgets.QMessageBox.AcceptRole) no = msgBox.addButton('No', QtWidgets.QMessageBox.RejectRole) msgBox.setDefaultButton(no) reply = msgBox.exec() if reply == QtWidgets.QMessageBox.AcceptRole: return True else: return False def test(self): self.set_connected(True) def send_warning(self, connect): self.warning(connect) def emit_rvd_signal(self, connect): self.browser.flush_response(connect) self.operateSignal.emit(connect) def emit_trans_signal(self, connect): self.operateSignal.emit(connect) def set_connected(self, connect): self.refreshButton.setEnabled(connect) self.rebootButton.setEnabled(connect) self.device_setting.setEnabled(connect) self.offset_setting.setEnabled(connect) self.axi_reg_setting.turn(connect, True) self.device_setting.refresh_all(connect) self.offset_setting.refresh_all(connect) @staticmethod def get_option(): return RRUCmd.cmd_type_str[OperateWidget.option] def get_ant_num(self): return self.optionComboBox.currentText() def set_option(self, connect): OperateWidget.option = connect self.device_setting.freqEdit.setPlaceholderText(self.device_setting.freqEditTip[connect]) self.optionComboBox.disconnect() self.optionComboBox.clear() for i in range(RRUCmd.ant_num[OperateWidget.option]): self.optionComboBox.addItem(str(i)) self.optionComboBox.currentIndexChanged.connect(self.refresh_ant_num) def slot_connection_out_signal(self): self.connectionOutSignal.emit() def refresh_ant_num(self): self.device_setting.antenna_index = self.optionComboBox.currentIndex() self.offset_setting.antenna_index = self.optionComboBox.currentIndex() self.device_setting.refresh_ant_num() self.offset_setting.refresh_ant_num() <file_sep>/src/QtRep/LoginWidget.py import os import logging from PyQt5.QtCore import pyqtSignal, QThreadPool from PyQt5.QtWidgets import QWidget from src.QtRep.NonQSSStyle import NonQSSStyle from src.Telnet import JsonRep from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.Runnable.ConnectionMonitor import ConnectionMonitor from src.Telnet.Runnable.TelnetWorker import TelnetWorker, WorkerSignals from src.Telnet.TelRepository import TelRepository from src.Telnet.Telnet import Telnet from PyQt5 import QtWidgets from src.Tool.ValidCheck import ValidCheck valueEditStyle = "height: 22px" setButtonStyle = "height: 90px" pubSpacing = 10 mainSpacing = 2 class LoginWidget(QWidget): sinOption = pyqtSignal(int) loginSignal = pyqtSignal(bool) loginWarningSignal = pyqtSignal(str) ipTranSignal = pyqtSignal(str) ipRecvSignal = pyqtSignal(str) def __init__(self, parent): self.isTelnetLogined = False super(LoginWidget, self).__init__() self.parentWindow = parent with open('../Qss/OperatorQSS.qss', 'r') as f: self.list_style = f.read() self.setStyleSheet(self.list_style) self._setup_ui() self._add_signal() self._check_json() self._set_logger() # self.ip_config_widget.setDisabled(True) def _setup_ui(self): self.hostnameLabel = QtWidgets.QLabel("Hostname") self.hostEdit = QtWidgets.QLineEdit() self.hostEdit.setStyleSheet(valueEditStyle) self.saveCheckBox = QtWidgets.QCheckBox("Save ") self.saveCheckBox.setChecked(True) device_manage_layout = QtWidgets.QGridLayout() device_manage_layout.addWidget(self.hostnameLabel, 0, 0) device_manage_layout.addWidget(self.hostEdit, 0, 1) device_manage_layout.addWidget(self.saveCheckBox, 0, 3) device_manage_layout.setSpacing(pubSpacing) userPwGroup = QtWidgets.QGroupBox() self.loginButton = QtWidgets.QPushButton("Login") self.loginButton.setStyleSheet(setButtonStyle) self.getTxGainLabel = QtWidgets.QLabel("Username") self.userEdit = QtWidgets.QLineEdit() self.userEdit.setStyleSheet(valueEditStyle) self.optionComboBox = QtWidgets.QComboBox() for i in range(len(RRUCmd.cmd_type_str)): self.optionComboBox.addItem(RRUCmd.cmd_type_str[i]) self.getRxGainLabel = QtWidgets.QLabel("Password") self.passwordEdit = QtWidgets.QLineEdit() self.passwordEdit.setStyleSheet(valueEditStyle) self.passwordEdit.setEchoMode(QtWidgets.QLineEdit.Password) self.user_pw_layout = QtWidgets.QGridLayout() self.user_pw_layout.addWidget(self.getTxGainLabel, 0, 0) self.user_pw_layout.addWidget(self.userEdit, 0, 1) self.user_pw_layout.addWidget(self.optionComboBox, 0, 3) self.user_pw_layout.addWidget(self.getRxGainLabel, 1, 0) self.user_pw_layout.addWidget(self.passwordEdit, 1, 1, 1, 3) self.user_pw_layout.setSpacing(pubSpacing) self.vLineFrame = QtWidgets.QFrame() self.vLineFrame.setFrameStyle(QtWidgets.QFrame.VLine | QtWidgets.QFrame.Sunken) deviceLayout = QtWidgets.QGridLayout() deviceLayout.addLayout(self.user_pw_layout, 0, 0) deviceLayout.addWidget(self.vLineFrame, 0, 1) deviceLayout.addWidget(self.loginButton, 0, 2) userPwGroup.setLayout(deviceLayout) '''Ip Address Config Pane''' self.ipaddrLabel = QtWidgets.QLabel("IP Address Config") self.ipaddrEdit = QtWidgets.QLineEdit() self.ipaddrEdit.setStyleSheet(valueEditStyle) self.ipAddrRefreshButton = QtWidgets.QPushButton("Refresh") self.ipAddrConfigButton = QtWidgets.QPushButton("Config") ip_config_layout = QtWidgets.QGridLayout() ip_config_layout.addWidget(self.ipaddrLabel, 0, 0) ip_config_layout.addWidget(self.ipaddrEdit, 0, 1, 1, 3) ip_config_layout.addWidget(self.ipAddrRefreshButton, 0, 4) ip_config_layout.addWidget(self.ipAddrConfigButton, 0, 5) ip_config_layout.setSpacing(pubSpacing) self.ip_config_widget = QtWidgets.QWidget() self.ip_config_widget.setLayout(ip_config_layout) '''End of ip Address Config Pane''' mainLayout = QtWidgets.QVBoxLayout() mainLayout.addLayout(device_manage_layout) mainLayout.addWidget(userPwGroup) mainLayout.addWidget(self.ip_config_widget) mainLayout.setContentsMargins(10, 20, 10, 20) mainLayout.setSpacing(mainSpacing) v_layout = QtWidgets.QVBoxLayout() v_layout.addLayout(mainLayout) v_layout.setContentsMargins(5, 70, 5, 70) self.setLayout(v_layout) def _add_signal(self): self.loginButton.clicked.connect(self.login_onclick) self.optionComboBox.currentIndexChanged.connect(self._send_option) self.ipAddrRefreshButton.clicked.connect(self.refresh_ip_addr) self.ipAddrConfigButton.clicked.connect(self.set_ip_addr) self.passwordEdit.textChanged.connect(self.back_normal) self.passwordEdit.returnPressed.connect(self.login_onclick) self.userEdit.textChanged.connect(self.back_normal) self.hostEdit.textChanged.connect(self.back_normal) self.setTabOrder(self.hostEdit, self.userEdit) self.setTabOrder(self.userEdit, self.passwordEdit) def _check_json(self): if os.access('../JSON/' + Telnet.json_filename + '.json', os.F_OK): data_in_json = JsonRep.read_json(Telnet.json_filename) self.hostEdit.setText(data_in_json[0][Telnet.json_dict[0]]) self.userEdit.setText(data_in_json[0][Telnet.json_dict[1]]) self.passwordEdit.setText(data_in_json[0][Telnet.json_dict[2]]) return True else: return False @staticmethod def _set_logger(): logging.basicConfig(filename='../log/' + __name__ + '.log', format='[%(asctime)s-%(filename)s-%(funcName)s-%(levelname)s:%(message)s]', level=logging.DEBUG, filemode='a', datefmt='%Y-%m-%d %I:%M:%S %p') def login(self): self.back_normal() host = self.hostEdit.text().strip() user = self.userEdit.text().strip() password = self.passwordEdit.text() self.isTelnetLogined = TelRepository.telnet_instance.login(host, user, password) if self.isTelnetLogined: self.loginButton.setStyleSheet("background-color: green; height: 90px") self.loginButton.setText('Logout') # self.ip_config_widget.setDisabled(False) # Save if self.saveCheckBox.isChecked(): data = [{Telnet.json_dict[0]: host, Telnet.json_dict[1]: user, Telnet.json_dict[2]: password}] JsonRep.save_by_json(data) self.loginSignal.emit(True) monitor_thread = ConnectionMonitor() monitor_thread.signals.connectionLost.connect(self.health_failure) QThreadPool.globalInstance().start(monitor_thread) else: self.loginButton.setStyleSheet("background-color: red; height: 90px") self.loginButton.setText('Failed') self.loginSignal.emit(False) self.loginWarningSignal.emit(str(TelRepository.telnet_instance.get_warning())) def back_normal(self): if TelRepository.telnet_instance.isTelnetLogined: self.loginButton.setStyleSheet("background-color: green; height: 90px") else: self.loginButton.setStyleSheet(setButtonStyle) self.loginButton.setText("Login") def test_login(self): self.back_normal() host = self.hostEdit.text().strip() user = self.userEdit.text().strip() password = self.passwordEdit.text().strip() self.isTelnetLogined = TelRepository.telnet_instance.login(host, user, password) if self.isTelnetLogined: self.loginButton.setStyleSheet("background-color: green; height: 90px") self.loginButton.setText('Logout') # Save if self.saveCheckBox.isChecked(): data = [{Telnet.json_dict[0]: host, Telnet.json_dict[1]: user, Telnet.json_dict[2]: password}] JsonRep.save_by_json(data) self.monitorT.start() else: self.loginButton.setStyleSheet("background-color: red; height: 90px") self.loginButton.setText('Failed') @staticmethod def warning(title: str, icon, info): msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle(title) msgBox.setIcon(icon) msgBox.setText('Info') msgBox.setInformativeText(info) msgBox.addButton('Yes', QtWidgets.QMessageBox.AcceptRole) no = msgBox.addButton('No', QtWidgets.QMessageBox.RejectRole) msgBox.setDefaultButton(no) reply = msgBox.exec() if reply == QtWidgets.QMessageBox.AcceptRole: return True else: return False def login_onclick(self): if self.isTelnetLogined: info = "Press Yes to log out" if self.userEdit.text().strip() != TelRepository.telnet_instance.loginedUserName: info = "Press Yes to log out first" if self.warning("Warning", QtWidgets.QMessageBox.Information, info): if TelRepository.connection_check(): TelRepository.telnet_instance.logout() self._loose_login() else: self._loose_login() else: self.login() # TODO Use self.login() if not for DEBUG def _send_option(self): self.sinOption.emit(self.optionComboBox.currentIndex()) def health_failure(self): """Shut down all panes and send warning when connection lost Connection lost may either be reported by monitor thread or passive touch before sending message """ self._loose_login() msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('Connection Lost!') msgBox.exec() def _loose_login(self): self.loginSignal.emit(False) # self.ip_config_widget.setDisabled(True) self.isTelnetLogined = False self.back_normal() def refresh_ip_addr(self): if self.isTelnetLogined: cmd = RRUCmd.get_ipaddr("ipaddr") thread = TelnetWorker(RRUCmd.GET_IP_ADDR, cmd) thread.signals.connectionLost.connect(self.health_failure) thread.signals.consoleDisplay.connect(self._console_slot) thread.signals.result.connect(self.refresh_resp_handler) QThreadPool.globalInstance().start(thread) else: msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('Login before Refreshing the IP Address') msgBox.exec() def refresh_resp_handler(self, case, res): if case == RRUCmd.GET_IP_ADDR: value = RespFilter.ipaddr_read_filter(res) if value is not None: self.ipaddrEdit.setText(str(value.group())) else: msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('Cannot get IP Address!') msgBox.exec() def set_ip_addr(self): if self.isTelnetLogined: ipaddr2set = ValidCheck.filter(ValidCheck.IPADDR_RE, self.ipaddrEdit.text().strip()) if ipaddr2set is not None: cmd = RRUCmd.config_ipaddr("ipaddr", ipaddr2set.group()) thread = TelnetWorker(RRUCmd.SET_IP_ADDR, cmd) thread.signals.connectionLost.connect(self.health_failure) thread.signals.consoleDisplay.connect(self._console_slot) thread.signals.result.connect(self.set_handler) QThreadPool.globalInstance().start(thread) else: self.ipaddrEdit.setStyleSheet(NonQSSStyle.warningStyle) else: msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('Login before Setting the IP Address') msgBox.exec() def _console_slot(self, case, cmd): if case == WorkerSignals.TRAN_SIGNAL: self.ipTranSignal.emit(cmd) elif case == WorkerSignals.RECV_SIGNAL: self.ipRecvSignal.emit(cmd) def ipaddr_edit_back2normal(self): self.ipaddrEdit.setStyleSheet(NonQSSStyle.displayValueStyle) @staticmethod def set_handler(case, resp: str): if case == RRUCmd.SET_IP_ADDR: if not RespFilter.resp_check(resp): msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Warning') msgBox.setIcon(QtWidgets.QMessageBox.Warning) msgBox.setText('IP Address cannot be set properly!') msgBox.exec() <file_sep>/src/Telnet/RespFilter.py import re from src.Telnet.RRUCmd import RRUCmd from src.Tool.ValidCheck import ValidCheck class RespFilter: FREQUENCY_ASSERTION = 'freq:' TX_ATTEN_ASSERTION = 'txAtten' RX_GAIN_ASSERTION = 'rxGain' TDD_SLOT_ASSERTION = 'tddSlot' S_SLOT_ASSERTION = 'sSlot' UL_OFFSET_ASSERTION = 'UlFrameOffset' DL_OFFSET_ASSERTION = 'dlFrameOffset' IP_ADDR_ASSERTION = 'ipaddr:' AXI_OFFSET_ASSERTION = 'axi reg ' CPRI_LOOP_MODE_ASSERTION = 'cpriLoopMode' CPRI_STATUS_ASSERTION = 'CPRI status is' CPRI_CONFIG_OK = 'CPRI config complete' CMD_OK = 'CMD OK' CMD_FAIL = 'CMD FAILED' @staticmethod def resp_check(resp): if resp is None: return False if RespFilter.CMD_FAIL not in resp: return True else: return False @staticmethod def value_filter(resp, ast: str): if RespFilter.resp_check(resp): return re.search(r'(?<=' + ast + r')\d+(\.\d+)?', resp) else: return None @staticmethod def value_filter_with_ant(resp, ast: str, antNum: int): if RespFilter.resp_check(resp): return re.search(r'(?<=' + ast + str(antNum) + r':' + r')\d+(\.\d+)?', resp) else: return None @staticmethod def hex_value_filter(resp, ast: str): if RespFilter.resp_check(resp): return re.search(r'(?<=' + ast + r')0[xX][0-9a-fA-F]+:0[xX][0-9a-fA-F]+', resp) else: return None @staticmethod def word_value_filter(resp, ast: str): if RespFilter.resp_check(resp): return re.search(r'(?<=' + ast + r')( \w+)+', resp) else: return None @staticmethod def axi_read_filter(resp): return re.search(r'(?<=read axi reg )0[xX][0-9a-fA-F]{8}:0[xX][0-9a-fA-F]{8}', resp) @staticmethod def ipaddr_read_filter(resp): return re.search(r'(?<=The ipaddr is \[)' r'((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}', resp) @staticmethod def trim_cpri_status(resp: str): begin = resp.find(RespFilter.CPRI_STATUS_ASSERTION) end = resp.find(RespFilter.CMD_OK) if begin != -1 and end != -1: begin += len(RespFilter.CPRI_STATUS_ASSERTION) res = resp[begin: end].replace("\n", "") return res.replace("\r", "").upper() else: return None @staticmethod def trim(resp: str): resp = resp.replace("\n\r", " ") resp = resp.replace("\r\n", " ") resp = resp.replace("\r", " ") resp = resp.replace("\n", " ") return resp def main(): text = "txAtten1:36000" res = RespFilter.value_filter_with_ant(text, RespFilter.TX_ATTEN_ASSERTION, 0) if res is not None: print(str(res.group())) else: print('Failed') i = 0 if res is None: if 0 == i: i += 1 while res is None and i < 4: res = RespFilter.value_filter_with_ant(text, RespFilter.TX_ATTEN_ASSERTION, i) i += 1 i -= 1 else: i = 0 if res is not None: print(str(res.group())) res = ValidCheck.transfer_attenuation(res.group(), RRUCmd.GET_TX_ATTEN) print(res) print(i) if __name__ == '__main__': main() <file_sep>/src/Telnet/RRUCmd.py class RRUCmd: CMD_TYPE_DEBUG = -220 CMD_TYPE_SET = -200 CMD_TYPE_GET = -100 FAIL = -1 REBOOT = 0 VERSION = 1 GET_FREQUENCY = 2 SET_FREQUENCY = 3 GET_S_SLOT = 4 SET_S_SLOT = 5 GET_TDD_SLOT = 6 SET_TDD_SLOT = 7 GET_TX_ATTEN = 8 SET_TX_ATTEN = 9 GET_RX_GAIN = 10 SET_RX_GAIN = 11 GET_DL_OFFSET = 12 SET_DL_OFFSET = 13 GET_UL_OFFSET = 14 SET_UL_OFFSET = 15 GET_CPRI_STATUS = 20 SET_CPRI = 21 GET_CPRI_LOOP_MODE = 18 SET_CPRI_LOOP_MODE = 19 GET_AXI_REG = 20 SET_AXI_REG = 21 GET_AXI_OFFSET = 22 SET_AXI_OFFSET = 23 GET_IP_ADDR = 24 SET_IP_ADDR = 25 cmd_type_str = ['2.6GHz', '3.5GHz', '4.9GHz'] ant_num = [2, 4, 4] slot_type_str = ['TDD', 'Special'] @staticmethod def reboot(cmdType): return "rruAutoRun {cmdType}".format(cmdType=cmdType) @staticmethod def get_version(): return "" # Get RRU frequency (HZ) @staticmethod def get_frequency(cmdType): return "rruAutoRun {cmdType} freq".format(cmdType=cmdType) # Set RRU frequency (HZ) @staticmethod def config_frequency(cmdType, value): return "rruAutoRun {cmdType} freq {value}".format(cmdType=cmdType, value=value) @staticmethod def get_s_slot(cmdType, antNum): return "rruAutoRun {cmdType} sSlot {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_s_slot(cmdType, antNum, value): return "rruAutoRun {cmdType} sSlot {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_tdd_slot(cmdType, antNum): return "rruAutoRun {cmdType} tddSlot {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_tdd_slot(cmdType, antNum, value): return "rruAutoRun {cmdType} tddSlot {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_tx_gain(cmdType, antNum): return "rruAutoRun {cmdType} txAtten {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_tx_gain(cmdType, antNum, value): return "rruAutoRun {cmdType} txAtten {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_rx_gain(cmdType, antNum): return "rruAutoRun {cmdType} rxGain {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_rx_gain(cmdType, antNum, value): return "rruAutoRun {cmdType} rxGain {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_dl_frame_offset(cmdType, antNum): return "rruAutoRun {cmdType} dlFrameOffset {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_dl_frame_offset(cmdType, antNum, value): return "rruAutoRun {cmdType} dlFrameOffset {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_ul_frame_offset(cmdType, antNum): return "rruAutoRun {cmdType} ulFrameOffset {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_ul_frame_offset(cmdType, antNum, value): return "rruAutoRun {cmdType} ulFrameOffset {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_link_delay(cmdType, antNum): return "rruAutoRun {cmdType} linkDelay {antNum}".format(cmdType=cmdType, antNum=antNum) @staticmethod def set_link_delay(cmdType, antNum, value): return "rruAutoRun {cmdType} linkDelay {antNum} {value}".format(cmdType=cmdType, antNum=antNum, value=value) @staticmethod def get_cpri(cmdType): return "rruAutoRun {cmdType} GetCpriStatus".format(cmdType=cmdType) @staticmethod def config_cpri(cmdType): return "rruAutoRun {cmdType} SetCpri".format(cmdType=cmdType) @staticmethod def get_cpri_loop_mode(cmdType): return "rruAutoRun {cmdType} cpriLoopMode".format(cmdType=cmdType) @staticmethod def config_cpri_loop_mode(cmdType, value): return "rruAutoRun {cmdType} cpriLoopMode {value}".format(cmdType=cmdType, value=value) @staticmethod def get_axis_offset(cmdType): return "rruAutoRun {cmdType} axi offsetAddr".format(cmdType=cmdType) @staticmethod def config_axis_offset(cmdType, value): return "rruAutoRun {cmdType} axi offsetAddr {value}".format(cmdType=cmdType, value=value) @staticmethod def get_axis_reg(cmdType, offset): return "rruAutoRun {cmdType} axi {offsetAddr}".format(cmdType=cmdType, offsetAddr=offset) @staticmethod def set_axis_reg(cmdType, change): return "rruAutoRun {cmdType} axi {change}".format(cmdType=cmdType, change=change) @staticmethod def change(offset, value): return "{offsetAddr} {value}".format(offsetAddr=offset, value=value) @staticmethod def get_ipaddr(cmdType): return "rruAutoRun {cmdType}".format(cmdType=cmdType) @staticmethod def config_ipaddr(cmdType, value): return "rruAutoRun {cmdType} {value}".format(cmdType=cmdType, value=value) def main(): cmd = RRUCmd.config_frequency('4.9G', 4900000000) print(cmd) if __name__ == '__main__': main() <file_sep>/src/Telnet/Config/TelnetConfig.py class TelnetConfig: LoginTimeOut = 3 ReadTimeOut = 0.5 TapDelay = 0.2 TapTimeOut = 0.2 MonitorInterval = 1.5 <file_sep>/src/QtRep/TabWidget/OffsetTab.py from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSignal from src.QtRep.Component.ValueLabel import ValueLabel from src.QtRep.NonQSSStyle import NonQSSStyle from src.RRU.Antenna import Antenna from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.TelRepository import TelRepository from src.Telnet.Thread.WorkThread import WorkThread from src.Tool.ValidCheck import ValidCheck valueEditStyle = "height: 22px" setButtonStyle = "width: 30px; height: 90px" buttonWidth = 80 pubSpacing = 10 mainSpacing = 2 class OffsetTab(QtWidgets.QWidget): deviceTranSignal = pyqtSignal(str) deviceRvdSignal = pyqtSignal(str) warningSignal = pyqtSignal(str) connectionOutSignal = pyqtSignal() def __init__(self, parent): super(OffsetTab, self).__init__() self.parentWidget = parent self._setup_ui() self._add_signal() self._init_bean() def _setup_ui(self): """OFFSET SETTING PANE""" offsetGroup = QtWidgets.QGroupBox("Frame Offset") self.getDlFrameOffsetLabel = QtWidgets.QLabel("Dl Frame Offset") self.dlOffsetValueLabel = ValueLabel("00000000", RRUCmd.GET_DL_OFFSET) self.dlOffsetValueLabel.refreshSig.connect(self.quick_refresh) self.dlOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.setDlFrameOffsetLabel = QtWidgets.QLabel("Set as") self.dlOffsetEdit = QtWidgets.QLineEdit() self.dlOffsetEdit.setStyleSheet(valueEditStyle) self.getUlFrameOffsetLabel = QtWidgets.QLabel("Ul Frame Offset") self.ulOffsetValueLabel = ValueLabel("00000000", RRUCmd.GET_UL_OFFSET) self.ulOffsetValueLabel.refreshSig.connect(self.quick_refresh) self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.setUlFrameOffsetLabel = QtWidgets.QLabel("Set as") self.ulOffsetEdit = QtWidgets.QLineEdit() self.ulOffsetEdit.setStyleSheet(valueEditStyle) self.getAxisOffsetLabel = QtWidgets.QLabel("Link Delay") self.axisOffsetValueLabel = ValueLabel("00000000", RRUCmd.GET_AXI_OFFSET) self.axisOffsetValueLabel.refreshSig.connect(self.quick_refresh) self.axisOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.axisOffsetEdit = QtWidgets.QLineEdit() self.axisOffsetEdit.setStyleSheet(valueEditStyle) frameOffsetLayout = QtWidgets.QGridLayout() frameOffsetLayout.addWidget(self.getDlFrameOffsetLabel, 0, 0) frameOffsetLayout.addWidget(self.dlOffsetValueLabel, 0, 1) frameOffsetLayout.addWidget(self.setDlFrameOffsetLabel, 0, 2) frameOffsetLayout.addWidget(self.dlOffsetEdit, 0, 3, 1, 3) frameOffsetLayout.addWidget(self.getUlFrameOffsetLabel, 1, 0) frameOffsetLayout.addWidget(self.ulOffsetValueLabel, 1, 1) frameOffsetLayout.addWidget(self.setUlFrameOffsetLabel, 1, 2) frameOffsetLayout.addWidget(self.ulOffsetEdit, 1, 3, 1, 3) frameOffsetLayout.addWidget(self.getAxisOffsetLabel, 2, 0) frameOffsetLayout.addWidget(self.axisOffsetValueLabel, 2, 1, 1, 2) frameOffsetLayout.addWidget(self.axisOffsetEdit, 2, 3, 1, 3) frameOffsetLayout.setSpacing(pubSpacing) vLineFrame = QtWidgets.QFrame() vLineFrame.setFrameStyle(QtWidgets.QFrame.VLine | QtWidgets.QFrame.Sunken) self.setUlOffsetButton = QtWidgets.QPushButton("Send") self.setUlOffsetButton.setStyleSheet(setButtonStyle) self.setUlOffsetButton.setMaximumWidth(buttonWidth) offsetLayout = QtWidgets.QGridLayout() offsetLayout.addLayout(frameOffsetLayout, 0, 0) offsetLayout.addWidget(vLineFrame, 0, 1) offsetLayout.addWidget(self.setUlOffsetButton, 0, 2) offsetGroup.setLayout(offsetLayout) """END OF OFFSET SETTING PANE""" """CPRI SETTING PANE""" cpriGroup = QtWidgets.QGroupBox("CPRI OFFSET") self.getCPRIStatusLabel = QtWidgets.QLabel("CPRI Status") self.cpriValueLabel = ValueLabel("---- ----", RRUCmd.GET_CPRI_STATUS) self.cpriValueLabel.refreshSig.connect(self.quick_refresh) self.cpriValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.getCPRIButton = QtWidgets.QPushButton("Refresh Status") self.getCPRIButton.setStyleSheet(valueEditStyle) self.configCPRIButton = QtWidgets.QPushButton("Set CPRI") self.configCPRIButton.setStyleSheet(valueEditStyle) self.getCPRILoopModeLabel = QtWidgets.QLabel("CPRI Loop Mode") self.cpriLoopModeLabel = ValueLabel("00000000", RRUCmd.GET_CPRI_LOOP_MODE) self.cpriLoopModeLabel.refreshSig.connect(self.quick_refresh) self.cpriLoopModeLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.setCPRILoopModeLabel = QtWidgets.QLabel("Set as") self.cpriLoopModeEdit = QtWidgets.QLineEdit() self.cpriLoopModeEdit.setStyleSheet(valueEditStyle) cpriLayout = QtWidgets.QGridLayout() cpriLayout.addWidget(self.getCPRIStatusLabel, 0, 0) cpriLayout.addWidget(self.cpriValueLabel, 0, 1, 1, 2) cpriLayout.addWidget(self.getCPRIButton, 0, 3) cpriLayout.addWidget(self.configCPRIButton, 0, 4) cpriLayout.addWidget(self.getCPRILoopModeLabel, 1, 0) cpriLayout.addWidget(self.cpriLoopModeLabel, 1, 1) cpriLayout.addWidget(self.setCPRILoopModeLabel, 1, 2) cpriLayout.addWidget(self.cpriLoopModeEdit, 1, 3, 1, 2) cpriLayout.setSpacing(pubSpacing) vLineFrame_2 = QtWidgets.QFrame() vLineFrame_2.setFrameStyle(QtWidgets.QFrame.VLine | QtWidgets.QFrame.Sunken) self.setCPRIButton = QtWidgets.QPushButton("Send") self.setCPRIButton.setStyleSheet(setButtonStyle) self.setCPRIButton.setMaximumWidth(buttonWidth) cpriSettingLayout = QtWidgets.QGridLayout() cpriSettingLayout.addLayout(cpriLayout, 0, 0) cpriSettingLayout.addWidget(vLineFrame_2, 0, 1) cpriSettingLayout.addWidget(self.setCPRIButton, 0, 2) cpriGroup.setLayout(cpriSettingLayout) """END OF DEVICE SETTING PANE""" mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(offsetGroup) mainLayout.addWidget(cpriGroup) mainLayout.addSpacing(mainSpacing) self.setLayout(mainLayout) def _add_signal(self): self.setUlOffsetButton.clicked.connect(self._send) self.getCPRIButton.clicked.connect(self._get_cpri_status) self.configCPRIButton.clicked.connect(self._set_cpri_status) self.setCPRIButton.clicked.connect(self._set_cpri_loop_mode) self.axisOffsetEdit.textChanged.connect(self._axi_offset_edit_back2normal) self.axisOffsetEdit.returnPressed.connect(self._set_axis_offset) self.ulOffsetEdit.textChanged.connect(self._ul_offset_edit_back2normal) self.dlOffsetEdit.textChanged.connect(self._dl_offset_edit_back2normal) self.cpriLoopModeEdit.textChanged.connect(self._cpri_loop_mode_edit_back2normal) self.cpriLoopModeEdit.returnPressed.connect(self._set_cpri_loop_mode) def _init_bean(self): self.antenna_bean_arr = [] for i in range(max(RRUCmd.ant_num)): self.antenna_bean_arr.append(Antenna()) self.antenna_index = 0 def warning(self, info): self.warningSignal.emit(info) @staticmethod def info(info): msgBox = QtWidgets.QMessageBox() msgBox.setWindowTitle('Info') msgBox.setIcon(QtWidgets.QMessageBox.Information) msgBox.setText(info) msgBox.exec() def refresh_ant_num(self): if TelRepository.telnet_instance.isTelnetLogined: self.display() def display(self): """Refresh display of antenna-differed values """ # Ul Frame Offset self.ulOffsetValueLabel.setText(self.antenna_bean_arr[self.antenna_index].ulFrameOffset) if self.antenna_bean_arr[self.antenna_index].ulFrameOffsetOutDated: self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.ulOffsetEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].ulFrameOffset)) # Dl Frame Offset self.dlOffsetValueLabel.setText(self.antenna_bean_arr[self.antenna_index].dlFrameOffset) if self.antenna_bean_arr[self.antenna_index].dlFrameOffsetOutDated: self.dlOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.dlOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.dlOffsetEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].dlFrameOffset)) def slot_connection_out_signal(self): self.connectionOutSignal.emit() def _send(self): self._set_axis_offset() # TODO Valid Check not added yet ulOffset2set = self.ulOffsetEdit.text().strip() if len(ulOffset2set) != 0: self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) if ulOffset2set != self.ulOffsetValueLabel.text(): cmd = RRUCmd.set_ul_frame_offset(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), ulOffset2set) self.antenna_bean_arr[self.antenna_index].ulFrameOffsetOutDated = True thread_ul_offset_Set = WorkThread(self, RRUCmd.SET_UL_OFFSET, cmd) thread_ul_offset_Set.sigConnectionOut.connect(self.slot_connection_out_signal) thread_ul_offset_Set.sigSetOK.connect(self.set_resp_handler) thread_ul_offset_Set.start() thread_ul_offset_Set.exec() else: self.ulOffsetEdit.setStyleSheet(NonQSSStyle.warningStyle) # TODO Valid Check not added yet dlOffset2set = self.udlOffsetEdit.text().strip() if len(dlOffset2set) != 0: self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) if dlOffset2set != self.dlOffsetValueLabel.text(): cmd = RRUCmd.set_dl_frame_offset(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), dlOffset2set) self.antenna_bean_arr[self.antenna_index].dlFrameOffsetOutDated = True thread_dl_offset_Set = WorkThread(self, RRUCmd.SET_DL_OFFSET, cmd) thread_dl_offset_Set.sigConnectionOut.connect(self.slot_connection_out_signal) thread_dl_offset_Set.sigSetOK.connect(self.set_resp_handler) thread_dl_offset_Set.start() thread_dl_offset_Set.exec() else: self.dlOffsetEdit.setStyleSheet(NonQSSStyle.warningStyle) def _set_axis_offset(self): axiOffset2set = self.axisOffsetEdit.text().strip() if axiOffset2set != self.axisOffsetValueLabel.text(): match = ValidCheck.filter(ValidCheck.HEX_RE, axiOffset2set) if match is not None: self.axisOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) cmd = RRUCmd.config_axis_offset(self.parentWidget.get_option(), str(match.group())) thread_axi_offset_set = WorkThread(self, RRUCmd.SET_AXI_OFFSET, cmd) thread_axi_offset_set.sigConnectionOut.connect(self.slot_connection_out_signal) thread_axi_offset_set.sigSetOK.connect(self.set_resp_handler) thread_axi_offset_set.start() thread_axi_offset_set.exec() else: self.axisOffsetEdit.setStyleSheet(NonQSSStyle.warningStyle) def _set_cpri_status(self): cmd = RRUCmd.get_cpri(self.parentWidget.get_option()) thread_cpri_set = WorkThread(self, RRUCmd.SET_CPRI, cmd) thread_cpri_set.sigConnectionOut.connect(self.slot_connection_out_signal) thread_cpri_set.sigGetRes.connect(self.set_resp_handler) thread_cpri_set.start() thread_cpri_set.exec() def _set_cpri_loop_mode(self): # TODO Valid Check not added yet loopMode2set = self.cpriLoopModeEdit.text().strip() if loopMode2set != self.cpriValueLabel.text(): if len(loopMode2set) != 0: self.cpriValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) cmd = RRUCmd.config_cpri_loop_mode(self.parentWidget.get_option(), loopMode2set) thread_cpri_loop_mode_set = WorkThread(self, RRUCmd.SET_CPRI_LOOP_MODE, cmd) thread_cpri_loop_mode_set.sigConnectionOut.connect(self.slot_connection_out_signal) thread_cpri_loop_mode_set.sigSetOK.connect(self.set_resp_handler) thread_cpri_loop_mode_set.start() thread_cpri_loop_mode_set.exec() else: self.cpriLoopModeEdit.setStyleSheet(NonQSSStyle.warningStyle) def _get_cpri_status(self): cmd = RRUCmd.get_cpri(self.parentWidget.get_option()) thread_cpri_get = WorkThread(self, RRUCmd.GET_CPRI_STATUS, cmd) thread_cpri_get.sigConnectionOut.connect(self.slot_connection_out_signal) thread_cpri_get.sigGetRes.connect(self.get_resp_handler) thread_cpri_get.start() thread_cpri_get.exec() def _get_axi_offset(self): cmd = RRUCmd.get_axis_offset(self.parentWidget.get_option()) thread_axi_offset_get = WorkThread(self, RRUCmd.GET_AXI_OFFSET, cmd) thread_axi_offset_get.sigConnectionOut.connect(self.slot_connection_out_signal) thread_axi_offset_get.sigGetRes.connect(self.get_resp_handler) thread_axi_offset_get.start() thread_axi_offset_get.exec() def _get_ul_frame_offset(self): cmd = RRUCmd.get_ul_frame_offset(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) thread_ul_frame_offset_get = WorkThread(self, RRUCmd.GET_UL_OFFSET, cmd) thread_ul_frame_offset_get.sigConnectionOut.connect(self.slot_connection_out_signal) thread_ul_frame_offset_get.sigGetRes.connect(self.get_resp_handler) thread_ul_frame_offset_get.start() thread_ul_frame_offset_get.exec() def _get_dl_frame_offset(self): cmd = RRUCmd.get_dl_frame_offset(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) thread_dl_frame_offset_get = WorkThread(self, RRUCmd.GET_DL_OFFSET, cmd) thread_dl_frame_offset_get.sigConnectionOut.connect(self.slot_connection_out_signal) thread_dl_frame_offset_get.sigGetRes.connect(self.get_resp_handler) thread_dl_frame_offset_get.start() thread_dl_frame_offset_get.exec() def _get_cpri_loop_mode(self): cmd = RRUCmd.get_cpri_loop_mode(self.parentWidget.get_option()) thread_cpri_loop_mode_get = WorkThread(self, RRUCmd.GET_CPRI_LOOP_MODE, cmd) thread_cpri_loop_mode_get.sigConnectionOut.connect(self.slot_connection_out_signal) thread_cpri_loop_mode_get.sigGetRes.connect(self.get_resp_handler) thread_cpri_loop_mode_get.start() thread_cpri_loop_mode_get.exec() def get_resp_handler(self, case, res: str): """Work Thread Get the Value and Send to refresh_resp_handler for displaying update data mainly by rewriting antenna_bean and refresh display change dimension in the mean time """ if case == RRUCmd.GET_CPRI_STATUS: value = RespFilter.word_value_filter(res, RespFilter.CPRI_STATUS_ASSERTION) if value is not None: self.cpriValueLabel.setText(str(value.group())) self.cpriValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) else: self.cpriValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("CPRI Status cannot be refreshed properly") elif case == RRUCmd.GET_AXI_OFFSET: value = RespFilter.hex_value_filter(res, RespFilter.AXI_OFFSET_ASSERTION) if value is not None: self.axisOffsetValueLabel.setText(str(value.group())) self.axisOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.axisOffsetEdit.setText(str(value.group())) else: self.axisOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("Axis Offset Address cannot be refreshed properly") elif case == RRUCmd.GET_UL_OFFSET: value = RespFilter.value_filter_with_ant(res, RespFilter.UL_OFFSET_ASSERTION, self.antenna_index) if value is not None: res = str(value.group()) self.antenna_bean_arr[self.antenna_index].ulFrameOffset = res self.antenna_bean_arr[self.antenna_index].ulFrameOffset2Set = res self.antenna_bean_arr[self.antenna_index].ulFrameOffsetOutDated = False else: self.ulOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("Ul Frame Offset cannot be refreshed properly") elif case == RRUCmd.GET_DL_OFFSET: value = RespFilter.value_filter_with_ant(res, RespFilter.DL_OFFSET_ASSERTION, self.antenna_index) if value is not None: res = str(value.group()) self.antenna_bean_arr[self.antenna_index].dlFrameOffset = res self.antenna_bean_arr[self.antenna_index].dlFrameOffset2Set = res self.antenna_bean_arr[self.antenna_index].dlFrameOffsetOutDated = False else: self.dlOffsetValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("Dl Frame Offset cannot be refreshed properly") elif case == RRUCmd.GET_CPRI_LOOP_MODE: value = RespFilter.word_value_filter(res, RespFilter.CPRI_LOOP_MODE_ASSERTION) if value is not None: self.cpriLoopModeLabel.setText(str(value.group())) self.cpriLoopModeLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.cpriLoopModeEdit.setText(str(value.group())) else: self.cpriLoopModeLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("CPRI Loop Mode cannot be refreshed properly") # TODO ADD self.display() def set_resp_handler(self, case, resp: str): if case == RRUCmd.SET_CPRI: if RespFilter.resp_check(resp): self.info("CPRI Config Complete!") else: self.warning("CPRI Config May be Failed") elif case == RRUCmd.SET_UL_OFFSET: if not RespFilter.resp_check(resp): self.warning("Ul Frame Offset cannot be set properly") # self._get_ul_frame_offset() elif case == RRUCmd.SET_DL_OFFSET: if not RespFilter.resp_check(resp): self.warning("Dl Frame Offset cannot be set properly") # self._get_dl_frame_offset() elif case == RRUCmd.SET_AXI_OFFSET: if not RespFilter.resp_check(resp): self.warning("Axis Offset cannot be set properly") # self._get_axi_offset() elif case == RRUCmd.SET_CPRI_LOOP_MODE: if not RespFilter.resp_check(resp): self.warning("CPRI Loop Mode cannot be set properly") # self._get_cpri_loop_mode() # TODO ADD def refresh_all(self, connect): if connect: for i in range(RRUCmd.ant_num[self.parentWidget.option]): self.antenna_bean_arr.append(Antenna()) self._refresh_all_value() else: self.antenna_bean_arr.clear() self.setEnabled(connect) def _refresh_all_value(self): if TelRepository.telnet_instance.isTelnetLogined: pass # self._get_axi_offset() # self._get_cpri_status() # self.refresh_s_slot() # self.refresh_tdd_slot() # TODO ADD def _ul_offset_edit_back2normal(self): self.antenna_bean_arr[self.antenna_index].ulFrameOffset2Set = self.ulOffsetEdit.text() self.ulOffsetEdit.setStyleSheet(valueEditStyle) def _dl_offset_edit_back2normal(self): self.antenna_bean_arr[self.antenna_index].dlFrameOffset2Set = self.dlOffsetEdit.text() self.dlOffsetEdit.setStyleSheet(valueEditStyle) def _axi_offset_edit_back2normal(self): self.axisOffsetEdit.setStyleSheet(valueEditStyle) def _cpri_loop_mode_edit_back2normal(self): self.cpriLoopModeEdit.setStyleSheet(valueEditStyle) def quick_refresh(self, cmd): if TelRepository.telnet_instance.isTelnetLogined: if cmd == RRUCmd.GET_UL_OFFSET: self._get_ul_frame_offset() elif cmd == RRUCmd.GET_DL_OFFSET: self._get_dl_frame_offset() elif cmd == RRUCmd.GET_AXI_OFFSET: self._get_axi_offset() elif cmd == RRUCmd.GET_CPRI_STATUS: self._get_cpri_status() elif cmd == RRUCmd.GET_CPRI_LOOP_MODE: self._get_cpri_loop_mode() <file_sep>/src/QtRep/TerminalEdit.py from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QPlainTextEdit from src.Telnet.TelRepository import TelRepository from src.Telnet.Telnet import Telnet class TerminalEdit(QPlainTextEdit): startOfValidCmd = 0 cursorPosCurrent = 0 cursorPosFormer = 0 isCmdInput = False def __init__(self): super(QPlainTextEdit, self).__init__() self.textChanged.connect(self.todo_when_text_changed) self.cursorPositionChanged.connect(self.todo_when_cursor_pos_changed) self.setFont(QFont('sans-serif', 10)) def keyPressEvent(self, event): QPlainTextEdit.keyPressEvent(self, event) if event.key() == Qt.Key_Return: cursor = self.textCursor() cursor.clearSelection() cursor.deletePreviousChar() self.process_cmd_for_transmitting() def test(self): self.setPlainText('ERROR\n') self.startOfValidCmd = 6 # Slot for SIGNAL CURSOR POSITION CHANGED def todo_when_cursor_pos_changed(self): self.cursorPosFormer = self.cursorPosCurrent # print('formerPos') # print(self.cursorPosFormer) self.cursorPosCurrent = self.textCursor().position() # print('currentPos') # print(self.cursorPosCurrent) # Slot for SIGNAL TEXT CHANGED def todo_when_text_changed(self): if self.cursorPosFormer < self.startOfValidCmd: self.startOfValidCmd = self.startOfValidCmd + self.cursorPosCurrent - self.cursorPosFormer # print('Valid') # print(self.startOfValidCmd) def process_cmd_for_transmitting(self): content_split = self.toPlainText()[self.startOfValidCmd:].split('\n') if content_split[-1] == '': return False else: if self.is_telnet_opened(): resp = TelRepository.telnet_instance.execute_command(content_split[-1]) self.flush_response(resp) else: self.warn_tel_not_opened() # TODO: 默认只能通过 telnet open 进行登陆,否则会认为没登陆 def is_telnet_opened(self): return Telnet.isTelnetLogined # TODO def warn_tel_not_opened(self): self.appendPlainText('Telnet not opened') # TODO: 检查Edit中显示消息是否过长以致需要删除部分旧消息 def display_check(self): pass def new_cmd_check(self): if len(self.toPlainText()) > self.startOfValidCmd: self.isCmdInput = True else: self.isCmdInput = False def flush_response(self, resp): if resp != '': resp.replace('\r\n', '\n') self.appendPlainText(resp) self.display_check() self.startOfValidCmd = len(self.toPlainText()) def all_clear(self): self.setPlainText('') self.startOfValidCmd = 0 <file_sep>/src/MainApplication.py import sys import logging from PyQt5.QtWidgets import QApplication from src.QtRep.LeftTabWidget import LeftTabWidget LOG_FILE = '../log/log.log' def set_logger(): logging.basicConfig(filename='../log/' + __name__ + '.log', format='[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]', level=logging.DEBUG, filemode='a', datefmt='%Y-%m-%d %I:%M:%S %p') def main(): app = QApplication(sys.argv) app.setStyle('Fusion') set_logger() main_wnd = LeftTabWidget() main_wnd.resize(850, 570) main_wnd.show() sys.exit(app.exec()) if __name__ == '__main__': main() <file_sep>/src/Telnet/Thread/WorkThread.py from PyQt5 import QtCore from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.TelRepository import TelRepository class WorkThread(QtCore.QThread): """各功能 Tab 通过创建工作线程实体发送 RRUCmd 并接收反馈。 Tab 或 Widget 类通过 RRUCmd 类创建指令后通过构造函数交给 WorkThread 。 WorkThread 只负责收发,不对消息进行处理。 """ sigConnectionOut = QtCore.pyqtSignal() sigSetOK = QtCore.pyqtSignal(int, str) sigGetRes = QtCore.pyqtSignal(int, str) def __init__(self, parentWidget, case, cmd): super(WorkThread, self).__init__() self.parentWidget = parentWidget self.case = case # Case Flag from RRUCmd.py self.cmd = cmd def __del__(self): self.wait() def run(self) -> None: if TelRepository.connection_check(): if self.case == RRUCmd.REBOOT: self.reboot(self.cmd) elif self.case == RRUCmd.VERSION: self.version(self.cmd) elif self.case == RRUCmd.GET_FREQUENCY: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_FREQUENCY: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_TX_ATTEN: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_TX_ATTEN: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_RX_GAIN: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_RX_GAIN: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_TDD_SLOT: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_TDD_SLOT: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_S_SLOT: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_S_SLOT: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_UL_OFFSET: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_UL_OFFSET: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_DL_OFFSET: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_DL_OFFSET: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_CPRI_STATUS: self.get_cpri(self.cmd) elif self.case == RRUCmd.SET_CPRI: self.set_cpri(self.cmd) elif self.case == RRUCmd.GET_AXI_OFFSET: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_AXI_OFFSET: self.get_frequency(self.cmd) elif self.case == RRUCmd.GET_CPRI_LOOP_MODE: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_CPRI_LOOP_MODE: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_AXI_REG: self.get_frequency(self.cmd) elif self.case == RRUCmd.SET_AXI_REG: self.set_frequency(self.cmd) elif self.case == RRUCmd.GET_IP_ADDR: self.get_ip_addr(self.cmd) elif self.case == RRUCmd.SET_IP_ADDR: self.set_ip_addr(self.cmd) # TODO ADD else: self.sigConnectionOut.emit() def reboot(self, cmd): pass def version(self, cmd): pass def get_frequency(self, cmd): # Execute and send Info to Sim-Console self.parentWidget.deviceTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(res) self.parentWidget.deviceRvdSignal.emit(res_display) # Emit Signal to Trigger Value Refresh in Device Setting Tab self.sigGetRes.emit(self.case, res) def set_frequency(self, cmd): # Execute and send Info to Sim-Console self.parentWidget.deviceTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(res) self.parentWidget.deviceRvdSignal.emit(res_display) # Emit Signal to Device Setting Tab as Response self.sigSetOK.emit(self.case, res) def get_cpri(self, cmd): # Execute and send Info to Sim-Console self.parentWidget.deviceTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) # Emit Signal to Trigger Value Refresh in Device Setting Tab self.sigGetRes.emit(self.case, res) def set_cpri(self, cmd): # Execute and send Info to Sim-Console self.parentWidget.deviceTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(res) self.parentWidget.deviceRvdSignal.emit(res_display) # Emit Signal to Device Setting Tab as Response self.sigSetOK.emit(self.case, res) def get_ip_addr(self, cmd): """Used by LoginWidget to Get Ip Address of RRU Device """ # Execute and send Info to Sim-Console self.parentWidget.ipTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(res) self.parentWidget.ipRecvSignal.emit(res_display) self.sigGetRes.emit(self.case, res) def set_ip_addr(self, cmd): """Used by LoginWidget to Set Ip Address of RRU Device """ # Execute and send Info to Sim-Console self.parentWidget.ipTranSignal.emit(cmd) res = TelRepository.telnet_instance.execute_command(cmd) res_display = RespFilter.trim(res) self.parentWidget.ipRecvSignal.emit(res_display) # Emit Signal to LoginWidget as Response self.sigSetOK.emit(self.case, res) <file_sep>/src/QtRep/LeftTabWidget.py from PyQt5 import QtCore, QtWidgets, QtGui from PyQt5.QtWidgets import QListWidget, QStackedWidget from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtCore import QSize, Qt, QThreadPool from src.QtRep.LoginWidget import LoginWidget from src.QtRep.OperateWidget import OperateWidget from src.QtRep.TerminalWidget import TerminalWidget from src.Telnet.TelRepository import TelRepository class LeftTabWidget(QWidget): def __init__(self): super(LeftTabWidget, self).__init__() self.setObjectName('LeftTabWidget') self.setWindowTitle('TerminalDemo') with open('../Qss/QListWidgetQSS.qss', 'r') as f: self.list_style = f.read() self.main_layout = QHBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) self.left_widget = QListWidget() self.left_widget.setStyleSheet(self.list_style) self.main_layout.addWidget(self.left_widget) self.right_widget = QStackedWidget() self.main_layout.addWidget(self.right_widget) self._setup_ui() self.resize(600, 500) def _setup_ui(self): self.left_widget.currentRowChanged.connect(self.right_widget.setCurrentIndex) self.left_widget.setFrameShape(QListWidget.NoFrame) self.left_widget.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.left_widget.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.left_widget.setIconSize(QtCore.QSize(48, 58)) self.left_widget.setViewMode(QtWidgets.QListView.IconMode) item_terminal = QtWidgets.QListWidgetItem() icon_terminal = QtGui.QIcon() icon_terminal.addPixmap(QtGui.QPixmap('../Icon/console-mod.png')) item_terminal.setIcon(icon_terminal) item_login = QtWidgets.QListWidgetItem() icon_login = QtGui.QIcon() icon_login.addPixmap(QtGui.QPixmap('../Icon/login-mod.png')) item_login.setIcon(icon_login) item_setting = QtWidgets.QListWidgetItem() icon_setting = QtGui.QIcon() icon_setting.addPixmap(QtGui.QPixmap('../Icon/setting-mod.png')) item_setting.setIcon(icon_setting) self.left_widget.addItem(item_login) self.left_widget.addItem(item_setting) self.left_widget.addItem(item_terminal) self.loginWidget = LoginWidget(self) self.right_widget.addWidget(self.loginWidget) self.settingWidget = OperateWidget() self.right_widget.addWidget(self.settingWidget) self.terminalWidget = TerminalWidget() self.right_widget.addWidget(self.terminalWidget) '''Signal''' self.loginWidget.loginSignal.connect(self.settingWidget.set_connected) self.loginWidget.ipTranSignal.connect(self.terminalWidget.show_response) self.loginWidget.ipRecvSignal.connect(self.terminalWidget.show_response) self.settingWidget.operateSignal.connect(self.terminalWidget.show_response) self.loginWidget.loginWarningSignal.connect(self.terminalWidget.show_response) self.loginWidget.sinOption.connect(self.settingWidget.set_option) self.settingWidget.connectionOutSignal.connect(self.loginWidget.health_failure) '''''' self._retranslate_ui() def _retranslate_ui(self): up_list_str = ['Connect', 'Setting', 'Terminal'] for i in range(3): self.item = self.left_widget.item(i) self.item.setText(up_list_str[i]) self.item.setSizeHint(QSize(110, 90)) self.item.setTextAlignment(Qt.AlignCenter) def closeEvent(self, a0: QtGui.QCloseEvent) -> None: if self.loginWidget.isTelnetLogined: self.settingWidget.axi_reg_setting.json_save() QThreadPool.globalInstance().clear() TelRepository.telnet_instance.terminate() <file_sep>/src/RRU/Antenna.py class Antenna: RRU_NONE = "000000000" @staticmethod def not_none(s_value): if s_value == Antenna.RRU_NONE: return "" else: return s_value def __init__(self): self.tddSlot = Antenna.RRU_NONE self.tddSlot2Set = Antenna.RRU_NONE self.tddSlotOutDated = True self.sSlot = Antenna.RRU_NONE self.sSlot2Set = Antenna.RRU_NONE self.sSlotOutDated = True self.txAttenuation = Antenna.RRU_NONE self.txAttenuation2Set = Antenna.RRU_NONE self.txAttenuationOutDated = True self.txAttenuationInitialized = False self.rxGainAttenuation = Antenna.RRU_NONE self.rxGainAttenuation2Set = Antenna.RRU_NONE self.rxGainAttenuationOutDated = True self.rxGainAttenuationInitialized = False self.dlFrameOffset = Antenna.RRU_NONE self.dlFrameOffset2Set = Antenna.RRU_NONE self.dlFrameOffsetOutDated = True self.ulFrameOffset = Antenna.RRU_NONE self.ulFrameOffset2Set = Antenna.RRU_NONE self.ulFrameOffsetOutDated = True self.linkDelay = Antenna.RRU_NONE self.linkDelay2Set = Antenna.RRU_NONE self.linkDelayOutDated = True <file_sep>/test.py def main(): n = 7 e = [[0 for col in range(n+2)] for row in range(n+2)] w = [[0 for col in range(n+2)] for row in range(n+2)] root = [[0 for col in range(n+2)] for row in range(n+2)] ''' q = [0.05, 0.10, 0.05, 0.05, 0.05, 0.10] p = [0, 0.15, 0.10, 0.05, 0.10, 0.20] ''' q = [0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05, 0.05] p = [0, 0.04, 0.06, 0.08, 0.02, 0.10, 0.12, 0.14] for i in range(1, n + 2): e[i][i-1] = q[i-1] w[i][i-1] = q[i-1] for l in range(1, n + 1): for i in range(1, n - l + 2): j = i + l - 1 e[i][j] = 300 w[i][j] = w[i][j - 1] + p[j] + q[j] for r in range(i, j + 1): t = e[i][r-1]+e[r+1][j]+w[i][j] if t < e[i][j]: e[i][j] = t root[i][j] = r print(e) print(w) print(root) if __name__ == '__main__': main() <file_sep>/src/Tool/ValidCheck.py import re from src.Telnet.RRUCmd import RRUCmd class ValidCheck: # 195-255,步进 0.5 GAIN_RE = r"(^(1[9][5-9]|2[0-4][0-9]|25[0-4])(\.5)?)|(^(255)(\.0)?)|(^(1[9][5-9]|2[0-4][0-9]|25[0-4])(\.0)?)" # IPV4 IPADDR_RE = r"((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}" # 非负浮点数 NON_NEGATIVE_FLOAT_RE = r"^\d+(\.\d+)?$" # 非正浮点数 NON_POSITIVE_FLOAT_RE = r"^((-\d+(\.\d+)?)|(0+(\.0+)?))$" # 浮点数 FLOAT_RE = r"^(-?\d+)(\.\d+)?$" # HEX HEX_RE = r"^0[xX][0-9a-fA-F]+$" @staticmethod def is_number(s): try: float(s) return True except ValueError: pass try: import unicodedata unicodedata.numeric(s) return True except (TypeError, ValueError): pass return False @staticmethod def reg_format(s_value: str): try: n = int(s_value, 16) return '0x{:08x}'.format(n) except (TypeError, ValueError): return None @staticmethod def freq(option: str, s_value: str): """Check validity of Frequency input :option: CMDType 0 for 2.6 GHz, 1 for 3.5 GHz, 2 for 4,9 GHz :s_value: frequency as str :return: True or False """ if s_value.isdigit(): n_value = int(s_value) if option == RRUCmd.cmd_type_str[0]: return 2565000000 <= n_value <= 2625000000 elif option == RRUCmd.cmd_type_str[1]: return 3450000000 <= n_value <= 3550000000 elif option == RRUCmd.cmd_type_str[2]: return 4850000000 <= n_value <= 4950000000 else: return False @staticmethod def transfer_attenuation(s_value: str, case: int): """Unit Convert GUI uses dB as basic unit """ try: if case == RRUCmd.SET_TX_ATTEN: # dB -> mdB return str(int(float(s_value) * -1000)) elif case == RRUCmd.SET_RX_GAIN: # dB -> RRU Dimension return str(float(s_value) * 2 + 255) elif case == RRUCmd.GET_TX_ATTEN: # mdB -> dB if float(s_value) == 0: return "0.0" else: return str(float(s_value) / -1000) elif case == RRUCmd.GET_RX_GAIN: # RRU Dimension -> dB return str((float(s_value) - 255) / 2) except ValueError: return None @staticmethod def atten(s_value: str): """Check validity of tx attenuation input :return: True or False """ if s_value is None: return False elif s_value.isdigit(): n_value = int(s_value) return n_value <= 41950 else: return False @staticmethod def filter(s_re: str, s_value: str): """Filter using re :s_re: re expression :s_value: value as str :return: math group or none when cannot match """ if s_value is None: return None else: return re.match(s_re, s_value) @staticmethod def addr_transfer(s_value, case): if case == RRUCmd.GET_AXI_REG: # Offset Addr -> Addr return hex(int(s_value, 16) + 0x40000000) elif case == RRUCmd.SET_AXI_REG: # Addr -> Offset Addr return hex(int(s_value, 16) - 0x40000000) def main(): rxGain2set = "02222222222201" if True: # Transfer Unit match = ValidCheck.reg_format(rxGain2set) if match is not None: print(match) else: print("Failed") if __name__ == '__main__': main() <file_sep>/src/QtRep/TabWidget/DeviceTab.py import logging from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSignal, QThreadPool from src.QtRep.Component.ValueLabel import ValueLabel from src.QtRep.NonQSSStyle import NonQSSStyle from src.RRU.Antenna import Antenna from src.Telnet.RRUCmd import RRUCmd from src.Telnet.RespFilter import RespFilter from src.Telnet.Runnable.TelnetWorker import TelnetWorker, WorkerSignals from src.Telnet.TelRepository import TelRepository from src.Tool.ValidCheck import ValidCheck pubSpacing = 10 mainSpacing = 2 TEST = False class DeviceTab(QtWidgets.QWidget): deviceTranSignal = pyqtSignal(str) deviceRvdSignal = pyqtSignal(str) warningSignal = pyqtSignal(str) connectionOutSignal = pyqtSignal() def __init__(self, parent): super(DeviceTab, self).__init__() self.parentWidget = parent # Setting Flags self.mod_dimension = True self.auto_fresh = True self._init_ui() self.add_signal() self.set_logger() self._init_bean() self.debug_counter = 0 @staticmethod def set_logger(): logging.basicConfig(filename='../log/' + __name__ + '.log', format='[%(asctime)s-%(filename)s-%(funcName)s-%(levelname)s:%(message)s]', level=logging.DEBUG, filemode='a', datefmt='%Y-%m-%d %I:%M:%S %p') def _init_ui(self): """DEVICE SETTING PANE""" settingGroup = QtWidgets.QGroupBox("Device Setting") self.getFrequencyLabel = QtWidgets.QLabel("Freq (Hz) ") self.setFrequencyLabel = QtWidgets.QLabel("Set Freq") self.freqValueLabel = ValueLabel("000000", RRUCmd.GET_FREQUENCY) self.freqValueLabel.refreshSig.connect(self.quick_refresh) self.freqValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.freqEdit = QtWidgets.QLineEdit() self.freqEdit.setStyleSheet(NonQSSStyle.valueEditStyle) self.setFreqButton = QtWidgets.QPushButton("Send") self.setFreqButton.setStyleSheet(NonQSSStyle.setButtonBigStyle) self.freqEditTip = ["(2.565 - 2.625 GHz, Correct to 1 Hz)", "(3.45 - 3.55 GHz, Correct to 1 Hz)", "(4.85 - 4.95 GHz, Correct to 1 Hz)"] self.freqEdit.setPlaceholderText(self.freqEditTip[0]) if self.mod_dimension: self.getTxGainLabel = QtWidgets.QLabel("Tx atten (dB)") else: self.getTxGainLabel = QtWidgets.QLabel("TX atten (mdB)") self.setTxGainLabel = QtWidgets.QLabel("Set Gain") self.txGainValueLabel = ValueLabel("000000", RRUCmd.GET_TX_ATTEN) self.txGainValueLabel.refreshSig.connect(self.quick_refresh) self.txGainValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.txGainEdit = QtWidgets.QLineEdit() self.txGainEdit.setStyleSheet(NonQSSStyle.valueEditStyle) if self.mod_dimension: txGainTip = "(-41.95 - 0 dB, Correct to 0.001 dB)" else: txGainTip = "(-41950 - 0 mdB, Correct to 1 mdB)" self.txGainEdit.setPlaceholderText(txGainTip) if self.mod_dimension: self.getRxGainLabel = QtWidgets.QLabel("RX gain atten (dB)") else: self.getRxGainLabel = QtWidgets.QLabel("RX gain atten") self.setRxGainLabel = QtWidgets.QLabel("Set Gain") self.rxGainValueLabel = ValueLabel("000000", RRUCmd.GET_RX_GAIN) self.rxGainValueLabel.refreshSig.connect(self.quick_refresh) self.rxGainValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.rxGainEdit = QtWidgets.QLineEdit() self.rxGainEdit.setStyleSheet(NonQSSStyle.valueEditStyle) if self.mod_dimension: rxGainTip = "(-30 - 0 dB, Correct to 0.25 dB)" else: rxGainTip = "(195 - 255, Correct to 0.5)" self.rxGainEdit.setPlaceholderText(rxGainTip) self.freqLayout = QtWidgets.QGridLayout() self.freqLayout.addWidget(self.getFrequencyLabel, 0, 0) self.freqLayout.addWidget(self.freqValueLabel, 0, 1) self.freqLayout.addWidget(self.setFrequencyLabel, 0, 2) self.freqLayout.addWidget(self.freqEdit, 0, 3) self.freqLayout.addWidget(self.getTxGainLabel, 1, 0) self.freqLayout.addWidget(self.txGainValueLabel, 1, 1) self.freqLayout.addWidget(self.setTxGainLabel, 1, 2) self.freqLayout.addWidget(self.txGainEdit, 1, 3) self.freqLayout.addWidget(self.getRxGainLabel, 2, 0) self.freqLayout.addWidget(self.rxGainValueLabel, 2, 1) self.freqLayout.addWidget(self.setRxGainLabel, 2, 2) self.freqLayout.addWidget(self.rxGainEdit, 2, 3) self.freqLayout.setSpacing(pubSpacing) self.vLineFrame = QtWidgets.QFrame() self.vLineFrame.setFrameStyle(QtWidgets.QFrame.VLine | QtWidgets.QFrame.Sunken) deviceLayout = QtWidgets.QGridLayout() deviceLayout.addLayout(self.freqLayout, 0, 0) deviceLayout.addWidget(self.vLineFrame, 0, 1) deviceLayout.addWidget(self.setFreqButton, 0, 2) settingGroup.setLayout(deviceLayout) '''END OF DEVICE SETTING PANE''' '''SLOT PANE''' slot_setting_layout = QtWidgets.QGroupBox("Slot Setting") self.typeLabel = QtWidgets.QLabel("Slot Set") self.typeComboBox = QtWidgets.QComboBox() for i in range(len(RRUCmd.slot_type_str)): self.typeComboBox.addItem(RRUCmd.slot_type_str[i]) self.slotValueLabel = ValueLabel("000000", RRUCmd.GET_TDD_SLOT) self.slotValueLabel.refreshSig.connect(self.quick_refresh) self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.slotEdit = QtWidgets.QLineEdit() self.setButton = QtWidgets.QPushButton("Set") slot_layout = QtWidgets.QGridLayout() slot_layout.addWidget(self.typeComboBox, 0, 0) slot_layout.addWidget(self.typeLabel, 0, 1) slot_layout.addWidget(self.slotValueLabel, 0, 2) slot_layout.addWidget(self.slotEdit, 0, 3) slot_layout.addWidget(self.setButton, 0, 5) slot_layout.setSpacing(pubSpacing) slot_setting_layout.setLayout(slot_layout) '''END OF SLOT PANE''' mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(settingGroup) mainLayout.addWidget(slot_setting_layout) mainLayout.addSpacing(mainSpacing) self.setLayout(mainLayout) def _init_bean(self): self.antenna_bean_arr = [] for i in range(max(RRUCmd.ant_num)): self.antenna_bean_arr.append(Antenna()) self.antenna_index = 0 def add_signal(self): if TEST: self.setFreqButton.clicked.connect(self.test) else: self.setFreqButton.clicked.connect(self.send) self.typeComboBox.currentIndexChanged.connect(self.display_slot) self.setButton.clicked.connect(self.set_slot) self.freqEdit.textChanged.connect(self.freq_back2normal) self.freqEdit.returnPressed.connect(self.set_freq) self.rxGainEdit.textChanged.connect(self.rx_back2normal) self.rxGainEdit.returnPressed.connect(self.set_rx_gain) self.txGainEdit.textChanged.connect(self.tx_back2normal) self.txGainEdit.returnPressed.connect(self.set_tx_gain) self.slotEdit.textChanged.connect(self.slot_back2normal) self.slotEdit.returnPressed.connect(self.set_slot) def _console_slot(self, case, msg): if case == WorkerSignals.TRAN_SIGNAL: self.deviceTranSignal.emit(msg) elif case == WorkerSignals.RECV_SIGNAL: self.deviceRvdSignal.emit(msg) def send(self): self.set_freq() self.set_tx_gain() self.set_rx_gain() def test(self): text = "txAtten0:36000 (mdB)" self.get_resp_handler(RRUCmd.GET_TX_ATTEN, text) self.display() text = "rxGain0:200 (mdB)" self.get_resp_handler(RRUCmd.GET_RX_GAIN, text) self.display() def _debug_send(self): cmd = "DEBUG" thread = TelnetWorker(RRUCmd.CMD_TYPE_DEBUG, cmd) thread.signals.consoleDisplay.connect(self._console_slot) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.error.connect(self.log_error) thread.signals.result.connect(self.get_resp_handler) QThreadPool.globalInstance().start(thread) def _process_cmd(self, cmd_type: int, cmd_case: int, cmd: str): thread = TelnetWorker(cmd_case, cmd) thread.signals.consoleDisplay.connect(self._console_slot) thread.signals.connectionLost.connect(self.slot_connection_out_signal) thread.signals.error.connect(self.log_error) if cmd_type == RRUCmd.CMD_TYPE_GET: thread.signals.result.connect(self.get_resp_handler) elif cmd_type == RRUCmd.CMD_TYPE_SET: thread.signals.result.connect(self.set_resp_handler) QThreadPool.globalInstance().start(thread) def set_freq(self): freq2set = self.freqEdit.text().strip() if freq2set != self.freqValueLabel.text(): if ValidCheck.freq(self.parentWidget.get_option(), freq2set): self.freqValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) cmd = RRUCmd.config_frequency(self.parentWidget.get_option(), freq2set) self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.SET_FREQUENCY, cmd) else: self.freqEdit.setStyleSheet(NonQSSStyle.warningStyle) def set_rx_gain(self): rxGain2set = self.rxGainEdit.text().strip() if rxGain2set != self.rxGainValueLabel.text() and len(rxGain2set) != 0: if self.mod_dimension: # Transfer Unit match = ValidCheck.filter(ValidCheck.GAIN_RE, ValidCheck.transfer_attenuation(rxGain2set, RRUCmd.SET_RX_GAIN)) else: match = ValidCheck.filter(ValidCheck.GAIN_RE, rxGain2set) if match is not None: self.rxGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) cmd = RRUCmd.set_rx_gain(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), match.group()) self.antenna_bean_arr[self.antenna_index].rxGainAttenuationOutDated = True self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.SET_RX_GAIN, cmd) else: self.rxGainEdit.setStyleSheet(NonQSSStyle.warningStyle) def set_tx_gain(self): txGain2set = self.txGainEdit.text().strip() if txGain2set != self.txGainValueLabel.text() and len(txGain2set) != 0: if self.mod_dimension: # Transfer Unit txGain2set = ValidCheck.transfer_attenuation(txGain2set, RRUCmd.SET_TX_ATTEN) if ValidCheck.atten(txGain2set): self.txGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) cmd = RRUCmd.set_tx_gain(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), txGain2set) self.antenna_bean_arr[self.antenna_index].txAttenuationOutDated = True self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.SET_TX_ATTEN, cmd) else: self.txGainEdit.setStyleSheet(NonQSSStyle.warningStyle) def set_slot(self): # TODO Valid Check not added yet slot2set = self.slotEdit.text().strip() if slot2set is not None: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) if self.typeComboBox.currentText() == RRUCmd.slot_type_str[0] and slot2set != self.slotValueLabel.text(): cmd = RRUCmd.set_tdd_slot(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), slot2set) self.antenna_bean_arr[self.antenna_index].tddSlotOutDated = True self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.SET_TDD_SLOT, cmd) elif self.typeComboBox.currentText() == RRUCmd.slot_type_str[1] and slot2set != self.slotValueLabel.text(): cmd = RRUCmd.set_s_slot(self.parentWidget.get_option(), self.parentWidget.get_ant_num(), slot2set) self.antenna_bean_arr[self.antenna_index].sSlotOutDated = True self._process_cmd(RRUCmd.CMD_TYPE_SET, RRUCmd.SET_S_SLOT, cmd) def get_resp_handler(self, case, res): """Work Thread Get the Value and Send to refresh_resp_handler for displaying update data mainly by rewriting antenna_bean and refresh display change dimension in the mean time """ if case == RRUCmd.GET_FREQUENCY: value = RespFilter.value_filter(res, RespFilter.FREQUENCY_ASSERTION) if value is not None: self.freqValueLabel.setText(str(value.group())) logging.debug("FREQ GET AS" + str(value.group())) self.freqValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.freqEdit.setText(str(value.group())) self.display() if not TEST: self.initialize_update() else: self.freqValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("Frequency cannot be refreshed properly") elif case == RRUCmd.GET_TX_ATTEN: value = RespFilter.value_filter_with_ant(res, RespFilter.TX_ATTEN_ASSERTION, self.antenna_index) i = 0 if value is None: if self.antenna_index == i: i += 1 while value is None and i < RRUCmd.ant_num[self.parentWidget.option]: value = RespFilter.value_filter_with_ant(res, RespFilter.TX_ATTEN_ASSERTION, i) i += 1 i -= 1 else: i = self.antenna_index if value is not None: res = str(value.group()) if self.mod_dimension: # Transfer Unit res = ValidCheck.transfer_attenuation(res, RRUCmd.GET_TX_ATTEN) self.antenna_bean_arr[i].txAttenuation = res logging.debug("TX GET AS" + str(value.group()) + "For Ant" + str(i) + "TRAN TO" + res) self.antenna_bean_arr[i].txAttenuation2Set = res self.antenna_bean_arr[i].txAttenuationOutDated = False self.antenna_bean_arr[i].txAttenuationInitialized = True self.display() if not TEST: self.initialize_update() else: self.txGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("TX's attenuation cannot be refreshed properly") elif case == RRUCmd.GET_RX_GAIN: value = RespFilter.value_filter_with_ant(res, RespFilter.RX_GAIN_ASSERTION, self.antenna_index) i = 0 if value is None: if self.antenna_index == i: i += 1 while value is None and i < RRUCmd.ant_num[self.parentWidget.option]: value = RespFilter.value_filter_with_ant(res, RespFilter.RX_GAIN_ASSERTION, i) i += 1 i -= 1 else: i = self.antenna_index if value is not None: res = str(value.group()) if self.mod_dimension: # Transfer Unit res = ValidCheck.transfer_attenuation(res, RRUCmd.GET_RX_GAIN) self.antenna_bean_arr[i].rxGainAttenuation = res logging.debug("RX GET AS" + str(value.group()) + "For Ant" + str(i) + "TRAN TO" + res) self.antenna_bean_arr[i].rxGainAttenuation2Set = res self.antenna_bean_arr[i].rxGainAttenuationOutDated = False self.antenna_bean_arr[i].rxGainAttenuationInitialized = True self.display() if not TEST: self.initialize_update() else: self.rxGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("RX's Gain attenuation cannot be refreshed properly") elif case == RRUCmd.GET_S_SLOT: value = RespFilter.value_filter_with_ant(res, RespFilter.RX_GAIN_ASSERTION, self.antenna_index) if value is not None: self.antenna_bean_arr[self.antenna_index].sSlot = str(value.group()) self.antenna_bean_arr[self.antenna_index].sSlot2Set = str(value.group()) self.antenna_bean_arr[self.antenna_index].sSlotOutDated = False self.display() else: if self.typeComboBox.currentText() == RRUCmd.slot_type_str[1]: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("Special Slot cannot be refreshed properly") elif case == RRUCmd.GET_TDD_SLOT: value = RespFilter.value_filter_with_ant(res, RespFilter.RX_GAIN_ASSERTION, self.antenna_index) if value is not None: self.antenna_bean_arr[self.antenna_index].tddSlot = str(value.group()) self.antenna_bean_arr[self.antenna_index].tddSlot2Set = str(value.group()) self.antenna_bean_arr[self.antenna_index].tddSlotOutDated = False self.display() else: if self.typeComboBox.currentText() == RRUCmd.slot_type_str[0]: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) self.warning("TDD Slot cannot be refreshed properly") def initialize_update(self): """在初始化自动刷新过程中持续刷新不同天线的收发增益 每次刷新完收或发增益后都会触发这一方法,以检查是否所有天线的收发增益都经过了初始化 """ for i in range(RRUCmd.ant_num[self.parentWidget.option]): if not self.antenna_bean_arr[i].txAttenuationInitialized: cmd = RRUCmd.get_tx_gain(self.parentWidget.get_option(), str(i)) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_TX_ATTEN, cmd) break elif not self.antenna_bean_arr[i].rxGainAttenuationInitialized: cmd = RRUCmd.get_rx_gain(self.parentWidget.get_option(), str(i)) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_RX_GAIN, cmd) break # TODO def refresh_freq(self): cmd = RRUCmd.get_frequency(self.parentWidget.get_option()) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_FREQUENCY, cmd) def refresh_tx_gain(self): cmd = RRUCmd.get_tx_gain(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_TX_ATTEN, cmd) def refresh_rx_gain(self): cmd = RRUCmd.get_rx_gain(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_RX_GAIN, cmd) def refresh_s_slot(self): cmd = RRUCmd.get_s_slot(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_S_SLOT, cmd) def refresh_tdd_slot(self): cmd = RRUCmd.get_tdd_slot(self.parentWidget.get_option(), self.parentWidget.get_ant_num()) self._process_cmd(RRUCmd.CMD_TYPE_GET, RRUCmd.GET_TDD_SLOT, cmd) def warning(self, info): self.warningSignal.emit(info) def refresh_all(self, connect): if connect: for i in range(RRUCmd.ant_num[self.parentWidget.option]): self.antenna_bean_arr.append(Antenna()) self._refresh_all_value() else: self.antenna_bean_arr.clear() self.setEnabled(connect) def _refresh_all_value(self): if TelRepository.telnet_instance.isTelnetLogined: if self.auto_fresh: self.refresh_freq() self.refresh_tx_gain() # TODO ADD 不同天线的数值刷新仅需触发一次,之后会通过 initialize_update 方法自动刷新,遇到失败后会中断,须手动刷新, # 因此添加新功能时,为了实现自动刷新需要在 intialize_update 和 get_resp_handler 中进行添加和修改而不是这里 def set_resp_handler(self, case, resp: str): if case == RRUCmd.SET_FREQUENCY: if not RespFilter.resp_check(resp): self.warning("Frequency cannot be set properly") else: self.refresh_freq() elif case == RRUCmd.SET_TX_ATTEN: if not RespFilter.resp_check(resp): self.warning("TX Attenuation cannot be set properly") else: self.refresh_tx_gain() elif case == RRUCmd.SET_RX_GAIN: if not RespFilter.resp_check(resp): self.warning("RX's Gain Attenuation cannot be set properly") else: self.refresh_rx_gain() elif case == RRUCmd.SET_TDD_SLOT: if not RespFilter.resp_check(resp): self.warning("TDD Slot cannot be set properly") else: self.refresh_tdd_slot() elif case == RRUCmd.SET_S_SLOT: if not RespFilter.resp_check(resp): self.warning("Special Slot cannot be set properly") else: self.refresh_s_slot() def slot_connection_out_signal(self): self.connectionOutSignal.emit() def freq_back2normal(self): self.freqEdit.setStyleSheet(NonQSSStyle.valueEditStyle) def rx_back2normal(self): self.antenna_bean_arr[self.antenna_index].rxGainAttenuation2Set = self.rxGainEdit.text() self.rxGainEdit.setStyleSheet(NonQSSStyle.valueEditStyle) def tx_back2normal(self): self.antenna_bean_arr[self.antenna_index].txAttenuation2Set = self.txGainEdit.text() self.txGainEdit.setStyleSheet(NonQSSStyle.valueEditStyle) def slot_back2normal(self): if self.typeComboBox.currentText() == RRUCmd.slot_type_str[0]: self.antenna_bean_arr[self.antenna_index].tddSlot2Set = self.slotEdit.text() elif self.typeComboBox.currentText() == RRUCmd.slot_type_str[1]: self.antenna_bean_arr[self.antenna_index].sSlot2Set = self.slotEdit.text() self.slotEdit.setStyleSheet(NonQSSStyle.valueEditStyle) def display_slot(self): self.slotEdit.textChanged.disconnect() if self.typeComboBox.currentText() == RRUCmd.slot_type_str[0]: self.slotValueLabel.cmd = RRUCmd.GET_TDD_SLOT self.slotValueLabel.setText(self.antenna_bean_arr[self.antenna_index].tddSlot) if self.antenna_bean_arr[self.antenna_index].tddSlotOutDated: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.slotEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].tddSlot2Set)) elif self.typeComboBox.currentText() == RRUCmd.slot_type_str[1]: self.slotValueLabel.cmd = RRUCmd.GET_S_SLOT self.slotValueLabel.setText(self.antenna_bean_arr[self.antenna_index].sSlot) if self.antenna_bean_arr[self.antenna_index].sSlotOutDated: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.slotValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.slotEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].sSlot2Set)) self.slotEdit.textChanged.connect(self.slot_back2normal) def display(self): # RX's Gain attenuation self.rxGainValueLabel.setText(self.antenna_bean_arr[self.antenna_index].rxGainAttenuation) if self.antenna_bean_arr[self.antenna_index].rxGainAttenuationOutDated: self.rxGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.rxGainValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.rxGainEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].rxGainAttenuation2Set)) # TX's attenuation self.txGainValueLabel.setText(self.antenna_bean_arr[self.antenna_index].txAttenuation) if self.antenna_bean_arr[self.antenna_index].txAttenuationOutDated: self.txGainValueLabel.setStyleSheet(NonQSSStyle.displayValueTempStyle) else: self.txGainValueLabel.setStyleSheet(NonQSSStyle.displayValueStyle) self.txGainEdit.setText(Antenna.not_none(self.antenna_bean_arr[self.antenna_index].txAttenuation2Set)) # Slot self.display_slot() def refresh_ant_num(self): if TelRepository.telnet_instance.isTelnetLogined: self.display() @staticmethod def log_error(t_error: tuple): s_error = "" for i in t_error: s_error += str(i) + " " logging.error(s_error) def quick_refresh(self, cmd): if TelRepository.telnet_instance.isTelnetLogined: if cmd == RRUCmd.GET_FREQUENCY: self.refresh_freq() elif cmd == RRUCmd.GET_TX_ATTEN: self.refresh_tx_gain() elif cmd == RRUCmd.GET_RX_GAIN: self.refresh_rx_gain() elif cmd == RRUCmd.GET_S_SLOT: self.refresh_s_slot() elif cmd == RRUCmd.GET_TDD_SLOT: self.refresh_tdd_slot() <file_sep>/src/Telnet/Telnet.py import telnetlib import logging import time from src.Telnet.Config.TelnetConfig import TelnetConfig return_symbol = b'\r' class Telnet: timeout = 4 # Timeout Set as 4 secs delay = 0.5 isTelnetOpened = False isTelnetLogined = False loginedUserName = '' json_filename = 'Telnet' json_dict = ("host_ip", "username", "password") locked = False def __init__(self): self.tn = telnetlib.Telnet() self.tn.set_debuglevel(2) self.set_logger() self.warning = '' @staticmethod def set_logger(): logging.basicConfig(filename='../log/' + __name__ + '.log', format='[%(asctime)s-%(filename)s-%(funcName)s-%(levelname)s:%(message)s]', level=logging.DEBUG, filemode='a', datefmt='%Y-%m-%d %I:%M:%S %p') def lock_check(self): while self.locked: time.sleep(0.1) def login(self, host_ip, username, password): # Logout first if telnet opened already if self.isTelnetLogined: self.lock_check() self.logout() try: '''Lock''' print('Try to open Telnet') logging.debug('Try to open Telnet %s' % host_ip) self.locked = True self.tn.open(host_ip, port=23, timeout=TelnetConfig.LoginTimeOut) self.isTelnetOpened = True logging.debug('%s Telnet Opened' % host_ip) except Exception as argument: logging.warning('%s , Telnet Open Failed' % argument) self.warning = argument return False if username is not None and len(username) != 0: logging.debug('Try to login as %s' % username) self.tn.read_until(b'login:', timeout=TelnetConfig.LoginTimeOut) self.tn.write(username.encode('ascii') + b'\r') logging.debug('Username input') else: self.locked = False return False if password is not None and len(password) != 0: logging.debug('Try to input password') self.tn.read_until(b'password:', timeout=TelnetConfig.LoginTimeOut) logging.debug('Find assertion for password') if len(password) == 0: self.tn.write(b'\r') else: self.tn.write(password.encode('ascii') + return_symbol) logging.debug('Password input: %s' % password) else: self.locked = False return False time.sleep(self.delay) result = self._get_result() # response = self.tn.read_very_eager().decode('ascii') logging.debug(result) self.locked = False '''Lock Out''' if username in result: logging.info('%s Login Succeeded' % host_ip) self.isTelnetLogined = True self.loginedUserName = username return True elif 'incorrect' in result or 'Failed' in result: self.warning = result logging.warning('%s Login Failed' % host_ip) logging.warning(result) if self.isTelnetOpened: self.tn.close() return False else: self.warning = result logging.warning('%s Login Failed' % host_ip) logging.error(result) if self.isTelnetOpened: self.tn.close() return False def terminate_all(self): logging.info("Shut down") self.tn.close() def logout(self): self.lock_check() try: '''Lock''' self.locked = True self.tn.write("exit".encode('ascii') + return_symbol) logging.info("Logged out from %s" % self.loginedUserName) finally: self.locked = False '''UnLock''' self.terminate() def execute_command(self, command): """Send command and get response :return: None when Exception is thrown resp when response successfully received through telnet """ self.lock_check() '''Lock''' self.locked = True response = '' try: self.tn.write(command.encode('ascii') + return_symbol) logging.info("send " + command) time.sleep(self.delay) response = self._get_result() logging.info("recv " + response) except Exception as argument: logging.error(argument) response = None finally: self.locked = False '''UnLock''' return response def tap(self): """Send a return symbol to check whether the connection and login is live """ if self.isTelnetLogined: result = False try: self.lock_check() '''Lock''' self.locked = True logging.debug('Tap Starts Here') self.tn.write(return_symbol) time.sleep(TelnetConfig.TapDelay) response = self._get_result() if self.loginedUserName in response: logging.info('Login alive') result = True else: logging.info('Login dead') result = False except Exception as argument: logging.warning(argument) result = False finally: self.locked = False '''UnLock''' return result else: logging.info('Not login yet') return False def terminate(self): logging.info("Shut down") try: self.tn.close() finally: self.isTelnetLogined = False self.isTelnetOpened = False def get_warning(self): return self.warning def _get_result(self, timeout=TelnetConfig.ReadTimeOut): result = str() a = [] while True: try: b, c, d = self.tn.expect(a, timeout=timeout) result = result + str(d, encoding="gbk") if b == 0: self.tn.write(r' ') else: break except Exception as argument: logging.error(argument) break return result
e9311659b9251bab9ed5c3086024f6b4cf765b41
[ "Python" ]
25
Python
WinterOrch/RRUTerminalDemo
93bc97df9bde17ce908ff9ddb2f5e1deb2f0bae2
05aabcce8bb5fa2b9a71e9f13dc648e609e39470
refs/heads/master
<file_sep>"""Deep Q Learning Network""" import random import gym from gym import wrappers import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers import Adam, RMSprop from keras import backend as K EPISODES = 2000 class DQNAgent: def __init__(self, state_size, action_size): self.state_size = state_size self.action_size = action_size self.memory = deque(maxlen=4000) #self.reward_memory = deque(maxlen=4000) self.highest_score = { "indices" : deque(maxlen=32), "score" : deque(maxlen=32) } self.gamma = 0.98 # discount rate self.epsilon = 1.0 # exploration rate self.epsilon_min = 0.001 # epsilon = np.exp(-1 / number replays) self.epsilon_decay = 0.9905 self.learning_rate = 0.001 self.model = self._build_model() self.target_model = self._build_model() self.update_target_model() ''' def _huber_loss(self, target, prediction): # sqrt(1+error^2)-1 error = prediction - target return K.mean(K.sqrt(1+K.square(error))-1, axis=-1) ''' def cartpole_loss(self, target, prediction): r = K.cast(K.less_equal(target, -1e4), K.floatx()) return -K.mean(K.log(prediction) * (1-r) * target, axis=-1) def discounted_reward(self, rewards, gamma): ans = np.zeros_like(rewards) running_sum = 0 # compute the result backward for i in reversed(range(len(rewards))): running_sum = running_sum * gamma + rewards[i] ans[i] = running_sum return ans def _build_model(self): # Neural Net for Deep-Q learning Model model = Sequential() model.add(Dense(2, input_dim=self.state_size, activation='relu')) #model.add(Dense(32, activation='relu')) model.add(Dense(self.action_size, activation='softmax')) model.compile(loss=self.cartpole_loss, optimizer= Adam(lr=self.learning_rate)) return model def update_target_model(self): # copy weights from model to target_model self.target_model.set_weights(self.model.get_weights()) def remember(self, state, action, reward, next_state, done): self.memory.append((state, action, reward, next_state, done)) #self.reward_memory.append(reward) index = len(self.memory) - 1 try: if max(self.highest_score["score"]) <= reward: self.highest_score["score"].append(reward) self.highest_score["indices"].append(index) except ValueError: self.highest_score["score"].append(reward) self.highest_score["indices"].append(index) def act(self, state): if np.random.rand() <= self.epsilon: return random.randrange(self.action_size) act_values = self.model.predict(state) return np.argmax(act_values[0]) # returns action def replay(self, batch_size): minibatch = random.sample(self.memory, batch_size) r = [] for tup in minibatch: # List of rewards r.append(tup[2]) r = self.discounted_reward(r, self.gamma) r = (r - np.mean(r)) / np.std(r) # After discounting and normalizing rewards, add the new rewards them back into minibatch for i, tup in enumerate(minibatch): # tup[2] is the rewards in the minibatch tuple tup = list(tup) tup[2] = r[i] tup = tuple(tup) minibatch[i] = tup for state, action, reward, next_state, done in minibatch: target = self.model.predict(state) if done: target[0][action] = reward #print(target) else: # a is predicted reward of next state a = self.model.predict(next_state)[0] # t is predicted reward nof next state different model t = self.target_model.predict(next_state)[0] target[0][action] = reward + self.gamma * t[np.argmax(a)] #print(target) #print(target) # 0 -> 1 # 1 -> 0 # -1 -> 1 # -(x-1) -> 1-x target[0][1 - action] = -1e4 #print(target) # discount and normalize before self.model.fit() self.model.fit(state, target, epochs=1, verbose=0) def epsilon_update(self): if self.epsilon > self.epsilon_min: # scale = epsilon ** number replays # np.exp(-1) = epsilon ** number replays # -1 = number replays * np.log(epsilon) # epsilon = np.exp(-1 / number replays) self.epsilon *= self.epsilon_decay def load(self, name): self.model.load_weights(name) def save(self, name): self.model.save_weights(name) def highest_score(): x = deque(maxlen=32) if __name__ == "__main__": env = gym.make('CartPole-v1') #env = wrappers.Monitor(env, 'cartpolev1-experiment-4', force=True) state_size = env.observation_space.shape[0] action_size = env.action_space.n agent = DQNAgent(state_size, action_size) # agent.load("./save/cartpole-ddqn.h5") done = False batch_size = 32 for e in range(EPISODES): state = env.reset() state = np.reshape(state, [1, state_size]) for time in range(500): #env.render() action = agent.act(state) next_state, reward, done, _ = env.step(action) reward = reward if not done else -10 next_state = np.reshape(next_state, [1, state_size]) agent.remember(state, action, reward, next_state, done) state = next_state if done: agent.update_target_model() print("episode: {}/{}, score: {}, e: {:.2}" .format(e, EPISODES, time, agent.epsilon)) break if len(agent.memory) > batch_size: agent.replay(batch_size) agent.epsilon_update() # if e % 10 == 0: # agent.save("./save/cartpole-ddqn.h5") <file_sep>"""Algorithm created by Irlyue""" import gym import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers #from gym import wrappers def discounted_reward(rewards, gamma): """Compute the discounted reward.""" #print(rewards) ans = np.zeros_like(rewards) running_sum = 0 # compute the result backward for i in reversed(range(len(rewards))): #print(rewards[i]) running_sum = running_sum * gamma + rewards[i] ans[i] = running_sum #print(ans) return ans def test(): """Just a test function to make sure I'm coding the right thing. """ rewards = np.array([4, 2, 2, 1]) print(discounted_reward(rewards, 1)) # print out some help information about the environment env = gym.make('CartPole-v0') s = env.reset() print('Start state: ', s) print('Action space: ', env.action_space.n) class Agent(object): def __init__(self, input_size=4, hidden_size=2, gamma=0.95, action_size=2, alpha=0.1): self.input_size = input_size self.hidden_size = hidden_size self.gamma = gamma self.action_size = action_size self.alpha = alpha # save the hyper parameters self.params = self.__dict__.copy() # placeholders self.input_pl = tf.placeholder(tf.float32, [None, input_size]) self.action_pl = tf.placeholder(tf.int32, [None]) self.reward_pl = tf.placeholder(tf.float32, [None]) # a two-layer fully connected network hidden_layer = layers.fully_connected(self.input_pl, hidden_size, biases_initializer=None, activation_fn=tf.nn.relu) self.output = layers.fully_connected(hidden_layer, action_size, biases_initializer=None, activation_fn=tf.nn.softmax) # responsible output one_hot = tf.one_hot(self.action_pl, action_size) responsible_output = tf.reduce_sum(self.output * one_hot, axis=1) self.loss = -tf.reduce_mean(tf.log(responsible_output) * self.reward_pl) # training variables variables = tf.trainable_variables() self.variable_pls = [] for i, var in enumerate(variables): self.variable_pls.append(tf.placeholder(tf.float32)) print(variables) self.gradients = tf.gradients(self.loss, variables) solver = tf.train.AdamOptimizer(learning_rate=alpha) self.update = solver.apply_gradients(zip(self.variable_pls, variables)) def next_action(self, sess, feed_dict, greedy=False): """Pick an action based on the current state. Args: - sess: a tensorflow session - feed_dict: parameter for sess.run() - greedy: boolean, whether to take action greedily Return: Integer, action to be taken. """ ans = sess.run(self.output, feed_dict=feed_dict)[0] if greedy: return ans.argmax() else: return np.random.choice(range(self.action_size), p=ans) def show_parameters(self): """Helper function to show the hyper parameters.""" for key, value in self.params.items(): print(key, '=', value) def train(): render = False update_every = 3 print_every = 50 n_episodes = 500 rate = 0.01 running_reward = 0.0 tf.reset_default_graph() agent = Agent(hidden_size=10, alpha=1e-1, gamma=0.95) agent.show_parameters() env = gym.make('CartPole-v0') #env = wrappers.Monitor(env, 'tmp/trial/', force=True) with tf.Session() as sess: tf.global_variables_initializer().run() grad_buffer = sess.run(tf.trainable_variables()) for idx in range(len(grad_buffer)): grad_buffer[idx] *= 0 for i in range(n_episodes): s = env.reset() state_history = [] reward_history = [] action_history = [] current_reward = 0 while True: feed_dict = {agent.input_pl: [s]} greedy = False action = agent.next_action(sess, feed_dict, greedy=greedy) snext, r, done, _ = env.step(action) if render and i % 50 == 0: env.render() current_reward += r state_history.append(s) reward_history.append(r) action_history.append(action) s = snext if done: state_history = np.array(state_history) rewards = discounted_reward(reward_history, agent.gamma) # normalizing the reward really helps rewards = (rewards - np.mean(rewards)) / np.std(rewards) feed_dict = { agent.reward_pl: rewards, agent.action_pl: action_history, agent.input_pl: state_history } episode_gradients = sess.run(agent.gradients, feed_dict=feed_dict) for idx, grad in enumerate(episode_gradients): grad_buffer[idx] += grad if i % update_every == 0: feed_dict = dict(zip(agent.variable_pls, grad_buffer)) sess.run(agent.update, feed_dict=feed_dict) # reset the buffer to zero for idx in range(len(grad_buffer)): grad_buffer[idx] *= 0 if i % print_every == 0: print('episode %d, current_reward %d, running_reward %d' % (i, current_reward, running_reward)) break running_reward = rate * current_reward + (1 - rate) * running_reward if __name__ == '__main__': test() train()<file_sep>""" Simple Q Learning Network """ import random import gym import numpy as np from collections import deque import keras from keras.models import Sequential from keras.layers import Dense from keras.optimizers import SGD from keras import backend as K from gym import wrappers EPISODES = 1000 class DQNAgent: def __init__(self, state_size, action_size, batch_size): self.state_size = state_size self.action_size = action_size self.batch_size = batch_size self.MEMORY = deque(maxlen=100000) self.gamma = 0.99 # discount rate self.epsilon = 1.0 # exploration rate self.epsilon_min = 0.01 # epsilon = np.exp(-1 / number replays) self.epsilon_decay = 0.999 self.learning_rate = 0.00025 self.model = self._build_model() def discounted_reward(self, rewards, gamma): ans = np.zeros_like(rewards) running_sum = 0 # compute the result backward for i in reversed(range(len(rewards))): running_sum = running_sum * gamma + rewards[i] ans[i] = running_sum return ans def cartpole_loss(self, target, prediction): r = K.cast(K.less_equal(target, -1e4), K.floatx()) # create array of target # If target[0] is greater than target[1], nothing changes. # If target [0] is less than target[1], target[0] = 0 #target[0] *= K.cast(K.greater_equal(target[0], target[1]), K.floatx()) return (target - prediction * (1 - r)) ** 2 #return -K.mean(K.log(prediction + 0.001) * K.sum((1-r) * target), axis=-1) #good_probabilities = K.sum(prediction * (1-r)) #log_prob = K.log(good_probabilities) #return -K.sum(log_prob)a def _build_model(self): # Neural Net for Deep-Q learning Model model = Sequential() model.add(Dense(units=64, input_dim=self.state_size, activation='relu')) #model.add(Dense(24, activation='relu')) #model.add(keras.layers.normalization.BatchNormalization()) model.add(Dense(units=self.action_size, activation='linear')) model.compile(loss='mse', optimizer=keras.optimizers.RMSprop(lr=self.learning_rate)) return model def act(self, state): if np.random.rand() <= self.epsilon: return random.randrange(self.action_size) #predictOne act_values = self.model.predict(state.reshape(1, self.state_size)).flatten() return np.argmax(act_values[0]) # returns action #input is state and action, output is reward, just like in replay() use target[0][action] def replay_episode(self, state_history, reward_history, action_history, next_state, done): #reward = self.discounted_reward(reward_history, self.gamma) #reward = (reward - np.mean(reward)) / np.std(reward) target_f = np.zeros((1, 2)) debug1 = self.model.predict(state_history[-1]) for i, action in enumerate(action_history): if done: target_f[0][action] = reward_history[i] else: target_f[0][action] = reward_history[i] + self.gamma * numpy.amax(self.model.predict(next_state[i])) #target_f[0][1 - action] = -1e4 self.model.fit(state_history[i], target_f, epochs=1, verbose=0) debug2 = self.model.predict(state_history[-1]) #print("{} + {}, {} = {}".format(debug1, action_history[-1], reward[-1], debug2)) def epsilon_update(self): if self.epsilon > self.epsilon_min: # scale = epsilon ** number replays # np.exp(-1) = epsilon ** number replays # -1 = number replays * np.log(epsilon) # epsilon = np.exp(-1 / number replays) self.epsilon *= self.epsilon_decay def load(self, name): self.model.load_weights(name) def save(self, name): self.model.save_weights(name) if __name__ == "__main__": env = gym.make('CartPole-v0') # RIP openai gym :( #env = wrappers.Monitor(env, 'cartpolev0-experiment', force=True) state_size = env.observation_space.shape[0] action_size = env.action_space.n batch_size = 64 agent = DQNAgent(state_size, action_size, batch_size) # agent.load("./save/cartpole-dqn.h5") done = False for e in range(EPISODES): state = env.reset() state = np.reshape(state, [1, state_size]) state_history = [] reward_history = [] action_history = [] pred_next_state = [] for time in range(500): #env.render() # Agent chooses to act either randomly or the best action based on epsilon # Environment updates, get state and reward action = agent.act(state) next_state, reward, done, _ = env.step(action) #if done and time < 199: # reward = -10 #done and print(reward) next_state = np.reshape(next_state, [1, state_size]) if done: next_state = None # Append states, rewards, and action to history state_history.append(state) reward_history.append(reward) action_history.append(action) pred_next_state.append(next_state) state = next_state if done: print("episode: {}/{}, score: {}, e: {:.2}" .format(e, EPISODES, time, agent.epsilon)) break agent.replay_episode(state_history, reward_history, action_history, pred_next_state, done) agent.epsilon_update() # if e % 10 == 0: # agent.save("./save/cartpole-dqn.h5") <file_sep>import numpy as np import gym from collections import deque # Create model from keras.optimizers import RMSprop from keras.layers import * from keras.models import Sequential class Model: # All model stuff and networking goes here def __init__(self, state_size, action_size): self.state_size = state_size self.action_size = action_size self.learning_rate = 0.00025 self.model = self.create_model() def create_model(self): model = Sequential() model.add(Dense(64, activation='relu', input_dim=self.state_size)) model.add(Dense(self.action_size, activation='linear')) model.compile(loss='mse', optimizer=RMSprop(lr=self.learning_rate)) return model def train(self, states, target, epochs=1, verbose=0): self.model.fit(states, target, batch_size=64, epochs=epochs, verbose=verbose) def predict(self, states): return self.model.predict(states) class Memory: """docstring for memory""" samples = dequq(maxlen=MEMORY_LEN) def __init__(self): super(memory, self).__init__() def add(self, sample): self.samples.append(sample) def sample(self, n) # returns a random sample of batch size n to be replayed n = min(n, len(self.samples)) return random.sample(self.samples, n) MEMORY_LEN = 100000 BATCH_SIZE = 64 GAMMA = .999 EPSILON_MAX = 1. EPSILON_MIN = 0.001 LAMBDA = 0.001 class Agent: # Needs Act, Remember, and replay # variables for epsilon update steps = 0 epsilon = EPSILON_MAX def __init__(self, state_size, action_size): self.state_size = state_size self.action_size = action_size self.memory = Memory(MEMORY_LEN) self.model = Model(state_size, action_size) def act(self, state): if np.random.rand() <= self.epsilon: return np.random.randint(0, self.action_size-1) else: return nump.argmax(self.model.predict(state)) def observe(self, mem_input): self.memory.add(mem_input) def epsilon_update(self): self.steps += 1 self.epsilon = EPSILON_MIN + (EPSILON_MAX - EPSILON_MIN) * np.exp(-LAMBDA * self.steps) def replay(self): batch = self.memory.sample(BATCH_SIZE) batchLen = len(batch) # for the last state_ which DNE no_state = np.zeros(self.state_size) states = np.array([o[0] for o in batch ]) # o[3] is next state so if o[3] DNE (last state) then have an array of zeros in states_ states_ = np.array([ (no_state if o[3] is None else o[3]) for o in batch ]) predict = self.model.predict(states) predict_ = self.model.predict(states_) x = np.zeros((batchLen, self.state_size)) y = np.zeros((batchLen, self.action_size))
3843f547d70dc358c48b0d3185dea9acb76b7651
[ "Python" ]
4
Python
jackchen0226/reinforcement-learning
08638ce7f048b24f5067bb9ead8a20e1921a7bd4
8651a29558150ab7d62514c58bf8d1c5e192db02
refs/heads/master
<repo_name>rolljee/ogame-blog<file_sep>/content/blog/plugins/index.md --- title: Plugins date: '2018-01-21T22:21:00.004Z' --- # Abordons l'aspect plugins L'interface d'ogame comporte en elle même beaucoup d'informations, mais naturellement nous en temps que joueur en voulons toujours plus... C'est pour cela que dans cette partie, je vais aborder une liste complètement arbitraire, puisque je vais vous parler des plugins que j'utilise personnellement ! Ils se comptent sur les doigts d'une main, mais à eux tous ils améliorement drastiquement votre experience du jeu. Je vais essayer de survoler l'ensemble des fonctionnalités que chacun apporte au jeu et avec un peu de chance cela fera naître en vous l'envie de l'utiliser ! (du moins je l'espère). Pour cela il va falloir que vous choisissiez votre naviguateur, pour ces extentions il vous faudra prendre google chrome. 1. [Antigame-origine](https://chrome.google.com/webstore/detail/antigamereborn/mhfbpacbhjchkjeopjfgdhckepclcfll) maintenant appelé Antigame-reborn car le développement à repris !!! Enfin. 2. OGame Nearby Players 3. OGame UI++ 4. TamperMonkey un utilitaire pour rajouter des scripts (on en reparlera dans la catégorie qui lui est dédié) A elles quatres, elles permettent d'avoir tous ce que Ogame ne vous offre pas de base. Laissez moi vous l'expliquer plus en détails. ## Antigame Reborn Surement le plugin d'ogame offrant le plus de fonctionnalités, avec l'appuie de screenshot je vais vous expliquer les features que j'utilise le plus. <file_sep>/.github/deploy.workflow workflow "Deploy to Github Pages" { on = "push" resolves = ["Deploy to GH"] } action "Deploy to GH" { uses = "actions/npm@de7a3705a9510ee12702e124482fad6af249991b" runs = "npm run deploy" } <file_sep>/content/blog/introduction/index.md --- title: Introduction à Ogame date: '2018-01-20T22:21:00.004Z' --- Nous allons dans ce blog aborder les fondamentaux de Ogame. ![Ogame screenshot](./ogame-screen.jpg) Je vais essayer dans chacun des blogs post de fournir un bon nombre d'information sur tous les différents type de gameplay auquel nous pouvons faire face durant votre sejour sur un univers et aborder: - comment on joue ? - Les différentes façon de jouer - Les tips & trick relatif au bon début de jeu - Les différents mots clés du jeu Rentrons tout de suite dans le vif du sujet et ne perdons pas de temps ! Avant de pouvoir parler en profondeur de chaque sujet, il faut nous poser question très une simple ... ## Mais comment on joue à ce jeu ? > Bah c'est facile tu cliques sur des icones et tu attends 😀 Sans rire, il y beaucoup de vrai dans cette petite citation, mais heuresement c'est loin d'être la seule chose que tu vas faire ! > Tu vas aussi regarder des timers et strésser quand il y aura un gros triangle rouge sur ton interface 😀 Lorsque que tu auras crée ton compte, tu arriveras sur l'interface des ressources, normalement ça devrait ressembler à cela ![base](./base.png) Pour traiter les différents style de jeu au cas par cas, il nous faut tout de même un petit aperçu de base ! ![Mines](./mines.png) Voici vos bâtiments principaux, les mines et les différents moyen de produire de l'énergie. Le concept de base est très simple, plus le niveau de tes mines est haut que ce soit, le métal le cristal, ou le deut ... plus tu vas produire de ressources dans ce jeu on parlera toujours de production à l'heure. ## Quels sont Les façons de jouer à Ogame ? Il existe 3 grandes familles de joueurs pour qu'ensuite chacuns des différents style de jeu dérive d'une des classes mère. - Les Raideurs - Les Mineurs Pour les Raiders nous avons les sous-catégories reconnues par la communautée - Raiders aggro - Raiders défensif Pour les mineurs nous avons - Mineur aggro - Mineur défensif (ou aussi appellé Turtle). - Les deutiers (Je n'ai pas une grande expérience car je n'ai jamais joué de compte purement dans ce style, mais nous verrons que beaucoup de concept reste similaire, mais on détaillera quand même l'essentiel) Jusqu'à maintenant rien de bien bien compliqué, mais poser les bases c'est toujours important ! J'ai toujours appriécié le mineur aggressif ! 😀 Un style un peu tapette en early mais qui fait vite fureur lorsque votre production de matière première devient conséquente sur chacune de vos planètes. Je commence l'univers sur des bases minières, en montant l'intégralité des bâtiments de production et en essayant de récupérer le plus de planètes possible en early game généralement placée en X:XXX:8 ou 9 pour que celle-ci est un maximum de place. Mais nous reviendront sur le nombres de place des planètes et leur positionement dans le système solaire plus tard. Lorsque que j'ai arrété mon compte sur Spica il avait plus de 8 millions de points. J'ai récemment recommencer à jouer au jeu et je suis parti sur l'univers Mensa les screenshots que vous verrez à l'appuie sur les différentes catégories seront issue de ce compte. <file_sep>/README.md # An Ogame blog. 1. Find useful stuff about Ogame here.
80c10666f30dad506261b4b785e1dbfefe76f4fe
[ "Markdown", "HCL" ]
4
Markdown
rolljee/ogame-blog
0692159558af752f6b4c16309d688df809e364ed
8e2bf7ff62fdf6f3b1dc83997d8f5c8a14cac4d7
refs/heads/main
<file_sep>function tmp_comp_grad A=rand(3,3); R=expmso3(rand(3,1)); eps = 1e-8; M = grad(R,A); M_num = grad_num(R,A,eps); disp(norm(M_num-M)); end function J = obj(R,A) tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R,A) % this actually computes the negative gradient M=vee(R'*A-A'*R); end function M = grad_num(R,A,eps) % this actually computes the negative gradient eps = 1e-8; II=eye(3); M=zeros(3,1); for i=1:3 M(i)=(obj(R*expmso3(eps*II(:,i)),A)-obj(R,A))/eps; end M=-M; end <file_sep>% effects of varying h_0 clear all; close all; A = [ 0.7572 0.5678 0.5308 0.7537 0.0759 0.7792 0.3804 0.0540 0.9340]; r = [0.7915 -0.3101 0.5267]; [U S V]=psvd(A); R0 = U*expm(0.9*pi*hat(r))*V'; J=eye(3); T = 30 flag_update_h = true; flag_display_progress = true; flag_stop =1; hk = 0.1; p = 4; h0_vec=[0.001 0.05 0.01 0.1 0.4]; for i=1:length(h0_vec) h0 = h0_vec(i) [t, JJ, errR, t_elapsed, N_grad_comp] = vigdSO3(A,p,J,R0,h0,T,flag_update_h,flag_display_progress,flag_stop); t_vec{i} = t; J_vec{i} = JJ; errR_vec{i} = errR; t_elapsed_vec{i} = t_elapsed; N_grad_comp_vec{i} = N_grad_comp; disp([hk log10(JJ(end)) log10(errR(end)) t_elapsed N_grad_comp(end)]); hold on; end save comp_2 % figure(1);plot(t ,JJ, 'k'); % set(gca,'xscale','log','yscale','log'); % hold on; % figure(2);plot(t, errR, 'k'); % set(gca,'xscale','log','yscale','log'); % hold on; % <file_sep>function [t, JJ, errR, t_elapsed] = rk4(A,p,J,R0,h,N) [U S V]=psvd(A); R_opt = U*V'; JJ_opt = obj(R_opt,A); Jd=trace(J)/2*eye(3)-J;%nonstandard inertia matrix options = optimoptions(@lsqnonlin,'StepTolerance', 1e-4, 'Display', 'off'); N_grad_comp = 0; C=1; t=1:h:(N-1)*h+1; %% W0 = zeros(3,1); X=zeros(12,N); X(:,1)= [reshape(R0,9,1); W0]; % options = odeset('RelTol',1e-8,'AbsTol',1e-8); tic; for k=1:N-1 F1 = eom_EL_Breg(t(k),X(:,k),A,p,J,C); F2 = eom_EL_Breg(t(k)+h/2,X(:,k)+h/2*F1,A,p,J,C); F3 = eom_EL_Breg(t(k)+h/2,X(:,k)+h/2*F2,A,p,J,C); F4 = eom_EL_Breg(t(k)+h,X(:,k)+h*F3,A,p,J,C); X(:,k+1) = X(:,k) + (h/6)*(F1 + 2*F2 + 2*F3 + F4); end t_elapsed=toc; for k=1:N R(:,:,k)=reshape(X(1:9,k),3,3); JJ(k) = obj(R(:,:,k),A)-JJ_opt; errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); end end function X_dot = eom_EL_Breg(t,X,A,p,J,C) R=reshape(X(1:9),3,3); W=X(10:12); M = grad(R,A); R_dot = R*hat(W); W_dot = J\( -(p+1)/t*J*W - hat(W)*J*W + C*p^2*t^(p-2)*M); X_dot = [reshape(R_dot,9,1); W_dot]; end function J = obj(R,A) tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R,A) global N_grad_comp N_grad_comp = N_grad_comp+1; M=vee(R'*A-A'*R); end <file_sep>\documentclass[letterpaper, 10pt, conference]{ieeeconf} \IEEEoverridecommandlockouts \overrideIEEEmargins \usepackage{amsmath,amssymb,url} \usepackage{graphicx,subfigure} \usepackage{color} %\usepackage[hidelinks]{hyperref} \usepackage{cleveref} \newcommand{\norm}[1]{\ensuremath{\left\| #1 \right\|}} \newcommand{\abs}[1]{\ensuremath{\left| #1 \right|}} \newcommand{\bracket}[1]{\ensuremath{\left[ #1 \right]}} \newcommand{\braces}[1]{\ensuremath{\left\{ #1 \right\}}} \newcommand{\parenth}[1]{\ensuremath{\left( #1 \right)}} \newcommand{\ip}[1]{\ensuremath{\langle #1 \rangle}} \newcommand{\tr}[1]{\mbox{tr}\ensuremath{\negthickspace\bracket{#1}}} \newcommand{\deriv}[2]{\ensuremath{\frac{\partial #1}{\partial #2}}} \newcommand{\G}{\ensuremath{\mathsf{G}}} \newcommand{\SO}{\ensuremath{\mathsf{SO(3)}}} \newcommand{\T}{\ensuremath{\mathsf{T}}} \renewcommand{\L}{\ensuremath{\mathsf{L}}} \newcommand{\so}{\ensuremath{\mathfrak{so}(3)}} \newcommand{\SE}{\ensuremath{\mathsf{SE(3)}}} \newcommand{\se}{\ensuremath{\mathfrak{se}(3)}} \renewcommand{\Re}{\ensuremath{\mathbb{R}}} \newcommand{\Sph}{\ensuremath{\mathsf{S}}} \newcommand{\aSE}[2]{\ensuremath{\begin{bmatrix}#1&#2\\0&1\end{bmatrix}}} \newcommand{\ase}[2]{\ensuremath{\begin{bmatrix}#1&#2\\0&0\end{bmatrix}}} \newcommand{\D}{\ensuremath{\mathbf{D}}} \newcommand{\pair}[1]{\ensuremath{\left\langle #1 \right\rangle}} \newcommand{\met}[1]{\ensuremath{\langle\!\langle #1 \rangle\!\rangle}} \newcommand{\Ad}{\ensuremath{\mathrm{Ad}}} \newcommand{\ad}{\ensuremath{\mathrm{ad}}} \newcommand{\g}{\ensuremath{\mathfrak{g}}} \DeclareMathOperator*{\argmin}{arg\,min} \newcommand\encircle[1]{% \tikz[baseline=(X.base)] \node (X) [draw, shape=circle, inner sep=0] {#1};} \newcommand{\TODO}[1]{\vspace{0.1cm}\newline\fbox{\parbox{0.97\columnwidth}{\textbf{TODO:} #1 }}\vspace*{0.1cm}\newline} % \newcommand{\tao}[1]{[{\color{blue} Tao: #1}]} %\renewcommand{\tao}[1]{} % \newcommand{\leok}[1]{[{\color{orange} Leok: #1}]} %\renewcommand{\leok}[1]{} % \newcommand{\EditTL}[1]{[{\color{red} TL: #1}]} %\renewcommand{\EditTL}[1]{{\protect #1}} \title{\LARGE \bf Variational Symplectic Accelerated Optimization on Lie Groups} \author{% <NAME>, <NAME>, and <NAME>% \thanks{<NAME>, Mechanical and Aerospace Engineering, George Washington University, Washington, DC 20052. {\tt <EMAIL>}}% \thanks{<NAME>, Mathematics, Georgia Institute of Technology, Atlanta, GA 30332. {\tt <EMAIL>}} \thanks{<NAME>, Mathematics, University of California--San Diego, La Jolla, CA 92093. {\tt <EMAIL>}} \thanks{The research was partially supported by NSF under the grants CNS-1837382, CMMI-1760928, DMS-1813635, IIP-1747760, DMS-1847802, ECCS-1936776, and by AFOSR FA9550-18-1-0288 and DoD 13106725.} } \newcommand{\RomanNumeralCaps}[1]{\textup{\uppercase\expandafter{\romannumeral#1}}} \newcommand{\RI}{\RomanNumeralCaps{1}} \newcommand{\RII}{\RomanNumeralCaps{2}} \newcommand{\RIII}{\RomanNumeralCaps{3}} \newtheorem{definition}{Definition} \newtheorem{lem}{Lemma} \newtheorem{prop}{Proposition} \newtheorem{remark}{Remark} \graphicspath{{./figs/}} %\color{white}\pagecolor{black} \begin{document} \allowdisplaybreaks \maketitle \thispagestyle{empty} \pagestyle{empty} \begin{abstract} There has been significant interest in generalizations of the Nesterov accelerated gradient descent algorithm due to its improved performance guarantee compared to the standard gradient descent algorithm, and its applicability to large scale optimization problems arising in deep learning. A particularly fruitful approach is based on numerical discretizations of differential equations that describe the continuous time limit of the Nesterov algorithm, and a generalization involving time-dependent Bregman Lagrangian and Hamiltonian dynamics that converges at an arbitrarily fast rate to the minimum. We develop a Lie group variational discretization based on an extended path space formulation of the Bregman Lagrangian on Lie groups, and analyze its computational properties with two examples in attitude determination and vision-based localization. \end{abstract} \section{Introduction} Nesterov's accelerated gradient descent algorithm~\cite{Nes83} was introduced in 1983, and it exhibits the convergence rate of $\mathcal{O}(1/k^2)$ when applied to a convex objective function, which is faster than the $\mathcal{O}(1/k)$ convergence rate of standard gradient descent methods. It is shown in~\cite{nesterov2003introductory} that this rate of convergence is optimal for the class of first-order gradient methods. This improved rate of convergence over the standard gradient method is referred to as acceleration, and there is a great interest in developing systematic approaches to the construction of efficient accelerated optimization algorithms, driven by potential applications in deep learning. A continuous time limit of the Nesterov algorithm was studied in~\cite{su2016differential}, whose flow converges to the minimum at $\mathcal{O}(1/t^2)$, and this was generalized in~\cite{wibisono2016variational} using a time-dependent Bregman Lagrangian and Hamiltonian to obtain higher-order convergence of $\mathcal{O}(1/t^p)$ for arbitrary $p\geq 2$. However, it has been shown that discretizing Bregman dynamics is not trivial as common discretizations fail to achieve the higher convergence rate guaranteed in the continuous time limit. As such, there have been several attempts to construct accelerated optimization algorithms using geometric structure-preserving discretizations of the Bregman dynamics~\cite{betancourt2018symplectic}. A natural class\footnote{Note that other classes of discretization methods exist, such as those based on splitting (e.g., \cite{HaLuWa2006,tao2020variational}) and composition (e.g., \cite{tao2010nonintrusive}), and such approaches also arise in variational discretization \cite{MarWesAN01}.} of geometric numerical integrators~\cite{HaLuWa2006} for discretizing such Lagrangian or Hamiltonian systems is variational integrators~\cite{MarWesAN01,LeZh2009}. They are constructed by a discrete analogue of Hamilton's variational principle, and therefore, their numerical flows are symplectic. They also satisfy a discrete Noether's theorem that relates symmetries with momentum conservation properties, and further exhibit excellent exponentially long-time energy stability. One complication is that such methods are typically developed for autonomous Lagrangian and Hamiltonian systems on the Euclidean space. To address this, variational integrators have been developed on a Lie group~\cite{LeeLeoCMAME07}, and time-adaptive Hamiltonian variational integrators have been proposed~\cite{DuScLe2021}. In this paper, we focus on the optimization problem to minimize an objective function defined on an a Lie group. Optimization on a manifold or a Lie group appears in various areas of machine learning, engineering, and applied mathematics~\cite{hu2020brief,absil2009optimization}, and respecting the geometric structure of manifolds yields more accurate and efficient optimization schemes, when compared to methods based on embeddings in a higher-dimensional Euclidean space with algebraic constraints, or using local coordinates. In particular, we formulate a Bregman Lagrangian system on a Lie group, and we further discretize it using the extended Lie group variational integrator to construct an intrinsic accelerated optimization scheme, which inherits the desirable properties of variational integrators while also preserving the group structure. Compared with~\cite{DuScLe2021} where the evolution of the stepsize is prescribed, the proposed scheme adaptively adjusts the stepsize according to the extended variational principle at the cost of increased computational load. The resulting computational properties of the proposed approach are analyzed with two examples in attitude determination and vision-based localization, where it is observed that the scheme exhibits an interesting convergence of the adaptive stepsize, and the variational discretization provides robustness against the choice of stepsize, which is exploited in the numerical experiments to improve computational efficiency. We also present benchmark studies against other discretization schemes applied to the Bregman dynamics, and other accelerated optimization schemes on a Lie group~\cite{tao2020variational}. \section{Extended Lagrangian Mechanics} This section presents Lagrangian mechanics for non-autonomous systems on a Lie group. It is referred to as \textit{extended} Lagrangian mechanics as the variational principle is extended to include reparamerization of time~\cite{MarWesAN01}. These are developed in both of continuous-time and discrete-time formulations. The latter yields a \textit{Lie group variational integrator}~\cite{LeeLeoCMAME07}, which will be applied to accelerated optimization using the Bregman Lagrangian in the next section. Consider an $n$-dimensional Lie group $\G$. Let $\g$ be the associated Lie algebra, or the tangent space at the identity, i.e., $\g = \T_e\G$. Consider a left trivialization of the tangent bundle of the group $\T\G \simeq \G\times \g$, $(g,\dot g)\mapsto (g, L_{g^{-1}}\dot g)\equiv(g,\xi)$ More specifically, let $\L:\G\times\G\rightarrow\G$ be the left action defined such that $\L_g h = gh$ for $g,h\in\G$. Then the left trivialization is a map $(g,\dot g)\mapsto (g, L_{g^{-1}}\dot g)\equiv(g,\xi)$, where $\xi\in\g$, and the kinematics equation can be written as \begin{align} \dot g = g\xi. \label{eqn:g_dot} \end{align} Further, suppose $\g$ is equipped with an inner product $\pair{\cdot, \cdot}$, which induces an inner product on $\T_g\G$ via left trivialization. For any $v,w\in\T_g\G$, $\pair{w,v}_{\T_g\G} = \pair{ \T_g \L_{g^{-1}} v, \T_g \L_{g^{-1}} w}_\g$. Given the inner product, we identify $\g\simeq \g^*$ and $\T_g \G \simeq \T^*_g \G\simeq G\times \g^*$ via the Riesz representation. Throughout this paper, the pairing is also denoted by the dot product $\cdot$. Let $\mathbf{J}:\g\rightarrow\g^*$ be chosen such that $\pair{\mathbf{J}(\xi),\zeta}$ is positive-definite and symmetric as a bilinear form of $\xi,\zeta\in\g$. Define the metric $\met{\cdot,\cdot}:\g\times\g\rightarrow\Re$ with $\met{\xi,\zeta} = \pair{\mathbf{J}(\xi),\zeta}$. This serves as a left-invariant Riemmanian metric on $\G$. Also $\|\xi\|^2 = \met{\xi,\xi}$ for any $\xi\in\g$. The adjoint operator is denoted by $\Ad_g:\g\rightarrow\g$, and the ad operator is denoted by $\ad_\xi:\g\rightarrow\g$. See, for example~\cite{MarRat99} for detailed preliminaries. \subsection{Continuous-Time Extended Lagrangian Mechanics} Consider a non-autonomous (left-trivialized) Lagrangian $L(t,g,\xi):\Re\times\G\times\g\rightarrow \Re$ on the \textit{extended state space}. The corresponding \textit{extended path space} is composed of the curves $(c_t(a),c_g(a))$ on $\Re\times \G$ parameterized by $a>0$. To ensure that the reparameterized time increases monotonically, we require $c'_t(a) > 0$. For a given time interval $[t_0,t_f]$, the corresponding interval $[a_0,a_f]$ for $a$ is chosen such that $t_0=c_t(a_0)$ and $t_f=c_t(a_f)$. For any path $(c_t(a),c_g(a))$ over $[a_0,a_f]$ in the extended space, the \textit{associated curve} is \begin{align} g(t) = c_g(c_t^{-1}(t)),\label{eqn:ac} \end{align} on $\G$ over the time interval $[t_0,t_f]$. For a given extended path, define the \textit{extended action integral} as \begin{align} \mathfrak{G}(c_t,c_g) = \int_{t_0}^{t_f} L(t,g,\xi)\bigg|_{g(t) = c_g(c_t^{-1}(t))} dt,\label{eqn:AI} \end{align} where the Lagrangian is evaluated on the associated curve \eqref{eqn:ac}, and $\xi$ satisfies the kinematics equation \eqref{eqn:g_dot}. Taking the variation of $\mathfrak{G}$ with respect to the extended path, we obtain the Euler--Lagrange equation according to the variational principle in the extended phase space. As discussed in~\cite[Sec. 4.2.2]{MarWesAN01}, the resulting Euler--Lagrange equations depend only on the associated curve \eqref{eqn:ac}, not on the extended path $(c_t,c_g)$ itself, and the variational principle does not dictate how the curve should be reparameterized. Further, the resulting Euler--Lagrange equation share the exactly same form as (unextended) Lagrangian mechanics for the associated curve. As such, the Euler--Lagrange equation for non-autonomous Lagrangian $L(t,g,\xi):\Re\times\G\times\g\rightarrow \Re$ can be written as \begin{align} \frac{d}{dt}\!\parenth{\deriv{L}{\xi}} - \ad^*_\xi \deriv{L}{\xi} - \T^*_e \L_g (\D_g L) = 0, \label{eqn:EL} \end{align} where $\D_g$ stands for the differential with respect to $g$ (see~\cite[Sec. 8.6.3]{LeeLeo17} for derivation of the above equation for autonomous Lagrangians). Introducing the Legendre transform $\mu = \deriv{L}{\xi} \in\g^*$, and assuming that it is invertible, the Euler--Lagrange equation can be rewritten as \begin{align} \dot \mu - \ad^*_{\xi} \mu - \T^*_e \L_g (\D_g L) = 0. \label{eqn:HE} \end{align} \subsection{Extended Lie Group Variational Integrator} Variational integrators are geometric numerical integration schemes that can be viewed as discrete-time mechanics derived from a discretization of the variational principle for Lagrangian mechanics~\cite{MarWesAN01}. The discrete-time flows of variational integrators are symplectic and they exhibit a discrete analogue of Noether's theorem. This provides long-term structural stability in the resulting numerical simulations. For Lagrangian mechanics evolving on a Lie group, the corresponding Lie group variational integrators were developed in~\cite{LeeLeoCMAME07}. Here, we develop extended Lie group variational integrators by discretizing the extended variational principle presented above, following the general framework of~\cite{MarWesAN01}. The \textit{extended discrete path space} is composed of the sequence $\{(t_k, g_k)\}_{k=0}^N$ on $\Re\times\G$, satisfying $t_{k+1}>t_k$. Next, the discrete kinematics equation is chosen to be \begin{align} g_{k+1} = g_k f_k, \label{eqn:gkp} \end{align} for $f_k \in\G$ representing the relative update over a single timestep. The discrete Lagrangian $L_d(t_k, t_{k+1}, g_k, f_k): \Re\times\Re\times\G\times\G\rightarrow \Re$ is chosen such that the following \textit{extended discrete action sum} \begin{align} \mathfrak{G}_d(\{(t_k, g_k)\}_{k=0}^N) = \sum_{k=0}^{N-1} L_d(t_k, t_{k+1}, g_k, f_k), \label{eqn:Gd} \end{align} approximates \eqref{eqn:AI}. \begin{prop} The discrete path $\{(g_k,f_k)\}_{k=0}^{N-1}$ that extremizes the discrete action sum \eqref{eqn:Gd} subject to fixed endpoints satisfies the following discrete Euler--Lagrange equation, \begin{gather} \T^*_e\L_{g_k}(\D_{g_k} L_{d_k})- \Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} L_{d_k}))\nonumber \\ + \T^*_e\L_{f_{k-1}}(\D_{f_{k-1}} L_{d_{k-1}}) =0,\label{eqn:DEL}\\ \D_{t_k} L_{d_{k-1}} + \D_{t_k} L_{d_k} = 0, \label{eqn:DELt} \end{gather} which together with the discrete kinematic equation \eqref{eqn:gkp} defines an extended Lie group variational integrator. \end{prop} \begin{proof} From \eqref{eqn:gkp}, $\delta f_k = - g_k^{-1}( \delta g_k ) g_k^{-1} g_{k+1} + g_k^{-1}\delta g_{k+1}$. Since $\delta g_k$ can be written as $\delta g_k = g_k \eta_k $ for $\eta_k\in \g$, \begin{align} f_k^{-1}\delta f_k = -\Ad_{f_k^{-1}} \eta_k + \eta_{k+1}.\label{eqn:del_fk} \end{align} Take the variation of \eqref{eqn:Gd} and substitute \eqref{eqn:del_fk} to obtain \begin{align*} \delta \mathfrak{G}_d = \sum_{k=0}^{N-1} & \T^*_e\L_{g_k}(\D_{g_k} L_{d_k}) \cdot \eta_k \\ & + \T^*_e\L_{f_k}(\D_{f_k} L_{d_k}) \cdot (-\Ad_{f_k^{-1}} \eta_k + \eta_{k+1}) \\ & + \D_{t_k} L_{d_k}\cdot \delta t_k + \D_{t_{k+1}} \D_{d_k}\cdot \delta t_{k+1}. \end{align*} Since the endpoints are fixed, we have $\eta_0=0$ and $\delta t_0 = 0$. Therefore in the above expression, the range of summation for the terms paired with $\eta_k$ and $\delta t_k$ can be reduced to $1\leq k\leq N-1$. Also, using $\eta_N=0$ and $\delta t_N=0$, for the other terms paired with $\eta_{k+1}$ and $\delta t_{k+1}$, the terms can be reindexed by reducing the subscripts by one and summed over the same range. % Therefore, %\begin{align*} %\delta \mathfrak{G}_d = \sum_{k=1}^{N-1} %& \big\{ \T^*_e\L_{g_k}(\D_{g_k} L_{d_k})- \Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} L_{d_k})) \\ %& + (\T^*_e\L_{f_{k-1}}(\D_{f_{k-1}} L_{d_{k-1}})) \big\} \cdot \eta_{k} \\ %& + \{ \D_{t_k} L_{d_k} + \D_{t_{k}} \D_{d_{k-1}} \} \delta t_k. % \end{align*} According to the variational principle, $\delta\mathfrak{G}_d = 0$ for any $\eta_k$ and $\delta t_k$, which yields \eqref{eqn:DEL} and \eqref{eqn:DELt}. \end{proof} The most notable difference compared to the continuous-time counterpart is that in addition to the discrete Euler--Lagrange equation \eqref{eqn:DEL}, we have the additional equation \eqref{eqn:DELt} for the evolution of the discrete time. This is because the discrete action sum $\mathfrak{G}_d$ depends on the complete extended path $\{(t_k,g_k)\}_{k=1}^N$. Whereas the continuous-time action $\mathfrak{G}$ is only a function of the associated curve \eqref{eqn:ac}. The discrete Euler--Lagrange equation for the discrete time~\eqref{eqn:DELt} is associated with an energy. Define the discrete energy to be \begin{align} E^+_k &= - \D_{t_{k+1}} L_{d_k},\label{eqn:Ep}\\ E^-_k &= \D_{t_{k}} L_{d_k}.\label{eqn:Em} \end{align} Then, \eqref{eqn:DELt} can be rewritten as \begin{align} E^+_{k-1} = E^-_k,\label{eqn:DELE} \end{align} which reflects the evolution of the discrete energy. When the discrete Lagrangian is autonomous, \eqref{eqn:DELE} implies the conservation of discrete energy, thereby yielding a symplectic-energy-momentum integrator~\cite{KaMaOr1999}. %This connection should come as no surprise, as the Hamiltonian is the conjugate momentum associated with time. %In case the discrete Lagrangian is time-invariant so that $L_d(t_k,t_{k+1},g_k,f_k) = L_d(t_k+s,t_{k+1}+s,g_k,f_k)$ for any $s$, %we have $\D_{t_k}L_{d_k} + \D_{t_{k+1}}L_{d_k}=0$, or equivalently $E^-_k = E^+_k$. %Combined with \eqref{eqn:DELE}, this yields $E_{k-1}^+ = E_k^+$ and $E_{k-1}^-=E_k^-$, which shows the conservation of discrete energy for autonomous Lagrangian systems. This yields an example of a symplectic-energy-momentum integrator~\cite{KaMaOr1999}, and it does not violate the theorem of Ge and Marsden~\cite{GeMa1988} as it is not a fixed timestep method. Rather, \eqref{eqn:DELE} prescribes the timestep to be taken. To implement \eqref{eqn:DEL} and \eqref{eqn:DELt} as a numerical integrator, it is more convenient to introduce the \textit{extended discrete Legendre transforms}, $\mathbb{F}^\pm L_{d_k}: \Re\times\Re \times \G \times \G \rightarrow \Re\times \Re\times\G\times\g^*$ as \begin{align} \mathbb{F}^+ L_{d_k} (t_k,t_{k+1}, g_k,f_k) & = (t_{k+1}, E_{k+1}, g_{k+1}, \mu_{k+1}),\\ \mathbb{F}^- L_{d_k} (t_k,t_{k+1}, g_k,f_k) & = (t_k, E_k, g_{k}, \mu_{k}). \end{align} where \begin{align} \mu_k & = -\T^*_e\L_{g_k}(\D_{g_k} L_{d_k})+ \Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} L_{d_k})),\label{eqn:muk}\\ \mu_{k+1} & = \T^*_e\L_{f_k} (\D_{f_k} L_{d_k}),\label{eqn:mukp} \end{align} and $E_{k+1}$ and $E_k$ are given by \eqref{eqn:Ep} and \eqref{eqn:Em}, respectively. The resulting discrete flow map is defined by $\mathbb{F}^+L_{d_k} \circ (\mathbb{F}L_{d_k})^{-1}$. More specifically, for given $(t_k, E_k, g_k, \mu_k)$, \eqref{eqn:Em} and \eqref{eqn:muk} are solved together for $t_{k+1},f_k$ with the constraint $t_{k+1}>t_k$. Then, $(E_{k+1}, g_{k+1},\mu_{k+1})$ are computed by \eqref{eqn:Ep}, \eqref{eqn:gkp}, and \eqref{eqn:mukp}, respectively. This yields the discrete flow map $(t_k, E_k, g_k, \mu_k)\rightarrow(t_{k+1}, E_{k+1}, g_{k+1}, \mu_{k+1})$ consistent with \eqref{eqn:DEL} and \eqref{eqn:DELt}. While the flow map is expressed in terms of $E$ for convenience, the initial value of $E_0$ is often selected by choosing the initial timestep $h_0$ and calculating the corresponding value of $E_0$ through \eqref{eqn:Em}. This inherits the desirable properties of variational integrators, and the group structure is also preserved through \eqref{eqn:gkp}. %, in combination with an ansatz $f_k=\exp(h\xi_k)$, where $\xi_k\in\g$ in order to ensure that $f_k\in\G$. \section{Bregman Lagrangian Systems on $\G$}\label{sec:Breg} \newcommand{\obj}{\mathsf{f}} Let $\obj:\G\rightarrow\Re$ be a real-valued smooth function on $\G$. We focus on the optimization problem: \begin{align} \min_{g\in\G} \obj (g). \end{align} A variational accelerated optimization scheme for the above problem was developed in~\cite{tao2020variational}, where the Nesterov accelerated gradient (NAG) descent on a finite-dimensional vector space was intrinsically generalized to a Lie group. In this section, we introduce an intrinsic formulation of Bregman Lagrangian dynamics~\cite{wibisono2016variational}, which encompasses a larger class of accelerated optimization scheme, including NAG. More importantly, the continuous dynamics guarantees polynomial convergence rates up to an arbitrary order. %(note that this is not preserved under discretization; however, in practice, the numerical performance can be tuned; see Sec.\ref{sec:experimentA}, \cite{su2016differential} and also \cite{attouch2018fast}). \subsection{Continuous-Time Bregman Dynamics} The Bregman Lagrangian $L(t,g,\xi):\Re\times\G\times\g\rightarrow$ is %given by \begin{align} L(t,g,\xi) = \frac{t^{\lambda p+1}}{2p} \|\xi\|^2 - C p t^{(\lambda+1)p-1} \obj (g),\label{eqn:BL} \end{align} where $\|\xi\|^2 = \met{\xi,\xi}=\pair{\mathbf{J}(\xi),\xi}$, for $p, C>0$, and $\lambda\geq 1$. When $\G=\Re^n$ and $\lambda=1$, this recovers the Bregman Lagrangian for vector spaces~\cite{wibisono2016variational}, and it yields the continuous-time limit of Nesterov's accelerated gradient descent for $p=2$~\cite{nesterov2005smooth}. Also, in case $p = 3$, it corresponds to the continuous-time limit of Nesterov’s accelerated cubic-regularized Newton’s method~\cite{nesterov2008accelerating}. When $\G$ is considered as a Riemannian manifold, this corresponds to the $p$-Bregman Lagrangian in~\cite{duruisseaux2021variational}. The additional term $\lambda$ accounts for the sectional curvature and diameter of the manifold~\cite{alimisis2020continuous}. The left-trivialized derivative of the objective function is \begin{align} \nabla_\L \obj(g) = \T_e^*\L_g (\D_g \obj(g)).\label{eqn:grad} \end{align} Applying \eqref{eqn:EL} to \eqref{eqn:BL}, the corresponding Euler--Lagrange equations are given below. \begin{prop}\label{prop:EL_Breg} The Euler--Lagrange equations corresponding to the Bregman Lagrangian \eqref{eqn:BL} are% given by \begin{align} \frac{d \mathbf{J}(\xi)}{dt} + \frac{\lambda p+1}{t}\mathbf{J}(\xi) - \ad^*_\xi \mathbf{J}(\xi) + Cp^2 t^{p-2} \nabla_\L \obj (g) =0, \label{eqn:EL_Breg} \end{align} and \eqref{eqn:g_dot}. Further, the corresponding continuous flow locally converges to the minimizer $g^*$ of $\obj$ with the rate given by \begin{align} \obj(g(t)) - \obj(g^*) \in \mathcal{O}(t^{-p}), \end{align} when $\obj$ is geodesically convex. \end{prop} \begin{proof} We have \begin{align*} \deriv{L}{\xi} & = \frac{t^{\lambda p+1}}{p}\mathbf{J}(\xi) \end{align*} Substituting this into \eqref{eqn:EL} and using \eqref{eqn:grad}, \begin{gather*} \frac{t^{\lambda p+1}}{p}\frac{d \mathbf{J}(\xi)}{dt} + \frac{(\lambda p+1)t^{\lambda p}}{p}\mathbf{J}(\xi) -\frac{t^{\lambda p+1}}{p} \ad^*_\xi \mathbf{J}(\xi) \\ + Cpt^{(\lambda +1)p-1} \nabla_\L \obj(g) =0. \end{gather*} Dividing both sides by $\frac{t^{\lambda p+1}}{p}$ yields \eqref{eqn:EL_Breg}. The convergence property is established by~\cite[Theorem 3.2]{duruisseaux2021variational}. \end{proof} Therefore, the optimization problem on $\G$ can be addressed by numerically integrating \eqref{eqn:EL_Breg} from an initial guess. However, it has been observed that a na\"\i ve discretization is not able to match the polynomial convergence rate established in~\cite{wibisono2016variational}. Further, we need a guarantee that the discrete trajectory evolves on the Lie group. These two challenges can be addressed by applying a Lie group variational integrator, as their structure-preserving properties provides long-term numerical stability, and preservation of the group structure. In the subsequent section, we derive Lie group variational integrators for the Bregman Lagrangian system. \subsection{Lie Group Variational Integrator for Bregman Dynamics} Let $h_k = t_{k+1}- t_k$ and $t_{k,k+1} = t_k + h_k/2$. We consider the following form of the discrete Lagrangian \begin{align} L_d(t_k, t_{k+1}, g_k, f_k ) & = \frac{\phi(t_{k,k+1}) }{h_k} T_d(f_k) -\frac{h_k}{2} \theta(t_k) \obj (g_k)\nonumber \\ & \quad -\frac{h_k}{2} \theta(t_{k+1}) \obj (g_kf_k), \label{eqn:Ld} \end{align} where $T_d(f_k):\G\rightarrow\Re$ is chosen such that it approximates $T(f_k) \approx h_k^2 \|\xi_k \|^2/2$, and $\phi,\theta:\Re\rightarrow\Re$ are \begin{align} \phi(t) & = \frac{t^{\lambda p +1}}{p},\\ \theta(t) & = C p t^{(\lambda+1)p-1}. \end{align} The corresponding variational integrators are presented as follows. \begin{prop}\label{prop:DEL_Breg} The discrete-time Euler--Lagrange equations, or the Lie group variational integrator for the discrete Lagrangian \eqref{eqn:Ld} corresponding to the Bregman Lagrangian~\eqref{eqn:BL} are given by \begin{align} \mu_k & = \frac{\phi_{k,k+1}}{h_k}\Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} T_{d_k})) + \frac{h_k\theta_k}{2} \nabla_L \obj_k, \label{eqn:muk_Breg}\\ \mu_{k+1} & = \Ad^*_{f_k}( \mu_k - \frac{h_k\theta_k}{2} \nabla_L\obj_k ) -\frac{h_k\theta_{k+1}}{2} \nabla_\L \obj_{k+1}, \label{eqn:mukp_Breg}\\ E_{k} & = \frac{\phi'_{k,k+1}}{ 2 h_k} T_{d_k} -\frac{h_k\theta'_{k}}{2} \obj_{k} \nonumber\\\ & \quad + \frac{\phi_{k,k+1}}{h_k^2}T_{d_k} + \frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1}, \label{eqn:Ek_Breg}\\ E_{k+1} & = -\frac{\phi'_{k,k+1}}{ 2 h_k} T_{d_k} +\frac{h_k\theta'_{k+1}}{2} \obj_{k+1}\nonumber \\\ & \quad + \frac{\phi_{k,k+1}}{h_k^2}T_{d_k} +\frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1}, \label{eqn:Ekp_Breg} \end{align} together with \eqref{eqn:gkp}. %, where %\begin{align*} %\phi'(t) & = \frac{(\lambda p +1) t^{\lambda p}}{p}, \\ %\theta'(t) & = Cp((\lambda+1)p-1) t^{(\lambda +1)p-2}. %\end{align*} \end{prop} \begin{proof} These can be derived by substituting \eqref{eqn:Ld} into \eqref{eqn:muk}, \eqref{eqn:mukp}, \eqref{eqn:Em}, and \eqref{eqn:Ep}, respectively. \end{proof} As discussed at the end of Section III, these provide symplectic and momentum-preserving discrete time flow maps. Since these correspond to a discretization of the Bregman Lagrangian system, they can be considered as a geometric numerical integrator for \eqref{eqn:EL_Breg}, or utilized as an optimization algorithm on $\G$. If $T_d(f_k)=T_d(f_k^{-1})$, then the discrete Lagrangian is self-adjoint, and the above integrator is symmetric and therefore at least second-order accurate. \section{Optimization on $\G$} In this section, we present both of the continuous Bregman Lagrangian system and the Lie group variational integrator for several Lie groups. \subsection{Euclidean Space $\Re^n$} Suppose $\G=\Re^n$, with the additive group action, and the inner product is chosen to be $\pair{x,y}=x^Ty$ for any $x,y\in\Re^n$. Let $\mathbf{J}(\dot x) = I_{n\times n} \dot x$, and $\lambda =1$. From \eqref{eqn:EL_Breg}, the continuous Euler--Lagrange equation is given by \begin{align} \ddot x + \frac{p+1}{t} \dot x + Cp^2 t^{p-2} \nabla \obj(x) = 0,\label{eqn:EL_Re} \end{align} which recovers the differential equation derived in \cite{wibisono2016variational}. Next, we develop variational integrators. The discrete kinematics equation \eqref{eqn:gkp} is rewritten as $x_{k+1} = x_k + \Delta x_k$ for $\Delta x_k\in\Re^n$. The kinetic energy term in \eqref{eqn:Ld} is chosen as \begin{align} T_d =\frac{1}{2}\|\Delta x_k\|^2.\label{eqn:Td_Re} \end{align} According to \Cref{prop:DEL_Breg}, we obtain the discrete Euler--Lagrange equations as follows. \begin{prop} When $G=\Re^n$, the variational integrator for the discrete Bregman Lagrangian \eqref{eqn:Ld} is given by \begin{align} v_k & = \frac{\phi_{k,k+1}}{h_k}\Delta x_k + \frac{h_k\theta_k}{2} \nabla \obj_k,\label{eqn:muk_Re} \\ v_{k+1} & = v_k - \frac{h_k\theta_k}{2} \nabla\obj_k -\frac{h_k\theta_{k+1}}{2} \nabla \obj_{k+1}, \label{eqn:mukp_Re} % E_{k} & = \frac{\phi'_{k,k+1}}{ 4 h_k} \|\Delta x_k\|^2 -\frac{h_k\theta'_{k}}{2} \obj_{k} \nonumber\\\ %& \quad + \frac{\phi_{k,k+1}}{2 h_k^2}\|\Delta x_k\|^2 + \frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1},\label{eqn:Ek_Re}\\ %E_{k+1} & = -\frac{\phi'_{k,k+1}}{ 4 h_k} \|\Delta x_k\|^2 +\frac{h_k\theta'_{k+1}}{2} \obj_{k+1}\nonumber \\\ % & \quad + \frac{\phi_{k,k+1}}{2 h_k^2}\|\Delta x_k\|^2 +\frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1}. \end{align} and \eqref{eqn:Ek_Breg}, \eqref{eqn:Ekp_Breg} with \eqref{eqn:Td_Re}. \end{prop} These are implicit as \eqref{eqn:muk_Re} and \eqref{eqn:Ek_Breg} should be solved together for $\Delta x_k$ and $h_k$. One straightforward approach is fixed-point iteration. For a given $h_k$, \eqref{eqn:muk_Re} can be solved explicitly for $\Delta_k$, which yields $x_{k+1}$. Then, \eqref{eqn:Ek_Breg} can be solved for $h_k$. These procedures are iterated until $h_k$ converges. \subsection{Three-Dimensional Special Orthogonal Group $\SO$} Next, consider $\SO=\{R\in\Re^{3\times 3}\,|\, R^T R = I_{3\times 3},\, \mathrm{det}(R)]=1\}$. Its Lie algebra is $\so=\{S\in\Re^{3\times 3}\,|\, S^T=-S\}$ with the matrix commutator as the Lie bracket. This is identified with $\Re^3$ through the \textit{hat} map $\hat\cdot :\Re^3\rightarrow\so$ defined such that $\hat x\in\so$ and $\hat x y = x\times y$ for any $x,y\in\Re^3$. The inverse of the hat map is denoted by the \textit{vee} map $\vee: \so\rightarrow\Re^3$. The inner product is given by \begin{align*} \langle \hat \eta, \hat \xi \rangle_{\so} = \frac{1}{2}\tr{\hat \eta^T\hat \xi} = \eta^T\xi = \pair{\eta,\xi}_{\Re^3}. \end{align*} The metric is chosen as \begin{align} \langle \mathbf{J}(\hat \eta), \hat \xi \rangle_{\so} = \tr{\hat \eta^T J_d \hat \xi} = \eta^TJ \xi = \pair{J\eta,\xi}_{\Re^3},\label{eqn:met_SO3} \end{align} where $J\in\Re^{3\times 3}$ is a symmetric, positive-definite matrix, and $J_d=\frac{1}{2}\tr{J}I_{3\times 3}-J\in\Re^{3\times 3}$. Further, \begin{alignat*}{2} \ad_\eta\xi &= \eta\times \xi,& \quad \ad^*_\eta \xi &= \xi\times \eta,\\ \Ad_F\eta &= F\eta,& \quad \Ad^*_F \eta &= F^T\eta. \end{alignat*} Consider \begin{align*} L(t,R,\Omega) = \frac{t^{p+1}}{2p} \Omega\cdot J\Omega - Cpt^{2p-1} \obj(R). \end{align*} From \eqref{eqn:EL_Breg}, the Euler--Lagrange equations are given by \begin{gather} J\dot\Omega + \frac{p+1}{t} J\Omega + \hat\Omega J\Omega + C p^2 t^{p-2} \nabla_\L \obj(R) = 0,\label{eqn:EL_SO3}\\ \dot R = R\hat\Omega. \label{eqn:R_dot} \end{gather} Next, we derive variational integrators. The kinematics equation is written as \begin{align} R_{k+1} = R_k F_k, \label{eqn:Rkp} \end{align} for $F_k\in\SO$. Similar with~\cite{LeeLeoCMAME07}, the angular velocity is approximated with $\hat\Omega_k \approx \frac{1}{h_k} R_k^T (R_{k+1}-R_k) = \frac{1}{h_k} (F_k-I_{3\times 3})$. Substituting this into \eqref{eqn:met_SO3}, \begin{align} T_d(F_k) & =\tr{(I_{3\times 3}-F_k)J_d}, \label{eqn:Td_SO3} \end{align} which satisfies $T_d(F_k)=T_d(F_k^T)$. \begin{prop}\label{prop:DEL_Breg_SO3} When $\G=\SO$, the Lie group variational integrator for the discrete Bregman Lagrangian \eqref{eqn:Ld} with \eqref{eqn:Td_SO3} is given by \begin{align} \mu_k & =\frac{\phi_{k,k+1}}{h_k } (F_k J_d - J_dF_k^T)^\vee + \frac{h_k\theta_k }{2} \nabla_\L \obj_k, \label{eqn:muk_SO3} \\ \mu_{k+1} & = F_k^T \mu_k -\frac{h_k\theta_k}{2}\nabla_\L \obj_k - \frac{h_k\theta_k}{2} \nabla_\L \obj_{k+1}, \label{eqn:mukp_SO3} % E_{k} & = \frac{\phi'_{k,k+1}}{ 2 h_k} \tr{(I-F_k)J_d} -\frac{h_k\theta'_{k}}{2} \obj_{k} \nonumber\\\ % & \quad + \frac{\phi_{k,k+1}}{h_k^2} \tr{(I-F_k)J_d} + \frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1}, \label{eqn:Ek_SO3}\\ % E_{k+1} & = -\frac{\phi'_{k,k+1}}{ 2 h_k} \tr{(I-F_k)J_d} +\frac{h_k\theta'_{k+1}}{2} \obj_{k+1}\nonumber \\\ % & \quad + \frac{\phi_{k,k+1}}{h_k^2} \tr{(I-F_k)J_d} +\frac{\theta_k}{2}\obj_k + \frac{\theta_{k+1}}{2}\obj_{k+1}, \label{eqn:Ekp_SO3} \end{align} together with \eqref{eqn:Ekp_Breg}, \eqref{eqn:Rkp}, \eqref{eqn:Ek_Breg}, and \eqref{eqn:Td_SO3}. \end{prop} \begin{proof} Let $\delta F_k = F_k \hat\chi_k$. The derivative of \eqref{eqn:Td_SO3} is %given by \begin{align*} \D_{F_k} T_{d_k} \cdot \delta F_k = \tr{-F_k\hat\chi_k J_d} = (J_dF_k - F_k^T J_d)^\vee \cdot \chi, \end{align*} where the last equality is from the identity, $\mathrm{tr}[-\hat x A]= x\cdot (A-A^T)^\vee$ for any $x\in\Re^3$ and $A\in\Re^{3\times 3}$. Thus, $\T^*_I \L_{F_k} (\D_{F_k} T_{d_k}) = (J_dF_k - F_k^T J_d)^\vee $. Substituting this into \eqref{eqn:muk_Breg} and \eqref{eqn:mukp_Breg} yields \eqref{eqn:muk_SO3} and \eqref{eqn:mukp_SO3}, respectively. % The remaining \eqref{eqn:Ek_SO3} and \eqref{eqn:Ekp_SO3} are directly from \eqref{eqn:Ek_Breg} and \eqref{eqn:Ekp_Breg} with \eqref{eqn:Td_SO3}. \end{proof} To implement these, \eqref{eqn:mukp_SO3} and \eqref{eqn:Ek_Breg} should be solved together for $h_k$ and $F_k$. For a given $h_k$, computational approaches to solve \eqref{eqn:muk_SO3} for $F_k$ are presented in~\cite[Sec 3.3.8]{Lee08}. When $J=I_{3\times 3}$, or equivalently when $J_d = \frac{1}{2}I_{3\times 3}$, \eqref{eqn:muk_SO3} can be solved explicitly to obtain \begin{align} F_k = \exp \left(\frac{\sin^{-1}\|a\|}{\|a\|}\hat a\right),\label{eqn:Fk_SO3} \end{align} where $a = \frac{h_k}{\phi_{k,k+1}} (\mu_k - \frac{h_k\theta_k}{2}\nabla_\L \obj_k)\in\Re^3$. This can replace \eqref{eqn:muk_SO3}. \subsection{Product of $\Re^n$ and $\SO$} Suppose $\G=\SO\times \Re^n$. As it is the direct product of $\SO$ and $\Re^n$, the variation of the action sum is decomposed into two parts of $\SO$ and $\Re^n$. Therefore, the continuous Euler--Lagrange equations on $\SO\times\Re^n$ are given by \eqref{eqn:EL_Re} and \eqref{eqn:EL_SO3}, after replacing $\nabla \obj(x)$ of \eqref{eqn:EL_Re} with $\nabla_x \obj(R,x)$, and replacing $\nabla_\L f(R)$ of \eqref{eqn:EL_SO3} with $\T^*_I\L_R(\D_R\obj(R,x))$. Similarly, the corresponding Lie group variational integrators are also given by \eqref{eqn:muk_Re}, \eqref{eqn:mukp_Re}, \eqref{eqn:muk_SO3}, and \eqref{eqn:mukp_SO3}, in addition to the energy equations \eqref{eqn:Ek_Breg} and \eqref{eqn:Ekp_Breg} with \begin{align*} T_{d_k}(F_k,\Delta x_k) = \frac{1}{2}\|\Delta x_k\|^2 + \tr{(I_{3\times 3}-F_k)J_d}. \end{align*} %For $n=3$, these can be utilized for optimization on $\SE$ as well, since $\SE$ and $\SO\times \Re^3$ are identical as manifolds, although Bregman Lagrangian systems can be directly developed on $\SE$, where the critical difference would be in the choice of metric. \section{Numerical Examples} \subsection{Optimization on $\SO$} \label{sec:experimentA} Consider the objective function given by \begin{align} \obj (R) & = \frac{1}{2}\| A- R\|^2_{\mathcal{F}} %= \frac{1}{2} \tr{(A-R)^T(A-R)} \\ =\frac{1}{2}(\|A\|^2_{\mathcal{F}} + 3) - \tr{A^T R},\label{eqn:obj_SO3} \end{align} where $\|\cdot\|_{\mathcal{F}}$ denotes the Frobenius norm, and $A\in\Re^{3\times 3}$. Optimization of the above function appears in the least-squares estimation of attitude, referred to as Wahba's problem~\cite{WahSR65}. Let the singular value decomposition of $A=USV^T$ for a diagonal $S\in\Re^{3\times 3}$ and $U,V\in\mathsf{O}(3)$. The optimal attitude is explicitly given by $R^* = U \mathrm{diag}[1,1,\mathrm{det}(UV)] V^T$. The left-trivialized gradient is $\nabla_\L \obj(R) = (A^T R - R^T A)^\vee$. \subsubsection{Order of Convergence} \begin{figure} \centerline{ \subfigure[convergence with respect to $t$]{\includegraphics[width=0.8\columnwidth]{comp_0}} } \centerline{ \subfigure[convergence with respect to $k$]{\includegraphics[width=0.8\columnwidth]{comp_1}} } \caption{Convergence rate of LGVI in \Cref{prop:DEL_Breg_SO3} for varying $p$}\label{fig:conv} \end{figure} First, we check if the theoretical order of convergence guaranteed by \Cref{prop:EL_Breg} is achieved by the discrete Euler--Lagrange equations presented in \Cref{prop:DEL_Breg}. The elements of the matrix $A$ in \eqref{eqn:obj_SO3} are randomly chosen from the uniform distribution on $[0,1]$. The initial guess of $R_0$ is chosen such that the initial error is $0.9\pi$ in terms of the Euler-axis rotation. Lie group variational integrators (LGVI) in \Cref{prop:DEL_Breg_SO3} are simulated with fixed $J=I_{3\times 3}$, $C=1$, and $h_0 = 0.1$ for varying $p\in\{2,4,6,8\}$. Since $J=I_{3\times 3}$, \eqref{eqn:muk_SO3} is replaced by \eqref{eqn:Fk_SO3}. The remaining implicit equation \eqref{eqn:Ek_Breg} is solved for $h_k$ via the Matlab equation solver, \texttt{lsqnonlin} with the tolerance of $10^{-4}$. The initial guess for $h_k$ is provided by $h_{k-1}$. The resulting convergence rate represented by $\obj-\obj^*$ over $t_k$ is illustrated in \Cref{fig:conv}.(a), where the empirical convergence rate computed by manual fitting are also marked. It is shown that LGVI empirically achieved the order of convergence greater than the theoretical guarantee of $\mathcal{O}(t^{-p})$. It has been reported that na\"\i ve discretizations of Bregman Lagrangian systems are not able to match the theoretical convergence rate, or it might cause numerical instability~\cite{wibisono2016variational,betancourt2018symplectic}. These results suggest that LGVIs do not suffer from these discretization issues, and their performance are consistent with the continuous-time analysis. Next, given that the step size $h_k$ is adjusted adaptively according to \eqref{eqn:Ek_Breg} and \eqref{eqn:Ekp_Breg}, it is likely that numerical simulation with higher $p$ requires a smaller step size. In fact, the average step sizes are given by $6.15\times10^{-2}$, $6.50\times 10^{-3}$, $4.89\times10^{-4}$ and $1.21\times 10^{-5}$, respectively for $p\in\{2,4,6,8\}$. To examine the effects of the step size variations, the convergence with respect to the discrete time step is illustrated in \Cref{fig:conv}.(b). It turns out that all of four cases of $p$ exhibit the similar order of long-term convergence, approximately $\mathcal{O}(k^{-2.3})$. This is not surprising, as Nesterov~\cite{nesterov2003introductory} showed that for every smooth first-order method, there exists a convex, $L$-smooth objective function, such that the rate of convergence is bounded from below by $\mathcal{O}(k^{-2})$, but it does not preclude the possibility of faster rates of convergence for strongly convex functions. However, the case of higher $p$ benefits from faster initial convergence, and as a result, the terminal error for $p=4$ is more than 400 times smaller than that of $p=2$. \subsubsection{Effects of Initial Step Size} \begin{figure} \centerline{ \subfigure[convergence with respect to $t$]{\includegraphics[width=0.8\columnwidth]{comp_2a}} } \centerline{ \subfigure[evolution of step size $h_k$]{\includegraphics[width=0.8\columnwidth]{comp_2b}} } \caption{Convergence rate of LGVI in \Cref{prop:DEL_Breg_SO3} for varying $h_0$.} \label{fig:conv_h} \end{figure} As discussed at the end of \Cref{sec:Breg}, the extended LGVI requires choosing the initial step size $h_0$. Here, we study the effects of $h_0$ in the convergence. More specifically, the order is fixed to $p=4$, and the initial step size is varied as $h_0\in\{0.001, 0.05, 0.01, 0.1, 0.4\}$. The corresponding results are illustrated at \Cref{fig:conv_h}. Interestingly, in \Cref{fig:conv_h}.(a), the convergence with respect to $t$ is not much affected by the initial step size $h_0$. Next, \Cref{fig:conv_h}.(b) presents the time-evolution of the step size, and it is shown that the step size computed by \eqref{eqn:Ek_Breg} decreases at the approximate order of $\mathcal{O}(t^{-1.6})$ for all cases. This might have been caused by the fact that the forcing term in \eqref{eqn:EL_SO3} increases over time. Another notable feature is that after a certain period, the step sizes tend to converge. More specifically, the step size initialized by $h_0=0.001$ converges to $1.8\times 10^{-4}$ when $t>10$, which is joined by the case of $h_0=0.005$ later. It is expected that the next case for $h_0=0.01$ would follow the similar trend if the simulation time is increased. This implies a certain stability property of the extended LGVI in the step size. Furthermore, observe that for the wide range of variations of step sizes presented in \Cref{fig:conv_h}.(b), the convergence in \Cref{fig:conv_h}.(a) is fairly consistent, which suggests that the LGVI is robust to the choice of the step size. \subsubsection{Comparison with Other Discretizations of Bregman Euler--Lagrange Equation} \begin{figure} \centerline{ \subfigure[convergence with respect to $t$]{\includegraphics[width=0.8\columnwidth]{comp_3a}} } \centerline{ \subfigure[orthogonality error of $R_k$]{\includegraphics[width=0.8\columnwidth]{comp_3b}} } \caption{Comparison with other discretization schemes for Bregman Euler--Lagrange equation}\label{fig:comp_disc} \end{figure} Next, we compare LGVI with other discretization schemes applied to \eqref{eqn:EL_SO3} and \eqref{eqn:R_dot}. Three methods are considered, namely the splitting approach introduced in \cite{tao2020variational} applied to the proposed continuous dynamics (abbreviated as SPLT), a 4-th order fixed-step Runge--Kutta method (RK4), and a variable stepsize Runge--Kutta method (RK45) implemented by the Matlab \texttt{ode45} function with the tolerance of $10^{-8}$. More precisely, the evolution of SPLT over step size $h$ is written as $\phi_{h/2} \circ \psi_h \circ \phi_{h/2}$, where $\phi_t$ is the exact flow map of \eqref{eqn:R_dot} with fixed $\Omega$, and $\psi_t$ is the exact $t$-time flow map of \eqref{eqn:EL_SO3} with fixed $R$ and $J=I_{3\times 3}$. The goal of this comparison is not to claim that a certain method is superior to the other methods. Rather, it is to identify the numerical properties of LGVI compared with others. Having stated that, LGVI is implicit, and \eqref{eqn:Ek_Breg} is solved by a general purpose nonlinear solver, instead of a numerical solver tailored for \eqref{eqn:Ek_Breg}. As a consequence, LGVI is substantially slower than the three explicit methods, to the extent that the comparison is not meaningful. Instead, for a more interesting comparison, we exploit the property of LGVI providing consistent results for a wide range of step sizes, and we only utilize \eqref{eqn:muk_SO3} and \eqref{eqn:mukp_SO3} with a fixed prescribed step size. The resulting scheme, denoted by ELGVI, is explicit as shown in \eqref{eqn:Fk_SO3}. Overall ELGVI is quite comparable with SPLT, but it benefits from a bit faster initial convergence, especially when $p$ is larger and $h$ is smaller. One particular case for $p=6$ and $h=0.001$ is illustrated in \Cref{fig:comp_disc}.(a). With regard to RK4 and RK45, their convergence is almost identical to ELGVI, but as presented in \Cref{fig:comp_disc}.(b), those methods do not preserve the orthogonality of the rotation matrix, which is problematic. Whereas, both of LGVI and SPLT conserve the structure of rotation matrices. Next, the computation time with Intel Core i7 3.2GHz, averaged for 10 executions, are 0.0727, 0.0258, 0.3847, and 1.1476 seconds for ELGVI, SPLT, RK4, and RK45, respectively. It is expected that RK4 requires more computation time as the gradient should be evaluated four times per a step, and it seems that the time-adaptive RK45 algorithm requires more frequent evaluations of the gradient. \subsubsection{Comparison with Other Optimization Schemes on Lie Groups} \begin{figure} \centerline{ \includegraphics[width=0.8\columnwidth]{comp_4} } \caption{Comparison with other accelerated optimization schemes on Lie groups}\label{fig:comp_accel} \end{figure} Finally, we compare ELGVI with other optimization schemes on Lie groups. In particular, we consider variationally accelerated Lie-group methods based on the NAG variational principle and operating splitting \cite{tao2020variational}, referred to as Lie-NAG-SC and Lie-NAG-C, which are conformally symplectic and group-structure preserving. Note that Lie-NAG-C corresponds to SPLT with $p=2$. %(the choice of NAG). Four cases are considered, as labeled in \Cref{fig:comp_accel} for varying $p$ and $h$. Compared with Lie-NAG-C, ELGVI exhibits faster convergence at a higher order. This does not contradict Nesterov's oracle lower bound: the continuous Bregman dynamics with $p>2$ should be discretized by smaller steps as $t$ increases, and therefore, the asymptotic order of convergence is still $\mathcal{O}(1/k^2)$ as illustrated above. However, since ELGVI uses a fixed stepsize, the initial error can decay faster than inverse quadratic, and depending on the level of accuracy required, we can take advantage of it by employing early stopping. %\tao{Taeyoung, any insight about this observation? I thought we previously described that no matter what $p$ is, after the discretization the convergence becomes like $k^{-2.3}$. Is there a contraction? Or is it because ELGVI uses a fixed step size, so that it is initially faster, but there is a need for early stopping because otherwise it will eventually become unstable? If this understanding of mine is correct, it is actually a nice property, and we might want to explain it a little more.} %\leok{I believe the ELVGI method is essentially a regular fixed-timestep variational integrator applied to a non-autonomous Lagrangian, and in those instances, one does sometimes encounter instabilities, and variable stepsizing in somr form may be important for the highest accuracy applications. There is a mention in the conclusion of why we should more at variable stepsize methods for these applications But, in this case, I think it's just that Lie-NAG-SC is exponential for strongly convex functions, but the initial convergence is slower, so for moderate stopping criteria, fewer iterations are needed for ELGVI as seen in the Figure, I'm not sure there is something deeper here.} %\EditTL{Right, it seems that fixing the step size made such difference. Also, if I run it long enough, it diverges eventually. Depending on the chosen step size and the required accuracy, \textit{early} stopping may not be needed. One practical approach will be starting from a relatively large step to take the advantage of the fast initial convergence, and run it until it divergences. At that point, the step size can be reduced. } On the other hand, Lie-NAG-SC demonstrates exponential convergence asymptotically when applied to strongly convex functions. Overall, if moderate stopping criteria are employed, ELGVI may be preferred, as they exhibit the fastest initial decay of the cost function. %ELGVI may benefit from early stopping if moderate accuracy is acceptable, as they enjoy the best initial convergence. \subsection{Optimization on $\SO\times \Re^3$} Next, we present an optimization problem on $\SO\times\Re^3$ to estimate the position and the attitude of a camera using the KITTI vision benchmark dataset~\cite{Geiger2013IJRR}. This is to verify the performance of ELGVI for a non-convex function in a higher-dimensional Lie group, with more relevance to engineering practice. More specifically, we consider $N=516$ distinct features on a single image frame, where their 2D pixel coordinates in the image plane, and the actual 3D location in the world coordinates are given by $p^i\in\Re^3$ and $P^i\in\Re^4$, respectively as homogeneous coordinates. Assuming that the camera calibration matrix $K\in\Re^{3\times 3}$ is also known, we wish to estimate the pose $(R,x)\in\SO\times \Re^3$ of the camera. This is formulated as an optimization problem to minimize the reprojection error, which is the discrepancy between the actual pixel location of the features and the features projected to the image plane by the current estimate of $(R,x)$~\cite{ma2012invitation}. For example, let $\tilde p^i\in\Re^3$ be the homogeneous coordinates for the feature corresponding to $P^i$ projected to the image plane by $(R,x)$. From the perspective camera model, \begin{align*} \lambda \tilde p^i = K[R, x]P^i, \end{align*} for $\lambda >0$. The corresponding reprojected pixel is determined by the dehomogenization of $\tilde p^i$, namely $H^{-1}(\tilde p^i)\in\Re^2$ corresponding to the first two elements of $\tilde p^i$ divided by the last element. The objective function is the sum of the reprojection error given by \begin{align} \obj (R,x) = \sum_{i=1}^N \| H^{-1}(p^i) - H^{-1}(\tilde p^i)\|^2.\label{eqn:obj_SE3} \end{align} \Cref{fig:comp_6} presents the optimization results by ELGVI, which are comparable to the benchmark examples presented for $\SO$. However, the terminal phase is relatively noisy, partially because the gradients of \eqref{eqn:obj_SE3} are evaluated numerically with a finite-difference rule. \Cref{fig:KITTI} illustrates the reprojected features before and after the optimization. \begin{figure} \centerline{ \includegraphics[width=0.8\columnwidth]{comp_6a} } \caption{Optimization on $\SO\times\Re^3$: convergence with respect to $k$}\label{fig:comp_6} \end{figure} \begin{figure} \centerline{ \subfigure[Initial guess $(R_0,x_0)$]{\includegraphics[width=1.0\columnwidth]{comp_6b.eps}} } \centerline{ \subfigure[Optimized $(R^*,x^*)$]{\includegraphics[width=1.0\columnwidth]{comp_6c}} } \caption{Reprojection error: the red $+$ markers denote the key points detected, and the yellow $+$ markers represent the key points projected by the estimated pose. The paired features are connected by solid lines. }\label{fig:KITTI} \end{figure} \section{Conclusions} In this paper, we proposed a Lie group variational integrator for the Bregman Lagrangian dynamics on Lie groups, to construct an accelerated optimization scheme. The variable stepsize prescribed by the extended variational principle exhibits an interesting convergence property, and the variational discretization is robust to the initial stepsize. It would be interesting to explore the role of variable time-stepping in geometric discretizations of the Bregman dynamics especially compared with Hamiltonian variational integrators. \bibliography{CDC21} \bibliographystyle{IEEEtran} \end{document} <file_sep>function [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,hk,TN,flag_update_h,flag_display_progress,flag_stop) % flag_stop =1 : stop of t>TN, % flag_stop =2 : stop of k>TN, [U S V]=psvd(A); R_opt = U*V'; JJ_opt = obj(R_opt,A); Jd=trace(J)/2*eye(3)-J;%nonstandard inertia matrix options = optimoptions(@lsqnonlin,'StepTolerance', 1e-12, 'Display', 'off'); C=1; %% if flag_stop == 2 R=zeros(3,3,TN); M=zeros(3,TN); t=zeros(TN,1); Pi=zeros(3,TN); end R(:,:,1)=R0; Pi(:,1)=zeros(3,1); t(1)=1; JJ(1) = obj(R(:,:,1),A); M(:,1) = grad(R(:,:,1),A); tic; [~, E(1)] = err_FLdm(hk, t(1), Pi(:,1), R(:,:,1), 0, JJ(1), M(:,1), p, C, Jd, A); k = 1; while 1 if flag_update_h [hk, res] = lsqnonlin(@(hk) err_FLdm(hk, t(k), Pi(:,k), R(:,:,k), E(k), JJ(k), M(:,k), p, C, Jd, A), hk, 0, [], options); end t(k+1) = t(k) + hk; tkkp= (t(k)+t(k+1))/2; g = (Pi(:,k) + hk/2*C*p*t(k)^(2*p-1)*M(:,k))*hk*p/tkkp^(p+1); Fk = expmso3( g*asin(norm(g))/norm(g) ); R(:,:,k+1) = R(:,:,k)*Fk; M(:,k+1) = grad(R(:,:,k+1),A); Pi(:,k+1) = Fk'*Pi(:,k) + hk/2*C*p*t(k)^(2*p-1)*Fk'*M(:,k) + hk/2*C*p*t(k+1)^(2*p-1)*M(:,k+1); if flag_update_h JJ(k+1) = obj(R(:,:,k+1),A); E(k+1) = (-(p+1)*tkkp^p/2/hk/p + tkkp^(p+1)/hk^2/p)*trace((eye(3)-Fk)*Jd)... +1/2*C*p*t(k)^(2*p-1)*JJ(k) + 1/2*C*p*t(k+1)^(2*p-1)*JJ(k+1) ... +hk/2*C*p*(2*p-1)*t(k+1)^(2*p-2)*JJ(k+1); end k=k+1; switch flag_stop case 1 if t(k) > TN break; end % if flag_display_progress && rem(k,500)==0 % disp([t(k)/TN]); % end case 2 if k >= TN break; end % % if flag_display_progress && rem(k,500)==0 % % disp([k/TN]); % end end end t_elapsed=toc; %% for k=1:length(t) JJ(k) = obj(R(:,:,k),A)-JJ_opt; errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); end end function [errE FLdm]= err_FLdm(hk, tk, Pik, Rk, Ek, Jk, Mk, p, C, Jd, A) tkp = tk + hk; tkkp= (tk+tkp)/2; g = (Pik + hk/2*C*p*tk^(2*p-1)*Mk)*hk*p/tkkp^(p+1); Fk = expmso3( g*asin(norm(g))/norm(g) ); Rkp = Rk*Fk; Jkp = obj(Rkp,A); FLdm = ((p+1)*tkkp^p/2/hk/p + tkkp^(p+1)/hk^2/p)*trace((eye(3)-Fk)*Jd)... +1/2*C*p*tk^(2*p-1)*Jk + 1/2*C*p*tkp^(2*p-1)*Jkp ... -hk/2*C*p*(2*p-1)*tk^(2*p-2)*Jk; errE = abs(Ek-FLdm); end function J = obj(R,A) tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R,A) % this actually computes the negative gradient M=vee(R'*A-A'*R); end function M = grad_num(R,A) % this actually computes the negative gradient eps = 1e-8; II=eye(3); M=zeros(3,1); for i=1:3 M(i)=(obj(R*expmso3(eps*II(:,i)),A)-obj(R,A))/eps; end M=-M; end <file_sep>clear; close all; load data/p_W_landmarks.txt load data/K.txt load data/keypoints.txt N = length(keypoints); p = [keypoints(:, [2,1])'; ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; M=K*[eye(3), zeros(3,1)]; p_proj = M*P; norm(p(1:2,:)./p(3,:)-p_proj(1:2,:)./p_proj(3,:))<file_sep>clear; close all; load comp_6 load data/p_W_landmarks.txt; load data/K.txt; load data/keypoints.txt; keypoints = keypoints'; figure(1);plot(1:N,JJ); hold on; set(gca,'xscale','log','yscale','log'); legend('$\mathrm{ELGVI}\; (p=3, h=0.00015)$',... 'Location','SouthWest','interpreter','latex'); ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); xlabel('$k$','interpreter','latex'); set(gca,'FontSize',16); print('comp_6a','-depsc'); figure(2); N = length(keypoints); p = [keypoints([2,1],:); ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; M = K*[R0, x0]; p_proj = M*P; keypoints_proj = p_proj(1:2,:)./p_proj(3,:); keypoints_proj = keypoints_proj([2 1],:); img = imread('data/000000.png'); imshow(img); hold on; plot([keypoints(2,:); keypoints_proj(2,:)], [keypoints(1,:); keypoints_proj(1,:)]); scatter(keypoints(2,:), keypoints(1,:),'r+', 'LineWidth',2); scatter(keypoints_proj(2,:), keypoints_proj(1,:),'y+', 'LineWidth',2); print('comp_6b','-depsc'); figure(3); M = K*[R, x]; p_proj = M*P; keypoints_proj = p_proj(1:2,:)./p_proj(3,:); keypoints_proj = keypoints_proj([2 1],:); img = imread('data/000000.png'); imshow(img); hold on; scatter(keypoints(2,:), keypoints(1,:),'r+', 'LineWidth',2); hold on; scatter(keypoints_proj(2,:), keypoints_proj(1,:),'y+', 'LineWidth',2); plot([keypoints(2,:); keypoints_proj(2,:)], [keypoints(1,:); keypoints_proj(1,:)]); print('comp_6c','-depsc'); !cp comp_6*.eps ../figs<file_sep>clear; close all; load comp_0 figure(1); for i=1:length(p_vec) plot(t_vec{i}, J_vec{i}) hold on; end set(gca,'yscale','log'); set(gca,'xscale','log'); set(gca,'FontSize',16); conv_x=[3.625 10; 2.577 10; 1.88 10; 1.864 10] conv_y=[0.4068 0.02341; 0.07402 2.098e-5;0.06836 2.1e-8; 0.011 2.1e-11] plot(conv_x',conv_y','k--'); diff(log10(conv_y'))./diff(log10(conv_x')) legend('$\mathrm{LGVI}_2\;(p=2)$','$\mathrm{LGVI}_4\;(p=4)$','$\mathrm{LGVI}_6\;(p=6)$','$\mathrm{LGVI}_8\;(p=8)$',... 'Location','SouthWest','interpreter','latex') xlabel('$t$','interpreter','latex'); ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); text(5.5,5e-8,'$\mathcal{O}(t^{-11.95})$','interpreter','latex','fontsize',18); text(5.5,1e-5,'$\mathcal{O}(t^{-8.97})$','interpreter','latex','fontsize',18); text(5.5,2e-3,'$\mathcal{O}(t^{-6.02})$','interpreter','latex','fontsize',18); text(5.5,3e-1,'$\mathcal{O}(t^{-2.81})$','interpreter','latex','fontsize',18); print('comp_0','-depsc'); !cp comp_0.eps ../figs <file_sep>clear all; close all; A = [ 0.7572 0.5678 0.5308 0.7537 0.0759 0.7792 0.3804 0.0540 0.9340]; r = [0.7915 -0.3101 0.5267]; [U S V]=psvd(A); R0 = U*expm(0.9*pi*hat(r))*V'; J=eye(3); T = 10; flag_update_h = true; flag_display_progress = true; flag_stop =1 ; hk = 0.1; p_vec=[2 4 6 8]; for i=1:length(p_vec) p = p_vec(i); [t, JJ, errR, t_elapsed, N_grad_comp] = vigdSO3(A,p,J,R0,hk,T,flag_update_h,flag_display_progress,flag_stop); t_vec{i} = t; J_vec{i} = JJ; errR_vec{i} = errR; t_elapsed_vec{i} = t_elapsed; N_grad_comp_vec{i} = N_grad_comp; disp([hk log10(JJ(end)) log10(errR(end)) t_elapsed N_grad_comp]); plot(diff(t)); hold on; end save comp_0 % figure(1);plot(t ,JJ, 'k'); % set(gca,'xscale','log','yscale','log'); % hold on; % figure(2);plot(t, errR, 'k'); % set(gca,'xscale','log','yscale','log'); % hold on; % <file_sep>% comparision with other discretization of Bregman Euler-Lagrange equation clear; close all; A = [ 0.7572 0.5678 0.5308 0.7537 0.0759 0.7792 0.3804 0.0540 0.9340]; r = [0.7915 -0.3101 0.5267]; [U S V]=psvd(A); R0 = U*expm(0.9*pi*hat(r))*V'; J=eye(3); N = 9000; p = 6; h = 0.001; %% LGVI flag_update_h = false; flag_display_progress = false; flag_stop = 2; [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,h,N,flag_update_h,flag_display_progress,flag_stop); disp(t_elapsed); figure(1);plot(t,JJ); hold on; set(gca,'xscale','log','yscale','log'); figure(2);plot(t, errR); set(gca,'xscale','log','yscale','log'); hold on; %% Splitting flag_type=3; [JJ, errR, t_elapsed] = benchmark_LieNAG_new(A,p,R0,h,N,flag_type); figure(1);plot(t,JJ,'--'); figure(2);plot(t, errR, '--'); disp(t_elapsed); %% RK4 [t, JJ, errR, t_elapsed] = rk4(A,p,J,R0,h,N); figure(1);plot(t ,JJ, '--'); figure(2);plot(t, errR, '--'); disp(t_elapsed); %% RK45 [t, JJ, errR, t_elapsed, sol] = rk45(A,p,J,R0,h*N); figure(1);plot(t ,JJ, '-.'); figure(2);plot(t, errR, '-.'); disp(t_elapsed); save comp_3 %% figure(1) legend('$\mathrm{ELGVI}$', '$\mathrm{Splitting (SPLT)}$', '$\mathrm{RK4}$', '$\mathrm{RK45}$',... 'Location','SouthWest','interpreter','latex') ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); xlabel('$t$','interpreter','latex'); set(gca,'FontSize',16); figure(2) legend('$\mathrm{ELGVI}$', '$\mathrm{Splitting\; (SPLT)}$', '$\mathrm{RK4}$', '$\mathrm{RK45}$',... 'Location','SouthEast','interpreter','latex') xlabel('$t$','interpreter','latex'); ylabel('$\|I-R^TR\|$','interpreter','latex'); set(gca,'FontSize',16); figure(1); print('comp_3a','-depsc'); figure(2); print('comp_3b','-depsc'); cpu_time = [ 0.0774 0.0648 0.0919 0.1074 0.1185 0.1454 0.0868 0.0788 0.0711 0.0854 0.0231 0.0235 0.0274 0.0262 0.0245 0.0379 0.0230 0.0264 0.0219 0.0243 0.3346 0.3899 0.3970 0.4047 0.3916 0.3796 0.3972 0.4212 0.3748 0.3562 1.0050 1.1003 1.2049 1.1693 1.1611 1.1086 1.1300 1.2166 1.2657 1.1144]; disp(mean(cpu_time')) !cp comp_3?.eps ../figs <file_sep>% checking the numerical gradient evaluation clear; close all; % A = [ 0.7572 0.5678 0.5308 % 0.7537 0.0759 0.7792 % 0.3804 0.0540 0.9340]; % r = [0.7915 % -0.3101 % 0.5267]; % A=rand(3,3); % r=rand(3,1); A =[ 0.9398 0.6393 0.5439 0.6456 0.5447 0.7210 0.4795 0.6473 0.5225]; r =[ 0.9937 0.2187 0.1058 ]; [U S V]=psvd(A); R0 = U*expm(pi*hat(r))*V'; J=eye(3); N = 10000; %% LGVI flag_update_h = false; flag_display_progress = false; flag_stop = 2; p = 2; h = 0.1; p = 3; h = 0.025; [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,h,N,flag_update_h,flag_display_progress,flag_stop); disp(t_elapsed); figure(1);plot(1:N,JJ); hold on; set(gca,'xscale','log','yscale','log'); p = 4; h = 0.0055; [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,h,N,flag_update_h,flag_display_progress,flag_stop); disp(t_elapsed); figure(1);plot(1:N,JJ); figure(1) ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); xlabel('$k$','interpreter','latex'); set(gca,'FontSize',16); <file_sep>clear all; close all; A = [ 0.7572 0.5678 0.5308 0.7537 0.0759 0.7792 0.3804 0.0540 0.9340]; r = [0.7915 -0.3101 0.5267]; [U S V]=psvd(A); R0 = U*expm(0.9*pi*hat(r))*V'; J=eye(3); T=10; [t_GD, J_GD, errR_GD] = gdSO3(A,J,R0,T); figure(1);plot(t_GD ,J_GD, 'k'); set(gca,'xscale','log','yscale','log'); hold on; figure(2);plot(t_GD, errR_GD, 'k'); set(gca,'xscale','log','yscale','log'); hold on; p=2; [t_AGD, J_AGD, errR_AGD] = agdSO3(A,p,J,R0,T); figure(1);plot(t_AGD, J_AGD, 'b:'); figure(2);plot(t_AGD, errR_AGD, 'b:'); hk = 0.1; flag_update_h = true; [t_LGVI, J_LGVI, errR_LGVI] = vigdSO3(A,p,J,R0,hk,T,flag_update_h); figure(1);plot(t_LGVI, J_LGVI, 'r:'); figure(2);plot(t_LGVI, errR_LGVI, 'r:'); p=4; [t_AGD, J_AGD, errR_AGD] = agdSO3(A,p,J,R0,T); figure(1);plot(t_AGD, J_AGD, 'b'); figure(2);plot(t_AGD, errR_AGD, 'b'); hk = 0.1; flag_update_h = true; [t_LGVI, J_LGVI, errR_LGVI] = vigdSO3(A,p,J,R0,hk,T,flag_update_h); figure(1);plot(t_LGVI, J_LGVI, 'r'); figure(2);plot(t_LGVI, errR_LGVI, 'r'); p=6; [t_AGD, J_AGD, errR_AGD] = agdSO3(A,p,J,R0,T); figure(1);plot(t_AGD, J_AGD, 'b', 'linewidth', 2); figure(2);plot(t_AGD, errR_AGD, 'b','linewidth', 2); hk = 0.1; flag_update_h = true; [t_LGVI, J_LGVI, errR_LGVI] = vigdSO3(A,p,J,R0,hk,T,flag_update_h); figure(1);plot(t_LGVI, J_LGVI, 'r', 'linewidth', 2); figure(2);plot(t_LGVI, errR_LGVI, 'r', 'linewidth', 2); grid on; save('comp_0'); figure(1); xlabel('$t$','interpreter','latex'); ylabel('$f-f^*$','interpreter','latex'); figure(2); xlabel('$t$','interpreter','latex'); ylabel('$\|I-R^TR\|$','interpreter','latex'); <file_sep>function [t, JJ, errR, t_elapsed, R, x] = vigdSE3(p,J,R0,x0,hk,TN,flag_update_h,flag_display_progress,flag_stop,Cx) % flag_stop =1 : stop of t>TN, % flag_stop =2 : stop of k>TN, load data/p_W_landmarks.txt; load data/K.txt; load data/keypoints.txt; keypoints = keypoints'; img.w = 1271; img.h = 376; K_normal = [2/img.w 0 -1; 0 2/img.h -1 0 0 1]; N = size(keypoints,2); P = [p_W_landmarks'; ones(1,N)]; p_new = K_normal*K*[eye(3), zeros(3,1)]*P; keypoints_n = p_new(1:2,:)./p_new(3,:); keypoints_n = [keypoints_n(2,:); keypoints_n(1,:)]; K_n = K_normal*K; keypoints=keypoints_n; K=K_n; JJ_opt = obj(eye(3),zeros(3,1), K,keypoints,p_W_landmarks); Jd=trace(J)/2*eye(3)-J;%nonstandard inertia matrix options = optimoptions(@lsqnonlin,'StepTolerance', 1e-4, 'Display', 'off'); C=1; %% if flag_stop == 2 R=zeros(3,3,TN); x=zeros(3,TN); v=zeros(3,TN); grad_x=zeros(3,TN); grad_R=zeros(3,TN); t=zeros(TN,1); Pi=zeros(3,TN); end R(:,:,1)=R0; Pi(:,1)=zeros(3,1); x(:,1)=x0; v(:,1)=zeros(3,1); t(1)=1; JJ(1) = obj(R(:,:,1),x(:,1), K,keypoints,p_W_landmarks); [grad_R(:,1), grad_x(:,1)] = grad(R(:,:,1),x(:,1), K,keypoints,p_W_landmarks); tic; if flag_update_h % [~, E(1)] = err_FLdm(hk, t(1), Pi(:,1), R(:,:,1), 0, JJ(1), grad_R(:,1), p, C, Jd, K,keypoints,p_W_landmarks); end k = 1; while 1 if flag_update_h % [hk, res] = lsqnonlin(@(hk) err_FLdm(hk, t(k), Pi(:,k), R(:,:,k), E(k), JJ(k), grad_R(:,k), p, C, Jd, K,keypoints,p_W_landmarks), hk, 0, [], options); end t(k+1) = t(k) + hk; tkkp= (t(k)+t(k+1))/2; [phi_kkp, phi_dot_kkp] = compute_phi(tkkp,p); [theta_k, ~] = compute_theta(t(k),p,C); [theta_kp, theta_dot_kp] = compute_theta(t(k+1),p,C); g = (Pi(:,k) - hk*theta_k/2*grad_R(:,k))*hk/phi_kkp; if norm(g) > 1 disp('Warning: g is too large'); end Fk = expmso3( g*asin(norm(g))/norm(g) ); R(:,:,k+1) = R(:,:,k)*Fk; delxk = (v(:,k) - hk*theta_k/2*Cx*grad_x(:,k))*hk/phi_kkp; x(:,k+1) = x(:,k)+delxk; [grad_R(:,k+1), grad_x(:,k+1)] = grad(R(:,:,k+1),x(:,k+1), K,keypoints,p_W_landmarks); v(:,k+1) = v(:,k) - hk*theta_k/2*Cx*grad_x(:,k) - hk*theta_kp/2*Cx*grad_x(:,k+1); Pi(:,k+1) = Fk'*Pi(:,k) - hk*theta_k/2*Fk'*grad_R(:,k) - hk*theta_kp/2*grad_R(:,k+1); JJ(k+1) = obj(R(:,:,k+1),x(:,k+1), K,keypoints,p_W_landmarks); % if flag_update_h % JJ(k+1) = obj(R(:,:,k+1),K,keypoints,p_W_landmarks); % % E(k+1) = (-phi_dot_kkp/2/hk+phi_kkp/hk^2)*trace((eye(3)-Fk)*Jd) ... % + hk*theta_dot_kp/2*JJ(k+1) + theta_k/2*JJ(k) +theta_kp/2*JJ(k+1); % % end k=k+1; switch flag_stop case 1 if t(k) > TN break; end if flag_display_progress && rem(k,500)==0 disp([t(k)/TN]); end case 2 if k >= TN break; end if flag_display_progress && rem(k,500)==0 disp([k/TN]); end end end t_elapsed=toc; %% for k=1:length(t) % JJ(k) = obj(R(:,:,k),x(:,k), K,keypoints,p_W_landmarks)-JJ_opt; errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); end end function [errE FLdm]= err_FLdm(hk, tk, Pik, Rk, Ek, JJk, grad_Rk, p, C, Jd, K,keypoints,p_W_landmarks) tkp = tk + hk; tkkp= (tk+tkp)/2; [theta_k, theta_dot_k] = compute_theta(tk,p,C); [theta_kp, ~] = compute_theta(tkp,p,C); [phi_kkp, phi_dot_kkp] = compute_phi(tkkp,p); g = (Pik - hk/2*theta_k*grad_Rk)*hk/phi_kkp; Fk = expmso3( g*asin(norm(g))/norm(g) ); Rkp = Rk*Fk; JJkp = obj(Rkp,K,keypoints,p_W_landmarks); FLdm = (phi_dot_kkp/2/hk + phi_kkp/hk^2)*trace((eye(3)-Fk)*Jd) ... -hk*theta_dot_k/2*JJk + theta_k/2*JJk + theta_kp/2*JJkp; errE = abs(Ek-FLdm); end function J = obj(R, x, K,keypoints,p_W_landmarks) N = length(keypoints); p = [keypoints([2,1],:); ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; M = K*[R, x]; p_proj = M*P; J = norm(p(1:2,:)./p(3,:)-p_proj(1:2,:)./p_proj(3,:))^2; end function [grad_R, grad_x] = grad(R, x, K,keypoints,p_W_landmarks) eps = 1e-8; II=eye(3); grad_R=zeros(3,1); grad_x=zeros(3,1); for i=1:3 grad_R(i)=(obj(R*expmso3(eps*II(:,i)), x, K,keypoints,p_W_landmarks)... -obj(R*expmso3(-eps*II(:,i)), x, K,keypoints,p_W_landmarks))/eps/2; grad_x(i)=(obj(R,x+eps*II(:,i), K,keypoints,p_W_landmarks)... -obj(R,x-eps*II(:,i), K,keypoints,p_W_landmarks))/eps/2; end % for i=1:3 % grad_R(i)=(obj(R*expmso3(eps*II(:,i)), x, K,keypoints,p_W_landmarks)... % -obj(R, x, K,keypoints,p_W_landmarks))/eps; % grad_x(i)=(obj(R,x+eps*II(:,i), K,keypoints,p_W_landmarks)... % -obj(R, x, K,keypoints,p_W_landmarks))/eps; % end N = length(keypoints); p = [keypoints([2,1],:); ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; M = K*[R, x]; p_proj = M*P; uv = p(1:2,:)./p(3,:); uv_proj = p_proj(1:2,:)./p_proj(3,:); J = norm(uv-uv_proj)^2/N/N; grad_x=zeros(3,1); for i=1:N tmp = 2*(uv_proj(:,i)-uv(:,i))'; grad_x(1) = grad_x(1) + tmp*[K(1,1)/(x(3) + P(1:3,i)'*R(3,:)'); 0]; grad_x(2) = grad_x(2) + tmp*[0; K(1,1)/(x(3) + P(1:3,i)'*R(3,:)')]; grad_x(3) = grad_x(3) + tmp*[-(K(1,1)*(x(1) + P(1:3,i)'*R(1,:)'))/(x(3) + P(1:3,i)'*R(3,:)')^2;... -(K(1,1)*(x(2) + P(1:3,i)'*R(2,:)'))/(x(3) + P(1:3,i)'*R(3,:)')^2]; end % grad_x=grad_x/N/N; end function [phi, phi_dot] = compute_phi(t,p) phi = t^(p+1)/p; phi_dot = (p+1)/p*t^p; end function [theta, theta_dot] = compute_theta(t,p,C) theta = C*p*t^(2*p-1); theta_dot = C*p*(2*p-1)*t^(2*p-2); end <file_sep>\documentclass[letterpaper, 10pt, conference]{ieeeconf} \IEEEoverridecommandlockouts \overrideIEEEmargins \usepackage{amsmath,amssymb,url} \usepackage{graphicx}%,subfigure} %\usepackage[all,import]{xy} \usepackage{color} \usepackage{siunitx} %\usepackage[hidelinks]{hyperref} \usepackage{cleveref} \newcommand{\norm}[1]{\ensuremath{\left\| #1 \right\|}} \newcommand{\abs}[1]{\ensuremath{\left| #1 \right|}} \newcommand{\bracket}[1]{\ensuremath{\left[ #1 \right]}} \newcommand{\braces}[1]{\ensuremath{\left\{ #1 \right\}}} \newcommand{\parenth}[1]{\ensuremath{\left( #1 \right)}} \newcommand{\ip}[1]{\ensuremath{\langle #1 \rangle}} \newcommand{\refeqn}[1]{(\ref{eqn:#1})} \newcommand{\reffig}[1]{Fig. \ref{fig:#1}} \newcommand{\tr}[1]{\mbox{tr}\ensuremath{\negthickspace\bracket{#1}}} \newcommand{\deriv}[2]{\ensuremath{\frac{\partial #1}{\partial #2}}} \newcommand{\G}{\ensuremath{\mathsf{G}}} \newcommand{\SO}{\ensuremath{\mathsf{SO(3)}}} \newcommand{\T}{\ensuremath{\mathsf{T}}} \renewcommand{\L}{\ensuremath{\mathsf{L}}} \newcommand{\so}{\ensuremath{\mathfrak{so}(3)}} \newcommand{\SE}{\ensuremath{\mathsf{SE(3)}}} \newcommand{\se}{\ensuremath{\mathfrak{se}(3)}} \renewcommand{\Re}{\ensuremath{\mathbb{R}}} \newcommand{\Sph}{\ensuremath{\mathsf{S}}} \newcommand{\aSE}[2]{\ensuremath{\begin{bmatrix}#1&#2\\0&1\end{bmatrix}}} \newcommand{\ase}[2]{\ensuremath{\begin{bmatrix}#1&#2\\0&0\end{bmatrix}}} \newcommand{\D}{\ensuremath{\mathbf{D}}} \newcommand{\pair}[1]{\ensuremath{\left\langle #1 \right\rangle}} \newcommand{\met}[1]{\ensuremath{\langle\!\langle #1 \rangle\!\rangle}} \newcommand{\Ad}{\ensuremath{\mathrm{Ad}}} \newcommand{\ad}{\ensuremath{\mathrm{ad}}} \newcommand{\g}{\ensuremath{\mathfrak{g}}} \DeclareMathOperator*{\argmin}{arg\,min} \title{\LARGE \bf Variational Accelerated Optimization on a Lie Group} \author{<NAME>%\authorrefmark{1}% \thanks{<NAME>, Mechanical and Aerospace Engineering, George Washington University, Washington, DC 10051 {\tt <EMAIL>}}% %\thanks{\textsuperscript{\footnotesize\ensuremath{*}}This research has been supported in part by NSF under the grant CNS-1837382.}% } \newcommand{\RomanNumeralCaps}[1]{\textup{\uppercase\expandafter{\romannumeral#1}}} \newcommand{\RI}{\RomanNumeralCaps{1}} \newcommand{\RII}{\RomanNumeralCaps{2}} \newcommand{\RIII}{\RomanNumeralCaps{3}} \newcommand{\EditTL}[1]{{\color{red}\protect #1}} \renewcommand{\EditTL}[1]{{\protect #1}} \newtheorem{definition}{Definition} \newtheorem{lem}{Lemma} \newtheorem{prop}{Proposition} \newtheorem{remark}{Remark} \graphicspath{{./Figs/}} %\color{white}\pagecolor{black} \begin{document} \allowdisplaybreaks \maketitle \thispagestyle{empty} \pagestyle{empty} \begin{abstract} \end{abstract} \section{Introduction} \section{Hamiltonian Mechanics} Consider an $n$-dimensional Lie group $\G$. Let $\g$ be the tangent space at the identity, i.e., $\g = \T_e\G$, or the lie algebra. The tangent bundle of the group is identified with $\T\G \simeq G\times \g$ via left trivialization. More specifically, let $\L:\G\times\G\rightarrow\G$ be the left action defined such that $\L_g h = gh$ for $g,h\in\G$. For any $v\in\T_g\G$, there exists $\xi\in\g$ such that $v =\T_e\L_g \xi=g\xi$. Further, suppose $\g$ is equipped with an inner product $\pair{\cdot, \cdot}$, which is extended to the corresponding inner product on $\T_g\G$ through the left trivialization, i.e., for any $v,w\in\T_g\G$, we have $\pair{w,v}_{\T_g\G} = \pair{ \T_g \L_{g^{-1}} v, \T_g \L_{g^{-1}} w}_\g$. Considering the inner product as a pairing between a tangent vector and a cotangent vector, $g\simeq g^*$ and $\T_g \G \simeq \T^*_g \G\simeq G\times \g^*$. Throughout this paper, the pairing is also denoted by $\cdot$. \subsection{Variational Principle in Phase Space} Consider a Hamiltonian system evolving on $\G$, with the Hamiltonian given by $H(g,\mu): \G\times \g^* \rightarrow \Re$. The corresponding Hamiltonian flow $g(t),\mu(t)$ can be formulated with variational principles in the phase space. Considering the flow map from the initial state $(g(t_0),\mu(t_0))$ to the terminal state $(g(t_f),\mu(t_f))$ as a canonical transform, the variational principle can be formulated in four types of generating functions. First, consider the following functional dependent of a curve $(g(\cdot),\mu(\cdot))$ on $\G\times \g^*$ over $[t_0,t_f]$, \begin{align} \mathfrak{G}_\RI = \int_{t_0}^{t_f} \mu \cdot \xi - H(g,\mu) \, dt,\label{eqn:G10} \end{align} where $\xi\in\g$ is defined such that \begin{align} \dot g = \T_e \L_{g}\, \xi = g\xi.\label{eqn:g_dot} \end{align} The Hamilton's phase space variational principle states that the solution of following Hamilton's equations with the fixed boundary conditions $g(t_0)=g_0$ and $g(t_f)=g_f$ extremizes the functional, as presented in~\cite[Section 8.6.5]{LeeLeo17}: \begin{align} \dot \mu & = \ad^*_{H_\mu(g,\mu)} \mu - \T^*_e \L_g (\D_g H(g,\mu)),\label{eqn:mu_dot}\\ \dot g & = g H_\mu (g,\mu),\label{eqn:g_dot_H} \end{align} where $\ad^*$ is the coadjoint operator and $\D_g$ denotes the differential. Once the functional is evaluated with the solution of the above equations satisfying the boundary condition, it is rewritten as $\mathfrak{G}_\RI(g_0, g_f)$, which corresponds to the type $\RI$ generating function. Further, replacing $t_f$ with an arbitrary time $t$, and taking the variation of $\mathfrak{G}_\RI$ with the end point $(g, t)$, \begin{align} \delta\mathfrak{G}_\RI = \deriv{ \mathfrak{G}_\RI}{t} \delta t + \D_g\mathfrak{G}_\RI \cdot \delta g = g\mu \cdot \delta g - H(g,\mu) \delta t,\label{eqn:G1} \end{align} which yields \begin{align} \mu =\T^*_e \L_g (\D_g \mathfrak{G}_\RI). \end{align} and the Hamilton-Jacobi equation \begin{align} \deriv{ \mathfrak{G}_\RI}{t} + H(g, \T^*_e \L_g (\D_g \mathfrak{G}_\RI )) = 0. \end{align} These summarize the phase space variational principle to recover the Hamilton's equations with the type $\RI$ generating function. Next, we formulate the variational principle with the type $\RII$ generating function to discretize the Hamilton's equations. The type $\RII$ generating function is constructed by the Legendre transform of the type $\RI$ generating function as \begin{align} \mathfrak{G}_\RII (g_0, p_f) = \sup_{g_f} \{ p_f \cdot g_f - \mathfrak{G}_\RI (g_0,g_f) \},\label{eqn:G2} \end{align} where $p_f$ is conjugate to $g_f$ determined by \begin{align} p_f = \D_{g_f} \mathfrak{G}_\RI (g_0,g_f) = g_f\mu_f. \end{align} Similar with the type $\RI$ case, the type $\RII$ generating function can be considered as a functional dependent of $(g(\cdot),\mu(\cdot))$ with the fixed boundary conditions $g(t_0)=g_0$ and $p(t_f)=p_f$. The corresponding phase space variational principle is presented as follows. \begin{prop}\label{prop:PVPII} The solution of the Hamilton's equations \eqref{eqn:mu_dot} and \eqref{eqn:g_dot_H} with the boundary condition $g(t_0)=g_0$ and $p(t_f)=p_f$ extremizes \eqref{eqn:G2} that is considered as a functional. \end{prop} \begin{proof} The infinitesimal variation of \eqref{eqn:G2} is \begin{align} \delta\mathfrak{G}_\RII & = p_f \cdot \delta g(t_f)\nonumber\\ & \quad - \int_{t_0}^{t_f} \braces{ \mu \cdot \delta\xi - \pair{\D_g H, \delta g} +\delta\mu \cdot \parenth{ \xi - H_\mu}} dt,\label{eqn:delta_G_0} \end{align} where $\delta g$ can be written as $\delta g = g\eta$ for $\eta\in\g$. Since taking the time-derivatives commutes with taking the variation, from \eqref{eqn:g_dot}, we obtain $\delta \dot g = g\eta\xi + g\delta \xi = g\xi \eta + g \dot\eta$, which yields \begin{align} \delta \xi = \dot \eta + \ad_\xi\eta. \end{align} Substituting these into \eqref{eqn:delta_G_0} and rearranging \begin{align*} \delta\mathfrak{G}_\RII & = \mu_f \cdot \eta(t_f)\\ & \quad - \int_{t_0}^{t_f} \{ \mu\cdot\dot\eta + (\ad^*_\xi\mu - \T^*_e \L_g (\D_g H))\cdot \eta \\ & \qquad + \delta\mu\cdot(\xi- H_\mu)\}\,dt. \end{align*} Integrating the second term on the right side by parts, and using $\eta(t_0)=0$, \begin{align*} \delta\mathfrak{G}_\RII & = - \int_{t_0}^{t_f} \{ (-\dot \mu+\ad^*_\xi\mu - \T^*_e \L_g (\D_g H))\cdot \eta \\ & \qquad + \delta\mu\cdot(\xi- H_\mu)\}\,dt. \end{align*} To extremize $\mathfrak{G}_\RII$, we should have $\delta\mathfrak{G}_\RII=0$ for any $\eta(t),\delta\mu(t)$, and this yields \eqref{eqn:mu_dot} and \eqref{eqn:g_dot_H}. \end{proof} \subsection{Hamiltonian Variational Integrator} Variational integrators are geometric numerical integration schemes interpreted as discrete-time mechanics, and traditionally, they were constructed by discretizing the variational principle for Lagrangian mechanics~\cite{MarWesAN01}. For Lagrangian mechanics evolving on a Lie group, the corresponding Lie group variational integrators are presented in~\cite{Leo04,Lee08,LeeLeoCMAME07}. On the other hand, the discrete Hamiltonian mechanics has been formulated from generating functions~\cite{de2007discrete,LalWesJPMG06}, where the type $\RII$ and the type $\RIII$ generating functions over a time step are referred to as the \textit{right} and the \textit{left} discrete Hamiltonian, respectively. In fact, the discrete Lagrangian can be considered as the type $\RI$ generating function. These are further developed into the discrete Hamilton-Jacobi theory~\cite{OhsBloSJCO11} and higher-order integrators~\cite{leok2011discrete}, respectively. In this subsection, we present the discrete counterpart of the previous section, where Lie group Hamiltonian variational integrator is constructed. Let the time span be discretized with a time step $h>0$ into a sequence indexed by integer $k$, i.e., $\{t_0,t_1,\ldots\}$. The subscript $k$ denotes the value of a variable at $t=t_k$. The sequence of $g_k$ is marched by \begin{align} g_{k+1} = g_k f_k,\label{eqn:gkp} \end{align} where $f_k\in\G$ represents the relative update of the group elements over a timestep. The exact discrete Lagrangian is the type $\RI$ generating function \eqref{eqn:G1} over a discrete time step, \begin{align*} L_d (g_k, f_k) = \mathfrak{G}_\RI (g_k, g_kf_k), \end{align*} which is evaluated along the solution of \eqref{eqn:mu_dot} and \eqref{eqn:g_dot_H} satisfying $g(t_k)=g_k$ and $g(t_{k+1})=g_kf_k$. Then, \eqref{eqn:G1} can be considered as a functional for a discrete trajectory $\{g_k,f_k\}_{k=0}^{N-1}$ given by \begin{align} \mathfrak{G}^d_\RI = \sum_{k=0}^{N-1} L_d(g_k,f_k).\label{eqn:G1d} \end{align} According to the variational principle, the discrete Euler-Lagrange equations are constructed as follows. \begin{prop} The discrete trajectory of $\{(g_k,f_k)\}_{k=0}^{N-1}$ extremizing \eqref{eqn:G1d} with the fixed $g_0$ and $g_N$ constructed by the following discrete Euler-Lagrange equation, \begin{gather} \T^*_e\L_{g_k}(\D_{g_k} L_{d_k})- \Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} L_{d_k}))\nonumber \\ + \T^*_e\L_{f_{k-1}}(\D_{f_{k-1}} L_{d_{k-1}}) =0,\label{eqn:DEL} \end{gather} and \eqref{eqn:gkp}. \end{prop} \begin{proof} From \eqref{eqn:gkp}, \begin{align*} \delta f_k = - g_k^{-1}( \delta g_k ) g_k^{-1} g_{k+1} + g_k^{-1}\delta g_{k+1}. \end{align*} Since $\delta g_k = g_k \eta_k $ for $\eta_k\in \g$, this is rewritten as \begin{align*} \delta f_k = - \eta_k f_k +f_k \eta_{k+1}. \end{align*} Or equivalently, \begin{align} f_k^{-1}\delta f_k = -\Ad_{f_k^{-1}} \eta_k + \eta_{k+1}.\label{eqn:del_fk} \end{align} Taking the variation of \eqref{eqn:G1d} and substituting \eqref{eqn:del_fk}, \begin{align*} \delta \mathfrak{G}^d_\RI = \sum_{k=0}^{N-1} & \T^*_e\L_{g_k}(\D_{g_k} L_{d_k}) \cdot \eta_k \\ & + \T^*_e\L_{f_k}(\D_{f_k} L_{d_k}) \cdot (-\Ad_{f_k^{-1}} \eta_k + \eta_{k+1}). \end{align*} Using $\eta_0=\eta_N=0$, the summation can be rewritten as \begin{align*} \delta \mathfrak{G}^d_\RI = \sum_{k=1}^{N-1} & \{ \T^*_e\L_{g_k}(\D_{g_k} L_{d_k})- \Ad^*_{f_k^{-1}} (\T^*_e\L_{f_k}(\D_{f_k} L_{d_k})) \} \cdot \eta_k \\ & + (\T^*_e\L_{f_{k-1}}(\D_{f_{k-1}} L_{d_{k-1}})) \cdot \eta_{k}. \end{align*} According to the variational principle, $\delta\mathfrak{G}^d_\RI = 0$ for any $\eta_k$, and this yields \eqref{eqn:DEL}. \end{proof} The exact discrete Hamiltonian of the type $\RII$ is the generating function \begin{align} H^d_\RII (g_k, p_{k+1}) = \sup_{g_{k+1}} \{ p_{k+1}\cdot g_{k+1} - L_d(g_k,g_k^{-1} g_{k+1})\} \end{align} which implies \begin{align*} p_{k+1} \cdot g_{k+1}\eta_{k+1} - \D_{f_k} L_d(g_k, f_k )\cdot f_k \eta_{k+1} =0. \end{align*} Thus, we have \begin{align} \mu_{k+1} = g_{k+1}^{-1} p_{k+1} = \T^*_e\L_{f_k} (\D_{f_k} L_{d_k}).\label{eqn:DLT+} \end{align} Then, \eqref{eqn:G2} can be considered as a functional for a discrete trajectory $\{g_k,\mu_k\}_{k=0}^N$ given by \begin{align} \mathfrak{G}_\RII^d = p_N\cdot g_N - \sum_{k=0}^{N-1} \{p_{k+1}\cdot g_{k+1} - H_d(g_k,\mu_{k+1})\}. \end{align} In analogous to \Cref{prop:PVPII}, the type $\RII$ discrete phase space variational principle states that $\delta\mathfrak{G}_\RII^d=0$ for any discrete trajectory with the fixed boundary condition $(g_0,g_N\mu_N)= (g_0,p_N)$~\cite{leok2011discrete}. This yields the discrete Hamilton's equations as follows. \begin{prop} \begin{align} p_k & = \D_{g_k} H_d( g_k, p_{k+1}),\label{eqn:DHE_q}\\ g_{k+1} & = \D_{p_{k+1}} H_d(g_{k}, p_{k+1}).\label{eqn:DHE_g} \end{align} \end{prop} \begin{proof} The variation of $\mathfrak{G}_\RII^d$ is \begin{align*} \delta \mathfrak{G}_\RII^d & = - \sum_{k=1}^{N-1} \delta p_k \cdot g_k + p_k \cdot \delta g_k\\ & \quad +\sum_{k=0}^{N-1} \D_{g_k} H_{d_k} \cdot \delta g_k + \D_{p_{k+1}} H_{d_k} \cdot \delta p_{k+1}\\ & = - \sum_{k=1}^{N-1} \delta p_k \cdot g_k + p_k \cdot \delta g_k\\ & \quad +\sum_{k=1}^{N-1} \D_{g_k} H_{d_k} \cdot \delta g_k + \D_{p_{k}} H_{d_{k-1}} \cdot \delta p_{k}\\ & \quad +\D_{g_0} H_{d_0} \cdot \delta g_0 + \D_{p_{N}} H_{d_{N-1}} \cdot \delta p_{N}. \end{align*} From the fixed boundary conditions, $\delta g_0 = \delta p_N=0$. Since $\delta \mathfrak{G}_\RII^d =0$ for any $\delta g_k, \delta p_k$, this yields \eqref{eqn:DHE_q} and \eqref{eqn:DHE_g}. \end{proof} \section{Attitude Dynamics of a Rigid Body on $\SO$} Consider the attitude dynamics of a rigid body described by \begin{gather*} J\dot\Omega + \Omega\times J\Omega = 0, \\ \dot R = R\hat\Omega. \end{gather*} The Lagrangian is \begin{align*} L(\Omega) = \frac{1}{2}\Omega \cdot J\Omega. \end{align*} \subsection{Discrete Lagrangian Mechanics on $\SO$} The discrete Lagrangian can be chosen as \begin{align*} L_d (F_k) = \frac{1}{h} \tr{ (I-F_k) J_d}, \end{align*} where $J_d = \frac{1}{2}\tr{J}I- J$. Equations \eqref{eqn:DEL} yields the discrete Euler-Lagrange equation \begin{align*} \frac{1}{h} ( F_{k+1}J_d - J_d F_{k+1}^T ) -\frac{1}{h} (J_d F_k - F_k^T J_d) = 0. \end{align*} For given $(R_k,F_k)$, the above can be solved for $F_{k+1}$ to yield $(R_{k+1}, F_{k+1})$. From the (right) discrete Legendre transform given by \eqref{eqn:DLT+}, \begin{align} R_{k+1}^T P_{k+1} = \frac{1}{h}(J_d F_k - F_k^T J_d) =\hat p_{k+1}. \label{eqn:Pkp} \end{align} Similarly, from the (left) discrete Legendre transform, one can show \begin{align*} R_k^T P_k = \frac{1}{h} (F_k J_d - J_d F_k^T) = \hat p_k. \end{align*} Therefore, the discrete EL equation can also be written as \begin{align*} \hat p_{k+1} = F_k^T \hat p_k F_k = \Ad^*_{F_k} \hat p_k = (F_k^Tp_k)^\wedge \end{align*} \subsection{Discrete Hamiltonian Mechanics on $\SO$} From Lall and West, the type II discrete Hamiltonian is chosen as \begin{align*} H_d (R_k, P_{k+1}) & = P_{k+1} \cdot R_k + \frac{h}{2} \mu_{k+1} \cdot J^{-1} \mu_{k+1}\\ & = \frac{1}{2}\tr{R_k^T P_{k+1}} + \frac{h}{2} \tr{ J^{-1} \mu_{k+1}\mu_{k+1}^T}. \end{align*} Since $xx^T = \hat x^2 -\frac{1}{2}\tr{\hat x^2}I_{3\times 3}$, it can be rearranged into \begin{align*} H_d (R_k, P_{k+1}) & = \frac{1}{2}\tr{R_k^T P_{k+1}} + \frac{h}{2} \tr{ K \hat \mu_{k+1}^T \hat \mu_{k+1}} \end{align*} where $K = \frac{1}{2}\tr{J^{-1}} I_{3\times 3}-J^{-1} \in\Re^{3\times 3} $. This further implies \begin{align} H_d (R_k, P_{k+1}) & = \frac{1}{2}\tr{R_k^T P_{k+1}} + \frac{h}{2} \tr{ K P_{k+1}^T P_{k+1}}. \end{align} The derivative of the discrete Hamiltonian is \begin{align*} \D_{R_k} H_d \cdot \delta R_k = P_{k+1} \cdot \delta R_k = P_k \cdot \delta R_k. \end{align*} This implies the \textit{projection} of $P_{k+1}$ to $\T_{R_k} \SO$ is equal to $P_k$, or $P_{k+1} F_k^T = P_k$. Thus \begin{align*} R_{k+1} \hat \mu_{k+1} F_k^T = R_k \hat \mu_k, \end{align*} or \begin{align*} R_k F_k \hat\mu_{k+1} F_k^T = R_k \hat \mu_k, \end{align*} or \begin{align} F_k \mu_{k+1} = \mu_k, \end{align} which is consistent with LGVI, and it implies the conservation of the angular momentum. However, if we don't use the \textit{projection}, \begin{align*} & \D_{R_k} H_d \cdot \delta R_k =\frac{1}{2} \tr{-\hat\eta_k Q_k} \\ & = \frac{1}{2} ( Q_k- Q_k^T )^\vee\cdot \eta_k, \end{align*} where $Q_k = R_k^T P_{k+1} = F_k \hat\mu_{k+1}$. Thus, \begin{align*} \mu_k & = \frac{1}{2} (F_k\hat\mu_{k+1}+\hat\mu_{k+1}F_k^T )^\vee\nonumber \\ & = \frac{1}{2}(\tr{F_k}I_{3\times 3}-F_k^T) \mu_{k+1}. \end{align*} Unfortunately, this implies that the angular momentum is not preserved. Let's stick to the idea of projection for now. Next, the derivative with respect to $P_{k+1}$ is \begin{align*} \D_{P_{k+1}} H_d & = \frac{1}{2}\tr{ R_k^T \delta P_{k+1}} + h\tr{K \delta P_{k+1}^T P_{k+1} } \\ & = ( R_k + 2h P_{k+1}K ) \cdot \delta P_{k+1} \end{align*} Thus, \begin{gather*} 0 = (- R_{k+1} + R_k + 2h P_{k+1}K ) \cdot \delta P_{k+1},\\ 0 = (- I + F_k^T + 2h \hat\mu_{k+1} K ) \cdot \delta \hat p_{k+1}. \end{gather*} This implies \begin{gather} 2h \hat\mu_{k+1} K + 2h K \hat\mu_{k+1} = F_k - F_k^T\nonumber\\ 2h (\tr{K}I_{3\times 3} - K )\mu_{k+1} = (F_k- F_k^T)^\vee. \end{gather} \begin{align*} H_d (R_k, P_{k+1}) & = \frac{1}{2}\tr{R_k^T P_{k+1}} + \frac{h}{2} \tr{ K R_k^T P_{k+1} P_{k+1}^T R_k }. \end{align*} The variation of the discrete Hamiltonian is \begin{align*} & \D_{R_k} H_d \cdot \delta R_k =\frac{1}{2} \tr{-\hat\eta_k Q_k} - h \tr{\hat\eta_k Q_kQ_k^T K } \\ & = ( (Q_k^T- Q_k)/2 +h Q_kQ_k^TK - hK Q_k Q_k^T)^\vee\cdot \eta_k \end{align*} where $Q_k = R_k^T P_{k+1} = F_k \hat\mu_{k+1}$. Thus, \begin{align} \mu_k & = ((F_k\hat\mu_{k+1}-\hat\mu_{k+1}F_k^T)/2 - h \widehat{F_k\mu_{k+1}}^2 K + h K \widehat{F_k\mu_{k+1}}^2)^\vee\nonumber \\ & = \{ \frac{1}{2}(\tr{F_k}I_{3\times 3}-F_k^T) -h (KF_k\mu_{k+1})^\wedge F_{k+1} \} \mu_{k+1}. \end{align} Also, \begin{align*} \D_{P_{k+1}} H_d & = \frac{1}{2}\tr{ R_k^T \delta P_{k+1}} + h\tr{KR_k^T \delta P_{k+1} P_{k+1}^T R_k} \\ & = ( R_k + 2h R_k K R_k^T P_{k+1}) \cdot \delta P_{k+1} \end{align*} Thus, \begin{gather*} 0 = (- R_{k+1} + R_k + 2h R_k K R_k^T P_{k+1}) \cdot \delta P_{k+1},\\ 0 = (- I + F_k^T + 2h F_k^T K F_k \hat\mu_{k+1}) \cdot \delta \hat p_{k+1}. \end{gather*} This implies \begin{gather} 2h F_k^T K F_k \hat\mu_{k+1} + 2h \hat\mu_{k+1} F_k^T K F_k = F_k - F_k^T\nonumber\\ 2h (\tr{K}I_{3\times 3} - F_k^T K F_k)\mu_{k+1} = (F_k- F_k^T)^\vee. \end{gather} \subsection{Symplectic Form on $\SO$} We have $\hat\mu = R^T P$. \begin{align*} \delta \hat \mu = -\hat\eta R^T P + R^T \delta P. \end{align*} Solve this for $\delta P$, \begin{align*} R \delta \hat \mu + R\hat\eta R^T P + \delta P,\\ R \delta \hat \mu + R\hat\eta \hat\mu+ \delta P. \end{align*} Substituting these into the canonical form on $\T^*\SO$ \begin{align*} & \omega( R, P) ((\delta R_1, \delta P_1),(\delta R_2, \delta P_2)) \\ & = \pair{\delta P_2, \delta R_1}-\pair{\delta P_1, \delta R_2} \\ & = \pair{\delta\hat\mu_2 +\hat\eta_2\hat\mu, \hat\eta_1} -\pair{\delta\hat \mu_1 + \hat\eta_1\hat\mu, \hat \eta_2}\\ & = \delta \mu_2 \cdot \eta_1 - \delta \mu_1 \cdot \eta_2 + \mu \cdot (\eta_1\times \eta_2)\\ & = \omega_L(R,\mu) ((\eta_1, \delta \mu_1), (\eta_2,\delta\mu_2)). \end{align*} In a matrix form, \begin{align*} & \omega_L(R,\mu) ((\eta_1, \delta \mu_1), (\eta_2,\delta\mu_2))\\ & = \begin{bmatrix} \eta_1 \\ \mu_1 \end{bmatrix}^T \begin{bmatrix} -\hat\mu & I_{3\times 3}\\ -I_{3\times 3} & 0_{3\times 3} \end{bmatrix} \begin{bmatrix} \eta_2 \\ \mu_2 \end{bmatrix} \\ & = \begin{bmatrix} \eta_1 \\ \mu_1 \end{bmatrix}^T \mathbb{J}_L(\mu) \begin{bmatrix} \eta_2 \\ \mu_2 \end{bmatrix}. \end{align*} One can show \begin{align*} \mathbb{J}_L(\mu) & = -\mathbb{J}_L^T(\mu) \\ \mathbb{J}^{-1}_L(\mu) & = \begin{bmatrix} 0_{3\times 3} & -I_{3\times 3}\\ I_{3\times 3} & \hat\mu \end{bmatrix},\\ \mathbb{J}^{-T}_L(\mu) \mathbb{J}(\mu) & = \begin{bmatrix} -I_{3\times 3} & 0_{3\times 3}\\ -2 \hat\mu & -I_{3\times 3} \end{bmatrix}. \end{align*} The Hamiltonian vector field is defined by \begin{align*} \omega( X_H(z), \delta z) = dH(z) \cdot \delta z \end{align*} or \begin{align*} X_H = \mathbb{J}^{-T} dH. \end{align*} In the reduced form, we have \begin{align*} \begin{bmatrix} (R^T \dot R)^\vee \\ \dot \mu \end{bmatrix} = \begin{bmatrix} 0_{3\times 3} & I_{3\times 3}\\ -I_{3\times 3} & -\hat\mu \end{bmatrix} \begin{bmatrix} \T^* \L_R (D_RH)\\ H_\mu \end{bmatrix}, \end{align*} which yields \begin{align*} \dot R & = R \hat H_\mu,\\ \dot \mu & = -\hat\mu H_\mu - \T^* \L_R (D_RH). \end{align*} \section{Hamiltonian Variational Integrator} Let's try to approximate \eqref{eqn:G10} directly, without any canonical transform, as in~\cite{ma2010lie,de2018lie}. We have \begin{align*} \frac{1}{h} R_k^T(R_{k+1}-R_k) = \frac{1}{h} (F_k - I_{3\times 3}) \approx \hat\Omega_k. \end{align*} Or, $\hat\Omega_k$ is approximated by the skew-symmetric part of it to obtain \begin{align*} h\hat\Omega_k =\frac{1}{2}( F_k-F_k^T). \end{align*} We have \begin{align*} &\mathfrak{G}_k(R_k,\Pi_k,F_k) = \frac{1}{2}\Pi_k \cdot (F_k-F_k^T)^\vee\\ &- \frac{h}{2} \Pi_k\cdot J^{-1}\Pi_k -\frac{h}{2}U(R_k) -\frac{h}{2} U(R_kF_k). \end{align*} Also, \begin{align*} \delta F_k = -\hat\eta_k F_k + F_k\hat\eta_{k+1}. \end{align*} Now, \begin{align*} \delta \mathfrak{G}_k & = \frac{1}{2}(F_k-F_k^T)^\vee \cdot \delta \Pi_k -h J^{-1}\Pi_k \cdot \delta\Pi_k \\ &\quad + \frac{1}{2} \Pi_k \cdot (\delta F_k -\delta F_k^T)^\vee\\ &\quad +\frac{h}{2} M_k\cdot \eta_k + \frac{h}{2} M_{k+1} \cdot \eta_{k+1}, \end{align*} where \begin{align*} \delta F_k -\delta F_k^T & = -\hat\eta_k F_k -F_k^T \hat\eta_k + F_k\hat\eta_{k+1} + \hat\eta_{k+1} F_k^T \\ & = -((\tr{F_k}I_{3\times 3}-F_k) \eta_k )^\wedge \\ & \quad + ((\tr{F_k}I_{3\times 3}-F_k^T) \eta_{k+1} )^\wedge. \end{align*} Substituting this \begin{align*} \delta \mathfrak{G}_k & = (\frac{1}{2}(F_k-F_k^T)^\vee -h J^{-1}\Pi_k) \cdot \delta\Pi_k \\ &\quad +\frac{1}{2} ( -(\tr{F_k}I_{3\times 3} -F_k^T)\Pi_k + hM_k ) \cdot \eta_k\\ &\quad +\frac{1}{2} ( +(\tr{F_k}I_{3\times 3} -F_k)\Pi_k + hM_{k+1} ) \cdot \eta_{k+1}. \end{align*} Thus, \begin{align*} \delta\mathfrak{G} & = \sum_{k=0}^{N-1} \delta\mathfrak{G}_k \\ & = \sum_{k=1}^{N-1} (\frac{1}{2}(F_k-F_k^T)^\vee -h J^{-1}\Pi_k) \cdot \delta\Pi_k \\ &\quad + \sum_{k=1}^{N-1} \frac{1}{2}( -(\tr{F_k}I_{3\times 3} -F_k^T)\Pi_k + h M_k ) \cdot \eta_k\\ &\quad + \sum_{k=1}^{N-1} \frac{1}{2}( (\tr{F_{k-1}}I_{3\times 3} -F_{k-1})\Pi_{k-1} + h M_{k} ) \cdot \eta_{k}. \end{align*} Thus, \begin{gather} \frac{1}{2}(F_k -F_k^T)^\vee = hJ^{-1}\Pi_k,\\ (\tr{F_k}I_{3\times 3} -F_k^T)\Pi_k - 2 h M_k = (\tr{F_{k-1}}I_{3\times 3} -F_{k-1})\Pi_{k-1} . \end{gather} Both equations should be solved together for $F_k,\Pi_k$. But, the first implies \begin{align*} f_k = h J^{-1}\Pi_k, \end{align*} or \begin{align*} F_k = \exp (h \widehat{J^{-1}\Pi_k}). \end{align*} The second should be solved for $\Pi_k$. Alternatively, assume that \begin{align*} J^{-1} (F_k J_d - J_d F_k^T)^\vee \approx h\Omega_k. \end{align*} We have \begin{align*} \mathfrak{G}_k & = \Pi_k \cdot J^{-1} (F_k J_d - J_d F_k^T)^\vee \\ &\quad - \frac{h}{2} \Pi_k \cdot J^{-1}\Pi_k - \frac{h}{2} U(R_k) - \frac{h}{2} U(R_k F_k). \end{align*} Also, \begin{align*} & \delta F_k J_d - J_d\delta F_k^T =-\hat\eta_k F_k J_d -J_d F_k^T\hat\eta_k\\ & + F_k\hat\eta_{k+1} J_d + J_d \hat\eta_{k+1} F_k^T\\ & = - (\tr{F_kJ_d}I_{3\times 3} -F_k J_d)\eta_k\\ & + (\tr{F_kJ_d}I_{3\times 3} - F_kJ_d)\eta_{k+1}. \end{align*} Now, \begin{align*} \delta \mathfrak{G} & = ( (F_k J_d - J_d F_k^T)^\vee - h\Pi_k) \cdot J^{-1}\delta\Pi_k\\ & \quad J^{-1}\Pi_k \cdot ( \end{align*} The resulting integrators are \begin{gather*} (F_k J_d - J_d F_k^T)^\vee = h\Pi_k \\ (\tr{F_kJ_d}I_{3\times 3} -F_k J_d)^T J^{-1}\Pi_k - hM_k\\ = (\tr{F_{k-1}J_d}I_{3\times 3} -F_{k-1} J_d)^T J^{-1}\Pi_{k-1} . \end{gather*} The first one is identical to the LGVI, but not the second one. For given $\Pi_k$, the first one is solved for $F_k$. Then, the second should be solved for $F_{k+1}$. Numerically, it is slower and it has larger energy error. So, we wouldn't study it further. \section{Bregman Dynamics for Optimization} Consider \begin{align*} H_p(t,g,\mu) = \frac{p}{2t^{p+1}} \pair{\mu,\mu} + cp t^{2p-1} f(g). \end{align*} This is transformed into autonomous system by extending the configuration space into $\G\times \Re$. \begin{align*} \bar H (g,t,\mu,E) = H(g,\mu,t) -E, \end{align*} where \begin{align*} E = E(\tau) = H(t(\tau), g(\tau),\mu(\tau)). \end{align*} Now we have $((g,t),(\mu,-E)) = (\G\times \Re)\times(g^*, \Re)$. The variational principle is \begin{align*} \mathfrak{G} = \int_{\tau_0}^{\tau_f} \big[ \mu(\tau) \cdot \bar\xi(\tau) - H(t(\tau), g(\tau), \mu(\tau)) \frac{dt}{d\tau}\big] d\tau, \end{align*} where \begin{align*} \bar \xi = g^{-1} g' \end{align*} Now \begin{align*} \mathfrak{G} = \int_{\tau_0}^{\tau_f} \big[ \mu(\tau) \cdot \bar\xi(\tau) - \bar H( g,t,\mu,-E) \big] d\tau, \end{align*} with \begin{align*} \bar H = (H(t(\tau), g(\tau), \mu(\tau))- E) \frac{dt}{d\tau} \end{align*} \section{Bregman Lagrangian System on $\SO$} On a second thought, do we really need Hamiltonian system, given that we have VI for the time-varying Lagrangian system. Bregman Lagrangian is \begin{align*} L = e^{\alpha(t)+\gamma(t)} D_h(x+ e^{-\alpha(t)} v, x) - e^{\alpha+\beta+\gamma} f(x), \end{align*} where \begin{align*} \dot\beta \leq e^\alpha\\ \dot \gamma = e^\alpha. \end{align*} In particular, the following choice has been made. For $p,C>0$, \begin{align*} \alpha & = \log p - \log t\\ \beta & = p\log t + \log C\\ \gamma & = p \log t. \end{align*} Substituting these, \begin{align*} L = p t^{p-1} D_h(x+ \frac{t}{p} v, x) - p C t^{2p-1} f(x). \end{align*} Further when $h(x)=\frac{1}{2}\|x\|^2$, \begin{align*} L = \frac{t^{p+1}}{2p} \| v\|^2 - p C t^{2p-1} f(x). \end{align*} \subsection{Continuous-Time EL} Consider \begin{align*} L(t,R,\Omega) = \frac{t^{p+1}}{2p} \Omega\cdot J\Omega - cpt^{2p-1} f(R). \end{align*} It has been shown that the variational principle in the extended space results in the same EL equation as for autonomous systems, and it does not matter how the time is reparameterized. We have \begin{align*} \D_\Omega L = \frac{t^{p+1}}{p} J\Omega,\\ \T^*_e \L_R( \D_R L) = cpt^{2p-1} M. \end{align*} and \begin{align*} \frac{d}{dt} \D_\Omega L = \frac{p+1}{p} t^p J\Omega + \frac{t^{p+1}}{p} J\dot\Omega. \end{align*} Thus, the EL equation is given by \begin{align*} \frac{t^{p+1}}{p} J\dot\Omega + \frac{p+1}{p} t^p J\Omega + \frac{t^{p+1}}{p} \hat\Omega J\Omega - cpt^{2p-1} M = 0, \end{align*} or \begin{align*} J\dot\Omega + \frac{p+1}{t} J\Omega + \hat\Omega J\Omega - c p^2 t^{p-2} M = 0. \end{align*} Let \begin{align*} \Pi = \frac{t^{p+1}}{p} J\Omega \end{align*} We have \begin{align*} \dot \Pi + \Omega\times \Pi - cpt^{2p-1} M = 0. \end{align*} and \begin{align*} \dot R = \frac{p}{t^{p+1}} R (J^{-1}\Pi)^\wedge \end{align*} Let \begin{align*} f(R) & = \frac{1}{2}\| A- R\|^2_F = \frac{1}{2} \tr{(A-R)^T(A-R)} \\ & =\frac{1}{2}(\|A\|^2 + 3) - \tr{A^T R}. \end{align*} Thus, \begin{align*} \D_R f(R) \cdot \delta R = -\tr{A^T R\hat\eta} = (A^T R- R^T A)^\vee \cdot \eta. \end{align*} This implies \begin{align*} M = (R^T A-A^T R)^\vee. \end{align*} \subsection{LGVI} The discrete Lagrangian is chosen as \begin{align*} & L_d(t_k, t_{k+1}, R_k, F_k) = \frac{t_{k}^{p+1}}{h_k p} \tr{(I-F_k)J_d}\\ &- \frac{h_k}{2}c p t_k^{2p-1} f(R_k) - \frac{h_k}{2}c p t_{k+1}^{2p-1} f(R_{k+1}), \end{align*} where $h_k = t_{k+1}-t_k$. Let \begin{align*} M = -\T^*_I \L_R f(R). \end{align*} We have \begin{align*} D_{R_k} L_{d_k} &= \frac{h_k}{2} cp (t_k^{2p-1} M_k + t_{k+1}^{2p-1} F_k M_{k+1})\\ D_{F_k} L_{d_k} &= \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1} \\ \Ad^*_{F_k^T} & \T^*_e \L_{F_{k+1}} D_{F_k} L_{d_k}\\ & = \frac{t^{p+1}_{k}}{h_k p} (F_k J_d - J_dF_k^T)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} F_k M_{k+1} \\ \end{align*} Substituting these into DEL \begin{align*} \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1}\\ - \frac{t^{p+1}_{k+1}}{h_{k+1} p} (F_{k+1} J_d - J_dF_{k+1}^T)^\vee - \frac{h_{k+1}}{2} cpt^{2p-1}_{k+2} F_{k+1} M_{k+2}\\ + \frac{h_{k+1}}{2} cp (t_{k+1}^{2p-1} M_{k+1} + t_{k+2}^{2p-1} F_{k+1} M_{k+2}) \end{align*} This yields DEL \begin{gather} \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee -\frac{t^{p+1}_{k+1}}{h_{k+1} p} (F_{k+1} J_d - J_dF_{k+1}^T)^\vee\nonumber \\ + \frac{h_k+h_{k+1}}{2} cp t_{k+1}^{2p-1} M_{k+1} =0. \end{gather} Dividing both sides by ... \begin{gather} \frac{(t_k/t_{k+1})^{p+1}}{h_k } (J_dF_k -F_k^T J_d)^\vee -\frac{1}{h_{k+1} } (F_{k+1} J_d - J_dF_{k+1}^T)^\vee\nonumber \\ + \frac{h_k+h_{k+1}}{2} cp^2 t_{k+1}^{p-2} M_{k+1} =0. \end{gather} Also, for $t_k$ \begin{align*} & D_{h_k} L_{d_k} = -\frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d}\\ & - \frac{1}{2}c p t_k^{2p-1} f(R_k) - \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ \end{align*} Thus, \begin{align*} & D_{t_k} L_{d_k} = \frac{(p+1)t_k^p}{p h_k} \tr{(I-F_k)J_d} \\ & -\frac{h_k}{2}cp(2p-1) t_k^{2p-2} f(R_k) - D_{h_k} L_{d_k} \\ & = \parenth{ \frac{(p+1)t_k^p}{p h_k} + \frac{t^{p+1}_{k}}{h_k^2 p} } \tr{(I-F_k)J_d} \\ & + \parenth{- \frac{h_k}{2 t_k}cp(2p-1) + \frac{1}{2}c p} t_k^{2p-1} f(R_k) + \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ & = E^-_{d_k}\\ & D_{t_{k+1}} L_{d_k} = -\frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d} \\ & - \frac{1}{2}c p t_k^{2p-1} f(R_k) - \parenth{\frac{h_k}{2t_{k+1}}cp(2p-1) + \frac{1}{2}c p} t_{k+1}^{2p-1} f(R_{k+1}) \\ & = - E^+_{d_k} \end{align*} We have \begin{gather*} D_{t_k} L_{d_k} + D_{t_k} L_{d_{k-1}} = 0\\ E^-_{d_k} = E^+_{d_{k-1}} \\ \end{gather*} Perform discrete Legendre transform to obtain \begin{gather*} \Pi_k =\frac{t_{k+1}^{p+1} }{h_k p} (F_k J_d - J_dF_k^T)^\vee -\frac{h_k}{2} cp t_k^{2p-1} M_k \\ \Pi_{k+1} = \frac{t_{k+1}^{p+1} }{h_k p} (J_dF_k -F_k^T J_d)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1}\\ = F_k^T \Pi_k + \frac{h_k}{2} cp t_k^{2p-1} F_k^T M_k +\frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1} \end{gather*} First consider, $\hat{\mathbb{F}}^+ L_d: (t_k,t_{k+1},R_k,F_k)\rightarrow(t_{k+1}, R_{k+1}, \Pi_{k+1}, E_{k+1})$ \begin{align*} & \Pi_{k+1} = F_k^T \Pi_k + \frac{h_k}{2} cp t_k^{2p-1} F_k^T M_k +\frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1},\\ & -E_{k+1} = -\frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d} \\ & - \frac{1}{2}c p t_k^{2p-1} f(R_k) - \parenth{\frac{h_k}{2t_{k+1}}cp(2p-1) + \frac{1}{2}c p} t_{k+1}^{2p-1} f(R_{k+1}) \\ \end{align*} Also, $\hat{\mathbb{F}}^- L_d: (t_k,t_{k+1}, R_k, F_k)\rightarrow (t_k, R_k, \Pi_k, E_k)$ given by \begin{align*} \Pi_k & =\frac{p}{h_k t_k^{p+1}} (F_k J_d - J_dF_k^T)^\vee -\frac{h_k}{2} cp t_k^{2p-1} M_k \\ E_k & = \parenth{ \frac{(p+1)t_k^p}{p h_k} + \frac{t^{p+1}_{k}}{h_k^2 p} } \tr{(I-F_k)J_d} \\ & + \parenth{- \frac{h_k}{2 t_k}cp(2p-1) + \frac{1}{2}c p} t_k^{2p-1} f(R_k) + \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ \end{align*} The discrete Hamiltonian flow map is constructed by $\hat{\mathbb{F}}^+L_d \circ (\hat{\mathbb{F}}^-L_d)^{-1}$. \subsection{LGVI First Order} The discrete Lagrangian is chosen as \begin{align*} & L_d(t_k, t_{k+1}, R_k, F_k) = \frac{t_{k}^{p+1}}{h_k p} \tr{(I-F_k)J_d}\\ &- h_k c p t_k^{2p-1} f(R_k). \end{align*} where $h_k = t_{k+1}-t_k$. Let \begin{align*} M = -\T^*_I \L_R f(R). \end{align*} We have test \begin{align*} D_{R_k} L_{d_k} &= h_k cp t_k^{2p-1} M_k \\ D_{F_k} L_{d_k} &= \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee \\ \Ad^*_{F_k^T} & \T^*_e \L_{F_{k+1}} D_{F_k} L_{d_k}\\ & = \frac{t^{p+1}_{k}}{h_k p} (F_k J_d - J_dF_k^T)^\vee \end{align*} Substituting these into DEL \begin{align*} \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee \\ - \frac{t^{p+1}_{k+1}}{h_{k+1} p} (F_{k+1} J_d - J_dF_{k+1}^T)^\vee \\ + h_{k+1} cp t_{k+1}^{2p-1} M_{k+1} = 0. \end{align*} Also, for $t_k$ \begin{align*} D_{h_k} L_{d_k} = -\frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d} - c p t_k^{2p-1} f(R_k) \end{align*} Thus, \begin{align*} & D_{t_k} L_{d_k} = \frac{(p+1)t_k^p}{p h_k} \tr{(I-F_k)J_d} \\ & -h_k cp(2p-1) t_k^{2p-2} f(R_k) - D_{h_k} L_{d_k} \\ & = \parenth{ \frac{(p+1)t_k^p}{p h_k} + \frac{t^{p+1}_{k}}{h_k^2 p} } \tr{(I-F_k)J_d} \\ & + \parenth{- \frac{h_k}{2 t_k}cp(2p-1) + c p} t_k^{2p-1} f(R_k) \\ & = E^-_{d_k}\\ \end{align*} Next, \begin{align*} & D_{t_{k+1}} L_{d_k} = D_{h_k} L_{d_k} \\ & = -\frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d} - c p t_k^{2p-1} f(R_k) & = - E^+_{d_k} \end{align*} We have \begin{gather*} D_{t_k} L_{d_k} + D_{t_k} L_{d_{k-1}} = 0\\ E^-_{d_k} = E^+_{d_{k-1}} \\ \end{gather*} Now Perform discrete Legendre transform. First consider, $\hat{\mathbb{F}}^+ L_d: (t_k,t_{k+1},R_k,F_k)\rightarrow(t_{k+1}, R_{k+1}, \Pi_{k+1}, E_{k+1})$ \begin{align*} & \Pi_{k+1} = \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee \\ & = F_k^T \Pi_k + h_k cp t_k^{2p-1} F_k^T M_k ,\\ & E_{k+1} = \frac{t^{p+1}_{k}}{h_k^2 p} \tr{(I-F_k)J_d} + c p t_k^{2p-1} f(R_k) \end{align*} Also, $\hat{\mathbb{F}}^- L_d: (t_k,t_{k+1}, R_k, F_k)\rightarrow (t_k, R_k, \Pi_k, E_k)$ given by \begin{align*} \Pi_k & =\frac{t_k^{p+1}}{h_k p} (F_k J_d - J_dF_k^T)^\vee - h_k cp t_k^{2p-1} M_k \\ E_k & = \parenth{ \frac{(p+1)t_k^p}{p h_k} + \frac{t^{p+1}_{k}}{h_k^2 p} } \tr{(I-F_k)J_d} \\ & + \parenth{- \frac{h_k}{2 t_k}cp(2p-1) + c p} t_k^{2p-1} f(R_k) \\ \end{align*} The discrete Hamiltonian flow map is constructed by $\hat{\mathbb{F}}^+L_d \circ (\hat{\mathbb{F}}^-L_d)^{-1}$. However, the first order didn't work properly with either fixed point iteration or nonlinear solver. \subsection{LGVI Second Order Integrator} The discrete Lagrangian is chosen as \begin{align*} & L_d(t_k, t_{k+1}, R_k, F_k) = \frac{t_{k,k+1}^{p+1}}{h_k p} \tr{(I-F_k)J_d}\\ &- \frac{h_k}{2}c p t_k^{2p-1} f(R_k) - \frac{h_k}{2}c p t_{k+1}^{2p-1} f(R_{k+1}), \end{align*} where $h_k = t_{k+1}-t_k$ and $t_{k,k+1}=(t_k + t_{k+1})/2$. Let \begin{align*} M = -\T^*_I \L_R f(R). \end{align*} We have \begin{align*} D_{R_k} L_{d_k} &= \frac{h_k}{2} cp (t_{k,k+1}^{2p-1} M_k + t_{k+1}^{2p-1} F_k M_{k+1})\\ D_{F_k} L_{d_k} &= \frac{t^{p+1}_{k}}{h_k p} (J_dF_k -F_k^T J_d)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1} \\ \Ad^*_{F_k^T} & \T^*_e \L_{F_{k+1}} D_{F_k} L_{d_k}\\ & = \frac{t^{p+1}_{k,k+1}}{h_k p} (F_k J_d - J_dF_k^T)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} F_k M_{k+1} \\ \end{align*} Also, for $t_k$ \begin{align*} & D_{h_k} L_{d_k} = -\frac{t^{p+1}_{k,k+1}}{h_k^2 p} \tr{(I-F_k)J_d}\\ & - \frac{1}{2}c p t_k^{2p-1} f(R_k) - \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ & D_{t_{k,k+1}} L_{d_k} = \frac{(p+1)t_{k,k+1}^p}{h_k p} \tr{(I-F_k)J_d} \end{align*} Thus, \begin{align*} & D_{t_k} L_{d_k} = \frac{1}{2} D_{t_{k,k+1}} L_{d_k} - D_{h_k} L_{d_k} \\ & -\frac{h_k}{2} c p (2p-1) t_k^{2p-2} f(R_k) \\ & = E^-_{d_k}. \end{align*} Next, \begin{align*} & D_{t_{k+1}} L_{d_k} = \frac{1}{2} D_{t_{k,k+1}} L_{d_k} + D_{h_k} L_{d_k} \\ & -\frac{h_k}{2} c p (2p-1) t_{k+1}^{2p-2} f(R_{k+1}) \\ & = - E^+_{d_k}. \end{align*} We have \begin{gather*} D_{t_k} L_{d_k} + D_{t_k} L_{d_{k-1}} = 0\\ E^-_{d_k} = E^+_{d_{k-1}} \\ \end{gather*} Perform discrete Legendre transform to obtain \begin{gather*} \Pi_k =\frac{t_{k,k+1}^{p+1} }{h_k p} (F_k J_d - J_dF_k^T)^\vee -\frac{h_k}{2} cp t_k^{2p-1} M_k \\ \Pi_{k+1} = \frac{t_{k,k+1}^{p+1} }{h_k p} (J_dF_k -F_k^T J_d)^\vee + \frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1}\\ = F_k^T \Pi_k + \frac{h_k}{2} cp t_k^{2p-1} F_k^T M_k +\frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1} \end{gather*} First consider, $\hat{\mathbb{F}}^+ L_d: (t_k,t_{k+1},R_k,F_k)\rightarrow(t_{k+1}, R_{k+1}, \Pi_{k+1}, E_{k+1})$ \begin{align*} & \Pi_{k+1} = F_k^T \Pi_k + \frac{h_k}{2} cp t_k^{2p-1} F_k^T M_k +\frac{h_k}{2} cpt^{2p-1}_{k+1} M_{k+1},\\ & E_{k+1} = - \frac{(p+1)t_{k,k+1}^p}{2 h_k p} \tr{(I-F_k)J_d} \\ & +\frac{t^{p+1}_{k,k+1}}{h_k^2 p} \tr{(I-F_k)J_d}\\ & + \frac{1}{2}c p t_k^{2p-1} f(R_k) + \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ & +\frac{h_k}{2} c p (2p-1) t_{k+1}^{2p-2} f(R_{k+1}) \\ \end{align*} Also, $\hat{\mathbb{F}}^- L_d: (t_k,t_{k+1}, R_k, F_k)\rightarrow (t_k, R_k, \Pi_k, E_k)$ given by \begin{align*} \Pi_k & =\frac{t_{k,k+1}^{p+1}}{h_k p} (F_k J_d - J_dF_k^T)^\vee -\frac{h_k}{2} cp t_k^{2p-1} M_k \\ E_k & = \frac{(p+1)t_{k,k+1}^p}{ 2 h_k p} \tr{(I-F_k)J_d} \\ & +\frac{t^{p+1}_{k,k+1}}{h_k^2 p} \tr{(I-F_k)J_d}\\ & + \frac{1}{2}c p t_k^{2p-1} f(R_k) + \frac{1}{2}c p t_{k+1}^{2p-1} f(R_{k+1}),\\ & -\frac{h_k}{2} c p (2p-1) t_k^{2p-2} f(R_k) \\ \end{align*} The discrete Hamiltonian flow map is constructed by $\hat{\mathbb{F}}^+L_d \circ (\hat{\mathbb{F}}^-L_d)^{-1}$. \bibliography{/Users/tylee/Documents/BibMaster17,/Users/tylee/Documents/tylee} \bibliographystyle{IEEEtran} \end{document} \begin{align*} H(R_k, P_{k+1}) = P_{k+1} \cdot R_k - \frac{1}{h} \tr{ (I-F_k) J_d}, \end{align*} where $F_k$ is the solution of \eqref{eqn:Pkp} for given $(R_k,F_k)$, which is rewritten as The type II discrete Hamiltonian is \begin{align*} H(R_k, P_{k+1}) = P_{k+1} \cdot R_k - \frac{1}{h} \tr{ (I-F_k) J_d}, \end{align*} where $F_k$ is the solution of \eqref{eqn:Pkp} for given $(R_k,F_k)$, which is rewritten as \begin{align*} R_k^T P_{k+1} = \frac{1}{h}(F_k J_d F_k - J_d). \end{align*} Therefore, the Hamiltonian is rewritten in terms of $F_k$ into \begin{align*} H(F_k(R_k, P_{k+1})) & = \frac{1}{h} \tr{(R_k^T P_{k+1})^T F_k} - \frac{1}{h}\tr{(I-F_k)J_d}\\ & = -\frac{1}{h} \tr{(I-F_k) J_d}. \end{align*} The variational of the discrete Hamiltonian is \begin{align*} \delta H = \frac{1}{h}\tr{\delta F_k J_d}. \end{align*} We have to rewrite $\delta H$ in terms of $\delta R_k$ and $\delta P_{k+1}$. The variation of \eqref{eqn:Pkp} is \begin{align*} \delta (R_{k+1}^TP_{k+1}) & = \frac{1}{h} (J_d F_k\hat \chi_k + \hat\chi_k F_k^T J_d) \\ & = \frac{1}{h} ((\tr{F^T J_d} I - F^T J_d) \chi_k)^\wedge. \end{align*} On the other hand, \begin{align*} \delta (R_{k+1}^TP_{k+1}) & = \delta (F_k^T R_k^T P_{k+1}) \\ & = -\hat\chi_k R_{k+1}^T P_{k+1} - F_k^T \hat \eta_k R_k^T P_{k+1} + R_{k+1}^T \delta P_{k+1} \end{align*} <file_sep>clc; clear; close all; %% setup A = [ 0.7572 0.5678 0.5308 0.7537 0.0759 0.7792 0.3804 0.0540 0.9340]; r = [0.7915 -0.3101 0.5267]; [U S V]=psvd(A); R0 = U*expm(0.9*pi*hat(r))*V'; RIC=R0; xiIC=zeros(3); gamma=1; % this needs to be tuned h=0.01; % this needs to be tuned TotalSteps=10000; %% Lie-NAG-SC and Lie-NAG-C % implementation: 2nd-order splitting (explicit and conformally symplectic) % it preserves Lie group to machine precision; optimization error also has this lower bound for iter=1:2 % 1: NAG-SC, 2: NAG-C tic R=RIC; xi=xiIC; loss=zeros(1,TotalSteps+1); deviation=zeros(1,TotalSteps+1); i=0; loss(i+1)=norm(A-R,'fro')^2/2; deviation(i+1)=norm(R'*R-eye(3),'fro'); RR=R; xxi=xi; hh=h/2; temp=expm(hh*xxi); RR=RR*temp; for i=1:TotalSteps hh=h; force=-(A'*RR-RR'*A); if (iter==1) % NAG-SC xxi=exp(-gamma*hh)*xxi+(1-exp(-gamma*hh))/gamma*force; end if (iter==2) % NAG-C gamma=3/((i-1/2)*h) t0=(i-1)*h; t1=i*h; xxi=t0^3/t1^3*xxi+(t1^4-t0^4)/t1^3/4*force; end hh=h; temp=expm(hh*xxi); RR=RR*temp; R=RR; xi=xxi; loss(i+1)=norm(A-R,'fro')^2/2; deviation(i+1)=norm(R'*R-eye(3),'fro'); end switch iter case 1 h_NAGSC=h; loss_NAGSC=loss; deviation_NAGSC=deviation; case 2 h_NAGC=h; loss_NAGC=loss; deviation_NAGC=deviation; end toc end %% %truth [U,S,V]=psvd(A); Rstar=U*V'; exact=norm(A-Rstar,'fro')^2/2; figure % subplot(2,1,1); plot([0:TotalSteps],loss_NAGSC-exact, [0:TotalSteps],loss_NAGC-exact, 'LineWidth',2); set(gca,'xscale','log'); set(gca,'yscale','log'); xlabel('iteration steps'); title('distance from optimum value'); % % subplot(2,1,2); % semilogy([0:TotalSteps],deviation_NAGSC, [0:TotalSteps],deviation_NAGC, 'LineWidth',2); % xlabel('iteration steps'); % title('deviation from Lie group'); % axis([0 TotalSteps 1E-16 1E-9]); legend(['NAG-SC h=',num2str(h_NAGSC)], ['NAG-C h=',num2str(h_NAGC)], 'Location','Best'); <file_sep>function [U S V]=psvd(F) [U S V]=svd(F); S=S*diag([1 1 det(U*V)]); U=U*diag([1 1 det(U)]); V=V*diag([1 1 det(V)]); end <file_sep>clear; close all; R0=expmso3(10*pi/180*[1 0.5 -0.5]'); x0 = [2, 1, -0.5]'; p=3; J=eye(3); h=0.0015; N=5000; Cx=1.5; flag_update_h = false; flag_display_progress = false; flag_stop = 2; [t, JJ, errR, t_elapsed, R, x] = vigdSE3(p,J,R0,x0, h,N,flag_update_h,flag_display_progress,flag_stop,Cx); disp(JJ(end)); figure(); plot(1:N,JJ); set(gca,'xscale','log','yscale','log'); title(['C_x =' num2str(Cx)]); drawnow; R=R(:,:,end); x=x(:,end); save comp_6 <file_sep>function [t_GD, J_GD, errR_GD]=gdSO3(A,J,R0,T) global A p J C close all % A=rand(3,3);%diag([5, 3, 1])*expm(pi*hat([1 1 1])/sqrt(3)); % A = [ 0.7572 0.5678 0.5308 % 0.7537 0.0759 0.7792 % 0.3804 0.0540 0.9340]; [U S V]=psvd(A); R_opt = U*V'; J_opt = obj(R_opt); % p=4; C=1; % J=eye(3); %% GD % % r = [0.7915 % % -0.3101 % % 0.5267]; % R0 = U*expm(pi*hat(r))*V'; W0 = zeros(3,1); X0=reshape(R0,9,1); tspan=[1 T]; options = odeset('RelTol',1e-8,'AbsTol',1e-8); sol = ode45(@eom_GD, tspan, X0, options); t=sol.x;X=sol.y';disp(sol.stats); N=length(t); for k=1:N R_GD(:,:,k) = reshape(X(k,:),3,3); J_GD(k) = obj(R_GD(:,:,k))-J_opt; errR_GD(k) = norm(R_GD(:,:,k)'*R_GD(:,:,k)-eye(3)); end t_GD=t; % % % %% Post Process % % plot(t_GD ,J_GD, 'r', t_AGD, J_AGD,'b', t_AGD_Pi, J_AGD_Pi,'g'); % set(gca,'xscale','log','yscale','log'); % filename='gdSO3_0'; % save(filename); % evalin('base','clear all'); % evalin('base',['load ' filename]); end function J = obj(R) global A tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R) global A M=vee(R'*A-A'*R);%+randn(3,1)*1e-3; end function X_dot = eom_GD(t,X) R=reshape(X,3,3); M = grad(R); R_dot = R*hat(M); X_dot = reshape(R_dot,9,1); end function X_dot = eom_AGD(t,X) global p J C R=reshape(X(1:9),3,3); W=X(10:12); M = grad(R); R_dot = R*hat(W); W_dot = J\( -(p+1)/t*J*W - hat(W)*J*W + C*p^2*t^(p-2)*M); X_dot = [reshape(R_dot,9,1); W_dot]; end function X_dot = eom_AGD_Pi(t,X) global p J C R=reshape(X(1:9),3,3); Pi=X(10:12); M = grad(R); W = J\(p/t^(p+1)*Pi); R_dot = R*hat(W); Pi_dot = -hat(W)*Pi + C*p*t^(2*p-1)*M; X_dot = [reshape(R_dot,9,1); Pi_dot]; end <file_sep>function [JJ, errR, t_elapsed] = LieGD(A,R0,h,N) % flag_stop =1 : stop of t>TN, % flag_stop =2 : stop of k>TN, [U S V]=psvd(A); R_opt = U*V'; JJ_opt = obj(R_opt,A); %% R(:,:,1)=R0; tic; for k=1:N-1 Mk = grad(R(:,:,k),A); R(:,:,k+1) = R(:,:,k)*expmso3(h*Mk); end t_elapsed=toc; %% for k=1:N JJ(k) = obj(R(:,:,k),A)-JJ_opt; errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); end end function J = obj(R,A) tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R,A) M=vee(R'*A-A'*R); end <file_sep>function tmp_grad_proj_2 load data/p_W_landmarks.txt; load data/K.txt; load data/keypoints.txt; keypoints = keypoints'; img.w = 1271; img.h = 376; K_normal = [2/img.w 0 -1; 0 2/img.h -1 0 0 1]; N = size(keypoints,2); p = [keypoints(2,:); keypoints(1,:); ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; p_new = K_normal*K*[eye(3), zeros(3,1)]*P; keypoints_n = p_new(1:2,:)./p_new(3,:); keypoints_n = [keypoints_n(2,:); keypoints_n(1,:)]; K_n = K_normal*K; R=eye(3); x=[0 0 0]'; J = obj(R, x, K_n,keypoints_n,p_W_landmarks); [num_grad_R, num_grad_x] = grad_num(R, x, K_n,keypoints_n,p_W_landmarks); M = K_n*[R, x]; p_proj = M*P; uv = p(1:2,:)./p(3,:); uv_proj = p_proj(1:2,:)./p_proj(3,:); K = K_n; grad_x=zeros(3,1); grad_R=zeros(3,1); for i=1:N tmp = 2*(uv_proj(:,i)-uv(:,i))'; grad_x(1) = grad_x(1) + tmp*[K(1,1)/(x(3) + P(1:3,i)'*R(3,:)'); 0]; grad_x(2) = grad_x(2) + tmp*[0; K(1,1)/(x(3) + P(1:3,i)'*R(3,:)')]; grad_x(3) = grad_x(3) + tmp*[-(K(1,1)*(x(1) + P(1:3,i)'*R(1,:)')); ... -(K(1,1)*(x(2) + P(1:3,i)'*R(2,:)'))]/(x(3) + P(1:3,i)'*R(3,:)')^2; grad_R(1) = grad_R(1) + tmp* ... [(K(1,1)*(P(2,i)*R(1,3)*x(3) - P(3,i)*R(1,2)*x(3) - P(2,i)*R(3,3)*x(1) + P(3,i)*R(3,2)*x(1)))/x(3)^2; (K(1,1)*(P(2,i)*R(2,3)*x(3) - P(3,i)*R(2,2)*x(3) - P(2,i)*R(3,3)*x(2) + P(3,i)*R(3,2)*x(2)))/x(3)^2]; grad_R(2) = grad_R(2) + tmp* ... [-(K(1,1)*(P(1,i)*R(1,3)*x(3) - P(3,i)*R(1,1)*x(3) - P(1,i)*R(3,3)*x(1) + P(3,i)*R(3,1)*x(1)))/x(3)^2; -(K(1,1)*(P(1,i)*R(2,3)*x(3) - P(3,i)*R(2,1)*x(3) - P(1,i)*R(3,3)*x(2) + P(3,i)*R(3,1)*x(2)))/x(3)^2]; grad_R(3) = grad_R(3) + tmp* ... [(K(1,1)*(P(1,i)*R(1,2)*x(3) - P(2,i)*R(1,1)*x(3) - P(1,i)*R(3,2)*x(1) + P(2,i)*R(3,1)*x(1)))/x(3)^2; (K(1,1)*(P(1,i)*R(2,2)*x(3) - P(2,i)*R(2,1)*x(3) - P(1,i)*R(3,2)*x(2) + P(2,i)*R(3,1)*x(2)))/x(3)^2]; end grad_x=grad_x/N/N; grad_R=grad_R/N/N; disp([num_grad_x, grad_x]); disp([num_grad_R, grad_R]); end function J = obj(R, x, K,keypoints,p_W_landmarks) N = size(keypoints,2); p = [keypoints(2,:); keypoints(1,:); ones(1,N)]; P = [p_W_landmarks'; ones(1,N)]; M = K*[R, x]; p_proj = M*P; J = norm(p(1:2,:)./p(3,:)-p_proj(1:2,:)./p_proj(3,:)); end function [grad_R, grad_x] = grad_num(R, x, K,keypoints,p_W_landmarks) eps = 1e-6; II=eye(3); grad_R=zeros(3,1); grad_x=zeros(3,1); for i=1:3 grad_R(i)=(obj(R*expmso3(eps*II(:,i)), x, K,keypoints,p_W_landmarks)... -obj(R*expmso3(-eps*II(:,i)), x, K,keypoints,p_W_landmarks))/eps/2; grad_x(i)=(obj(R,x+eps*II(:,i), K,keypoints,p_W_landmarks)... -obj(R,x-eps*II(:,i), K,keypoints,p_W_landmarks))/eps/2; end % for i=1:3 % grad_R(i)=(obj(R*expmso3(eps*II(:,i)), x, K,keypoints,p_W_landmarks)... % -obj(R, x, K,keypoints,p_W_landmarks))/eps; % grad_x(i)=(obj(R,x+eps*II(:,i), K,keypoints,p_W_landmarks)... % -obj(R, x, K,keypoints,p_W_landmarks))/eps; % end end <file_sep>clear all; close all; syms R11 R12 R13 R21 R22 R23 R31 R32 R33 x1 x2 x3 K11 K22 K13 K23 P1 P2 P3 e1 e2 e3 K = [K11 0 K13; 0 K11 K23; 0 0 1]; R=[R11 R12 R13; R21 R22 R23; R31 R32 R33]; P = [P1 P2 P3 1].'; x= [x1 x2 x3].'; eta =[e1 e2 e3].'; p = K*[R*hat(eta), x]*P; uv = p(1:2)/p(3); gradx1=simplify(diff(uv,x1)); gradx2=simplify(diff(uv,x2)); gradx3=simplify(diff(uv,x3)); gradR1 = simplify(subs(diff(uv,e1),[e1,e2,e3],[0,0,0])); gradR2 = simplify(subs(diff(uv,e2),[e1,e2,e3],[0,0,0])); gradR3 = simplify(subs(diff(uv,e3),[e1,e2,e3],[0,0,0])); <file_sep>function [t, JJ, errR, t_elapsed, sol] = rk45(A,p,J,R0,T) [U S V]=psvd(A); R_opt = U*V'; JJ_opt = obj(R_opt,A); options = odeset('RelTol',1e-8,'AbsTol',1e-8); C=1; %% W0 = zeros(3,1); X0= [reshape(R0,9,1); W0]; tic; sol = ode45(@(t,X) eom_EL_Breg(t,X,A,p,J,C), [1, T+1], X0, options); t_elapsed=toc; t=sol.x;X=sol.y; for k=1:length(t) R(:,:,k)=reshape(X(1:9,k),3,3); JJ(k) = obj(R(:,:,k),A)-JJ_opt; errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); end end function X_dot = eom_EL_Breg(t,X,A,p,J,C) R=reshape(X(1:9),3,3); W=X(10:12); M = grad(R,A); R_dot = R*hat(W); W_dot = J\( -(p+1)/t*J*W - hat(W)*J*W + C*p^2*t^(p-2)*M); X_dot = [reshape(R_dot,9,1); W_dot]; end function J = obj(R,A) tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R,A) global N_grad_comp N_grad_comp = N_grad_comp+1; M=vee(R'*A-A'*R); end <file_sep>function [t, JJ, t_elapsed, x] = vigdRe(p,x0,hk,TN,flag_update_h,flag_display_progress,flag_stop) % flag_stop =1 : stop of t>TN, % flag_stop =2 : stop of k>TN, n=length(x0); A=rand(n,n); A=A+A'; [V D]=eig(A); A= V*abs(D)*V'; disp(eig(A)); b=rand(n,1); x_opt = -A\b; JJ_opt = obj(x_opt,A,b); options = optimoptions(@lsqnonlin,'StepTolerance', 1e-12,'OptimalityTolerance', 1e-6, 'Display', 'off'); % options = optimoptions(@lsqnonlin,'StepTolerance', 1e-8); C=1; %% if flag_stop == 2 x=zeros(n,TN); grad_x=zeros(n,TN); t=zeros(TN,1); v=zeros(n,TN); end x(:,1)=x0; v(:,1)=zeros(n,1); t(1)=1; JJ(1) = obj(x(:,1),A,b); grad_x(:,1) = grad(x(:,1),A,b); tic; if flag_update_h [~, E(1)] = err_FLdm(hk, t(1), v(:,1), x(:,1), 0, JJ(1), grad_x(:,1), p, C, A,b); end k = 1; while 1 if flag_update_h [hk, res] = lsqnonlin(@(hk) err_FLdm(hk, t(k), v(:,k), x(:,k), E(k), JJ(k), grad_x(:,1), p, C, A,b), 1, 0, [], options); end % disp(hk); t(k+1) = t(k) + hk; tkkp= (t(k)+t(k+1))/2; [phi_kkp, phi_dot_kkp] = compute_phi(tkkp,p); [theta_k, ~] = compute_theta(t(k),p,C); [theta_kp, theta_dot_kp] = compute_theta(t(k+1),p,C); delxk = (v(:,k)-hk*theta_k/2*grad_x(:,k))*hk/phi_kkp; x(:,k+1) = x(:,k)+delxk; grad_x(:,k+1) = grad(x(:,k+1),A,b); v(:,k+1) = v(:,k) - hk*theta_k/2*grad_x(:,k) - hk*theta_kp/2*grad_x(:,k+1); JJ(k+1) = obj(x(:,k+1),A,b); if flag_update_h E(k+1) = (-phi_dot_kkp/2/hk+phi_kkp/hk^2)*norm(delxk)^2/2 ... + hk*theta_dot_kp/2*JJ(k+1) + theta_k/2*JJ(k) +theta_kp/2*JJ(k+1); end k=k+1; switch flag_stop case 1 if t(k) > TN break; end if flag_display_progress && rem(k,500)==0 disp([t(k)/TN, hk]); end case 2 if k >= TN break; end if flag_display_progress && rem(k,500)==0 disp([k/TN]); end end end t_elapsed=toc; %% JJ = JJ-JJ_opt; % for k=1:length(t) % JJ(k) = obj(x(:,k),A,b)-JJ_opt; % errR(k) = norm(R(:,:,k)'*R(:,:,k)-eye(3)); % end end function [errE, FLdm]= err_FLdm(hk, tk, vk, xk, Ek, JJk, grad_k, p, C, A, b) tkp = tk + hk; tkkp= (tk+tkp)/2; [theta_k, theta_dot_k] = compute_theta(tk,p,C); [theta_kp, ~] = compute_theta(tkp,p,C); [phi_kkp, phi_dot_kkp] = compute_phi(tkkp,p); delxk = (vk-hk*theta_k/2*grad_k)*hk/phi_kkp; xkp = xk+delxk; JJkp = obj(xkp,A,b); FLdm = (phi_dot_kkp/2/hk + phi_kkp/hk^2)*norm(delxk)^2/2 ... -hk*theta_dot_k/2*JJk + theta_k/2*JJk + theta_kp/2*JJkp; errE = abs(Ek-FLdm); end function [phi, phi_dot] = compute_phi(t,p) phi = t^(p+1)/p; phi_dot = (p+1)/p*t^p; end function [theta, theta_dot] = compute_theta(t,p,C) theta = C*p*t^(2*p-1); theta_dot = C*p*(2*p-1)*t^(2*p-2); end function J = obj(x,A,b) J=1/2*(A*x+b)'*(A*x+b); end % function M = grad(R,A) % % this actually computes the negative gradient % M=vee(R'*A-A'*R); % end function M = grad(x,A,b) M = A'*A*x+A'*b; end <file_sep>function FCay=findF(g,J,varargin) if isempty(varargin) f = zeros(3,1); else f = varargin{1}; end delf=1; while delf > 1e-15 G=g+(hat(g)-2*J)*f+(g'*f)*f; nabG=(hat(g)-2*J)+g'*f*eye(3)+f*g'; f_new=f-inv(nabG)*G; delf=norm(f_new-f); f=f_new; end %FCay=(eye(3)+skew(f))*inv(eye(3)-skew(f)); FCay=[ 1+f(1)^2-f(3)^2-f(2)^2, -2*f(3)+2*f(2)*f(1), 2*f(3)*f(1)+2*f(2); 2*f(3)+2*f(2)*f(1), -f(3)^2+1+f(2)^2-f(1)^2, 2*f(3)*f(2)-2*f(1); -2*f(2)+2*f(3)*f(1), 2*f(3)*f(2)+2*f(1), -f(2)^2-f(1)^2+1+f(3)^2]/(1+f'*f); <file_sep>%i% This BibTeX bibliography file was created using BibDesk. %% https://bibdesk.sourceforge.io/ %% Created for Taeyoung Lee at 2021-03-23 14:49:37 -0400 %% Saved with string encoding Unicode (UTF-8) @article{hu2020brief, author = {<NAME> and <NAME> and <NAME>-Wen and Yuan, Ya-Xiang}, isbn = {2194-6698}, journal = {Journal of the Operations Research Society of China}, number = {2}, pages = {199--248}, title = {A Brief Introduction to Manifold Optimization}, volume = {8}, year = {2020}, } @book{absil2009optimization, author = {<NAME>. and <NAME>. and <NAME>.}, publisher = {Princeton University Press}, title = {Optimization Algorithms on Matrix Manifolds}, year = {2008} } @article{tao2010nonintrusive, title={Nonintrusive and structure preserving multiscale integration of stiff ODEs, SDEs, and Hamiltonian systems with hidden slow dynamics via flow averaging}, author={<NAME> and <NAME> and <NAME>}, journal={Multiscale Modeling \& Simulation}, volume={8}, number={4}, pages={1269--1324}, year={2010}, publisher={SIAM} } @inproceedings{ShaLeePACC20, author = {<NAME> and <NAME> and <NAME> and <NAME>}, booktitle = {Proceedings of the American Control Conference}, date-added = {2021-03-23 14:49:36 -0400}, date-modified = {2021-03-23 14:49:36 -0400}, key = {GM}, month = jul, pages = {2826--2831}, title = {Symplectic Accelerated Optimization on {SO(3)} with {L}ie Group Variational Integrators}, year = {2020}} @book{ma2012invitation, author = {<NAME> and Kosecka, Jana and Sastry, <NAME>}, publisher = {Springer Science \& Business Media}, title = {An invitation to 3-{D} vision: from images to geometric models}, volume = {26}, year = {2012}} @article{Geiger2013IJRR, author = {<NAME> and <NAME> and <NAME> and <NAME>}, journal = {International Journal of Robotics Research (IJRR)}, title = {Vision meets Robotics: The {KITTI} Dataset}, year = {2013}} @book{HaLuWa2006, address = {Berlin}, author = {<NAME> and <NAME> and <NAME>}, edition = {Second}, publisher = {Springer-Verlag}, title = {Geometric Numerical Integration: Structure-preserving algorithms for ordinary differential equations}, year = {2006}} @article{LeZh2009, author = {<NAME> and <NAME>}, fjournal = {IMA Journal of Numerical Analysis}, journal = {IMA J. Numer. Anal.}, number = {4}, pages = {1497--1532}, title = {Discrete {H}amiltonian Variational Integrators}, volume = {31}, year = {2011}} @inproceedings{ZhMoSrJa2018, author = {<NAME> and <NAME> and <NAME> <NAME>}, booktitle = {Advances in Neural Information Processing Systems}, editor = {<NAME> and <NAME> and <NAME> and <NAME> and <NAME> and <NAME>}, publisher = {Curran Associates, Inc.}, title = {Direct Runge-Kutta Discretization Achieves Acceleration}, volume = {31}, year = {2018}} @article{KaMaOr1999, author = {<NAME>. and Marsden, {J.~E.} and Ortiz,M.}, journal = {Journal of Mathematical Physics}, number = {7}, pages = {3353-3371}, title = {Symplectic-energy-momentum preserving variational integrators}, volume = {40}, year = {1999}} @article{GeMa1988, author = {<NAME>. and Marsden, {J.~E.}}, journal = {Physics Letters A}, number = {3}, pages = {134-139}, title = {Lie--{P}oisson {H}amilton--{J}acobi theory and {L}ie--{P}oisson integrators}, volume = {133}, year = {1988}} @inproceedings{su2014differential, author = {<NAME>, <NAME> and Candes, <NAME>}, booktitle = {NIPS}, date-added = {2021-03-17 17:26:08 -0400}, date-modified = {2021-03-17 17:26:08 -0400}, number = {27}, pages = {2510--2518}, title = {A Differential Equation for Modeling {N}esterov's Accelerated Gradient Method: Theory and Insights.}, volume = {14}, year = {2014}} @article{DuScLe2021, author = {<NAME> and <NAME> and <NAME>}, journal = {arXiv preprint arXiv:1709.01975}, title = {Adaptive {H}amiltonian variational integrators and symplectic accelerated optimization}, year = {2021}} @article{betancourt2018symplectic, author = {<NAME> and <NAME>}, date-added = {2021-03-17 17:25:59 -0400}, date-modified = {2021-03-17 17:25:59 -0400}, journal = {arXiv preprint arXiv:1802.03653}, title = {On symplectic optimization}, year = {2018}} @article{WahSR65, author = {<NAME>}, date-added = {2021-03-17 17:25:48 -0400}, date-modified = {2021-03-17 17:25:48 -0400}, journal = {SIAM Review}, number = {5}, owner = {rachell0}, pages = {409}, timestamp = {2008.02.11}, title = {A least squares Estimate of Satellite Attitude, {P}roblem 65-1}, volume = {7}, year = {1965}} @inproceedings{alimisis2020continuous, author = {<NAME> <NAME>}, booktitle = {International Conference on Artificial Intelligence and Statistics}, date-added = {2021-03-17 17:25:38 -0400}, date-modified = {2021-03-17 17:25:38 -0400}, organization = {PMLR}, pages = {1297--1307}, title = {A continuous-time perspective for modeling acceleration in {R}iemannian optimization}, year = {2020}} @article{duruisseaux2021variational, author = {<NAME> and <NAME>}, date-added = {2021-03-17 17:25:25 -0400}, date-modified = {2021-03-17 17:25:25 -0400}, journal = {arXiv preprint arXiv:2101.06552}, title = {A Variational Formulation of Accelerated Optimization on {R}iemannian Manifolds}, year = {2021}} @article{nesterov2008accelerating, author = {<NAME>}, date-added = {2021-03-17 17:25:14 -0400}, date-modified = {2021-03-17 17:25:14 -0400}, journal = {Mathematical Programming}, number = {1}, pages = {159--181}, publisher = {Springer}, title = {Accelerating the cubic regularization of {N}ewton's method on convex problems}, volume = {112}, year = {2008}} @article{nesterov2005smooth, author = {<NAME>}, date-added = {2021-03-17 17:25:14 -0400}, date-modified = {2021-03-17 17:25:14 -0400}, journal = {Mathematical programming}, number = {1}, pages = {127--152}, publisher = {Springer}, title = {Smooth minimization of non-smooth functions}, volume = {103}, year = {2005}} @article{wibisono2016variational, author = {<NAME> Wilson, <NAME> and <NAME>}, date-added = {2021-03-17 17:24:56 -0400}, date-modified = {2021-03-17 17:24:56 -0400}, journal = {proceedings of the National Academy of Sciences}, number = {47}, pages = {E7351--E7358}, title = {A variational perspective on accelerated methods in optimization}, volume = {113}, year = {2016}} @inproceedings{tao2020variational, author = {<NAME> and <NAME>}, booktitle = {International Conference on Artificial Intelligence and Statistics}, date-added = {2021-03-17 17:24:46 -0400}, date-modified = {2021-03-17 17:24:46 -0400}, pages = {4269--4280}, title = {Variational optimization on {L}ie groups, with examples of leading (generalized) eigenvalue problems}, year = {2020}} @phdthesis{Lee08, author = {<NAME>}, date-added = {2021-03-17 17:24:28 -0400}, date-modified = {2021-03-17 17:24:28 -0400}, key = {GM}, school = {University of Michigan}, title = {Computational Geometric Mechanics and Control of Rigid Bodies}, year = {2008}} @phdthesis{Leo04, author = {<NAME>}, date-added = {2021-03-17 17:24:15 -0400}, date-modified = {2021-03-17 17:24:15 -0400}, owner = {rachell0}, school = {California {I}nstittute of {T}echnology}, timestamp = {2008.02.11}, title = {Foundations of computational geometric mechanics}, year = {2004}} @book{LeeLeo17, author = {<NAME> and <NAME> and {<NAME>}, date-added = {2021-03-17 17:24:04 -0400}, date-modified = {2021-03-17 17:24:04 -0400}, doi = {10.1007/978-3-319-56953-6}, key = {BK}, publisher = {Springer}, title = {Global Formulation of {L}agrangian and {H}amiltonian Dynamics on Manifolds}, year = {2018}, Bdsk-Url-1 = {http://dx.doi.org/10.1007/978-3-319-56953-6}} @book{MarRat99, author = {{<NAME> and {<NAME>}, date-added = {2021-03-17 17:23:41 -0400}, date-modified = {2021-03-17 17:23:41 -0400}, edition = {Second}, owner = {rachell0}, publisher = {Springer-Verlag}, series = {Texts in Applied Mathematics}, timestamp = {2008.02.11}, title = {Introduction to Mechanics and Symmetry}, volume = {17}, year = {1999}} @article{LeeLeoCMAME07, author = {<NAME> and <NAME> and {<NAME>}, date-added = {2021-03-17 17:23:26 -0400}, date-modified = {2021-03-17 17:23:26 -0400}, doi = {10.1016/j.cma.2007.01.017}, journal = {Computer Methods in Applied Mechanics and Engineering}, key = {GM}, month = may, owner = {rachell0}, pages = {2907--2924}, timestamp = {2008.02.11}, title = {Lie group variational integrators for the full body problem}, volume = {196}, year = {2007}, Bdsk-Url-1 = {http://dx.doi.org/10.1016/j.cma.2007.01.017}} @incollection{MarWesAN01, author = {{<NAME> and <NAME>}, booktitle = {Acta Numerica}, date-added = {2021-03-17 17:22:38 -0400}, date-modified = {2021-03-17 17:22:38 -0400}, owner = {rachell0}, pages = {317--514}, publisher = {Cambridge University Press}, timestamp = {2008.02.11}, title = {Discrete mechanics and variational integrators}, volume = {10}, year = {2001}} @article{su2016differential, author = {<NAME> <NAME>}, journal = {The Journal of Machine Learning Research}, number = {1}, pages = {5312--5354}, publisher = {JMLR. org}, title = {A differential equation for modeling Nesterov's accelerated gradient method: Theory and insights}, volume = {17}, year = {2016}} @article{attouch2018fast, author = {<NAME> <NAME> <NAME>}, journal = {Mathematical Programming}, number = {1}, pages = {123--175}, publisher = {Springer}, title = {Fast convergence of inertial dynamics and algorithms with asymptotic vanishing viscosity}, volume = {168}, year = {2018}} @book{nesterov2003introductory, author = {<NAME>}, title = {Introductory lectures on convex optimization: A basic course}, year = {2004}} @article{Nes83, author = {<NAME>}, journal = {Soviet Mathematics Doklady}, number = {2}, pages = {372-376}, title = {A Method of Solving a Convex Programming Problem with Convergence Rate $\mathcal{O}(1/k^2)$}, volume = {27}, year = {1983}} <file_sep>function [JJ, errR, t_elapsed] = benchmark_LieNAG_new(A,p,R0,hk,N,flag_iter) RIC=R0; xiIC=zeros(3); C=1; CC=C*p^2; % this needs to be tuned gamma=1; % this needs to be tuned h=hk; % this needs to be tuned TotalSteps=N; %% Lie-NAG-SC, Lie-NAG-C, and Lie-Bregman % implementation: 2nd-order splitting (explicit and conformally symplectic) % it preserves Lie group to machine precision; optimization error also has this lower bound % 1: NAG-SC, 2: NAG-C, 3: Bregman iter=flag_iter; R=RIC; xi=xiIC; loss=zeros(1,TotalSteps); deviation=zeros(1,TotalSteps); RR=R; xxi=xi; RR_save=zeros(3,3,N); RR_save(:,:,1)=RR; tic hh=h/2; temp=expm(hh*xxi); RR=RR*temp; for i=1:TotalSteps-1 hh=h; % note: i'm using the same h for all 3 methods, but Bregman actually requires smaller h, especially if t is large. % early stopping could be one option to sell Bregman better force=-(A'*RR-RR'*A); switch iter case 1 % NAG-SC xxi=exp(-gamma*hh)*xxi+(1-exp(-gamma*hh))/gamma*force; case 2 % NAG-C t0=(i-1)*h; t1=i*h; xxi=t0^3/t1^3*xxi+(t1^4-t0^4)/t1^3/4*force; case 3 % more general Bregman (p \neq 2) t0=(i-1)*h; t1=i*h; xxi=t0^(p+1)/t1^(p+1)*xxi+(t1^(2*p)-t0^(2*p))/t1^(1+p)/(2*p)*CC*force; end hh=h; temp=expmso3(hh*vee(xxi)); RR=RR*temp; R=RR; xi=xxi; RR_save(:,:,i+1)=RR; end t_elapsed=toc; for i=1:TotalSteps loss(i)=norm(A-RR_save(:,:,i),'fro')^2/2; deviation(i)=norm(RR_save(:,:,i)'*RR_save(:,:,i)-eye(3),'fro'); end %% %truth [U,S,V]=svd(A); Rstar=U*diag([1 1 det(U*V)])*V'; exact=norm(A-Rstar,'fro')^2/2; JJ = loss-exact; errR = deviation; <file_sep>clear; close all; load comp_2 hfig = figure(1); for i=1:length(h0_vec) plot(t_vec{i}, J_vec{i}) hold on; end set(gca,'yscale','log'); set(gca,'xscale','log'); set(gca,'FontSize',16); figure(2); for i=1:length(h0_vec) plot(t_vec{i}(2:end), diff(t_vec{i})) hold on; end set(gca,'yscale','log'); set(gca,'xscale','log'); set(gca,'FontSize',16); figure(1) legend('$h_0=0.001$', '$h_0=0.05$', '$h_0=0.01$', '$h_0=0.1$', '$h_0=0.4$',... 'Location','SouthWest','interpreter','latex') ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); xlabel('$t$','interpreter','latex'); figure(2) xlabel('$t$','interpreter','latex'); ylabel('$h_k$','interpreter','latex'); conv_x=[4.449 28.94; 4.295 29.95; 4.286 23.14; 4.296 9.956; 4.226 7.916]; conv_y=[0.05102 0.002298; 0.01079 0.0004252; 0.005641 0.0003221; 0.001154 0.0002936; 0.0007076 0.0002483]; plot(conv_x',conv_y','k--'); legend('$h_0=0.001$', '$h_0=0.05$', '$h_0=0.01$', '$h_0=0.1$', '$h_0=0.4$',... 'Location','NorthEast','interpreter','latex') text(5.5,5e-2,'$\mathcal{O}(t^{-1.66})$','interpreter','latex','fontsize',18); diff(log10(conv_y'))./diff(log10(conv_x')) figure(1); print('comp_2a','-depsc'); figure(2); print('comp_2b','-depsc'); !cp comp_2?.eps ../figs <file_sep>clear; close all; load comp_1 hfig = figure(1); for i=1:length(p_vec) plot(1:N, J_vec{i}) hold on; end set(gca,'yscale','log'); set(gca,'xscale','log'); set(gca,'FontSize',16); conv_x=[84 1e4; 39 1e4; 39 1e4; 20 1e4]; conv_y=[0.07652 1.278e-6; 0.07402 2.47e-7; 0.02522 8.11e-8; 0.07677 4.894e-8]; plot(conv_x',conv_y','k--'); diff(log10(conv_y'))./diff(log10(conv_x')) legend('$\mathrm{LGVI}_2\;(p=2)$','$\mathrm{LGVI}_4\;(p=4)$','$\mathrm{LGVI}_6\;(p=6)$','$\mathrm{LGVI}_8\;(p=8)$',... 'Location','SouthWest','interpreter','latex') xlabel('$k$','interpreter','latex'); ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); annotation('textarrow',[0.75 0.6],[0.85 0.68], 'String','$\mathcal{O}(k^{-2.30})$','interpreter','latex','fontsize',18); annotation('textarrow',[0.75 0.6],[0.78 0.635], 'String','$\mathcal{O}(k^{-2.27})$','interpreter','latex','fontsize',18); annotation('textarrow',[0.75 0.6],[0.72 0.605], 'String','$\mathcal{O}(k^{-2.28})$','interpreter','latex','fontsize',18); annotation('textarrow',[0.75 0.6],[0.65 0.595], 'String','$\mathcal{O}(k^{-2.29})$','interpreter','latex','fontsize',18); print('comp_1','-depsc'); !cp comp_1.eps ../figs <file_sep>function [t_AGD, J_AGD, errR_AGD]=agdSO3(A,p,J,R0,T) global A % A=rand(3,3);%diag([5, 3, 1])*expm(pi*hat([1 1 1])/sqrt(3)); % A = [ 0.7572 0.5678 0.5308 % 0.7537 0.0759 0.7792 % 0.3804 0.0540 0.9340]; [U S V]=psvd(A); R_opt = U*V'; J_opt = obj(R_opt); % p=4; C=1; % J=eye(3); %% AGD W0=zeros(3,1); X0=[reshape(R0,9,1); W0]; options = odeset('RelTol',1e-8,'AbsTol',1e-8); sol=ode45(@(t,X) eom_AGD(t,X,p,J,C), [1 T], X0, options); t=sol.x;X=sol.y';disp(sol.stats); N=length(t); W=X(:,10:12)'; for k=1:N R_AGD(:,:,k) = reshape(X(k,1:9),3,3); J_AGD(k) = obj(R_AGD(:,:,k))-J_opt; Pi_AGD(:,k) = t(k)^(p+1)/p*J*W(:,k); errR_AGD(k) = norm(R_AGD(:,:,k)'*R_AGD(:,:,k)-eye(3)); end t_AGD = t; % %% AGD_Pi % % % X0=[reshape(R0,9,1); J*W0]; % % sol=ode45(@eom_AGD_Pi, tspan, X0, options); % t=sol.x;X=sol.y';disp(sol.stats); % % N=length(t); % Pi=X(:,10:12)'; % % for k=1:N % R_AGD_Pi(:,:,k) = reshape(X(k,1:9),3,3); % J_AGD_Pi(k) = obj(R_AGD_Pi(:,:,k))-J_opt; % end % t_AGD_Pi = t; % % % %% Post Process % % plot(t_GD ,J_GD, 'r', t_AGD, J_AGD,'b', t_AGD_Pi, J_AGD_Pi,'g'); % set(gca,'xscale','log','yscale','log'); % filename='gdSO3_0'; % save(filename); % evalin('base','clear all'); % evalin('base',['load ' filename]); end function J = obj(R) global A tmp=R-A; J = tmp(:)'*tmp(:)/2; end function M = grad(R) global A M=vee(R'*A-A'*R);%+randn(3,1)*1e-3; end function X_dot = eom_GD(t,X) R=reshape(X,3,3); M = grad(R); R_dot = R*hat(M); X_dot = reshape(R_dot,9,1); end function X_dot = eom_AGD(t,X, p, J,C) R=reshape(X(1:9),3,3); W=X(10:12); M = grad(R); R_dot = R*hat(W); W_dot = J\( -(p+1)/t*J*W - hat(W)*J*W + C*p^2*t^(p-2)*M); X_dot = [reshape(R_dot,9,1); W_dot]; end function X_dot = eom_AGD_Pi(t,X) global p J C R=reshape(X(1:9),3,3); Pi=X(10:12); M = grad(R); W = J\(p/t^(p+1)*Pi); R_dot = R*hat(W); Pi_dot = -hat(W)*Pi + C*p*t^(2*p-1)*M; X_dot = [reshape(R_dot,9,1); Pi_dot]; end <file_sep>% comparision with other accelerated optimization schmes on Lie groups clear; close all; % A = [ 0.7572 0.5678 0.5308 % 0.7537 0.0759 0.7792 % 0.3804 0.0540 0.9340]; % r = [0.7915 % -0.3101 % 0.5267]; % A=rand(3,3); % r=rand(3,1); A =[ 0.9398 0.6393 0.5439 0.6456 0.5447 0.7210 0.4795 0.6473 0.5225]; r =[ 0.9937 0.2187 0.1058 ]; [U S V]=psvd(A); R0 = U*expm(pi*hat(r))*V'; J=eye(3); N = 10000; %% LGVI flag_update_h = false; flag_display_progress = false; flag_stop = 2; p = 2; h = 0.1; p = 3; h = 0.025; [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,h,N,flag_update_h,flag_display_progress,flag_stop); disp(t_elapsed); figure(1);plot(1:N,JJ); hold on; set(gca,'xscale','log','yscale','log'); p = 4; h = 0.0055; [t, JJ, errR, t_elapsed] = vigdSO3(A,p,J,R0,h,N,flag_update_h,flag_display_progress,flag_stop); disp(t_elapsed); figure(1);plot(1:N,JJ); %% Lie-NAG-SC flag_type=1; h=0.05; [JJ, errR, t_elapsed] = benchmark_LieNAG_new(A,0,R0,h,N,flag_type); figure(1);plot(1:N,JJ); disp(t_elapsed); %% Lie-NAG-C flag_type=2; h=0.05; [JJ, errR, t_elapsed] = benchmark_LieNAG_new(A,0,R0,h,N,flag_type); figure(1);plot(1:N,JJ,'--'); disp(t_elapsed); % %% Lie-GD % h=0.01; % [JJ, errR, t_elapsed] = LieGD(A,R0,h,N); % figure(1);plot(1:N,JJ); % disp(t_elapsed); %% figure(1) legend('$\mathrm{ELGVI}\; (p=3, h=0.025)$', '$\mathrm{ELGVI}\; (p=4, h=0.005)$', 'Lie-NAG-SC $(h=0.05)$', 'Lie-NAG-C $(h=0.05)$' ,... 'Location','SouthWest','interpreter','latex'); ylabel('${f}(R)-{f}(R^*)$','interpreter','latex'); xlabel('$k$','interpreter','latex'); set(gca,'FontSize',16); print('comp_4','-depsc'); !cp comp_4.eps ../figs
5a565d0bf4dfa2cb3353283ce62bdbf4b583b568
[ "M", "MATLAB", "TeX", "BibTeX" ]
30
M
fdcl-gwu/VAOG
6ea88ec03cbe7c3981a7e4a0c27241ae9591504f
0e77d816fb1f7315de6bf22c131ac87aef73a2af
refs/heads/master
<file_sep>import React from 'react' import {Button as ButtonANT } from 'antd'; import 'antd/lib/button/style/css'; import { ButtonProps } from 'antd/lib/button'; export function Button(props: ButtonProps) { return <ButtonANT {...props} /> } <file_sep> { "extends": "./tsconfig.base.json", "compilerOptions": { "baseUrl": ".", "allowSyntheticDefaultImports": true, "paths": { "@bookie-sdk/api-services": ["packages/api-services/src/index"], "@bookie-sdk/components": ["packages/components/*"], "@bookie-sdk/accountants": ["packages/accountants/src/index"], "@bookie-sdk/utilities": ["packages/utilities/src/index"] } }, "exclude": ["**/node_modules/**", "**/build/**"] }<file_sep>'use strict'; const test = (tmplateLiteras: TemplateStringsArray) => { console.log(tmplateLiteras) return tmplateLiteras.join(); } export function apiServices() { return test`Services ziomel!` } <file_sep>'use strict'; const appServer = require('..'); describe('app-server', () => { it('needs tests'); }); <file_sep># `api-services` > TODO: description ## Usage ``` const apiServices = require('api-services'); // TODO: DEMONSTRATE API ``` <file_sep>import {Config} from 'bili'; import path from 'path'; const config: Config = { input: "./src/index.tsx", output: { moduleName: "Package", minify: true, format: ["esm"], dir: "./build" }, plugins: { typescript2: { cacheRoot: path.join(__dirname, ".rpt2_cache") } }, extendRollupConfig: (config) => ({ ...config, inputConfig: { ...config.inputConfig, inlineDynamicImports: true, treeshake: true } }) } export default config;<file_sep>import React from 'react'; export const Test = () => <div>Testasdasd</div><file_sep>export * from './Component/Component'; export * from './Button/Button';<file_sep>export function login(user: string) { return {user}; } <file_sep>import React from 'react'; import {storiesOf} from '@storybook/react'; import {Component} from '..'; storiesOf('Component', module).add('default', () => <Component />);<file_sep>export const getLength = (array: any[]) => array.length;<file_sep>import { css } from '@emotion/core' import React from 'react'; import {getLength} from '@bookie-sdk/utilities'; const style = css` color: hotpink; ` const SomeComponent: React.FC = ({ children }) => ( <div css={style}> Some hotpink text. {children} </div> ) console.log(getLength([1,2])) const anotherStyle = css({ textDecoration: 'underline' }) export const Component = () => ( <SomeComponent> <div css={anotherStyle}>Some text with an underline.</div> </SomeComponent> ) <file_sep>export * from './login'; export * from './other';<file_sep>'use strict'; module.exports = appServer; function appServer() { // TODO } <file_sep>import React from 'react'; import {storiesOf} from '@storybook/react' import { Button } from '.'; storiesOf('Button', module).add('default', () => <div style={{height: 300}}> <Button onClick={() => console.log('test')}>Test click</Button> </div>)<file_sep># `app-server` > TODO: description ## Usage ``` const appServer = require('app-server'); // TODO: DEMONSTRATE API ``` <file_sep>Working example of monorepot: * lerna * react * typescript * yark workspaces * rollup (switch to webpack) * storybook * simple testing Todo: * switch to webpack * add separate versioning for packages * make proper build configs * add backend package and try to connect with envs * add docker and try to put on google console kubernetes
a2be4a3956c925b32f9c1814a616db4c7b566dfd
[ "TSX", "JSON with Comments", "Markdown", "JavaScript", "TypeScript" ]
17
TSX
Draer/bookie
22a9efd867315c493f54993bf75318aeb1fef2da
db3530b57ef70af89d2a46199d7773d96e692969
refs/heads/master
<file_sep>module github.com/KenerChang/golang go 1.13 require github.com/gorilla/mux v1.7.4 <file_sep>package rest import ( "net/http" ) type HandleFunc func(w http.ResponseWriter, r *http.Request) // Endpoint is a api endpoint for serving a rest api, ex: get /api/v1/cars type Endpoint struct { Version int Path string Method string Callback HandleFunc } // Route is a collection of endpoints type Route struct { Name string Endpoints []Endpoint InitFunc func() } <file_sep># .DEFAULT_GOAL:= test .PHONY: test test: go test ./... <file_sep>package util import ( "fmt" "github.com/KenerChang/golang/logger" "github.com/KenerChang/golang/rest" "github.com/gorilla/mux" "net/http" ) // SetRoutes recives routes info and return a mux func SetRoutes(routes []rest.Route) *mux.Router { apiRoutes := mux.NewRouter() for _, route := range routes { for _, endpoint := range route.Endpoints { localEndpoint := endpoint path := fmt.Sprintf("/api/v%d/%s", endpoint.Version, route.Name) if endpoint.Path != "" { path = path + "/" + endpoint.Path } logger.Info.Printf("set path: %s", path) apiRoutes. HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { defer func() { if err := recover(); err != nil { errMsg := fmt.Sprintf("%#v", err) WriteWithStatus(w, errMsg, http.StatusInternalServerError) logger.Error.Println("Panic error:", errMsg) } }() localEndpoint.Callback(w, r) }). Methods(endpoint.Method) } // init module if route.InitFunc != nil { route.InitFunc() } } return apiRoutes } <file_sep>package config import ( "testing" ) func TestParseEnvs(t *testing.T) { err := Parse("test.env") if err != nil { t.Errorf("test parseEnvs failed, %s", err.Error()) return } target := map[string]string{"a": "b", "c": "d=d", "e": "fg"} for k, v := range store { if targetV, ok := target[k]; !ok || v != targetV { t.Errorf("parse envs failed, expect %v, got %v", target, store) return } } } <file_sep>package config import ( "bufio" "os" "strconv" "strings" ) var store map[string]string // config store func init() { store = map[string]string{} } // parse parses a given env file and transforms the to a map func Parse(filePath string) (err error) { env, err := os.Open(filePath) if err != nil { return } defer env.Close() scanner := bufio.NewScanner(env) for scanner.Scan() { results := strings.Split(scanner.Text(), "=") // incorrect format, skip if len(results) <= 1 { continue } key := results[0] value := results[1] // if "=" in value, concat all strings after first "=" if len(results) > 2 { value = strings.Join(results[1:len(results)], "=") } value = strings.Replace(value, "\"", "", -1) store[key] = value } if err = scanner.Err(); err != nil { return } return } func GetEnv(key string) string { value := store[key] return value } func GetBool(key string) bool { value := store[key] result, err := strconv.ParseBool(value) if err != nil { return false } return result }
80186f593b3dd73bdb7a5b1d91ea17d8c53ebc28
[ "Go Module", "Makefile", "Go" ]
6
Go Module
KenerChang/golang
e5ac808ee5c88344d1ce878d1e03e79a55ef4be1
e872a14d0f33d86dec0175717b557ca274e6c731
refs/heads/master
<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UsefulTool { class Program { static void Module() { Console.WriteLine("Separate module"); Console.WriteLine("I can see Alternative branch"); Console.WriteLine("1234567890"); } static void Main(string[] args) { Console.WriteLine("InitCommit"); Console.WriteLine("SecondCommit"); Console.WriteLine("Second person commit"); for (int i = 0; i < 10; i++) Console.Write(i); Console.WriteLine("Contenu"); } } }
5d6b2bd3fc16f81fde4837ff3ff784383105ae9b
[ "C#" ]
1
C#
Eraphion/DreamTeam
55740409b3ab97d24786478b50caa10260e619d3
8aa3a8fd6eeca4c73912619fd92e7778db4b8a63
refs/heads/master
<file_sep>package com.byc.mylibrary; import android.text.TextUtils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class DateUtils { public static String TIME_FORMAT_ZERO = "yyyy年MM月dd日 HH时mm分ss秒"; public static String TIME_FORMAT_ONE = "yyyy-MM-dd HH:mm:ss"; public static String TIME_FORMAT_TWO = "yyyy.MM.dd HH:mm:ss"; public static String TIME_FORMAT_THREE = "yyyy-MM-dd HH:mm"; /** * 时间戳转化为格式时间 * 调用此方法输入所要转换的时间戳输入例如(1402733340)输出("2014.06.14 15:43:23") * @param time 时间戳 * @param format 时间格式 * @return */ public static String FormatTimestamp(String time, String format) { if (TextUtils.isEmpty(time)) { return ""; } else { SimpleDateFormat sdr = new SimpleDateFormat(format); @SuppressWarnings("unused") long lcc = Long.valueOf(time); int i = Integer.parseInt(time); String times = sdr.format(new Date(i * 1000L)); return times; } } /** * 格式时间转化为时间戳 * 调用此方法输入所要转换的时间输入例如("2014年06月14日16时09分00秒")返回时间戳 * @param format 时间格式 * @param time 时间 * @return */ public String TimestampFormat(String format, String time) { SimpleDateFormat sdr = new SimpleDateFormat(format, Locale.CHINA); Date date; String times = null; try { date = sdr.parse(time); long l = date.getTime(); String stf = String.valueOf(l); times = stf.substring(0, 10); } catch (Exception e) { e.printStackTrace(); } return times; } /** * 获取当前时间—年份 * @return */ public static String getCurrentTime_TodayYear() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(new Date()); } /** * 获取当前时间—时分 * @return */ public static String getCurrentTime_Today() { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); return sdf.format(new Date()); } /** * 根据当前日期获得是星期几 * @return */ public static String getWeekDay(long seconds) { Date date = new Date(seconds); String Week = ""; Calendar c = Calendar.getInstance(); c.setTime(date); int wek = c.get(Calendar.DAY_OF_WEEK); if (wek == 1) { Week += "星期日"; } if (wek == 2) { Week += "星期一"; } if (wek == 3) { Week += "星期二"; } if (wek == 4) { Week += "星期三"; } if (wek == 5) { Week += "星期四"; } if (wek == 6) { Week += "星期五"; } if (wek == 7) { Week += "星期六"; } return Week; } /** * 输入时间戳变星期 * @param time * @return */ public static String changeweek(String time) { SimpleDateFormat sdr = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒"); int i = Integer.parseInt(time); String times = sdr.format(new Date(i * 1000L)); Date date = null; int mydate = 0; String week = null; try { date = sdr.parse(times); Calendar cd = Calendar.getInstance(); cd.setTime(date); mydate = cd.get(Calendar.DAY_OF_WEEK); // 获取指定日期转换成星期几 } catch (Exception e) { e.printStackTrace(); } if (mydate == 1) { week = "星期日"; } else if (mydate == 2) { week = "星期一"; } else if (mydate == 3) { week = "星期二"; } else if (mydate == 4) { week = "星期三"; } else if (mydate == 5) { week = "星期四"; } else if (mydate == 6) { week = "星期五"; } else if (mydate == 7) { week = "星期六"; } return week; } /** * 获取过去第几天的日期 * * @param past * @return */ public static String getPastDate(int past, String format) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - past); Date today = calendar.getTime(); SimpleDateFormat formats = new SimpleDateFormat(format); String result = formats.format(today); return result; } /** * 判断是否为今天(效率比较高) * * @param day 传入的 时间 "2016-06-28 10:10:30" "2016-06-28" 都可以 * @return true今天 false不是 * @throws ParseException */ public static boolean IsToday(String day) throws ParseException { Calendar pre = Calendar.getInstance(); Date predate = new Date(System.currentTimeMillis()); pre.setTime(predate); Calendar cal = Calendar.getInstance(); Date date = getDateFormat().parse(day); cal.setTime(date); if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) { int diffDay = cal.get(Calendar.DAY_OF_YEAR) - pre.get(Calendar.DAY_OF_YEAR); if (diffDay == 0) { return true; } } return false; } private static ThreadLocal<SimpleDateFormat> DateLocal = new ThreadLocal<SimpleDateFormat>(); public static SimpleDateFormat getDateFormat() { if (null == DateLocal.get()) { DateLocal.set(new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA)); } return DateLocal.get(); } /** * 获取过去第几天的日期 * * @param past * @return */ public static String getPastDate(int past) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - past); Date today = calendar.getTime(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String result = format.format(today); return result; } /** * 获取未来 第 past 天的日期 * * @param past * @return */ public static String getFetureDate(int past) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + past); Date today = calendar.getTime(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String result = format.format(today); return result; } } <file_sep># CommonTools implementation 'com.github.byc-gh:CommonTools:v1.5' ---- 1、崩溃捕获以减少不必要的程序崩溃 ---- 使用:在程序的Application中进行设置,代码如下 public class BaseApplication extends Application { @Override public void onCreate() { super.onCreate(); install(); } private void install() { Cockroach.install(BaseApplication.this, new ExceptionHandler() { @Override protected void onUncaughtExceptionHappened(Thread thread, Throwable throwable) { Log.e("AndroidRuntime", "--->onUncaughtExceptionHappened:" + thread + "<---", throwable); new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { } }); } @Override protected void onBandageExceptionHappened(Throwable throwable) { throwable.printStackTrace();//打印警告级别log,该throwable可能是最开始的bug导致的,无需关心 } @Override protected void onEnterSafeMode() { } }); } } ---- 2、日期格式化工具 ---- DateUtils.FormatTimestamp(String time, String format); //将时间戳格式化为自己指定的时间格式 目前给出的格式有如下几种: public static String TIME_FORMAT_ZERO = "yyyy年MM月dd日 HH时mm分ss秒"; public static String TIME_FORMAT_ONE = "yyyy-MM-dd HH:mm:ss"; public static String TIME_FORMAT_TWO = "yyyy.MM.dd HH:mm:ss"; public static String TIME_FORMAT_THREE = "yyyy-MM-dd HH:mm"; DateUtils.TimestampFormat(String format, String time); //将格式化的时间转为时间戳 ---- 3、身份证号码本地验证工具 ---- IDCardValidate.validate_effective(String idcardNumber); //填入身份证号码验证身份证号码格式是否正确,正确则返回身份证号 ---- 4、IP地址获取工具 ---- IPAddressUtil.getIpAddress(Context context); //返回设备当前的网络IP ---- 5、缓存数据工具 ---- ACache aCache = ACache.get(mContext); String string = aCache.getAsString(key); //获取缓存数据 aCache.put(key,json,7 * ACache.TIME_DAY); //添加缓存数据,最后参数为缓存时效,示例为时效7天,具体可自行设置,也可不设置 ---- 6、SharedPreferences数据操作工具 ---- PrefUtil.putString(context,key,value); //存储数据 PrefUtil.getString(context, key, defaltValue); //获取数据 其他数据类型存储同上 ---- 7、屏幕信息工具 ---- ScreenUtils.getScreenWidth(context); //获取屏幕宽度 ScreenUtils.getScreenHeight(context); //获取屏幕高度 ScreenUtils.getStatusHeight(context); //获取屏幕状态栏高度 ScreenUtils.getScreenDensity(context); //获取屏幕像素密度 ScreenUtils.snapShotWithStatusBar(context); //获取当前屏幕截图,包含状态栏 ScreenUtils.snapShotWithoutStatusBar(context); //获取当前屏幕截图,不包含状态栏 ---- 8、Log日志工具 ---- 在APP的Application中设置L.isDebug = true; 此时程序中自行打印的Log日志可见,反之则不可见 ---- 9、软键盘工具 ---- KeyBoardUtils.openKeyBord(editText,context); //打开软键盘 KeyBoardUtils.closeKeyBord(context,editText); //关闭软键盘 KeyBoardUtils.isSHowKeyboard(context,view); //判断软键盘是否弹出 ---- 10、APP操作工具 ---- AppUtils.getAppName(context); //获取应用程序名称 AppUtils.getVersionName(context); //当前应用的版本名称 AppUtils.getVersionCode(context); //当前应用的版本号 AppUtils.getPackageName(context); //当前应用包名 AppUtils.getBitmap(context); //获取图标 ---- 11、网络状态监听工具 取自[CocoYuki](https://github.com/CocoYuki/NetListener) ---- 在Application的onCreate方法中添加 NetworkManager.getDefault().init(this); 在AndroidManifest.xml文件中添加如下代码: <receiver android:name="com.byc.mylibrary.networklistener.NetStateReceiver"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/> </intent-filter> </receiver> 在Activity中添加 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); NetworkManager.getDefault().registerObserver(this); } //网络监听 @NetworkListener() public void netork(@NetType String type){ switch (type){ case NetType.AUTO: L.e("network","AUTO"); break; case NetType.CMNET: L.e("network","CMNET"); break; case NetType.CMWAP: L.e("network","CMWAP"); break; case NetType.WIFI: L.e("network","WIFI"); break; case NetType.NONE: L.e("network","NONE"); break; } } @Override protected void onDestroy() { super.onDestroy(); //注销目标广播 NetworkManager.getDefault().unRegisterObserver(this); //注销所有广播 NetworkManager.getDefault().unRegisterAllObserver(); } ---- 12、新增两个自定义控件ShapeTextView和RoundImageView 取自[ASheng-Bisheng](https://github.com/ASheng-Bisheng/Android-or-Java-UtilityClass) ---- ShapeTextView为圆角TextView <com.byc.mylibrary.ShapeTextView android:id="@+id/tv_shape" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center" android:textColor="#FFFFFF" android:textSize="17sp" android:text="aaaaaaaaaaaa" app:solidColor="#1fadff" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" app:textRadius="10dp" /> RoundImageView为可圆角、可圆形、可不处理的ImageView 属性为:round(圆角) circle(圆形) <com.byc.mylibrary.RoundImageView android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity="center_horizontal" app:type="circle" app:radius="10dp" android:src="@mipmap/a" android:scaleType="centerCrop"/> <file_sep>package com.byc.commontools; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.byc.mylibrary.ACache; import com.byc.mylibrary.AppUtils; import com.byc.mylibrary.DateUtils; import com.byc.mylibrary.IDCardValidate; import com.byc.mylibrary.IPAddressUtil; import com.byc.mylibrary.L; import com.byc.mylibrary.PrefUtil; import com.byc.mylibrary.ScreenUtils; import com.byc.mylibrary.networklistener.NetType; import com.byc.mylibrary.networklistener.NetworkListener; import com.byc.mylibrary.networklistener.NetworkManager; public class MainActivity extends AppCompatActivity { private String time = "1594287701"; private TextView tv_network_status; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); NetworkManager.getDefault().registerObserver(this); tv_network_status = findViewById(R.id.tv_network_status); final TextView tv_time = findViewById(R.id.tv_time); final TextView tv_ip = findViewById(R.id.tv_ip); final TextView tv_crash = findViewById(R.id.tv_crash); final TextView tv_add_cache = findViewById(R.id.tv_add_cache); final TextView tv_get_cache = findViewById(R.id.tv_get_cache); final TextView tv_clear_cache = findViewById(R.id.tv_clear_cache); final TextView tv_add_sp = findViewById(R.id.tv_add_sp); final TextView tv_get_sp = findViewById(R.id.tv_get_sp); final TextView tv_clear_sp = findViewById(R.id.tv_clear_sp); final TextView tv_get_screen_width_height = findViewById(R.id.tv_get_screen_width_height); final TextView tv_shoot_screen_status = findViewById(R.id.tv_shoot_screen_status); final TextView tv_shoot_screen = findViewById(R.id.tv_shoot_screen); final ImageView iv_screen_shoot = findViewById(R.id.iv_screen_shoot); final TextView tv_log = findViewById(R.id.tv_log); final TextView tv_get_version = findViewById(R.id.tv_get_version); String timestamp = DateUtils.FormatTimestamp(time, DateUtils.TIME_FORMAT_ZERO); tv_time.setText(timestamp); tv_time.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { long l = System.currentTimeMillis() / 1000; String currentTime = String.valueOf(l); String times = DateUtils.FormatTimestamp(currentTime, DateUtils.TIME_FORMAT_ZERO); tv_time.setText(times); } }); final String s = IDCardValidate.validate_effective("3701000000000000"); Log.e("身份证号码验证", "onCreate: " + s); tv_ip.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String ipAddress = IPAddressUtil.getIpAddress(MainActivity.this); tv_ip.setText(ipAddress); } }); tv_crash.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int a = 10 / 0; } }); final ACache aCache = ACache.get(MainActivity.this); tv_add_cache.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { aCache.put("test_cache","这是测试缓存添加的数据",7 * ACache.TIME_DAY); //添加缓存数据,最后参数为缓存时效,示例为时效7天,具体可自行设置,也可不设置,永久缓存 } }); tv_get_cache.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String string = aCache.getAsString("test_cache"); //获取缓存数据 Toast.makeText(MainActivity.this, ""+string, Toast.LENGTH_SHORT).show(); } }); tv_clear_cache.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { aCache.clear(); } }); tv_add_sp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { PrefUtil.putString(MainActivity.this,"test","测试SharedPreferences数据存储"); } }); tv_get_sp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String string = PrefUtil.getString(MainActivity.this, "test", "默认数据"); Toast.makeText(MainActivity.this, ""+string, Toast.LENGTH_SHORT).show(); } }); tv_clear_sp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { PrefUtil.removeStr(MainActivity.this,"test"); } }); tv_get_screen_width_height.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { tv_get_screen_width_height.setText("宽:"+ ScreenUtils.getScreenWidth(MainActivity.this)+" 高:"+ScreenUtils.getScreenHeight(MainActivity.this)+" 状态栏高:"+ScreenUtils.getStatusHeight(MainActivity.this)+" dpi:"+(int)(ScreenUtils.getScreenDensity(MainActivity.this)*160)); } }); tv_shoot_screen_status.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Bitmap bitmap = ScreenUtils.snapShotWithStatusBar(MainActivity.this); iv_screen_shoot.setImageBitmap(bitmap); } }); tv_shoot_screen.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Bitmap bitmap = ScreenUtils.snapShotWithoutStatusBar(MainActivity.this); iv_screen_shoot.setImageBitmap(bitmap); } }); tv_log.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { L.e("这是打印出来的内容"); } }); tv_get_version.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { tv_get_version.setText("包名:"+ AppUtils.getPackageName(MainActivity.this)+" 版本号:"+AppUtils.getVersionCode()); } }); } //网络监听 @NetworkListener() public void netork(@NetType String type){ switch (type){ case NetType.AUTO: if (tv_network_status!=null) { tv_network_status.setText("AUTO"); } break; case NetType.CMNET: if (tv_network_status!=null) { tv_network_status.setText("CMNET"); } break; case NetType.CMWAP: if (tv_network_status!=null) { tv_network_status.setText("CMWAP"); } break; case NetType.WIFI: if (tv_network_status!=null) { tv_network_status.setText("WIFI"); } break; case NetType.NONE: if (tv_network_status!=null) { tv_network_status.setText("NONE"); } break; } } }
79720c6893ffdccd12b3996b531fb297f1b4f86e
[ "Java", "Markdown" ]
3
Java
byc-gh/CommonTools
8bc260d84357c0ef5a447576dea23a1c832a19d0
e0a3e26d0d88750343db6cbc7e7580674251b060
refs/heads/master
<file_sep>import os import csv csvpath=os.path.join("Resources","election_data.csv") with open(csvpath) as csvfile: readableFile=csv.reader(csvfile) csvHeader=next(readableFile) names = ["Khan", "Correy", "Li", "O'Tooley"] namesDict = {} total_votes=0 for row in readableFile: name=row[2] if name in namesDict: namesDict[name]=namesDict[name]+1 else: namesDict[name]=1 total_votes=total_votes+1 print("Election Results") print("------------------------") print("Total Votes: ", total_votes) print("------------------------") print(names[0] +str(": ") +str(round(100*namesDict[names[0]]/total_votes,5)) +str("% (") +str(namesDict[names[0]])+str(")")) print(names[1] +str(": ") +str(round(100*namesDict[names[1]]/total_votes,5)) +str("% (") +str(namesDict[names[1]])+str(")")) print(names[2] +str(": ") +str(round(100*namesDict[names[2]]/total_votes,5)) +str("% (") +str(namesDict[names[2]])+str(")")) print(names[3] +str(": ") +str(round(100*namesDict[names[3]]/total_votes,5)) +str("% (") +str(namesDict[names[3]])+str(")")) MaxDictVal = max(namesDict, key=namesDict.get) print("------------------------") print("Winner: " +str(MaxDictVal)) print("------------------------") pathToWriteFile=os.path.join("Analysis","output.txt") write_file=open(pathToWriteFile, 'w+') write_file.write(str("Election Results"+'\n')) write_file.write(str("------------------------"+'\n')) write_file.write(str("Total Votes: " +str(total_votes)+'\n')) write_file.write(str("------------------------"+'\n')) write_file.write(str(names[0])+ ": " +str(round(100*namesDict[names[0]]/total_votes,5)) + "% (" +str(namesDict[names[0]])+ ")"+'\n') write_file.write(str(names[1])+ ": " +str(round(100*namesDict[names[1]]/total_votes,5)) + "% (" +str(namesDict[names[1]])+ ")"+'\n') write_file.write(str(names[2])+ ": " +str(round(100*namesDict[names[2]]/total_votes,5)) + "% (" +str(namesDict[names[2]])+ ")"+'\n') write_file.write(str(names[3])+ ": " +str(round(100*namesDict[names[3]]/total_votes,5)) + "% (" +str(namesDict[names[3]])+ ")"+'\n') write_file.write(str("------------------------"+'\n')) write_file.write(str("Winner: ") +str(MaxDictVal) +'\n') write_file.write(str("------------------------"+'\n'))<file_sep>DROP TABLE central_and_south; CREATE TABLE central_and_south( zipcode int, population int, median_age real, household_income real, per_capita_income real, poverty_count int, nicaraguans int, costa_ricans int, guatemalans int, hondurans int, panamanians int, salvadorans int, argentineans int, bolivians int, chileans int, colombians int, ecuadorians int, paraguayans int, peruvians int, uruguayans int, venezuelans int, lat real, lng real, city varchar, state_id varchar, state_name varchar, population_zip int, density real, county_fips int, county_name varchar, county_weights varchar, county_names_all varchar, county_fips_all varchar, timezone varchar, poverty_rate real, central_americans int, south_americans int, total int, percent_central_american real, percent_south_american real, percent_total real ); SELECT * FROM central_and_south; SELECT ( state_id, sum(total), sum(nicaraguans), sum(hondurans), sum(salvadorans), sum(guatemalans), sum(costa_ricans), sum(panamanians), sum(colombians), sum(venezuelans), sum(ecuadorians), sum(peruvians), sum(bolivians), sum(chileans), sum(paraguayans), sum(uruguayans), sum(argentineans)) FROM central_and_south GROUP BY state_id ORDER BY sum(total) desc, sum(nicaraguans), sum(hondurans), sum(salvadorans), sum(guatemalans), sum(costa_ricans), sum(panamanians), sum(colombians), sum(venezuelans), sum(ecuadorians), sum(peruvians), sum(bolivians), sum(chileans), sum(paraguayans), sum(uruguayans), sum(argentineans) ; SELECT ( city, state_id, sum(nicaraguans), sum(population) ) FROM central_and_south GROUP BY city, state_id ORDER BY sum(nicaraguans) desc; <file_sep>I wanted to investigate in detail the population in the United States of America who are of Central American and South American origin. There are a total of 15 countries of origin for these communitites. For Central American-Americans the countries of origin are Guatemala, El Salvador, Honduras, Nicaragua, and Costa Rica, who on September 15, 1821, declared their independence from Spain and formed the United Republics of Central America. Also, I included Panama in the Central America region. Although Panama geographically is in the Central American Isthmus, until the early 1900s, Panama formed part of Colombia, and Panama is linguistically, culturally, historically, etc. more like a South American nation. The countries included in the South American region are the aforementioned Colombia, Venezuela, and Ecuador, who together with Panama, also formed another federation when these countries became independent from Spain. Also included in the South American region are Peru and Bolivia, who were once upon a time also one country. Argentina, Uruguay and Paraguay also formed another federal entity when these nations became independent from Spain. Lastly, Chile is also included in the South American region. I only included countries whose official language is Spanish and whose predominant language is Spanish. I thus excluded other countries situated in the regions such as Belize in Central America and Brazil in South America. These 15 countries also share linguistic characteristics such as the widespread use of the voseo Spanish, which is absent from those Spanish varieties spoken in the Caribbean islands, Mexico, and Spain. I adapted a Jupyter file written in Python by reviewing the documention for the US Census API and pulled the number of people who self-identified as being of origin of each of the 15 countries of interest at the zip code level. I wanted to be able to aggregate the retrieved data at the city, county and state levels. I was able to download a free database from https://simplemaps.com/data/us-zips. I then split the database into 3 pieces. One contained only those zip codes that had 3 digits in their zip codes. I added the leading two zeroes. I did the same for those zip codes who that had 4 digits in their zip codes. I added the leading zero. Finally, I concatenated the previous two files with the one that already had zip codes with five digits. I finally, joined the new zip code database with the census database containing the counts of the different nationalities. Finally, I cleaned up the data by adding city, county, and state information to some zip code which had such information missing. I then added some columns that would give me the total of the Central Americans, South Americans, and a grand total of all 15 nationalities at the zip code level. I also added columns that calculated the percentages of the 3 sums calculated above as percent of the total population in each zip code. I also added a column calculating the poverty rate at the zip code level. I finally uploaded the comma delimited file created above in pandas to a pgAdmin SQL database. This will allow me to do further analysis and illustrations/visualizations in the future. I calculated that the total population of Central American and South American origins in the United States of America total some 8.8 million people, which represents about 2.7% of the total U.S. population. Among people of origin from a predominantly Spanish speaking country, Central American-Americans and South American-Americans represent approximately 15% of such population in the U.S. Our Spanish language variety, which uses voseo, is not taught in the schools or universities in the United States. Most Spanish language mass media in the United States also does not cater or target these nationalities. The states with the highest Central American and South American populations are California (1,743,039), Florida (1,459,696), New York (1,017,889), and Texas (811,097). These populations are concentrated in the Los Angeles, Miami, New York City, Houston, and Washington, D.C. metropolitan areas. Salvadorans are by far the largest group at 2,197,375, which represents about 25% of the total of Central and South American origins. Salvadorans, together with the other Northern Triangle countries of Guatemala (1,421,645) and Honduras (903,987) make up 51% of the total. Colombians are by far the largest South American group at 1,152,714, which is about one-third of the South American population in the USA. Ecuadorans (704,781) and Peruvians (657,103) make up, combined with the aforementioned nationalities, almost 80% of the total Central American and South American total population. The other 9 nationalities slightly make up more than 20%. Central Americans number 5.3 million and South Americans number some 3.5 million. The combined population of 8.8 million is comparable in size to the population of Honduras, and bigger than that of El Salvador, Paraguay, Nicaragua, Costa Rica, Panama, and Uruguay. <file_sep>To run these files successfully, I open them up in Visual Studio. From the index.html file, I open a new terminal at the bottom of the screen. I then type at the cursor location the following, python -m http.server A couple of lines show up at the bottom screen. I press ctrl and click on the (http://0.0.0.0:8000/) This will open up a pop up window and click on the open window button A new tab opens up in my internet browser. I then change the url to 127.0.0.1:8000/StarterCode in my computer. For the grader, maybe you do not need the StarterCode or you may not need to change the 0.0.0.0:8000 I am using a Windows 10 Home 64 bit OS. The Test Subject ID defaults to 940, and the demographic info, bar chart, gauge and bubbles charts default to this subject data. See how everything changes by changing the test subject id in the dropdown menu. The bonus part about the gauge chart was incorporated into the main app.js, so no need for a bonus.js file. I am glad that I got everything to work fine. # Plot.ly Homework - Belly Button Biodiversity ![Bacteria by filterforge.com](Images/bacteria.jpg) In this assignment, you will build an interactive dashboard to explore the [Belly Button Biodiversity dataset](http://robdunnlab.com/projects/belly-button-biodiversity/), which catalogs the microbes that colonize human navels. The dataset reveals that a small handful of microbial species (also called operational taxonomic units, or OTUs, in the study) were present in more than 70% of people, while the rest were relatively rare. ## Step 1: Plotly 1. Use the D3 library to read in `samples.json`. 2. Create a horizontal bar chart with a dropdown menu to display the top 10 OTUs found in that individual. * Use `sample_values` as the values for the bar chart. * Use `otu_ids` as the labels for the bar chart. * Use `otu_labels` as the hovertext for the chart. ![bar Chart](Images/hw01.png) 3. Create a bubble chart that displays each sample. * Use `otu_ids` for the x values. * Use `sample_values` for the y values. * Use `sample_values` for the marker size. * Use `otu_ids` for the marker colors. * Use `otu_labels` for the text values. ![Bubble Chart](Images/bubble_chart.png) 4. Display the sample metadata, i.e., an individual's demographic information. 5. Display each key-value pair from the metadata JSON object somewhere on the page. ![hw](Images/hw03.png) 6. Update all of the plots any time that a new sample is selected. Additionally, you are welcome to create any layout that you would like for your dashboard. An example dashboard is shown below: ![hw](Images/hw02.png) ## Advanced Challenge Assignment (Optional) The following task is advanced and therefore optional. * Adapt the Gauge Chart from <https://plot.ly/javascript/gauge-charts/> to plot the weekly washing frequency of the individual. * You will need to modify the example gauge code to account for values ranging from 0 through 9. * Update the chart whenever a new sample is selected. ![Weekly Washing Frequency Gauge](Images/gauge.png) ## Deployment * Deploy your app to a free static page hosting service, such as GitHub Pages. Submit the links to your deployment and your GitHub repo. * Ensure your repository has regular commits (i.e. 20+ commits) and a thorough README.md file ## Hints * Use `console.log` inside of your JavaScript code to see what your data looks like at each step. * Refer to the [Plotly.js documentation](https://plot.ly/javascript/) when building the plots. ### About the Data <NAME>. et al.(2012) _A Jungle in There: Bacteria in Belly Buttons are Highly Diverse, but Predictable_. Retrieved from: [http://robdunnlab.com/projects/belly-button-biodiversity/results-and-data/](http://robdunnlab.com/projects/belly-button-biodiversity/results-and-data/) - - - © 2019 Trilogy Education Services <file_sep>// from data.js var tableData = data; // Select the button var button = d3.select("#filter-btn"); // Create event handlers button.on("click", runEnter); // YOUR CODE HERE! // Get a reference to the table body var tbody = d3.select("tbody"); // Console.log the weather data from data.js console.log(tableData); // Step 1: Loop Through `data` and console.log each weather report object function createTable(currentData){ tbody.html(""); currentData.forEach(function(RC){ console.log(RC) var row = tbody.append('tr'); Object.entries(RC).forEach(function ([x,y] ) { console.log(`x is ${x} y is ${y}`) row.append('td').text(y); }) }); } createTable(tableData) function runEnter() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElement = d3.select("#datetime"); console.log(inputElement); // Get the value property of the input element var inputValue = inputElement.property("value"); console.log(inputValue); console.log(tableData); var filteredData = tableData.filter(tableData => tableData.datetime === inputValue); console.log(filteredData); createTable(filteredData) };<file_sep>// this loads the list of availible IDs and places them in the dropdown in the HTML d3.json('samples.json').then(function(data) { var sampleNames = data.names; d3.select('#selDataset').selectAll('option').data(sampleNames) .enter().append('option').html(function (m) { return` ${m} ` }) var firstSample = sampleNames[0]; return firstSample; }); // This function loads the correct data and creates the bar graph function reload(ID) { d3.json('samples.json').then(function(dbar) { function barFilter (num) {return num.id == ID} var barResults = dbar.samples.filter(barFilter) var values = barResults[0].sample_values var idnames = barResults[0].otu_ids.map(function (i) {return `OTU ${i}`}) var label = barResults[0].otu_labels trace = { y : idnames.slice(0, 10).reverse(), x : values.slice(0, 10).reverse(), text : label.slice(0, 10).reverse(), type: 'bar', orientation : 'h' }; var barData = [trace] var layout = { title: 'Top 10 Samples' }; Plotly.newPlot('bar' , barData , layout); // Begins the bubble graph reloadBuble(ID , barResults , values , label) // Triggers the Demographic info to load reloadinfo(ID,dbar) }) } // This generates the bubble graph function reloadBuble(ID , bubbleResults , values , label ){ var idNumber = bubbleResults[0].otu_ids var trace1 = { x : idNumber, y : values , text: label, type : "scatter", mode : 'markers', marker : { color: idNumber, colorscale: [[0, 'rgb(0,0,255)'], [1, 'rgb(165,42,42)']], cmin: d3.min(idNumber), cmax: d3.max(idNumber), size : values } }; var data1 = [trace1]; var layout1 = { showlegend: false, xaxis: { title: "OTU ID"}, height: 600, width: 1200 } Plotly.newPlot('bubble' , data1 , layout1) }; // Generates the demographic info function reloadinfo (ID , data){ function barFilter (num) {return num.id == ID} var infoResults = data.metadata.filter(barFilter) var values = infoResults[0] var ul = d3.select('#sample-metadata').html("") Object.entries(values).forEach( ([key,value]) => { ul.append('p').text(`${key}: ${value}`) }) var data1 = [ { domain: {x: [0, 1], y: [0, 1]}, value: values.wfreq, title: {text: "Belly Button Washing Frequency Scrubs Per Week", font: {size: 14}}, type: "indicator", mode: "gauge+number+delta", delta: {reference: 0, increasing: {color: "green"}}, gauge: {axis: {range: [0, 9]}, steps: [{range: [0, 5], color: "lightgray"}, {range: [5, 8], color: "gray"}], threshold: {line: {color: "red", width: 4}, thickness: 0.75, value: 9}}}]; var gaugeLayout = {width: 400, height: 500, margin: {t: 0, b: 0}}; Plotly.newPlot("gauge", data1, gaugeLayout); }; // Triggers the chain of reload functions function optionChanged () { id = d3.select('#selDataset').property('value'); reload(id) return id }; function init(firstSample) { reload("940"); }; init();<file_sep>import os import csv csvpath = os.path.join("Resources","budget_data.csv") with open(csvpath) as csvfile: readableFile=csv.reader(csvfile) csvHeader=next(readableFile) firstRow = next(readableFile) previousPL=int(firstRow[1]) totalDelta=0 totalRowsForAverage=0 totalMonths=1 TotalPL = int(firstRow[1]) Max_Increase_In_Profit_Amount= int(firstRow[1]) Max_Increase_In_Loss_Amount=int(firstRow[1]) Max_Increase_In_Profit_Month=firstRow[0] Max_Increase_In_Loss_Month=firstRow[0] for row in readableFile: Annual_Delta = int(int(row[1])-int(previousPL)) totalDelta = int(totalDelta) + Annual_Delta totalRowsForAverage=totalRowsForAverage+1 if Annual_Delta > int(Max_Increase_In_Profit_Amount): Max_Increase_In_Profit_Amount = int(Annual_Delta) Max_Increase_In_Profit_Month = row[0] if int(Annual_Delta) < int(Max_Increase_In_Loss_Amount): Max_Increase_In_Loss_Amount = int(Annual_Delta) Max_Increase_In_Loss_Month = row[0] previousPL = int(row[1]) totalMonths = totalMonths + 1 TotalPL = TotalPL + int(row[1]) print("Financial Analysis") print("----------------------------") print("Total Months: ", totalMonths) print("Total: $", TotalPL) print("Average Change: $", round((totalDelta/totalRowsForAverage),2)) print("Greatest Increase in Profits: ", Max_Increase_In_Profit_Month, " ($",Max_Increase_In_Profit_Amount,")") print("Greatest Decrease in Profits: ", Max_Increase_In_Loss_Month, " ($",Max_Increase_In_Loss_Amount,")") pathToWriteFile=os.path.join("Analysis","output.txt") write_file=open(pathToWriteFile, 'w+') write_file.write(str("Financial Analysis"+'\n')) write_file.write(str("----------------------------"+'\n')) write_file.write("Total Months: " +str(totalMonths)+'\n') write_file.write("Total: $" +str(TotalPL)+'\n') write_file.write("Average Change: $" +str(round((totalDelta/totalRowsForAverage),2))+'\n') write_file.write("Greatest Increase in Profits: " +str(Max_Increase_In_Profit_Month) +str(" ($") +str(Max_Increase_In_Profit_Amount) +str(")")+'\n') write_file.write("Greatest Decrease in Profits: " +str(Max_Increase_In_Loss_Month) +str(" ($") +str(Max_Increase_In_Loss_Amount) +str(")")+'\n')<file_sep># OpenWeatherMap API Key weather_api_key = "YOUR KEY IN HERE!" # Google API Key g_key = "YOUR KEY IN HERE!" <file_sep>// API key const API_KEY = "<KEY>"; <file_sep>import pandas as pd from bs4 import BeautifulSoup import requests import pymongo from splinter import Browser import time import re def scrape(): executable_path = {'executable_path': r'C:\Users\rafae\Downloads\chromedriver_win32\chromedriver.exe'} browser = Browser('chrome', **executable_path, headless=False) url = 'https://mars.nasa.gov/news' browser.visit(url) html = browser.html time.sleep(2) soup = BeautifulSoup(html, 'html.parser') time.sleep(2) #slides = soup.select_one('ul.item_list li.slide') slides22 = soup.select_one('ul.item_list li.slide') time.sleep(2) slides = slides22.find("div", class_="content_title").get_text() #news_title = soup.find_all("div", class_="content_title") slides23 = soup.select_one('ul.item_list li.slide') time.sleep(2) slides2 = slides23.find("div", class_="article_teaser_body").get_text() url2 = 'https://jpl.nasa.gov/images' browser.visit(url2) slides3 = browser.find_by_id("full_image") slides3.click() more_info_element = browser.links.find_by_partial_text('more info') more_info_element.click() html = browser.html img_soup = BeautifulSoup(html, 'html.parser') img_soup image = img_soup.select_one('figure.lede a img') img_url = image.get("src") img_url = 'https://jpl.nasa.gov' + img_url img_url url3 = 'https://twitter.com/marswxreport?lang=en' browser.visit(url3) time.sleep(3) html3 = browser.html soup3 = BeautifulSoup(html3, 'html.parser') time.sleep(3) tweets=soup3.find_all("span",text=re.compile('InSight sol')) time.sleep(3) latestweather = tweets[0].get_text() url_facts = 'https://space-facts.com/mars/' browser.visit(url_facts) time.sleep(3) tables = pd.read_html(url_facts) mars_facts = tables[0] time.sleep(1) mars_facts = mars_facts.to_html() cerberus_url = "https://astrogeology.usgs.gov/search/map/Mars/Viking/cerberus_enhanced" browser.visit(cerberus_url) time.sleep(1) # Scrape page into Soup html = browser.html soup = BeautifulSoup(html, "html.parser") # Get featured image URL cerberus = soup.select_one('div.downloads a')['href'] schiaparelli_url = "https://astrogeology.usgs.gov/search/map/Mars/Viking/schiaparelli_enhanced" browser.visit(schiaparelli_url) time.sleep(1) # Scrape page into Soup html = browser.html soup = BeautifulSoup(html, "html.parser") # Get featured image URL schiaparelli = soup.select_one('div.downloads a')['href'] syrtis_url = "https://astrogeology.usgs.gov/search/map/Mars/Viking/syrtis_major_enhanced" browser.visit(syrtis_url) time.sleep(1) # Scrape page into Soup html = browser.html soup = BeautifulSoup(html, "html.parser") # Get featured image URL syrtis = soup.select_one('div.downloads a')['href'] valles_url = "https://astrogeology.usgs.gov/search/map/Mars/Viking/valles_marineris_enhanced" browser.visit(valles_url) time.sleep(1) # Scrape page into Soup html = browser.html soup = BeautifulSoup(html, "html.parser") # Get featured image URL valles = soup.select_one('div.downloads a')['href'] hemisphere_image_urls = [ {"title": "Valles Marineris Hemisphere", "img_url": valles}, {"title": "Cerberus Hemisphere", "img_url": cerberus}, {"title": "Schiaparelli Hemisphere", "img_url": schiaparelli}, {"title": "Syrtis Major Hemisphere", "img_url": syrtis}] data = { 'title' : slides, 'subtitle': slides2, 'image' : img_url, 'weather' : latestweather, 'table' : mars_facts, 'imageUrls': hemisphere_image_urls } browser.quit() return data<file_sep>Attribute VB_Name = "Module2" Sub Stock_Data_Analyzer() For Each ws In Worksheets ws.Cells(1, 9).Value = "Ticker" ws.Cells(1, 10).Value = "Yearly Change" ws.Cells(1, 11).Value = "Percent Change" ws.Cells(1, 12).Value = "Total Stock Volume" ws.Cells(1, 9).WrapText = True ws.Cells(1, 10).WrapText = True ws.Cells(1, 11).WrapText = True ws.Cells(1, 12).WrapText = True ws.Cells(1, 9).Font.Bold = True ws.Cells(1, 10).Font.Bold = True ws.Cells(1, 11).Font.Bold = True ws.Cells(1, 12).Font.Bold = True ws.Cells(1, 9).Font.Underline = True ws.Cells(1, 10).Font.Underline = True ws.Cells(1, 11).Font.Underline = True ws.Cells(1, 12).Font.Underline = True Dim openStock As Double Dim closeStock As Double Dim Ticker As String Dim OutputRow As String Dim Total_Volume As Double OutputRow = 2 Total_Volume = 0 Dim lastRow As Long lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row Ticker = ws.Cells(2, 1).Value openStock = ws.Cells(2, 3).Value For i = 2 To lastRow If (Ticker <> ws.Cells(i, 1).Value) Then closeStock = ws.Cells(i - 1, 6).Value ws.Cells(OutputRow, 10).Value = closeStock - openStock If ws.Cells(OutputRow, 10).Value >= 0 Then ws.Cells(OutputRow, 10).Interior.ColorIndex = 4 Else ws.Cells(OutputRow, 10).Interior.ColorIndex = 3 End If ws.Cells(OutputRow, 10).NumberFormat = "#,##0.00;-#,##0.00" ws.Cells(OutputRow, 9).Value = Ticker If openStock <> 0 Then ws.Cells(OutputRow, 11).Value = (closeStock - openStock) / openStock ws.Cells(OutputRow, 11).NumberFormat = "0.00%;[red]-0.00%" End If ws.Cells(OutputRow, 12).Value = Total_Volume ws.Cells(OutputRow, 12).NumberFormat = "#,##" Ticker = ws.Cells(i, 1).Value openStock = ws.Cells(i, 3).Value OutputRow = OutputRow + 1 Total_Volume = ws.Cells(i, 7).Value ElseIf (Ticker = ws.Cells(i, 1).Value) Then Total_Volume = Total_Volume + ws.Cells(i, 7).Value End If Next i ws.Cells(1, 15).Value = "Ticker" ws.Cells(1, 16).Value = "Value By Iteration" ws.Cells(1, 17).Value = "Value By Formula" ws.Cells(2, 14).Value = "Greatest % Increase" ws.Cells(3, 14).Value = "Greatest % Decrease" ws.Cells(4, 14).Value = "Greatest Total Volume" ws.Cells(2, 17).Value = WorksheetFunction.Max(ws.Range("K2:K" & OutputRow)) ws.Cells(2, 17).NumberFormat = "0.00%;[red]-0.00%" ws.Cells(3, 17).Value = WorksheetFunction.Min(ws.Range("K2:K" & OutputRow)) ws.Cells(3, 17).NumberFormat = "0.00%;[red]-0.00%" ws.Cells(4, 17).Value = WorksheetFunction.Max(ws.Range("L2:L" & OutputRow)) ws.Cells(4, 17).NumberFormat = "#,##" ws.Cells(1, 15).WrapText = True ws.Cells(1, 16).WrapText = True ws.Cells(1, 17).WrapText = True ws.Cells(1, 15).Font.Bold = True ws.Cells(1, 16).Font.Bold = True ws.Cells(1, 17).Font.Bold = True ws.Cells(1, 15).Font.Underline = True ws.Cells(1, 16).Font.Underline = True ws.Cells(1, 17).Font.Underline = True ws.Cells(4, 14).EntireColumn.ColumnWidth = 18.75 Dim Ticker_Max_Increase As String Dim Ticker_Max_Decrease As String Dim Ticker_Max_Volume As String Dim Max_Increase As Double Dim Max_Decrease As Double Dim Max_Volume As Double Ticker_Max_Increase = ws.Cells(2, 9).Value Max_Increase = ws.Cells(2, 11).Value Ticker_Max_Decrease = ws.Cells(2, 9).Value Max_Decrease = ws.Cells(2, 11).Value Ticker_Max_Volume = ws.Cells(2, 9).Value Max_Volume = ws.Cells(2, 12).Value For t = 3 To OutputRow If (ws.Cells(t, 11).Value > Max_Increase) Then Max_Increase = ws.Cells(t, 11).Value Ticker_Max_Increase = ws.Cells(t, 9).Value End If If (ws.Cells(t, 11).Value < Max_Decrease) Then Max_Decrease = ws.Cells(t, 11).Value Ticker_Max_Decrease = ws.Cells(t, 9).Value End If If (ws.Cells(t, 12).Value > Max_Volume) Then Max_Volume = ws.Cells(t, 12).Value Ticker_Max_Volume = ws.Cells(t, 9).Value End If Next t ws.Cells(2, 15).Value = Ticker_Max_Increase ws.Cells(3, 15).Value = Ticker_Max_Decrease ws.Cells(4, 15).Value = Ticker_Max_Volume ws.Cells(2, 16).Value = Max_Increase ws.Cells(2, 16).NumberFormat = "0.00%;[red]-0.00%" ws.Cells(3, 16).Value = Max_Decrease ws.Cells(3, 16).NumberFormat = "0.00%;[red]-0.00%" ws.Cells(4, 16).Value = Max_Volume ws.Cells(4, 16).NumberFormat = "#,##" Next ws End Sub <file_sep>from flask import Flask, jsonify import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import numpy as np import datetime as dt # create engine engine = create_engine('sqlite:///hawaii.sqlite') Base = automap_base() Base.prepare(engine, reflect = True) Measurement = Base.classes.measurement Station = Base.classes.station session = Session(engine) # step 1: app = Flask(__name__) @app.route("/") def helloWorld(): # urls that tell the user the end points that are available return ("Hello World<br>" f"These are the available pages:<br>" f"/precipitation<br>" f"/stations<br>" f"/tobs<br>" f"/start date as YYYY-MM-DD <br>" f"/start date as YYYY-MM-DD/end date as YYYY-MM-DD<br>") @app.route("/precipitation") def precipitation(): # create our session link from Python to the DB session = Session(engine) lastdayInDB=dt.date(2017,8,23) lastdayminusOneYear = lastdayInDB - dt.timedelta(days=365) lastyearsResults = session.query(Measurement.date, Measurement.prcp).filter(Measurement.date >= lastdayminusOneYear).all() print(lastyearsResults) session.close() # convert the query results to a dictionary using 'date' as the key and 'prcp' as the value. # return the JSON representation of your dictionary results = [] for date, prcp in lastyearsResults: result_dict = {} result_dict[date] = prcp results.append(result_dict) return jsonify(results) @app.route("/stations") def stations(): session = Session(engine) # return a list of all the stations in JSON format listOfStations = session.query(Station.station).all() session.close() stationOneDimension = list(np.ravel(listOfStations)) return jsonify(stationOneDimension) @app.route("/tobs") def tobs(): session = Session(engine) lastdayInDB=dt.date(2017,8,23) lastdayminusOneYear = lastdayInDB - dt.timedelta(days=365) # Find the most active station mostactivestation = session.query(Measurement.station).group_by(Measurement.station).order_by(func.count().desc()).first() # Get the station id of the most active station (mostactivestationid, ) = mostactivestation print(f"The station id of the most active station is {mostactivestation}.") # Query to retrieve the temperatures fro the most active station from the last year lastyearResults = session.query(Measurement.date, Measurement.tobs).filter(Measurement.station == mostactivestationid).\ filter(Measurement.date >= lastdayminusOneYear).all() session.close() # Convert the query result to a dictionary using date as the key and temperature as the value temperatures = [] for date, temp in lastyearResults: if temp != None: temp_dict = {} temp_dict[date] = temp temperatures.append(temp_dict) # Return the JSON representation of dictionary return jsonify(temperatures) @app.route('/<start>', defaults={'end': None}) @app.route('/<start>/<end>') def findtemperaturesfordaterange(start, end): # Return a JSON list of the minimum temperature, the average temperature, and the maximum temperature for a give date range # When given the start date only, calculate TMIN, TAVG, and TMAX for all the dates greater than or equal to the start date. # When given the start and end dates, calculate the TMIN, TAVG, and TMAX for the dates between the start and end dates inclusive session = Session(engine) # if both a start date and end date are known if end != None: temperatures = session.query(func.min(Measurement.tobs), func.avg(Measurement.tobs), func.max(Measurement.tobs)).\ filter(Measurement.date >= start).filter(Measurement.date <= end).all() # If only the start date is known else: temperatures = session.query(func.min(Measurement.tobs), func.avg(Measurement.tobs), func.max(Measurement.tobs)).\ filter(Measurement.date >= start).all() session.close() # Convert the queries results to lists temperatures_list = [] no_temperature_data = False for min_temp, avg_temp, max_temp in temperatures: if min_temp == None or avg_temp == None or max_temp == None: no_temperature_data = True temperatures_list.append(min_temp) temperatures_list.append(avg_temp) temperatures_list.append(max_temp) # Return the JSON representation of the temperature dictionary if no_temperature_data == True: return f"No temperature data found for the given date range. Try another date range." else: return jsonify(temperatures_list) #2nd step: if __name__ == '__main__': app.run()<file_sep>SELECT employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary FROM salaries INNER JOIN employees ON employees.emp_no = salaries.emp_no ORDER BY emp_no; SELECT first_name, last_name, hire_date FROM employees WHERE hire_date BETWEEN '1986-01-01' AND '1986-12-31' ORDER BY emp_no; SELECT departments.dept_no, departments.dept_name, dept_manager.emp_no, employees.last_name, employees.first_name FROM departments JOIN dept_manager ON (dept_manager.dept_no = departments.dept_no) JOIN employees ON (dept_manager.emp_no = employees.emp_no); SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name FROM employees JOIN dept_emp ON (dept_emp.emp_no = employees.emp_no) JOIN departments ON (dept_emp.dept_no = departments.dept_no) ORDER BY emp_no; SELECT first_name, last_name, sex FROM employees WHERE (first_name = 'Hercules') AND (last_name LIKE 'B%'); SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name FROM employees JOIN dept_emp ON (dept_emp.emp_no = employees.emp_no) JOIN departments ON (dept_emp.dept_no = departments.dept_no) WHERE dept_name = 'Sales'; SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name FROM employees JOIN dept_emp ON (dept_emp.emp_no = employees.emp_no) JOIN departments ON (dept_emp.dept_no = departments.dept_no) WHERE dept_name = 'Sales' OR dept_name = 'Development'; SELECT last_name, COUNT(last_name) FROM employees GROUP BY last_name ORDER BY COUNT(last_name) DESC;<file_sep>This is for the Web Scraping Challenge. The app.py file opens up the web browser and when user presses the scrape new data button, then the scrape_mars.py file does the scraping. The results are saved to a Mongo database and the results are presented in the web browser using the index.html file. I have included screen captures to verify it worked at the time of the scraping. Since the information being scraped changes, I cannot guarantee that in the future the files will work seemlessly. <file_sep>// from data.js var tableData = data; // Select the button var button = d3.select("#filter-btn"); var button2 = d3.select("#filter-btn2"); var button3 = d3.select("#filter-btn3"); var button4 = d3.select("#reset-btn"); // Create event handlers button.on("click", runEnter); // button.on("click", radioChosen); button2.on("click", runStateOrProvince); button3.on("click", runCitySearch); button4.on("click", runReset); // YOUR CODE HERE! // Get a reference to the table body var tbody = d3.select("tbody"); // Console.log the weather data from data.js console.log(tableData); // Step 1: Loop Through `data` and console.log each weather report object function createTable(currentData){ tbody.html(""); currentData.forEach(function(RC){ console.log(RC) var row = tbody.append('tr'); Object.entries(RC).forEach(function ([x,y] ) { console.log(`x is ${x} y is ${y}`) row.append('td').text(y); }) }); } createTable(tableData) function runEnter() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElement = d3.select("#datetime"); console.log(inputElement); // Get the value property of the input element var inputValue = inputElement.property("value"); console.log(inputValue); console.log(tableData); var filteredData = tableData.filter(tableData => tableData.datetime === inputValue); console.log(filteredData); createTable(filteredData) }; function order(){ // Get variables var chkus = document.getElementById("chkus"); var chkca = document.getElementById("chkca"); var output = document.getElementById("output"); var result = "<ul> " if (chkus.checked){ result += "<li>" + chkus.value + "</li> "; } // end if if (chkca.checked){ result += "<li>" + chkca.value + "</li> "; } // end if result += "</ul> " output.innerHTML = result; // filtering table based on country or countries chosen or not chosen if (chkus.checked && chkca.checked) { createTable(tableData); } else if (chkus.checked) { // inputCountry = "us"; var filteredData = tableData.filter(tableData => tableData.country === "us"); createTable(filteredData); // radioChosen(inputCountry); return; } else if (chkca.checked) { // inputCountry = "ca"; var filteredData = tableData.filter(tableData => tableData.country === "ca"); createTable(filteredData); // radioChosen(inputCountry); return; } else tbody.html(""); } // end function function radioChosen() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputRadio = d3.select("#country"); console.log(inputRadio); // Get the value property of the input element var inputValue = inputRadio.property("value"); console.log(inputValue); console.log(tableData); var filteredData = tableData.filter(tableData => tableData.country === inputCountry); console.log(filteredData); createTable(filteredData) }; /* $("input[type=radio]").change(function(){ var filter = this.value; if (filter == "All") $("tr.dataRow").css("visibility", "visible"); else $("tr.dataRow").css("visibility", "collapse"); var matchFound = false; $("tr.dataRow").find("td").each(function() { $this = $(this); if (!matchFound){ if ($this.html() == filter){ matchFound = true; $this.parent().css("visibility", "visible"); } } }); }); */ function runStateOrProvince() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElement = d3.select("#state"); console.log(inputElement); // Get the value property of the input element var inputValue = inputElement.property("value").toLowerCase().trim(); console.log(inputValue); console.log(tableData); var filteredData = tableData.filter(tableData => tableData.state === inputValue); console.log(filteredData); createTable(filteredData) }; function runCitySearch() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElement = d3.select("#city"); console.log(inputElement); // Get the value property of the input element var inputValue = inputElement.property("value").toLowerCase().trim(); console.log(inputValue); console.log(tableData); var filteredData = tableData.filter(tableData => tableData.city === inputValue); console.log(filteredData); createTable(filteredData) }; function runReset() { d3.event.preventDefault(); tbody.html(""); createTable(tableData) };
bd99ee3f588b288d180ed93d29705f65a1a4e60c
[ "Markdown", "SQL", "VBScript", "JavaScript", "Python" ]
15
Markdown
RafaelCespedes1/Data-Analytics-Boot-Camp
89c3d02a37a8ab3bbc5a1dd08e70815cdc44f2fd
2f1e5de73188097faa2b7b5124b8201e1d8686f4
refs/heads/master
<file_sep>$.ajax({ url: 'https://toloka.yandex.ru/api/task-suite-pools', type: 'GET', crossDomain: true, success: function(data) { console.log(data); if (jQuery.isEmptyObject(data)) { console.log("No tasks"); $("#result").append('<strong>Нет заданий</strong>'); } else { console.log(data.tec); if(data.tec.length > 2) { $("#result").append('<strong>У тебя есть задания!!!</strong>'); alert("У тебя есть задания!!!"); console.log("Your have a tasks") } } }, error: function(e) { console.log("Not works"); $("#result").append('<strong>Ошибка! Авторизируйся на toloka.yandex.ru</strong>'); }, beforeSend: function (xhr) { xhr.setRequestHeader('Content-Type', "application/json; charset=UTF-8") xhr.setRequestHeader('Access-Control-Allow-Origin' , "*"); } });
adc9bd70273a5f95f8d4ede7c80b086f198e6e0c
[ "JavaScript" ]
1
JavaScript
edlvj/toloka
f0b2c084f663c07b1eddf85885e56e14a03d9236
d8912241bb94d1907b8c44eba2ed41beb71eabe1
refs/heads/master
<repo_name>LoManer/SpringMvc_PageHelper<file_sep>/README.md # SpringMvc_PageHelper 简单的spring+springmvc+mybatis+pageHelper
c9097fdcbaffde577eb4deb8aae52cac434ef824
[ "Markdown" ]
1
Markdown
LoManer/SpringMvc_PageHelper
3ca9b884dbdf7d30281f77881996ccffc140ffd9
fb63138845efcca4a29f6a7653343c43294eb6c3
refs/heads/master
<file_sep># hello-world This is a test of first commit.
e68caf9ecb5ec870a373954f7c191e3c7fc8e6f8
[ "Markdown" ]
1
Markdown
lucasyuan07/hello-world
00a138151412386942e0cda0935d9ea67f1dd2aa
bf303d33bb308b026562fa1d1e54b717b97b6bec
refs/heads/master
<repo_name>chavita1386/UareU-C-Sharp<file_sep>/Enroll.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using DPUruNet; using System.Threading; using System.Data.SqlClient; using System.Drawing.Imaging; namespace UareUWindowsMSSQLCSharp { public partial class Enroll : Form { private Reader reader; private bool reset = false; private int fingerindex;//indexfinger private int count; private List<Fmd> preEnrollmentFmd; private DataResult<Fmd> enrollmentFmd, fmd1, fmd2; public Form_Main _sender; public Enroll() { InitializeComponent(); } private void InitializeReaders() { ReaderCollection rc = ReaderCollection.GetReaders(); if (rc.Count == 0) { //UpdateEnrollMessage("Fingerprint Reader not found. Please check if reader is plugged in and try again", null); MessageBox.Show("Fingerprint Reader not found. Please check if reader is plugged in and try again"); } else { reader = rc[0]; Constants.ResultCode readersResult = reader.Open(Constants.CapturePriority.DP_PRIORITY_COOPERATIVE); } } private void Enroll_Load(object sender, EventArgs e) { InitializeReaders(); try { Constants.ResultCode result = reader.GetStatus(); if (result == Constants.ResultCode.DP_SUCCESS) { StartEnrollment(result); } else MessageBox.Show("Reader status is:" + result); } catch(Exception ex) { MessageBox.Show(ex.Message); } } private void StartEnrollment(Constants.ResultCode readerResult) { fingerindex = 0; preEnrollmentFmd = new List<Fmd>(); CheckReaderStatus(); if (readerResult == Constants.ResultCode.DP_SUCCESS) { reader.On_Captured += new Reader.CaptureCallback(reader_On_Captured); EnrollmentCapture(); } else { messagelbl.Text = "Could not perform capture. Reader result code :" + readerResult.ToString(); } } private void EnrollmentCapture() { count =0; Constants.ResultCode captureResult = reader.CaptureAsync(Constants.Formats.Fid.ANSI, Constants.CaptureProcessing.DP_IMG_PROC_DEFAULT, reader.Capabilities.Resolutions[0]); if (captureResult != Constants.ResultCode.DP_SUCCESS) { MessageBox.Show("CaptureResult: " + captureResult.ToString()); } } void reader_On_Captured(CaptureResult capResult) { if (capResult.Quality == Constants.CaptureQuality.DP_QUALITY_GOOD) { count++; DataResult<Fmd> fmd = FeatureExtraction.CreateFmdFromFid(capResult.Data, Constants.Formats.Fmd.DP_PRE_REGISTRATION); // Get view bytes to create bitmap. foreach (Fid.Fiv fiv in capResult.Data.Views) { //Ask user to press finger to get fingerprint UpdateEnrollMessage("Click save button to save fingerprint", HelperFunctions.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height)); break; } //preEnrollmentFmd.Add(fmd.Data); //enrollmentFmd = DPUruNet.Enrollment.CreateEnrollmentFmd(Constants.Formats.Fmd.DP_REGISTRATION, preEnrollmentFmd); ////if (enrollmentFmd.ResultCode == Constants.ResultCode.DP_SUCCESS) //{ // if (fingerindex == 0) // { // fmd1 = enrollmentFmd; // fingerindex++; // count = 0; // preEnrollmentFmd.Clear(); // UpdateEnrollMessage("Please swipe 2nd finger", null); // } // else if (fingerindex == 1) // { // fmd2 = enrollmentFmd; // preEnrollmentFmd.Clear(); // UpdateEnrollMessage("User " + userIDTb.Text.ToString() + " Successfully Enrolled!", null); // string userid = userIDTb.Text.ToString(); // HelperFunctions.updateFMDUserIDList(fmd1.Data, fmd2.Data, userid); // if (!CheckIfUserExists()) // { // SaveEnrolledFmd(userIDTb.Text.ToString(), Fmd.SerializeXml(fmd1.Data), Fmd.SerializeXml(fmd2.Data)); // } // } // } } } private bool CheckIfUserExists() { bool userExists = false; string query = "select * from Users where UserID = '" + userIDTb.Text.ToString() + "'"; SqlDataReader dataReader = HelperFunctions.ConnectDBnExecuteSelectScript(query); DataTable dt = new DataTable(); dt.Load(dataReader); if (dt.Rows.Count != 0) { userExists = true; } else { userExists = false; } return userExists; dataReader.Close(); } public void SaveEnrolledFmd(string userName, string xmlFMD1, string xmlFMD2) { string saveFmdScript = "Insert into Users values ('" + userName + "', '" + xmlFMD1 + "', '" + xmlFMD2 + "' )"; // Save user and his relative FMD into database HelperFunctions.ConnectDBnExecuteScript(saveFmdScript); } delegate void UpdateEnrollMessageCallback(string text1, Bitmap image); private void UpdateEnrollMessage(string text, Bitmap image) { if (this.messagelbl.InvokeRequired) { UpdateEnrollMessageCallback callBack = new UpdateEnrollMessageCallback(UpdateEnrollMessage); this.Invoke(callBack, new object[] { text, image }); } else { messagelbl.Text = text; if (image != null) { enrollPicBox.Image = image; enrollPicBox.Refresh(); } } } public void CancelCaptureAndCloseReader() { if (reader != null) { reader.CancelCapture(); reader.Dispose(); } } public void CheckReaderStatus() { //If reader is busy, sleep if (reader.Status.Status == Constants.ReaderStatuses.DP_STATUS_BUSY) { Thread.Sleep(50); } else if ((reader.Status.Status == Constants.ReaderStatuses.DP_STATUS_NEED_CALIBRATION)) { reader.Calibrate(); } else if ((reader.Status.Status != Constants.ReaderStatuses.DP_STATUS_READY)) { throw new Exception("Reader Status - " + reader.Status.Status); } } private void Enroll_FormClosed(object sender, FormClosedEventArgs e) { CancelCaptureAndCloseReader(); } private void sacwebmp_Click(object sender, EventArgs e) { if (enrollPicBox.Image != null) { saveFileDialog1.Filter = "Bitmap Files (*.bmp)|*.bmp"; saveFileDialog1.Title = "Save fingerprint as"; string filename = (saveFileDialog1.ShowDialog() == DialogResult.Cancel) ? "" : saveFileDialog1.FileName; if (filename != "") enrollPicBox.Image.Save(filename, ImageFormat.Bmp); } } } } <file_sep>/LEDControl.cs namespace DPUruNet { class LEDControl { /*For 5160 and 5100 module LED Main is the background light. LED REJECT is the surface red light. LED ACCEPT is the surface green light. LED FINGER_DETECT is the runner (side) blue lights */ public enum LED { MAIN=1, REJECT=4, ACCEPT=8, FINGER_DETECT=16}; public enum LED_CMD { OFF=0, ON }; public enum LED_MODE { AUTO = 1, CLIENT }; //CLIENT mode allows the client application to override default LED behavior [DllImport("dpfpdd.dll")] private static extern int dpfpdd_led_config(IntPtr devHandle, LED led, LED_MODE led_mode, IntPtr reserved); [DllImport("dpfpdd.dll")] private static extern int dpfpdd_led_ctrl(IntPtr devHandle, LED led_id, LED_CMD led_cmd); //Must be called to get device handle to control the LEDs (this must be coupled with a ReleaseReaderHandle) public static IntPtr GetReaderHandle(DPUruNet.Reader reader) { //We must use reflection here to get the private device handle BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; FieldInfo field = reader.GetType().GetField("m_handle", flags); System.Runtime.InteropServices.SafeHandle privateHandle = (System.Runtime.InteropServices.SafeHandle)field.GetValue(reader); Boolean bSuccess = false; if (privateHandle != null) privateHandle.DangerousAddRef(ref bSuccess); //increment the reference counter for the reader\device handle if (bSuccess) return privateHandle.DangerousGetHandle(); //return the handle to the caller else return IntPtr.Zero; } //Must be called before controlling the LEDs. public static int Configure(IntPtr devHandle, LED led, LED_MODE mode) { return dpfpdd_led_config(devHandle, led, mode, IntPtr.Zero); } //Allows the changing of the LED state public static int Toggle(IntPtr devHandle, LED led, LED_CMD command) { return dpfpdd_led_ctrl(devHandle, led, command); } //Release the device handle counter. Must be called for every GetReaderHandle to prevent resource leak. public static void ReleaseReaderHandle(DPUruNet.Reader reader) { BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; FieldInfo field = reader.GetType().GetField("m_handle", flags); System.Runtime.InteropServices.SafeHandle privateHandle = (System.Runtime.InteropServices.SafeHandle)field.GetValue(reader); if (privateHandle != null && !privateHandle.IsInvalid && !privateHandle.IsClosed) { privateHandle.DangerousRelease(); //decrement the device handle counter so the reader can be freed } } } } <file_sep>/Form_Main.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; using DPUruNet; namespace UareUWindowsMSSQLCSharp { public partial class Form_Main : Form { private Reader reader; public Reader GetReader { get { return reader; } } public Form_Main() { InitializeComponent(); CheckReaderPluggedin(); //Load all users from database to use in identify function. This data being //considerably large we would want to load this once at the statrtup of //application // HelperFunctions.LoadAllUsers(); } private void CheckReaderPluggedin() { ReaderCollection rc = ReaderCollection.GetReaders(); //If reader count is zero, inform user if (rc.Count == 0) { readerNotFoundlbl.Visible = true; } } private void enrollbtn_Click(object sender, EventArgs e) { // Launch EnrollForm Enroll enrollForm = new Enroll(); enrollForm._sender = this; enrollForm.ShowDialog(); } private void verifybtn_Click(object sender, EventArgs e) { //Launch VerifyForm Verify verify = new Verify(); verify._sender = this; verify.ShowDialog(); } } }
222c42a58759a6dff9fe7a58670e1afb808cf7e4
[ "C#" ]
3
C#
chavita1386/UareU-C-Sharp
7537ff46ca4d21181356c1595b85372ab7642961
bdd86cc4c5c4a2cefdcf3e6e0984014741ce52e6
refs/heads/master
<file_sep>from unittest import TestCase class TestDivisionByZero(TestCase): def divide_by_zero(self): return 7 / 0 def test_divide_by_zero(self): self.assertRaises(ZeroDivisionError, self.divide_by_zero) <file_sep>[tox] envlist = py{36,37}-django{20,21,22} [pep8] exclude = .git,.tox max-line-length = 120 [pytest] DJANGO_SETTINGS_MODULE = travis_integration.settings norecursedirs = .* [testenv] deps = django20: Django>=2.0,<2.1 django21: Django>=2.1,<2.2 django22: Django>=2.2,<2.3 -r{toxinidir}/requirements.txt -r{toxinidir}/test_requirements.txt commands = pytest {posargs} travis_integration/tests.py [testenv:quality] whitelist_externals = make rm touch deps = Django>=2.0,<2.3 travis_integration >=1.0 -r{toxinidir}/requirements.txt -r{toxinidir}/test_requirements.txt<file_sep># !/usr/bin/env python from setuptools import find_packages, setup import travis_integration setup( name='travis_integration', version=travis_integration.__version__, description='', author='aarif', url='', classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Framework :: Django', ], packages=find_packages(), install_requires=[ 'Django==2.2.18', 'pytz==2019.1', 'sqlparse==0.3.0' ] ) <file_sep># django-travis-integration [![Build Status](https://travis-ci.com/mraarif/django-travis-integration.svg?branch=master)](https://travis-ci.com/mraarif/django-travis-integration) A sample repository to demonstrate Travis CI integration with a Django project <file_sep>atomicwrites==1.3.0 attrs==19.1.0 filelock==3.0.12 importlib-metadata==0.18 more-itertools==7.1.0 packaging==19.0 pluggy==0.12.0 py pyparsing==2.4.0 pytest==5.0.1 pytest-django==3.5.1 six==1.12.0 toml==0.10.0 tox==3.13.2 virtualenv==16.6.2 wcwidth==0.1.7 zipp==0.5.2
f16cd3ed2e17e461366b89e4aa247f4d16396b1a
[ "Markdown", "Text", "INI", "Python" ]
5
Markdown
mraarif/django-travis-integration
fb4ae7fef9818666fa93eda91b001293f2aba343
9230fbe91c3524ac296c6d88a2987d3bbb1952e4
refs/heads/master
<repo_name>victorovgoncalves/AuraSouthAfricaIDSearcher<file_sep>/force-app/main/default/classes/searchSouthAfricaIdLControllerTest.cls /* Name: searchSouthAfricaIdLControllerTest Purpose: test all methods of searchSouthAfricaIdLController apex class Author: <NAME> Date: 2021-07-09 Change Log 2021/07/09 - <NAME> - searchSouthAfricaId() method created */ @isTest public class searchSouthAfricaIdLControllerTest { @isTest static void searchSouthAfricaId(){ Contact con1 = searchSouthAfricaIdLController.searchSouthAfricaIdNumber(decimal.valueOf('8101019999051'),'1981-01-01','Male','SA citizen'); Contact con2 = searchSouthAfricaIdLController.searchSouthAfricaIdNumber(decimal.valueOf('8101019999051'),'1981-01-01','Male','SA citizen'); Test.setMock(HttpCalloutMock.class, new holidaysCalloutMock()); Test.startTest(); Map<String,String> resultsJson = searchSouthAfricaIdLController.getRecordHolidaysByCallout(con2); Test.stopTest(); Map<Boolean,String> holidaysInsertResults = searchSouthAfricaIdLController.insertHolidayRecords('{"Name":"New Years Day","Description__c":"New Year’s Day is celebrated with a blend of both diversity and tradition in countries such as South Africa on January 1 each year.","Date__c":"1981-01-01","Type__c":"National holiday"}',con2); } }
4e2a84c85b1c70ea25bb90f592466655b48c8cfd
[ "Apex" ]
1
Apex
victorovgoncalves/AuraSouthAfricaIDSearcher
9817f16d85c19a1a1f91a8c8512aa9506f3f8bed
7707b3adde57c0c121d866877a35166e34821fc9
refs/heads/master
<file_sep># arthurHWA Practical task set by QA to develop a web application based on a personal hobby.
2f5f45c00b35adb926c76c167a2958cf93f49d11
[ "Markdown" ]
1
Markdown
Arthurraffs/arthurHWA
57728572ccd841c09fc69455b98ea7a6dde2c049
ac21958790ee7ead2f2e12c7adc5b5a106ea9bf9
refs/heads/master
<repo_name>tbengland/SMART<file_sep>/Documents/smart/smart.pro #------------------------------------------------- # # Project created by QtCreator 2016-01-20T15:53:26 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = smart TEMPLATE = app SOURCES += main.cpp\ smart.cpp HEADERS += smart.h FORMS += smart.ui <file_sep>/Documents/smart/smart.h #ifndef SMART_H #define SMART_H #include <QMainWindow> namespace Ui { class smart; } class smart : public QMainWindow { Q_OBJECT public: explicit smart(QWidget *parent = 0); ~smart(); private: Ui::smart *ui; }; #endif // SMART_H <file_sep>/Documents/smart/smart.cpp #include "smart.h" #include "ui_smart.h" #include<QTimer> #include<QDateTime> #include<QDate> smart::smart(QWidget *parent) : QMainWindow(parent), ui(new Ui::smart) { ui->setupUi(this); QMainWindow::showFullScreen(); } smart::~smart() { delete ui; }
8fdaa1759c89e4f4fbb898218a2dd06df1afdd85
[ "C++", "QMake" ]
3
C++
tbengland/SMART
bf77acbe83ef4597820e2f2d9e39f919c05cec5f
b14d65def900964fcee595e400aca98c1e67eabf
refs/heads/master
<repo_name>JoseAndresChoc96/Proyecto-Final<file_sep>/libros/forms.py from django import forms from .models import Libro, Autor, Clasificacion class AutorForm(forms.ModelForm): class Meta: model = Autor fields = ('nombre', 'apellido', 'genero', 'libros') def __init__ (self, *args, **kwargs): super(ClienteForm, self).__init__(*args, **kwargs) self.fields["libros"].widget = forms.widgets.CheckboxSelectMultiple() self.fields["libros"].help_text = "Ingrese Libros" self.fields["libros"].queryset = Libro.objects.all() class ClasificacionForm(forms.ModelForm): class Meta: model = Clasificacion fields = ('libro', 'autor') class LibroForm(forms.ModelForm): class Meta: model = Libro fields = ('nombre', 'editorial', 'precio', 'unidades') <file_sep>/libros/models.py from django.db import models from django.contrib import admin class Libro (models.Model): nombre = models.CharField(max_length=60) editorial = models.CharField(max_length=60) precio = models.DecimalField(max_digits=5, decimal_places=2) unidades = models.IntegerField() def __str__(self): return self.nombre class Autor (models.Model): nombre = models.CharField(max_length=50) apellido = models.CharField(max_length=50) genero = models.CharField(max_length=50) libros = models.ManyToManyField(Libro, through='Clasificacion') def __str__(self): return self.nombre class Clasificacion(models.Model): libro = models.ForeignKey(Libro, on_delete=models.CASCADE) autor = models.ForeignKey(Autor, on_delete=models.CASCADE) extra = 1 class ClasificacionInLine(admin.TabularInline): model = Clasificacion extra = 1 class AutorAdmin(admin.ModelAdmin): inlines = (ClasificacionInLine,) class LibroAdmin (admin.ModelAdmin): inlines = (ClasificacionInLine,) <file_sep>/libros/urls.py from django.conf.urls import url from django.urls import path from . import views urlpatterns = [ #url(r'^$', views.lista_peliculas, name ='lista_peliculas'), url(r'^clasificacion/nueva/$', views.clasificacion_nueva, name='clasificacion_nueva'), path('', views.clasificacion_lista, name='clasificacion_lista'), path('clasificacion/lista', views.clasificacion_lista, name='clasificacion_lista'), path('clasificacion/<int:pk>/editar/', views.clasificacion_editar, name='clasificacion_editar'), url(r'^clasificacion/(?P<pk>\d+)/remove/$', views.clasificacion_remove, name='clasificacion_remove'), path('clasificacion/<int:pk>/', views.clasificacion_detalle, name='clasificacion_detalle'), path('libro/lista', views.libro_lista, name='libro_lista'), url(r'^libro/nuevo/$', views.libro_nuevo, name='libro_nuevo'), path('libro/<int:pk>/editar/', views.libro_editar, name='libro_editar'), url(r'^libro/(?P<pk>\d+)/remove/$', views.libro_remove, name='libro_remove'), ] <file_sep>/libros/migrations/0001_initial.py # Generated by Django 2.1.3 on 2018-11-07 04:19 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Autor', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nombre', models.CharField(max_length=50)), ('apellido', models.CharField(max_length=50)), ('seudonimo', models.CharField(max_length=50)), ('genero', models.CharField(max_length=50)), ], ), migrations.CreateModel( name='Clasificacion', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('autor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='libros.Autor')), ], ), migrations.CreateModel( name='Libro', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nombre', models.CharField(max_length=60)), ('editorial', models.CharField(max_length=60)), ('precio', models.DecimalField(decimal_places=2, max_digits=5)), ('unidades', models.IntegerField()), ], ), migrations.AddField( model_name='clasificacion', name='libro', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='libros.Libro'), ), migrations.AddField( model_name='autor', name='libros', field=models.ManyToManyField(through='libros.Clasificacion', to='libros.Libro'), ), ] <file_sep>/libros/migrations/0002_remove_autor_seudonimo.py # Generated by Django 2.1.3 on 2018-11-07 08:37 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('libros', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='autor', name='seudonimo', ), ] <file_sep>/libros/views.py from django.shortcuts import render, get_object_or_404, redirect from django.contrib import messages from .forms import AutorForm, LibroForm, ClasificacionForm from libros.models import Libro, Clasificacion, Autor from django.contrib.auth.decorators import login_required @login_required def clasificacion_nueva(request): if request.method == "POST": formulario = AutorForm(request.POST) if formulario.is_valid(): autor = Autor.objects.create( nombre = formulario.cleaned_data['nombre'], apellido = formulario.cleaned_data['apellido'], genero = formulario.cleaned_data['genero'] ) for libro_id in request.POST.getlist('libros'): clasificacion = Clasificacion(libro_id=libro_id, autor_id = autor.id) clasificacion.save() messages.add_message(request, messages.SUCCESS, 'Clasificacion creada satisfactoriamente.') return redirect('clasificacion_lista') else: formulario = AutorForm() return render(request, 'clasificaciones/clasificaciones_nueva.html', {'formulario': formulario}) @login_required def clasificacion_lista(request): autores = Autor.objects.all() return render(request, 'clasificaciones/clasificaciones_lista.html', {'autores': autores}) @login_required def clasificacion_detalle(request, pk): autor = get_object_or_404(Autor,pk=pk) clasificaciones = Clasificacion.objects.filter(autor__id=pk) return render(request,"clasificaciones/clasificaciones_detalle.html",{'autor':autor, 'clasificaciones':clasificaciones}) @login_required def clasificacion_editar(request, pk): autor = get_object_or_404(Autor, pk=pk) if request.method == 'POST': formulario = ClasificacionForm(request.POST, request.FILES, instance=cliente) if formulario.is_valid(): cliente = formulario.save() cliente.save() return redirect('clasificacion_lista') else: formulario = AutorForm(instance=autor) return render(request, 'clasificaciones/clasificacion_editar.html', {'formulario': formulario}) @login_required def clasificacion_remove(request, pk): autor = get_object_or_404(Autor, pk=pk) autor.delete() return redirect('clasificacion_lista') @login_required def libro_lista(request): libros = Libro.objects.all() return render(request, 'libros/libro_lista.html', {'libros': libros}) @login_required def libro_nuevo(request): if request.method == "POST": formulario = LibroForm(request.POST) if formulario.is_valid(): libro = Libro.objects.create( nombre = formulario.cleaned_data['nombre'], editorial = formulario.cleaned_data['editorial'], precio = formulario.cleaned_data['precio'], unidades = formulario.cleaned_data['unidades']) messages.add_message(request, messages.SUCCESS, 'Clasificacion realizada con Exito.') return redirect('libro_lista') else: formulario = LibroForm() return render(request, 'libros/libro_crear.html', {'formulario': formulario}) @login_required def libro_editar(request, pk): libro = get_object_or_404(Libro, pk=pk) if request.method == 'POST': formulario = LibroForm(request.POST, request.FILES, instance=libro) if formulario.is_valid(): libro = formulario.save() libro.save() return redirect('libro_lista') else: formulario = LibroForm(instance=libro) return render(request, 'libros/libro_editar.html', {'formulario': formulario}) @login_required def libro_remove(request, pk): libro = get_object_or_404(Libro, pk=pk) libro.delete() return redirect('libro_lista')
da38c09aba8b6b6a926d76bd31412aa49ad833f9
[ "Python" ]
6
Python
JoseAndresChoc96/Proyecto-Final
cb283c53e5f2e2f1a320a456dd8164f264252167
a12f2f80c91837e4544ad96d49743919816fefa5
refs/heads/master
<file_sep>!!! 5 %html %head %meta{ :charset => 'utf-8' } %title Bye bye, CanCan, I got the Role! = stylesheet_link_tag 'admin_the_role' = javascript_include_tag 'admin_the_role' = csrf_meta_tags %body .the_role %h3 = link_to 'The Role', 'https://github.com/the-teacher/the_role' \| Role system for Rails Apps \| User: #{current_user.try(:name) || current_user.id} .crusty .container .row .span3 .sidebar= yield :sidebar .span9 .content= yield
ae744d8c93f873cc36ec4b02f3360daed4b5f168
[ "Haml" ]
1
Haml
igmarin/the_role
e01e8967917e4682afa663d9aaeb00a853a204a0
c274d56a737fd6949e78c0e7034a6efcf1c5b8ae
HEAD
<repo_name>umate-dating/divaina-matrimony-scraper<file_sep>/spec/app_spec.rb require_relative "../src/app" require_relative "../src/lib/query" describe UMate::DivainaMatrimonyScraper::App do before :all do @app = UMate::DivainaMatrimonyScraper::App.new @query = UMate::DivainaMatrimonyScraper::Query.new @query.gender = :female @query.country = UMate::DivainaMatrimonyScraper::Countries::SriLanka @query.age_min = 18 @query.age_max = 32 @query.category = :matrimony @query.page = 1 end it "should have method `scrape`" do expect( @app ).to respond_to(:scrape) end it "should raise error if called with invalid attributes" do expect do @app.scrape end.to raise_error(ArgumentError, 'Query or Params must be provided') end it "should return an array of listings once scraped" do result = @app.scrape( query: @query ) expect( result ).to be_kind_of(Array) end end <file_sep>/build/thor/scrape.thor require_relative "../../src/app" require_relative "../../src/lib/query" class Scrape < Thor::Group include Thor::Actions argument :name class_option :gender, type: :string, enum: %w(male female), default: 'female' class_option :age_min, type: :numeric, default: 1 class_option :age_max, type: :numeric, default: 99 class_option :country, type: :string, default: 'any' class_option :category, type: :string, enum: %w(matrimony friendship), default: 'matrimony' def process @app = UMate::DivainaMatrimonyScraper::App.new() category = options[:category] gender = options[:gender] age_min = options[:age_min] age_max = options[:age_max] country = options[:country] # Generating a query query = UMate::DivainaMatrimonyScraper::Query.new() query.age_min = age_min query.age_max = age_max query.gender = UMate::DivainaMatrimonyScraper::Parsers::Gender.new(gender).gender query.category = UMate::DivainaMatrimonyScraper::Parsers::Category.new(category).category query.country = UMate::DivainaMatrimonyScraper::Parsers::Country.new(country).country # Scraper options @app.scrape(query, options) end end # vim: set syntax=ruby: <file_sep>/src/lib/parsers/country.rb require_relative '../countries' module UMate module DivainaMatrimonyScraper module Parsers class Country attr_reader :country def initialize(country) parse(country.strip) end private def parse(country = 'Sri Lanka') @country = country == 'Sri Lanka' ? Countries::SriLannka : Countries::ALL end end end end end <file_sep>/Rakefile require 'rubygems' require 'rake' # Load rake tasks Dir.glob('build/rake/**/*.rake').each { |f| import f } <file_sep>/src/lib/url_generator.rb require 'open-uri' require_relative 'downloader' module UMate module DivainaMatrimonyScraper class URLGenerator URL_FORMAT = "http://matrimony.divaina.com/results.asp?page=[PAGE_NO]&category=[CATEGORY]&atage1=[AGE_MIN]&atage2=[AGE_MAX]&sex=[GENDER]&country=[COUNTRY]" def generate query = nil result = [] pages = get_pages( query ) if query.page && query.page > 0 result << generate_link(query, query.page) else (1..pages).each do |page_no| result << generate_link(query, page_no) end end result end def generate_link query, page_no # Generate the first link url = URL_FORMAT url.gsub! '[PAGE_NO]' , page_no.to_s url.gsub! '[CATEGORY]' , query.category.to_s url.gsub! '[AGE_MIN]' , query.age_min.to_s url.gsub! '[AGE_MAX]' , query.age_max.to_s url.gsub! '[GENDER]' , query.gender.to_s url.gsub! '[COUNTRY]' , query.country URI::encode url end def get_pages query = nil link = generate_link( query, 1 ) source = UMate::DivainaMatrimonyScraper::Downloader.body( link ) doc = Nokogiri::HTML(source) links = doc.css('a') last_link = links[ links.length - 2 ] pages = last_link.text.to_i pages end end end end <file_sep>/Thorfile Dir.glob( "build/thor/**/*{thor,rb}" ){ |name| Thor::Util.load_thorfile name } <file_sep>/spec/extractor_sepc.rb require_relative "../src/lib/downloader" require_relative "../src/lib/extractor" require_relative "../src/lib/listing" describe UMate::DivainaMatrimonyScraper::Extractor do before :each do end it "raises error if body is not provided" do expect do UMate::DivainaMatrimonyScraper::Extractor.extract end.to raise_error(ArgumentError) end it "scrpes properly" do profiles = [] d1 = OpenStruct.new d1.nickname = 'Sha' d1.category = 'matrimony' d1.gender = 'female' d1.age = '38' d1.height = '5 feet 2 Inches' d1.religion = 'Islam' d1.caste = 'NA' d1.nationality = 'Sri Lankan' d1.occupation = 'Occ.' d1.city = 'Cit.' d1.country = 'Sri Lanka' d1.profile = 'Down to earth' d1.partner = 'A person who will' d1.email = '<EMAIL>' p1 = UMate::DivainaMatrimonyScraper::Listing.new(d1) path = File.expand_path('../archives/samples/matrimony-female-2014-11-18.txt', File.dirname( __FILE__ )) file = IO.read(path) listings = UMate::DivainaMatrimonyScraper::Extractor.extract(file) expect(listings.length).not_to be(0) first = listings.first expect(first.nickname).to eq(p1.nickname) expect(first.category).to eq(p1.category) expect(first.gender).to eq(p1.gender) expect(first.age).to eq(p1.age) expect(first.height).to eq(p1.height) expect(first.religion).to eq(p1.religion) expect(first.caste).to eq(p1.caste) expect(first.nationality).to eq(p1.nationality) expect(first.occupation).to eq(p1.occupation) expect(first.city).to eq(p1.city) expect(first.country).to eq(p1.country) expect(first.profile).to eq(p1.profile) expect(first.partner).to eq(p1.partner) expect(first.email).to eq(p1.email) end end <file_sep>/spec/url_generator_spec.rb require_relative '../src/lib/url_generator' describe UMate::DivainaMatrimonyScraper::URLGenerator do before :each do @query = UMate::DivainaMatrimonyScraper::Query.new @query.gender = :female @query.country = UMate::DivainaMatrimonyScraper::Countries::SriLanka @query.age_min = 18 @query.age_max = 32 @query.category = :matrimony @url_generator = UMate::DivainaMatrimonyScraper::URLGenerator.new end it "responds to generate method" do expect( @url_generator ).to respond_to( :generate ) end it "returns frst page of the query" do link = @url_generator.generate_link( @query, 1 ) expected_link = "http://matrimony.divaina.com/results.asp?page=1&category=matrimony&atage1=18&atage2=32&sex=female&country=Sri%20Lanka" expect( link ).to eq( expected_link ) end it "returns an array of strings which are links that need to be scraped" do results = @url_generator.generate( @query ) expect( results ).to be_kind_of(Array) results_are_string = true results.each do |r| results_are_string = false unless r.is_a?(String) end expect( results_are_string ).to be(true) end end <file_sep>/src/lib/countries.rb module UMate module DivainaMatrimonyScraper class Countries ALL = 'All' SriLanka = 'Sri Lanka' end end end <file_sep>/src/lib/parsers/category.rb module UMate module DivainaMatrimonyScraper module Parsers class Category attr_reader :category def initialize(category) parse(category.strip) end private def parse(category = 'matrimony') @category = category == 'matrimony' ? :matrimony : :friendship end end end end end <file_sep>/src/lib/parsers/height.rb module UMate module DivainaMatrimonyScraper module Parsers class Height attr_reader :feet attr_reader :inches def initialize(height) @height = height parse end def in_cm ((12 * @feet + @inches) * 2.54).round(2) end private def parse @feet = 0 @inches = 0 parts = @height.scan /(\d+)/ @feet = parts[0][0].to_i @inches = parts[1][0].to_i end end end end end <file_sep>/src/lib/configuration.rb module UMate module DivainaMatrimonyScraper class Configuration attr_accessor :writers attr_accessor :reader def initialize @reader = UMate::DivainaMatrimonyScraper::Readers::Database @writers = [] @writers << UMate::DivainaMatrimonyScraper::Writers::Database end end end end <file_sep>/src/lib/query.rb require_relative 'countries' module UMate module DivainaMatrimonyScraper class Query GENDER_MALE = :male GENDER_FEMALE = :female GENDERS = [ GENDER_MALE, GENDER_FEMALE ] CATEGORIES = [ :matrimony, :friendship ] AGE_MIN = 1 AGE_MAX = 99 attr_reader :gender attr_reader :age_min attr_reader :age_max attr_reader :country attr_reader :category attr_reader :page def gender= gender = GENDER_MALE raise ArgumentError, 'Gender should be a Symbol' unless gender.is_a?(Symbol) raise ArgumentError, 'Gender should be :male or :female' unless GENDERS.include?(gender) @gender = gender end def age_min= age_min = 1 raise ArgumentError, 'Age min should not be nil' if age_min.nil? raise ArgumentError, 'Age min should be Integer' unless age_min.is_a?(Integer) raise ArgumentError, 'Age min should be within 1 and 99' if age_min < AGE_MIN || age_min > AGE_MAX @age_min = age_min end def age_max= age_max = 99 raise ArgumentError, 'Age max should not be nil' if age_max.nil? raise ArgumentError, 'Age max should be Integer' unless age_max.is_a?(Integer) raise ArgumentError, 'Age max should be within 1 and 99' if age_max < AGE_MIN || age_max > AGE_MAX @age_max = age_max end def country= country = Countries::SriLanka raise ArgumentError, 'Country should not be nil' if country.nil? raise ArgumentError, 'The country value is unknown' unless Countries.constants.collect{ |c| Countries.const_get(c.to_s) }.include?(country) @country = country end def category= category = :matrimony raise ArgumentError, 'Category is required' if category.nil? raise ArgumentError, 'Category should be a Symbol' unless category.is_a?(Symbol) raise ArgumentError, 'Unknown category' unless CATEGORIES.include?( category ) @category = category end def page= page = 0 raise ArgumentError, 'Page is require' if page.nil? raise ArgumentError, 'Page should be an integer' unless page.is_a?(Integer) raise ArgumentError, 'Page should be positive' if page < 0 @page = page end end end end <file_sep>/spec/predictors/religion_spec.rb require_relative '../../src/lib/predictors/religion' describe UMate::DivainaMatrimonyScraper::Predictors::Religion do before :each do @height = '5 Feet 6 Inches ' @parser = UMate::DivainaMatrimonyScraper::Predictors::Religion.new end it "predicts religions starting with 'b' as Buddhism" do expect(@parser.predict('b-----')).to be(:buddhism) expect(@parser.predict('B-----')).to be(:buddhism) end it "predicts religions starting with 'i' as Islam" do expect(@parser.predict('i-----')).to be(:islam) expect(@parser.predict('I-----')).to be(:islam) end it "predicts religions starting with 'h' as Hinduism" do expect(@parser.predict('h-----')).to be(:hinduism) expect(@parser.predict('H-----')).to be(:hinduism) end it "predicts religions starting with 'c' as Christianity" do expect(@parser.predict('c-----')).to be(:christianity) expect(@parser.predict('C-----')).to be(:christianity) end end <file_sep>/src/lib/downloader.rb require 'mechanize' module UMate module DivainaMatrimonyScraper class Downloader class << self def body uri = nil raise ArgumentError, 'URI required' if uri.nil? browser = Mechanize.new { |agent| agent.user_agent_alias = "Mechanize" } browser.get( uri ).body end end end end end <file_sep>/src/lib/writers/databse.rb module UMate module DivainaMatrimonyScraper module Writers module Databse def self.write(listings = nil) listings.respond_to?(:each) ? ArrayWriter.new(listings).write : Writer.new(listings).write end class ArrayWriter def initialize(listings = []) @listings = listings end def write result = [] @listings.each do |listing| result << Writer.new(listing).write end result end end class Writer def initialize(listing = nil) @listing = listing end def write profile = ::Profile.new profile.email = listing.email profile.nickname = listing.nickname profile.gender = UMate::DivainaMatrimonyScraper::Parsers::Gender.new(listing.gender).gender profile.category = UMate::DivainaMatrimonyScraper::Parsers::Category.new(isting.category).category profile.age = listing.age.to_i profile.height = UMate::DivainaMatrimonyScraper::Parsers::Height.new(listing.height).in_cm profile.religion = UMate::DivainaMatrimonyScraper::Predictors::Religion.new.predict(listing.religion) profile.caste = listing.caste profile.occupation = listing.occupation profile.city = listing.city profile.country = listing.country profile.profile = listing.profile profile.partner = listing.partner profile.save end end end end end end <file_sep>/spec/query_spec.rb require_relative "../src/lib/query" require_relative "../src/lib/countries" describe UMate::DivainaMatrimonyScraper::Query do before :each do @query = UMate::DivainaMatrimonyScraper::Query.new end it "updates gender" do @query.gender = :female expect( @query.gender ).to eq( :female ) @query.gender = :male expect( @query.gender ).to eq( :male ) end it "should raise error if value is not a hash" do expect do @query.gender = 'female' end.to raise_error(ArgumentError, 'Gender should be a Symbol') end it "should raise error if value is not male or female" do expect do @query.gender = :foo end.to raise_error(ArgumentError, 'Gender should be :male or :female') end it "updates age_min value" do @query.age_min = 18 expect( @query.age_min ).to eq(18) end it "raises error if no argument is provided" do expect do @query.age_min = nil end.to raise_error(ArgumentError, "Age min should not be nil") end it "raises an error if a non integer value is given as age min" do expect do @query.age_min = "23" end.to raise_error(ArgumentError, "Age min should be Integer") end it "raises an error if the value is out of range" do expect do @query.age_min = 0 end.to raise_error(ArgumentError, "Age min should be within 1 and 99") expect do @query.age_min = 100 end.to raise_error(ArgumentError, "Age min should be within 1 and 99") end it "updates age_max value" do @query.age_max = 18 expect( @query.age_max ).to eq(18) end it "raises error if no argument is provided" do expect do @query.age_max = nil end.to raise_error(ArgumentError, "Age max should not be nil") end it "raises an error if a non integer value is given as age min" do expect do @query.age_max = "23" end.to raise_error(ArgumentError, "Age max should be Integer") end it "raises an error if the value is out of range" do expect do @query.age_max = 0 end.to raise_error(ArgumentError, "Age max should be within 1 and 99") expect do @query.age_max = 100 end.to raise_error(ArgumentError, "Age max should be within 1 and 99") end it "sets country" do @query.country = UMate::DivainaMatrimonyScraper::Countries::SriLanka expect( @query.country ).to eq( UMate::DivainaMatrimonyScraper::Countries::SriLanka ) end it "exepects country attribute and raises error if nil" do expect do @query.country = nil end.to raise_error(ArgumentError, "Country should not be nil") end it "raises error if a country value not in Countries is provided" do expect do @query.country = "Some random country!" end.to raise_error(ArgumentError, "The country value is unknown") end it "sets category" do @query.category = :matrimony expect( @query.category ).to eq( :matrimony ) @query.category = :friendship expect( @query.category ).to eq( :friendship ) end it "raises error if category var is not a symbol" do expect do @query.category = 'matrimony' end.to raise_error(ArgumentError, "Category should be a Symbol") end it "raises error if category is not one of :matrimony or :friendship" do expect do @query.category = :foo end.to raise_error(ArgumentError, 'Unknown category') end it "raises error if category is nil" do expect do @query.category = nil end.to raise_error(ArgumentError, 'Category is required') end end <file_sep>/src/lib/listing.rb require 'ostruct' module UMate module DivainaMatrimonyScraper class Listing attr_reader :nickname attr_reader :category attr_reader :gender attr_reader :age attr_reader :height attr_reader :religion attr_reader :caste attr_reader :nationality attr_reader :occupation attr_reader :city attr_reader :country attr_reader :profile attr_reader :partner attr_reader :email def initialize data = {} self.nickname = data.respond_to?(:nickname) ? data.nickname : nil self.category = data.respond_to?(:category) ? data.category : nil self.gender = data.respond_to?(:gender) ? data.gender : nil self.age = data.respond_to?(:age) ? data.age : nil self.height = data.respond_to?(:height) ? data.height : nil self.religion = data.respond_to?(:religion) ? data.religion : nil self.caste = data.respond_to?(:caste) ? data.caste : nil self.nationality = data.respond_to?(:nationality) ? data.nationality : nil self.occupation = data.respond_to?(:occupation) ? data.occupation : nil self.city = data.respond_to?(:city) ? data.city : nil self.country = data.respond_to?(:country) ? data.country : nil self.profile = data.respond_to?(:profile) ? data.profile : nil self.partner = data.respond_to?(:partner) ? data.partner : nil self.email = data.respond_to?(:email) ? data.email : nil end def nickname= nickname = nil @nickname = filter(nickname) end def category= category = nil @category = filter(category) end def gender= gender = nil @gender = filter(gender) end def age= age = nil @age = filter(age) end def height= height = nil @height = filter(height) end def religion= religion = nil @religion = filter(religion) end def caste= caste = nil @caste = filter(caste) end def nationality= nationality = nil @nationality = filter(nationality) end def occupation= occupation = nil @occupation = filter(occupation) end def city= city = nil @city = filter(city) end def country= country = nil @country = filter(country) end def profile= profile = nil @profile = filter(profile) end def partner= partner = nil @partner = filter(partner) end def email= email = nil @email = filter(email) end private def filter text = nil return '' if text.nil? text.strip end end end end <file_sep>/spec/downloader_spec.rb require_relative "../src/lib/downloader" describe UMate::DivainaMatrimonyScraper::Downloader do before :each do end it "raises error if no URI is provided" do expect do UMate::DivainaMatrimonyScraper::Downloader.body end.to raise_error(ArgumentError, 'URI required') end end <file_sep>/README.md [![Build Status](https://travis-ci.org/umate-dating/divaina-matrimony-scraper.svg?branch=develop)](https://travis-ci.org/umate-dating/divaina-matrimony-scraper) # UMate - Divaina Matrimony Scraper Divaina, a leadig news paper in Sri Lanka. It turns out to have a poorly built listing system for dating and matrimony. The purpose of this project is to import all listings to a SQLite database by querying through the old site. Once the necessary data is collected, it will be exported to various file formats such as XML, Excel, ODT and PDF for analytical reasons. ## Stack The application is built on Ruby and is powered by Nokogiri. - Ruby 2.1.5 (Latest) - Datamapper - Nokogiri - Thor (command line features) ## Minimum requirements - Linux or Unix (including Mac OS) operating systems - Ruby 2.1.5 ## Installation and Running You would require a Linux or Unix operating system for the proper execution of the application. In the case of Ruby git clone git@github.com:umate-dating/divaina-matrimony-scraper.git cd divaina-matrimony-scraper bundle install thor scrape For a detailed list of command line operations, please reffer to the project wiki. ## Developers For any technical assitance in the use of the given application, you could contact any of the developers below. **<NAME>** Malabe 10115 Sri Lanka +94-71-2477701 <EMAIL> jdeen.solutions (Skype) <file_sep>/src/lib/parsers/gender.rb module UMate module DivainaMatrimonyScraper module Parsers class Gender attr_reader :gender def initialize(gender) parse(gender.strip) end private def parse(gender = 'male') @gender = gender == 'female' ? :female : :male end end end end end <file_sep>/src/lib/predictors/religion.rb module UMate module DivainaMatrimonyScraper module Predictors class Religion def predict religion = '' religion = religion.downcase case religion[0] when 'i' return :islam when 'b' return :buddhism when 'c' return :christianity when 'h' return :hinduism else return :other end end end end end end <file_sep>/src/lib/extractor.rb require_relative 'listing' module UMate module DivainaMatrimonyScraper class Extractor RESULTS_PER_PAGE = 5 def self.extract body = nil raise ArgumentError, 'HTML of the page that records need to be extracted is required' if body.nil? page = Nokogiri::HTML(body) elements = page.css("center td:nth-child(2)") wide_elements = page.css("[colspan='2']") mail_elements = page.css("[name='mailid']") # FIXME Need to properly handle available qty raise Exception, 'Not suficient elemnets' if elements.length != 55 raise Exception, 'Not suficient elements' if wide_elements.length < 10 listings = [] (0.. (RESULTS_PER_PAGE - 1)).each do |counter| listing = Listing.new listing.nickname = elements[counter * 11 + 0].text.strip listing.category = elements[counter * 11 + 1].text.strip listing.gender = elements[counter * 11 + 2].text.strip listing.age = elements[counter * 11 + 3].text.strip listing.height = elements[counter * 11 + 4].text.strip listing.religion = elements[counter * 11 + 5].text.strip listing.caste = elements[counter * 11 + 6].text.strip listing.nationality = elements[counter * 11 + 7].text.strip listing.occupation = elements[counter * 11 + 8].text.strip listing.city = elements[counter * 11 + 9].text.strip listing.country = elements[counter * 11 + 10].text.strip listing.profile = wide_elements[counter * 5 + 1].text.strip listing.partner = wide_elements[counter * 5 + 3].text.strip listing.email = mail_elements[counter]['value'] listings << listing puts "#{listing.email} - #{listing.nickname}" end listings end end end end <file_sep>/spec/parsers/height_spec.rb require_relative '../../src/lib/parsers/height' describe UMate::DivainaMatrimonyScraper::Parsers::Height do before :each do @height = '5 Feet 6 Inches ' @parser = UMate::DivainaMatrimonyScraper::Parsers::Height.new(@height) end it "Finds values in feet and inches" do expect(@parser.feet).to be(5) expect(@parser.inches).to be(6) end it "should provide values in cm" do expect(@parser.in_cm).to be(167.64) end end <file_sep>/Gemfile source "https://rubygems.org" group :default do # Databse gem "data_mapper" gem "dm-sqlite-adapter" # Scraper gem "nokogiri" gem "mechanize" # Commandline gem "thor" gem "rake" # Debuggin gem "pry" end group :development do gem "ghi" end group :test do gem "rspec" end <file_sep>/src/models/init.rb require 'pathname' uri = Pathname.new( __FILE__ ) folder = uri.dirname category = folder.basename.to_s.capitalize Pathname.glob( "#{uri.dirname}/**/*.rb" ).each do |file| path = file.relative_path_from( folder ) unless uri == file puts "~~> #{category} init, loading Path #{file}" require_relative file end end <file_sep>/src/config/database.rb require 'rubygems' require 'data_mapper' require 'bcrypt' # The models require_relative '../models/init' # @class class DatabaseSetup {{{ # @brief This class will handle database setup in the application. It defines 3 environments. # That are development, test and productiom. class DatabaseSetup def initialize options = nil setup end # @fn def setup {{{ # @brief Sets up the databse based on the environment. def setup database_url = "sqlite://#{File.expand_path('../../database/general.sqlite', File.dirname(__FILE__))}" puts database_url DataMapper.setup(:default, database_url) DataMapper::Logger.new( STDOUT, :debug ) DataMapper.finalize end # }}} end # class DatabaseSetup }}} <file_sep>/src/models/profile.rb class Profile include DataMapper::Resource property :id, Serial property :email, String property :category, Enum[:matrimony, :epal] property :nickname, String property :gender, Enum[:male, :female] property :age, Integer property :height, Integer property :religion, Enum[:islam, :buddhism, :hinduism, :christianity, :other] property :caste, String property :occupation, String property :city, String property :country, String property :nationality, String property :profile, Text property :partner, Text end <file_sep>/src/app.rb require "rubygems" require "data_mapper" require "mechanize" require "pry" require_relative 'config/database' require_relative 'lib/url_generator' require_relative 'lib/extractor' require_relative 'lib/parsers/height' require_relative 'lib/predictors/religion' module UMate module DivainaMatrimonyScraper class << self attr_accessor :configuration end def self.configure self.configuration ||= Configuration.new end class App def initialize @db = DatabaseSetup.new end def scrape query: nil, params: nil raise ArgumentError, 'Query or Params must be provided' if query.nil? && params.nil? url_generator = URLGenerator.new urls = url_generator.generate( query ) results = [] urls.each do |url| puts "Extracting: #{url}" body = Downloader.body( url ) result = Extractor.extract( body ) results.concat result end store(results) results end def store results writers = UMate::DivainaMatrimonyScraper.configuration.writers writers.each { |writer| writer.write(results)} end end end end
e07480dfccbd393a4107e9b8f60e8f885f7921ff
[ "Markdown", "Ruby" ]
29
Markdown
umate-dating/divaina-matrimony-scraper
f48ba34f72f97d5b240d1a7d419e10217935a459
0269efb2099fea967ac587a7cbb4a7159e097442
refs/heads/master
<file_sep>require 'jar_dependencies' JBUNDLER_LOCAL_REPO = Jars.home JBUNDLER_JRUBY_CLASSPATH = [] JBUNDLER_JRUBY_CLASSPATH.freeze JBUNDLER_TEST_CLASSPATH = [] JBUNDLER_TEST_CLASSPATH.freeze JBUNDLER_CLASSPATH = [] JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/apache/pdfbox/fontbox/2.0.9/fontbox-2.0.9.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/apache/commons/commons-csv/1.4/commons-csv-1.4.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/commons-cli/commons-cli/1.4/commons-cli-1.4.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/jline/jline/2.11/jline-2.11.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/locationtech/jts/jts-core/1.15.0/jts-core-1.15.0.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/bouncycastle/bcmail-jdk15on/1.56/bcmail-jdk15on-1.56.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/apache/pdfbox/pdfbox/2.0.9/pdfbox-2.0.9.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/commons-logging/commons-logging/1.2/commons-logging-1.2.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/com/github/jai-imageio/jai-imageio-core/1.3.1/jai-imageio-core-1.3.1.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/technology/tabula/tabula/1.0.2/tabula-1.0.2.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/com/github/jai-imageio/jai-imageio-jpeg2000/1.3.0/jai-imageio-jpeg2000-1.3.0.jar') JBUNDLER_CLASSPATH << (JBUNDLER_LOCAL_REPO + '/com/levigo/jbig2/levigo-jbig2-imageio/2.0/levigo-jbig2-imageio-2.0.jar') JBUNDLER_CLASSPATH.freeze <file_sep>import xlwt, csv, os csv_folder = "./" book = xlwt.Workbook() for fil in os.listdir(csv_folder): sheet = book.add_sheet(fil[:-4]) with open(csv_folder + fil) as filname: reader = csv.reader(filname) i = 0 for row in reader: for j, each in enumerate(row): sheet.write(i, j, each) i += 1 book.save("Output.xls")
cc628b525a6de1d54dc58d03be53c0ac089ecdfd
[ "Ruby", "Python" ]
2
Ruby
khianmin/tabula_merge_set
0399841ed135d5d1ff6fbb0517121745ac2fae5f
23491498b45dab9a1f2551700bd0392d9c8c9828
refs/heads/master
<file_sep>1; disp("Octave solutions to dec 17, 2002 final exam for MIT 18.06 (paper from appendix of G Strang's Intro to Linear Algebra)") disp("--------------------------------") disp("Q1 a") A = [1,1,1,1,1,1;2,1,1,1,1,1;2,2,1,1,1,1;2,2,2,1,1,1] [L, U] = lu(A) disp("Q1 b") rank(A) rref(null(A)') disp("--------------------------------") disp("Q2 a") A = rref(null([2,3,1,0])') rank(A) disp("solution is [0,0,0,0] + k[2,3,1,0]") disp("Q2 b") A disp("--------------------------------") P = 1/21*[1,2,-4;2,4,-8;-4,-8,16] disp("Q3 a") [1,0,0]*rref(P) disp("Q3 b") sqrt(dot(cross([1,0,0]*rref(P), [1,1,1])/norm([1,0,0]*rref(P)),cross([1,0,0]*rref(P), [1,1,1])/norm([1,0,0]*rref(P)))) disp("Q3 c") [V,D] = eig(P); disp("Eigenvalues are: ") [1,1,1]*D if(rref (V) == [1,0,0;0,1,0;0,0,1]) disp("P is diagonisable") else disp('P isnt diagonisable'); endif disp("--------------------------------") disp("Q4 a1 : null") disp("Q4 a2 : column") disp("Q4 a3 : left null") disp("Q4 a4 : row") disp("Q4 b1 : (5-r)*7") disp("Q4 b2 : s*9") disp("Q4 b3 : r + s = 7") disp("--------------------------------") A = [1;2;2] B = [5;4;-2] disp("Q6 a") An = A/norm(A); Bn = B - (A' * B * A)/(A' * A); q1 = An q2 = Bn / norm(Bn) disp("Q6 b") Y = [A,B]; P = Y * inv(Y' * Y) * Y' disp("--------------------------------") disp("Q7 a : full rank") disp("Q7 b : 3, 4") disp("Q7 c") [1,0,0;0,1,0;0,0,0] disp("--------------------------------") disp("Q8") A4 = [3,0,0,2;2,3,0,0;0,2,3,0;0,0,2,3] determinant = det(A4) disp("--------------------------------") disp("Q9 a : -1,1;1") disp("Q9 b : 3,1,0;") <file_sep># octave-scripts my octave stuff ## Contains - Solutions to mit 18.06 2002 finals (mit-final-2002.m)
5e7f93a5353bde047e7e50cf81f465ba230d4ca4
[ "MATLAB", "Markdown" ]
2
MATLAB
pranavgade20/octave-scripts
fcd26be8b57ca904e4819f5e2551a2243ad3f59d
3cda6d92e7ec0e969955e7c988e2961f805c9211
refs/heads/master
<repo_name>csamarchi/appsody-backend-ces<file_sep>/.appsody-config.yaml id: "20200401115333.38593500" project-name: appsody-backend-ces stack: kabanero/nodejs-express:0.2
e7e18d826ef0afff47ca7fef2aea2c746709b07e
[ "YAML" ]
1
YAML
csamarchi/appsody-backend-ces
02b50161c809df18b2f876bd6efb7df981d094ad
deadba41162843ac169d87e19fbff4225298d74a
refs/heads/master
<file_sep>FROM node:latest RUN mkdir -p /usr/src/hw-bot WORKDIR /usr/src/hw-bot COPY package.json /usr/src/hw-bot RUN npm install COPY . /usr/src/hw-bot CMD [ "node" , "index.js" ]
b8d6ad37350c006f4e035731de4782388551cc2d
[ "Dockerfile" ]
1
Dockerfile
Master76/hw-bot
6cab2e45749620efe9b483607cfd64b6e285f2c2
925845c9c9830acbf5abee780addf69be0e1c2ea
refs/heads/master
<repo_name>cjenaro/video-player<file_sep>/main.js const player = document.querySelector('.player') const video = player.querySelector('.viewer') const progress = player.querySelector('.progress') const progressBar = player.querySelector('.progress__filled') const toggle = player.querySelector('.toggle') const skipButtons = player.querySelectorAll('[data-skip]') const ranges = player.querySelectorAll('.player__slider') const fullscreen = player.querySelector('.player__fullscreen') let isClicking = false function togglePlay(e) { if (video.paused) { video.play() toggle.innerHTML = '&#9613;&#9613;' } else { toggle.innerHTML = '&#9658;' video.pause() } } function handleFwdOrBk(e) { video.currentTime = Math.ceil( video.currentTime + parseInt(this.dataset.skip, 10) ) } function moveProgressBar(e) { progressBar.style.flexBasis = (this.currentTime / this.duration) * 100 + '%' } function handleRanges(e) { if (isClicking) { video[this.name] = this.value } } function scrub(e) { const scrubTime = (e.offsetX / progress.offsetWidth) * video.duration video.currentTime = scrubTime } function handleFullscreen(e) { player.classList.toggle('fullscreen') } toggle.addEventListener('click', togglePlay) video.addEventListener('click', togglePlay) video.addEventListener('timeupdate', moveProgressBar) skipButtons.forEach(btn => { btn.addEventListener('click', handleFwdOrBk) }) ranges.forEach(range => { range.addEventListener('mousedown', () => (isClicking = true)) range.addEventListener('mouseup', () => (isClicking = false)) range.addEventListener('mousemove', handleRanges) }) progress.addEventListener('click', scrub) progress.addEventListener('mousedown', () => (isClicking = true)) progress.addEventListener('mouseup', () => (isClicking = false)) progress.addEventListener('mouseout', () => (isClicking = false)) progress.addEventListener('mousemove', e => isClicking && scrub(e)) fullscreen.addEventListener('click', handleFullscreen)
b9611764923993dfb97947415030472149672aba
[ "JavaScript" ]
1
JavaScript
cjenaro/video-player
85fd9e01cc0e29ad6aa65991a99268a32716124e
add05608646e2858704224e70f412b7f11ac37e1
refs/heads/main
<repo_name>jhaastrup/docs-sanity<file_sep>/components/dataInput.js import React from 'react'; import PatchEvent, {set, unset} from 'part:@sanity/form-builder/patch-event'; function createPatchFrom(value){ PatchEvent.from(value === '' ? unset() : set(value)) } export default function dataInput({type, value, onChange, inputComponent}){ const ref = React.forwardRef return( <div> <h4>{type.title}</h4> <input type={type.name} value={value} ref={inputComponent} //class="DefaultTextInput_input_3BjJK text-input_textInput_2rEOM text-input_root_2Mz4y" onChange={event =>onChange(createPatchFrom(event.target.value))} /> </div> ) } dataInput.focus = function(){ this._inputElement.focus(); }<file_sep>/schemas/pages.js export default{ name:'page', title:'Page', type:'document', fields:[ { name:'book', title:'Book', description:'page of what book', type:'reference', to:[{type:'book'}] }, { name:'chapter', title:'Chapter', description:'chapter of page', type:'reference', to:[{type:'chapter'}] }, { name:'name', title:'Name', description:'name of the page', type:'string' }, { name: 'slug', title: 'Slug', type: 'slug', options: { source: 'name', maxLength: 100, }, }, { name:'title', title:'Title', description:'title of this page', type:'string', }, { name:'description', title:'Description', description:'an introductory comment about this page', type:'text' }, { name:'section', title:'Section', type:'array', of: [{type: 'section'}] } ] }<file_sep>/schemas/books.js export default{ name:'book', title:'Book', type:'document', fields:[ { name:'name', title:'Name', description:'name of this book', type:'string' }, { name: 'slug', title: 'Slug', type: 'slug', options: { source: 'name', maxLength: 100, }, }, { name:'title', title:'Title', description:'tilte of this book', type:'string' }, { name:'url', title:'Url', type:'url' }, { name:'description', title:'Description', type:'text', description:'an introductory comment about this book' } ] }<file_sep>/schemas/chapters.js export default{ name:'chapter', title:'Chapter', type:'document', fields:[ { name:'book', title:'Book', type:'reference', to:[{type:'book'}], description:'a chapter of the book' }, { name:'name', title:'Name', type:'string', description:'name of this chapter' }, { name: 'slug', title: 'Slug', type: 'slug', options: { source: 'name', maxLength: 100, }, }, { name:'title', title:'Title', description:'title of this chapter', type:'string' }, { name:'description', title:'Description', description:'an introductory comment about this page', type:'text' } ] }<file_sep>/schemas/schema.js // First, we must import the schema creator import createSchema from 'part:@sanity/base/schema-creator' // Then import schema types from any plugins that might expose them import schemaTypes from 'all:part:@sanity/base/schema-type' // Then we give our schema to the builder and provide the result to Sanity import books from './books'; import chapters from './chapters'; import pages from './pages'; import sections from './sections'; export default createSchema({ // We name our schema name: 'default', // Then proceed to concatenate our document type // to the ones provided by any plugins that are installed types: schemaTypes.concat([ /* Your types here! */ books, chapters, pages, sections ]) }) <file_sep>/schemas/sections.js import dataInput from './../components/dataInput'; export default{ name:'section', title:'Section', type:'object', fields: [ { name: 'name', type: 'string', title: 'Section name' }, { name:'title', title:'Section title', type:'string', }, { name:'url', title:'Url', type:'url' }, { name:'content', title:'Content', type:'text', inputComponent:dataInput, } ] }
3970f2a30fd6550ea93bf97a754d2c6b8ddc76f6
[ "JavaScript" ]
6
JavaScript
jhaastrup/docs-sanity
e88037265130be1da0aba2dd29a4af106b23c37f
713d370508b7d786051488a0b32f8958b74f85ee
refs/heads/master
<repo_name>narasimma23/go-i2c<file_sep>/README.md # I2C bus setting up and usage for linux on RPi device and respective clones This library written in Go programming language intended to activate and interact with the I2C bus by reading and writing data. Forked from ------------ https://github.com/d2r2/go-i2c.git with logging part removed. Golang usage ------------ ```go func main() { // Create new connection to I2C bus on 2 line with address 0x27 i2c, err := i2c.NewI2C(0x27, 2) if err != nil { log.Fatal(err) } // Free I2C connection on exit defer i2c.Close() .... // Here goes code specific for sending and reading data // to and from device connected via I2C bus, like: _, err := i2c.Write([]byte{0x1, 0xF3}) if err != nil { log.Fatal(err) } .... } ```
f66ef5b778355a2875c80160e98b05b353ab85c4
[ "Markdown" ]
1
Markdown
narasimma23/go-i2c
0ec04eac4ffd1206bd1ee86fd4708e8aa7a863a2
0e9ebe27f05df45e1cf58aeec8ed1f07771b41d1
refs/heads/master
<repo_name>santiagobassani96/bet_bot<file_sep>/bot.py import mechanize from bs4 import BeautifulSoup import cookielib #aca va tu mail entre comilla USERNAME = # aca tu password tambien entre comillas PASSWORD = URL = 'https://playfulbet.com/users/sign_in?locale=en' br = mechanize.Browser() br.set_handle_robots(False) br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')] #cookiejar cj = cookielib.LWPCookieJar() br.set_cookiejar(cj) br.open(URL) br.select_form(nr = 0) br.form['user[login]'] = USERNAME br.form['user[password]'] = <PASSWORD> br.submit() print br.response().read()
6d04378524d3d799a957a751739b00f2da5eba01
[ "Python" ]
1
Python
santiagobassani96/bet_bot
62a01a3917c4680f1e02a25d398f74c91ba1ac06
c1bf0e7e3d1593c1614fec8dc6287bb35323fbd1
refs/heads/master
<file_sep>require 'spec_helper' RSpec.describe Placement do context 'valid input' do it 'expects initialize object' do expect { described_class.new(x: 0, y: 0, face: 'NORTH') }.not_to raise_error InvalidPlacement end end context 'invalid input' do it 'expects to raise error with incorrect x' do expect { described_class.new(x: 6, y: 0, face: 'NORTH') }.to raise_error InvalidPlacement end it 'expects to raise error with incorrect y' do expect { described_class.new(x: 3, y: -1, face: 'NORTH') }.to raise_error InvalidPlacement end it 'expects to raise error with incorrect face' do expect { described_class.new(x: 6, y: 0, face: 'SOMEWHERE') }.to raise_error InvalidPlacement end end describe '#print' do subject { described_class.new(x: 1, y: 2, face: 'SOUTH') } it 'prints position' do expect(subject.print).to eq('1,2,SOUTH') end end describe '#==' do let(:other_placement) { Placement.new(x: 1, y: 2, face: 'NORTH') } it 'equals' do expect(described_class.new(x: 1, y: 2, face: 'NORTH')).to eq other_placement end it 'not equals' do expect(described_class.new(x: 3, y: 4, face: 'SOUTH')).not_to eq other_placement end end end <file_sep>class Runner def initialize(source:, executor: Executor.new) @executor = executor @commands = source end def execute commands.each do |command| executor.command(command) end end private attr_reader :executor, :commands end <file_sep>class Executor def initialize(robot = Robot.new) @robot = robot end def command(str) command_line = str.split(' ') command = command_line[0].downcase.to_sym args = extract_args(command_line[1]) return nil unless robot.methods.include? command print_out(robot.public_send(command, *args)) end private attr_reader :robot def extract_args(args) return if args.nil? args.split(',').map do |arg| begin Integer(arg) rescue ArgumentError arg end end end def print_out(result) if result.is_a? String puts result end result end end <file_sep>#!/usr/bin/env ruby require 'rubygems' require 'bundler/setup' require 'pry' require_relative 'executor' require_relative 'placement' require_relative 'robot' require_relative 'runner' def run source = File.readlines(ARGV[0]) runner = Runner.new(source: source) runner.execute end def print_usage puts 'Usage: ./run.rb file_name.extension' end if ARGV.size < 1 print_usage exit 1 else run end <file_sep>require 'spec_helper' RSpec.describe Executor do let(:robot) { Robot.new } subject { described_class.new(robot) } describe '#command' do it 'expects to ignore incorrect commands' do expect(subject.command('xyz')).to be_nil end context 'execute correct commands' do it 'expects to place the robot' do expect(robot).to receive(:place).with(1, 1, 'NORTH') subject.command('PLACE 1,1,NORTH') end %w(move left right).each do |method| it "expects to #{method} the robot" do expect(robot).to receive(method) subject.command(method) end end end end end <file_sep>require 'spec_helper' RSpec.describe Robot do subject { described_class.new } describe '#place' do let(:placement) {Placement.new(x: 1, y: 2, face: 'SOUTH')} it 'places the robot' do expect(subject.place(1, 2, 'SOUTH')).to eq(placement) end end describe '#report' do it 'reports position' do subject.place(1, 2, 'SOUTH') expect(subject.report).to eq('1,2,SOUTH') end end describe '#move' do context 'valid placement' do it 'moves to SOUTH' do subject.place(1, 2, 'SOUTH') subject.move expect(subject.report).to eq '1,1,SOUTH' end it 'moves to NORTH' do subject.place(1, 2, 'NORTH') subject.move expect(subject.report).to eq '1,3,NORTH' end it 'moves to EAST' do subject.place(1, 2, 'EAST') subject.move expect(subject.report).to eq '2,2,EAST' end it 'moves to WEST' do subject.place(1, 2, 'WEST') subject.move expect(subject.report).to eq '0,2,WEST' end end context 'invalid placement' do it 'ignores move' do subject.place(0, 5, 'WEST') subject.move expect(subject.report).to eq nil end end end describe '#left' do it 'turns from EAST to NORTH' do subject.place(0, 0, 'EAST') subject.left expect(subject.report).to eq '0,0,NORTH' end it 'turns from NORTH to WEST' do subject.place(0, 0, 'NORTH') subject.left expect(subject.report).to eq '0,0,WEST' end it 'turns from WEST to SOUTH' do subject.place(0, 0, 'WEST') subject.left expect(subject.report).to eq '0,0,SOUTH' end it 'turns from SOUTH to EAST' do subject.place(0, 0, 'SOUTH') subject.left expect(subject.report).to eq '0,0,EAST' end end describe '#right' do it 'turns from EAST to SOUTH' do subject.place(0, 0, 'EAST') subject.right expect(subject.report).to eq '0,0,SOUTH' end it 'turns from SOUTH to WEST' do subject.place(0, 0, 'SOUTH') subject.right expect(subject.report).to eq '0,0,WEST' end it 'turns from WEST to NORTH' do subject.place(0, 0, 'WEST') subject.right expect(subject.report).to eq '0,0,NORTH' end it 'turns from NORTH to EAST' do subject.place(0, 0, 'NORTH') subject.right expect(subject.report).to eq '0,0,EAST' end end end <file_sep>source :rubygems ruby '2.4.0' gem "rspec" gem 'pry' <file_sep>class Robot DIMENSION = 5 def place(x, y, face) @placement = Placement.new(x: x, y: y, face: face) rescue InvalidPlacement # robot ignores invalid move end def report placement.print unless placement.nil? end def move return if placement.nil? new_placement = placement case placement.face when Placement::FACE[:SOUTH] new_placement = Placement.new(x: placement.x, y: placement.y - 1, face: placement.face) when Placement::FACE[:NORTH] new_placement = Placement.new(x: placement.x, y: placement.y + 1, face: placement.face) when Placement::FACE[:EAST] new_placement = Placement.new(x: placement.x + 1, y: placement.y, face: placement.face) when Placement::FACE[:WEST] new_placement = Placement.new(x: placement.x - 1, y: placement.y, face: placement.face) end @placement = new_placement if new_placement.valid? rescue InvalidPlacement # robot ignores invalid move end def left return if placement.nil? turn(:left) end def right return if placement.nil? turn(:right) end private attr_reader :placement def turn(side) new_placement = Placement.new(x: placement.x, y: placement.y, face: Placement.turn(face: placement.face, side: side)) @placement = new_placement if new_placement.valid? end end <file_sep>class Placement FACE = { NORTH: 'NORTH', SOUTH: 'SOUTH', EAST: 'EAST', WEST: 'WEST' }.freeze TURN_RULES = { FACE[:EAST] => FACE[:NORTH], FACE[:NORTH] => FACE[:WEST], FACE[:WEST] => FACE[:SOUTH], FACE[:SOUTH] => FACE[:EAST] }.freeze DIMENSION = 5 attr_reader :x, :y, :face def initialize(x:, y:, face:) raise InvalidPlacement unless correct_face?(face) && correct_xy?(x, y) @x, @y, @face = x, y, face end def ==(other_placement) x == other_placement.x && y == other_placement.y && face == other_placement.face end def print "#{x},#{y},#{face}" end def valid? correct_face?(face) && correct_xy?(x, y) end def self.turn(side:, face:) if side == :left TURN_RULES[face] elsif side == :right TURN_RULES.key(face) end end private def correct_face?(face) FACE.values.include? face end def correct_xy?(x, y) x >= 0 && x < DIMENSION && y >=0 && y < DIMENSION end end class InvalidPlacement < StandardError def message 'Incorrect input' end end <file_sep>require 'spec_helper' RSpec.describe Runner do let(:executor) {Executor.new} subject do described_class.new(source: commands, executor: executor) end describe '#execute' do context 'first example' do let(:commands) do [ 'PLACE 0,0,NORTH', 'MOVE', 'REPORT' ] end it 'expects to report 0,1,NORTH ' do subject.execute expect(executor.command('report')).to eq '0,1,NORTH' end end context 'second example' do let(:commands) do [ 'PLACE 0,0,NORTH', 'LEFT', 'REPORT' ] end it 'expects to report 0,0,WEST' do subject.execute expect(executor.command('report')).to eq '0,0,WEST' end end context 'third example' do let(:commands) do [ 'PLACE 1,2,EAST', 'MOVE', 'MOVE', 'LEFT', 'MOVE', 'REPORT' ] end it 'expects to report 3,3,NORTH' do subject.execute expect(executor.command('report')).to eq '3,3,NORTH' end end end end <file_sep>require_relative '../executor' require_relative '../placement' require_relative '../robot' require_relative '../runner'
9ef9e2a665adb18b376a8b6823a2d8173e7006a4
[ "Ruby" ]
11
Ruby
lanadz/toy_robot
a33f8b7b6cfb68784b9813c2b23a9a8aed5f145c
abd7ad5fd1ffebc4e012fa1de97dcf661a59705f
refs/heads/master
<file_sep>import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'home_screen.dart'; class WelcomeText extends StatelessWidget { @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.all(38), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Vacation Trips", style: GoogleFonts.lato( fontSize: 36, fontWeight: FontWeight.w700, color: Colors.black54 ), ), SizedBox(height: 25), Text( 'Enjoy your vacations with warmth and amazing sightseeing on the . Enjoy the best experience with us!', style: GoogleFonts.lato( fontSize: 16, fontWeight: FontWeight.w500, color: Colors.black54, ) ), SizedBox(height: 40), GestureDetector( onTap: (){ Navigator.push(context, MaterialPageRoute( builder: (context) => HomeScreen() )); }, child: Container( alignment: Alignment.center, width: MediaQuery.of(context).size.width, padding: EdgeInsets.symmetric(vertical: 20), decoration: BoxDecoration( color: Color(0xff544c98), borderRadius: BorderRadius.circular(30), ), child: Text("Let's Go!", style: TextStyle( color: Colors.black, fontWeight: FontWeight.w500, fontSize: 17, ),), ), ), ], ), ); } } <file_sep>import 'package:cloud_firestore/cloud_firestore.dart'; class DatabaseMethods{ getUserByUsername(String username) async { return await Firestore.instance.collection("users") .where("name", isEqualTo: username) .getDocuments(); } getUserByUserEmail(String userEmail) async { return await Firestore.instance.collection("users") .where("email", isEqualTo: userEmail ) .getDocuments(); } uploadUserInfo(userMap){ Firestore.instance.collection("users") .add(userMap); } }<file_sep>import 'package:flutter/material.dart'; import 'package:fluttertravelapp/helper/authenticate.dart'; import 'package:fluttertravelapp/screens/top_banner.dart'; import 'package:fluttertravelapp/screens/welcome_text.dart'; import 'package:fluttertravelapp/services/auth.dart'; class DisplayScreen extends StatefulWidget { @override _DisplayScreenState createState() => _DisplayScreenState(); } class _DisplayScreenState extends State<DisplayScreen> { AuthMethods authMethods = new AuthMethods(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Image.asset("assets/images/logo.png", height: 50,), actions: [ GestureDetector( onTap: (){ authMethods.signOut(); Navigator.pushReplacement(context, MaterialPageRoute( builder: (context) => Authenticate(), )); }, child: Container( padding: EdgeInsets.symmetric(horizontal: 16), child: Icon(Icons.exit_to_app), ), ), ], ), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ TopBanner(), WelcomeText(), ], ), ), ); } } <file_sep>storePassword=<PASSWORD> keyPassword=<PASSWORD> keyAlias=key0 storeFile=C:\\Users\\Ajay\\Desktop\newKey.jks
ac9566c5eb8e692e057e861815773df097bc5213
[ "Dart", "INI" ]
4
Dart
Ishaan-01/Flutter-Travel_Package-_Application
17adf439c587e01fef46b4e7c1dea56fd1c017ca
0a16a47fbda6d34676f919ecc0e41467c20359f2
refs/heads/master
<file_sep>import React from 'react'; import { Appear, BlockQuote, Cite, Deck, Heading, Image, Link, ListItem, List, Quote, Slide, Spectacle, Table, TableHeaderItem, TableItem, TableRow, } from 'spectacle'; import preloader from 'spectacle/lib/utils/preloader'; import createTheme from 'spectacle/lib/themes/default'; import CodeSlide from 'spectacle-code-slide'; import 'normalize.css'; import 'spectacle/lib/themes/default/index.css'; // images import plouf from '../assets/plouf.gif'; import boring from '../assets/boring.gif'; import memory from '../assets/memory.gif'; import quizz from '../assets/quizz.gif'; import request from '../assets/request.gif'; import processWeb from '../assets/processWeb.png'; import operation from '../assets/operation.gif'; import teapot from '../assets/teapot.gif'; import pages from '../assets/pages.gif'; import problem from '../assets/problem.gif'; import homework from '../assets/homework.gif'; import summary from '../assets/summary.gif'; // code import requestCode from '../assets/request.example'; import responseCode from '../assets/response.example'; preloader({ plouf, boring, memory, quizz, request, processWeb, operation, teapot, pages, problem, homework, summary, }); const theme = createTheme({ primary: '#00a0e6', }); const Presentation = () => ( <Spectacle theme={theme}> <Deck transition={['zoom', 'fade']} transitionDuration={500}> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Intro </Heading> <Heading size={1} fit caps> au développement web </Heading> <Heading size={1} fit caps textColor="black"> Historique, fonctionnement et outils </Heading> </Slide> <Slide bgColor="black"> <BlockQuote> <Quote> Internet est un outil formidable, dommage qu'on y perde notre temps à regarder des vidéos de chats. </Quote> <Cite><NAME></Cite> </BlockQuote> </Slide> <Slide bgColor="black"> <Image src={plouf} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Le grand plongeon? </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> On fait quoi avec les technos web? </Heading> <List> <Appear><ListItem><Link href="http://rleonardi.com/interactive-resume/" target="_blank">Portfolio</Link></ListItem></Appear> <Appear><ListItem><Link href="http://visaglobe.jam3.net/" target="_blank">Dataviz</Link></ListItem></Appear> <Appear><ListItem><Link href="http://www.ro.me/" target="_blank">Clip interactif</Link></ListItem></Appear> <Appear><ListItem><Link href="http://codepen.io/Yakudoo/full/YXxmYR/" target="_blank">Des animaux mignons en 3D</Link></ListItem></Appear> <Appear><ListItem><Link href="https://www.trainline.fr/" target="_blank">Des apps</Link></ListItem></Appear> <Appear><ListItem>Et plein d'autres trucs...</ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={boring} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Mais c'est quoi le web?? </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Un peu d'histoire </Heading> <Heading size={1} fit caps lineHeight={1} textColor="black"> (c'est chiant mais ça vous permettra de gagner au Trivial Poursuit) </Heading> <List> <Appear><ListItem> 1958 : création du premier modem </ListItem></Appear> <Appear><ListItem> 1962 : début du projet ARPA visant à relier des ordinateurs </ListItem></Appear> <Appear><ListItem> 1971 : connexion des 1ers ordinateurs de 4 universités américaines </ListItem></Appear> <Appear><ListItem> 1971 : Envoi du premier mail par <NAME> </ListItem></Appear> <Appear><ListItem> 1983 : Premier serveur de noms de domaine </ListItem></Appear> <Appear><ListItem> 1989 : 100 000 ordinateurs connectés </ListItem></Appear> <Appear><ListItem> 1990 : Disparition de l’ARPAnet </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Encore des dates!! </Heading> <List> <Appear><ListItem> 1991 : Apparition du World Wide Web </ListItem></Appear> <Appear><ListItem> 1993 : Apparition du navigateur NSCA Mosaic </ListItem></Appear> <Appear><ListItem> 1996 : 10 000 000 ordinateurs connectés </ListItem></Appear> <Appear><ListItem> 2000 : explosion d’internet </ListItem></Appear> <Appear><ListItem> 2012 : 2 milliards d’utilisateurs dans le monde </ListItem></Appear> <Appear><ListItem> Depuis 2012, vous êtes au courant :) </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={memory} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Des mots à retenir!! </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Jouons à retrouver les mot clés de cet historique! </Heading> <List> <Appear><ListItem> ordinateurs </ListItem></Appear> <Appear><ListItem> mail </ListItem></Appear> <Appear><ListItem> serveur </ListItem></Appear> <Appear><ListItem> noms de domaine </ListItem></Appear> <Appear><ListItem> World Wide Web </ListItem></Appear> <Appear><ListItem> navigateur </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={quizz} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Quizz time! </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Faire une phrase avec ces mots </Heading> <List> <ListItem> ordinateurs </ListItem> <ListItem> mail </ListItem> <ListItem> serveur </ListItem> <ListItem> noms de domaine </ListItem> <ListItem> World Wide Web </ListItem> <ListItem> navigateur </ListItem> </List> </Slide> <Slide bgColor="black"> <Image src={request} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Une histoire de requêtes (et de réponses) </Heading> </Slide> <Slide bgColor="primary"> <Heading size={2} caps fit>Je souhaite consulter mes mails.</Heading> <Image src={processWeb} margin="40px auto 0px" width="850px" /> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Le navigateur ... </Heading> <List> <Appear><ListItem> est un logiciel qui permet d'émettre des requêtes </ListItem></Appear> <Appear><ListItem> permet de recevoir des réponses </ListItem></Appear> <Appear><ListItem> sait afficher le résultat de ces réponses </ListItem></Appear> <Appear><ListItem> il y en a plein! Chrome, Firefox, Safari, IE, etc. </ListItem></Appear> <Appear><ListItem> dans plein de versions différentes! </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Un serveur de noms c'est ... </Heading> <List> <Appear><ListItem> ce qu'on apelle un DNS (Domain Naming System) </ListItem></Appear> <Appear><ListItem> un serveur qui sait traduire une URL en adresse IP </ListItem></Appear> <Appear><ListItem> DIY: accédez à google.com via son IP, 172.16.17.32 </ListItem></Appear> <Appear><ListItem> sans DNS, on taperait que des IPs dans la barre d'adresse! </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Un serveur web c'est ... </Heading> <List> <Appear><ListItem> un serveur qui reçoit des requêtes </ListItem></Appear> <Appear><ListItem> envoie des réponses </ListItem></Appear> <Appear><ListItem> page statiques, dynamiques, API, ... </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={operation} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Anatomie d'une requête et d'une réponse </Heading> </Slide> <CodeSlide transition={[]} lang="markup" code={requestCode} ranges={[ { loc: [0, 1], note: 'Méthode de la requête, ici GET' }, { loc: [0, 1], note: 'Page du serveur demandée, ici /' }, { loc: [0, 1], note: 'Version du protocole HTTP, ici 1.1' }, { loc: [1, 2], note: 'Site web requêté' }, { loc: [2, 3], note: 'Type de contenu requêté par le navigateur' }, { loc: [3, 4], note: 'Navigateur utilisé, et OS' }, { loc: [4, 5], note: 'D\'autres trucs, qui nous intéressent pas' }, ]} /> <CodeSlide transition={[]} lang="markup" code={responseCode} ranges={[ { loc: [0, 1], note: 'Réponse du serveur' }, { loc: [1, 2], note: 'Date de la réponse' }, { loc: [2, 3], note: 'Type de serveur répondant' }, { loc: [3, 4], note: 'Type du contenu de la réponse' }, { loc: [5, 9], note: 'Contenu de la réponse du serveur' }, ]} /> <Slide bgColor="black"> <Image src={teapot} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Les codes HTTP </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> HTTP codes </Heading> <Table> <TableRow> <TableHeaderItem>Famille</TableHeaderItem> <TableHeaderItem>Description</TableHeaderItem> <TableHeaderItem>Exemple</TableHeaderItem> </TableRow> <TableRow> <TableItem>1xx</TableItem> <TableItem>Information</TableItem> <TableItem /> </TableRow> <TableRow> <TableItem>2xx</TableItem> <TableItem>Succès</TableItem> <TableItem>200 : succès de la requête</TableItem> </TableRow> <TableRow> <TableItem>4xx</TableItem> <TableItem>Erreur du client</TableItem> <TableItem>404 : resource non trouvée</TableItem> </TableRow> <TableRow> <TableItem>5xx</TableItem> <TableItem>Erreur du serveur</TableItem> <TableItem>500 : erreur interne du serveur</TableItem> </TableRow> </Table> <Link href="https://fr.wikipedia.org/wiki/Liste_des_codes_HTTP" target="_blank">Liste des codes HTTP</Link> </Slide> <Slide bgColor="black"> <Image src={pages} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Les différents types de réponses et pages d'un serveur </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Jouons à naviguer sur internet! </Heading> <List> <Appear><ListItem> allez sur votre boite mail </ListItem></Appear> <Appear><ListItem> allez sur votre réseau social préféré </ListItem></Appear> <Appear><ListItem> allez sur <Link href="https://xseignard.github.io/ecv-1" target="_blank">la page de ces slides</Link> </ListItem></Appear> <Appear><ListItem> allez sur <Link href="http://data.nantes.fr/api/getFluiditeAxesRoutiers/1.0/51G0VBM9453IF7R/?output=json" target="_blank">cette page</Link> </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Page statique </Heading> <List> <Appear><ListItem> toujours la même </ListItem></Appear> <Appear><ListItem> quelque soit la personne la visitant </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Page dynamique </Heading> <List> <Appear><ListItem> contenu adapté au visiteur </ListItem></Appear> <Appear><ListItem> authentification, localisation, langue, etc. </ListItem></Appear> <Appear><ListItem> deux types de pages dynamiques, générée sur le serveur ou sur le navigateur </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} caps lineHeight={1} textColor="black"> API </Heading> <List> <Appear><ListItem> page dynamique ou statique? </ListItem></Appear> <Appear><ListItem> expose des données </ListItem></Appear> <Appear><ListItem> ensuite exploitables depuis une autre page HTML, une app mobile, etc. </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={problem} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Les réjouissances du développement web </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> World Wide Web ou World Wild Web? </Heading> <List> <Appear><ListItem> géré par le <Link href="https://www.w3.org/" target="_blank">W3C</Link> </ListItem></Appear> <Appear><ListItem> organisme de spécification et standardisation d'HTML et CSS (entre autres) </ListItem></Appear> <Appear><ListItem> les navigateurs "implémentent" ces spécifications </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> "One web for all", c'est beau mais c'est faux! </Heading> <List> <Appear><ListItem> les différents navigateurs n'implémentent pas les spécifications à la même vistesse </ListItem></Appear> <Appear><ListItem> une fonctionalité disponible sur un navigateur et pas sur un autre </ListItem></Appear> <Appear><ListItem> une fonctionalité disponible sur une version d'un navigateur et pas sur une autre </ListItem></Appear> <Appear><ListItem> un cauchemard pour le développeur web... </ListItem></Appear> </List> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> Les outils à la rescousse!!! </Heading> <List> <Appear><ListItem> il existe une multitude d'outils pour harmoniser ces différences </ListItem></Appear> <Appear><ListItem> votre nouvel ami : <Link href="http://caniuse.com/#feat=css-matches-pseudo" target="_blank">caniuse.com</Link> </ListItem></Appear> <Appear><ListItem> et d'autres bons potes: <Link href="http://www.alsacreations.com/astuce/lire/36-reset-css.html" target="_blank">les resets CSS</Link>, <Link href="https://remysharp.com/2010/10/08/what-is-a-polyfill" target="_blank">les polyfills</Link> </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={homework} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> HTML, HTML5, CSS2, CSS3, WAAAT? </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> C'est vous les profs! </Heading> <List> <Appear><ListItem> trouver des références sur l'historique des versions HTML et CSS </ListItem></Appear> <Appear><ListItem> faire un topo là dessus! </ListItem></Appear> <Appear><ListItem> à vous de jouer! </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={summary} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Si on résume </Heading> </Slide> <Slide bgColor="primary"> <Heading size={1} fit caps lineHeight={1} textColor="black"> les internets c'est </Heading> <List> <Appear><ListItem> des serveurs et des clients (navigateurs, app, etc.) </ListItem></Appear> <Appear><ListItem> des requêtes HTTP et des réponses HTTP </ListItem></Appear> <Appear><ListItem> des pages HTML, statiques ou dynamiques, des API </ListItem></Appear> <Appear><ListItem> des standards, différents navigateurs et différentes versions de tout ça! </ListItem></Appear> <Appear><ListItem> vieux et un cauchemard :) (mais pas tant que ça!) </ListItem></Appear> </List> </Slide> <Slide bgColor="black"> <Image src={plouf} margin="0px auto 40px" height="293px" /> <Heading size={2} caps fit textColor="primary"> Alors, on plonge? </Heading> </Slide> </Deck> </Spectacle> ); export default Presentation;
fb88db2015056f9a1f416790a87c4a5c75cbb117
[ "JavaScript" ]
1
JavaScript
IMAGE-ET/ecv-1
d69214a7d761c4c8aec8d3c27c8b7dd2a69b35d4
2b93d0d5f92c1dbf63dd4391d2256c072592dc0a
refs/heads/master
<repo_name>sze-chuan/Contacts-Wpf-App<file_sep>/README.md # Contact App Contact App is an application that stores information of the contacts. It is developed using WPF and follows the MVVM design pattern.<file_sep>/ContactsApp/ViewModels/ContactMainViewModel.cs using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Data; using ContactsApp.Commands; using ContactsApp.Models; using System.Windows.Input; namespace ContactsApp.ViewModels { public class ContactMainViewModel : ViewModelBase { public ContactMainViewModel(IList<Contact> preGeneratedContacts = null) { Contacts = preGeneratedContacts != null ? new ObservableCollection<Contact>(preGeneratedContacts) : new ObservableCollection<Contact>(); SetupContactsView(); Mode = ApplicationMode.None; } private Contact _selectedContact; private ObservableCollection<Contact> _contacts; private ICollectionView ContactsView { get; set; } private ApplicationMode _mode; private string _searchText; private DelegateCommand _addNewContactCommand; private DelegateCommand _saveContactCommand; private DelegateCommand _editContactCommand; private DelegateCommand _cancelCommand; private DelegateCommand _deleteContactCommand; public Contact SelectedContact { get => _selectedContact; set { _selectedContact = value; OnPropertyChanged(nameof(SelectedContact)); } } public ObservableCollection<Contact> Contacts { get => _contacts; set { _contacts = value; OnPropertyChanged(nameof(Contacts)); } } public ApplicationMode Mode { get => _mode; set { _mode = value; OnPropertyChanged(nameof(Mode)); OnPropertyChanged(nameof(ShowContactInfo)); OnPropertyChanged(nameof(ShowDeleteButton)); OnPropertyChanged(nameof(ContactHeaderText)); } } public string SearchText { get => _searchText; set { if (value == _searchText) return; _searchText = value; ContactsView.Refresh(); OnPropertyChanged(nameof(SearchText)); } } public bool ShowContactInfo => Mode == ApplicationMode.Add || Mode == ApplicationMode.Edit; public bool ShowDeleteButton => Mode == ApplicationMode.Edit; public string ContactHeaderText => Mode == ApplicationMode.Add ? "Add New Contact" : "Edit Contact"; #region Command related public ICommand AddNewContactCommand => _addNewContactCommand ??= new DelegateCommand(AddNewContact, CanAddNewContact); public ICommand SaveContactCommand => _saveContactCommand ??= new DelegateCommand(SaveContact, CanSaveContact); public ICommand EditContactCommand => _editContactCommand ??= new DelegateCommand(EditContact, CanEditContact); public ICommand CancelCommand => _cancelCommand ??= new DelegateCommand(CancelContact, CanCancelContact); public ICommand DeleteCommand => _deleteContactCommand ??= new DelegateCommand(DeleteContact, CanDeleteContact); private void AddNewContact(object commandParameter) { Mode = ApplicationMode.Add; SelectedContact = new Contact(); } private bool CanAddNewContact(object commandParameter) { return Mode == ApplicationMode.None; } private void SaveContact(object commandParameter) { if (Mode == ApplicationMode.Add) { Contacts.Add(SelectedContact); } else if (Mode == ApplicationMode.Edit) { var contactIndex = Contacts.IndexOf(SelectedContact); Contacts[contactIndex].FirstName = SelectedContact.FirstName; } Mode = ApplicationMode.None; } private bool CanSaveContact(object commandParameter) { return true; } private void CancelContact(object commandParameter) { Mode = ApplicationMode.None; } private bool CanCancelContact(object commandParameter) { return true; } private void EditContact(object commandParameter) { if (commandParameter != null) { Mode = ApplicationMode.Edit; SelectedContact = (Contact)commandParameter; } } private bool CanEditContact(object commandParameter) { return true; } private void DeleteContact(object commandParameter) { if (SelectedContact != null) { Contacts.Remove(SelectedContact); } Mode = ApplicationMode.None; } private bool CanDeleteContact(object commandParameter) { return Mode == ApplicationMode.Edit; } #endregion private void SetupContactsView() { ContactsView = CollectionViewSource.GetDefaultView(Contacts); ContactsView.Filter = contact => string.IsNullOrEmpty(SearchText) || ((Contact)contact).FullName.Contains(SearchText, StringComparison.InvariantCultureIgnoreCase); ContactsView.SortDescriptions.Add(new SortDescription("FullName", ListSortDirection.Ascending)); } } public enum ApplicationMode { Add, Edit, None } } <file_sep>/UnitTests/ContactMainViewModelTests.cs using System.Collections.ObjectModel; using System.Linq; using ContactsApp.Models; using NUnit.Framework; using ContactsApp.ViewModels; namespace UnitTests { [TestFixture] public class Tests { private ContactMainViewModel ViewModel { get; set; } [SetUp] public void Setup() { ViewModel = new ContactMainViewModel(); } [TestCase(ApplicationMode.Add, true)] [TestCase(ApplicationMode.Edit, true)] [TestCase(ApplicationMode.None, false)] public void ShowContactInfoTests(ApplicationMode mode, bool expected) { ViewModel.Mode = mode; Assert.AreEqual(expected, ViewModel.ShowContactInfo); } [TestCase(ApplicationMode.Add, false)] [TestCase(ApplicationMode.Edit, true)] [TestCase(ApplicationMode.None, false)] public void ShowDeleteButtonTests(ApplicationMode mode, bool expected) { ViewModel.Mode = mode; Assert.AreEqual(expected, ViewModel.ShowDeleteButton); } [TestCase(ApplicationMode.Add)] [TestCase(ApplicationMode.Edit)] [TestCase(ApplicationMode.None)] public void ContactHeaderTextTests(ApplicationMode mode) { var expected = mode == ApplicationMode.Add ? "Add New Contact" : "Edit Contact"; ViewModel.Mode = mode; Assert.AreEqual(expected, ViewModel.ContactHeaderText); } [TestCase(ApplicationMode.Add, false)] [TestCase(ApplicationMode.Edit, false)] [TestCase(ApplicationMode.None, true)] public void CanAddNewCommandTests(ApplicationMode mode, bool expected) { ViewModel.Mode = mode; Assert.AreEqual(expected, ViewModel.AddNewContactCommand.CanExecute(null)); } [Test] public void AddNewCommandTest() { ViewModel.AddNewContactCommand.Execute(null); Assert.AreEqual(ApplicationMode.Add, ViewModel.Mode); Assert.IsNotNull(ViewModel.SelectedContact); } [Test] public void SaveContactWhenContactIsNewTest() { ViewModel.Mode = ApplicationMode.Add; ViewModel.SelectedContact = new Contact {FirstName = "test"}; ViewModel.SaveContactCommand.Execute(null); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.IsTrue(ViewModel.Contacts.Any(x => x.FirstName == "test")); } [Test] public void SaveContactWhenContactIsExistingTest() { var contact = new Contact {FirstName = "test"}; ViewModel.Contacts = new ObservableCollection<Contact>{ contact }; ViewModel.Mode = ApplicationMode.Edit; ViewModel.SelectedContact = contact; ViewModel.SelectedContact.LastName = "test1"; ViewModel.SaveContactCommand.Execute(null); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.AreEqual(1, ViewModel.Contacts.Count); Assert.IsTrue(ViewModel.Contacts.Any(x => x.LastName == "test1")); } [Test] public void DoNotSaveContactWhenModeIsNoneTest() { ViewModel.Mode = ApplicationMode.None; ViewModel.SelectedContact = new Contact { FirstName = "test" }; ViewModel.SaveContactCommand.Execute(null); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.AreEqual(0, ViewModel.Contacts.Count); } [Test] public void EditContactWhenCommandParameterIsNotNullTest() { var contact = new Contact {FirstName = "test"}; ViewModel.EditContactCommand.Execute(contact); Assert.AreEqual(ApplicationMode.Edit, ViewModel.Mode); Assert.AreEqual(contact, ViewModel.SelectedContact); } [Test] public void EditContactWhenCommandParameterIsNullTest() { ViewModel.EditContactCommand.Execute(null); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.IsNull(ViewModel.SelectedContact); } [Test] public void DeleteContactWhenSelectedContactIsNotNullTest() { var contact = new Contact { FirstName = "test" }; ViewModel.Contacts = new ObservableCollection<Contact> { contact }; ViewModel.Mode = ApplicationMode.Edit; ViewModel.SelectedContact = contact; ViewModel.DeleteCommand.Execute(contact); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.AreEqual(0, ViewModel.Contacts.Count); } [Test] public void DoNotDeleteContactWhenSelectedContactIsNullTest() { var contact = new Contact { FirstName = "test" }; ViewModel.Contacts = new ObservableCollection<Contact> { contact }; ViewModel.Mode = ApplicationMode.Edit; ViewModel.DeleteCommand.Execute(contact); Assert.AreEqual(ApplicationMode.None, ViewModel.Mode); Assert.AreEqual(1, ViewModel.Contacts.Count); } [TestCase(ApplicationMode.Add, false)] [TestCase(ApplicationMode.Edit, true)] [TestCase(ApplicationMode.None, false)] public void CanDeleteContactTests(ApplicationMode mode, bool expected) { ViewModel.Mode = mode; Assert.AreEqual(expected, ViewModel.DeleteCommand.CanExecute(null)); } } }<file_sep>/ContactsApp/Utilities/ContactUtility.cs using System.Collections.Generic; using ContactsApp.Models; namespace ContactsApp.Utilities { public class ContactUtility { /// <summary> /// Method to pre-populate data /// </summary> /// <returns>List of contacts</returns> public static IList<Contact> GenerateContacts() { var contacts = new List<Contact>(); for (var i = 0; i < 30; i++) { var contact = new Contact { FirstName = "Person", LastName = "Test" + i, AddressLine1 = "Address Line 1", AddressLine2 = "Address Line 2", Country = "Singapore", Email = "<EMAIL>", Mobile = "91234554" + i, PostalCode = "123456" }; contacts.Add(contact); } return contacts; } } } <file_sep>/ContactsApp/App.xaml.cs using System.Collections.ObjectModel; using System.Windows; using ContactsApp.Models; using ContactsApp.Utilities; using ContactsApp.ViewModels; using ContactsApp.Views; namespace ContactsApp { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // Pre-populate with some random generated data var contactMainViewModel = new ContactMainViewModel(ContactUtility.GenerateContacts()); var contactMain = new ContactMain {DataContext = contactMainViewModel}; contactMain.Show(); } } } <file_sep>/ContactsApp/Models/Contact.cs using System.ComponentModel; namespace ContactsApp.Models { public class Contact : INotifyPropertyChanged { private string _firstName; private string _lastName; private string _email; public string FirstName { get => _firstName; set { _firstName = value; OnPropertyChanged(nameof(FullName)); } } public string LastName { get => _lastName; set { _lastName = value; OnPropertyChanged(nameof(FullName)); } } public string Email { get => _email; set { _email = value; OnPropertyChanged(nameof(Email)); } } public string Mobile { get; set; } public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } public string PostalCode { get; set; } public string Country { get; set; } public string FullName => $@"{FirstName} {LastName}"; public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) => OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { var handler = PropertyChanged; handler?.Invoke(this, e); } } }
c891cd4e86702bdc5267dee7857ab18b25942a77
[ "C#", "Markdown" ]
6
C#
sze-chuan/Contacts-Wpf-App
7b87b850e2d0c477219ba0cf29ba2dd4667a8bde
a0f1c3122485122defc3de7ddfc9eee3998d4b69
refs/heads/master
<file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da silva egito <NAME> Curso: Ciência da Computação */ #include "permutar.h" //Biblioteca permutar definida em permutar.c #include <ctype.h> //Utilizamos essa bilbioteca pois incluimos a função isalpha(). "isalpha()" verifica se o caracter é alfabético #define MAX 256 // Funcao que verifica as entradas void stringEntrada(char*);//Assinatura da função para verificar caracteres char charEntrada(); //Assinatura da funçao para verificar entrada (para char) int inteiroEntrada(); //Assinatura da funçao para verificar entrada(para inteiro) void Ordena(fila**, int);//Organizar as caixas por quantidade de bolas : Ordem nao descrescente (Valores podem ser iguais na ordenação) //Funçao utilizada para ordenação das caixas void Ordena(fila **vet_caixa, int qnt_caixa){ // Bubble Sort: Simples int i, j; fila *aux; for(i = 0; i < qnt_caixa ; i++){ for(j = i+1; j < qnt_caixa ; j++){ if (quantidade_fila(vet_caixa[i]) > quantidade_fila(vet_caixa[j])){ aux = vet_caixa[i]; vet_caixa[i] = vet_caixa[j]; vet_caixa[j] = aux; } } } } void stringEntrada(char* str){//Usado ao pedir (Cor de bolas) do{ fgets(str, MAX, stdin); //Para receber a string str[strlen(str) - 1] = '\0'; // Remocao do \n do final da string if (!isalpha(str[0]))//Verifica se a entrada é um '\n' ou espaço, caso seja o usuário recebe uma mensagem para inserir um novo valor printf("Entrada Invalida!\nInforme novamente: "); else break; }while(1); } char charEntrada(){//Função que verifica se a entrada é um char. Caso nao, pede para inserir um novo valor (Até que seja do tipo char) char str[MAX]; do { fgets(str,MAX,stdin); //Para receber a string //Isalpha verifica se o caracter inserido é alguma letra do alfabeto if (strlen(str) == 2 && isalpha(str[0])) // isalpha(str[0]) = (str[0] >= 'a' && str[0] <= 'z') || (str[0] >= 'A' && str[0] <= 'Z') return str[0]; else //Casao nao seja letra do alfabeto, pedimos ao usuario para inserir um novo valor printf("Entrada Invalida!\nInforme novamente: "); } while (1); } int inteiroEntrada(){ //Faz verificação da entrada, se é realmente um número inteiro. Caso nao, pede para inserir um novo valor (Até que seja um inteiro) char *p, s[MAX]; int n; while (fgets(s, sizeof(s), stdin)) { //Leitura da entrada como string n = strtol(s, &p, 10);//Conversao para inteiro, strtol converte a string ate o primeiro char diferente de um numero, retorna o numero convertido e aponta o char* ate a posicao que parou if (p == s || *p != '\n') { // Se o char que parou for igual o inicio ou diferente do ENTER, é considerado uma entrada invalida printf("Entrada Invalida!\nInforme novamente: "); } else if (n<=0){//Verifica se a quantidade de bolas e caixas inseridas é maior que zero printf("Entrada Invalida!\nInforme um valor maior que zero: "); } else break; } return n; } int main(int argc, char** arg){ int i,j,k; int qnt_caixa; // Quantidade de caixas char str[MAX]; // Cor da caixa, que tem MAX como tamanho 256 char c; // Caracter da Bola fila* aux; // Auxiliar usado para ordenação das caixas em forma nao decrescente fila** vet_caixa; // Vetor de caixa que armazena as bolas //Caso seja feita a entrada na linha de comando do terminal //Depois de ter digitado inserido o ./exec //Iremos inserir a cor da caixa e as respectivas bolas que estao contidas nesta caixa //Por exemplo: "./exec preta abc rosa hj", sendo preta a cor da caixa e abc suas respectivas bolas, e assim sucessivamente (Explicaçao mais detalhada no relatório na parte de compilação) if ((argc % 2 == 1) && argc != 1){ // Entrada de dados na linha de comando do terminal qnt_caixa = ((argc-1)/2); // argc conta quantas string foram digitadas, contando com o nome do programa, entao se subtrai 1 e divide por 2 para obter a quantidade de caixas vet_caixa = (fila**)calloc(qnt_caixa,sizeof(fila*)); // alocacao do vetor de filas for(i = 0; i < qnt_caixa; i++) // alocacao de cada posicao do vetor vet_caixa[i] = nova_fila(arg[2 * i + 1]); for(i = 0, k = 2; i < qnt_caixa; i++,k+=2){ // preenche cada fila for(j = 0; j < strlen(arg[k]) ; j++) insere_fila(vet_caixa[i],arg[k][j]); } } else { // entrada de dados manual printf("Informe a quantidade de caixas: "); qnt_caixa = inteiroEntrada(); //Insere a quantidade de caixas, e faz a verificação se o número é realmente inteiro vet_caixa = (fila**)calloc(qnt_caixa,sizeof(fila*));//Aloca a quantidade de caixa(s) inserida(s) anteriormente em uma fila for(i = 0; i < qnt_caixa; i++){ // Aloca cada posicao do vetor printf("Cor da Caixa %d: ",i+1); stringEntrada(str);//Chamada função para verificar entrada de string vet_caixa[i] = nova_fila(str); // Aloca espaco da caixa printf("Informe a quantidade de bolas: "); j = inteiroEntrada(); //Inserção de quantidade de bolas referente a caixa[i], e verificaçao se o número é realmente inteiro for(k = 0; k < j; k++){//For para inserçao de bolas na caixa printf("Bola %d: ",k+1); c = charEntrada(); //Chamada da funcao de entrada do caracter da bola insere_fila(vet_caixa[i],c); //Inserção do caracter de cada bola, referente a caixa[i] } } } //Chamda da função para ordenação de caixas de forma nao decrescente Ordena(vet_caixa, qnt_caixa); //Chamada da função para permutar permutar(vet_caixa,qnt_caixa); // Libera memoria alocada for(i = 0; i < qnt_caixa ; i++) free_fila(vet_caixa[i]); free(vet_caixa); return 0; }<file_sep>## 🎲 Data Structure 👨🏻‍💻 Alguns algoritmos desenvolvidos utilizando a linguagem de programação C, enfatizando a estrutura de dados. ### 📌 Algoritmos de ordenação: - [QuickSort](https://github.com/WellersonPrenholato/data-structure/blob/master/Estrutura%20de%20Dados%20II/Algoritmos%20de%20Ordena%C3%A7%C3%A3o/quickSort.c) - [MergeSort](https://github.com/WellersonPrenholato/data-structure/blob/master/Estrutura%20de%20Dados%20II/Algoritmos%20de%20Ordena%C3%A7%C3%A3o/mergeSort.c) - [HeapSort](https://github.com/WellersonPrenholato/data-structure/blob/master/Estrutura%20de%20Dados%20II/Algoritmos%20de%20Ordena%C3%A7%C3%A3o/heapsort.c) - [InsertionSort](https://github.com/WellersonPrenholato/data-structure/blob/master/Estrutura%20de%20Dados%20II/Algoritmos%20de%20Ordena%C3%A7%C3%A3o/insertionSort.c) <file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da <NAME> <NAME> Curso: Ciência da Computação */ #include "permutar.h" void permutar(fila** vet_cx, int k) { int i; if (k > 0){ permutacao* novo = (permutacao*)malloc(sizeof(permutacao)); // aloca novo do tipo permutacao if (novo){ // verifica se novo foi alocado novo->qnt_caixa = k; // insere a qnt de caixas na estrutura pilha** vet_pilha = (pilha**)calloc(k, sizeof(pilha*)); // aloca vetor de pilhas necessarias na permutacao if (vet_pilha){ // verifica vet_pilha foi alocado for(i = 0; i < k; i++) // aloca cada posicao do vetor vet_pilha[i] = nova_pilha("\0"); novo->caixa = vet_cx; novo->perm = vet_pilha; //Chama a funçao permutacao recursiva permutar_rec(novo, 0); // Libera o espaco de memoria (Free) for(i = 0; i < k ; i++) free_pilha(vet_pilha[i]); free(vet_pilha); } } } } void permutar_rec(permutacao* permS, int count){ char c; int i,j; fila** fila = permS->caixa; // melhor visibilidade pilha** pilha = permS->perm; // melhor visibilidade if (quantidade_fila(fila[count]) == 0){ // caso base: quantidade igual a 0 --> tem uma permutacao if (count == permS->qnt_caixa-1){ // verifica se e a ultima caixa for(j = 0; j < permS->qnt_caixa; j++){ // imprime a sequencia de permSutacao de todas as caixas cor_fila(fila[j]); printf(" | "); imprimir_pilha(pilha[j]); printf("| "); } printf("\n"); } else{ // caso nao for a ultima caixa count++; // atualiza o valor para que a prox caixa seja permutada permutar_rec(permS,count); // chama recursao para a prox caixa } } else { for(i = 0; i < quantidade_fila(fila[count]); i++){ // for para a quantidade de bolas na caixa c = remove_fila(fila[count]); // retira da fila insere_pilha(pilha[count],c); // coloca na pilha permutar_rec(permS,count); // chamada recursiva c = remove_pilha(pilha[count]); // backtrack insere_fila(fila[count],c); } } }<file_sep># [Algoritmos de Ordenação] Algoritmo de ordenação é um algoritmo que coloca os elementos de uma dada sequência em uma certa ordem em outras palavras, efetua sua ordenação completa ou parcial. As ordens mais usadas são a numérica e a lexicográfica. > Esses algoritmos foram implementados utilizando a linguagem C. > "Primeiro coloque os números em ordem. > Depois decidimos o que fazer." > - Estratégia Algorítmica --- [Algoritmos de Ordenação]: https://pt.wikipedia.org/wiki/Algoritmo_de_ordena%C3%A7%C3%A3o ### Algoritmos implementados: - QuickSort - MergeSort - HeapSort - InsertionSort <file_sep>all:main.o fila.o pilha.o permutar.o gcc -o exec *.o fila.o: fila.c gcc -c fila.c permutar.o: permutar.c gcc -c permutar.c pilha.o: pilha.c gcc -c pilha.c main.o: main.c gcc -c main.c clean: rm -f *.o <file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da silva egito <NAME> Curso: Ciência da Computação */ #ifndef _PILHA_H_ #define _PILHA_H_ #include <stdlib.h> #include <stdio.h> #include <string.h> //Definição das estruturas typedef struct bolaP { char elem;//Armazena o char que representa a letra struct bolaP* prox; struct bolaP* ant; } bolaP; //Estrutura bolaP é armazenada na pilha typedef struct pilha{ char* cor;//Cor da caixa int quantidade; // Quantidade de bola(s) na pilha (caixa) bolaP* ini; //Ponteiro para a ultima bola da pilha bolaP* fim; //Ponteiro para a ultima bola da pilha } pilha; //TAD Pilha // Cria nova bolaP, retornando ponteiro para a bolaP // Entrada: 1 char bolaP* nova_bolaPP(char); // Cria nova pilha vazia, retornando ponteiro para a bolaP // Entrada: cor da pilha em string pilha* nova_pilha(char*); // Funcao de inserir no topo da pilha, retorna o char removido void insere_pilha(pilha*,char); // Funcao de remover no topo da pilha, retorna o char removido char remove_pilha(pilha*); // Imprimi a pilha void imprimir_pilha(pilha*); // Quantidade de elementos na pilha, retorna int int quantidade_pilha(pilha*); // free na memoria alocada pela pilha void free_pilha(pilha*); // imprime a cor da pilha void cor_pilha(pilha*); #endif<file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da silva egito <NAME> Curso: Ciência da Computação */ #ifndef _PERMUTAR_H_ #define _PERMUTAR_H_ #include "fila.h" #include "pilha.h" typedef struct permutacao{ fila** caixa; // vetor de fila (representam as caixas) pilha** perm; // vetor de pilha que contem a permutacao int qnt_caixa; // quantidade de caixas } permutacao; //Estrutura que armazena vetores de pilha e fila // funcao que recebe as caixas e aloca a estrutura permutacao necessaria para utilizar a funçao permutacao recursiva // entrada: ponteiro para o vetor de caixas, quantidade de caixa void permutar(fila**, int); // funcao recursiva das permutacoes // entrada: estrutura de permutacao, int que conta em qual caixa esta permutando void permutar_rec(permutacao*, int); #endif<file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da silva egito <NAME> Curso: Ciência da Computação */ //Funçoes básicas de gereciamento de pilha #include "pilha.h" //Função para desalocar uma pilha void free_pilha(pilha* P){ bolaP *aux, *temp; if (P) { aux = P->ini; while (aux){ temp = aux; aux = aux->prox; free(temp); } free(P); } } //Função para imprimir a cor da pilha void cor_pilha(pilha* P){ printf("%s",P->cor); } //Funçao para alocar uma nova bolaP bolaP* nova_bolaP(char c){ bolaP* nova = (bolaP*)calloc(1,sizeof(bolaP)); if (nova) nova->elem = c; return nova; } //Funçao para alocar uma nova pilha pilha* nova_pilha(char* cor){ pilha* nova = (pilha*)calloc(1,sizeof(pilha)); if (nova){ nova->cor = (char*)malloc(strlen(cor)); strcpy(nova->cor,cor); } return nova; } //Função para inserir uma nova bolaP na pilha void insere_pilha(pilha* P,char c){ if (P){ bolaP* nova = nova_bolaP(c); if (nova){ if (P->ini && P->fim){ nova->ant = P->fim; P->fim->prox = nova; P->fim = nova; } else { P->ini = nova; P->fim = nova; } P->quantidade++; } } } //Função para remover uma bola da pilha char remove_pilha(pilha* P){ bolaP* aux; char c = '\0'; if (P){ aux = P->fim; c = aux->elem; if (P->ini && P->fim){ if (P->ini == P->fim){ P->ini = NULL; P->fim = NULL; } else{ P->fim->ant->prox = NULL; P->fim = P->fim->ant; } free(aux); P->quantidade--; } } return c; } //Funçao para imprimir uma pilha void imprimir_pilha(pilha* P){ if (P){ bolaP* aux = P->ini; while (aux){ printf("%c ",aux->elem); aux = aux->prox; } } } //Funçao para imprimir a quantidade de elementos na pilha int quantidade_pilha(pilha* P){ int x=-1; if (P) x = P->quantidade; return x; }<file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> <NAME> <NAME> Curso: Ciência da Computação */ //Funçoes básicas de gerenciamento de Fila #include "fila.h" //Funçao para desalocar fila void free_fila(fila* F){ bolaF *aux, *temp; if (F) { aux = F->ini; while (aux){ temp = aux; aux = aux->prox; free(temp); } free(F); } } //Função que imprime a cor de cada fila void cor_fila(fila* F){ printf("%s",F->cor); } //Funçao para alocar uma nova bolaF bolaF* nova_bolaF(char c){ bolaF* nova = (bolaF*)calloc(1,sizeof(bolaF)); if (nova) nova->elem = c; return nova; } //Função para criar uma nova fila fila* nova_fila(char* cor){ fila* nova = (fila*)calloc(1,sizeof(fila)); if (nova){ nova->cor = (char*)malloc(strlen(cor)); strcpy(nova->cor,cor); } return nova; } //Funçao para inserir na fila uma nova bolaF void insere_fila(fila* F,char c){ if (F){ bolaF* nova = nova_bolaF(c); if (nova){ if (F->ini && F->fim){ nova->ant = F->fim; F->fim->prox = nova; F->fim = nova; } else { F->ini = nova; F->fim = nova; } F->quantidade++; } } } //Funçao para remover uma bolaF na fila char remove_fila(fila* F){ bolaF* aux; char c = '\0'; if (F){ aux = F->ini; c = aux->elem; if (F->ini && F->fim){ if (F->ini == F->fim){ F->ini = NULL; F->fim = NULL; } else{ F->ini->prox->ant = NULL; F->ini = F->ini->prox; } free(aux); F->quantidade--; } } return c; } //Função para imprimir uma fila void imprimir_fila(fila* F){ if (F){ bolaF* aux = F->ini; while (aux){ printf("%c ",aux->elem); aux = aux->prox; } } } //Funçao que acessa a quantidade de bolas na fila int quantidade_fila(fila* F){ int x=-1; if (F) x = F->quantidade; return x; }<file_sep>//Algoritmo de Ordenação //************ FUNCIONANDO *************** //*** FUNCIONANDO COM ELEMENTOS REPETIDOS *** #include<stdio.h> #define MAXN 1010 int particiona(int *v, int ini, int fim){ int esq, dir, pivo, aux; esq = ini; dir = fim; pivo = v[ini]; while(esq < dir){ while( v[esq] <= pivo ) //para quando encontrar elemento esq++; //maior que o pivo while( v[dir] > pivo) //para quando encontrar elemento dir--; //menor ou igual ao pivo if(esq < dir){ //se temos posicoes validas, entao faz a troca aux = v[esq]; v[esq] = v[dir]; v[dir] = aux; } } v[ini] = v[dir]; v[dir] = pivo; return dir; } void quickSort(int *v, int inicio, int fim){ int pivo; if (inicio < fim){ //So faz ordenacao se tive pelo menos 2 elementos pivo = particiona (v, inicio, fim); quickSort (v, inicio, pivo-1); quickSort (v, pivo+1, fim); } } void printfVetor(int vet[], int tam){ // Procedimento para imprimir o vetor int i; printf("Vetor Organizado: "); for (i=0; i< tam; i++){ printf("%d ", vet[i]); } printf("\n"); } int main (){ int n, vetor[MAXN]; // declaro as variáveis que usarei int i; //Variaveis do for's printf("Insira o tamanho do vetor: "); scanf("%d", &n); // leio o valor de n printf("Insira os valores do vetor: "); for(i=0; i<n; i++){ //Preencher o vetor scanf("%d", &vetor[i]); // leio os n números do vetor } quickSort(vetor, 0, (n-1)); // Parametros: Vetor -> indice inicial -> indice final printfVetor(vetor, n); // Parametros: Vetor -> tamanho do vetor return 0; } <file_sep>//Algoritmo de ordenação em memória primária - Insertion Sort //************ FUNCIONANDO *************** #include<stdio.h> #define MAXN 1010 //Define MAXN com 1010 void insertionSort (int vet[], int tam){ //Implementação da função Insertio Sort int aux, i, j; for (i=1; i <tam; i++){ aux = vet[i]; j= i-1; while (aux< vet[j] && j>= 0){ vet[j+1] = vet[j]; j--; } vet[j+1] = aux; } } void printfVetor(int vet[], int tam){ //Função para printar int i; printf("Vetor Organizado: "); for (i=0; i< tam; i++){ printf("%d ", vet[i]); } printf("\n"); } int main(){ int n, vetor[MAXN]; // declaro as variáveis que usarei int i; //Variaveis do for's printf("Insira o tamanho do vetor: "); scanf("%d", &n); // leio o valor de n printf("Insira os valores do vetor: "); for(i=0; i<n; i++){ scanf("%d", &vetor[i]); // leio os n números do vetor } //Chamada de funçoes insertionSort (vetor, n); printfVetor(vetor, n); return 0; } <file_sep>//Algoritmo de Ordenação //************ FUNCIONANDO *************** #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAXN 1010 void merge (int *v, int p, int q, int r){ // Parametros: Ponteiro para vetor -> inicio -> meio -> fim int tam = r-p; // Tamanho do Vetor int *aux = (int*)calloc (tam, sizeof (int)); int i, j, k; k=0; i=p; j=q; while (i< q && j< r){ if (v[i] <= v[j]){ aux[k++]= v[i++]; }else{ aux[k++]=v[j++]; } } while (i<q){ aux[k++]=v[i++]; } while (j< r){ aux[k++] = v[j++]; } /*for (i=p; i< r; i++){ v[i]=aux[i-p]; }*/ memcpy(&(v[p]), aux, tam *sizeof(int)); free(aux); } void mergeSort (int *vet, int p, int r){ //Parametros: Ponteiro para Vetor -> inicio -> fim if (p < r-1){ int q; q = (p+r)/2; //Meio do vetor mergeSort(vet, p, q); // Vetor -> Inicio -> Meio mergeSort(vet, q, r); // Vetor -> Meio -> Fim merge(vet, p, q, r); // Vetor -> inicio -> meio -> fim } } void printfVetor(int vet[], int tam){ // Procedimento para imprimir o vetor int i; printf("Vetor Organizado: "); for (i=0; i< tam; i++){ printf("%d ", vet[i]); } printf("\n"); } int main (){ int n, vetor[MAXN]; // declaro as variáveis que usarei int i; //Variaveis do for's printf("Insira o tamanho do vetor: "); scanf("%d", &n); // leio o valor de n printf("Insira os valores do vetor: "); for(i=0; i<n; i++){ //Preencher o vetor scanf("%d", &vetor[i]); // leio os n números do vetor } mergeSort(vetor, 0, n); // Parametros: Vetor -> indice inicial -> indice final printfVetor(vetor, n); // Parametros: Vetor -> tamanho do vetor return 0; } <file_sep># Trabalho Prático - [Estrutura de Dados I] --- > Trabalho realizado na disciplina de Estrutura de Dados I - CEUNES (Centro Universitário Norte do Espírito Santo). > Foram utilizadas algumas técnicas de armazenamento e organização de dados, de modo que fossem usados eficientemente, facilitando sua busca e modificação. > Algumas estruturas utilizadas: Fila, Pilha entre outras. --- > #### Aluno(s) que realizaram o trabalho: > <NAME> > <NAME> > <NAME> > <NAME> --- ## Tarefa Um professor de matemática resolveu criar um jogo que utiliza n bolas coloridas. Cada bola possui uma cor e uma letra. O professor separa as bolas em caixas de acordo com suas cores. São um total de k cores. O professor começa a retirar as bolas de uma caixa, uma de cada vez, enfileirando-as sobre a mesa, na ordem em que elas foram sorteadas. Ele retira as bolas de uma caixa até que esta fique vazia. Só então ele começa a retirar as bolas de outra caixa e assim sucessivamente, até que todas as bolas sejam retiradas e enfileiradas sobre a mesa. Considere que o conjunto de cores é C = {c1, c2, . . . . , ck} e o número de bolas de uma cor ci é dado por |ci|. A ordem de escolha da caixa a ser esvaziada é de acordo com o número de bolas contidas nela. Ou seja, as caixas serão ordenadas de forma não-decrescente do número de bolas contidas nelas. Uma vez definida a ordem das caixas, cada aluno deve escrever a sequência de bolas que serão enfileiradas. Cada elemento da sequência deve ter a cor e a letra de cada bola. Ganha o aluno que acertar a sequência. Implemente um algoritmo de busca em profundidade de forma recursiva para gerar todas as possibilidades de resultado para o jogo. As possibilidades de resultado do jogo devem ser impressas na tela, uma por linha. Na impressão de um resultado, para cada bola deve ser impressas sua cor e sua letra. Seu programa deve receber como entrada: * O número de bolas (valor de n); * O número de cores (valor de k); * Para cada cor: a quantidade de bolas daquela cor e as letras de cada bola. --- [Estrutura de Dados I]: https://pt.wikipedia.org/wiki/Estrutura_de_dados <file_sep>/* Grupo:2 Aluno(s): <NAME> <NAME> Hádamo da silva egito <NAME> Curso: Ciência da Computação */ #ifndef _FILA_H_ #define _FILA_H_ #include <stdlib.h> #include <stdio.h> #include <string.h> //Def das estruturas typedef struct bolaF { char elem; ////Armazena o char que representa a letra struct bolaF* prox; struct bolaF* ant; } bolaF;//Estrutura bolaF é armazenada na Fila typedef struct fila{ char* cor; //Cor da caixa int quantidade; //Quantidade de elementos bolaF* ini; //Ponteiro para inicio da fila bolaF* fim; //Ponteiro para inicio da fila } fila;//TAD Fila // Cria nova bolaF, retornando ponteiro para a bolaF // Entrada: 1 char bolaF* nova_bolaF(char); // Cria nova fila vazia, retornando ponteiro para a fila // Entrada: cor da caixa em string fila* nova_fila(char*); // Funcao de inserir no fim da fila void insere_fila(fila*,char); // Funcao de remover no inicio da fila, retorna o char removido char remove_fila(fila*); // Imprimi a fila void imprimir_fila(fila*); // Quantidade de elementos na fila, retorna int int quantidade_fila(fila*); // free na memoria alocada pela fila void free_fila(fila*); // imprime a cor da fila void cor_fila(fila*); #endif
b49ab3fa4ef1519ac7647ab3baf284853f6fe7ba
[ "Makefile", "Markdown", "C" ]
14
Makefile
WellersonPrenholato/data-structure
ce7bd014dd9bd1b3f4f00901d7927718e001bc1a
bff6d595c6b87afa33bcda46671bf4840ad610f2
refs/heads/master
<file_sep>package kong.qingwei.kqwwifimanagerdemo; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.SwitchCompat; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.CompoundButton; import android.widget.FrameLayout; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.kongqw.permissionslibrary.PermissionsManager; import com.kongqw.wifilibrary.WiFiManager; import com.kongqw.wifilibrary.listener.OnWifiConnectListener; import com.kongqw.wifilibrary.listener.OnWifiEnabledListener; import com.kongqw.wifilibrary.listener.OnWifiScanResultsListener; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.*; import android.os.Handler; import android.os.Message; //import java.util.Timer; //import java.util.TimerTask; import android.net.TrafficStats; import java.io.*; //import java.io.FileReader; //import java.io.IOException; //import java.io.File; //import java.io.FileInputStream; //import java.io.FileOutputStream; //import javax.xml.bind.*; import kong.qingwei.kqwwifimanagerdemo.adapter.WifiListAdapter; import kong.qingwei.kqwwifimanagerdemo.view.ConnectWifiDialog; import kong.qingwei.kqwwifimanagerdemo.Node; import android.app.ActivityManager; import android.app.ActivityManager.*; import java.lang.*; import android.app.*; import java.net.*; public class MainActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, OnWifiScanResultsListener, OnWifiConnectListener, OnWifiEnabledListener { private static final String TAG = "MainActivity"; private ListView mWifiList; private SwipeRefreshLayout mSwipeLayout; private PermissionsManager mPermissionsManager; private TextView mCurrentData; private TextView mPath; // 所需的全部权限 static final String[] PERMISSIONS = new String[]{ Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE }; private final int GET_WIFI_LIST_REQUEST_CODE = 0; private WiFiManager mWiFiManager; private WifiListAdapter mWifiListAdapter; private SwitchCompat switchCompat; private FrameLayout frameLayout; public long lastTotalBytes = 0; public long lastTimeStamp = 0; public long lastMobileBytes = 0; //public long startleftdataBytes = 0; public static int firstcreate = 1; public int UPDATE = 100; public int UPDATE1 = 101; public int UPDATE2 = 102; public File file; public FileInputStream fi; public FileOutputStream fo; public int wifi = 0; //特征列表 public static List<String> featureList = new ArrayList<String>(); //特征值列表 public static List<List<String>> featureValueTableList = new ArrayList<List<String>>(); //得到全局数据 public static Map<Integer, List<String>> tableMap = new HashMap<Integer, List<String>>(); private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO 接收消息并且去更新UI线程上的控件内容 if (msg.what == UPDATE) { //tv.setText(String.valueOf(msg.obj)); Log.i(TAG, "网速/剩余流量为:"+msg.obj); mCurrentData.setText("网速/剩余流量为:"+msg.obj); } if (msg.what == UPDATE1) { Log.i(TAG, "添加行:"+msg.obj); try{ fo = new FileOutputStream(file,true); fo.write(msg.obj.toString().getBytes()); fo.flush(); fo.close(); //check if log.txt is too big; if is: create new log //fi = new FileInputStream(file); //int len = fi.available(); /*byte [] buffer = new byte[len]; fi.read(buffer); String fileContent = new String(buffer); fi.close(); mPath.setText(fileContent);*/ } catch (IOException e1) { e1.printStackTrace(); } } if (msg.what == UPDATE2) { Log.i(TAG, "预测结果:"+msg.obj); mPath.setText("预测结果:"+msg.obj); } super.handleMessage(msg); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); // 加载View initView(); // 添加WIFI开关的监听 switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { mWiFiManager.openWiFi(); //wifi = 1; } else { mWiFiManager.closeWiFi(); //here //wifi = 0; } } }); // 添加下拉刷新的监听 mSwipeLayout.setOnRefreshListener(this); // 初始化WIFI列表 mWifiList.setEmptyView(findViewById(R.id.empty_view)); mWifiListAdapter = new WifiListAdapter(getApplicationContext()); mWifiList.setAdapter(mWifiListAdapter); mWifiList.setOnItemClickListener(this); mWifiList.setOnItemLongClickListener(this); // WIFI管理器 mWiFiManager = WiFiManager.getInstance(getApplicationContext()); // 动态权限管理器 mPermissionsManager = new PermissionsManager(this) { @Override public void authorized(int requestCode) { // 6.0 以上系统授权通过 if (GET_WIFI_LIST_REQUEST_CODE == requestCode) { // 获取WIFI列表 List<ScanResult> scanResults = mWiFiManager.getScanResults(); refreshData(scanResults); } } @Override public void noAuthorization(int requestCode, String[] lacksPermissions) { // 6.0 以上系统授权失败 } @Override public void ignore() { // 6.0 以下系统 获取WIFI列表 List<ScanResult> scanResults = mWiFiManager.getScanResults(); refreshData(scanResults); } }; // 请求WIFI列表 mPermissionsManager.checkPermissions(GET_WIFI_LIST_REQUEST_CODE, PERMISSIONS); //add by me //String processName = getProcessName(this, android.os.Process.myPid()); //if(firstcreate != 0) //{ lastTotalBytes = getTotalRxBytes() + getTotalTxBytes(); if(!mWiFiManager.isWifiEnabled()) lastMobileBytes = TrafficStats.getMobileRxBytes() + TrafficStats.getMobileTxBytes(); //startleftdataBytes = TrafficStats.getMobileRxBytes() + TrafficStats.getMobileTxBytes() + 10000; lastTimeStamp = System.currentTimeMillis(); Log.i(TAG, "lastTotalBytes:" + lastTotalBytes); Log.i(TAG, "lastMobileBytes:" + lastMobileBytes); Log.i(TAG, "lastTimeStamp:" + lastTimeStamp); TimerTask task = new TimerTask() { @Override public void run() { showNetSpeed(); } }; new Timer().schedule(task, 1000, 2000); // 1s后启动任务,每2s执行一次 //mCurrentData.setText("B"); //create log try { File file1 = new File(this.getApplicationContext().getFilesDir().toString()); if(!file1.exists()){ file1.mkdir(); } file = new File(file1, "log.txt"); /*if (!file.exists()) { file.mkdir(); }*/ if(firstcreate == 1) { fo = new FileOutputStream(file, true); String s = "@feature\nleft_data,wifi_level,current_traffic,wifi_enabled\n\n@data\n"; fo.write(s.getBytes()); fo.flush(); fo.close(); firstcreate = 0; } /*fi = new FileInputStream(file); int len = fi.available(); byte [] buffer = new byte[len]; fi.read(buffer); String fileContent = new String(buffer); fi.close();*/ //mPath.setText(fileContent); } catch (IOException e1) { e1.printStackTrace(); } TimerTask task1 = new TimerTask() { @Override public void run() { //decision(); sendData(); //clean log try{ fo = new FileOutputStream(file,false); fo.write("".getBytes()); fo.flush(); fo.close(); } catch (IOException e1) { e1.printStackTrace(); } } }; new Timer().schedule(task1, 100000, 100000); // 100s后启动任务,每100s执行一次*/ //firstcreate = 0; //} } public void sendData(){ //构建URL的格式为: http://IP地址:监听的端口号/Servlet的路径 final String strUrl = "http://192.168.6.1:8080/TomcatTest/MyServlet"; //文件路径+文件名 [此处最好是把文件格式给带上] //final String filepath = this.getApplicationContext().getFilesDir()+"/log.txt"; final URL[] url = {null}; Thread th = new Thread(new Runnable() { @Override public void run() { try{ String content = null; try { content = "?command=" + URLEncoder.encode("upload image", "UTF-8")+"&filename="+ URLEncoder.encode("log.txt", "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } //第一步:访问网站,进行连接 //url[0] =new URL(strUrl+content); // url[0] =new URL("http://192.168.1.101:8080/TomcatTest/MyServlet"); HttpURLConnection urlConn=(HttpURLConnection) url[0].openConnection(); urlConn.setDoInput(true); //setting inputstream using bytestream urlConn.setDoOutput(true); urlConn.setRequestMethod("POST"); urlConn.setUseCaches(false); //urlConn.setRequestProperty("Content-Type","application/x-ww-form-urlencoded"); urlConn.setRequestProperty("Connection", "Keep-Alive"); urlConn.setRequestProperty("Charset","utf-8"); //urlConn.connect(); Message msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = urlConn; mHandler.sendMessage(msg2); //第二步:打开数据通道 DataOutputStream dop=new DataOutputStream(urlConn.getOutputStream()); msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = urlConn + " " + dop.toString(); mHandler.sendMessage(msg2); /*msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = filepath; mHandler.sendMessage(msg2);*/ //第三步:准备好发送的数据 //File f=new File(filepath); FileInputStream fis = new FileInputStream(file); if(file.isFile()){ byte[] buffer=new byte[1024]; int length; while ((length=fis.read(buffer))!=-1){ dop.write(buffer,0,length); } }else { //如果不是文件,直接返回,然后啥也不干 return; } //第四步:将准备的数据发送给服务器 dop.flush(); dop.close(); /*msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = "send end"; mHandler.sendMessage(msg2);*/ //第五步:打开输入的数据通道,等待服务端回发数据! BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(urlConn.getInputStream())); String result=""; String readLine; while ((readLine=bufferedReader.readLine())!=null){ result+=readLine; } //最后一步:清理场地,主要是把打开的通道都关闭掉,养成一个好习惯 bufferedReader.close(); urlConn.disconnect(); //调试返回的数据 //System.out.println("从服务端获得的返回数据为: "+ URLDecoder.decode(result,"utf-8")); }catch (MalformedURLException e){ Message msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = "url exc" + e.toString(); mHandler.sendMessage(msg2); //System.out.println("出现了异常:"+e.getMessage()); } catch (IOException e) { Message msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = "io exc"+ e.toString(); mHandler.sendMessage(msg2); //System.out.println("出现了异常:"+e.getMessage()); e.printStackTrace(); } } }); th.start(); } /*public static String getProcessName(Context cxt, int pid) { ActivityManager am = (ActivityManager) cxt.getSystemService(Context.ACTIVITY_SERVICE); List<RunningAppProcessInfo> runningApps = am.getRunningAppProcesses(); if (runningApps == null) { return null; } for (RunningAppProcessInfo procInfo : runningApps) { if (procInfo.pid == pid) { return procInfo.processName; } } return null; }*/ private long getTotalRxBytes() { // return TrafficStats.getUidRxBytes(getApplicationInfo().uid) == TrafficStats.UNSUPPORTED ? 0 :(TrafficStats.getTotalRxBytes()/1024);//转为KB return TrafficStats.getTotalRxBytes() / 1024;//转为KB } private long getTotalTxBytes() { // return TrafficStats.getUidRxBytes(getApplicationInfo().uid) == TrafficStats.UNSUPPORTED ? 0 :(TrafficStats.getTotalRxBytes()/1024);//转为KB return TrafficStats.getTotalTxBytes() / 1024;//转为KB } private void decision() { // 初始化数据 readOriginalData(file); /*for (String f : featureList) { System.out.println(f); }*/ // 获得数据集的列表 List<Integer> tempDataList = new ArrayList<Integer>(); for (Map.Entry<Integer, List<String>> entry : tableMap.entrySet()) { /*System.out.print(entry.getKey() + ","); for (String s : entry.getValue()) { System.out.print(s + ","); } System.out.println();*/ tempDataList.add(entry.getKey()); } // 得到特征的列表 List<Integer> featureIndexList = new ArrayList<Integer>(); for (int i = 0; i < featureList.size(); i++) { featureIndexList.add(i); } // 构造决策树 Node decisionTree = createDecisionTree(tempDataList, featureIndexList, null); // 预测结果 Message msg2 = mHandler.obtainMessage(); msg2.what = UPDATE2; msg2.obj = getDTAnswer(decisionTree, featureList, Arrays.asList("100,1,1000".split(","))); mHandler.sendMessage(msg2); } /** * 初始化数据 * * @param file */ public static void readOriginalData(File file) { int index = 0; try { FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); String line; while ((line = br.readLine()) != null) { // 得到特征名称 if (line.startsWith("@feature")) { line = br.readLine(); String[] row = line.split(","); for (String s : row) { featureList.add(s.trim()); //trim() 删除头尾空白字符 featureList:特征名称列表 } } else if (line.startsWith("@data")) { while ((line = br.readLine()) != null) { if (line.equals("")) { continue; } String[] row = line.split(","); if (row.length != featureList.size()) { throw new Exception("列表数据和特征数目不一致"); } List<String> tempList = new ArrayList<String>(); for (String s : row) { if (s.trim().equals("")) { throw new Exception("列表数据不能为空"); } tempList.add(s.trim()); } tableMap.put(index++, tempList); //tableMap:第i行data } // 遍历tableMap得到属性值列表 Map<Integer, Set<String>> valueSetMap = new HashMap<Integer, Set<String>>(); for (int i = 0; i < featureList.size(); i++) { valueSetMap.put(i, new HashSet<String>());//valueSetMap: 第i个feature } for (Map.Entry<Integer, List<String>> entry : tableMap.entrySet()) { List<String> dataList = entry.getValue(); for (int i = 0; i < dataList.size(); i++) { valueSetMap.get(i).add(dataList.get(i)); } } for (Map.Entry<Integer, Set<String>> entry : valueSetMap.entrySet()) { List<String> valueList = new ArrayList<String>(); for (String s : entry.getValue()) { valueList.add(s); } featureValueTableList.add(valueList); } } else { continue; } } br.close(); } catch (IOException e1) { e1.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } /** * 计算熵 * * @param dataSetList * @return */ public static double calculateEntropy(List<Integer> dataSetList) { if (dataSetList == null || dataSetList.size() <= 0) { return 0; } // 得到结果 int resultIndex = tableMap.get(dataSetList.get(0)).size() - 1; //value0/1下标 Map<String, Integer> valueMap = new HashMap<String, Integer>(); for (Integer id : dataSetList) { String value = tableMap.get(id).get(resultIndex); Integer num = valueMap.get(value); if (num == null || num == 0) { num = 0; } valueMap.put(value, num + 1); //value0/1 index(start from 1) } double entropy = 0; for (Map.Entry<String, Integer> entry : valueMap.entrySet()) { double prob = entry.getValue() * 1.0 / dataSetList.size(); entropy -= prob * Math.log10(prob) / Math.log10(2); } return entropy; } /** * 对一个数据集进行划分 * * @param dataSetList * 待划分的数据集 * @param featureIndex * 第几个特征(特征下标,从0开始) * @param value * 得到某个特征值的数据集 * @return */ public static List<Integer> splitDataSet(List<Integer> dataSetList, int featureIndex, String value) { List<Integer> resultList = new ArrayList<Integer>(); for (Integer id : dataSetList) { if (tableMap.get(id).get(featureIndex).equals(value)) { resultList.add(id); } } return resultList; } /** * 在指定的几个特征中选择一个最佳特征(信息增益最大)用于划分数据集 * * @param dataSetList * @return 返回最佳特征的下标 */ public static int chooseBestFeatureToSplit(List<Integer> dataSetList, List<Integer> featureIndexList) { double baseEntropy = calculateEntropy(dataSetList); double bestInformationGain = 0; int bestFeature = -1; // 循环遍历所有特征 for (int temp = 0; temp < featureIndexList.size() - 1; temp++) { int i = featureIndexList.get(temp); // 得到特征集合 List<String> featureValueList = new ArrayList<String>(); for (Integer id : dataSetList) { String value = tableMap.get(id).get(i); featureValueList.add(value); } Set<String> featureValueSet = new HashSet<String>(); featureValueSet.addAll(featureValueList); // 得到此分类下的熵 double newEntropy = 0; for (String featureValue : featureValueSet) { List<Integer> subDataSetList = splitDataSet(dataSetList, i, featureValue); double probability = subDataSetList.size() * 1.0 / dataSetList.size(); newEntropy += probability * calculateEntropy(subDataSetList); } // 得到信息增益 double informationGain = baseEntropy - newEntropy; // 得到信息增益最大的特征下标 if (informationGain > bestInformationGain) { bestInformationGain = informationGain; bestFeature = temp; } } return bestFeature; } /** * 多数表决得到出现次数最多的那个值 * * @param dataSetList * @return */ public static String majorityVote(List<Integer> dataSetList) { // 得到结果 int resultIndex = tableMap.get(dataSetList.get(0)).size() - 1; Map<String, Integer> valueMap = new HashMap<String, Integer>(); for (Integer id : dataSetList) { String value = tableMap.get(id).get(resultIndex); Integer num = valueMap.get(value); if (num == null || num == 0) { num = 0; } valueMap.put(value, num + 1); } int maxNum = 0; String value = ""; for (Map.Entry<String, Integer> entry : valueMap.entrySet()) { if (entry.getValue() > maxNum) { maxNum = entry.getValue(); value = entry.getKey(); } } return value; } /** * 创建决策树 * * @param dataSetList * 数据集 * @param featureIndexList * 可用的特征列表 * @param lastFeatureValue * 到达此节点的上一个特征值 * @return */ public static Node createDecisionTree(List<Integer> dataSetList, List<Integer> featureIndexList, String lastFeatureValue) { // 如果只有一个值的话,则直接返回叶子节点 int valueIndex = featureIndexList.get(featureIndexList.size() - 1);//标签索引 // 选择第一个值 String firstValue = tableMap.get(dataSetList.get(0)).get(valueIndex);//标签值 int firstValueNum = 0; for (Integer id : dataSetList) { if (firstValue.equals(tableMap.get(id).get(valueIndex))) { firstValueNum++; } } if (firstValueNum == dataSetList.size())//所有数据属于同一类 { Node node = new Node(); node.lastFeatureValue = lastFeatureValue; node.featureName = firstValue; node.childrenNodeList = null; return node; } // 遍历完所有特征时特征值还没有完全相同,返回多数表决的结果 if (featureIndexList.size() == 1)//就剩下标签了 { Node node = new Node(); node.lastFeatureValue = lastFeatureValue; node.featureName = majorityVote(dataSetList); node.childrenNodeList = null; return node; } // 获得信息增益最大的特征 int bestFeatureIndex = chooseBestFeatureToSplit(dataSetList, featureIndexList); // 得到此特征在全局的下标 int realFeatureIndex = featureIndexList.get(bestFeatureIndex); String bestFeatureName = featureList.get(realFeatureIndex); // 构造决策树 Node node = new Node(); node.lastFeatureValue = lastFeatureValue; node.featureName = bestFeatureName; // 得到所有特征值的集合 List<String> featureValueList = featureValueTableList.get(realFeatureIndex); // 删除此特征 featureIndexList.remove(bestFeatureIndex); // 遍历特征所有值,划分数据集,然后递归得到子节点 for (String fv : featureValueList) { // 得到子数据集 List<Integer> subDataSetList = splitDataSet(dataSetList, realFeatureIndex, fv); // 如果子数据集为空,则使用多数表决给一个答案。 if (subDataSetList == null || subDataSetList.size() <= 0) { Node childNode = new Node(); childNode.lastFeatureValue = fv; childNode.featureName = majorityVote(dataSetList); childNode.childrenNodeList = null; node.childrenNodeList.add(childNode); break; } // 添加子节点 Node childNode = createDecisionTree(subDataSetList, featureIndexList, fv); node.childrenNodeList.add(childNode); } return node; } /** * 输入测试数据得到决策树的预测结果 * @param decisionTree 决策树 * @param featureList 特征列表 * @param testDataList 测试数据 * @return */ public static String getDTAnswer(Node decisionTree, List<String> featureList, List<String> testDataList) { if (featureList.size() - 1 != testDataList.size()) { System.out.println("输入数据不完整"); return "ERROR"; } while (decisionTree != null) { // 如果孩子节点为空,则返回此节点答案. if (decisionTree.childrenNodeList == null || decisionTree.childrenNodeList.size() <= 0) { return decisionTree.featureName; } // 孩子节点不为空,则判断特征值找到子节点 for (int i = 0; i < featureList.size() - 1; i++) { // 找到当前特征下标 if (featureList.get(i).equals(decisionTree.featureName)) { // 得到测试数据特征值 String featureValue = testDataList.get(i); // 在子节点中找到含有此特征值的节点 Node childNode = null; for (Node cn : decisionTree.childrenNodeList) { if (cn.lastFeatureValue.equals(featureValue)) { childNode = cn; break; } } // 如果没有找到此节点,则说明训练集中没有到这个节点的特征值 if (childNode == null) { System.out.println("没有找到此特征值的数据"); return "ERROR"; } decisionTree = childNode; break; } } } return "ERROR"; } // 把结果写入xml文件 /*public static void writeToXML(Node node, String filename) { try { // 生成xml JAXBContext context = JAXBContext.newInstance(Node.class); Marshaller marshaller = context.createMarshaller(); File file = new File(filename); if (file.exists() == false) { if (file.getParent() == null) { file.getParentFile().mkdirs(); } file.createNewFile(); } marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); // 设置编码字符集 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // 格式化XML输出,有分行和缩进 marshaller.marshal(node, System.out); // 打印到控制台 FileOutputStream fos = new FileOutputStream(file); marshaller.marshal(node, fos); fos.flush(); fos.close(); } catch (Exception e) { e.printStackTrace(); } }*/ private void showNetSpeed() { //long nowTotalTxBytes = getTotalTxBytes(); //long nowTotalRxBytes = getTotalRxBytes(); long nowTotalBytes = getTotalTxBytes() + getTotalRxBytes(); long nowTimeStamp = System.currentTimeMillis(); long speed = ((nowTotalBytes - lastTotalBytes) * 1000 / (nowTimeStamp - lastTimeStamp));//毫秒转换 lastTimeStamp = nowTimeStamp; lastTotalBytes = nowTotalBytes; long nowMobileBytes = TrafficStats.getMobileRxBytes() + TrafficStats.getMobileTxBytes(); long consumeMobile = (nowMobileBytes - lastMobileBytes)/1024; //kb if(mWiFiManager.isWifiEnabled()) consumeMobile = 0; else { lastMobileBytes = nowMobileBytes; ExampleApplication.left = ExampleApplication.left - consumeMobile; } long leftdata = ExampleApplication.left; int leftdatalevel; if(leftdata > 500) leftdatalevel = 4; else if(leftdata <= 500 && leftdata > 0) leftdatalevel = 3; else if(leftdata <= 0 && leftdata >-500) leftdatalevel = 2; else leftdatalevel = 1; int speedlevel; if(speed > 5000) speedlevel = 7; //5M/s else if(speed <= 5000 && speed > 3000) speedlevel = 6; //3M/s else if(speed <= 3000 && speed > 1000) speedlevel = 5; //1M/s else if(speed <= 1000 && speed > 600) speedlevel = 4; //600k/s else if(speed <= 600 && speed > 300) speedlevel = 3; else if(speed <= 300 && speed > 100) speedlevel = 2; else if(speed <= 100 && speed > 50) speedlevel = 1; else speedlevel = 0; Message msg = mHandler.obtainMessage(); msg.what = UPDATE; if(speed == 0){ msg.obj = String.valueOf(speed) + ".00kb/s " + String.valueOf(leftdata) + "kb"; }else { msg.obj = String.valueOf(speed) + "kb/s " + String.valueOf(leftdata) + "kb"; } mHandler.sendMessage(msg);//更新界面 Message msg1 = mHandler.obtainMessage(); msg1.what = UPDATE1; if(mWiFiManager.isWifiEnabled()) wifi = 1; else wifi = 0; if(mWiFiManager.getConnectionInfo()!=null) { msg1.obj = String.valueOf(leftdatalevel) + "," + mWiFiManager.calculateSignalLevel(mWiFiManager.getConnectionInfo().getRssi()) + "," + String.valueOf(speedlevel) + "," + wifi + "\n";// mWiFiManager.calculateSignalLevel(Integer.parseInt(current_ssid)) } else { msg1.obj = String.valueOf(leftdatalevel) + "," + "0" + "," + String.valueOf(speedlevel) + "," + wifi + "\n"; } mHandler.sendMessage(msg1); //if(speed > 100) //mWiFiManager.closeWiFi(); } /** * 初始化界面 */ private void initView() { // WIFI 开关 switchCompat = (SwitchCompat) findViewById(R.id.switch_wifi); // 显示WIFI信息的布局 frameLayout = (FrameLayout) findViewById(R.id.fl_wifi); // 下拉刷新 mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout); // WIFI列表 mWifiList = (ListView) findViewById(R.id.wifi_list); mCurrentData = (TextView) findViewById(R.id.textView); mPath = (TextView) findViewById(R.id.textView2); } @Override protected void onResume() { super.onResume(); // 添加监听 mWiFiManager.setOnWifiEnabledListener(this); mWiFiManager.setOnWifiScanResultsListener(this); mWiFiManager.setOnWifiConnectListener(this); // 更新WIFI开关状态 switchCompat.setChecked(mWiFiManager.isWifiEnabled()); } @Override protected void onPause() { super.onPause(); // 移除监听 mWiFiManager.removeOnWifiEnabledListener(); mWiFiManager.removeOnWifiScanResultsListener(); mWiFiManager.removeOnWifiConnectListener(); } /** * 刷新页面 * * @param scanResults WIFI数据 */ public void refreshData(List<ScanResult> scanResults) { mSwipeLayout.setRefreshing(false); // 刷新界面 mWifiListAdapter.refreshData(scanResults); Snackbar.make(mWifiList, "WIFI列表刷新成功", Snackbar.LENGTH_SHORT).show(); } /** * Android 6.0 权限校验 * * @param requestCode requestCode * @param permissions permissions * @param grantResults grantResults */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); // 复查权限 mPermissionsManager.recheckPermissions(requestCode, permissions, grantResults); } /** * WIFI列表单击 * * @param parent parent * @param view view * @param position position * @param id id */ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final ScanResult scanResult = (ScanResult) mWifiListAdapter.getItem(position); switch (mWiFiManager.getSecurityMode(scanResult)) { case WPA: case WPA2: new ConnectWifiDialog(this) { @Override public void connect(String password) { mWiFiManager.connectWPA2Network(scanResult.SSID, password); } }.setSsid(scanResult.SSID).show(); break; case WEP: new ConnectWifiDialog(this) { @Override public void connect(String password) { mWiFiManager.connectWEPNetwork(scanResult.SSID, password); } }.setSsid(scanResult.SSID).show(); break; case OPEN: // 开放网络 mWiFiManager.connectOpenNetwork(scanResult.SSID); break; } } /** * WIFI列表长按 * * @param parent parent * @param view view * @param position position * @param id id * @return 是否拦截长按事件 */ @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { ScanResult scanResult = (ScanResult) mWifiListAdapter.getItem(position); final String ssid = scanResult.SSID; new AlertDialog.Builder(this) .setTitle(ssid) .setItems(new String[]{"断开连接", "删除网络配置"}, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: // 断开连接 WifiInfo connectionInfo = mWiFiManager.getConnectionInfo(); Log.i(TAG, "onClick: connectionInfo :" + connectionInfo.getSSID()); if (mWiFiManager.addDoubleQuotation(ssid).equals(connectionInfo.getSSID())) { mWiFiManager.disconnectWifi(connectionInfo.getNetworkId()); } else { Toast.makeText(getApplicationContext(), "当前没有连接 [ " + ssid + " ]", Toast.LENGTH_SHORT).show(); } break; case 1: // 删除网络配置 WifiConfiguration wifiConfiguration = mWiFiManager.getConfigFromConfiguredNetworksBySsid(ssid); if (null != wifiConfiguration) { boolean isDelete = mWiFiManager.deleteConfig(wifiConfiguration.networkId); Toast.makeText(getApplicationContext(), isDelete ? "删除成功!" : "其他应用配置的网络没有ROOT权限不能删除!", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(), "没有保存该网络!", Toast.LENGTH_SHORT).show(); } break; default: break; } } }) .show(); return true; } /** * 下拉刷新的回调 */ @Override public void onRefresh() { // 下拉刷新 mWiFiManager.startScan(); } /** * WIFI列表刷新后的回调 * * @param scanResults 扫描结果 */ @Override public void onScanResults(List<ScanResult> scanResults) { refreshData(scanResults); } /** * WIFI连接的Log得回调 * * @param log log */ @Override public void onWiFiConnectLog(String log) { Log.i(TAG, "onWiFiConnectLog: " + log); Snackbar.make(mWifiList, "WIFI正在连接 : " + log, Snackbar.LENGTH_SHORT).show(); } /** * WIFI连接成功的回调 * * @param SSID 热点名 */ @Override public void onWiFiConnectSuccess(String SSID) { Log.i(TAG, "onWiFiConnectSuccess: [ " + SSID + " ] 连接成功"); Toast.makeText(getApplicationContext(), SSID + " 连接成功", Toast.LENGTH_SHORT).show(); //current_ssid = SSID; } /** * WIFI连接失败的回调 * * @param SSID 热点名 */ @Override public void onWiFiConnectFailure(String SSID) { Log.i(TAG, "onWiFiConnectFailure: [ " + SSID + " ] 连接失败"); Toast.makeText(getApplicationContext(), SSID + " 连接失败!请重新连接!", Toast.LENGTH_SHORT).show(); } /** * WIFI开关状态的回调 * * @param enabled true 可用 false 不可用 */ @Override public void onWifiEnabled(boolean enabled) { switchCompat.setChecked(enabled); //set whether on or off should be displayed on switch frameLayout.setVisibility(enabled ? View.VISIBLE : View.GONE); } }
02a4bae0d7bab685c0270e8f5f2db9e22e9e1139
[ "Java" ]
1
Java
yellowlattice/WifiorDataApp
e001eca9219d84da16a000fe4440564cac2c73be
cce931e4b5b8298e73a97ee497184c5aced6ceea
refs/heads/master
<repo_name>NovikovAndrey/HttpHandlers<file_sep>/GenericHandler/TextHandler.ashx <%@ WebHandler Language="C#" CodeBehind="TextHandler.ashx.cs" Class="GenericHandler.TextHandler" %> <file_sep>/HttpHandlers/MyFirstHandler.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace HttpHandlers { public class MyFirstHandler : IHttpHandler { public bool IsReusable { get { return false; } } public void ProcessRequest(HttpContext context) { context.Response.Write("Hello Hell"); } } }
392ff8052d2d854dd94c9b08a2d2b96ae23a3e81
[ "C#", "ASP.NET" ]
2
C#
NovikovAndrey/HttpHandlers
e10be317d82f6607b3100b3bf90dbb0bd3d942b0
0d6a4ce6088f0a9a98ba91af68a8bdbb436884a2
refs/heads/master
<repo_name>Benoire/Sky-EPG-Grabber-Plugin<file_sep>/ClassLibrary5/SkyUKChannelEPGGrabber.vb Imports Custom_Data_Grabber Imports TvDatabase Imports TvLibrary.Channels Imports TvLibrary.Epg Imports TvLibrary.Interfaces Imports TvEngine Imports System.Text Imports System.Collections.Generic Imports System.Collections.Specialized Imports SetupTv Imports TvControl Imports TvLibrary.Log Public Class Sky_UkGrabber Implements ITvServerPlugin Dim settings As Settings Dim WithEvents skygrabber As SkyGrabber Dim WithEvents timer As Timers.Timer Sub OnTick() Handles timer.Elapsed If settings.IsGrabbing = False Then If settings.AutoUpdate = True Then If settings.EveryHour = True Then If settings.LastUpdate.AddHours(settings.UpdateInterval) < Now Then skygrabber.Grab() End If Else If (Now.Hour = settings.UpdateTime.Hour) And settings.LastUpdate.Date <> Now.Date Then If Now.Minute >= settings.UpdateTime.Minute And Now.Minute <= settings.UpdateTime.Minute + 10 Then Select Case Now.DayOfWeek Case System.DayOfWeek.Monday If settings.Mon = True Then skygrabber.Grab() End If Case System.DayOfWeek.Tuesday If settings.Tue = True Then skygrabber.Grab() End If Case System.DayOfWeek.Wednesday If settings.Wed = True Then skygrabber.Grab() End If Case System.DayOfWeek.Thursday If settings.Thu = True Then skygrabber.Grab() End If Case System.DayOfWeek.Friday If settings.Fri = True Then skygrabber.Grab() End If Case System.DayOfWeek.Saturday If settings.Sat = True Then skygrabber.Grab() End If Case System.DayOfWeek.Sunday If settings.Sun = True Then skygrabber.Grab() End If End Select End If End If End If End If End If End Sub Public ReadOnly Property Author As String Implements TvEngine.ITvServerPlugin.Author Get Return "DJBlu" End Get End Property Public ReadOnly Property MasterOnly As Boolean Implements TvEngine.ITvServerPlugin.MasterOnly Get Return True End Get End Property Public ReadOnly Property Name As String Implements TvEngine.ITvServerPlugin.Name Get Return "Sky UK Grabber" End Get End Property Public ReadOnly Property Setup As SetupTv.SectionSettings Implements TvEngine.ITvServerPlugin.Setup Get Return New Setup() End Get End Property Public Sub Start(ByVal controller As TvControl.IController) Implements TvEngine.ITvServerPlugin.Start skygrabber = New SkyGrabber settings = New Settings settings.IsGrabbing = False timer = New Timers.Timer timer.Interval = 10000 timer.Start() End Sub Public Sub Stopit() Implements TvEngine.ITvServerPlugin.Stop timer.Start() settings = Nothing skygrabber = Nothing End Sub Public ReadOnly Property Version As String Implements TvEngine.ITvServerPlugin.Version Get Return "192.168.3.11" End Get End Property Private Sub skygrabber_OnMessage(ByVal Text As String, ByVal UpdateLast As Boolean) Handles skygrabber.OnMessage If UpdateLast = False Then Log.Write("Sky Plugin : " & Text) End If End Sub End Class Public Class Settings Dim layer As New TvBusinessLayer Public Event OnSettingChanged() Dim FireEvent As Boolean = True Dim Themes As New Dictionary(Of Integer, String) Public Sub StopEvents() FireEvent = False End Sub Public Sub StartEvents() FireEvent = True End Sub Function GetSkySetting(ByVal _Setting As String, ByVal defaultvalue As Object) As String Dim str As String = layer.GetSetting("OTVC_" + _Setting, defaultvalue.ToString()).Value Return str End Function Sub UpdateSetting(ByVal _Setting As String, ByVal value As String) Dim setting As Setting = layer.GetSetting("OTVC_" + _Setting, "0") setting.Value = value.ToString() setting.Persist() End Sub Sub FireSettingChange() If FireEvent = True Then RaiseEvent OnSettingChanged() End If End Sub 'Properties Public Property modulation() As Integer Get Return Convert.ToInt32(GetSkySetting("modulation", -1)) End Get Set(ByVal value As Integer) UpdateSetting("modulation", value.ToString) End Set End Property Public Property GrabTime() As Integer Get Return Convert.ToInt32(GetSkySetting("GrabTime", 60)) End Get Set(ByVal value As Integer) UpdateSetting("GrabTime", value.ToString) End Set End Property Public Property frequency() As Integer Get Return Convert.ToInt32(GetSkySetting("frequency", 11778000)) End Get Set(ByVal value As Integer) UpdateSetting("frequency", value.ToString) End Set End Property Public Property SymbolRate() As Integer Get Return Convert.ToInt32(GetSkySetting("SymbolRate", 27500)) End Get Set(ByVal value As Integer) UpdateSetting("SymbolRate", value.ToString) End Set End Property Public Property NID() As Integer Get Return Convert.ToInt32(GetSkySetting("NID", 2)) End Get Set(ByVal value As Integer) UpdateSetting("NID", value.ToString) End Set End Property Public Property polarisation() As Integer Get Return Convert.ToInt32(GetSkySetting("polarisation", 3)) End Get Set(ByVal value As Integer) UpdateSetting("polarisation", value.ToString) End Set End Property Public Property ServiceID() As Integer Get Return Convert.ToInt32(GetSkySetting("ServiceID", 4152)) End Get Set(ByVal value As Integer) UpdateSetting("ServiceID", value.ToString) End Set End Property Public Property TransportID() As Integer Get Return Convert.ToInt32(GetSkySetting("TransportID", 2004)) End Get Set(ByVal value As Integer) UpdateSetting("TransportID", value.ToString) End Set End Property Public Property AutoUpdate() As Boolean Get Return Convert.ToBoolean(GetSkySetting("AutoUpdate", True)) End Get Set(ByVal value As Boolean) UpdateSetting("AutoUpdate", value.ToString) End Set End Property Public Property useExtraInfo() As Boolean Get Return Convert.ToBoolean(GetSkySetting("useExtraInfo", True)) End Get Set(ByVal value As Boolean) UpdateSetting("useExtraInfo", value.ToString) End Set End Property Public Property UpdateChannels() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UpdateChannels", True)) End Get Set(ByVal value As Boolean) UpdateSetting("UpdateChannels", value.ToString) End Set End Property Public Property EveryHour() As Boolean Get Return Convert.ToBoolean(GetSkySetting("EveryHour", True)) End Get Set(ByVal value As Boolean) UpdateSetting("EveryHour", value.ToString) End Set End Property Public Property OnDaysAt() As Boolean Get Return Convert.ToBoolean(GetSkySetting("OnDaysAt", False)) End Get Set(ByVal value As Boolean) UpdateSetting("OnDaysAt", value.ToString) End Set End Property 'Days Public Property Mon() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Mon", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Mon", value.ToString) End Set End Property Public Property Tue() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Tue", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Tue", value.ToString) End Set End Property Public Property Wed() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Wed", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Wed", value.ToString) End Set End Property Public Property Thu() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Thu", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Thu", value.ToString) End Set End Property Public Property Fri() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Fri", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Fri", value.ToString) End Set End Property Public Property Sat() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Sat", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Sat", value.ToString) End Set End Property Public Property Sun() As Boolean Get Return Convert.ToBoolean(GetSkySetting("Sun", True)) End Get Set(ByVal value As Boolean) UpdateSetting("Sun", value.ToString) End Set End Property Public Property UpdateTime() As DateTime Get Return Convert.ToDateTime(GetSkySetting("UpdateTime", Now.ToString)) End Get Set(ByVal value As DateTime) UpdateSetting("UpdateTime", value.ToString) End Set End Property Public Property ReplaceSDwithHD() As Boolean Get Return Convert.ToBoolean(GetSkySetting("ReplaceSDwithHD", True)) End Get Set(ByVal value As Boolean) UpdateSetting("ReplaceSDwithHD", value.ToString) End Set End Property Public Property IgnoreScrambled() As Boolean Get Return Convert.ToBoolean(GetSkySetting("IgnoreScrambled", False)) End Get Set(ByVal value As Boolean) UpdateSetting("IgnoreScrambled", value.ToString) End Set End Property Public Property UseNotSetModSD() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UseNotSetModSD", False)) End Get Set(ByVal value As Boolean) UpdateSetting("UseNotSetModSD", value.ToString) End Set End Property Public Property UseNotSetModHD() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UseNotSetModHD", False)) End Get Set(ByVal value As Boolean) UpdateSetting("UseNotSetModHD", value.ToString) End Set End Property Public Property UpdateEPG() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UpdateEPG", True)) End Get Set(ByVal value As Boolean) UpdateSetting("UpdateEPG", value.ToString) End Set End Property Public Property UpdateInterval() As Integer Get Return Convert.ToInt32(GetSkySetting("UpdateInterval", 3)) End Get Set(ByVal value As Integer) UpdateSetting("UpdateInterval", value.ToString) End Set End Property Public Property RegionID() As Integer Get Return Convert.ToInt32(GetSkySetting("RegionID", 0)) End Get Set(ByVal value As Integer) UpdateSetting("RegionID", value.ToString) End Set End Property Public Property BouquetID() As Integer Get If ReplaceSDwithHD Then Return Convert.ToInt32(GetSkySetting("BouquetID", 0)) + 4 Else Return Convert.ToInt32(GetSkySetting("BouquetID", 0)) End If End Get Set(ByVal value As Integer) UpdateSetting("BouquetID", value.ToString) End Set End Property Public Property IsLoading As Boolean Get Return Convert.ToBoolean(GetSkySetting("IsLoading", True)) End Get Set(ByVal value As Boolean) UpdateSetting("IsLoading", value.ToString) End Set End Property Public Property CardMap As List(Of Integer) Get Dim returnlist As New List(Of Integer) Dim Stringtouse As String = GetSkySetting("CardMap", "") If Stringtouse.Length > 0 Then If Stringtouse.Length = 1 Then returnlist.Add(Convert.ToInt32(Stringtouse)) Else Dim Array1() As String = Stringtouse.Split(",") If Array1.Count > 0 Then For Each Str As String In Array1 returnlist.Add(Convert.ToInt32(Str)) Next End If End If End If Return returnlist End Get Set(ByVal value As List(Of Integer)) Dim str As New StringBuilder If value.Count > 0 Then For Each Num As Integer In value str.Append("," & Num.ToString) Next str.Remove(0, 1) End If UpdateSetting("CardMap", str.ToString) End Set End Property Public Property LastUpdate As DateTime Get Return DateTime.Parse(GetSkySetting("LastUpdate", Now.ToString)) End Get Set(ByVal value As DateTime) UpdateSetting("LastUpdate", value.ToString) End Set End Property Public Property UseSkyNumbers() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UseSkyNumbers", True)) End Get Set(ByVal value As Boolean) UpdateSetting("UseSkyNumbers", value.ToString) End Set End Property Public Property UseSkyCategories() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UseSkyCategories", True)) End Get Set(ByVal value As Boolean) UpdateSetting("UseSkyCategories", value.ToString) End Set End Property Public Property UseSkyRegions() As Boolean Get Return Convert.ToBoolean(GetSkySetting("UseSkyRegions", True)) End Get Set(ByVal value As Boolean) UpdateSetting("UseSkyRegions", value.ToString) End Set End Property Public Property DeleteOldChannels() As Boolean Get Return Convert.ToBoolean(GetSkySetting("DeleteOldChannels", True)) End Get Set(ByVal value As Boolean) UpdateSetting("DeleteOldChannels", value.ToString) End Set End Property Public Property OldChannelFolder() As String Get Return GetSkySetting("OldChannelFolder", "Old Sky Channels") End Get Set(ByVal value As String) UpdateSetting("OldChannelFolder", value) End Set End Property Public Property RegionIndex() As Integer Get Return Convert.ToInt32(GetSkySetting("RegionIndex", 0)) End Get Set(ByVal value As Integer) UpdateSetting("RegionIndex", value.ToString) End Set End Property Public Property CardToUseIndex() As Integer Get Return Convert.ToInt32(GetSkySetting("CardToUseIndex", 0)) End Get Set(ByVal value As Integer) UpdateSetting("CardToUseIndex", value.ToString) End Set End Property Public Property DiseqC() As Integer Get Return Convert.ToInt32(GetSkySetting("DiseqC", -1)) End Get Set(ByVal value As Integer) UpdateSetting("DiseqC", value.ToString) End Set End Property Public Property SwitchingFrequency() As Integer Get Return Convert.ToInt32(GetSkySetting("SwitchingFrequency", 11700000)) End Get Set(ByVal value As Integer) UpdateSetting("SwitchingFrequency", value.ToString) End Set End Property Public Property IsGrabbing() As Boolean Get Return Convert.ToBoolean(GetSkySetting("IsGrabbing", False)) End Get Set(ByVal value As Boolean) UpdateSetting("IsGrabbing", value.ToString) End Set End Property Public Function GetCategory(ByVal CatByte As Byte) As String Return GetSkySetting("Cat" & CatByte, CatByte) End Function Public Sub SetCategory(ByVal CatByte As Byte, ByVal Name As String) UpdateSetting("Cat" & CatByte, Name) End Sub Public Function GetTheme(ByVal Id As Integer) As String If Themes.ContainsKey(Id) Then Return Themes(Id) Else Return "" End If End Function Public Sub New() Themes.Add(&H0, "No Category") Themes.Add(&H1, "") Themes.Add(&H2, "") Themes.Add(&H3, "") Themes.Add(&H4, "") Themes.Add(&H5, "") Themes.Add(&H6, "") Themes.Add(&H7, "") Themes.Add(&H8, "") Themes.Add(&H9, "") Themes.Add(&HA, "") Themes.Add(&HB, "") Themes.Add(&HC, "") Themes.Add(&HD, "") Themes.Add(&HE, "") Themes.Add(&HF, "") Themes.Add(&H10, "") Themes.Add(&H11, "") Themes.Add(&H12, "") Themes.Add(&H13, "") Themes.Add(&H14, "") Themes.Add(&H15, "") Themes.Add(&H16, "") Themes.Add(&H17, "") Themes.Add(&H18, "") Themes.Add(&H19, "") Themes.Add(&H1A, "") Themes.Add(&H1B, "") Themes.Add(&H1C, "") Themes.Add(&H1D, "") Themes.Add(&H1E, "") Themes.Add(&H1F, "") Themes.Add(&H20, "Specialist - Undefined") Themes.Add(&H21, "Specialist - Adult") Themes.Add(&H22, "Specialist - Events") Themes.Add(&H23, "Specialist - Shopping") Themes.Add(&H24, "Specialist - Gaming") Themes.Add(&H25, "") Themes.Add(&H26, "") Themes.Add(&H27, "") Themes.Add(&H28, "") Themes.Add(&H29, "") Themes.Add(&H2A, "") Themes.Add(&H2B, "") Themes.Add(&H2C, "") Themes.Add(&H2D, "") Themes.Add(&H2E, "") Themes.Add(&H2F, "") Themes.Add(&H30, "") Themes.Add(&H31, "") Themes.Add(&H32, "") Themes.Add(&H33, "") Themes.Add(&H34, "") Themes.Add(&H35, "") Themes.Add(&H36, "") Themes.Add(&H37, "") Themes.Add(&H38, "") Themes.Add(&H39, "") Themes.Add(&H3A, "") Themes.Add(&H3B, "") Themes.Add(&H3C, "") Themes.Add(&H3D, "") Themes.Add(&H3E, "") Themes.Add(&H3F, "") Themes.Add(&H40, "Children - Undefined") Themes.Add(&H41, "Children - Cartoons") Themes.Add(&H42, "Children - Comedy") Themes.Add(&H43, "Children - Drama") Themes.Add(&H44, "Children - Educational") Themes.Add(&H45, "Children - Under 5") Themes.Add(&H46, "Children - Factual") Themes.Add(&H47, "Children - Magazine") Themes.Add(&H48, "Children - Games Shows") Themes.Add(&H49, "Children - Games") Themes.Add(&H4A, "") Themes.Add(&H4B, "") Themes.Add(&H4C, "") Themes.Add(&H4D, "") Themes.Add(&H4E, "") Themes.Add(&H4F, "") Themes.Add(&H50, "") Themes.Add(&H51, "") Themes.Add(&H52, "") Themes.Add(&H53, "") Themes.Add(&H54, "") Themes.Add(&H55, "") Themes.Add(&H56, "") Themes.Add(&H57, "") Themes.Add(&H58, "") Themes.Add(&H59, "") Themes.Add(&H5A, "") Themes.Add(&H5B, "") Themes.Add(&H5C, "") Themes.Add(&H5D, "") Themes.Add(&H5E, "") Themes.Add(&H5F, "") Themes.Add(&H60, "Entertainment - Undefined") Themes.Add(&H61, "Entertainment - Action") Themes.Add(&H62, "Entertainment - Comedy") Themes.Add(&H63, "Entertainment - Detective") Themes.Add(&H64, "Entertainment - Drama") Themes.Add(&H65, "Entertainment - Game Show") Themes.Add(&H66, "Entertainment - Sci-FI") Themes.Add(&H67, "Entertainment - Soap") Themes.Add(&H68, "Entertainment - Animation") Themes.Add(&H69, "Entertainment - Chat Show") Themes.Add(&H6A, "Entertainment - Cooking") Themes.Add(&H6B, "Entertainment - Factual") Themes.Add(&H6C, "Entertainment - Fashion") Themes.Add(&H6D, "Entertainment - Gardening") Themes.Add(&H6E, "Entertainment - Travel") Themes.Add(&H6F, "Entertainment - Technology") Themes.Add(&H70, "Entertainment - Arts") Themes.Add(&H71, "Entertainment - Lifestyle") Themes.Add(&H72, "Entertainment - Home") Themes.Add(&H73, "Entertainment - Magazine") Themes.Add(&H74, "Entertainment - Medical") Themes.Add(&H75, "Entertainment - Review") Themes.Add(&H76, "Entertainment - Antiques") Themes.Add(&H77, "Entertainment - Motors") Themes.Add(&H78, "Entertainment - Art&Lit") Themes.Add(&H79, "Entertainment - Ballet") Themes.Add(&H7A, "Entertainment - Opera") Themes.Add(&H7B, "") Themes.Add(&H7C, "") Themes.Add(&H7D, "") Themes.Add(&H7E, "") Themes.Add(&H7F, "") Themes.Add(&H80, "Music & Radio - Undefined") Themes.Add(&H81, "Music & Radio - Classical") Themes.Add(&H82, "Music & Radio - Folk and Country") Themes.Add(&H83, "Music & Radio - National Music") Themes.Add(&H84, "Music & Radio - Jazz") Themes.Add(&H85, "Music & Radio - Opera") Themes.Add(&H86, "Music & Radio - Rock&Pop") Themes.Add(&H87, "Music & Radio - Alternative Music") Themes.Add(&H88, "Music & Radio - Events") Themes.Add(&H89, "Music & Radio - Club and Dance") Themes.Add(&H8A, "Music & Radio - Hip Hop") Themes.Add(&H8B, "Music & Radio - Soul/R&B") Themes.Add(&H8C, "Music & Radio - Dance") Themes.Add(&H8D, "Music & Radio - Ballet") Themes.Add(&H8E, "") Themes.Add(&H8F, "Music & Radio - Current Affairs") Themes.Add(&H90, "Music & Radio - Features") Themes.Add(&H91, "Music & Radio - Arts & Lit.") Themes.Add(&H92, "Music & Radio - Factual") Themes.Add(&H93, "") Themes.Add(&H94, "") Themes.Add(&H95, "Music & Radio - Lifestyle") Themes.Add(&H96, "Music & Radio - News and Weather") Themes.Add(&H97, "Music & Radio - Easy Listening") Themes.Add(&H98, "Music & Radio - Discussion") Themes.Add(&H99, "Music & Radio - Entertainment") Themes.Add(&H9A, "Music & Radio - Religious") Themes.Add(&H9B, "") Themes.Add(&H9C, "") Themes.Add(&H9D, "") Themes.Add(&H9E, "") Themes.Add(&H9F, "") Themes.Add(&HA0, "News & Documentaries - Undefined") Themes.Add(&HA1, "News & Documentaries - Business") Themes.Add(&HA2, "News & Documentaries - World Cultures") Themes.Add(&HA3, "News & Documentaries - Adventure") Themes.Add(&HA4, "News & Documentaries - Biography") Themes.Add(&HA5, "News & Documentaries - Educational") Themes.Add(&HA6, "News & Documentaries - Feature") Themes.Add(&HA7, "News & Documentaries - Politics") Themes.Add(&HA8, "News & Documentaries - News") Themes.Add(&HA9, "News & Documentaries - Nature") Themes.Add(&HAA, "News & Documentaries - Religious") Themes.Add(&HAB, "News & Documentaries - Science") Themes.Add(&HAC, "News & Documentaries - Showbiz") Themes.Add(&HAD, "News & Documentaries - War Documentary") Themes.Add(&HAE, "News & Documentaries - Historical") Themes.Add(&HAF, "News & Documentaries - Ancient") Themes.Add(&HB0, "News & Documentaries - Transport") Themes.Add(&HB1, "News & Documentaries - Docudrama") Themes.Add(&HB2, "News & Documentaries - World Affairs") Themes.Add(&HB3, "News & Documentaries - Features") Themes.Add(&HB4, "News & Documentaries - Showbiz") Themes.Add(&HB5, "News & Documentaries - Politics") Themes.Add(&HB6, "News & Documentaries - Transport") Themes.Add(&HB7, "News & Documentaries - World Affairs") Themes.Add(&HB8, "") Themes.Add(&HB9, "") Themes.Add(&HBA, "") Themes.Add(&HBB, "") Themes.Add(&HBC, "") Themes.Add(&HBD, "") Themes.Add(&HBE, "") Themes.Add(&HBF, "") Themes.Add(&HC0, "Movie") Themes.Add(&HC1, "Movie - Action") Themes.Add(&HC2, "Movie - Animation") Themes.Add(&HC3, "") Themes.Add(&HC4, "Movie - Comedy") Themes.Add(&HC5, "Movie - Family") Themes.Add(&HC6, "Movie - Drama") Themes.Add(&HC7, "") Themes.Add(&HC8, "Movie - Sci-Fi") Themes.Add(&HC9, "Movie - Thriller") Themes.Add(&HCA, "Movie - Horror") Themes.Add(&HCB, "Movie - Romance") Themes.Add(&HCC, "Movie - Musical") Themes.Add(&HCD, "Movie - Mystery") Themes.Add(&HCE, "Movie - Western") Themes.Add(&HCF, "Movie - Factual") Themes.Add(&HD0, "Movie - Fantasy") Themes.Add(&HD1, "Movie - Erotic") Themes.Add(&HD2, "Movie - Adventure") Themes.Add(&HD3, "Movies - War") Themes.Add(&HD4, "") Themes.Add(&HD5, "") Themes.Add(&HD6, "") Themes.Add(&HD7, "") Themes.Add(&HD8, "") Themes.Add(&HD9, "") Themes.Add(&HDA, "") Themes.Add(&HDB, "") Themes.Add(&HDC, "") Themes.Add(&HDD, "") Themes.Add(&HDE, "") Themes.Add(&HDF, "") Themes.Add(&HE0, "Sports - Undefined") Themes.Add(&HE1, "Sports - American Football") Themes.Add(&HE2, "Sports - Athletics") Themes.Add(&HE3, "Sports - Baseball") Themes.Add(&HE4, "Sports - Basketball") Themes.Add(&HE5, "Sports - Boxing") Themes.Add(&HE6, "Sports - Cricket") Themes.Add(&HE7, "Sports - Fishing") Themes.Add(&HE8, "Sports - Football") Themes.Add(&HE9, "Sports - Golf") Themes.Add(&HEA, "Sports - Ice Hockey") Themes.Add(&HEB, "Sports - Motor Sport") Themes.Add(&HEC, "Sports - Racing") Themes.Add(&HED, "Sports - Rugby") Themes.Add(&HEE, "Sports - Equestrian") Themes.Add(&HEF, "Sports - Winter Sports") Themes.Add(&HF0, "Sports - Snooker / Pool") Themes.Add(&HF1, "Sports - Tennis") Themes.Add(&HF2, "Sports - Wrestling") Themes.Add(&HF3, "Sports - Darts") Themes.Add(&HF4, "Sports - Watersports") Themes.Add(&HF5, "Sports - Extreme") Themes.Add(&HF6, "Sports - Other") Themes.Add(&HF7, "") Themes.Add(&HF8, "") Themes.Add(&HF9, "") Themes.Add(&HFA, "") Themes.Add(&HFB, "") Themes.Add(&HFC, "") Themes.Add(&HFD, "") Themes.Add(&HFE, "") Themes.Add(&HFF, "") End Sub End Class Public Class SkyGrabber Dim MapCards As List(Of Integer) Dim CardstoMap As New List(Of Card) Dim Settings As New Settings Public firstask As Boolean = True Public WithEvents Sky As CustomDataGRabber Public Channels As New Dictionary(Of Integer, Sky_Channel) Public Bouquets As New Dictionary(Of Integer, SkyBouquet) Public SDTInfo As New Dictionary(Of String, SDTInfo) Public NITInfo As New Dictionary(Of Integer, NITSatDescriptor) Dim numberBouquetsPopulated As Integer = 0 Dim SDTCount As Integer = 0 Dim numberSDTPopulated As String = "" Dim GotAllSDT As Boolean = False Dim numberTIDPopulated As Integer = 0 Dim GotAllTID As Boolean = False Public titlesDecoded As Integer = 0 Dim summariesDecoded As Integer = 0 Public titleDataCarouselStartLookup As New Dictionary(Of Integer, String) Public completedTitleDataCarousels As New List(Of Integer) Public summaryDataCarouselStartLookup As New Dictionary(Of Integer, String) Public completedSummaryDataCarousels As New List(Of Integer) Public CatsDesc As New Dictionary(Of String, String) Private orignH As New HuffmanTreeNode Private nH As HuffmanTreeNode Dim _layer As New TvBusinessLayer Dim CPUHog As Integer = 0 Dim MaxThisCanDo As Integer = 0 Dim start As DateTime Dim DVBSChannel As DVBSChannel Dim FirstLCN As LCNHolder Public NITGot As Boolean = False Public Regions As New List(Of String) Public BouquetIDtoUse As Integer Public RegionIDtoUse As Integer Public GrabEPG As Boolean Public lasttime As DateTime Sub Reset() Channels.Clear() Bouquets.Clear() SDTInfo.Clear() NITInfo.Clear() numberBouquetsPopulated = 0 titlesDecoded = 0 summariesDecoded = 0 titleDataCarouselStartLookup.Clear() completedTitleDataCarousels.Clear() summaryDataCarouselStartLookup.Clear() completedSummaryDataCarousels.Clear() CatsDesc.Clear() orignH.Clear() CPUHog = 0 MaxThisCanDo = 0 start = Now NITGot = False BouquetIDtoUse = Settings.BouquetID RegionIDtoUse = Settings.RegionID numberSDTPopulated = "" GotAllSDT = False numberTIDPopulated = 0 GotAllTID = False End Sub Function AreAllTitlesPopulated() If completedTitleDataCarousels.Count = 8 Then Return True Else Return False End If End Function Function DoesTidCarryEpgTitleData(ByVal TableID As Integer) As Boolean If TableID = &HA0 Or TableID = &HA1 Or TableID = &HA2 Or TableID = &HA3 Then Return True Else Return False End If End Function Function IsTitleDataCarouselOnPidComplete(ByVal pid As Integer) As Boolean For Each pid1 As Integer In completedTitleDataCarousels If (pid1 = pid) Then Return True End If Next Return False End Function Private Sub OnTitleReceived(ByVal pid As Integer, ByVal titleChannelEventUnionId As String) If titleDataCarouselStartLookup.ContainsKey(pid) Then If (titleDataCarouselStartLookup(pid) = titleChannelEventUnionId) Then completedTitleDataCarousels.Add(pid) End If Else titleDataCarouselStartLookup.Add(pid, titleChannelEventUnionId) End If End Sub Function AreAllSummariesPopulated() If completedSummaryDataCarousels.Count = 8 Then Return True Else Return False End If End Function Private Sub OnSummaryReceived(ByVal pid As Integer, ByVal summaryChannelEventUnionId As String) If summaryDataCarouselStartLookup.ContainsKey(pid) Then If (summaryDataCarouselStartLookup(pid) = summaryChannelEventUnionId) Then completedSummaryDataCarousels.Add(pid) If (AreAllSummariesPopulated()) Then Return End If End If Else summaryDataCarouselStartLookup.Add(pid, summaryChannelEventUnionId) End If End Sub Function IsSummaryDataCarouselOnPidComplete(ByVal pid As Integer) As Boolean For Each pid1 As Integer In completedSummaryDataCarousels If pid1 = pid Then Return True Next Return False End Function Sub UpdateEPGEvent(ByRef channelId As Integer, ByVal eventId As Integer, ByVal SkyEvent As SkyEvent) If Channels.ContainsKey(channelId) Then If Channels(channelId).Events.ContainsKey(eventId) Then Channels(channelId).Events(eventId) = SkyEvent End If End If End Sub Sub UpdateChannel(ByVal ChannelId As Integer, ByVal Channel As Sky_Channel) If Channels.ContainsKey(ChannelId) Then Channels(ChannelId) = Channel End If End Sub Function GetEpgEvent(ByVal channelId As Long, ByVal eventId As Integer) As SkyEvent Dim channel As Sky_Channel = GetChannel(channelId) If channel.Events.ContainsKey(eventId) = False Then channel.Events.Add(eventId, New SkyEvent) End If Dim returnEvent As SkyEvent = channel.Events(eventId) Return returnEvent End Function Private Sub OnTitleSectionReceived(ByVal pid As Integer, ByVal section As Section) Try If (IsTitleDataCarouselOnPidComplete(pid)) Then Return End If If (DoesTidCarryEpgTitleData(section.table_id) = False) Then Return End If Dim buffer() As Byte = section.Data Dim totalLength As Integer = (((buffer(1) And &HF) * 256) + buffer(2)) - 2 If (section.section_length < 20) Then Return End If Dim channelId As Long = (buffer(3) * (2 ^ 8)) + buffer(4) Dim mjdStart As Long = (buffer(8) * (2 ^ 8)) + buffer(9) If (channelId = 0 Or mjdStart = 0) Then Return End If Dim currentTitleItem As Integer = 10 Dim iterationCounter As Integer = 0 Do While (currentTitleItem < totalLength) If (iterationCounter > 512) Then Return End If iterationCounter += 1 Dim eventId As Integer = (buffer(currentTitleItem + 0) * (2 ^ 8)) + buffer(currentTitleItem + 1) Dim headerType As Double = (buffer(currentTitleItem + 2) And &HF0) >> 4 Dim bodyLength As Integer = ((buffer(currentTitleItem + 2) And &HF) * (2 ^ 8)) + buffer(currentTitleItem + 3) Dim carouselLookupId As String = channelId.ToString & ":" & eventId.ToString OnTitleReceived(pid, carouselLookupId) If (IsTitleDataCarouselOnPidComplete(pid)) Then Return End If Dim epgEvent As SkyEvent = GetEpgEvent(channelId, eventId) If epgEvent Is Nothing Then Return End If epgEvent.mjdStart = mjdStart epgEvent.EventID = eventId Dim headerLength As Integer = 4 Dim currentTitleItemBody As Integer = currentTitleItem + headerLength Dim titleDescriptor As Integer = buffer(currentTitleItemBody + 0) Dim encodedBufferLength As Integer = buffer(currentTitleItemBody + 1) - 7 If (titleDescriptor = &HB5) Then epgEvent.StartTime = (buffer(currentTitleItemBody + 2) * (2 ^ 9)) Or (buffer(currentTitleItemBody + 3) * (2 ^ 1)) epgEvent.Duration = (buffer(currentTitleItemBody + 4) * (2 ^ 9)) Or (buffer(currentTitleItemBody + 5) * (2 ^ 1)) Dim themeId As Byte = buffer(currentTitleItemBody + 6) epgEvent.Category = themeId epgEvent.SetFlags(buffer(currentTitleItemBody + 7)) epgEvent.SetCategory(buffer(currentTitleItemBody + 8)) epgEvent.seriesTermination = ((buffer(currentTitleItemBody + 8) And &H40) >> 6) Xor &H1 If (encodedBufferLength <= 0) Then currentTitleItem += (headerLength + bodyLength) End If If (epgEvent.Title = "") Then '// Decode the huffman buffer Dim huffbuff(&H1000) As Byte If (currentTitleItemBody + 9 + encodedBufferLength > buffer.Length) Then Return End If Array.Copy(buffer, currentTitleItemBody + 9, huffbuff, 0, encodedBufferLength) epgEvent.Title = NewHuffman(huffbuff, encodedBufferLength) If (epgEvent.Title <> "") Then OnTitleDecoded() End If Else Return End If UpdateEPGEvent(channelId, epgEvent.EventID, epgEvent) End If currentTitleItem += (bodyLength + headerLength) Loop If Not (currentTitleItem = (totalLength + 1)) Then Return End If Catch err As Exception RaiseEvent OnMessage("Error decoding title, " & err.Message, False) Return End Try End Sub Public Event OnMessage(ByVal Text As String, ByVal UpdateLast As Boolean) Sub ParseNIT(ByVal Data As Section, ByVal Length As Integer) Try If NITGot Then Return Dim buf As Byte() = Data.Data Dim section_syntax_indicator As Integer = buf(1) And &H80 Dim section_length As Integer = ((buf(1) And &HF) * 256) Or buf(2) Dim network_id As Integer = (buf(3) * 256) Or buf(4) Dim version_number As Integer = (buf(5) >> 1) And &H1F Dim current_next_indicator As Integer = buf(5) And 1 Dim section_number As Integer = buf(6) Dim last_section_number As Integer = buf(7) Dim network_descriptor_length As Integer = ((buf(8) And &HF) * 256) Or buf(9) Dim l1 As Integer = network_descriptor_length Dim pointer As Integer = 10 Dim x As Integer = 0 Do While (l1 > 0) Dim indicator As Integer = buf(pointer) x = buf(pointer + 1) + 2 'LogDebug("decode nit desc1:%x len:%d", indicator,x) If (indicator = &H40) Then Dim netWorkName As String = System.Text.Encoding.GetEncoding("iso-8859-1").GetString(buf, pointer + 2, x - 2) End If l1 -= x pointer += x Loop pointer = 10 + network_descriptor_length If (pointer > section_length) Then Return 'LogDebug("NIT: decode() network:'%s'", m_nit.NetworkName) Dim transport_stream_loop_length As Integer = ((buf(pointer) And &HF) * 256) + buf(pointer + 1) l1 = transport_stream_loop_length pointer += 2 Do While (l1 > 0) If (pointer + 2 > section_length) Then Return Dim transport_stream_id As Integer = (buf(pointer) * 256) + buf(pointer + 1) Dim original_network_id As Integer = (buf(pointer + 2) * 256) + buf(pointer + 3) Dim transport_descriptor_length As Integer = ((buf(pointer + 4) And &HF) * 256) + buf(pointer + 5) pointer += 6 l1 -= 6 Dim l2 As Integer = transport_descriptor_length Do While (l2 > 0) If (pointer + 2 > section_length) Then Return Dim indicator As Integer = buf(pointer) x = buf(pointer + 1) + 2 If (indicator = &H43) Then ' sat DVB_GetSatDelivSys(buf, pointer, x, original_network_id, transport_stream_id) End If pointer += x l2 -= x l1 -= x Loop Loop Catch ex As Exception RaiseEvent OnMessage("Error Parsing NIT", False) End Try End Sub Sub DVB_GetSatDelivSys(ByVal b As Byte(), ByVal pointer As Integer, ByVal maxLen As Integer, ByVal NetworkID As Integer, ByVal TransportID As Integer) If (b(pointer + 0) = &H43 And maxLen >= 13) Then Dim descriptor_tag = b(pointer + 0) Dim descriptor_length = b(pointer + 1) If (descriptor_length > 13) Then Return Dim satteliteNIT As New NITSatDescriptor satteliteNIT.TID = TransportID satteliteNIT.Frequency = (100000000 * ((b(pointer + 2) >> 4) And &HF)) satteliteNIT.Frequency += (10000000 * (b(pointer + 2) And &HF)) satteliteNIT.Frequency += (1000000 * ((b(pointer + 3) >> 4) And &HF)) satteliteNIT.Frequency += (100000 * (b(pointer + 3) And &HF)) satteliteNIT.Frequency += (10000 * ((b(pointer + 4) >> 4) And &HF)) satteliteNIT.Frequency += (1000 * (b(pointer + 4) And &HF)) satteliteNIT.Frequency += (100 * ((b(pointer + 5) >> 4) And &HF)) satteliteNIT.Frequency += (10 * (b(pointer + 5) And &HF)) satteliteNIT.OrbitalPosition += (1000 * ((b(pointer + 6) >> 4) And &HF)) satteliteNIT.OrbitalPosition += (100 * ((b(pointer + 6) And &HF))) satteliteNIT.OrbitalPosition += (10 * ((b(pointer + 7) >> 4) And &HF)) satteliteNIT.OrbitalPosition += (b(pointer + 7) And &HF) satteliteNIT.WestEastFlag = (b(pointer + 8) And &H80) >> 7 Dim Polarisation = (b(pointer + 8) And &H60) >> 5 satteliteNIT.Polarisation = Polarisation + 1 satteliteNIT.isS2 = (b(pointer + 8) And &H4) >> 2 If (satteliteNIT.isS2) Then Dim rollOff = (b(pointer + 8) And &H18) >> 3 Select Case rollOff Case Is = 0 satteliteNIT.RollOff = 3 Case Is = 1 satteliteNIT.RollOff = 2 Case Is = 2 satteliteNIT.RollOff = 1 End Select Else satteliteNIT.RollOff = -1 End If satteliteNIT.Modulation = (b(pointer + 8) And &H3) satteliteNIT.Symbolrate = (100000 * ((b(pointer + 9) >> 4) And &HF)) satteliteNIT.Symbolrate += (10000 * ((b(pointer + 9) And &HF))) satteliteNIT.Symbolrate += (1000 * ((b(pointer + 10) >> 4) And &HF)) satteliteNIT.Symbolrate += (100 * ((b(pointer + 10) And &HF))) satteliteNIT.Symbolrate += (10 * ((b(pointer + 11) >> 4) And &HF)) satteliteNIT.Symbolrate += (1 * ((b(pointer + 11) And &HF))) Dim fec As Integer = (b(pointer + 12) And &HF) Select Case fec Case 0 fec = 0 Case 1 fec = 1 Case 2 fec = 2 Case 3 fec = 3 Case 4 fec = 6 Case 5 fec = 8 Case 6 fec = 13 Case 7 fec = 4 Case 8 fec = 5 Case 9 fec = 14 Case Else fec = 0 End Select satteliteNIT.FECInner = fec If Not NITInfo.ContainsKey(TransportID) Then NITInfo.Add(TransportID, satteliteNIT) Else If GotAllTID <> True Then RaiseEvent OnMessage("Got Network Information, " & NITInfo.Count & " transponders", False) End If GotAllTID = True Return End If End If End Sub Public Sub OnTSPacket(ByVal Pid As Integer, ByVal Length As Integer, ByVal Data As Section) Handles Sky.OnPacket ' Try Select Case Pid Case Is = &H10 'NIT If GotAllTID = False Then ParseNIT(Data, Length) End If Case Is = &H11 'SDT/BAT ParseChannels(Data, Length) Case Is = &H30, &H31, &H32, &H33, &H34, &H35, &H36, &H37 'OpenTV Titles OnTitleSectionReceived(Pid, Data) Case Is = &H40, &H41, &H42, &H43, &H44, &H45, &H46, &H47 'OpenTV Sumarries OnSummarySectionReceived(Pid, Data) End Select If IsEverythingGrabbed() Then RaiseEvent OnMessage("Everything Grabbed", False) Sky.SendComplete(0) End If End Sub Sub CreateGroups() If Settings.UseSkyCategories Then Dim groups As New List(Of String) If Settings.GetSkySetting("CatByte20", "-1") <> "-1" And Settings.GetSkySetting("CatText20", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText20", "")) If Settings.GetSkySetting("CatByte19", "-1") <> "-1" And Settings.GetSkySetting("CatText19", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText19", "")) If Settings.GetSkySetting("CatByte18", "-1") <> "-1" And Settings.GetSkySetting("CatText18", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText18", "")) If Settings.GetSkySetting("CatByte17", "-1") <> "-1" And Settings.GetSkySetting("CatText17", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText17", "")) If Settings.GetSkySetting("CatByte16", "-1") <> "-1" And Settings.GetSkySetting("CatText16", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText16", "")) If Settings.GetSkySetting("CatByte15", "-1") <> "-1" And Settings.GetSkySetting("CatText15", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText15", "")) If Settings.GetSkySetting("CatByte14", "-1") <> "-1" And Settings.GetSkySetting("CatText14", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText14", "")) If Settings.GetSkySetting("CatByte13", "-1") <> "-1" And Settings.GetSkySetting("CatText13", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText13", "")) If Settings.GetSkySetting("CatByte12", "-1") <> "-1" And Settings.GetSkySetting("CatText12", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText12", "")) If Settings.GetSkySetting("CatByte11", "-1") <> "-1" And Settings.GetSkySetting("CatText11", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText11", "")) If Settings.GetSkySetting("CatByte10", "-1") <> "-1" And Settings.GetSkySetting("CatText10", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText10", "")) If Settings.GetSkySetting("CatByte9", "-1") <> "-1" And Settings.GetSkySetting("CatText9", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText9", "")) If Settings.GetSkySetting("CatByte8", "-1") <> "-1" And Settings.GetSkySetting("CatText8", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText8", "")) If Settings.GetSkySetting("CatByte7", "-1") <> "-1" And Settings.GetSkySetting("CatText7", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText7", "")) If Settings.GetSkySetting("CatByte6", "-1") <> "-1" And Settings.GetSkySetting("CatText6", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText6", "")) If Settings.GetSkySetting("CatByte5", "-1") <> "-1" And Settings.GetSkySetting("CatText5", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText5", "")) If Settings.GetSkySetting("CatByte4", "-1") <> "-1" And Settings.GetSkySetting("CatText4", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText4", "")) If Settings.GetSkySetting("CatByte3", "-1") <> "-1" And Settings.GetSkySetting("CatText3", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText3", "")) If Settings.GetSkySetting("CatByte2", "-1") <> "-1" And Settings.GetSkySetting("CatText2", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText2", "")) If Settings.GetSkySetting("CatByte1", "-1") <> "-1" And Settings.GetSkySetting("CatText1", "") <> "" Then groups.Add(Settings.GetSkySetting("CatText1", "")) Dim a As Integer = groups.Count For Each Name As String In groups _layer.CreateGroup(Name) Dim group1 As ChannelGroup group1 = _layer.GetGroupByName(Name) group1.SortOrder = a group1.Persist() a -= 1 Next End If End Sub Public Sub UpdateAddChannels() Try Dim DiseqC As Integer = Settings.DiseqC Dim UseSkyNumbers As Boolean = Settings.UseSkyNumbers Dim SwitchingFrequency As Integer = Settings.SwitchingFrequency Dim UseSkyRegions As Boolean = Settings.UseSkyRegions Dim UseSkyCategories As Boolean = Settings.UseSkyCategories Dim ChannelsAdded As Integer = 0 Dim UseModNotSetSD As Boolean = Settings.UseNotSetModSD Dim UseModNotSetHD As Boolean = Settings.UseNotSetModHD Dim IgnoreScrambled As Boolean = Settings.IgnoreScrambled RaiseEvent OnMessage("", False) For Each pair As KeyValuePair(Of Integer, Sky_Channel) In Channels ChannelsAdded += 1 RaiseEvent OnMessage("(" & ChannelsAdded & "/" & Channels.Count & ") Channels sorted", True) Dim ScannedChannel As Sky_Channel = pair.Value Dim ChannelId As Integer = pair.Key If ChannelId < 1 Then Continue For Dim DBChannel As Channel Dim channel As New DVBSChannel Dim currentDetail As TuningDetail If ScannedChannel.NID = 0 Or ScannedChannel.TID = 0 Or ScannedChannel.SID = 0 Then Continue For End If Dim SDT As SDTInfo = GetChannelbySID(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) If SDT Is Nothing Then Continue For End If If IgnoreScrambled And SDT.isFTA Then Continue For End If Dim checker As Channel = _layer.GetChannelbyExternalID(ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString) If Not checker Is Nothing Then Dim Channels As List(Of TuningDetail) = checker.ReferringTuningDetail For Each Chann As TuningDetail In Channels If Chann.ChannelType = 3 And Chann.NetworkId = 2 Then currentDetail = Chann Exit For End If Next End If ' If currentDetail Is Nothing Then 'add new channel AddNewChannel: Dim NIT As NITSatDescriptor If Not NITInfo.ContainsKey(ScannedChannel.TID) Then 'no nit info RaiseEvent OnMessage("No NIT found for : " & ScannedChannel.SID, False) RaiseEvent OnMessage("", False) Continue For End If DBChannel = _layer.AddNewChannel(SDT.ChannelName) NIT = NITInfo(ScannedChannel.TID) DVBSChannel.BandType = 0 DVBSChannel.DisEqc = CType(DiseqC, DisEqcType) DVBSChannel.FreeToAir = True DVBSChannel.Frequency = NIT.Frequency DVBSChannel.SymbolRate = NIT.Symbolrate DVBSChannel.InnerFecRate = CType(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate) DVBSChannel.IsRadio = SDT.isRadio DVBSChannel.IsTv = SDT.isTV DVBSChannel.FreeToAir = Not SDT.isFTA DBChannel.SortOrder = 10000 DVBSChannel.LogicalChannelNumber = 10000 DBChannel.VisibleInGuide = True If UseSkyNumbers Then If ScannedChannel.LCNCount > 0 Then If ScannedChannel.ContainsLCN(BouquetIDtoUse, RegionIDtoUse) Then Dim LCNtouse As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, RegionIDtoUse) DVBSChannel.LogicalChannelNumber = LCNtouse.SkyNum DBChannel.SortOrder = LCNtouse.SkyNum Else If ScannedChannel.ContainsLCN(BouquetIDtoUse, 255) Then Dim LCNtouse As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, 255) DVBSChannel.LogicalChannelNumber = LCNtouse.SkyNum DBChannel.SortOrder = LCNtouse.SkyNum End If End If If DVBSChannel.LogicalChannelNumber = 10000 Then DBChannel.VisibleInGuide = False End If End If End If If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet Else Select Case NIT.Modulation Case 1 If NIT.isS2 Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk End If Case 2 If NIT.isS2 Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End If Case Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End Select End If DVBSChannel.Name = SDT.ChannelName DVBSChannel.NetworkId = ScannedChannel.NID DVBSChannel.Pilot = -1 DVBSChannel.Rolloff = -1 If NIT.isS2 = 1 Then DVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff) End If DVBSChannel.PmtPid = 0 DVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation) DVBSChannel.Provider = SDT.Provider DVBSChannel.ServiceId = ScannedChannel.SID DVBSChannel.TransportId = ScannedChannel.TID DVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter DBChannel.IsRadio = SDT.isRadio DBChannel.IsTv = SDT.isTV DBChannel.ExternalId = ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString DBChannel.Persist() MapChannelToCards(DBChannel) AddChannelToGroups(DBChannel, SDT, DVBSChannel, UseSkyCategories) _layer.AddTuningDetails(DBChannel, DVBSChannel) Else DBChannel = currentDetail.ReferencedChannel() If DBChannel.ExternalId <> ScannedChannel.NID & ":" & ChannelId.ToString Then 'Problem with TVServer so need to add new channel. GoTo AddNewChannel End If Dim checkDVBSChannel As DVBSChannel = _layer.GetTuningChannel(currentDetail) If checkDVBSChannel Is Nothing Then Continue For End If If DBChannel Is Nothing Then Continue For End If Dim Checksdt As SDTInfo If SDTInfo.ContainsKey(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) Then Dim haschanged As Boolean = False Dim deleteepg As Boolean = False Checksdt = SDTInfo(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) If DBChannel.DisplayName <> Checksdt.ChannelName Or currentDetail.Name <> Checksdt.ChannelName Then RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " name changed to " & Checksdt.ChannelName, False) DBChannel.DisplayName = Checksdt.ChannelName checkDVBSChannel.Name = Checksdt.ChannelName 'Check Channel hasn't become a real channel from a test channel If ScannedChannel.LCNCount > 0 And DBChannel.VisibleInGuide = False Then DBChannel.VisibleInGuide = True RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " is now part of the EPG making visible " & Checksdt.ChannelName & ".", False) End If haschanged = True End If If checkDVBSChannel.Provider <> Checksdt.Provider Then RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " Provider name changed to " & Checksdt.Provider & ".", False) RaiseEvent OnMessage("", False) checkDVBSChannel.Provider = Checksdt.Provider haschanged = True End If If currentDetail.TransportId <> ScannedChannel.TID Then 'Moved transponder RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False) RaiseEvent OnMessage("", False) Dim NIT As NITSatDescriptor If NITInfo.ContainsKey(ScannedChannel.TID) Then NIT = NITInfo(ScannedChannel.TID) Else Continue For End If checkDVBSChannel.BandType = 0 checkDVBSChannel.Frequency = NIT.Frequency checkDVBSChannel.SymbolRate = NIT.Symbolrate checkDVBSChannel.InnerFecRate = CType(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate) If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet Else Select Case NIT.Modulation Case 1 If NIT.isS2 Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk End If Case 2 If NIT.isS2 Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End If Case Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End Select End If checkDVBSChannel.Pilot = -1 checkDVBSChannel.Rolloff = -1 If NIT.isS2 = 1 Then checkDVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff) End If checkDVBSChannel.PmtPid = 0 checkDVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation) checkDVBSChannel.TransportId = ScannedChannel.TID checkDVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter haschanged = True deleteepg = True RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False) RaiseEvent OnMessage("", False) End If If currentDetail.ServiceId <> ScannedChannel.SID Then checkDVBSChannel.ServiceId = ScannedChannel.SID checkDVBSChannel.PmtPid = 0 RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " serviceID changed.", False) RaiseEvent OnMessage("", False) haschanged = True deleteepg = True End If If UseSkyRegions = True Then Dim checkLCN As Integer = 10000 If UseSkyNumbers Then If ScannedChannel.LCNCount > 0 Then If ScannedChannel.ContainsLCN(BouquetIDtoUse, RegionIDtoUse) Then Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, RegionIDtoUse) checkLCN = LCN.SkyNum Else If ScannedChannel.ContainsLCN(BouquetIDtoUse, 255) Then Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, 255) checkLCN = LCN.SkyNum End If End If If (currentDetail.ChannelNumber <> checkLCN And checkLCN < 1000) Or (checkLCN = 10000 And DBChannel.SortOrder <> 10000) Then RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " number has changed from : " & checkDVBSChannel.LogicalChannelNumber & " to : " & checkLCN & ".", False) RaiseEvent OnMessage("", False) DBChannel.RemoveFromAllGroups() currentDetail.ChannelNumber = checkLCN checkDVBSChannel.LogicalChannelNumber = checkLCN DBChannel.SortOrder = checkLCN DBChannel.VisibleInGuide = True haschanged = True AddChannelToGroups(DBChannel, Checksdt, checkDVBSChannel, UseSkyCategories) End If End If End If End If If haschanged Then DBChannel.Persist() Dim tuning As TuningDetail = _layer.UpdateTuningDetails(DBChannel, checkDVBSChannel, currentDetail) tuning.Persist() MapChannelToCards(DBChannel) If deleteepg Then _layer.RemoveAllPrograms(DBChannel.IdChannel) End If End If End If End If Next Catch err As Exception MsgBox(err.Message) End Try End Sub Private Sub MapChannelToCards(ByVal DBChannel As Channel) For Each card__1 As Card In CardstoMap _layer.MapChannelToCard(card__1, DBChannel, False) Next End Sub Private Sub AddChannelToGroups(ByVal DBChannel As Channel, ByVal SDT As SDTInfo, ByVal DVBSChannel As DVBSChannel, ByVal UseSkyCategories As Boolean) If DBChannel.IsTv Then _layer.AddChannelToGroup(DBChannel, TvConstants.TvGroupNames.AllChannels) If DVBSChannel.LogicalChannelNumber < 1000 Then If UseSkyCategories = True Then If Settings.GetCategory(SDT.Category) <> SDT.Category.ToString Then _layer.AddChannelToGroup(DBChannel, Settings.GetCategory(SDT.Category)) End If If SDT.isHD Then _layer.AddChannelToGroup(DBChannel, "HD Channels") End If If SDT.is3D Then _layer.AddChannelToGroup(DBChannel, "3D Channels") End If End If End If Else If DBChannel.IsRadio Then _layer.AddChannelToRadioGroup(DBChannel, TvConstants.RadioGroupNames.AllChannels) Else _layer.AddChannelToGroup(DBChannel, TvConstants.TvGroupNames.AllChannels) End If End If End Sub Public Sub UpdateEPG() Dim TVController1 As TvService.TVController = New TvService.TVController Dim DBUpd As New EpgDBUpdater(TVController1, "Sky TV EPG Updater", False) Dim ChannelstoUpdate As New List(Of EpgChannel) Dim AddExtraInfo As Boolean = Settings.useExtraInfo 'New method If _layer.GetPrograms(Now, Now.AddDays(1)).Count < 1 Then Dim listofprogs As New ProgramList For Each SkyChannelPair As KeyValuePair(Of Integer, Sky_Channel) In Channels Dim skyChannel As Sky_Channel = SkyChannelPair.Value Dim DBChannel As Channel = _layer.GetChannelByTuningDetail(skyChannel.NID, skyChannel.TID, skyChannel.SID) If DBChannel Is Nothing Then Else For Each SkyEvent1 As KeyValuePair(Of Integer, SkyEvent) In skyChannel.Events Dim Eventtouse As SkyEvent = SkyEvent1.Value If SkyEvent1.Value.EventID <> 0 And SkyEvent1.Value.Title <> "" Then Dim programStartDay As DateTime = (New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds((Eventtouse.mjdStart + 2400000.5 - 2440587.5) * 86400) Dim programStartTime As DateTime = programStartDay.AddSeconds(Eventtouse.StartTime) ' Start time is in UTC, need to convert to local time programStartTime = programStartTime.ToLocalTime() ' Calculate end time Dim programEndTime As DateTime = programStartTime.AddSeconds(Eventtouse.Duration) Dim desc As String If AddExtraInfo Then desc = Eventtouse.Summary & " " & Eventtouse.DescriptionFlag Else desc = Eventtouse.Summary End If Dim ProgtoAdd As New Program(DBChannel.IdChannel, programStartTime, programEndTime, Eventtouse.Title _ , desc, Settings.GetTheme(Convert.ToInt32(Eventtouse.Category)), TvDatabase.Program.ProgramState.None, New Date(1900, 1, 1), "", "", "", "", 0, Eventtouse.ParentalCategory, 0, Eventtouse.SeriesID.ToString(), Eventtouse.seriesTermination) listofprogs.Add(ProgtoAdd) End If Next End If Next _layer.InsertPrograms(listofprogs, System.Threading.ThreadPriority.Highest) Else For Each SkyChannelPair As KeyValuePair(Of Integer, Sky_Channel) In Channels Dim skyChannel As Sky_Channel = SkyChannelPair.Value Dim EpgChannel As EpgChannel = New EpgChannel Dim baseChannel As DVBBaseChannel = New DVBSChannel() baseChannel.NetworkId = skyChannel.NID baseChannel.TransportId = skyChannel.TID baseChannel.ServiceId = skyChannel.SID baseChannel.Name = String.Empty EpgChannel.Channel = baseChannel For Each SkyEvent1 As KeyValuePair(Of Integer, SkyEvent) In skyChannel.Events Dim Eventtouse As SkyEvent = SkyEvent1.Value If SkyEvent1.Value.EventID <> 0 And SkyEvent1.Value.Title <> "" Then Dim programStartDay As DateTime = (New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds((Eventtouse.mjdStart + 2400000.5 - 2440587.5) * 86400) Dim programStartTime As DateTime = programStartDay.AddSeconds(Eventtouse.StartTime) ' Start time is in UTC, need to convert to local time programStartTime = programStartTime.ToLocalTime() ' Calculate end time Dim programEndTime As DateTime = programStartTime.AddSeconds(Eventtouse.Duration) Dim skyProgramLang As EpgLanguageText If AddExtraInfo Then skyProgramLang = New EpgLanguageText("ALL", Eventtouse.Title, Eventtouse.Summary & " " & Eventtouse.DescriptionFlag, Settings.GetTheme(Convert.ToInt32(Eventtouse.Category)), 0, Eventtouse.ParentalCategory, -1) Else skyProgramLang = New EpgLanguageText("ALL", Eventtouse.Title, Eventtouse.Summary, Settings.GetTheme(Convert.ToInt32(Eventtouse.Category)), 0, Eventtouse.ParentalCategory, -1) End If Dim EPGProg As New EpgProgram(programStartTime, programEndTime) EPGProg.Text.Add(skyProgramLang) EPGProg.SeriesId = Eventtouse.SeriesID.ToString() EPGProg.SeriesTermination = Eventtouse.seriesTermination EpgChannel.Programs.Add(EPGProg) End If Next If EpgChannel.Programs.Count > 0 Then ChannelstoUpdate.Add(EpgChannel) End If Next Dim ChanNumber As Integer = 1 RaiseEvent OnMessage("", False) For Each EpgChannel As EpgChannel In ChannelstoUpdate DBUpd.UpdateEpgForChannel(EpgChannel) RaiseEvent OnMessage("(" & ChanNumber & "/" & ChannelstoUpdate.Count & ") Channels Updated", True) ChanNumber += 1 Next End If TVController1 = Nothing DBUpd = Nothing RaiseEvent OnMessage("EPG Update Complete", False) End Sub Public Event OnActivateControls() Sub UpdateDataBase(ByVal err As Boolean, ByVal errormessage As String) Handles Sky.OnComplete If err = False Then If Channels.Count < 100 Then RaiseEvent OnMessage("Error : Less than 100 channels found, Grabber found : " & Channels.Count, False) GoTo exitsub End If CreateGroups() If Settings.UpdateChannels Then RaiseEvent OnMessage("Moving/Deleting Old Channels", False) DeleteOldChannels() RaiseEvent OnMessage("Moving/Deleting Old Channels Complete", False) RaiseEvent OnMessage("Updating/Adding New Channels", False) UpdateAddChannels() RaiseEvent OnMessage("Updating/Adding New Channels Complete", False) End If If Settings.UpdateEPG Then RaiseEvent OnMessage("Updating EPG, please wait ... This can take upto 15 mins", False) UpdateEPG() End If Settings.LastUpdate = Now RaiseEvent OnMessage("Database Update Complete, took " & Int(Now.Subtract(start).TotalSeconds) & " Seconds", False) Else RaiseEvent OnMessage("Error Occured:- " & errormessage, False) End If exitsub: RaiseEvent OnActivateControls() Settings.IsGrabbing = False End Sub Private Sub DeleteOldChannels() Dim UseRegions As Boolean = Settings.UseSkyRegions Dim DeleteOld As Boolean = Settings.DeleteOldChannels Dim OldFolder As String = Settings.OldChannelFolder RegionIDtoUse = Settings.RegionID Dim ChannelstoCheck As List(Of Channel) = _layer.Channels For Each Channelto As Channel In ChannelstoCheck If Channelto.ExternalId.Count > 1 Then 'Delete channels that are no longer transmitted Dim ExternalID() As String = Channelto.ExternalId.Split(":") ' Get NID and ChannelID Dim NetworkID As Integer Dim ChannelID As Integer Try NetworkID = Convert.ToInt32(ExternalID(0)) ChannelID = Convert.ToInt32(ExternalID(1)) Catch Continue For End Try If NetworkID <> 2 Then Continue For 'Not a 28e channel If Channels.ContainsKey(ChannelID) = False Then removechannel(Channelto, DeleteOld, OldFolder) Continue For End If If UseRegions Then 'Move Channels that are not in this Bouquet Dim ScannedChannel As Sky_Channel = Channels(ChannelID) If ScannedChannel.ContainsLCN(BouquetIDtoUse, RegionIDtoUse) Or ScannedChannel.ContainsLCN(BouquetIDtoUse, 255) Then Continue For End If If (Channelto.IsTv And Channelto.VisibleInGuide = True) Then Channelto.RemoveFromAllGroups() Channelto.VisibleInGuide = False Channelto.Persist() _layer.AddChannelToGroup(Channelto, TvConstants.TvGroupNames.AllChannels) RaiseEvent OnMessage("Channel " & Channelto.DisplayName & " isn't used in this region, moved to all channels.", False) End If End If End If Next End Sub Sub removechannel(ByVal DBchannel As Channel, ByVal DeleteOld As Boolean, ByVal OldChannelFolder As String) 'channel has been deleted If DeleteOld Then DBchannel.Delete() RaiseEvent OnMessage("Channel " & DBchannel.DisplayName & " no longer exists in the EPG, Deleted.", False) Else DBchannel.RemoveFromAllGroups() DBchannel.Persist() _layer.AddChannelToGroup(DBchannel, OldChannelFolder) RaiseEvent OnMessage("Channel " & DBchannel.DisplayName & " no longer exists in the EPG, moved to " & OldChannelFolder & ".", False) End If End Sub Private Sub Grabit() Sky = New CustomDataGRabber MapCards = Settings.CardMap If MapCards Is Nothing Or MapCards.Count = 0 Then RaiseEvent OnMessage("No cards are selected for use, please correct this before continuing", False) Settings.IsGrabbing = False RaiseEvent OnActivateControls() Return End If Dim Cats() As String = My.Settings.UKCats.Split(vbNewLine) For Each Str As String In Cats Dim tr() As String tr = Str.Split("=") If Asc(tr(0).Substring(0, 1)) = 10 Then tr(0) = tr(0).Replace(Chr(10), "") End If CatsDesc.Add(tr(0), tr(1)) Next LoadHuffman(0) RaiseEvent OnMessage("Huffman Loaded", False) Dim Pid_List As New List(Of Integer) Pid_List.Add(&H10) Pid_List.Add(&H11) If Settings.UpdateEPG Then For i = 0 To 7 Pid_List.Add(&H30 + i) Pid_List.Add(&H40 + i) Next End If GrabEPG = Settings.UpdateEPG Dim Channel As TvDatabase.Channel DVBSChannel = New DVBSChannel() Dim channelss As List(Of TvDatabase.Channel) = _layer.GetChannelsByName("Sky UK Grabber") If channelss.Count = 0 Then Channel = _layer.AddNewChannel("Sky UK Grabber") Channel.VisibleInGuide = False Channel.SortOrder = 10000 Channel.IsRadio = True Channel.IsTv = False DVBSChannel.BandType = 0 DVBSChannel.DisEqc = CType(Settings.DiseqC, DisEqcType) DVBSChannel.FreeToAir = True DVBSChannel.Frequency = Settings.frequency DVBSChannel.SymbolRate = Settings.SymbolRate DVBSChannel.InnerFecRate = -1 DVBSChannel.IsRadio = True DVBSChannel.IsTv = False DVBSChannel.LogicalChannelNumber = 10000 DVBSChannel.ModulationType = CType(Settings.modulation - 1, DirectShowLib.BDA.ModulationType) DVBSChannel.Name = "Sky UK Grabber" DVBSChannel.NetworkId = Settings.NID DVBSChannel.Pilot = -1 DVBSChannel.PmtPid = 0 DVBSChannel.Polarisation = Settings.polarisation - 1 DVBSChannel.Provider = "DJBlu" DVBSChannel.Rolloff = -1 DVBSChannel.ServiceId = Settings.ServiceID DVBSChannel.TransportId = Settings.TransportID DVBSChannel.SatelliteIndex = 16 DVBSChannel.SwitchingFrequency = Settings.SwitchingFrequency Channel.Persist() _layer.AddTuningDetails(Channel, DVBSChannel) Dim id As Integer = -1 For Each card__1 As Card In Card.ListAll() If RemoteControl.Instance.Type(card__1.IdCard) = CardType.DvbS Then id += 1 If MapCards.Contains(id) Then CardstoMap.Add(card__1) _layer.MapChannelToCard(card__1, Channel, False) End If End If Next _layer.AddChannelToRadioGroup(Channel, TvConstants.RadioGroupNames.AllChannels) RaiseEvent OnMessage("Sky UK Grabber channel added to database", False) Else Channel = channelss(0) ' Dim num As Integer = Settings.CardToUseIndex Dim id As Integer = -1 For Each card__1 As Card In Card.ListAll() If RemoteControl.Instance.Type(card__1.IdCard) = CardType.DvbS Then id += 1 If MapCards.Contains(id) Then CardstoMap.Add(card__1) End If End If Next End If RaiseEvent OnMessage("Grabbing Data", False) If Channel Is Nothing Then RaiseEvent OnMessage("Channel was lost somewhere, try clicking on Grab data again", False) Else Dim seconds As Integer = Settings.GrabTime RaiseEvent OnMessage("Grabber set to grab " & seconds & " seconds of data", False) Sky.GrabData(Channel.IdChannel, seconds, Pid_List) End If End Sub Public Sub Grab() RaiseEvent OnMessage("Sky Channel and EPG Grabber initialised", False) If Settings.IsGrabbing = False Then Settings.IsGrabbing = True Reset() Dim back As Threading.Thread = New Threading.Thread(AddressOf Grabit) back.Start() End If End Sub Private Sub LoadHuffman(ByVal type As Integer) Dim file1 As String file1 = My.Resources.UKDict Dim String1, String2 As String Dim Line() As String If nH Is Nothing Then Else nH.Clear() orignH.Clear() End If Line = file1.Split(vbNewLine) Dim a As Integer For a = 0 To Line.GetUpperBound(0) Line(a) = Line(a).Replace(Chr(10), "") String2 = Line(a).Substring(Line(a).LastIndexOf("=") + 1, Line(a).Length - Line(a).LastIndexOf("=") - 1) String1 = Line(a).Substring(0, Line(a).LastIndexOf("=")) nH = orignH Dim t As Integer For t = 0 To String2.Length - 1 If String2(t) = "1" Then If (nH.P1 Is Nothing) Then nH.P1 = New HuffmanTreeNode nH = nH.P1 Else nH = nH.P1 End If Else If (nH.P0 Is Nothing) Then nH.P0 = New HuffmanTreeNode nH = nH.P0 Else nH = nH.P0 End If End If Next nH.Value = String1 Next nH = orignH Line = Nothing String1 = "" String2 = "" End Sub Public Function NewHuffman(ByVal Data() As Byte, ByVal Length As Integer) As String Dim DecodeText, DecodeErrorText As New StringBuilder Dim i, p, q Dim CodeError, IsFound As Boolean Dim showatend As Boolean = False Dim Byter, lastByte, Mask, lastMask As Byte nH = orignH p = 0 q = 0 DecodeText.Length = 0 DecodeErrorText.Length = 0 CodeError = False IsFound = False lastByte = 0 lastMask = 0 nH = orignH For i = 0 To Length - 1 Byter = Data(i) Mask = &H80 If (i = 0) Then If (Byter And &H20) = 1 Then showatend = True End If Mask = &H20 lastByte = i lastMask = Mask End If loop1: If (IsFound) Then lastByte = i lastMask = Mask IsFound = False End If If ((Byter And Mask) = 0) Then If (CodeError) Then DecodeErrorText.Append("0x30") q += 1 GoTo nextloop1 End If If (nH.P0 Is Nothing) = False Then nH = nH.P0 If (nH.Value <> "") Then If nH.Value <> "!!!" Then DecodeText.Append(nH.Value) End If p += Len(nH.Value) nH = orignH IsFound = True End If Else p += 9 i = lastByte Byter = Data(lastByte) Mask = lastMask CodeError = True GoTo loop1 End If Else If (CodeError) Then DecodeErrorText.Append("0x31") q += 1 GoTo nextloop1 End If If (nH.P1 Is Nothing) = False Then nH = nH.P1 If (nH.Value <> "") Then If nH.Value <> "!!!" Then DecodeText.Append(nH.Value) End If p += Len(nH.Value) nH = orignH IsFound = True End If Else p += 9 i = lastByte Byter = Data(lastByte) Mask = lastMask CodeError = True GoTo loop1 End If End If nextloop1: Mask = Mask >> 1 If (Mask > 0) Then GoTo loop1 End If Next Return DecodeText.ToString End Function Private Sub ParseSummaries(ByVal Data() As Byte, ByVal Length As Integer) End Sub Private Sub OnTitleDecoded() titlesDecoded += 1 End Sub Private Sub OnSummaryDecoded() summariesDecoded += 1 End Sub Private Sub ParseSDT(ByVal Data As Section, ByVal Length As Integer) Try If GotAllSDT = True Then Return Dim Section As Byte() = Data.Data Dim transport_id As Integer = ((Section(3)) * 256) + Section(4) Dim original_network_id As Long = ((Section(8)) * 256) + Section(9) Dim len1 As Integer = Length - 11 - 4 Dim descriptors_loop_length As Integer Dim len2 As Integer Dim service_id As Long Dim EIT_schedule_flag As Integer Dim free_CA_mode As Integer Dim running_status As Integer Dim EIT_present_following_flag As Integer Dim pointer As Integer = 11 Dim x As Integer = 0 Do While (len1 > 0) service_id = (Section(pointer) * 256) + Section(pointer + 1) EIT_schedule_flag = (Section(pointer + 2) >> 1) And 1 EIT_present_following_flag = Section(pointer + 2) And 1 running_status = (Section(pointer + 3) >> 5) And 7 free_CA_mode = (Section(pointer + 3) >> 4) And 1 descriptors_loop_length = ((Section(pointer + 3) And &HF) * 256) + Section(pointer + 4) pointer += 5 len1 -= 5 len2 = descriptors_loop_length Do While (len2 > 0) Dim indicator As Integer = Section(pointer) x = 0 x = Section(pointer + 1) + 2 If (indicator = &H48) Then Dim info As SDTInfo info = DVB_GetServiceNew(Section, pointer) info.SID = service_id info.isFTA = free_CA_mode If SDTInfo.ContainsKey(original_network_id & "-" & transport_id & "-" & service_id) = False Then SDTInfo.Add(original_network_id & "-" & transport_id & "-" & service_id, info) SDTCount += 1 End If If AreAllBouquetsPopulated() And SDTCount = Channels.Count Then If GotAllSDT = False Then GotAllSDT = True RaiseEvent OnMessage("Got All SDT Info, " & SDTInfo.Count & " Channels found", False) End If End If 'add sdt info Else Dim st As Integer = indicator If (Not st = &H53 And Not st = &H64) Then st = 1 End If End If len2 -= x pointer += x len1 -= x Loop Loop Catch ex As Exception RaiseEvent OnMessage("Error Parsing SDT", False) Return End Try End Sub Function DVB_GetServiceNew(ByVal b As Byte(), ByVal x As Integer) As SDTInfo Dim info As New SDTInfo Dim descriptor_tag As Integer Dim descriptor_length As Integer Dim service_provider_name_length As Integer Dim service_name_length As Integer Dim pointer As Integer = 0 descriptor_tag = b(x + 0) descriptor_length = b(x + 1) If b(x + 2) = &H2 Then 'Radio Channel info.isRadio = True info.isTV = False info.isHD = False info.is3D = False Else 'TV Channel/3D/HD info.isRadio = False info.isTV = True info.isHD = False info.is3D = False If b(x + 2) = &H19 Or b(x + 2) = &H11 Then info.isHD = True End If If b(x + 2) >= &H80 And b(x + 2) <= &H84 Then info.is3D = True End If End If service_provider_name_length = b(x + 3) pointer = 4 info.Provider = GetString(b, pointer + x, service_provider_name_length, False) pointer += service_provider_name_length service_name_length = b(x + pointer) pointer += 1 info.ChannelName = GetString(b, pointer + x, service_name_length, False) pointer += service_name_length Select Case b(x + pointer) Case Is = &H49 pointer += b(x + pointer + 1) + 2 If (b(x + pointer) = &H5F) Then pointer += b(x + pointer + 1) + 5 If ((b(x + pointer + 1) And &H1) = 1) Then info.Category = b(x + pointer + 2) Else info.Category = b(x + pointer + 1) End If End If Case Is = &HB2 If ((b(x + pointer + 4) And &H1) = 1) Then info.Category = b(x + pointer + 5) Else info.Category = b(x + pointer + 4) End If Case Is = &H5F pointer += b(x + pointer + 1) + 5 If ((b(x + pointer + 1) And &H1) = 1) Then info.Category = b(x + pointer + 2) Else info.Category = b(x + pointer + 1) End If Case Is = &H4B Dim offset As Integer = x + pointer Dim morechanlen As Integer = b(offset + 1) Dim tt As Integer offset += 2 Dim Sid1, Nid1, Tid1 As Integer For tt = 0 To morechanlen Step 6 Tid1 = (b(offset + tt) * 256) Or b(offset + tt + 1) Nid1 = (b(offset + tt + 2) * 256) Or b(offset + tt + 3) Sid1 = (b(offset + tt + 4) * 256) Or b(offset + tt + 5) If SDTInfo.ContainsKey(Nid1 & "-" & Tid1 & "-" & Sid1) = False And info.ChannelName <> "" Then Dim SDT As New SDTInfo SDT.ChannelName = info.ChannelName SDT.Category = 0 SDT.SID = Sid1 SDT.isFTA = info.isFTA SDT.isHD = info.isHD SDT.isTV = info.isTV SDT.isRadio = info.isRadio SDT.Provider = info.Provider SDTInfo.Add(Nid1 & "-" & Tid1 & "-" & Sid1, SDT) SDTCount += 1 End If Next End Select Return info End Function Function GetString(ByVal byteData As Byte(), ByVal offset As Integer, ByVal length As Integer, ByVal replace As Boolean) As String If length = 0 Then Return (String.Empty) End If Dim isoTable As String = Nothing Dim startByte As Integer = 0 If byteData(offset) >= &H20 Then isoTable = "iso-8859-1" Else Select Case byteData(offset) Case &H1, &H2, &H3, &H4, &H5, &H6, _ &H7, &H8, &H9, &HA, &HB isoTable = "iso-8859-" & (byteData(offset) + 4).ToString() startByte = 1 Exit Select Case &H10 If byteData(offset + 1) = &H0 Then If byteData(offset + 2) <> &H0 AndAlso byteData(offset + 2) <> &HC Then isoTable = "iso-8859-" & CInt(byteData(offset + 2)).ToString() startByte = 3 Exit Select Else RaiseEvent OnMessage("Invalid DVB text string: byte 3 is not a valid value", replace) End If Else RaiseEvent OnMessage("Invalid DVB text string: byte 2 is not a valid value", replace) End If Case &H1F If byteData(offset + 1) = &H1 OrElse byteData(offset + 1) = &H2 Then ' Return (FreeSatDictionaryEntry.DecodeData(Utils.GetBytes(byteData, offset, length + 1))) Else RaiseEvent OnMessage("Invalid DVB text string: Custom text specifier is not recognized", replace) End If Case Else Return ("Invalid DVB text string: byte 1 is not a valid value") End Select End If Dim editedBytes As Byte() = New Byte(length - 1) {} Dim editedLength As Integer = 0 For index As Integer = startByte To length - 1 If byteData(offset + index) > &H1F Then If byteData(offset + index) < &H80 OrElse byteData(offset + index) > &H9F Then editedBytes(editedLength) = byteData(offset + index) editedLength += 1 End If Else If replace Then editedBytes(editedLength) = &H20 editedLength += 1 End If End If Next If editedLength = 0 Then Return (String.Empty) End If Try Dim sourceEncoding As Encoding = Encoding.GetEncoding(isoTable) If sourceEncoding Is Nothing Then sourceEncoding = Encoding.GetEncoding("iso-8859-1") End If Return (sourceEncoding.GetString(editedBytes, 0, editedLength)) Catch e As ArgumentException RaiseEvent OnMessage("** ERROR DECODING STRING - SEE COLLECTION LOG **", replace) End Try End Function Private Sub ParseChannels(ByVal Data As Section, ByVal Length As Integer) 'If all bouquets are already fully populated, return Try If (Data.table_id) <> &H4A Then If AreAllBouquetsPopulated() Then If Data.table_id = &H42 Or Data.table_id = &H46 Then If GotAllSDT Then Return Else ParseSDT(Data, Length) End If End If Return Else Return End If End If If AreAllBouquetsPopulated() Then Return End If Dim buffer() As Byte = Data.Data Dim bouquetId As Integer = (buffer(3) * 256) + buffer(4) Dim bouquetDescriptorLength As Integer = ((buffer(8) And &HF) * 256) + buffer(9) Dim skyBouquet As SkyBouquet = GetBouquet(bouquetId) If (skyBouquet.isPopulated) Then Return End If ' // If the bouquet is not initialized, this is the first time we have seen it If (skyBouquet.isInitialized = False) Then skyBouquet.firstReceivedSectionNumber = Data.section_number skyBouquet.isInitialized = True Else If (Data.section_number = skyBouquet.firstReceivedSectionNumber) Then skyBouquet.isPopulated = True NotifyBouquetPopulated() Return End If End If Dim body As Integer = 10 + bouquetDescriptorLength Dim bouquetPayloadLength As Integer = ((buffer(body + 0) And &HF) * 256) + buffer(body + 1) Dim endOfPacket As Integer = body + bouquetPayloadLength + 2 Dim currentTransportGroup As Integer = body + 2 Do While (currentTransportGroup < endOfPacket) Dim transportId As Integer = (buffer(currentTransportGroup + 0) * 256) + buffer(currentTransportGroup + 1) Dim networkId = (buffer(currentTransportGroup + 2) * 256) + buffer(currentTransportGroup + 3) Dim transportGroupLength As Integer = ((buffer(currentTransportGroup + 4) And &HF) * 256) + buffer(currentTransportGroup + 5) Dim currentTransportDescriptor As Integer = currentTransportGroup + 6 Dim endOfTransportGroupDescriptors As Integer = currentTransportDescriptor + transportGroupLength Do While (currentTransportDescriptor < endOfTransportGroupDescriptors) Dim descriptorType As Byte = buffer(currentTransportDescriptor) Dim descriptorLength As Integer = buffer(currentTransportDescriptor + 1) Dim currentServiceDescriptor As Integer = currentTransportDescriptor + 2 Dim endOfServiceDescriptors As Integer = currentServiceDescriptor + descriptorLength - 2 If (descriptorType = &HB1) Then Dim RegionID As Integer = buffer(currentTransportDescriptor + 3) Do While (currentServiceDescriptor < endOfServiceDescriptors) Dim serviceId As Integer = (buffer(currentServiceDescriptor + 2) * 256) + buffer(currentServiceDescriptor + 3) Dim channelId As Integer = (buffer(currentServiceDescriptor + 5) * 256) + buffer(currentServiceDescriptor + 6) Dim skyChannelNumber As Integer = (buffer(currentServiceDescriptor + 7) * 256) + buffer(currentServiceDescriptor + 8) Dim skyChannel As Sky_Channel = GetChannel(channelId) Dim SkyLCN As New LCNHolder(bouquetId, RegionID, skyChannelNumber) If (skyChannel.isPopulated = False) Then skyChannel.NID = networkId skyChannel.TID = transportId skyChannel.SID = serviceId skyChannel.ChannelID = channelId If skyChannel.AddSkyLCN(SkyLCN) Then skyChannel.isPopulated = True End If UpdateChannel(skyChannel.ChannelID, skyChannel) Else skyChannel.AddSkyLCN(SkyLCN) UpdateChannel(skyChannel.ChannelID, skyChannel) End If currentServiceDescriptor += 9 Loop End If currentTransportDescriptor += descriptorLength + 2 Loop currentTransportGroup += transportGroupLength + 6 Loop Catch ex As Exception RaiseEvent OnMessage("Error Parsing BAT", False) Return End Try End Sub Function GetBouquet(ByVal bouquetId As Integer) As SkyBouquet Dim returnBouquet As SkyBouquet If (Bouquets.ContainsKey(bouquetId)) Then returnBouquet = Bouquets(bouquetId) Else Bouquets.Add(bouquetId, New SkyBouquet) returnBouquet = Bouquets(bouquetId) End If Return returnBouquet End Function Function GetChannel(ByVal ChannelID As Integer) As Sky_Channel Dim returnChannel As Sky_Channel If (Channels.ContainsKey(ChannelID)) Then returnChannel = Channels(ChannelID) Else Channels.Add(ChannelID, New Sky_Channel) returnChannel = Channels(ChannelID) returnChannel.ChannelID = ChannelID End If Return returnChannel End Function Function GetChannelbySID(ByVal SID As String) As SDTInfo If (SDTInfo.ContainsKey(SID)) Then Return SDTInfo(SID) End If Return Nothing End Function Function AreAllBouquetsPopulated() As Boolean Return (Bouquets.Count > 0) And (Bouquets.Count = numberBouquetsPopulated) End Function Function IsEverythingGrabbed() As Boolean If GrabEPG Then If (AreAllBouquetsPopulated() And GotAllSDT) Then If AreAllSummariesPopulated() And AreAllTitlesPopulated() And GotAllTID = True Then RaiseEvent OnMessage("Everything grabbed:- Titles(" & titlesDecoded & ") : Summaries(" & summariesDecoded & ")", False) Return True Else Return False End If Else Return False End If Else If (Bouquets.Count = numberBouquetsPopulated And GotAllSDT) Then If GotAllTID = True Then Return True Else Return False End If Else Return False End If End If End Function Sub NotifyBouquetPopulated() numberBouquetsPopulated += 1 If (Bouquets.Count = numberBouquetsPopulated) Then RaiseEvent OnMessage("Bouquet scan complete. ", False) RaiseEvent OnMessage("Found " & Channels.Count & " channels in " & Bouquets.Count & " bouquets, searching SDT Information", False) End If End Sub Private Sub NotifySkyChannelPopulated(ByVal TID As Integer, ByVal NID As Integer, ByVal SID As Integer) If GotAllSDT Then Return If numberSDTPopulated = "" Then numberSDTPopulated = NID.ToString & "-" & TID.ToString & "-" & SID.ToString Else If NID.ToString & "-" & TID.ToString & "-" & SID.ToString = numberSDTPopulated Then GotAllSDT = True RaiseEvent OnMessage("Got all SDT Info, count: " & SDTInfo.Count, False) End If End If End Sub Private Sub NotifyTIDPopulated(ByVal TID As Integer) If GotAllTID Then Return If numberTIDPopulated = 0 Then numberTIDPopulated = TID Else If TID = numberTIDPopulated Then GotAllTID = True RaiseEvent OnMessage("Got all Network Information", False) End If End If End Sub Function DoesTidCarryEpgSummaryData(ByVal TableID As Integer) As Boolean If TableID = &HA8 Or TableID = &HA9 Or TableID = &HAA Or TableID = &HAB Then Return True Else Return False End If End Function Sub OnSummarySectionReceived(ByVal pid As Integer, ByVal section As Section) Try ' If the summary data carousel is complete for this pid, we can discard the data as we already have it If IsSummaryDataCarouselOnPidComplete(pid) Then Return End If ' Validate table id If Not DoesTidCarryEpgSummaryData(section.table_id) Then Return End If Dim buffer As Byte() = section.Data ' Total length of summary data (2 less for this length field) Dim totalLength As Integer = (((buffer(1) And &HF) * 256) + buffer(2)) - 2 ' If this section is a valid length (14 absolute minimum with 1 blank summary) If (section.section_length < 14) Then Return End If ' Get the channel id that this section's summary data relates to Dim channelId As Long = (buffer(3) * 256) + buffer(4) Dim mjdStartDate As Long = (buffer(8) * 256) + buffer(9) ' Check channel id and start date are valid If (channelId = 0 Or mjdStartDate = 0) Then Return End If ' Always starts at 10th byte Dim currentSummaryItem As Integer = 10 Dim iterationCounter As Integer = 0 ' Loop while we have more summary data Do While (currentSummaryItem < totalLength) If (iterationCounter > 512) Then Return End If iterationCounter += 1 ' Extract event id, header type and body length Dim eventId As Integer = (buffer(currentSummaryItem + 0) * 256) Or buffer(currentSummaryItem + 1) Dim headerType As Byte = (buffer(currentSummaryItem + 2) And &HF0) >> 4 Dim bodyLength As Integer = ((buffer(currentSummaryItem + 2) And &HF) * 256) Or buffer(currentSummaryItem + 3) ' Build the carousel lookup id Dim carouselLookupId As String = channelId.ToString & ":" & eventId.ToString ' Notify the parser that a title has been received OnSummaryReceived(pid, carouselLookupId) ' If the summary carousel for this pid is now complete, we can return If (IsSummaryDataCarouselOnPidComplete(pid)) Then Return ' Get the epg event we are to populate from the manager Dim epgEvent As SkyEvent = GetEpgEvent(channelId, eventId) ' Check we have the event reference If epgEvent Is Nothing Then Return End If Dim headerLength As Integer ' If this is an extended header (&HF) (7 bytes long) If (headerType = &HF) Then headerLength = 7 ' Else if normal header (&HB) (4 bytes long) ElseIf (headerType = &HB) Then headerLength = 4 ' Else other unknown header (not worked them out yet, at least 4 more) ' Think these are only used for box office and adult channels so not really important Else ' Cannot parse the rest of this packet as we dont know the header lengths/format etc Return End If ' If body length is less than 3, there is no summary data for this event, move to next If (bodyLength < 3) Then currentSummaryItem += (headerLength + bodyLength) End If ' Move to the body of the summary Dim currentSummaryItemBody As Integer = currentSummaryItem + headerLength ' Extract summary signature and huffman buffer length Dim summaryDescriptor As Integer = buffer(currentSummaryItemBody + 0) Dim encodedBufferLength As Integer = buffer(currentSummaryItemBody + 1) ' If normal summary item (&HB9) If (summaryDescriptor = &HB9) Then If (epgEvent.Summary = "") Then ' Decode the summary 'epgEvent.summary = skyManager.DecodeHuffmanData(&buffer(currentSummaryItemBody + 2), encodedBufferLength) Dim HuffBuff(&H1000) As Byte If (currentSummaryItemBody + 2 + encodedBufferLength) > buffer.Length Then Return End If Array.Copy(buffer, currentSummaryItemBody + 2, HuffBuff, 0, encodedBufferLength) epgEvent.Summary = NewHuffman(HuffBuff, encodedBufferLength) ' If failed to decode ' Notify the manager (for statistics) OnSummaryDecoded() UpdateEPGEvent(channelId, epgEvent.EventID, epgEvent) ' Else if (&HBB) - Unknown data item (special box office or adult?) ' Seems very rare (1 in every 2000 or so), so not important really End If ElseIf (summaryDescriptor = &HBB) Then ' Else other unknown data item, there are a few others that are unknown Else Return 'skyManager.LogError("CSkyEpgSummaryDecoder::OnSummarySectionReceived() - Error, unrecognised summary descriptor") End If ' Is there any footer information? Dim footerLength As Integer = bodyLength - encodedBufferLength - 2 If (footerLength >= 4) Then Dim footerPointer As Integer = currentSummaryItemBody + 2 + encodedBufferLength ' Get the descriptor Dim footerDescriptor As Integer = buffer(footerPointer + 0) ' If series id information (&HC1) If (footerDescriptor = &HC1) Then epgEvent.SeriesID = (buffer(footerPointer + 2) * 256) + (buffer(footerPointer + 3)) End If End If ' Move to next summary item currentSummaryItem += (bodyLength + headerLength) Loop ' Check the packet was parsed correctly - seem to get a few of these. ' Seems to be some extra information tagged onto the end of some summary packets (1 in every 2000 or so) ' Not worked this out - possibly box office information If (currentSummaryItem <> (totalLength + 1)) Then 'skyManager.LogError("CSkyEpgSummaryDecoder::OnSummarySectionReceived() - Warning, summary packet was not parsed correctly - pointer not in expected place") Return End If Catch err As Exception RaiseEvent OnMessage("Error decoding Summary, " & err.Message, False) Return End Try End Sub End Class Public Class LCNHolder Dim _BID As Integer Dim _RID As Integer Dim _SkyNum As Integer Public Sub New(ByVal BID As Integer, ByVal RID As Integer, ByVal SkyLCN As Integer) _BID = BID _RID = RID _SkyNum = SkyLCN End Sub Public Property RID As Integer Get Return _RID End Get Set(ByVal value As Integer) _RID = value End Set End Property Public Property BID As Integer Get Return _BID End Get Set(ByVal value As Integer) _BID = value End Set End Property Public Property SkyNum As Integer Get Return _SkyNum End Get Set(ByVal value As Integer) _SkyNum = value End Set End Property End Class Public Class Sky_Channel Dim _ChannelId As Integer Dim _NID As Integer Dim _TID As Integer Dim _SID As Integer Dim _Channel_Name As String Dim _isPopulated As Boolean Dim _epgChannelNumber As New Dictionary(Of String, LCNHolder) Dim _encrypted As Boolean Dim _Name As String Dim _NewChannelRequired As Boolean Dim _HasChanged As Boolean Public ReadOnly Property LCNS Get Return _epgChannelNumber.Values End Get End Property Public ReadOnly Property LCNCount Get Return _epgChannelNumber.Count End Get End Property Public Function GetLCN(ByVal BouquetID As Integer, ByVal RegionId As Integer) As LCNHolder If _epgChannelNumber.ContainsKey(BouquetID.ToString & "-" & RegionId.ToString) Then Return _epgChannelNumber(BouquetID.ToString & "-" & RegionId.ToString) Else Return Nothing End If End Function Public Function ContainsLCN(ByVal BouquetID As Integer, ByVal RegionId As Integer) As Boolean Return _epgChannelNumber.ContainsKey(BouquetID.ToString & "-" & RegionId.ToString) End Function Public Property HasChanged As Boolean Get Return _HasChanged End Get Set(ByVal value As Boolean) _HasChanged = value End Set End Property Public Property isPopulated As Boolean Get Return _isPopulated End Get Set(ByVal value As Boolean) _isPopulated = value End Set End Property Public Property AddChannelRequired As Boolean Get Return _NewChannelRequired End Get Set(ByVal value As Boolean) _NewChannelRequired = value End Set End Property Public Function AddSkyLCN(ByVal LCNHold As LCNHolder) As Boolean If Not _epgChannelNumber.ContainsKey(LCNHold.BID & "-" & LCNHold.RID) Then _epgChannelNumber.Add(LCNHold.BID & "-" & LCNHold.RID, LCNHold) Return False Else Return True End If End Function Public Property ChannelID As Integer Get Return _ChannelId End Get Set(ByVal value As Integer) _ChannelId = value End Set End Property Public Property NID As Integer Get Return _NID End Get Set(ByVal value As Integer) _NID = value End Set End Property Public Property TID As Integer Get Return _TID End Get Set(ByVal value As Integer) _TID = value End Set End Property Public Property SID As Integer Get Return _SID End Get Set(ByVal value As Integer) _SID = value End Set End Property Public Property Channel_Name As String Get Return _Channel_Name End Get Set(ByVal value As String) _Channel_Name = value End Set End Property 'EventID Public Events As New Dictionary(Of Integer, SkyEvent) End Class Public Class SkyEvent Dim _EventID As Integer Dim _StartTime As Integer Dim _duration As Integer Dim _ChannelID As Integer Dim _Title As String Dim _Summary As String Dim _Category As String Dim _ParentalCategory As String Dim _SeriesID As Integer Dim _mjdStart As Long Dim _seriesTermination As Integer Dim _AD As Boolean Dim _CP As Boolean Dim _HD As Boolean Dim _WS As Boolean Dim _Subs As Boolean Dim _SoundType As Integer Dim Flags As String Public Sub SetFlags(ByVal IntegerNumber As Integer) _AD = IntegerNumber And &H1 _CP = IntegerNumber And &H2 _HD = IntegerNumber And &H4 _WS = IntegerNumber And &H8 _Subs = IntegerNumber And &H10 _SoundType = IntegerNumber >> 6 End Sub Public Sub SetCategory(ByVal Category As Integer) Select Case Category And &HF Case 5 _ParentalCategory = "18" Case 4 _ParentalCategory = "15" Case 3 _ParentalCategory = "12" Case 2 _ParentalCategory = "PG" Case 1 _ParentalCategory = "U" Case Else _ParentalCategory = "" End Select End Sub Public ReadOnly Property ParentalCategory As String Get Return _ParentalCategory End Get End Property Public ReadOnly Property DescriptionFlag As String Get Flags = "" If _AD Then Flags &= "[AD]" End If If _CP Then If Flags <> "" Then Flags &= "," Flags &= "[CP]" End If If _HD Then If Flags <> "" Then Flags &= "," Flags &= "[HD]" End If If _WS Then If Flags <> "" Then Flags &= "," Flags &= "[W]" End If If _Subs Then If Flags <> "" Then Flags &= "," Flags &= "[SUB]" End If Select Case _SoundType Case 1 If Flags <> "" Then Flags &= "," Flags &= "[S]" Case 2 If Flags <> "" Then Flags &= "," Flags &= "[DS]" Case 3 If Flags <> "" Then Flags &= "," Flags &= "[DD]" End Select Return Flags End Get End Property Public Property Summary As String Get Return _Summary End Get Set(ByVal value As String) _Summary = value End Set End Property Public Property EventID As Integer Get Return _EventID End Get Set(ByVal value As Integer) _EventID = value End Set End Property Public Property StartTime As Integer Get Return _StartTime End Get Set(ByVal value As Integer) _StartTime = value End Set End Property Public Property Duration As Integer Get Return _duration End Get Set(ByVal value As Integer) _duration = value End Set End Property Public Property ChannelID As Integer Get Return _ChannelID End Get Set(ByVal value As Integer) _ChannelID = value End Set End Property Public Property Title As String Get Return _Title End Get Set(ByVal value As String) _Title = value End Set End Property Public Property Category As String Get Return _Category End Get Set(ByVal value As String) _Category = value End Set End Property Public Property SeriesID As Integer Get Return _SeriesID End Get Set(ByVal value As Integer) _SeriesID = value End Set End Property Public Property mjdStart As Long Get Return _mjdStart End Get Set(ByVal value As Long) _mjdStart = value End Set End Property Public Property seriesTermination As Integer Get Return _seriesTermination End Get Set(ByVal value As Integer) _seriesTermination = value End Set End Property Public Sub New() _EventID = -1 _StartTime = -1 _duration = -1 _ChannelID = -1 _Title = "" _Summary = "" _Category = "" _ParentalCategory = "" _SeriesID = Nothing _mjdStart = 0 _seriesTermination = Nothing _AD = False _CP = False _HD = False _WS = False _Subs = False _SoundType = -1 Flags = "" End Sub End Class Public Class SkyBouquet Dim _firstReceivedSectionNumber As Byte Dim _isInitialized As Boolean Dim _isPopulated As Boolean Public Property firstReceivedSectionNumber As Byte Get Return _firstReceivedSectionNumber End Get Set(ByVal value As Byte) _firstReceivedSectionNumber = value End Set End Property Public Property isInitialized As Boolean Get Return _isInitialized End Get Set(ByVal value As Boolean) _isInitialized = value End Set End Property Public Property isPopulated As Boolean Get Return _isPopulated End Get Set(ByVal value As Boolean) _isPopulated = value End Set End Property Public Sub New() _isInitialized = False _isPopulated = False End Sub End Class Public Class HuffHolder Dim _buff() As Byte Dim _Length As Integer Dim _NextID As String Public Property NextID() As String Get Return _NextID End Get Set(ByVal value As String) _NextID = value End Set End Property Public Property Buff() As Byte() Get Return _buff End Get Set(ByVal value As Byte()) _buff = value End Set End Property Public Property Length() As Integer Get Return _Length End Get Set(ByVal value As Integer) _Length = value End Set End Property End Class Public Class HuffmanTreeNode Public Sub New() End Sub Private Shadows Function Equals() As Boolean Return False End Function Private Shadows Function ReferenceEquals() As Boolean Return False End Function Public Value As String 'the character found in the file. 'amount of times the character was found in the file. Public Parent As HuffmanTreeNode 'the parent node. Public P1 As HuffmanTreeNode 'the left leaf. Public P0 As HuffmanTreeNode 'the right leaf. Public Function Clear() As Boolean If P1 Is Nothing Then Return True Else P1 = Nothing If P0 Is Nothing Then Else P0 = Nothing End If End If Return True End Function Public ReadOnly Property Path() As String 'the binary path to the node. Get Static strPath As String If strPath Is Nothing Then If Not (Me.Parent Is Nothing) Then If (Me.Parent.P0 Is Me) Then strPath = "0" If (Me.Parent.P1 Is Me) Then strPath = "1" strPath = Parent.Path & strPath End If End If Return strPath End Get End Property End Class Public Class SDTInfo Dim _sid As Integer Dim _ChannelName As String Dim _Cat As Byte Dim _Provider As String Dim _isFTA As Boolean Dim _isRadio As Boolean Dim _isTV As Boolean Dim _isHD As Boolean Dim _is3d As Boolean Public Property SID As Integer Get Return _sid End Get Set(ByVal value As Integer) _sid = value End Set End Property Public Property ChannelName As String Get Return _ChannelName End Get Set(ByVal value As String) _ChannelName = value End Set End Property Public Property Provider As String Get Return _Provider End Get Set(ByVal value As String) _Provider = value End Set End Property Public Property Category As Integer Get Return _Cat End Get Set(ByVal value As Integer) _Cat = value End Set End Property Public Property isFTA As Boolean Get Return _isFTA End Get Set(ByVal value As Boolean) _isFTA = value End Set End Property Public Property isRadio As Boolean Get Return _isRadio End Get Set(ByVal value As Boolean) _isRadio = value End Set End Property Public Property isTV As Boolean Get Return _isTV End Get Set(ByVal value As Boolean) _isTV = value End Set End Property Public Property isHD As Boolean Get Return _isHD End Get Set(ByVal value As Boolean) _isHD = value End Set End Property Public Property is3D As Boolean Get Return _is3d End Get Set(ByVal value As Boolean) _isHD = value End Set End Property End Class Public Class NITSatDescriptor Dim _TransportID As Integer Dim _Frequency As Single Dim _OrbitalPosition As Integer Dim _WestEastFlag As Integer Dim _Polarisation As Integer Dim _Modulation As Integer Dim _Symbolrate As Integer Dim _FECInner As Integer Dim _RollOff As Integer Dim _isS2 As Integer Dim _NetworkName As String Public Property TID As Integer Get Return _TransportID End Get Set(ByVal value As Integer) _TransportID = value End Set End Property Public Property Frequency As Integer Get Return _Frequency End Get Set(ByVal value As Integer) _Frequency = value End Set End Property Public Property OrbitalPosition As Integer Get Return _OrbitalPosition End Get Set(ByVal value As Integer) _OrbitalPosition = value End Set End Property Public Property WestEastFlag As Integer Get Return _WestEastFlag End Get Set(ByVal value As Integer) _WestEastFlag = value End Set End Property Public Property Polarisation As Integer Get Return _Polarisation End Get Set(ByVal value As Integer) _Polarisation = value End Set End Property Public Property Modulation As Integer Get Return _Modulation End Get Set(ByVal value As Integer) _Modulation = value End Set End Property Public Property Symbolrate As Integer Get Return _Symbolrate End Get Set(ByVal value As Integer) _Symbolrate = value End Set End Property Public Property FECInner As Integer Get Return _FECInner End Get Set(ByVal value As Integer) _FECInner = value End Set End Property Public Property RollOff As Integer Get Return _RollOff End Get Set(ByVal value As Integer) _RollOff = value End Set End Property Public Property isS2 As Integer Get Return _isS2 End Get Set(ByVal value As Integer) _isS2 = value End Set End Property Public Property NetworkName As String Get Return _NetworkName End Get Set(ByVal value As String) _NetworkName = value End Set End Property End Class <file_sep>/ClassLibrary5/Setup.vb  Imports SetupTv Imports TvDatabase Imports TvControl Imports TvLibrary.Interfaces Imports TvLibrary.Log Public Class Setup Inherits SectionSettings Dim WithEvents Grabber As SkyGrabber Dim Settings As New Settings Private WithEvents SkyIT_Tab As System.Windows.Forms.TabControl Private WithEvents tabPage1 As System.Windows.Forms.TabPage Private WithEvents skyUKContainer As System.Windows.Forms.GroupBox Private WithEvents groupBox3 As System.Windows.Forms.GroupBox Private WithEvents SkyUK_Region As System.Windows.Forms.ComboBox Private WithEvents groupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label15 As System.Windows.Forms.Label Friend WithEvents CatText20 As System.Windows.Forms.TextBox Friend WithEvents CatByte20 As System.Windows.Forms.TextBox Friend WithEvents Label16 As System.Windows.Forms.Label Friend WithEvents Label17 As System.Windows.Forms.Label Friend WithEvents CatText19 As System.Windows.Forms.TextBox Friend WithEvents CatByte19 As System.Windows.Forms.TextBox Friend WithEvents CatText18 As System.Windows.Forms.TextBox Friend WithEvents CatByte18 As System.Windows.Forms.TextBox Friend WithEvents Label18 As System.Windows.Forms.Label Friend WithEvents Label19 As System.Windows.Forms.Label Friend WithEvents CatText17 As System.Windows.Forms.TextBox Friend WithEvents CatByte17 As System.Windows.Forms.TextBox Friend WithEvents CatText16 As System.Windows.Forms.TextBox Friend WithEvents CatByte16 As System.Windows.Forms.TextBox Friend WithEvents Label20 As System.Windows.Forms.Label Friend WithEvents CatText15 As System.Windows.Forms.TextBox Friend WithEvents CatByte15 As System.Windows.Forms.TextBox Friend WithEvents Label21 As System.Windows.Forms.Label Friend WithEvents Label22 As System.Windows.Forms.Label Friend WithEvents CatText14 As System.Windows.Forms.TextBox Friend WithEvents CatByte14 As System.Windows.Forms.TextBox Friend WithEvents CatText13 As System.Windows.Forms.TextBox Friend WithEvents CatByte13 As System.Windows.Forms.TextBox Friend WithEvents Label23 As System.Windows.Forms.Label Friend WithEvents Label24 As System.Windows.Forms.Label Friend WithEvents CatText12 As System.Windows.Forms.TextBox Friend WithEvents CatByte12 As System.Windows.Forms.TextBox Friend WithEvents CatText11 As System.Windows.Forms.TextBox Friend WithEvents CatByte11 As System.Windows.Forms.TextBox Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents CatText9 As System.Windows.Forms.TextBox Friend WithEvents CatByte9 As System.Windows.Forms.TextBox Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents Label12 As System.Windows.Forms.Label Friend WithEvents CatText7 As System.Windows.Forms.TextBox Friend WithEvents CatByte7 As System.Windows.Forms.TextBox Friend WithEvents CatText10 As System.Windows.Forms.TextBox Friend WithEvents CatByte10 As System.Windows.Forms.TextBox Friend WithEvents Label13 As System.Windows.Forms.Label Friend WithEvents Label14 As System.Windows.Forms.Label Friend WithEvents CatText6 As System.Windows.Forms.TextBox Friend WithEvents CatByte6 As System.Windows.Forms.TextBox Friend WithEvents CatText5 As System.Windows.Forms.TextBox Friend WithEvents CatByte5 As System.Windows.Forms.TextBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents CatText4 As System.Windows.Forms.TextBox Friend WithEvents CatByte4 As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents CatText8 As System.Windows.Forms.TextBox Friend WithEvents CatByte8 As System.Windows.Forms.TextBox Friend WithEvents CatText3 As System.Windows.Forms.TextBox Friend WithEvents CatByte3 As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents CatText2 As System.Windows.Forms.TextBox Friend WithEvents CatByte2 As System.Windows.Forms.TextBox Friend WithEvents CatText1 As System.Windows.Forms.TextBox Friend WithEvents CatByte1 As System.Windows.Forms.TextBox Friend WithEvents Button4 As System.Windows.Forms.Button Public Delegate Sub AddLog1(ByVal Value As String, ByVal UpdateLast As Boolean) Public Log1 As New AddLog1(AddressOf AddLog) Public Delegate Sub SetBool1(ByVal Value As Boolean) Public Bool1 As New SetBool1(AddressOf SetBool) Public Delegate Sub SetBool2(ByVal Value As Boolean) Public Bool2 As New SetBool2(AddressOf SetBool22) Public Delegate Sub SetBool3(ByVal Value As Boolean) Public Bool3 As New SetBool3(AddressOf SetBool33) Public Delegate Sub SetBool4(ByVal Value As Boolean) Public Bool4 As New SetBool4(AddressOf SetBool44) Public Delegate Sub SetBool5(ByVal Value As Boolean) Public Bool5 As New SetBool5(AddressOf SetBool55) Public Delegate Sub SetBool6(ByVal Value As Boolean) Public Bool6 As New SetBool6(AddressOf SetBool66) Friend WithEvents TabPage2 As System.Windows.Forms.TabPage Friend WithEvents Sun As System.Windows.Forms.CheckBox Friend WithEvents Sat As System.Windows.Forms.CheckBox Friend WithEvents Fri As System.Windows.Forms.CheckBox Friend WithEvents Thu As System.Windows.Forms.CheckBox Friend WithEvents Wed As System.Windows.Forms.CheckBox Friend WithEvents Tue As System.Windows.Forms.CheckBox Friend WithEvents Mon As System.Windows.Forms.CheckBox Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents CheckBox6 As System.Windows.Forms.CheckBox Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox Friend WithEvents CheckBox4 As System.Windows.Forms.CheckBox Friend WithEvents Panel1 As System.Windows.Forms.Panel Friend WithEvents DateTimePicker1 As System.Windows.Forms.DateTimePicker Friend WithEvents NumericUpDown1 As System.Windows.Forms.NumericUpDown Friend WithEvents TabPage4 As System.Windows.Forms.TabPage Friend WithEvents ChannelMap As System.Windows.Forms.CheckedListBox Private WithEvents MpGroupBox2 As MediaPortal.UserInterface.Controls.MPGroupBox Private WithEvents MpGroupBox1 As MediaPortal.UserInterface.Controls.MPGroupBox Private WithEvents MpLabel1 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents mpDisEqc1 As MediaPortal.UserInterface.Controls.MPComboBox Private WithEvents MpLabel6 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents MpComboBox1 As MediaPortal.UserInterface.Controls.MPComboBox Private WithEvents MpLabel8 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents MpComboBox2 As MediaPortal.UserInterface.Controls.MPComboBox Private WithEvents MpLabel3 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents TextBox4 As System.Windows.Forms.TextBox Private WithEvents MpLabel4 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents TextBox5 As System.Windows.Forms.TextBox Private WithEvents TextBox6 As System.Windows.Forms.TextBox Private WithEvents MpLabel5 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents TextBox10 As System.Windows.Forms.TextBox Private WithEvents MpLabel9 As MediaPortal.UserInterface.Controls.MPLabel Private WithEvents MpLabel10 As MediaPortal.UserInterface.Controls.MPLabel Friend WithEvents Panel3 As System.Windows.Forms.Panel Friend WithEvents TabPage5 As System.Windows.Forms.TabPage Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TabPage6 As System.Windows.Forms.TabPage Friend WithEvents Panel2 As System.Windows.Forms.Panel Private WithEvents CheckBox8 As System.Windows.Forms.CheckBox Private WithEvents CheckBox7 As System.Windows.Forms.CheckBox Private WithEvents CheckBox3 As System.Windows.Forms.CheckBox Private WithEvents label8 As System.Windows.Forms.Label Private WithEvents CheckBox2 As System.Windows.Forms.CheckBox Private WithEvents chk_DeleteOld As System.Windows.Forms.RadioButton Private WithEvents CheckBox1 As System.Windows.Forms.CheckBox Private WithEvents chk_MoveOld As System.Windows.Forms.RadioButton Private WithEvents txt_Move_Old_Group As System.Windows.Forms.TextBox Private WithEvents chk_AutoUpdate As System.Windows.Forms.CheckBox Private WithEvents chk_SkyCategories As System.Windows.Forms.CheckBox Private WithEvents chk_SkyNumbers As System.Windows.Forms.CheckBox Private WithEvents chk_SkyRegions As System.Windows.Forms.CheckBox Private WithEvents tabPage3 As System.Windows.Forms.TabPage Friend WithEvents Label10 As System.Windows.Forms.Label Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents NumericUpDown2 As System.Windows.Forms.NumericUpDown Private WithEvents listViewStatus As System.Windows.Forms.ListView Private WithEvents columnHeader1 As System.Windows.Forms.ColumnHeader Friend WithEvents Button1 As System.Windows.Forms.Button Private WithEvents CheckBox9 As System.Windows.Forms.CheckBox Dim regions As New Dictionary(Of Integer, Region) Public Sub New() ' This call is required by the designer. Grabber = New SkyGrabber InitializeComponent() ' Add any initialization after the InitializeComponent() call. LoadSetting() ' SaveSettings() End Sub Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Setup)) Me.SkyIT_Tab = New System.Windows.Forms.TabControl() Me.tabPage3 = New System.Windows.Forms.TabPage() Me.Label10 = New System.Windows.Forms.Label() Me.Label9 = New System.Windows.Forms.Label() Me.NumericUpDown2 = New System.Windows.Forms.NumericUpDown() Me.listViewStatus = New System.Windows.Forms.ListView() Me.columnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.Button1 = New System.Windows.Forms.Button() Me.TabPage6 = New System.Windows.Forms.TabPage() Me.Panel2 = New System.Windows.Forms.Panel() Me.CheckBox9 = New System.Windows.Forms.CheckBox() Me.CheckBox8 = New System.Windows.Forms.CheckBox() Me.CheckBox7 = New System.Windows.Forms.CheckBox() Me.CheckBox3 = New System.Windows.Forms.CheckBox() Me.label8 = New System.Windows.Forms.Label() Me.CheckBox2 = New System.Windows.Forms.CheckBox() Me.chk_DeleteOld = New System.Windows.Forms.RadioButton() Me.CheckBox1 = New System.Windows.Forms.CheckBox() Me.chk_MoveOld = New System.Windows.Forms.RadioButton() Me.txt_Move_Old_Group = New System.Windows.Forms.TextBox() Me.chk_AutoUpdate = New System.Windows.Forms.CheckBox() Me.chk_SkyCategories = New System.Windows.Forms.CheckBox() Me.chk_SkyNumbers = New System.Windows.Forms.CheckBox() Me.chk_SkyRegions = New System.Windows.Forms.CheckBox() Me.tabPage1 = New System.Windows.Forms.TabPage() Me.skyUKContainer = New System.Windows.Forms.GroupBox() Me.groupBox1 = New System.Windows.Forms.GroupBox() Me.Button4 = New System.Windows.Forms.Button() Me.Label15 = New System.Windows.Forms.Label() Me.CatText20 = New System.Windows.Forms.TextBox() Me.CatByte20 = New System.Windows.Forms.TextBox() Me.Label16 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.CatText19 = New System.Windows.Forms.TextBox() Me.CatByte19 = New System.Windows.Forms.TextBox() Me.CatText18 = New System.Windows.Forms.TextBox() Me.CatByte18 = New System.Windows.Forms.TextBox() Me.Label18 = New System.Windows.Forms.Label() Me.Label19 = New System.Windows.Forms.Label() Me.CatText17 = New System.Windows.Forms.TextBox() Me.CatByte17 = New System.Windows.Forms.TextBox() Me.CatText16 = New System.Windows.Forms.TextBox() Me.CatByte16 = New System.Windows.Forms.TextBox() Me.Label20 = New System.Windows.Forms.Label() Me.CatText15 = New System.Windows.Forms.TextBox() Me.CatByte15 = New System.Windows.Forms.TextBox() Me.Label21 = New System.Windows.Forms.Label() Me.Label22 = New System.Windows.Forms.Label() Me.CatText14 = New System.Windows.Forms.TextBox() Me.CatByte14 = New System.Windows.Forms.TextBox() Me.CatText13 = New System.Windows.Forms.TextBox() Me.CatByte13 = New System.Windows.Forms.TextBox() Me.Label23 = New System.Windows.Forms.Label() Me.Label24 = New System.Windows.Forms.Label() Me.CatText12 = New System.Windows.Forms.TextBox() Me.CatByte12 = New System.Windows.Forms.TextBox() Me.CatText11 = New System.Windows.Forms.TextBox() Me.CatByte11 = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.CatText9 = New System.Windows.Forms.TextBox() Me.CatByte9 = New System.Windows.Forms.TextBox() Me.Label11 = New System.Windows.Forms.Label() Me.Label12 = New System.Windows.Forms.Label() Me.CatText7 = New System.Windows.Forms.TextBox() Me.CatByte7 = New System.Windows.Forms.TextBox() Me.CatText10 = New System.Windows.Forms.TextBox() Me.CatByte10 = New System.Windows.Forms.TextBox() Me.Label13 = New System.Windows.Forms.Label() Me.Label14 = New System.Windows.Forms.Label() Me.CatText6 = New System.Windows.Forms.TextBox() Me.CatByte6 = New System.Windows.Forms.TextBox() Me.CatText5 = New System.Windows.Forms.TextBox() Me.CatByte5 = New System.Windows.Forms.TextBox() Me.Label7 = New System.Windows.Forms.Label() Me.CatText4 = New System.Windows.Forms.TextBox() Me.CatByte4 = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.CatText8 = New System.Windows.Forms.TextBox() Me.CatByte8 = New System.Windows.Forms.TextBox() Me.CatText3 = New System.Windows.Forms.TextBox() Me.CatByte3 = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.CatText2 = New System.Windows.Forms.TextBox() Me.CatByte2 = New System.Windows.Forms.TextBox() Me.CatText1 = New System.Windows.Forms.TextBox() Me.CatByte1 = New System.Windows.Forms.TextBox() Me.groupBox3 = New System.Windows.Forms.GroupBox() Me.SkyUK_Region = New System.Windows.Forms.ComboBox() Me.TabPage4 = New System.Windows.Forms.TabPage() Me.MpGroupBox2 = New MediaPortal.UserInterface.Controls.MPGroupBox() Me.ChannelMap = New System.Windows.Forms.CheckedListBox() Me.MpGroupBox1 = New MediaPortal.UserInterface.Controls.MPGroupBox() Me.MpLabel1 = New MediaPortal.UserInterface.Controls.MPLabel() Me.mpDisEqc1 = New MediaPortal.UserInterface.Controls.MPComboBox() Me.MpLabel6 = New MediaPortal.UserInterface.Controls.MPLabel() Me.MpComboBox1 = New MediaPortal.UserInterface.Controls.MPComboBox() Me.MpLabel8 = New MediaPortal.UserInterface.Controls.MPLabel() Me.MpComboBox2 = New MediaPortal.UserInterface.Controls.MPComboBox() Me.MpLabel3 = New MediaPortal.UserInterface.Controls.MPLabel() Me.TextBox4 = New System.Windows.Forms.TextBox() Me.MpLabel4 = New MediaPortal.UserInterface.Controls.MPLabel() Me.TextBox5 = New System.Windows.Forms.TextBox() Me.TextBox6 = New System.Windows.Forms.TextBox() Me.MpLabel5 = New MediaPortal.UserInterface.Controls.MPLabel() Me.TextBox10 = New System.Windows.Forms.TextBox() Me.MpLabel9 = New MediaPortal.UserInterface.Controls.MPLabel() Me.MpLabel10 = New MediaPortal.UserInterface.Controls.MPLabel() Me.TabPage2 = New System.Windows.Forms.TabPage() Me.Panel3 = New System.Windows.Forms.Panel() Me.Panel1 = New System.Windows.Forms.Panel() Me.NumericUpDown1 = New System.Windows.Forms.NumericUpDown() Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker() Me.CheckBox5 = New System.Windows.Forms.CheckBox() Me.CheckBox6 = New System.Windows.Forms.CheckBox() Me.Sun = New System.Windows.Forms.CheckBox() Me.Sat = New System.Windows.Forms.CheckBox() Me.Label6 = New System.Windows.Forms.Label() Me.Fri = New System.Windows.Forms.CheckBox() Me.Mon = New System.Windows.Forms.CheckBox() Me.Thu = New System.Windows.Forms.CheckBox() Me.Tue = New System.Windows.Forms.CheckBox() Me.Wed = New System.Windows.Forms.CheckBox() Me.CheckBox4 = New System.Windows.Forms.CheckBox() Me.TabPage5 = New System.Windows.Forms.TabPage() Me.TextBox1 = New System.Windows.Forms.TextBox() Me.SkyIT_Tab.SuspendLayout() Me.tabPage3.SuspendLayout() CType(Me.NumericUpDown2, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage6.SuspendLayout() Me.Panel2.SuspendLayout() Me.tabPage1.SuspendLayout() Me.skyUKContainer.SuspendLayout() Me.groupBox1.SuspendLayout() Me.groupBox3.SuspendLayout() Me.TabPage4.SuspendLayout() Me.MpGroupBox2.SuspendLayout() Me.MpGroupBox1.SuspendLayout() Me.TabPage2.SuspendLayout() Me.Panel3.SuspendLayout() Me.Panel1.SuspendLayout() CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage5.SuspendLayout() Me.SuspendLayout() ' 'SkyIT_Tab ' Me.SkyIT_Tab.Controls.Add(Me.tabPage3) Me.SkyIT_Tab.Controls.Add(Me.TabPage6) Me.SkyIT_Tab.Controls.Add(Me.tabPage1) Me.SkyIT_Tab.Controls.Add(Me.TabPage4) Me.SkyIT_Tab.Controls.Add(Me.TabPage2) Me.SkyIT_Tab.Controls.Add(Me.TabPage5) Me.SkyIT_Tab.Dock = System.Windows.Forms.DockStyle.Fill Me.SkyIT_Tab.Location = New System.Drawing.Point(0, 0) Me.SkyIT_Tab.Name = "SkyIT_Tab" Me.SkyIT_Tab.SelectedIndex = 0 Me.SkyIT_Tab.Size = New System.Drawing.Size(456, 422) Me.SkyIT_Tab.TabIndex = 3 ' 'tabPage3 ' Me.tabPage3.Controls.Add(Me.Label10) Me.tabPage3.Controls.Add(Me.Label9) Me.tabPage3.Controls.Add(Me.NumericUpDown2) Me.tabPage3.Controls.Add(Me.listViewStatus) Me.tabPage3.Controls.Add(Me.Button1) Me.tabPage3.Location = New System.Drawing.Point(4, 22) Me.tabPage3.Name = "tabPage3" Me.tabPage3.Padding = New System.Windows.Forms.Padding(3) Me.tabPage3.Size = New System.Drawing.Size(448, 396) Me.tabPage3.TabIndex = 2 Me.tabPage3.Text = "General" Me.tabPage3.UseVisualStyleBackColor = True ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Location = New System.Drawing.Point(127, 11) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(49, 13) Me.Label10.TabIndex = 189 Me.Label10.Text = "Seconds" ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Location = New System.Drawing.Point(6, 12) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(56, 13) Me.Label9.TabIndex = 188 Me.Label9.Text = "Grab Time" ' 'NumericUpDown2 ' Me.NumericUpDown2.Location = New System.Drawing.Point(68, 9) Me.NumericUpDown2.Name = "NumericUpDown2" Me.NumericUpDown2.Size = New System.Drawing.Size(53, 20) Me.NumericUpDown2.TabIndex = 187 Me.NumericUpDown2.Value = New Decimal(New Integer() {60, 0, 0, 0}) ' 'listViewStatus ' Me.listViewStatus.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.columnHeader1}) Me.listViewStatus.Dock = System.Windows.Forms.DockStyle.Bottom Me.listViewStatus.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None Me.listViewStatus.Location = New System.Drawing.Point(3, 35) Me.listViewStatus.Name = "listViewStatus" Me.listViewStatus.Size = New System.Drawing.Size(442, 322) Me.listViewStatus.TabIndex = 179 Me.listViewStatus.UseCompatibleStateImageBehavior = False Me.listViewStatus.View = System.Windows.Forms.View.Details ' 'columnHeader1 ' Me.columnHeader1.Width = 415 ' 'Button1 ' Me.Button1.Dock = System.Windows.Forms.DockStyle.Bottom Me.Button1.Location = New System.Drawing.Point(3, 357) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(442, 36) Me.Button1.TabIndex = 0 Me.Button1.Text = "Grab Now" Me.Button1.UseVisualStyleBackColor = True ' 'TabPage6 ' Me.TabPage6.Controls.Add(Me.Panel2) Me.TabPage6.Location = New System.Drawing.Point(4, 22) Me.TabPage6.Name = "TabPage6" Me.TabPage6.Padding = New System.Windows.Forms.Padding(3) Me.TabPage6.Size = New System.Drawing.Size(448, 396) Me.TabPage6.TabIndex = 6 Me.TabPage6.Text = "Settings" Me.TabPage6.UseVisualStyleBackColor = True ' 'Panel2 ' Me.Panel2.Controls.Add(Me.CheckBox9) Me.Panel2.Controls.Add(Me.CheckBox8) Me.Panel2.Controls.Add(Me.CheckBox7) Me.Panel2.Controls.Add(Me.CheckBox3) Me.Panel2.Controls.Add(Me.label8) Me.Panel2.Controls.Add(Me.CheckBox2) Me.Panel2.Controls.Add(Me.chk_DeleteOld) Me.Panel2.Controls.Add(Me.CheckBox1) Me.Panel2.Controls.Add(Me.chk_MoveOld) Me.Panel2.Controls.Add(Me.txt_Move_Old_Group) Me.Panel2.Controls.Add(Me.chk_AutoUpdate) Me.Panel2.Controls.Add(Me.chk_SkyCategories) Me.Panel2.Controls.Add(Me.chk_SkyNumbers) Me.Panel2.Controls.Add(Me.chk_SkyRegions) Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill Me.Panel2.Location = New System.Drawing.Point(3, 3) Me.Panel2.Name = "Panel2" Me.Panel2.Size = New System.Drawing.Size(442, 390) Me.Panel2.TabIndex = 185 ' 'CheckBox9 ' Me.CheckBox9.AutoSize = True Me.CheckBox9.Location = New System.Drawing.Point(3, 192) Me.CheckBox9.Name = "CheckBox9" Me.CheckBox9.Size = New System.Drawing.Size(239, 17) Me.CheckBox9.TabIndex = 191 Me.CheckBox9.Text = "Set Modulation to ""Not Set"" for HD Channels" Me.CheckBox9.UseVisualStyleBackColor = True ' 'CheckBox8 ' Me.CheckBox8.AutoSize = True Me.CheckBox8.Location = New System.Drawing.Point(3, 215) Me.CheckBox8.Name = "CheckBox8" Me.CheckBox8.Size = New System.Drawing.Size(156, 17) Me.CheckBox8.TabIndex = 190 Me.CheckBox8.Text = "Ignore Scrambled Channels" Me.CheckBox8.UseVisualStyleBackColor = True ' 'CheckBox7 ' Me.CheckBox7.AutoSize = True Me.CheckBox7.Location = New System.Drawing.Point(3, 169) Me.CheckBox7.Name = "CheckBox7" Me.CheckBox7.Size = New System.Drawing.Size(238, 17) Me.CheckBox7.TabIndex = 189 Me.CheckBox7.Text = "Set Modulation to ""Not Set"" for SD Channels" Me.CheckBox7.UseVisualStyleBackColor = True ' 'CheckBox3 ' Me.CheckBox3.AutoSize = True Me.CheckBox3.Location = New System.Drawing.Point(3, 146) Me.CheckBox3.Name = "CheckBox3" Me.CheckBox3.Size = New System.Drawing.Size(251, 17) Me.CheckBox3.TabIndex = 188 Me.CheckBox3.Text = "Include Extra Program Info ([HD],[SUB],[W] etc)" Me.CheckBox3.UseVisualStyleBackColor = True ' 'label8 ' Me.label8.AutoSize = True Me.label8.Location = New System.Drawing.Point(3, 246) Me.label8.Name = "label8" Me.label8.Size = New System.Drawing.Size(89, 13) Me.label8.TabIndex = 172 Me.label8.Text = "Expired Channels" ' 'CheckBox2 ' Me.CheckBox2.AutoSize = True Me.CheckBox2.Location = New System.Drawing.Point(3, 35) Me.CheckBox2.Name = "CheckBox2" Me.CheckBox2.Size = New System.Drawing.Size(86, 17) Me.CheckBox2.TabIndex = 183 Me.CheckBox2.Text = "Update EPG" Me.CheckBox2.UseVisualStyleBackColor = True ' 'chk_DeleteOld ' Me.chk_DeleteOld.AutoSize = True Me.chk_DeleteOld.Location = New System.Drawing.Point(6, 262) Me.chk_DeleteOld.Name = "chk_DeleteOld" Me.chk_DeleteOld.Size = New System.Drawing.Size(56, 17) Me.chk_DeleteOld.TabIndex = 170 Me.chk_DeleteOld.TabStop = True Me.chk_DeleteOld.Text = "Delete" Me.chk_DeleteOld.UseVisualStyleBackColor = True ' 'CheckBox1 ' Me.CheckBox1.AutoSize = True Me.CheckBox1.Location = New System.Drawing.Point(3, 123) Me.CheckBox1.Name = "CheckBox1" Me.CheckBox1.Size = New System.Drawing.Size(172, 17) Me.CheckBox1.TabIndex = 182 Me.CheckBox1.Text = "Replace SD Channels with HD" Me.CheckBox1.UseVisualStyleBackColor = True ' 'chk_MoveOld ' Me.chk_MoveOld.AutoSize = True Me.chk_MoveOld.Location = New System.Drawing.Point(6, 285) Me.chk_MoveOld.Name = "chk_MoveOld" Me.chk_MoveOld.Size = New System.Drawing.Size(64, 17) Me.chk_MoveOld.TabIndex = 171 Me.chk_MoveOld.TabStop = True Me.chk_MoveOld.Text = "Move to" Me.chk_MoveOld.UseVisualStyleBackColor = True ' 'txt_Move_Old_Group ' Me.txt_Move_Old_Group.Location = New System.Drawing.Point(6, 305) Me.txt_Move_Old_Group.Name = "txt_Move_Old_Group" Me.txt_Move_Old_Group.Size = New System.Drawing.Size(112, 20) Me.txt_Move_Old_Group.TabIndex = 174 Me.txt_Move_Old_Group.Text = "Old Sky Channels" ' 'chk_AutoUpdate ' Me.chk_AutoUpdate.AutoSize = True Me.chk_AutoUpdate.Location = New System.Drawing.Point(3, 13) Me.chk_AutoUpdate.Name = "chk_AutoUpdate" Me.chk_AutoUpdate.Size = New System.Drawing.Size(157, 17) Me.chk_AutoUpdate.TabIndex = 167 Me.chk_AutoUpdate.Text = "Update/Add New Channels" Me.chk_AutoUpdate.UseVisualStyleBackColor = True ' 'chk_SkyCategories ' Me.chk_SkyCategories.AutoSize = True Me.chk_SkyCategories.Location = New System.Drawing.Point(3, 79) Me.chk_SkyCategories.Name = "chk_SkyCategories" Me.chk_SkyCategories.Size = New System.Drawing.Size(122, 17) Me.chk_SkyCategories.TabIndex = 177 Me.chk_SkyCategories.Text = "Use Sky Categories " Me.chk_SkyCategories.UseVisualStyleBackColor = True ' 'chk_SkyNumbers ' Me.chk_SkyNumbers.AutoSize = True Me.chk_SkyNumbers.Location = New System.Drawing.Point(3, 57) Me.chk_SkyNumbers.Name = "chk_SkyNumbers" Me.chk_SkyNumbers.Size = New System.Drawing.Size(120, 17) Me.chk_SkyNumbers.TabIndex = 168 Me.chk_SkyNumbers.Text = "Use Sky Numbering" Me.chk_SkyNumbers.UseVisualStyleBackColor = True ' 'chk_SkyRegions ' Me.chk_SkyRegions.AutoSize = True Me.chk_SkyRegions.Location = New System.Drawing.Point(3, 101) Me.chk_SkyRegions.Name = "chk_SkyRegions" Me.chk_SkyRegions.Size = New System.Drawing.Size(306, 17) Me.chk_SkyRegions.TabIndex = 176 Me.chk_SkyRegions.Text = "Use Sky Region (Untick to STOP channels moving around)" Me.chk_SkyRegions.UseVisualStyleBackColor = True ' 'tabPage1 ' Me.tabPage1.Controls.Add(Me.skyUKContainer) Me.tabPage1.Location = New System.Drawing.Point(4, 22) Me.tabPage1.Name = "tabPage1" Me.tabPage1.Padding = New System.Windows.Forms.Padding(3) Me.tabPage1.Size = New System.Drawing.Size(448, 396) Me.tabPage1.TabIndex = 0 Me.tabPage1.Text = "Region / Groups" Me.tabPage1.UseVisualStyleBackColor = True ' 'skyUKContainer ' Me.skyUKContainer.Controls.Add(Me.groupBox1) Me.skyUKContainer.Controls.Add(Me.groupBox3) Me.skyUKContainer.Dock = System.Windows.Forms.DockStyle.Fill Me.skyUKContainer.Location = New System.Drawing.Point(3, 3) Me.skyUKContainer.Name = "skyUKContainer" Me.skyUKContainer.Size = New System.Drawing.Size(442, 390) Me.skyUKContainer.TabIndex = 177 Me.skyUKContainer.TabStop = False ' 'groupBox1 ' Me.groupBox1.Controls.Add(Me.Button4) Me.groupBox1.Controls.Add(Me.Label15) Me.groupBox1.Controls.Add(Me.CatText20) Me.groupBox1.Controls.Add(Me.CatByte20) Me.groupBox1.Controls.Add(Me.Label16) Me.groupBox1.Controls.Add(Me.Label17) Me.groupBox1.Controls.Add(Me.CatText19) Me.groupBox1.Controls.Add(Me.CatByte19) Me.groupBox1.Controls.Add(Me.CatText18) Me.groupBox1.Controls.Add(Me.CatByte18) Me.groupBox1.Controls.Add(Me.Label18) Me.groupBox1.Controls.Add(Me.Label19) Me.groupBox1.Controls.Add(Me.CatText17) Me.groupBox1.Controls.Add(Me.CatByte17) Me.groupBox1.Controls.Add(Me.CatText16) Me.groupBox1.Controls.Add(Me.CatByte16) Me.groupBox1.Controls.Add(Me.Label20) Me.groupBox1.Controls.Add(Me.CatText15) Me.groupBox1.Controls.Add(Me.CatByte15) Me.groupBox1.Controls.Add(Me.Label21) Me.groupBox1.Controls.Add(Me.Label22) Me.groupBox1.Controls.Add(Me.CatText14) Me.groupBox1.Controls.Add(Me.CatByte14) Me.groupBox1.Controls.Add(Me.CatText13) Me.groupBox1.Controls.Add(Me.CatByte13) Me.groupBox1.Controls.Add(Me.Label23) Me.groupBox1.Controls.Add(Me.Label24) Me.groupBox1.Controls.Add(Me.CatText12) Me.groupBox1.Controls.Add(Me.CatByte12) Me.groupBox1.Controls.Add(Me.CatText11) Me.groupBox1.Controls.Add(Me.CatByte11) Me.groupBox1.Controls.Add(Me.Label5) Me.groupBox1.Controls.Add(Me.CatText9) Me.groupBox1.Controls.Add(Me.CatByte9) Me.groupBox1.Controls.Add(Me.Label11) Me.groupBox1.Controls.Add(Me.Label12) Me.groupBox1.Controls.Add(Me.CatText7) Me.groupBox1.Controls.Add(Me.CatByte7) Me.groupBox1.Controls.Add(Me.CatText10) Me.groupBox1.Controls.Add(Me.CatByte10) Me.groupBox1.Controls.Add(Me.Label13) Me.groupBox1.Controls.Add(Me.Label14) Me.groupBox1.Controls.Add(Me.CatText6) Me.groupBox1.Controls.Add(Me.CatByte6) Me.groupBox1.Controls.Add(Me.CatText5) Me.groupBox1.Controls.Add(Me.CatByte5) Me.groupBox1.Controls.Add(Me.Label7) Me.groupBox1.Controls.Add(Me.CatText4) Me.groupBox1.Controls.Add(Me.CatByte4) Me.groupBox1.Controls.Add(Me.Label3) Me.groupBox1.Controls.Add(Me.Label4) Me.groupBox1.Controls.Add(Me.CatText8) Me.groupBox1.Controls.Add(Me.CatByte8) Me.groupBox1.Controls.Add(Me.CatText3) Me.groupBox1.Controls.Add(Me.CatByte3) Me.groupBox1.Controls.Add(Me.Label2) Me.groupBox1.Controls.Add(Me.Label1) Me.groupBox1.Controls.Add(Me.CatText2) Me.groupBox1.Controls.Add(Me.CatByte2) Me.groupBox1.Controls.Add(Me.CatText1) Me.groupBox1.Controls.Add(Me.CatByte1) Me.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill Me.groupBox1.Location = New System.Drawing.Point(3, 65) Me.groupBox1.Name = "groupBox1" Me.groupBox1.Size = New System.Drawing.Size(436, 322) Me.groupBox1.TabIndex = 174 Me.groupBox1.TabStop = False Me.groupBox1.Text = "Groups" ' 'Button4 ' Me.Button4.Dock = System.Windows.Forms.DockStyle.Bottom Me.Button4.Location = New System.Drawing.Point(3, 285) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(430, 34) Me.Button4.TabIndex = 82 Me.Button4.Text = "Save Changes" Me.Button4.UseVisualStyleBackColor = True ' 'Label15 ' Me.Label15.AutoSize = True Me.Label15.Location = New System.Drawing.Point(218, 250) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(19, 13) Me.Label15.TabIndex = 81 Me.Label15.Text = "20" ' 'CatText20 ' Me.CatText20.Location = New System.Drawing.Point(282, 247) Me.CatText20.Name = "CatText20" Me.CatText20.Size = New System.Drawing.Size(133, 20) Me.CatText20.TabIndex = 80 ' 'CatByte20 ' Me.CatByte20.Location = New System.Drawing.Point(237, 247) Me.CatByte20.Name = "CatByte20" Me.CatByte20.Size = New System.Drawing.Size(39, 20) Me.CatByte20.TabIndex = 79 ' 'Label16 ' Me.Label16.AutoSize = True Me.Label16.Location = New System.Drawing.Point(218, 224) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(19, 13) Me.Label16.TabIndex = 78 Me.Label16.Text = "19" Me.Label16.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.Location = New System.Drawing.Point(218, 198) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(19, 13) Me.Label17.TabIndex = 77 Me.Label17.Text = "18" ' 'CatText19 ' Me.CatText19.Location = New System.Drawing.Point(282, 221) Me.CatText19.Name = "CatText19" Me.CatText19.Size = New System.Drawing.Size(133, 20) Me.CatText19.TabIndex = 76 ' 'CatByte19 ' Me.CatByte19.Location = New System.Drawing.Point(237, 221) Me.CatByte19.Name = "CatByte19" Me.CatByte19.Size = New System.Drawing.Size(39, 20) Me.CatByte19.TabIndex = 75 ' 'CatText18 ' Me.CatText18.Location = New System.Drawing.Point(282, 195) Me.CatText18.Name = "CatText18" Me.CatText18.Size = New System.Drawing.Size(133, 20) Me.CatText18.TabIndex = 74 ' 'CatByte18 ' Me.CatByte18.Location = New System.Drawing.Point(237, 195) Me.CatByte18.Name = "CatByte18" Me.CatByte18.Size = New System.Drawing.Size(39, 20) Me.CatByte18.TabIndex = 73 ' 'Label18 ' Me.Label18.AutoSize = True Me.Label18.Location = New System.Drawing.Point(218, 172) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(19, 13) Me.Label18.TabIndex = 72 Me.Label18.Text = "17" Me.Label18.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label19 ' Me.Label19.AutoSize = True Me.Label19.Location = New System.Drawing.Point(218, 146) Me.Label19.Name = "Label19" Me.Label19.Size = New System.Drawing.Size(19, 13) Me.Label19.TabIndex = 71 Me.Label19.Text = "16" ' 'CatText17 ' Me.CatText17.Location = New System.Drawing.Point(282, 169) Me.CatText17.Name = "CatText17" Me.CatText17.Size = New System.Drawing.Size(133, 20) Me.CatText17.TabIndex = 70 ' 'CatByte17 ' Me.CatByte17.Location = New System.Drawing.Point(237, 169) Me.CatByte17.Name = "CatByte17" Me.CatByte17.Size = New System.Drawing.Size(39, 20) Me.CatByte17.TabIndex = 69 ' 'CatText16 ' Me.CatText16.Location = New System.Drawing.Point(282, 143) Me.CatText16.Name = "CatText16" Me.CatText16.Size = New System.Drawing.Size(133, 20) Me.CatText16.TabIndex = 68 ' 'CatByte16 ' Me.CatByte16.Location = New System.Drawing.Point(237, 143) Me.CatByte16.Name = "CatByte16" Me.CatByte16.Size = New System.Drawing.Size(39, 20) Me.CatByte16.TabIndex = 67 ' 'Label20 ' Me.Label20.AutoSize = True Me.Label20.Location = New System.Drawing.Point(218, 120) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(19, 13) Me.Label20.TabIndex = 66 Me.Label20.Text = "15" ' 'CatText15 ' Me.CatText15.Location = New System.Drawing.Point(282, 117) Me.CatText15.Name = "CatText15" Me.CatText15.Size = New System.Drawing.Size(133, 20) Me.CatText15.TabIndex = 65 Me.CatText15.Text = "Sky Help" ' 'CatByte15 ' Me.CatByte15.Location = New System.Drawing.Point(237, 117) Me.CatByte15.Name = "CatByte15" Me.CatByte15.Size = New System.Drawing.Size(39, 20) Me.CatByte15.TabIndex = 64 Me.CatByte15.Text = "16" ' 'Label21 ' Me.Label21.AutoSize = True Me.Label21.Location = New System.Drawing.Point(218, 94) Me.Label21.Name = "Label21" Me.Label21.Size = New System.Drawing.Size(19, 13) Me.Label21.TabIndex = 63 Me.Label21.Text = "14" Me.Label21.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label22 ' Me.Label22.AutoSize = True Me.Label22.Location = New System.Drawing.Point(218, 68) Me.Label22.Name = "Label22" Me.Label22.Size = New System.Drawing.Size(19, 13) Me.Label22.TabIndex = 62 Me.Label22.Text = "13" ' 'CatText14 ' Me.CatText14.Location = New System.Drawing.Point(282, 91) Me.CatText14.Name = "CatText14" Me.CatText14.Size = New System.Drawing.Size(133, 20) Me.CatText14.TabIndex = 61 Me.CatText14.Text = "Adult" ' 'CatByte14 ' Me.CatByte14.Location = New System.Drawing.Point(237, 91) Me.CatByte14.Name = "CatByte14" Me.CatByte14.Size = New System.Drawing.Size(39, 20) Me.CatByte14.TabIndex = 60 Me.CatByte14.Text = "63" ' 'CatText13 ' Me.CatText13.Location = New System.Drawing.Point(282, 65) Me.CatText13.Name = "CatText13" Me.CatText13.Size = New System.Drawing.Size(133, 20) Me.CatText13.TabIndex = 59 Me.CatText13.Text = "Specialist" ' 'CatByte13 ' Me.CatByte13.Location = New System.Drawing.Point(237, 65) Me.CatByte13.Name = "CatByte13" Me.CatByte13.Size = New System.Drawing.Size(39, 20) Me.CatByte13.TabIndex = 58 Me.CatByte13.Text = "255" ' 'Label23 ' Me.Label23.AutoSize = True Me.Label23.Location = New System.Drawing.Point(218, 42) Me.Label23.Name = "Label23" Me.Label23.Size = New System.Drawing.Size(19, 13) Me.Label23.TabIndex = 57 Me.Label23.Text = "12" Me.Label23.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label24 ' Me.Label24.AutoSize = True Me.Label24.Location = New System.Drawing.Point(218, 16) Me.Label24.Name = "Label24" Me.Label24.Size = New System.Drawing.Size(19, 13) Me.Label24.TabIndex = 56 Me.Label24.Text = "11" ' 'CatText12 ' Me.CatText12.Location = New System.Drawing.Point(282, 39) Me.CatText12.Name = "CatText12" Me.CatText12.Size = New System.Drawing.Size(133, 20) Me.CatText12.TabIndex = 55 Me.CatText12.Text = "Gaming & Dating" ' 'CatByte12 ' Me.CatByte12.Location = New System.Drawing.Point(237, 39) Me.CatByte12.Name = "CatByte12" Me.CatByte12.Size = New System.Drawing.Size(39, 20) Me.CatByte12.TabIndex = 54 Me.CatByte12.Text = "95" ' 'CatText11 ' Me.CatText11.Location = New System.Drawing.Point(282, 13) Me.CatText11.Name = "CatText11" Me.CatText11.Size = New System.Drawing.Size(133, 20) Me.CatText11.TabIndex = 53 Me.CatText11.Text = "International" ' 'CatByte11 ' Me.CatByte11.Location = New System.Drawing.Point(237, 13) Me.CatByte11.Name = "CatByte11" Me.CatByte11.Size = New System.Drawing.Size(39, 20) Me.CatByte11.TabIndex = 52 Me.CatByte11.Text = "223" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(8, 250) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(19, 13) Me.Label5.TabIndex = 51 Me.Label5.Text = "10" ' 'CatText9 ' Me.CatText9.Location = New System.Drawing.Point(72, 221) Me.CatText9.Name = "CatText9" Me.CatText9.Size = New System.Drawing.Size(133, 20) Me.CatText9.TabIndex = 50 Me.CatText9.Text = "Shopping" ' 'CatByte9 ' Me.CatByte9.Location = New System.Drawing.Point(27, 221) Me.CatByte9.Name = "CatByte9" Me.CatByte9.Size = New System.Drawing.Size(39, 20) Me.CatByte9.TabIndex = 49 Me.CatByte9.Text = "48" ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Location = New System.Drawing.Point(8, 224) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(13, 13) Me.Label11.TabIndex = 48 Me.Label11.Text = "9" Me.Label11.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Location = New System.Drawing.Point(8, 198) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(13, 13) Me.Label12.TabIndex = 47 Me.Label12.Text = "8" ' 'CatText7 ' Me.CatText7.Location = New System.Drawing.Point(72, 169) Me.CatText7.Name = "CatText7" Me.CatText7.Size = New System.Drawing.Size(133, 20) Me.CatText7.TabIndex = 46 Me.CatText7.Text = "Kids" ' 'CatByte7 ' Me.CatByte7.Location = New System.Drawing.Point(27, 169) Me.CatByte7.Name = "CatByte7" Me.CatByte7.Size = New System.Drawing.Size(39, 20) Me.CatByte7.TabIndex = 45 Me.CatByte7.Text = "80" ' 'CatText10 ' Me.CatText10.Location = New System.Drawing.Point(72, 247) Me.CatText10.Name = "CatText10" Me.CatText10.Size = New System.Drawing.Size(133, 20) Me.CatText10.TabIndex = 44 Me.CatText10.Text = "Religion" ' 'CatByte10 ' Me.CatByte10.Location = New System.Drawing.Point(27, 247) Me.CatByte10.Name = "CatByte10" Me.CatByte10.Size = New System.Drawing.Size(39, 20) Me.CatByte10.TabIndex = 43 Me.CatByte10.Text = "191" ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Location = New System.Drawing.Point(8, 172) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(13, 13) Me.Label13.TabIndex = 42 Me.Label13.Text = "7" Me.Label13.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label14 ' Me.Label14.AutoSize = True Me.Label14.Location = New System.Drawing.Point(8, 146) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(13, 13) Me.Label14.TabIndex = 41 Me.Label14.Text = "6" ' 'CatText6 ' Me.CatText6.Location = New System.Drawing.Point(72, 143) Me.CatText6.Name = "CatText6" Me.CatText6.Size = New System.Drawing.Size(133, 20) Me.CatText6.TabIndex = 40 Me.CatText6.Text = "Documentaries" ' 'CatByte6 ' Me.CatByte6.Location = New System.Drawing.Point(27, 143) Me.CatByte6.Name = "CatByte6" Me.CatByte6.Size = New System.Drawing.Size(39, 20) Me.CatByte6.TabIndex = 39 Me.CatByte6.Text = "127" ' 'CatText5 ' Me.CatText5.Location = New System.Drawing.Point(72, 117) Me.CatText5.Name = "CatText5" Me.CatText5.Size = New System.Drawing.Size(133, 20) Me.CatText5.TabIndex = 38 Me.CatText5.Text = "News" ' 'CatByte5 ' Me.CatByte5.Location = New System.Drawing.Point(27, 117) Me.CatByte5.Name = "CatByte5" Me.CatByte5.Size = New System.Drawing.Size(39, 20) Me.CatByte5.TabIndex = 37 Me.CatByte5.Text = "176" ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(8, 120) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(13, 13) Me.Label7.TabIndex = 36 Me.Label7.Text = "5" ' 'CatText4 ' Me.CatText4.Location = New System.Drawing.Point(72, 91) Me.CatText4.Name = "CatText4" Me.CatText4.Size = New System.Drawing.Size(133, 20) Me.CatText4.TabIndex = 33 Me.CatText4.Text = "Sports" ' 'CatByte4 ' Me.CatByte4.Location = New System.Drawing.Point(27, 91) Me.CatByte4.Name = "CatByte4" Me.CatByte4.Size = New System.Drawing.Size(39, 20) Me.CatByte4.TabIndex = 32 Me.CatByte4.Text = "240" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(8, 94) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(13, 13) Me.Label3.TabIndex = 31 Me.Label3.Text = "4" Me.Label3.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(8, 68) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(13, 13) Me.Label4.TabIndex = 30 Me.Label4.Text = "3" ' 'CatText8 ' Me.CatText8.Location = New System.Drawing.Point(72, 195) Me.CatText8.Name = "CatText8" Me.CatText8.Size = New System.Drawing.Size(133, 20) Me.CatText8.TabIndex = 29 Me.CatText8.Text = "Music" ' 'CatByte8 ' Me.CatByte8.Location = New System.Drawing.Point(27, 195) Me.CatByte8.Name = "CatByte8" Me.CatByte8.Size = New System.Drawing.Size(39, 20) Me.CatByte8.TabIndex = 28 Me.CatByte8.Text = "159" ' 'CatText3 ' Me.CatText3.Location = New System.Drawing.Point(72, 65) Me.CatText3.Name = "CatText3" Me.CatText3.Size = New System.Drawing.Size(133, 20) Me.CatText3.TabIndex = 27 Me.CatText3.Text = "Movies" ' 'CatByte3 ' Me.CatByte3.Location = New System.Drawing.Point(27, 65) Me.CatByte3.Name = "CatByte3" Me.CatByte3.Size = New System.Drawing.Size(39, 20) Me.CatByte3.TabIndex = 26 Me.CatByte3.Text = "208" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(8, 42) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(13, 13) Me.Label2.TabIndex = 25 Me.Label2.Text = "2" Me.Label2.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(8, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(13, 13) Me.Label1.TabIndex = 24 Me.Label1.Text = "1" ' 'CatText2 ' Me.CatText2.Location = New System.Drawing.Point(72, 39) Me.CatText2.Name = "CatText2" Me.CatText2.Size = New System.Drawing.Size(133, 20) Me.CatText2.TabIndex = 3 Me.CatText2.Text = "Lifestyle & Culture" ' 'CatByte2 ' Me.CatByte2.Location = New System.Drawing.Point(26, 39) Me.CatByte2.Name = "CatByte2" Me.CatByte2.Size = New System.Drawing.Size(39, 20) Me.CatByte2.TabIndex = 2 Me.CatByte2.Text = "31" ' 'CatText1 ' Me.CatText1.Location = New System.Drawing.Point(72, 13) Me.CatText1.Name = "CatText1" Me.CatText1.Size = New System.Drawing.Size(133, 20) Me.CatText1.TabIndex = 1 Me.CatText1.Text = "Entertainment" ' 'CatByte1 ' Me.CatByte1.Cursor = System.Windows.Forms.Cursors.IBeam Me.CatByte1.Location = New System.Drawing.Point(27, 13) Me.CatByte1.Name = "CatByte1" Me.CatByte1.Size = New System.Drawing.Size(39, 20) Me.CatByte1.TabIndex = 0 Me.CatByte1.Text = "112" ' 'groupBox3 ' Me.groupBox3.Controls.Add(Me.SkyUK_Region) Me.groupBox3.Dock = System.Windows.Forms.DockStyle.Top Me.groupBox3.Location = New System.Drawing.Point(3, 16) Me.groupBox3.Name = "groupBox3" Me.groupBox3.Size = New System.Drawing.Size(436, 49) Me.groupBox3.TabIndex = 175 Me.groupBox3.TabStop = False Me.groupBox3.Text = "Region" ' 'SkyUK_Region ' Me.SkyUK_Region.DisplayMember = "Sky_UK_Regions.RegionName" Me.SkyUK_Region.Dock = System.Windows.Forms.DockStyle.Fill Me.SkyUK_Region.FormattingEnabled = True Me.SkyUK_Region.Location = New System.Drawing.Point(3, 16) Me.SkyUK_Region.Name = "SkyUK_Region" Me.SkyUK_Region.Size = New System.Drawing.Size(430, 21) Me.SkyUK_Region.TabIndex = 148 ' 'TabPage4 ' Me.TabPage4.Controls.Add(Me.MpGroupBox2) Me.TabPage4.Controls.Add(Me.MpGroupBox1) Me.TabPage4.Location = New System.Drawing.Point(4, 22) Me.TabPage4.Name = "TabPage4" Me.TabPage4.Padding = New System.Windows.Forms.Padding(3) Me.TabPage4.Size = New System.Drawing.Size(448, 396) Me.TabPage4.TabIndex = 4 Me.TabPage4.Text = "Cards / Mapping" Me.TabPage4.UseVisualStyleBackColor = True ' 'MpGroupBox2 ' Me.MpGroupBox2.Controls.Add(Me.ChannelMap) Me.MpGroupBox2.Dock = System.Windows.Forms.DockStyle.Fill Me.MpGroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.MpGroupBox2.Location = New System.Drawing.Point(3, 118) Me.MpGroupBox2.Name = "MpGroupBox2" Me.MpGroupBox2.Size = New System.Drawing.Size(442, 275) Me.MpGroupBox2.TabIndex = 187 Me.MpGroupBox2.TabStop = False Me.MpGroupBox2.Text = "Select Card(s) for grab and Mapping" ' 'ChannelMap ' Me.ChannelMap.AccessibleDescription = "Use this to select the cards you wish to Map your channel searches to." Me.ChannelMap.BorderStyle = System.Windows.Forms.BorderStyle.None Me.ChannelMap.Dock = System.Windows.Forms.DockStyle.Fill Me.ChannelMap.FormattingEnabled = True Me.ChannelMap.Location = New System.Drawing.Point(3, 16) Me.ChannelMap.Name = "ChannelMap" Me.ChannelMap.Size = New System.Drawing.Size(436, 256) Me.ChannelMap.TabIndex = 0 ' 'MpGroupBox1 ' Me.MpGroupBox1.Controls.Add(Me.MpLabel1) Me.MpGroupBox1.Controls.Add(Me.mpDisEqc1) Me.MpGroupBox1.Controls.Add(Me.MpLabel6) Me.MpGroupBox1.Controls.Add(Me.MpComboBox1) Me.MpGroupBox1.Controls.Add(Me.MpLabel8) Me.MpGroupBox1.Controls.Add(Me.MpComboBox2) Me.MpGroupBox1.Controls.Add(Me.MpLabel3) Me.MpGroupBox1.Controls.Add(Me.TextBox4) Me.MpGroupBox1.Controls.Add(Me.MpLabel4) Me.MpGroupBox1.Controls.Add(Me.TextBox5) Me.MpGroupBox1.Controls.Add(Me.TextBox6) Me.MpGroupBox1.Controls.Add(Me.MpLabel5) Me.MpGroupBox1.Controls.Add(Me.TextBox10) Me.MpGroupBox1.Controls.Add(Me.MpLabel9) Me.MpGroupBox1.Controls.Add(Me.MpLabel10) Me.MpGroupBox1.Dock = System.Windows.Forms.DockStyle.Top Me.MpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.MpGroupBox1.Location = New System.Drawing.Point(3, 3) Me.MpGroupBox1.Name = "MpGroupBox1" Me.MpGroupBox1.Size = New System.Drawing.Size(442, 115) Me.MpGroupBox1.TabIndex = 186 Me.MpGroupBox1.TabStop = False Me.MpGroupBox1.Text = "Sky Channel Grabber setting" ' 'MpLabel1 ' Me.MpLabel1.AutoSize = True Me.MpLabel1.Location = New System.Drawing.Point(6, 66) Me.MpLabel1.Name = "MpLabel1" Me.MpLabel1.Size = New System.Drawing.Size(40, 13) Me.MpLabel1.TabIndex = 187 Me.MpLabel1.Text = "Diseqc" ' 'mpDisEqc1 ' Me.mpDisEqc1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.mpDisEqc1.FormattingEnabled = True Me.mpDisEqc1.Items.AddRange(New Object() {"None", "SimpleA", "SimpleB", "Level1AA", "Level1AB", "Level1BA", "Level1BB"}) Me.mpDisEqc1.Location = New System.Drawing.Point(9, 81) Me.mpDisEqc1.Name = "mpDisEqc1" Me.mpDisEqc1.Size = New System.Drawing.Size(90, 21) Me.mpDisEqc1.TabIndex = 186 ' 'MpLabel6 ' Me.MpLabel6.AutoSize = True Me.MpLabel6.Location = New System.Drawing.Point(312, 65) Me.MpLabel6.Name = "MpLabel6" Me.MpLabel6.Size = New System.Drawing.Size(62, 13) Me.MpLabel6.TabIndex = 48 Me.MpLabel6.Text = "Modulation:" ' 'MpComboBox1 ' Me.MpComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.MpComboBox1.FormattingEnabled = True Me.MpComboBox1.Items.AddRange(New Object() {"ModNotSet", "ModNotDefined", "Mod16Qam", "Mod32Qam", "Mod64Qam", "Mod80Qam", "Mod96Qam", "Mod112Qam", "Mod128Qam", "Mod160Qam", "Mod192Qam", "Mod224Qam", "Mod256Qam", "Mod320Qam", "Mod384Qam", "Mod448Qam", "Mod512Qam", "Mod640Qam", "Mod768Qam", "Mod896Qam", "Mod1024Qam", "ModQpsk", "ModBpsk", "ModOqpsk", "Mod8Vsb", "Mod16Vsb", "ModAnalogAmplitude", "ModAnalogFrequency", "Mod8Psk", "ModRF", "Mod16Apsk", "Mod32Apsk", "ModNbcQpsk", "ModNbc8Psk", "ModDirectTv", "ModMax"}) Me.MpComboBox1.Location = New System.Drawing.Point(315, 81) Me.MpComboBox1.Name = "MpComboBox1" Me.MpComboBox1.Size = New System.Drawing.Size(92, 21) Me.MpComboBox1.TabIndex = 49 ' 'MpLabel8 ' Me.MpLabel8.AutoSize = True Me.MpLabel8.Location = New System.Drawing.Point(158, 66) Me.MpLabel8.Name = "MpLabel8" Me.MpLabel8.Size = New System.Drawing.Size(64, 13) Me.MpLabel8.TabIndex = 46 Me.MpLabel8.Text = "Polarisation:" ' 'MpComboBox2 ' Me.MpComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.MpComboBox2.FormattingEnabled = True Me.MpComboBox2.Items.AddRange(New Object() {"Not Set", "Not Defined", "Horizontal", "Vertical", "Circular Left", "Circular Right"}) Me.MpComboBox2.Location = New System.Drawing.Point(161, 81) Me.MpComboBox2.Name = "MpComboBox2" Me.MpComboBox2.Size = New System.Drawing.Size(92, 21) Me.MpComboBox2.TabIndex = 47 ' 'MpLabel3 ' Me.MpLabel3.AutoSize = True Me.MpLabel3.Location = New System.Drawing.Point(342, 16) Me.MpLabel3.Name = "MpLabel3" Me.MpLabel3.Size = New System.Drawing.Size(57, 13) Me.MpLabel3.TabIndex = 105 Me.MpLabel3.Text = "Service ID" ' 'TextBox4 ' Me.TextBox4.Location = New System.Drawing.Point(345, 32) Me.TextBox4.MaxLength = 5 Me.TextBox4.Name = "TextBox4" Me.TextBox4.Size = New System.Drawing.Size(63, 20) Me.TextBox4.TabIndex = 104 Me.TextBox4.Text = "4152" ' 'MpLabel4 ' Me.MpLabel4.AutoSize = True Me.MpLabel4.Location = New System.Drawing.Point(230, 16) Me.MpLabel4.Name = "MpLabel4" Me.MpLabel4.Size = New System.Drawing.Size(66, 13) Me.MpLabel4.TabIndex = 103 Me.MpLabel4.Text = "Transport ID" ' 'TextBox5 ' Me.TextBox5.Location = New System.Drawing.Point(233, 32) Me.TextBox5.MaxLength = 5 Me.TextBox5.Name = "TextBox5" Me.TextBox5.Size = New System.Drawing.Size(63, 20) Me.TextBox5.TabIndex = 102 Me.TextBox5.Text = "2004" ' 'TextBox6 ' Me.TextBox6.Location = New System.Drawing.Point(9, 32) Me.TextBox6.MaxLength = 8 Me.TextBox6.Name = "TextBox6" Me.TextBox6.Size = New System.Drawing.Size(63, 20) Me.TextBox6.TabIndex = 40 Me.TextBox6.Text = "11778000" ' 'MpLabel5 ' Me.MpLabel5.AutoSize = True Me.MpLabel5.Location = New System.Drawing.Point(6, 16) Me.MpLabel5.Name = "MpLabel5" Me.MpLabel5.Size = New System.Drawing.Size(60, 13) Me.MpLabel5.TabIndex = 39 Me.MpLabel5.Text = "Frequency:" ' 'TextBox10 ' Me.TextBox10.Location = New System.Drawing.Point(121, 32) Me.TextBox10.MaxLength = 5 Me.TextBox10.Name = "TextBox10" Me.TextBox10.Size = New System.Drawing.Size(63, 20) Me.TextBox10.TabIndex = 43 Me.TextBox10.Text = "27500" ' 'MpLabel9 ' Me.MpLabel9.AutoSize = True Me.MpLabel9.Location = New System.Drawing.Point(118, 16) Me.MpLabel9.Name = "MpLabel9" Me.MpLabel9.Size = New System.Drawing.Size(70, 13) Me.MpLabel9.TabIndex = 42 Me.MpLabel9.Text = "Symbol Rate:" ' 'MpLabel10 ' Me.MpLabel10.AutoSize = True Me.MpLabel10.Location = New System.Drawing.Point(82, 53) Me.MpLabel10.Name = "MpLabel10" Me.MpLabel10.Size = New System.Drawing.Size(26, 13) Me.MpLabel10.TabIndex = 41 Me.MpLabel10.Text = "kHz" ' 'TabPage2 ' Me.TabPage2.Controls.Add(Me.Panel3) Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) Me.TabPage2.Size = New System.Drawing.Size(448, 396) Me.TabPage2.TabIndex = 3 Me.TabPage2.Text = "Schedule" Me.TabPage2.UseVisualStyleBackColor = True ' 'Panel3 ' Me.Panel3.Controls.Add(Me.Panel1) Me.Panel3.Controls.Add(Me.CheckBox4) Me.Panel3.Location = New System.Drawing.Point(3, 3) Me.Panel3.Name = "Panel3" Me.Panel3.Size = New System.Drawing.Size(445, 394) Me.Panel3.TabIndex = 14 ' 'Panel1 ' Me.Panel1.Controls.Add(Me.NumericUpDown1) Me.Panel1.Controls.Add(Me.DateTimePicker1) Me.Panel1.Controls.Add(Me.CheckBox5) Me.Panel1.Controls.Add(Me.CheckBox6) Me.Panel1.Controls.Add(Me.Sun) Me.Panel1.Controls.Add(Me.Sat) Me.Panel1.Controls.Add(Me.Label6) Me.Panel1.Controls.Add(Me.Fri) Me.Panel1.Controls.Add(Me.Mon) Me.Panel1.Controls.Add(Me.Thu) Me.Panel1.Controls.Add(Me.Tue) Me.Panel1.Controls.Add(Me.Wed) Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill Me.Panel1.Location = New System.Drawing.Point(0, 17) Me.Panel1.Name = "Panel1" Me.Panel1.Size = New System.Drawing.Size(445, 377) Me.Panel1.TabIndex = 13 ' 'NumericUpDown1 ' Me.NumericUpDown1.Location = New System.Drawing.Point(114, 11) Me.NumericUpDown1.Name = "NumericUpDown1" Me.NumericUpDown1.Size = New System.Drawing.Size(58, 20) Me.NumericUpDown1.TabIndex = 14 ' 'DateTimePicker1 ' Me.DateTimePicker1.CustomFormat = "HH:mm" Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.DateTimePicker1.Location = New System.Drawing.Point(114, 51) Me.DateTimePicker1.Name = "DateTimePicker1" Me.DateTimePicker1.ShowUpDown = True Me.DateTimePicker1.Size = New System.Drawing.Size(58, 20) Me.DateTimePicker1.TabIndex = 13 ' 'CheckBox5 ' Me.CheckBox5.AutoSize = True Me.CheckBox5.Location = New System.Drawing.Point(8, 12) Me.CheckBox5.Name = "CheckBox5" Me.CheckBox5.Size = New System.Drawing.Size(53, 17) Me.CheckBox5.TabIndex = 1 Me.CheckBox5.Text = "Every" Me.CheckBox5.UseVisualStyleBackColor = True ' 'CheckBox6 ' Me.CheckBox6.AutoSize = True Me.CheckBox6.Location = New System.Drawing.Point(8, 54) Me.CheckBox6.Name = "CheckBox6" Me.CheckBox6.Size = New System.Drawing.Size(108, 17) Me.CheckBox6.TabIndex = 2 Me.CheckBox6.Text = "On these days @" Me.CheckBox6.UseVisualStyleBackColor = True ' 'Sun ' Me.Sun.AutoSize = True Me.Sun.Location = New System.Drawing.Point(116, 109) Me.Sun.Name = "Sun" Me.Sun.Size = New System.Drawing.Size(45, 17) Me.Sun.TabIndex = 11 Me.Sun.Text = "Sun" Me.Sun.UseVisualStyleBackColor = True ' 'Sat ' Me.Sat.AutoSize = True Me.Sat.Location = New System.Drawing.Point(63, 109) Me.Sat.Name = "Sat" Me.Sat.Size = New System.Drawing.Size(42, 17) Me.Sat.TabIndex = 10 Me.Sat.Text = "Sat" Me.Sat.UseVisualStyleBackColor = True ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(173, 13) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(39, 13) Me.Label6.TabIndex = 4 Me.Label6.Text = "hour(s)" ' 'Fri ' Me.Fri.AutoSize = True Me.Fri.Location = New System.Drawing.Point(8, 109) Me.Fri.Name = "Fri" Me.Fri.Size = New System.Drawing.Size(37, 17) Me.Fri.TabIndex = 9 Me.Fri.Text = "Fri" Me.Fri.UseVisualStyleBackColor = True ' 'Mon ' Me.Mon.AutoSize = True Me.Mon.Location = New System.Drawing.Point(8, 86) Me.Mon.Name = "Mon" Me.Mon.Size = New System.Drawing.Size(47, 17) Me.Mon.TabIndex = 5 Me.Mon.Text = "Mon" Me.Mon.UseVisualStyleBackColor = True ' 'Thu ' Me.Thu.AutoSize = True Me.Thu.Location = New System.Drawing.Point(173, 86) Me.Thu.Name = "Thu" Me.Thu.Size = New System.Drawing.Size(45, 17) Me.Thu.TabIndex = 8 Me.Thu.Text = "Thu" Me.Thu.UseVisualStyleBackColor = True ' 'Tue ' Me.Tue.AutoSize = True Me.Tue.Location = New System.Drawing.Point(63, 86) Me.Tue.Name = "Tue" Me.Tue.Size = New System.Drawing.Size(45, 17) Me.Tue.TabIndex = 6 Me.Tue.Text = "Tue" Me.Tue.UseVisualStyleBackColor = True ' 'Wed ' Me.Wed.AutoSize = True Me.Wed.Location = New System.Drawing.Point(116, 86) Me.Wed.Name = "Wed" Me.Wed.Size = New System.Drawing.Size(49, 17) Me.Wed.TabIndex = 7 Me.Wed.Text = "Wed" Me.Wed.UseVisualStyleBackColor = True ' 'CheckBox4 ' Me.CheckBox4.AutoSize = True Me.CheckBox4.Dock = System.Windows.Forms.DockStyle.Top Me.CheckBox4.Location = New System.Drawing.Point(0, 0) Me.CheckBox4.Name = "CheckBox4" Me.CheckBox4.Size = New System.Drawing.Size(445, 17) Me.CheckBox4.TabIndex = 0 Me.CheckBox4.Text = "Enabled" Me.CheckBox4.UseVisualStyleBackColor = True ' 'TabPage5 ' Me.TabPage5.Controls.Add(Me.TextBox1) Me.TabPage5.Location = New System.Drawing.Point(4, 22) Me.TabPage5.Name = "TabPage5" Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) Me.TabPage5.Size = New System.Drawing.Size(448, 396) Me.TabPage5.TabIndex = 5 Me.TabPage5.Text = "Change Log" Me.TabPage5.UseVisualStyleBackColor = True ' 'TextBox1 ' Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill Me.TextBox1.Location = New System.Drawing.Point(3, 3) Me.TextBox1.Multiline = True Me.TextBox1.Name = "TextBox1" Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox1.Size = New System.Drawing.Size(442, 390) Me.TextBox1.TabIndex = 0 Me.TextBox1.Text = resources.GetString("TextBox1.Text") ' 'Setup ' Me.Controls.Add(Me.SkyIT_Tab) Me.Name = "Setup" Me.Size = New System.Drawing.Size(456, 422) Me.SkyIT_Tab.ResumeLayout(False) Me.tabPage3.ResumeLayout(False) Me.tabPage3.PerformLayout() CType(Me.NumericUpDown2, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage6.ResumeLayout(False) Me.Panel2.ResumeLayout(False) Me.Panel2.PerformLayout() Me.tabPage1.ResumeLayout(False) Me.skyUKContainer.ResumeLayout(False) Me.groupBox1.ResumeLayout(False) Me.groupBox1.PerformLayout() Me.groupBox3.ResumeLayout(False) Me.TabPage4.ResumeLayout(False) Me.MpGroupBox2.ResumeLayout(False) Me.MpGroupBox1.ResumeLayout(False) Me.MpGroupBox1.PerformLayout() Me.TabPage2.ResumeLayout(False) Me.Panel3.ResumeLayout(False) Me.Panel3.PerformLayout() Me.Panel1.ResumeLayout(False) Me.Panel1.PerformLayout() CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage5.ResumeLayout(False) Me.TabPage5.PerformLayout() Me.ResumeLayout(False) End Sub Private Sub AddLog(ByVal Value As String, ByVal UpdateLast As Boolean) If UpdateLast = True Then listViewStatus.Items(listViewStatus.Items.Count - 1).Text = Value Else listViewStatus.Items.Add(Value) End If listViewStatus.Items(listViewStatus.Items.Count - 1).EnsureVisible() End Sub Private Sub SetBool(ByVal value As Boolean) Panel2.Enabled = value End Sub Private Sub SetBool22(ByVal value As Boolean) skyUKContainer.Enabled = value End Sub Private Sub SetBool33(ByVal value As Boolean) MpGroupBox1.Enabled = value End Sub Private Sub SetBool44(ByVal value As Boolean) MpGroupBox2.Enabled = value End Sub Private Sub SetBool55(ByVal value As Boolean) Panel3.Enabled = value End Sub Private Sub SetBool66(ByVal value As Boolean) Button1.Enabled = value End Sub Sub active() Handles Grabber.OnActivateControls Dim param(0) As Boolean param(0) = True Try Panel2.Invoke(Bool1, param(0)) skyUKContainer.Invoke(Bool2, param(0)) MpGroupBox1.Invoke(Bool3, param(0)) MpGroupBox2.Invoke(Bool4, param(0)) Panel3.Invoke(Bool5, param(0)) Button1.Invoke(Bool6, param(0)) Catch End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Settings.IsGrabbing = False Then listViewStatus.Items.Clear() Dim param(0) As Boolean param(0) = False Try Panel2.Invoke(Bool1, param(0)) skyUKContainer.Invoke(Bool2, param(0)) MpGroupBox1.Invoke(Bool3, param(0)) MpGroupBox2.Invoke(Bool4, param(0)) Panel3.Invoke(Bool5, param(0)) Button1.Invoke(Bool6, param(0)) Catch End Try Grabber.Grab() End If End Sub Private Sub OnMessage(ByVal Message As String, ByVal UpdateLast As Boolean) Handles Grabber.OnMessage Dim param() As Object = {Message, UpdateLast} Try listViewStatus.Invoke(Log1, param) If UpdateLast = False Then Log.Write("Sky Plugin : " & Message) End If Catch End Try End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try If CatByte1.Text <> "" And CatByte1.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte1.Text), CatText1.Text) Catch CatByte1.Text = "" End Try Try If CatByte2.Text <> "" And CatByte2.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte2.Text), CatText2.Text) Catch CatByte2.Text = "" End Try Try If CatByte3.Text <> "" And CatByte3.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte3.Text), CatText3.Text) Catch CatByte3.Text = "" End Try Try If CatByte4.Text <> "" And CatByte4.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte4.Text), CatText4.Text) Catch CatByte4.Text = "" End Try Try If CatByte5.Text <> "" And CatByte5.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte5.Text), CatText5.Text) Catch CatByte5.Text = "" End Try Try If CatByte6.Text <> "" And CatByte6.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte6.Text), CatText6.Text) Catch CatByte6.Text = "" End Try Try If CatByte7.Text <> "" And CatByte7.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte7.Text), CatText7.Text) Catch CatByte7.Text = "" End Try Try If CatByte8.Text <> "" And CatByte8.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte8.Text), CatText8.Text) Catch CatByte8.Text = "" End Try Try If CatByte9.Text <> "" And CatByte9.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte9.Text), CatText9.Text) Catch CatByte9.Text = "" End Try Try If CatByte10.Text <> "" And CatByte10.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte10.Text), CatText10.Text) Catch CatByte10.Text = "" End Try Try If CatByte11.Text <> "" And CatByte11.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte11.Text), CatText11.Text) Catch CatByte11.Text = "" End Try Try If CatByte12.Text <> "" And CatByte12.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte12.Text), CatText12.Text) Catch CatByte12.Text = "" End Try Try If CatByte13.Text <> "" And CatByte13.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte13.Text), CatText13.Text) Catch CatByte13.Text = "" End Try Try If CatByte14.Text <> "" And CatByte14.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte14.Text), CatText14.Text) Catch CatByte14.Text = "" End Try Try If CatByte15.Text <> "" And CatByte15.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte15.Text), CatText15.Text) Catch CatByte15.Text = "" End Try Try If CatByte16.Text <> "" And CatByte16.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte16.Text), CatText16.Text) Catch CatByte16.Text = "" End Try Try If CatByte17.Text <> "" And CatByte17.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte17.Text), CatText17.Text) Catch CatByte17.Text = "" End Try Try If CatByte18.Text <> "" And CatByte18.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte18.Text), CatText18.Text) Catch CatByte18.Text = "" End Try Try If CatByte19.Text <> "" And CatByte19.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte19.Text), CatText19.Text) Catch CatByte19.Text = "" End Try Try If CatByte20.Text <> "" And CatByte20.Text <> "0" Then Settings.SetCategory(Convert.ToInt32(CatByte20.Text), CatText20.Text) Catch CatByte20.Text = "" End Try SaveCatSettings() End Sub Sub LoadSetting() Dim layer As New TvBusinessLayer() Dim id As Integer = -1 Dim checker As Integer = 0 For Each card_1 As Card In Card.ListAll() If RemoteControl.Instance.Type(card_1.IdCard) = CardType.DvbS Then ChannelMap.Items.Add(card_1.Name) End If Next Settings.IsLoading = True Dim listofmap As List(Of Integer) = Settings.CardMap If listofmap.Count > 0 And ChannelMap.Items.Count > 0 Then For Each num In listofmap Try ChannelMap.SetItemChecked(num, True) Catch ex As Exception End Try Next End If Settings.IsLoading = False layer = Nothing Dim rr As New IO.StringReader(My.Settings.Regions) Dim ttt As New List(Of String) Dim lines() As String = My.Settings.Regions.Split(vbNewLine) For Each str As String In lines ttt.Add(str) Next Dim trt As Integer = -1 For Each yt As String In ttt trt += 1 Dim split(2) As String Dim Split2(2) As String split = yt.Split("=") SkyUK_Region.Items.Add(split(1)) Split2 = split(0).Split("-") Dim bad As New Region bad.BouquetID = Val(Split2(0)) bad.RegionID = Val(Split2(1)) regions.Add(trt, bad) Next If Settings.GetSkySetting(CatByte1.Name, CatByte1.Text) = "-1" Then CatByte1.Text = "" CatText1.Text = "" Else CatByte1.Text = Settings.GetSkySetting(CatByte1.Name, "-1") CatText1.Text = Settings.GetSkySetting(CatText1.Name, CatText1.Text) End If If Settings.GetSkySetting(CatByte2.Name, CatByte2.Text) = "-1" Then CatByte2.Text = "" CatText2.Text = "" Else CatByte2.Text = Settings.GetSkySetting(CatByte2.Name, "-1") CatText2.Text = Settings.GetSkySetting(CatText2.Name, CatText2.Text) End If If Settings.GetSkySetting(CatByte3.Name, CatByte3.Text) = "-1" Then CatByte3.Text = "" CatText3.Text = "" Else CatByte3.Text = Settings.GetSkySetting(CatByte3.Name, "-1") CatText3.Text = Settings.GetSkySetting(CatText3.Name, CatText3.Text) End If If Settings.GetSkySetting(CatByte4.Name, CatByte4.Text) = "-1" Then CatByte4.Text = "" CatText4.Text = "" Else CatByte4.Text = Settings.GetSkySetting(CatByte4.Name, "-1") CatText4.Text = Settings.GetSkySetting(CatText4.Name, CatText4.Text) End If If Settings.GetSkySetting(CatByte5.Name, CatByte5.Text) = "-1" Then CatByte5.Text = "" CatText5.Text = "" Else CatByte5.Text = Settings.GetSkySetting(CatByte5.Name, "-1") CatText5.Text = Settings.GetSkySetting(CatText5.Name, CatText5.Text) End If If Settings.GetSkySetting(CatByte6.Name, CatByte6.Text) = "-1" Then CatByte6.Text = "" CatText6.Text = "" Else CatByte6.Text = Settings.GetSkySetting(CatByte6.Name, "-1") CatText6.Text = Settings.GetSkySetting(CatText6.Name, CatText6.Text) End If If Settings.GetSkySetting(CatByte7.Name, CatByte7.Text) = "-1" Then CatByte7.Text = "" CatText7.Text = "" Else CatByte7.Text = Settings.GetSkySetting(CatByte7.Name, "-1") CatText7.Text = Settings.GetSkySetting(CatText7.Name, CatText7.Text) End If If Settings.GetSkySetting(CatByte8.Name, CatByte8.Text) = "-1" Then CatByte8.Text = "" CatText8.Text = "" Else CatByte8.Text = Settings.GetSkySetting(CatByte8.Name, "-1") CatText8.Text = Settings.GetSkySetting(CatText8.Name, CatText8.Text) End If If Settings.GetSkySetting(CatByte9.Name, CatByte9.Text) = "-1" Then CatByte9.Text = "" CatText9.Text = "" Else CatByte9.Text = Settings.GetSkySetting(CatByte9.Name, "-1") CatText9.Text = Settings.GetSkySetting(CatText9.Name, CatText9.Text) End If If Settings.GetSkySetting(CatByte10.Name, CatByte10.Text) = "-1" Then CatByte10.Text = "" CatText10.Text = "" Else CatByte10.Text = Settings.GetSkySetting(CatByte10.Name, "-1") CatText10.Text = Settings.GetSkySetting(CatText10.Name, CatText10.Text) End If If Settings.GetSkySetting(CatByte11.Name, CatByte11.Text) = "-1" Then CatByte11.Text = "" CatText11.Text = "" Else CatByte11.Text = Settings.GetSkySetting(CatByte11.Name, "-1") CatText11.Text = Settings.GetSkySetting(CatText11.Name, CatText11.Text) End If If Settings.GetSkySetting(CatByte12.Name, CatByte12.Text) = "-1" Then CatByte12.Text = "" CatText12.Text = "" Else CatByte12.Text = Settings.GetSkySetting(CatByte12.Name, "-1") CatText12.Text = Settings.GetSkySetting(CatText12.Name, CatText12.Text) End If If Settings.GetSkySetting(CatByte13.Name, CatByte13.Text) = "-1" Then CatByte13.Text = "" CatText13.Text = "" Else CatByte13.Text = Settings.GetSkySetting(CatByte13.Name, "-1") CatText13.Text = Settings.GetSkySetting(CatText13.Name, CatText13.Text) End If If Settings.GetSkySetting(CatByte14.Name, CatByte14.Text) = "-1" Then CatByte14.Text = "" CatText14.Text = "" Else CatByte14.Text = Settings.GetSkySetting(CatByte14.Name, "-1") CatText14.Text = Settings.GetSkySetting(CatText14.Name, CatText14.Text) End If If Settings.GetSkySetting(CatByte15.Name, CatByte15.Text) = "-1" Then CatByte15.Text = "" CatText15.Text = "" Else CatByte15.Text = Settings.GetSkySetting(CatByte15.Name, "-1") CatText15.Text = Settings.GetSkySetting(CatText15.Name, CatText15.Text) End If If Settings.GetSkySetting(CatByte16.Name, CatByte16.Text) = "-1" Then CatByte16.Text = "" CatText16.Text = "" Else CatByte16.Text = Settings.GetSkySetting(CatByte16.Name, "-1") CatText16.Text = Settings.GetSkySetting(CatText16.Name, CatText16.Text) End If If Settings.GetSkySetting(CatByte17.Name, CatByte17.Text) = "-1" Then CatByte17.Text = "" CatText17.Text = "" Else CatByte17.Text = Settings.GetSkySetting(CatByte17.Name, "-1") CatText17.Text = Settings.GetSkySetting(CatText17.Name, CatText17.Text) End If If Settings.GetSkySetting(CatByte18.Name, CatByte18.Text) = "-1" Then CatByte18.Text = "" CatText18.Text = "" Else CatByte18.Text = Settings.GetSkySetting(CatByte18.Name, "-1") CatText18.Text = Settings.GetSkySetting(CatText18.Name, CatText18.Text) End If If Settings.GetSkySetting(CatByte19.Name, CatByte19.Text) = "-1" Then CatByte19.Text = "" CatText19.Text = "" Else CatByte19.Text = Settings.GetSkySetting(CatByte19.Name, "-1") CatText19.Text = Settings.GetSkySetting(CatText19.Name, CatText19.Text) End If If Settings.GetSkySetting(CatByte20.Name, CatByte20.Text) = "-1" Then CatByte20.Text = "" CatText20.Text = "" Else CatByte20.Text = Settings.GetSkySetting(CatByte20.Name, "-1") CatText20.Text = Settings.GetSkySetting(CatText20.Name, CatText20.Text) End If TextBox6.Text = Settings.frequency chk_AutoUpdate.Checked = Settings.UpdateChannels chk_SkyNumbers.Checked = Settings.UseSkyNumbers chk_SkyCategories.Checked = Settings.UseSkyCategories chk_SkyRegions.Checked = Settings.UseSkyRegions chk_DeleteOld.Checked = Settings.DeleteOldChannels chk_MoveOld.Checked = Not Settings.DeleteOldChannels CheckBox1.Checked = Settings.ReplaceSDwithHD CheckBox2.Checked = Settings.UpdateEPG 'TextBox1.Text = Settings.SwitchingFrequency txt_Move_Old_Group.Text = Settings.OldChannelFolder SkyUK_Region.SelectedIndex = Settings.RegionIndex Settings.RegionIndex = SkyUK_Region.SelectedIndex TextBox10.Text = Settings.SymbolRate TextBox5.Text = Settings.TransportID TextBox4.Text = Settings.ServiceID mpDisEqc1.SelectedIndex = Settings.DiseqC If mpDisEqc1.SelectedIndex = -1 Then mpDisEqc1.SelectedIndex = 0 Settings.DiseqC = 0 End If MpComboBox2.SelectedIndex = Settings.polarisation If MpComboBox2.SelectedIndex = -1 Then MpComboBox2.SelectedIndex = 0 Settings.polarisation = 0 End If MpComboBox1.SelectedIndex = Settings.modulation If MpComboBox1.SelectedIndex = -1 Then MpComboBox1.SelectedIndex = 0 Settings.modulation = 0 End If TextBox6.Text = Settings.frequency CheckBox4.Checked = Settings.AutoUpdate CheckBox5.Checked = Settings.EveryHour CheckBox6.Checked = Settings.OnDaysAt If Settings.UpdateInterval = 0 Then Settings.UpdateInterval = 1 End If CheckBox3.Checked = Settings.useExtraInfo CheckBox7.Checked = Settings.UseNotSetModSD CheckBox9.Checked = Settings.UseNotSetModHD CheckBox8.Checked = Settings.IgnoreScrambled NumericUpDown2.Value = Settings.GrabTime NumericUpDown1.Value = Settings.UpdateInterval Panel1.Visible = Settings.AutoUpdate DateTimePicker1.Value = Settings.UpdateTime Mon.Checked = Settings.Mon Tue.Checked = Settings.Tue Wed.Checked = Settings.Wed Thu.Checked = Settings.Thu Fri.Checked = Settings.Fri Sat.Checked = Settings.Sat Sun.Checked = Settings.Sun If CatByte1.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte1.Text), CatText1.Text) If CatByte2.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte2.Text), CatText2.Text) If CatByte3.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte3.Text), CatText3.Text) If CatByte8.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte8.Text), CatText8.Text) If CatByte4.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte4.Text), CatText4.Text) If CatByte5.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte5.Text), CatText5.Text) If CatByte6.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte6.Text), CatText6.Text) If CatByte10.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte10.Text), CatText10.Text) If CatByte7.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte7.Text), CatText7.Text) If CatByte9.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte9.Text), CatText9.Text) If CatByte11.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte11.Text), CatText11.Text) If CatByte12.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte12.Text), CatText12.Text) If CatByte13.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte13.Text), CatText13.Text) If CatByte14.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte14.Text), CatText14.Text) If CatByte15.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte15.Text), CatText15.Text) If CatByte16.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte16.Text), CatText16.Text) If CatByte17.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte17.Text), CatText17.Text) If CatByte18.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte18.Text), CatText18.Text) If CatByte19.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte19.Text), CatText19.Text) If CatByte20.Text <> "" Then Settings.SetCategory(Convert.ToInt32(CatByte11.Text), CatText20.Text) End Sub Sub SaveCatSettings() Dim Temp As String Dim Name As String Dim Temo As String Dim Namo As String Temp = CatByte1.Text Name = CatByte1.Name Temo = CatText1.Text Namo = CatText1.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte2.Text Name = CatByte2.Name Temo = CatText2.Text Namo = CatText2.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte3.Text Name = CatByte3.Name Temo = CatText3.Text Namo = CatText3.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte4.Text Name = CatByte4.Name Temo = CatText4.Text Namo = CatText4.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte5.Text Name = CatByte5.Name Temo = CatText5.Text Namo = CatText5.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte6.Text Name = CatByte6.Name Temo = CatText6.Text Namo = CatText6.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte7.Text Name = CatByte7.Name Temo = CatText7.Text Namo = CatText7.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte8.Text Name = CatByte8.Name Temo = CatText8.Text Namo = CatText8.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte9.Text Name = CatByte9.Name Temo = CatText9.Text Namo = CatText9.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte10.Text Name = CatByte10.Name Temo = CatText10.Text Namo = CatText10.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte11.Text Name = CatByte11.Name Temo = CatText11.Text Namo = CatText11.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte12.Text Name = CatByte12.Name Temo = CatText12.Text Namo = CatText12.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte13.Text Name = CatByte13.Name Temo = CatText13.Text Namo = CatText13.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte14.Text Name = CatByte14.Name Temo = CatText14.Text Namo = CatText14.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte15.Text Name = CatByte15.Name Temo = CatText15.Text Namo = CatText15.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte16.Text Name = CatByte16.Name Temo = CatText16.Text Namo = CatText16.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte17.Text Name = CatByte17.Name Temo = CatText17.Text Namo = CatText17.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte18.Text Name = CatByte18.Name Temo = CatText18.Text Namo = CatText18.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte19.Text Name = CatByte19.Name Temo = CatText19.Text Namo = CatText19.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If Temp = CatByte20.Text Name = CatByte20.Name Temo = CatText20.Text Namo = CatText20.Name Settings.UpdateSetting(Namo, Temo) If Temp = "" Then Settings.UpdateSetting(Name, "-1") Else Settings.UpdateSetting(Name, Temp) End If End Sub Private Sub SkyUK_Region_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SkyUK_Region.SelectedIndexChanged Dim region As Region = regions(SkyUK_Region.SelectedIndex) Settings.RegionID = region.RegionID Settings.BouquetID = region.BouquetID Settings.RegionIndex = SkyUK_Region.SelectedIndex End Sub Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Settings.SymbolRate = TextBox10.Text End Sub Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Settings.TransportID = TextBox5.Text End Sub Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Settings.ServiceID = TextBox4.Text End Sub Private Sub MpComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MpComboBox1.SelectedIndexChanged Settings.modulation = MpComboBox1.SelectedIndex End Sub Private Sub mpDisEqc1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mpDisEqc1.SelectedIndexChanged Settings.DiseqC = mpDisEqc1.SelectedIndex End Sub Private Sub MpComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MpComboBox2.SelectedIndexChanged Settings.polarisation = MpComboBox2.SelectedIndex End Sub Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Settings.frequency = TextBox6.Text End Sub Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged Settings.AutoUpdate = CheckBox4.Checked Panel1.Visible = Settings.AutoUpdate End Sub Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged Settings.EveryHour = CheckBox5.Checked Settings.OnDaysAt = Not CheckBox5.Checked CheckBox6.Checked = Not CheckBox5.Checked Mon.Enabled = Not CheckBox5.Checked Tue.Enabled = Not CheckBox5.Checked Wed.Enabled = Not CheckBox5.Checked Thu.Enabled = Not CheckBox5.Checked Fri.Enabled = Not CheckBox5.Checked Sat.Enabled = Not CheckBox5.Checked Sun.Enabled = Not CheckBox5.Checked DateTimePicker1.Enabled = Not CheckBox5.Checked NumericUpDown1.Enabled = CheckBox5.Checked End Sub Private Sub CheckBox6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox6.CheckedChanged Settings.OnDaysAt = CheckBox6.Checked Settings.EveryHour = Not CheckBox6.Checked CheckBox5.Checked = Not CheckBox6.Checked Mon.Enabled = Not CheckBox5.Checked Tue.Enabled = Not CheckBox5.Checked Wed.Enabled = Not CheckBox5.Checked Thu.Enabled = Not CheckBox5.Checked Fri.Enabled = Not CheckBox5.Checked Sat.Enabled = Not CheckBox5.Checked Sun.Enabled = Not CheckBox5.Checked DateTimePicker1.Enabled = Not CheckBox5.Checked NumericUpDown1.Enabled = CheckBox5.Checked End Sub Private Sub Mon_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mon.CheckedChanged Settings.Mon = Mon.Checked End Sub Private Sub Tue_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tue.CheckedChanged Settings.Tue = Tue.Checked End Sub Private Sub Wed_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Wed.CheckedChanged Settings.Wed = Wed.Checked End Sub Private Sub Thu_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Thu.CheckedChanged Settings.Thu = Thu.Checked End Sub Private Sub Fri_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Fri.CheckedChanged Settings.Fri = Fri.Checked End Sub Private Sub Sat_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sat.CheckedChanged Settings.Sat = Sat.Checked End Sub Private Sub Sun_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sun.CheckedChanged Settings.Sun = Sun.Checked End Sub Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged Settings.UpdateInterval = NumericUpDown1.Value End Sub Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged Settings.UpdateTime = DateTimePicker1.Value.ToString End Sub Private Sub ChannelMap_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ChannelMap.ItemCheck If Settings.IsLoading = False Then Dim listofmap As New List(Of Integer) If ChannelMap.Items.Count > 0 Then For a As Integer = 0 To ChannelMap.Items.Count - 1 Try ' MsgBox(e.Index & " : " & e.NewValue) If e.Index = a Then If (e.NewValue = 1) Then listofmap.Add(a) End If Else If ChannelMap.GetItemChecked(a) Then listofmap.Add(a) End If End If Catch ex As Exception End Try Next End If Settings.CardMap = listofmap End If End Sub Private Sub NumericUpDown2_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Settings.GrabTime = NumericUpDown2.Value End Sub Private Sub txt_Move_Old_Group_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_Move_Old_Group.TextChanged Settings.OldChannelFolder = txt_Move_Old_Group.Text End Sub Private Sub TextBox6_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged Settings.frequency = TextBox6.Text End Sub Private Sub TextBox10_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged Settings.SymbolRate = TextBox10.Text End Sub Private Sub TextBox5_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged Settings.TransportID = TextBox5.Text End Sub Private Sub TextBox4_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged Settings.ServiceID = TextBox4.Text End Sub Private Sub CheckBox8_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox8.CheckedChanged Settings.IgnoreScrambled = CheckBox8.Checked End Sub Private Sub CheckBox7_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox7.CheckedChanged Settings.UseNotSetModSD = CheckBox7.Checked End Sub Private Sub chk_AutoUpdate_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_AutoUpdate.CheckedChanged Settings.UpdateChannels = chk_AutoUpdate.Checked End Sub Private Sub CheckBox2_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged Settings.UpdateEPG = CheckBox2.Checked End Sub Private Sub chk_SkyNumbers_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_SkyNumbers.CheckedChanged Settings.UseSkyNumbers = chk_SkyNumbers.Checked End Sub Private Sub chk_SkyCategories_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_SkyCategories.CheckedChanged Settings.UseSkyCategories = chk_SkyCategories.Checked End Sub Private Sub chk_SkyRegions_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_SkyRegions.CheckedChanged Settings.UseSkyRegions = chk_SkyRegions.Checked End Sub Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged Settings.ReplaceSDwithHD = CheckBox1.Checked End Sub Private Sub CheckBox3_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged Settings.useExtraInfo = CheckBox3.Checked End Sub Private Sub chk_DeleteOld_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_DeleteOld.CheckedChanged If chk_DeleteOld.Checked Then chk_MoveOld.Checked = False Settings.DeleteOldChannels = True End If End Sub Private Sub chk_MoveOld_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_MoveOld.CheckedChanged If chk_MoveOld.Checked Then chk_DeleteOld.Checked = False Settings.DeleteOldChannels = False End If End Sub Private Sub CheckBox9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox9.CheckedChanged Settings.UseNotSetModHD = CheckBox9.Checked End Sub End Class Public Class Region Dim _BouquetID As Integer Dim _RegionID As Integer Public Property BouquetID() As Integer Get Return _BouquetID End Get Set(ByVal value As Integer) _BouquetID = value End Set End Property Public Property RegionID() As Integer Get Return _RegionID End Get Set(ByVal value As Integer) _RegionID = value End Set End Property End Class
8dcb974e852c8234e90b5dc34f975559b8217af0
[ "Visual Basic .NET" ]
2
Visual Basic .NET
Benoire/Sky-EPG-Grabber-Plugin
d2e167d7414700cae56c3a82341d181d991737d9
10b7df3ff0ddf9fdd941ce302f8370ed6d8712ee
refs/heads/master
<file_sep>## Redux Minesweeper This is a personal project of a minesweeper game I built using Redux.<br> The reason behind adopting Redux instead using some simpler framework like MobX, for example, was educational only. After studying Redux, I decided to implment a bit of it in a project. That is an overkill though. <br> It was created using `create-react-app`. ## Running it In order to run this project, you can either check out the live demo [here](https://souzasmatheus.github.io/minesweeper/) or: 1. Clone this repository; 2. Move into its directory; 3. Run npm install; 4. Run npm run start;<file_sep>// variables // helping functions const getRandomNumbers = (max) => { const num = Math.floor(Math.random() * max) + 1 return num } const checkUniqueness = (value, array) => { let equalValuesArray = [] for (let i = 0; i < array.length; i++) { if (value === array[i]) { equalValuesArray.push(array[i]) } } if (equalValuesArray.length !== 0) { return false } else { return true } } const pushToArray = (value, array) => { array.push(value) } const toPushOrNotToPush = (value, array, condition, func) => { if (condition(value, array)) { func(value, array) } } // specific functions const fillMinesArray = () => { let mines = [] while (mines.length < 10) { let randomValue = getRandomNumbers(81) toPushOrNotToPush(randomValue, mines, checkUniqueness, pushToArray) } return mines } module.exports = fillMinesArray<file_sep>// import const C = require('./constants') // actions export const sortSquares = (array) => ({ type: C.SORT_SQUARES, squares: array }) export const showValue = (id) => ({ type: C.SHOW_VALUE, id }) export const finishGame = (...arg) => { if (arg.length !== 0) { return { type: C.FINISH_GAME, finish: false } } else { return { type: C.FINISH_GAME, finish: true } } }<file_sep>import React from 'react' import './boomModal.css' const BoomModal = () => { return ( <div className="modal"> <h1>Booom!!!</h1> </div> ) } export default BoomModal<file_sep>const C = require('./constants') export const square = (state={}, action) => { switch (action.type) { case C.SHOW_VALUE: return (state.id !== action.id) ? state : { ...state, isClicked: true } default: return state } } export const squares = (state=[], action) => { switch (action.type) { case C.SORT_SQUARES: return action.squares case C.SHOW_VALUE: return state.map( m => square(m, action) ) default: return state } } export const finish = (state=false, action) => { switch (action.type) { case C.FINISH_GAME: return action.finish default: return state } }<file_sep>const constants = { SORT_SQUARES: 'SORT_SQUARES', SHOW_VALUE: 'SHOW_VALUE', FINISH_GAME: 'FINISH_GAME' } module.exports = constants<file_sep>import React from 'react' import {showValue, finishGame} from '../../state/actionCreators' import './square.css' const Square = ({store, symbol, isClicked, id}) => { if (isClicked === false && symbol === 'mine') { return <td onClick={() => { store.dispatch(showValue(id)) setTimeout(() => store.dispatch(finishGame()), 700) }}></td> } else if (isClicked === true && symbol === 'mine') { return <td><i className="fas fa-bomb"></i></td> } else if (isClicked === true) { return <td>{symbol}</td> } else { return <td onClick={() => store.dispatch( showValue(id) )}></td> } } export default Square
bcc238f0c285813b111a46bc9cc705b8d4621ff2
[ "Markdown", "JavaScript" ]
7
Markdown
souzasmatheus/minesweeper
417f82f8d253f2dbc1d37fd1791b900d00cb3ef5
57374a9b6bdc4c82faa3e1fd41c5cdd59aa10b13
refs/heads/develop
<repo_name>BuildForSDGCohort2/team-101-frontend<file_sep>/src/components/footer.js import React from "react"; export default function Footer(props){ return( <React.Fragment> <div className ="row footerPadding"> <div className ="col-sm-6 "> <a className ="noDecoration" href="/home"> <img src="images/onboard_menu_icon.svg" alt ="onboard_menu_icon"/> <span className ="brandAfriData">Open Data</span> </a></div> <div className ="col-sm-6 d-flex"> <div> <ul className ="noStyleListFooter"> <li><a className ="noDecorationFooter" href="/home">Home</a></li> <li><a className ="noDecorationFooter" href="/catalog">Catalog</a></li> <li><a className ="noDecorationFooter" href="discover">Disccover</a></li> <li><a className ="noDecorationFooter" href="developers">Developers</a></li> </ul> </div> <div> <ul className ="noStyleListFooter"> <li><a className ="noDecorationFooter" href="/policy"> Policy</a></li> <li><a className ="noDecorationFooter" href="contact">Contact Us</a></li> <li><a className ="noDecorationFooter" href="/legal">Legal</a></li> <li><a className ="noDecorationFooter" href="/signup-to-contribute">Become a contributor</a></li> </ul> </div> </div> </div> <div className ="row copyright"> <div className ="col-sm-4"> <span > Copyright 2020 Build for SDG</span> </div> <div className ="col-sm-4 d-flex"> <a className ="socialIcon" href ="twitter.com"> <img src ="images/twitter-icon.png" alt ="our-twitter-handle"/></a> <a className ="socialIcon" href ="facebook.com"><img src ="images/fb-icon.png" alt ="fb-icon"/></a> <a className ="socialIcon" href ="instagram.com"><img src ="images/insta-icon.png" alt ="insta-icon"/></a> <a className ="socialIcon" href ="youtube.com"><img src ="images/youtube-icon.png" alt ="youtube-icon"/></a> </div> </div> </React.Fragment> ); }<file_sep>/src/components/forgotPassword.js import React from "react"; import {Container} from "react-bootstrap"; import { Row} from "react-bootstrap"; import {Col} from "react-bootstrap"; import {Form} from "react-bootstrap"; import {Button} from "react-bootstrap"; import { Link } from "react-router-dom"; export default function ResetPassword (props){ return( <Container className ="onboard-bottom-margin"> <Row> <Col><h1>Reset Password</h1></Col> <Col> </Col> </Row> <Row> <Col> <Form> <Form.Group controlId="formBasicEmail" > <Form.Label srOnly>Username/Email Address</Form.Label> <Form.Control size="lg" type="email" placeholder="Username/Email Address" className = "onboard-top-margin" /> </Form.Group> <Button variant="secondary afriDataButton" size="lg" block type="submit" className ="onboard-top-margin"> Reset Password </Button> <Link to ="/login"><a href ="/login"> Back to Login</a></Link> </Form> </Col> <Col><img src ="./images/visual_data_bro.svg" alt ="login data trend"/></Col> </Row> </Container> ); } <file_sep>/src/stylesheets/homeScreen.css h1 { color: #344127; } .btn_subscripte { background: #f9d48e; font-size: 1.2rem; font-weight: 700; } .btn_subscripte:hover { background: #f9d38ee3; } .btnClr { background: #344127; color: #fff; font-size: 1.4rem; transition: 0.3s all ease-in-out; } .btnClr:hover { color: #fff; background: #344127e8; } <file_sep>/src/components/contributorDashboard.js import React from "react"; import { nav } from "react-bootstrap"; import { Link, BrowserRouter as Router, Route, Switch,Redirect } from "react-router-dom"; import { useAuth } from "../context/auth"; import "../dashboard.css"; function AsideNav(props) { const { setAuthTokens } = useAuth(); function logOut() { setAuthTokens(); return <Redirect push to={{pathname:"/login"}}/>; } return ( <nav className="asideNav col-3 px-5 pt-3" style={{ background: "#344127" }}> <div className="container text-left"> <a className="h2 text-white Aside-title" href="/"> <img src="images/onboard_menu_icon.svg" alt="" /> Open Data </a> <ul className="navbar-nav mt-5 "> <li className="nav-item active"> <Link to="/dashboard" className="nav-link h4"> <i className="fas fa-home mr-2"></i> Dashboard </Link> </li> <li className="nav-item"> <Link to="/dashboard/stats" className="nav-link h4"> <i className="fas fa-chart-line mr-2"></i> Stats </Link> </li> <li className="nav-item"> <Link to="/dashboard/information"className="nav-link h4"> <i className="fas fa-info-circle mr-2"></i> Information </Link> </li> <li className="nav-item"> <Link to="/dashboard/uploads" className="nav-link h4"> <i className="fas fa-cloud-upload-alt mr-2"></i> Uploads </Link> </li> <li className="nav-item"> <Link to="/dashboard/contactus" className="nav-link h4"> <i className="far fa-comment-alt mr-2"></i> Contact Us </Link> </li> <li className="nav-item"> <div> <input type ="button" onClick={logOut} value ="Log out" /> </div> </li> </ul> </div> </nav> ); } function Container() { return ( <main class="col-9"> <div class="container"> <header class="container d-flex justify-content-between px-0 pt-3"> <div> <Link class="nav-left nav-link text-white" to ="/dashboard/uploads"> <i class="fas fa-upload mr-2"></i>Upload Dataset </Link> </div> <ul class="nav-right d-flex navbar-nav flex-row"> <li class="nav-item px-3"> <i class="far fa-bell"></i> 2 </li> <li> <a className="border-dark btn btn-outline-light text-dark px-4 py-0" href="/" > Level 1 </a> </li> <li class="nav-item px-3"> <a href="/" class="nav-link py-0"> <img class="img-fluid rounded-circle" width="20" height="10" alt =" " src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTRMdVmNPFIXw0viVx_1ikpgYWNaEvKVPdKcg&usqp=CAU"/> <li class="nav-item pl-3 pr-1"> <a href="/" class="nav-link text-dark py-0"> <img class="img-fluid rounded-circle pr-2" width="30" height="30" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTUwjB_JQ42cHVQHw6eWFp882_4okQmwCJxPA&usqp=CAU" alt="" /> Johnvibe104 </a> </li> <li class="dropdown show nav-item px-3"> <a class="dropdown-toggle" href="/" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >action</a> <div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> <a class="dropdown-item" href="/"> Action </a> <a class="dropdown-item" href="/"> Another action </a> <a class="dropdown-item" href="/"> Something else here </a> <li class="nav-item pr-3"> <div class="dropdown mr-1"> <button type="button" class="dropdown-toggle border-0 bg-transparent" id="dropdownMenuOffset" data-toggle="dropdown" data-offset="10,20" > </button> <div class="dropdown-menu" aria-labelledby="dropdownMenuOffset"> <a class="dropdown-item" href="/"> Log in </a> <a class="dropdown-item" href="/"> Sign Up </a> </div> </div> </li> </div> </li></a> </li></ul> </header> <section class="mt-5"> <div class="card" style={{ background: "#344127" }}> <div class="card-body text-white"> <h5 class="font-weight-normal"> Welcome <NAME> <br /> <br /> We are glad to have you as a contributor to Open Data for Africa , an open source project aimed to provide data to improve Africa’s growing technology revolution. <br /> <br /> If you have any abouts how to upload your first dataset, <a class="d-inline btn_ClickHere" href="/"> click here. </a> </h5> </div> </div> </section> <section class="mt-5 text-white OdaSection"> <h1 style={{ color: "#344127" }}>Trending Categories</h1> <h5 class="py-2" style={{ color: "#344127" }}> Our recommendations of datasets that are getting most searches... </h5> <div id="recipeCarousel" class="carousel slide w-100" data-ride="carousel" > <div class="carousel-inner w-100" role="listbox"> <div class="carousel-item row no-gutters active"> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/Doctor-amico.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center"> Health Care </h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/Farmer-amico.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center"> Agriculture </h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/House_searching-bro.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center">Housing</h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/Farmer-amico.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center"> Agriculture </h5> </div> </div> </div> </div> <div class="carousel-item row no-gutters"> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/Doctor-amico.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center"> Health Care </h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/House_searching-bro.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center">Housing</h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/Farmer-amico.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center"> Agriculture </h5> </div> </div> </div> <div class="col-3 float-left"> <div class="card mb-2 mx-3"> <div class="card-body"> <img src="images/dashboard-svg/House_searching-bro.svg" alt="" class="card-img-top" /> <h5 class="card-title text-white text-center">Housing</h5> </div> </div> </div> </div> </div> <a class="carousel-control-prev" href="#recipeCarousel" role="button" data-slide="prev" > <span class="carousel-control-prev-icon" aria-hidden="true" ></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#recipeCarousel" role="button" data-slide="next" > <span class="carousel-control-next-icon" aria-hidden="true" ></span> <span class="sr-only">Next</span> </a> </div> </section> <section class="my-5"> <h1 style={{ color: "#344127" }}>ODA Digest</h1> <div class="card py-5 mt-5" style={{ background: "linear-gradient(178.18deg,rgba(249, 212, 142, 0.9) -13.56%,rgba(52, 65, 39, 0.9) -13.56%,rgba(249, 212, 142, 0.9) 158.3%)", }} > <div class="card-body text-white text-center"> <h5 class="h4"> We have decided to share our stories to the world , join us on June 01 2020 as we launch the converse conversation with <NAME> and <NAME>. </h5> <button type="button" class="btn btn-outline-light mt-3 text-white" style={{ fontSize: "25px" }} > Learn More </button> </div> </div> </section> </div> </main> ); } function Uploads(){ return ( <main class="col-9"> <div class="container"> <section class="mt-5"> <div class="card" style={{ background: "#344127" }}> <div class="card-body text-white"> <div>Upload</div> </div> </div></section> </div> </main> ); } function Stats(){ return ( <main class="col-9"> <div class="container"> <section class="mt-5"> <div class="card" style={{ background: "#344127" }}> <div class="card-body text-white"> <div>Stats</div> </div></div> </section> </div> </main> ); } function Information(){ return ( <main class="col-9"> <div class="container"> <section class="mt-5"> <div class="card" style={{ background: "#344127" }}> <div class="card-body text-white"> <div>Information</div> </div></div> </section> </div> </main> ); } function ContactUs(){ return ( <main class="col-9"> <div class="container"> <section class="mt-5"> <div class="card" style={{ background: "#344127" }}> <div class="card-body text-white"> <div>Contact Us</div> </div></div> </section> </div> </main> ); } function Dashboard(props) { return ( <div className="row"> <Router> <AsideNav /> <Switch> <Route exact path ="/dashboard/"> <Container /> </Route> <Route exact path ="/dashboard/stats"> <Stats/> </Route> <Route exact path ="/dashboard/uploads"> <Uploads/> </Route> <Route exact path ="/dashboard/contactus"> <ContactUs/> </Route> <Route exact path ="/dashboard/information"> <Information/> </Route> </Switch> </Router> </div> ); } export default Dashboard; <file_sep>/src/components/contributorSignUp.js import React, {useState} from "react"; import {Spinner,Container} from "react-bootstrap"; import { Row} from "react-bootstrap"; import {Col} from "react-bootstrap"; import {Form} from "react-bootstrap"; import {Button} from "react-bootstrap"; import {Formik} from "formik"; import * as yup from "yup"; import {Redirect} from "react-router-dom"; const schema = yup.object({ first_name: yup.string().required().min(2,"minimium of 2 characters").max(20,"maximum of 20 characters"), last_name: yup.string().required().min(2,"minimium of 2 characters").max(20,"maximum of 20 characters"), email: yup.string().email().required(), username: yup.string().required(), password1: yup.string().required().min(8,"minimium of 8 characters"), password2: yup.string().oneOf([yup.ref("password1"), null],"password must match"), town_city: yup.string().required().min(2,"minimium of 2 characters").max(20,"maximum of 20 characters"), state: yup.string().required().min(2,"minimium of 2 characters").max(20,"maximum of 20 characters"), }); export default function ContributorSignUp (props){ const [isRegistered, setRegistered] = useState(false); const [isError, setIsError] = useState(false); const [isLoading, setIsLoading] = useState(false); if(isRegistered){ return <Redirect push to = {{pathname:"/login"}} />; } else{ return( <Container className ="onboard-bottom-margin"> <Row> <Col><h1>Become a contributor</h1></Col> <Col> </Col> </Row> <Row> <Col className = "onboard-top-margin"> <Formik validationSchema={schema} onSubmit={(values, { setSubmitting }) => { setIsLoading(true); const requestOptions = { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(values)}; const corsUrl = "https://secure-ravine-92476.herokuapp.com/"; const url = "https://afrida.herokuapp.com/api/auth/registration/"; setTimeout(() => { fetch(corsUrl +url , requestOptions) .then(async (response) => { const data = await response.json(); // check for error response if (!response.ok) { // get error message from body or default to response status const error = (data && data.message) || response.status; return Promise.reject(error); } return data; }).then((data) => {setRegistered(true);}) .catch((error) => { setIsError(true); setIsLoading(false); }); setSubmitting(false); }, 10000); }} initialValues={{ }} > {({ handleSubmit, handleChange, handleBlur, values, touched, isValid, errors, isSubmitting, }) => ( <Form className="center-a-form" onSubmit={handleSubmit}> {isError && (<span className ="error-color">There was an error, try again</span>)} { isLoading && (<Spinner as="span" animation="grow" role="status" aria-hidden="true" variant="info" />)} <Form.Group controlId="formBasicFirstName" > <Form.Label srOnly> First Name</Form.Label> <Form.Control className ="form-input-box" size="lg" type="text" name ="first_name" placeholder="<NAME>" value={values.first_name} onBlur={handleBlur} onChange={handleChange} isValid={touched.first_name && !errors.first_name} /> {errors.first_name && touched.first_name && errors.first_name} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicLstName" > <Form.Label srOnly> Last Name</Form.Label> <Form.Control className ="form-input-box" size="lg" type="text" name ="last_name" placeholder="<NAME>" value={values.last_name} onBlur={handleBlur} onChange={handleChange} isValid={touched.last_name && !errors.last_name} /> {errors.last_name && touched.last_name && errors.last_name} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicEmail" > <Form.Label srOnly>Email Address</Form.Label> <Form.Control size="lg" type="email" name="email" placeholder="Email Address" className = "onboard-top-margin" value={values.email} onBlur={handleBlur} onChange={handleChange} isValid={touched.email && !errors.email}/> {errors.email && touched.email && errors.email } <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicUserName" > <Form.Label srOnly> Username </Form.Label> <Form.Control size="lg" type="text" name="username" placeholder="Username" className = "onboard-top-margin" value={values.username} onBlur={handleBlur} onChange={handleChange} isValid={touched.username && !errors.username} /> {errors.username && touched.username && errors.username} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicPassword" > <Form.Label srOnly> Password </Form.Label> <Form.Control size="lg" type="password" name ="password1" placeholder="<PASSWORD>" className = "onboard-top-margin " value={values.password1} onBlur={handleBlur} onChange={handleChange} isValid={touched.password1 && !errors.password1}/> {errors.password1 && touched.password1 && errors.password1} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicConfirmPassword" > <Form.Label srOnly> Confirm Password</Form.Label> <Form.Control size="lg" type="password" name ="password2" placeholder="<PASSWORD>" className = "onboard-top-margin" value ={values.password2} onBlur ={handleBlur} onChange ={handleChange}/> {errors.password2 && (<div>{errors.password2}</div>)} </Form.Group> <Form.Group controlId="formBasicCity" > <Form.Label srOnly>City/Town</Form.Label> <Form.Control className ="form-input-box" size="lg" type="text" name ="town_city" placeholder="City or Town" value={values.town_city} onBlur={handleBlur} onChange={handleChange} isValid={touched.town_city && !errors.town_city} /> {errors.town_city && touched.town_city && errors.town_city} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicState" > <Form.Label srOnly>State</Form.Label> <Form.Control className ="form-input-box" size="lg" type="text" name ="state" placeholder="State" value={values.state} onBlur={handleBlur} onChange={handleChange} isValid={touched.state && !errors.state} /> {errors.state && touched.state && errors.state} <Form.Control.Feedback></Form.Control.Feedback> </Form.Group> <Form.Group controlId="formBasicCountry" > <Form.Label srOnly>State</Form.Label> <select name="country" value={values.country} onChange={handleChange} onBlur={handleBlur} style={{ display: "block" }} > <option value="" label="Select a country" /> <option value="algeria" label="Algeria"/> <option value="angola" label="Angola"/> <option value="benin" label="Benin"/> <option value="botswana" label="Botswana"/> <option value="burkina Faso" label="Burkina Faso"/> <option value="burundi" label="Burundi"/> <option value="cameroon" label="Cameroon"/> <option value="cape-verde" label="Cape Verde"/> <option value="central-african-republic" label="Central African Republic"/> <option value="chad" label="Chad"/> <option value="comoros" label="Comoros"/> <option value="congo-brazzaville" label="Congo - Brazzaville"/> <option value="congo-kinshasa" label="Congo - Kinshasa"/> <option value="ivory-coast" label="Côte d’Ivoire"/> <option value="djibouti" label="Djibouti"/> <option value="egypt" label="Egypt"/> <option value="equatorial-guinea" label="Equatorial Guinea"/> <option value="eritrea" label="Eritrea"/> <option value="ethiopia" label="Ethiopia"/> <option value="gabon" label="Gabon"/> <option value="gambia" label="Gambia"/> <option value="ghana" label="Ghana"/> <option value="guinea" label="Guinea"/> <option value="guinea-bissau" label="Guinea-Bissau"/> <option value="kenya" label="Kenya"/> <option value="lesotho" label="Lesotho"/> <option value="liberia" label="Liberia"/> <option value="libya" label="Libya"/> <option value="madagascar" label="Madagascar"/> <option value="malawi" label="Malawi"/> <option value="mali" label="Mali"/> <option value="mauritania" label="Mauritania"/> <option value="mauritius" label="Mauritius"/> <option value="mayotte" label="Mayotte"/> <option value="morocco" label="Morocco"/> <option value="mozambique" label="Mozambique"/> <option value="namibia" label="Namibia"/> <option value="niger" label="Niger"/> <option value="nigeria" label="Nigeria"/> <option value="rwanda" label="Rwanda"/> <option value="reunion" label="Réunion"/> <option value="saint-helena" label="Saint Helena"/> <option value="senegal" label="Senegal"/> <option value="seychelles" label="Seychelles"/> <option value="sierra-leone" label="Sierra Leone"/> <option value="somalia" label="Somalia"/> <option value="south-africa" label="South Africa"/> <option value="sudan" label="Sudan"/> <option value="south-sudan" label="Sudan"/> <option value="swaziland" label="Swaziland"/> <option value="Sao-tome-príncipe" label="São Tomé and Príncipe"/> <option value="tanzania"label="Tanzania"/> <option value="togo" label="Togo"/> <option value="tunisia" label="Tunisia"/> <option value="uganda" label="Uganda"/> <option value="western-sahara" label="Western Sahara"/> <option value="zambia" label="Zambia"/> <option value="zimbabwe" label="Zimbabwe"/> </select> {errors.country && touched.country && <div className="input-feedback"> {errors.country} </div>} </Form.Group> <Button variant="secondary afriDataButton " size="lg" block type="submit" className ="onboard-top-margin" disabled={isSubmitting}> Register </Button> </Form> )} </Formik> </Col> <Col><img src ="./images/Data_Trends_bro_1.svg" alt ="data trend"/></Col> </Row> </Container> ); }}<file_sep>/README.old.md # team-101-frontend [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d4666a69ff0a4b418f710f23973d7041)](https://app.codacy.com/gh/BuildForSDGCohort2/team-101-frontend?utm_source=github.com&utm_medium=referral&utm_content=BuildForSDGCohort2/team-101-frontend&utm_campaign=Badge_Grade_Settings) This project uses React framework.
618cff9b31dc2f361225eddaf85869250342d1f6
[ "Markdown", "JavaScript", "CSS" ]
6
Markdown
BuildForSDGCohort2/team-101-frontend
983407857967f0fe7dbfe3da2756528a5a0f7b18
ed0af1c20521ec0b0dab0ca040012e3d6f0e8556
refs/heads/main
<file_sep># myStudy 学习记录专用
fc9e43215b401aa5b2b2f8f7f3db8e14531b89eb
[ "Markdown" ]
1
Markdown
whereCome/myStudy
692cbd1639a6faaadfdf86b682e374468d2fdfa5
8a9bc8e7989f8e4a7232f5468b113aa2e3d66059
refs/heads/master
<repo_name>dracobk201/CopaTresMagos<file_sep>/Assets/Scripts/Cedric.cs using UnityEngine; using System.Collections; using System.Collections.Generic; public class Cedric : MonoBehaviour { public GenerateMaze maze; public Punto2D posicionCedric; Rigidbody rb; struct PosicionMapa { public Punto2D posicion; public List<Punto2D> camino; public override string ToString() { return posicion.ToString(); } } bool[,] visitados; int[] desplazamientosX = new int[] { 1, 0, -1, 0 }; int[] desplazamientosY = new int[] { 0, 1, 0, -1 }; /// <summary> /// Contiene la ruta (secuencia de puntos) de cedric hacia la copa. /// </summary> List<Punto2D> caminoACopa; /// <summary> /// Índice que representa la casilla actual de cedric dentro de su ruta. /// </summary> int casillaActual = -1; bool moviendo; void Start() { moviendo = false; caminoACopa = new List<Punto2D>(); rb = GetComponent<Rigidbody>(); StartCoroutine(MoverCedric()); } public Punto2D GetPosicionCedric() { return posicionCedric; } // Update is called once per frame void Update () { if (!moviendo) { return; } } /// <summary> /// Co-rutina que traslada a cedric hacia copa. /// </summary> /// <returns></returns> IEnumerator MoverCedric() { while (true) { if (!moviendo || caminoACopa.Count < 2) { yield return null; continue; } if (casillaActual >= caminoACopa.Count || caminoACopa.Count == 0) { if (caminoACopa.Count == 0) { Debug.Log("CalcularRuta dentro de mover"); CalcularRuta(posicionCedric, maze.copaPos); if (caminoACopa.Count == 0) { yield return null; continue; } } yield return null; continue; } yield return new WaitForSeconds(0.25f); if (casillaActual >= caminoACopa.Count) { Debug.LogError("index fuera del rango " + casillaActual + " ; " + caminoACopa.Count); yield return null; continue; } Punto2D posicionAnterior = posicionCedric; Punto2D posicionNueva = caminoACopa[casillaActual]; casillaActual++; if (posicionNueva.x == maze.copaPos.x && posicionNueva.y == maze.copaPos.y) { SetPosicionCedric(posicionNueva.x, posicionNueva.y); moviendo = false; //aqui. GameMaster.instance.winCondition = 2; //<NAME> yield return null; continue; } maze.moverJugador(posicionAnterior, posicionNueva, 4); SetPosicionCedric(posicionNueva.x, posicionNueva.y); if (casillaActual >= caminoACopa.Count) { break; } } yield return null; } /// <summary> /// Devuelve true si no existe camino de cedric a la copa. /// </summary> /// <returns></returns> public bool isNoHayCamino() { return caminoACopa.Count == 0; } /// <summary> /// Dada una posición x,y se devuelve true si esta posición está contenida /// en el camino de cedric a la copa. /// </summary> /// <param name="nuevaPared">La posición x,y a verificar</param> /// <returns>True si hay que recalcular la ruta de cedric hacia la copa.</returns> public bool isDebemosRecalcularRuta(Punto2D nuevaPared) { if (caminoACopa.Count == 0) return true; for (int i = casillaActual; i < caminoACopa.Count; i++) { if (caminoACopa[i].x == nuevaPared.x && caminoACopa[i].y == nuevaPared.y) return true; } return false; } public void SetPosicionCedric(int x, int y) { posicionCedric.x = x; posicionCedric.y = y; transform.position = new Vector3(x, 0, y); } /// <summary> /// Este método es usado para calcular la ruta de cedric a la copa. /// </summary> /// <param name="posicionIncial">Posición actual de Cedric</param> /// <param name="copa">Posición de la copa.</param> public void CalcularRuta(Punto2D posicionIncial, Punto2D copa) { moviendo = false; DoBFS(posicionIncial.x, posicionIncial.y, copa.x, copa.y); casillaActual = 0; //SetPosicionCedric(posicionIncial.x, posicionIncial.y); Debug.Log("longitud camino " + caminoACopa.Count); //for (int i = 0; i < caminoACopa.Count; i++) //{ // Debug.Log("punto " + caminoACopa[i]); //} moviendo = true; } /// <summary> /// Algoritmo de búsqueda en anchura para calcular el primer camino más corto hacia la copa. /// </summary> /// <param name="x">Posición x inicial</param> /// <param name="y">Posición y inicial</param> /// <param name="posCopaX">Posición x de la copa</param> /// <param name="posCopaY">Posición y de la copa</param> private void DoBFS(int x, int y, int posCopaX, int posCopaY) { visitados = new bool[maze.n, maze.m]; Queue<PosicionMapa> q = new Queue<PosicionMapa>(); PosicionMapa posInicial = new PosicionMapa(); posInicial.posicion.x = x; posInicial.posicion.y = y; posInicial.camino = new List<Punto2D>(); posInicial.camino.Add(new Punto2D(x, y)); visitados[x, y] = true; q.Enqueue(posInicial); while (q.Count > 0) { PosicionMapa posActual = q.Dequeue(); //Debug.LogWarning("recorriendo pos " + posActual); if (posActual.posicion.x == posCopaX && posActual.posicion.y == posCopaY) { //Enconttramos el camino a al copa. Guardamos la ruta. caminoACopa = new List<Punto2D>(posActual.camino); return; } //Se recorren las 4 posibilidades a partir de una posición. for (int i = 0; i < 4; i++) { int nuevoX = posActual.posicion.x + desplazamientosX[i]; int nuevoY = posActual.posicion.y + desplazamientosY[i]; if (nuevoX >= 0 && nuevoX < maze.n && nuevoY >= 0 && nuevoY < maze.m) //Validamos si la nueva posicion es válida { //if ((maze.muros[nuevoX, nuevoY] == 0 || maze.muros[nuevoX, nuevoY] == 2) && !visitados[nuevoX, nuevoY]) if ((maze.muros[nuevoX, nuevoY] != 1) && !visitados[nuevoX, nuevoY])//Si la posición está libre y no la hemos procesado entonces la encolamos. { visitados[nuevoX, nuevoY] = true; PosicionMapa nuevaPos = new PosicionMapa(); nuevaPos.posicion.x = nuevoX; nuevaPos.posicion.y = nuevoY; nuevaPos.camino = new List<Punto2D>(posActual.camino); nuevaPos.camino.Add(nuevaPos.posicion); q.Enqueue(nuevaPos); } } } } caminoACopa.Clear(); } } <file_sep>/Assets/Scripts/GenerateMaze.cs using UnityEngine; using UnityEngine.UI; using System.Collections; public class GenerateMaze : MonoBehaviour { public Cedric cedric; public controller harryPower; public int n, m, x, z, cubos; bool copaCreada, cedricBool,MazeRunner; bool muestra = true; float t; [HideInInspector] /// <summary> /// Representa el mapa de tamaño n x m. Los valores posibles /// para cada casilla son /// 0 = espacio libre /// 1 = pared /// 2 = copa /// 3 = HP /// 4 = Cedric /// </summary> public int[,] muros; public Punto2D copaPos; [HideInInspector] public GameObject[,] murosGameObjects; public int posicionCopaX, posicionCopaY; bool[,] visitados; int[] desplazamientosX = new int[] { 1, 0, -1, 0 }; int[] desplazamientosY = new int[] { 0, 1, 0, -1 }; public GameObject copaGameObject; public Material wallTexture; //Esto era para usar los inputfield del canvas //public GameObject nMaze; //public GameObject mMaze; //public GameObject tMaze; [HideInInspector] public string nMaze = "10"; [HideInInspector] public string mMaze = "10"; [HideInInspector] public string tMaze = "0"; // Use this for initialization private void Awake () { GameMaster.instance.canvas = GameObject.FindGameObjectWithTag ("UI"); } // Update is called once per frame private void Update () { if (Input.GetKeyDown (KeyCode.E) && !MazeRunner) { Asignaciones (); CrearLaberinto (); Punto2D posicionCopa = getPosicionAleatoriayLibre(); Debug.Log(" posicionCopa " + posicionCopa); muros[posicionCopa.x, posicionCopa.y] = 2; copaGameObject.transform.position = new Vector3 (posicionCopa.x, 0, posicionCopa.y); //Posicion de Harry Punto2D posicionHarry = getPosicionAleatoriayLibre(); Debug.Log(" posicionHarry " + posicionHarry); muros[posicionHarry.x, posicionHarry.y] = 3; harryPower.SetPosicion(posicionHarry.x, posicionHarry.y); Punto2D posicionCedric = getPosicionAleatoriayLibre (); Debug.Log (" posicionCedric " + posicionCedric); cedric.SetPosicionCedric(posicionCedric.x, posicionCedric.y); muros[posicionCedric.x, posicionCedric.y] = 4; copaPos = posicionCopa; cedric.CalcularRuta (posicionCedric, posicionCopa); StartCoroutine(Evolucion()); } } /// <summary> /// Obtiene una posicion dentro del mapa de forma aleatoria. /// </summary> /// <returns>Una posición 2D.</returns> Punto2D getPosicionAleatoria() { Punto2D punto = new Punto2D(); punto.x = Random.Range(0, n); punto.y = Random.Range(0, m); return punto; } /// <summary> /// Devuelve si la coordenada x y está dentro de /// las coordenadas del mapa /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public bool isDentroDelMapa(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; } /// <summary> /// Devuelve verdadero si la posición x y está libre. /// (es decir cualquier cosa que no sea una pared) /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public bool isPosicionLibre(int x, int y) { return muros[x, y] != 1; //return muros[x, y] == 0; } /// <summary> /// Obtiene una posicion dentro del mapa de forma aleatoria. /// </summary> /// <returns>Una posición 2D.</returns> Punto2D getPosicionEvolucion() { Punto2D punto = getPosicionAleatoria(); while (muros[punto.x, punto.y] != 0 && muros[punto.x, punto.y] != 1) { punto = getPosicionAleatoria(); } return punto; } /// <summary> /// Obtiene una posicion dentro del mapa de forma aleatoria. /// </summary> /// <returns>Una posición libre.</returns> Punto2D getPosicionAleatoriayLibre() { Punto2D punto = getPosicionAleatoria(); while (muros[punto.x, punto.y] != 0) { punto = getPosicionAleatoria(); } return punto; } /// <summary> /// Mueve un jugador de una posición a otra. /// </summary> /// <param name="posicionAnterior">Posición actual.</param> /// <param name="posicionNueva">Posición nueva.</param> /// <param name="tipoJugador">Indicar si es Harry o Cedric</param> public void moverJugador(Punto2D posicionAnterior, Punto2D posicionNueva, int tipoJugador) { muros[posicionAnterior.x, posicionAnterior.y] = 0; muros[posicionNueva.x, posicionNueva.y] = tipoJugador; } /// <summary> /// Devuelve una permutación de direcciones de forma aleatoria, a partir de 4 /// coordenadas (Este, Sur, Oeste, Norte). /// </summary> /// <returns>El arreglo de direcciones</returns> int[] permutarDirecciones() { int[] direcciones = new int[] { 0, 1, 2, 3 };//ESTE, SUR, OESTE, NORTE for (int i = 0; i < 3; i++) { int temp = direcciones[i]; int numeroRandom = Random.Range(0, 4); //Hacer un shuffle. direcciones[i] = direcciones[numeroRandom]; direcciones[numeroRandom] = temp; } return direcciones; } private void CrearLaberinto() { // Se inicializa el mapa. // Se asume que el mapa está lleno de paredes. for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { visitados[i, j] = false; muros[i, j] = 1; } } //Se genera el laberinto a partir de la posicion 0, 0 muros[0, 0] = 0; visitados[0, 0] = true; DoDFS(0, 0); x = 0; z = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { string name = "cube" + i + "-" + j; if (muros[i, j] == 1) // Si es una pared añade un cubo. { GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.transform.position = new Vector3(0 + x, 0, 0 + z); cube.transform.localScale = new Vector3(1, 3, 1); cube.AddComponent<BoxCollider>(); cube.GetComponent<Renderer>().material = wallTexture; cube.name = name; murosGameObjects[i, j] = cube; cubos++; } z++; } z = 0; x++; } } /// <summary> /// Método que se encarga de generar un laberinto usando un recorrido en profundidad /// (DFS). Inicialmente el mapa está lleno de paredes y a partir de una posición se abrirá camino progresivamente, /// con cada cada llamada al método. /// /// Dada una posición x,y se verifica con sus 4 puntos cardinales si se puede crear un nuevo camino hacia esa /// nueva dirección. En caso de ser válido se invoca nuevamente al método con esta nueva coordenada. /// /// Estos 4 puntos cardinales son tomados de forma aleatoria en vez de tomar siempre el mismo patrón. /// </summary> /// <param name="x">Coordenada x dentro del mapa</param> /// <param name="y">Coordenada y dentro del mapa</param> private void DoDFS(int x, int y) { int n2 = n; int m2 = m; int[] direcciones = permutarDirecciones(); for (int i = 0; i < direcciones.Length; i++) { int nuevoX = x + desplazamientosX[direcciones[i]]; int nuevoY = y + desplazamientosY[direcciones[i]]; int nuevoX_2 = x + desplazamientosX[direcciones[i]] * 2; int nuevoY_2 = y + desplazamientosY[direcciones[i]] * 2; //Aca se verifica que la nueva posicion sea válida (se encuentre dentro de los límites del mapa). if (nuevoX >= 0 && nuevoX < n2 && nuevoY >= 0 && nuevoY < m2 && nuevoX_2 >= 0 && nuevoX_2 < n2 && nuevoY_2 >= 0 && nuevoY_2 < m2) { if (!visitados[nuevoX_2, nuevoY_2]) // Se verifica que la nueva posición no haya sido visitada/procesada, para evitar ciclos en el recorrido. { muros[nuevoX, nuevoY] = 0; muros[nuevoX_2, nuevoY_2] = 0; visitados[nuevoX, nuevoY] = true; visitados[nuevoX_2, nuevoY_2] = true; //Se invoca recursivamente a la función. DoDFS(nuevoX_2, nuevoY_2); } } } } /// <summary> /// Método que permite modificar los parámetros de entrada. /// </summary> void OnGUI() { if (muestra) { nMaze = GUI.TextField (new Rect (5, 40, 35, 20), nMaze, 3); mMaze = GUI.TextField (new Rect (5, 200, 35, 20), mMaze, 3); tMaze = GUI.TextField (new Rect (5, 364, 35, 20), tMaze, 3); } } /// <summary> /// Co-rutina para evolucionar el mapa de forma aleatoria. /// </summary> /// <returns></returns> IEnumerator Evolucion() { while (true) { //Después de cada t segundos intercambiar una pared por un piso o viceversa. yield return new WaitForSeconds(t); Punto2D punto = getPosicionEvolucion(); if (muros[punto.x, punto.y] == 0) { //se genera una pared. string name = "cube" + punto.x + "-" + punto.y; GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.transform.position = new Vector3(punto.x, 0, punto.y); cube.transform.localScale = new Vector3(1, 3, 1); cube.AddComponent<BoxCollider>(); cube.GetComponent<Renderer>().material = wallTexture; cube.name = name; murosGameObjects[punto.x, punto.y] = cube; muros[punto.x, punto.y] = 1; if (cedric.isDebemosRecalcularRuta(punto)) { //Si la pared está en el recorrido de cedric debemos recalcular su camino mínimo. Debug.LogError("recalculando..."); cedric.CalcularRuta(cedric.GetPosicionCedric(), copaPos); } } else if (muros[punto.x, punto.y] == 1) { //se elimina una pared. Destroy(murosGameObjects[punto.x, punto.y]); muros[punto.x, punto.y] = 0; if (cedric.isNoHayCamino()) { cedric.CalcularRuta(cedric.GetPosicionCedric(), copaPos); } } } } void Asignaciones(){ //Esto era para usar los InputField del canvas /*n = int.Parse(nMaze.GetComponent<Text> ().text); m = int.Parse(mMaze.GetComponent<Text> ().text); n = int.Parse(tMaze.GetComponent<Text> ().text);*/ n = int.Parse(nMaze); m = int.Parse(mMaze); t = float.Parse(tMaze); muros = new int[n + 1, m + 1]; visitados = new bool[n, m]; murosGameObjects = new GameObject[n, m]; muestra = false; MazeRunner = true; GameMaster.instance.canvas.SetActive (false); } } public struct Punto2D { public int x, y; public Punto2D(int _x, int _y) { x = _x; y = _y; } public override string ToString() { return "x: " + x + "; y: " + y; } }<file_sep>/Assets/Scripts/GameMaster.cs using UnityEngine; using UnityEngine.UI; using System.Collections; public class GameMaster : MonoBehaviour { private static GameMaster _instance; #region imagenes public Sprite Cedric; public Sprite Harry; public Sprite Copa; #endregion #region GameObject public GameObject[] textosCanvas = new GameObject[5]; public GameObject canvas; public int winCondition = 0; //0: EN juego, 1: <NAME>, 2: <NAME> #endregion public static GameMaster instance { get { //If _instance hasn't been set yet, we grab it from the scene! //This will only happen the first time this reference is used. if (_instance == null) _instance = GameObject.FindObjectOfType<GameMaster>(); return _instance; } } private void Start() { canvas.GetComponentInChildren<Image>().sprite = Copa; Time.timeScale = 1f; } private void LateUpdate() { if (winCondition != 0) { Time.timeScale = 0f; canvas.SetActive(true); textosCanvas[0].SetActive(false); textosCanvas[1].SetActive(false); textosCanvas[2].SetActive(false); textosCanvas[3].SetActive(false); if (winCondition == 1) { canvas.GetComponentInChildren<Image>().sprite = Harry; textosCanvas[4].SetActive(true); textosCanvas[4].GetComponent<Text>().text = "Harry toca la copa, es un traslador, se lo lleva a un cementerio y Voldemort le trollea la victoria."; } else if (winCondition == 2) { canvas.GetComponentInChildren<Image>().sprite = Cedric; textosCanvas[4].SetActive(true); textosCanvas[4].GetComponent<Text>().text = "Ceric toca la copa, es un traslador, se lo lleva a un cementerio y Voldemort lo mata. Que conveniente."; } } } } <file_sep>/Assets/Scripts/controller.cs using UnityEngine; using System.Collections; public class controller : MonoBehaviour { public GenerateMaze maze; Vector3 positionActual; //public static float paso = .1f; Rigidbody rb; void Start () { rb = GetComponent<Rigidbody> (); } public void SetPosicion(int x, int y) { transform.position = new Vector3(x, 0, y); } // Update is called once per frame void Update () { int paso = 1; positionActual = this.transform.position; Vector3 positionNueva; Punto2D nuevaPosMapa; Punto2D posActualMapa = new Punto2D((int)positionActual.x, (int)positionActual.z); //Las teclas para mover a Harry en sus 4 coordenadas son D,A,W,S //Para cada coordenada se verifica si está dentro del mapa y si existe una posición libre. if (Input.GetKeyDown(KeyCode.D)) { positionNueva = new Vector3(positionActual.x + paso, positionActual.y, positionActual.z); nuevaPosMapa.x = (int)positionNueva.x; nuevaPosMapa.y = (int)positionNueva.z; if (maze.isDentroDelMapa(nuevaPosMapa.x, nuevaPosMapa.y) && maze.isPosicionLibre(nuevaPosMapa.x, nuevaPosMapa.y)) { maze.moverJugador(posActualMapa, nuevaPosMapa, 3); this.transform.position = positionNueva; } } if (Input.GetKeyDown(KeyCode.A)) { positionNueva = new Vector3(positionActual.x - paso, positionActual.y, positionActual.z); nuevaPosMapa.x = (int)positionNueva.x; nuevaPosMapa.y = (int)positionNueva.z; if (maze.isDentroDelMapa(nuevaPosMapa.x, nuevaPosMapa.y) && maze.isPosicionLibre(nuevaPosMapa.x, nuevaPosMapa.y)) { maze.moverJugador(posActualMapa, nuevaPosMapa, 3); this.transform.position = positionNueva; } } if (Input.GetKeyDown(KeyCode.W)) { positionNueva = new Vector3(positionActual.x, positionActual.y, positionActual.z + paso); nuevaPosMapa.x = (int)positionNueva.x; nuevaPosMapa.y = (int)positionNueva.z; if (maze.isDentroDelMapa(nuevaPosMapa.x, nuevaPosMapa.y) && maze.isPosicionLibre(nuevaPosMapa.x, nuevaPosMapa.y)) { maze.moverJugador(posActualMapa, nuevaPosMapa, 3); this.transform.position = positionNueva; } } if (Input.GetKeyDown(KeyCode.S)) { positionNueva = new Vector3(positionActual.x, positionActual.y, positionActual.z - paso); nuevaPosMapa.x = (int)positionNueva.x; nuevaPosMapa.y = (int)positionNueva.z; if (maze.isDentroDelMapa(nuevaPosMapa.x, nuevaPosMapa.y) && maze.isPosicionLibre(nuevaPosMapa.x, nuevaPosMapa.y)) { maze.moverJugador(posActualMapa, nuevaPosMapa, 3); this.transform.position = positionNueva; } } //float velo = (transform.position - positionActual).magnitude / Time.deltaTime; //Debug.LogWarning("velo " + velo); } void LateUpdate() { ControlesEscena(); } void OnTriggerEnter(Collider other) { if (other.CompareTag("Copa")) { GameMaster.instance.winCondition = 1; } } private void ControlesEscena() { if (Input.GetKeyDown(KeyCode.Escape)) Application.Quit(); if (Input.GetKeyDown(KeyCode.P)) Application.LoadLevel("Maze"); } }
e68a4bedb727ca2996fcbd307805610e51b9392c
[ "C#" ]
4
C#
dracobk201/CopaTresMagos
4916db35178ee1e582784224b31bd4bb664cdcd6
dd5388d01ff5aabc013aa42fe11758522fac7175
refs/heads/master
<file_sep>PHPchallenges ============= A collection of PHP challenges. <file_sep><?php // Count Words in a String – Counts the number of individual words in a string. For added complexity read these strings in from a text file and generate a summary. class WordCounter { public function countWords($string) { $wordArray = explode(' ', $string); $wordCount = 0; for ($i = 0; $i < count($wordArray); $i++) { // repeated spaces can cause empty array elements .. lets make sure we are not just looking at empty space if (strlen(preg_replace('/\s+/u','',$wordArray[$i])) !== 0) { $wordCount++; } } echo "The sentence " . $string . " has " . $wordCount . " words.<br>"; } } $wordCounter = new WordCounter(); $wordCounter->countWords('How many words are there in this sentence?'); $wordCounter->countWords('How man?'); ?>
2cd6fd5ee12abbe7688352154c52bd4e890a426e
[ "Markdown", "PHP" ]
2
Markdown
kristansmith/PHPchallenges
88ff0f6e13a1ad5ade57073c802dccb782dabe73
75395d7a3bfc4890de346521b9730ddce0239483
refs/heads/master
<repo_name>heroseven/proyectos-php-js<file_sep>/JVS11/index.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>JV Software | Tutorial 11</title> <script src="http://js.pusherapp.com/1.9/pusher.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script> $(function(){ var pusher = new Pusher('02b3ba8ad0fef8e1414d'); var canal = pusher.subscribe('canal_prueba'); canal.bind('nuevo_comentario', function(respuesta){ $('#comentarios').append('<li>' + respuesta.mensaje + '</li>'); }); $('form').submit(function(){ $.post('ajax.php', { msj : $('#input_mensaje').val(), socket_id : pusher.connection.socket_id }, function(respuesta){ $('#comentarios').append('<li>' + respuesta.mensaje + '</li>'); }, 'json'); return false; }); }); </script> </head> <body> <form action="" method="post"> <input type="text" id="input_mensaje" /> <input type="submit" class="submit" value="Enviar" /> </form> <ul id="comentarios"> <!-- Comentarios aqui! --> </ul> </body> </html>
aaa3a7fd41c988601794d1bb2fb5d930e4c502d7
[ "Hack" ]
1
Hack
heroseven/proyectos-php-js
eb4c3d61ba46d3d19790a734e6f41788336db3e8
72e302d2e4ad7af067b1772c416e754ec198a7e8
refs/heads/master
<repo_name>blochbr/my-collect-001-prework-web<file_sep>/lib/my_collect.rb def my_collect(collection) counter = 0 new_array = [] while counter != collection.length yield(new_array[counter] = collection[counter].upcase) counter += 1 end return new_array end
80b694a8991fb0033488ce28d5742c683bd3df91
[ "Ruby" ]
1
Ruby
blochbr/my-collect-001-prework-web
5fa1bad19b5babe4858659e077f55aa46ede185f
b8d37800f3ccb55b63a48cc1fa8aaffb213e23b5
refs/heads/master
<repo_name>tarks12/TERYKS<file_sep>/README.md # TERYKS
af22e03a60b93f7e7bb75a3b20be0896bf70c47f
[ "Markdown" ]
1
Markdown
tarks12/TERYKS
5b4325efc150db9448ca205f0f3e6ab4566a69f6
051af2c90511e002198713a0c3c3a5a55ddcbba0
refs/heads/master
<file_sep># youtube_live_chat_scrapper Simple script to fetch live youtube chats without using youtube API. <file_sep>import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import pandas as pd chromeOptions = webdriver.ChromeOptions() chromeOptions.add_argument('--headless') browser=webdriver.Chrome(options = chromeOptions, executable_path = r'/home/aashutosh/Documents/webScrapingStuffs/chr webdriver/chromedriver') time.sleep(4) i =0 comments = [] while True: try: browser.get('https://www.youtube.com/watch?v=smZRzehsXHA') time.sleep(1) browser.switch_to.frame(browser.find_element_by_css_selector('iframe[id*="chatframe"]')) result = browser.find_elements_by_xpath('//*[@id="message"]') for r in result: print(str(i) + ' ' +r.text) comments.append(r.text) i=i+1 # print('loop ended-----------------------------------------') df = pd.DataFrame(comments) df.to_csv('comments2.csv' , mode = 'a' , header = False) browser.switch_to.default_content() except exception as e: pass
856650e1f68b6bd2d97d40a50a174e711ff8d2f6
[ "Markdown", "Python" ]
2
Markdown
ashd32/youtube_live_chat_scrapper
fdf56da59af912bcdea35ef0f7f08a44bbc57d17
f0c3c128790c88d2f3e7fc43cba28dcac1c0412e
refs/heads/master
<file_sep>Javelin-Android =============== Javelin Client for Android <file_sep>./gradlew clean asDebug cp app/build/outputs/aar/app-debug.aar ../app-android-studio/ts-javelin/ts-javelin.aar
5a5d2cead6f19e8383e9c683588c4837f0da0f41
[ "Markdown", "Shell" ]
2
Markdown
Tapshield2016/TapShield-Safety-Application
ef110fe7c19a25b01da6f048696ca5018767fdef
e1d5ac459063f8f6de099fe68ebef9db06ff1863
refs/heads/master
<repo_name>bajju/Instagram-Automation-to-check-followers-unfollowers-using-Selenium-drivers<file_sep>/Instagram.py from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from time import sleep from pas import Password class InstaBot: def __init__(self,username,password): self.driver = webdriver.Chrome(ChromeDriverManager().install()) self.driver.get("https://www.instagram.com/") sleep(2) self.driver.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[2]/div/label/input').send_keys(username) self.driver.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[3]/div/label/input').send_keys(password) self.driver.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[4]').click() sleep(4) self.driver.find_element_by_xpath('/html/body/div[4]/div/div/div[3]/button[2]').click() self.driver.find_element_by_xpath('//*[@id="react-root"]/section/nav/div[2]/div/div/div[3]/div/div[5]/a/img').click() sleep(4) self.get_unfollowers() def get_unfollowers(self): self.driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[3]/a').click() following = self.get_names() self.driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[2]/a').click() followers = self.get_names() notfollowing= [user for user in following if user not in followers] followingfollowers= [user for user in followers if user not in following] print(len(notfollowing)) print(notfollowing) print(len(followingfollowers)) print(followingfollowers) def get_names(self): sleep(1) sugs= self.driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/ul/div') self.driver.execute_script('arguments[0].scrollIntoView()',sugs) sleep(1) last_ht,ht =0,1 while last_ht!=ht: last_ht=ht sleep(1) scrollbox= self.driver.find_element_by_xpath('/html/body/div[4]/div/div[2]') ht= self.driver.execute_script(""" arguments[0].scrollTo(0, arguments[0].scrollHeight); return arguments[0].scrollHeight; """,scrollbox) links = self.driver.find_elements_by_class_name('FPmhX') names=[] for name in links: names.append(name.text) self.driver.find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/button').click() return names #Enter username and password ''' InstaBot("Username","<PASSWORD>") '''
4bb29f8cce4169bc207018472719bbd1e7a5e64d
[ "Python" ]
1
Python
bajju/Instagram-Automation-to-check-followers-unfollowers-using-Selenium-drivers
e42e0bd753706b22d2782d5b3486648b7ad6f42a
23eab04a8ee219521f9718049981ba368ff298a8
refs/heads/master
<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.GstViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> </div> @using(Html.BeginForm("UploadAnswer","GstScan",FormMethod.Post,new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <div class="row"> <h3>Scan Answers</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label ">Answer Desciprion</label> <input type="text" class="form-control" name="description" id="description" /> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="control-label ">File</label> <input type="file" class="form-control" name="file" id="file2" /> </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Saved" class="btn btn-default" /> </div> </div> </div> </div> } </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.CourseViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script> $(document).ready(function() { $("#divDepartmentOption").hide(); var level = $("#course_Level_Id").val(); var DepartmentOption = $("#course_DepartmentOption_Id").val(); if (level > 2 && DepartmentOption > 0) { $("#divDepartmentOption").show(); } //Hide Department Option on Department change $("#course_Department_Id").change(function() { $("#divDepartmentOption").hide(); }); //Load Department Option $("#course_Level_Id").change(function() { var department = $("#course_Department_Id").val(); var level = $("#course_Level_Id").val(); //var programme = "3"; var programme= $('#course_Programme_Id').val(); //if (level > 2) { $("#course_DepartmentOption_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: department, programmeid: programme }, success: function(departmentOptions) { if (departmentOptions == "" || departmentOptions == null || departmentOptions == undefined) { $("#divDepartmentOption").hide(); } else { $("#course_DepartmentOption_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function(i, Option) { $("#course_DepartmentOption_Id").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); if (programme == 1 || programme > 2) { $("#divDepartmentOption").show(); } } }, error: function(ex) { alert('Failed to retrieve department Options.' + ex); } }); //} }); }) </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="row"> <h3>View Departmental Courses</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Programme.Id, "Programme", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Department.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Level.Id, "Level", new {@class = "control-label"}) @Html.DropDownListFor(model => model.course.Level.Id, (IEnumerable<SelectListItem>) ViewBag.levels, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group"> @Html.LabelFor(model => model.course.DepartmentOption.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.DepartmentOption.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentOptionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.DepartmentOption.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="View" class="btn btn-default" /> </div> </div> </div> </div> } <br /> @if (Model != null) { using (Html.BeginForm("SaveCourseChanges", "Courses/SaveCourseChanges", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> <h4>First Semester</h4> @if (Model.firstSemesterCourses != null) { <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Code</th> <th>Course Title</th> <th>Course Unit</th> <th>Course TYpe</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.firstSemesterCourses.Count; i++) { <tr> <td>@Html.TextBoxFor(model => model.firstSemesterCourses[i].Code, new {@class = "form-control olevel"})</td> <td>@Html.TextBoxFor(model => model.firstSemesterCourses[i].Name, new {@class = "form-control olevel"})</td> <td>@Html.TextBoxFor(model => model.firstSemesterCourses[i].Unit, new {@class = "form-control olevel"})</td> <td>@Html.DropDownListFor(model => model.firstSemesterCourses[i].Type.Id, (IEnumerable<SelectListItem>) ViewData["CourseTypeIdViewData" + i], new {@class = "form-control olevel"})</td> @Html.HiddenFor(model => model.firstSemesterCourses[i].Department.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].Programme.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].DepartmentOption.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].Level.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].Type.Id) @Html.HiddenFor(model => model.firstSemesterCourses[i].Id) </tr> } </tbody> </table> } </div> <div class="row"> <h4>Second Semester</h4> @if (Model.secondSemesterCourses != null) { <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Code</th> <th>Course Title</th> <th>Course Unit</th> <th>Course TYpe</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.secondSemesterCourses.Count; i++) { <tr> <td>@Html.TextBoxFor(model => model.secondSemesterCourses[i].Code, new {@class = "form-control"})</td> <td>@Html.TextBoxFor(model => model.secondSemesterCourses[i].Name, new {@class = "form-control"})</td> <td>@Html.TextBoxFor(model => model.secondSemesterCourses[i].Unit, new {@class = "form-control"})</td> <td>@Html.DropDownListFor(model => model.secondSemesterCourses[i].Type.Id, (IEnumerable<SelectListItem>) ViewData["SecondSemesterCourseTypeIdViewData" + i], new {@class = "form-control olevel"})</td> @Html.HiddenFor(model => model.secondSemesterCourses[i].Department.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].DepartmentOption.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].Level.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].Programme.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].Type.Id) @Html.HiddenFor(model => model.secondSemesterCourses[i].Id) </tr> } </tbody> </table> } </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Save Changes" class="btn btn-default" /> </div> </div> } } </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Pin Retrieval"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <br /> <br /> @using (Html.BeginForm("RetrievePinWithSerial", "Support", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h3>Pin Reset</h3> </div> <div class="alert alert-warning text-white" style="text-align: center"> <h3> <b>Enter Serial Number Of the Pin to be retrieved</b> </h3> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ScratchCard.SerialNumber, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ScratchCard.Pin, new { @class = "form-control", @placeholder = "Enter Pin" }) @Html.ValidationMessageFor(model => model.ScratchCard.Pin, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 fa fa-search" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> </div> </div> </div> } @using (Html.BeginForm("RetrievePinWithSerial", "Support", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) if (Model.ScratchCards == null) { return; } <div class="panel-body"> @foreach (var scratchCard in Model.ScratchCards) { <div class="col-md-12"> <div class="form-group"> @Html.Label("Serial", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="text" value="@scratchCard.SerialNumber" class="form-control" disabled /> </div> </div> <div class="form-group"> @Html.Label("Pin", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="text" value="@scratchCard.Pin" class="form-control" disabled /> </div> </div> </div> } </div> }<file_sep>@{ ViewBag.Title = "UpdateRRRBulk"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>UpdateRRRBulk</h2><file_sep>using System; using System.Collections.Generic; using System.IO; using System.Web.Mvc; using System.Web.UI; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class ProcessedSupplementaryReport : Page { public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public InstitutionChoice SelectedInstitutionChoice { get { return new InstitutionChoice { Id = Convert.ToInt32(ddlInstitutionChoice.SelectedValue), Name = ddlInstitutionChoice.SelectedItem.Text }; } set { ddlInstitutionChoice.SelectedValue = value.Id.ToString(); } } public ApplicationFormSetting SelectedApplicationFormSetting { get { return new ApplicationFormSetting { Id = Convert.ToInt32(ddlFormType.SelectedValue), Name = ddlFormType.SelectedItem.Text }; } set { ddlFormType.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { Message = ""; if (!IsPostBack) { ddlDepartment.Visible = false; PopulateAllDropDown(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReport(Session session, Department department, InstitutionChoice institutionChoice, ApplicationFormSetting applicationFormSetting) { try { var resultLogic = new ApplicantJambDetailLogic(); List<Model.Model.ProcessedSupplementaryReport> resultList = resultLogic.GetSupApplicantsByChoice(department, session, institutionChoice, applicationFormSetting); string reportPath = ""; string bind_ds = "DataSet1"; reportPath = @"Reports\ProcessedSupplementaryReport.rdlc"; if (applicationFormSetting.Id == 10) { reportPath = @"Reports\ProcessedSupplementaryReportDE.rdlc"; } rv.Reset(); rv.LocalReport.DisplayName = "Processed Supplementary Applicants"; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; if (resultList != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(), resultList)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { var programmeLogic = new ProgrammeLogic(); List<Programme> programmeList = programmeLogic.GetModelsBy(p => p.Programme_Id == 1); programmeList.Insert(0, new Programme { Id = 0, Name = "-- Select Programme --" }); Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, programmeList, Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlInstitutionChoice, Utility.GetAllInstitutionChoices(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlFormType, Utility.GetAllApplicationFormSetting(), Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if (SelectedInstitutionChoice == null || SelectedInstitutionChoice.Id <= 0) { lblMessage.Text = "Please select Institution Choice"; return true; } if (SelectedApplicationFormSetting == null || SelectedApplicationFormSetting.Id <= 0) { lblMessage.Text = "Please select Form Type"; return true; } if (Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if (Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch (Exception) { throw; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReport(SelectedSession, Department, SelectedInstitutionChoice, SelectedApplicationFormSetting); } catch (Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender, EventArgs e) { try { if (Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if (departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment, Utility.GetDepartmentByProgramme(programme), Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } protected void Button1_Click(object sender, EventArgs e) { try { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; if (Directory.Exists(Server.MapPath("~/Content/temp"))) { Directory.Delete(Server.MapPath("~/Content/temp"), true); } Directory.CreateDirectory(Server.MapPath("~/Content/temp")); DepartmentLogic departmentLogic = new DepartmentLogic(); List<Department> departments = departmentLogic.GetAll(); foreach (Department department in departments) { var resultLogic = new ApplicantJambDetailLogic(); List<Model.Model.ProcessedSupplementaryReport> report = resultLogic.GetSupApplicantsByChoice(department, SelectedSession, SelectedInstitutionChoice, SelectedApplicationFormSetting); if (report.Count > 0) { string reportPath = ""; string bind_ds = "DataSet1"; reportPath = @"Reports\ProcessedSupplementaryReport.rdlc"; if (SelectedApplicationFormSetting.Id == 10) { reportPath = @"Reports\ProcessedSupplementaryReportDE.rdlc"; } var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Processed Supplementary Report"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(), report)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath("~/Content/temp"); string savelocation = Path.Combine(path, department.Name.Replace("/", "").Replace("\\", "") + ".pdf"); System.IO.File.WriteAllBytes(savelocation, bytes); } } using (var zip = new ZipFile()) { string file = Server.MapPath("~/Content/temp/"); zip.AddDirectory(file, ""); string zipFileName = "SupplementaryApplicantReport"; zip.Save(file + zipFileName + ".zip"); string export = "~/Content/temp/" + zipFileName + ".zip"; var urlHelp = new UrlHelper(System.Web.HttpContext.Current.Request.RequestContext); Response.Redirect(export); } } catch (Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Edit Result Grade"; } @Html.Partial("Setup/_Edit", @Model)<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AttendanceReport :Page { private string courseId; private string departmentId; private string levelId; private string programmeId; private string semesterId; private string sessionId; protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(Request.QueryString["departmentId"] != null && Request.QueryString["programmeId"] != null && Request.QueryString["sessionId"] != null && Request.QueryString["levelId"] != null && Request.QueryString["semesterId"] != null && Request.QueryString["courseId"] != null) { departmentId = Request.QueryString["departmentId"]; programmeId = Request.QueryString["programmeId"]; sessionId = Request.QueryString["sessionId"]; levelId = Request.QueryString["levelId"]; semesterId = Request.QueryString["semesterId"]; courseId = Request.QueryString["courseId"]; if(!IsPostBack) { int departmentIdNew = Convert.ToInt32(departmentId); int programmeIdNew = Convert.ToInt32(programmeId); int sessionIdNew = Convert.ToInt32(sessionId); int levelIdNew = Convert.ToInt32(levelId); int semesterIdNew = Convert.ToInt32(semesterId); int courseIdNew = Convert.ToInt32(courseId); BuildCarryOverCourseList(departmentIdNew,programmeIdNew,levelIdNew,sessionIdNew,courseIdNew, semesterIdNew); } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void BuildCarryOverCourseList(int departmentId,int programmeId,int levelId,int sessionId, int courseId,int semesterId) { try { var department = new Department { Id = departmentId }; var programme = new Programme { Id = programmeId }; var level = new Level { Id = levelId }; var session = new Session { Id = sessionId }; var course = new Course { Id = courseId }; var semester = new Semester { Id = semesterId }; var courseRegistrationDetailLogic = new CourseRegistrationDetailLogic(); List<AttendanceFormat> attendanceList = courseRegistrationDetailLogic.GetCourseAttendanceSheet(session, semester,programme,department,level,course); string bind_dsAttendanceList = "dsAttendanceList"; string reportPath = @"Reports\AttendanceReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Attendance Report"; ReportViewer1.LocalReport.ReportPath = reportPath; if(attendanceList != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsAttendanceList.Trim(), attendanceList)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "RegisterCourse"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if(TempData["Message"] != null) { @Html.Partial("_Message",(Abundance_Nk.Model.Model.Message)TempData["Message"]) } @if(TempData["Action"] != null) { <div class="alert alert-dismissible alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@TempData["Action"].ToString()</p> </div> } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { //Programme Drop down Selected-change event $("#Programme").change(function () { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function (departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function (i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }) //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> @using(Html.BeginForm("RegisterAll","StudentCourseRegistration",new { area = "Admin" },FormMethod.Post)) { <div class="col-md-12"> <div class="form-group" style="color:black"> <h4>Register Course For All Students</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Session.Name,"Session",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id,(IEnumerable<SelectListItem>)ViewBag.Session,new { @class = "form-control",@id = "Session" }) @Html.ValidationMessageFor(model => model.Session.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name,"Semester",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Semester.Id,(IEnumerable<SelectListItem>)ViewBag.Semester,new { @class = "form-control",@id = "Semester" }) @Html.ValidationMessageFor(model => model.Semester.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name,"Programme",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id,(IEnumerable<SelectListItem>)ViewBag.Programme,new { @class = "form-control",@id = "Programme" }) @Html.ValidationMessageFor(model => model.Programme.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name,"Department",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id,(IEnumerable<SelectListItem>)ViewBag.Department,new { @class = "form-control",@id = "Department" }) @Html.ValidationMessageFor(model => model.Department.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name,"Level",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id,(IEnumerable<SelectListItem>)ViewBag.Level,new { @class = "form-control",@id = "Level" }) @Html.ValidationMessageFor(model => model.Level.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> } <br /> @if (Model.CourseRegistrations != null && Model.CourseRegistrations.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Name </th> <th> Matric Number </th> </tr> @for (int i = 0; i < Model.CourseRegistrations.Count(); i++) { <tr> <td> @Model.CourseRegistrations[i].Student.Name </td> <td> @Model.CourseRegistrations[i].Student.MatricNumber </td> </tr> } </table> <br/> @Html.ActionLink("Register All", "SaveAllRegisteredStudents", "StudentCourseRegistration", new { Area = "Admin"}, new { @class = "btn btn-success " }) </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "Geo Zone"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="panel panel-custom"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body text-justify"> <h2 style="font-weight: 300; text-align: center">Geo Zone</h2> <hr /> <br /> @using (Html.BeginForm("CreateGeoZone", "TranscriptProcessor", new { area = "Admin" }, FormMethod.Get)) { <div class="row" style="margin-bottom: 3px"> <div class="col-md-10"></div> <div class="col-md-2" style="padding-bottom: 3px"> <button class="btn btn-success mr5" type="submit" name="submit"><i class="fa fa-plus"> Create New </i></button> </div> </div> } <table class="table-responsive table-striped table-condensed" style="width: 100%" id="MyTable"> <thead> <tr> <th>SN</th> <th>Name</th> <th>Activated</th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.GeoZones.Count; i++) { var sN = i + 1; <tr> <td>@sN</td> <td>@Model.GeoZones[i].Name</td> <td>@Model.GeoZones[i].Activated</td> <td>@Html.ActionLink("Edit", "EditGeoZone", new { Id = @Model.GeoZones[i].Id, area = "admin", controller = "TranscriptProcessor", @class = "btn btn-success" })</td> </tr> } </tbody> </table> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "AllocateReservedRoom"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Allocate Reserved Room</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("AllocateReservedRoom", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <div class="panel panel-default"> <div class="panel-body"> @Html.HiddenFor(m => m.HostelRoom.Id) @Html.HiddenFor(m => m.HostelRoom.Hostel.Id) @Html.HiddenFor(m => m.HostelRoom.Series.Id) <div> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Hostel:") </dt> <dd> @Html.DisplayFor(model => model.HostelRoom.Hostel.Name) </dd> <br /> <dt> @Html.DisplayName("Series/Floor:") </dt> <dd> @Html.DisplayFor(model => model.HostelRoom.Series.Name) </dd> <br /> <dt> @Html.DisplayName("Room:") </dt> <dd> @Html.DisplayFor(model => model.HostelRoom.Number) </dd> <br/> <dt> @Html.DisplayName("Bed Space:") </dt> <dd> @Html.DropDownListFor(model => model.HostelRoomCorner.Id, (IEnumerable<SelectListItem>)ViewBag.CornerId, htmlAttributes: new { @class = "form-control", @required = "required" }) </dd> <br/> <dt> @Html.DisplayName("School Fee Confirmation Order Number:") </dt> <dd> @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @required = "required" }) </dd> <br /> @*<div class="row"> <div class="col-md-offset-2 col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoomCorner.Name, "Bed Space", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelRoomCorner.Id, (IEnumerable<SelectListItem>)ViewBag.CornerId, htmlAttributes: new { @class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.HostelRoomCorner.Id, null, new { @class = "text-danger" }) </div> </div> </div> <br/>*@ @*<div class="row"> <div class="col-md-offset-2 col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, "Matric Number", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Student.Id, null, new { @class = "text-danger" }) </div> </div> </div> <br />*@ </dl> </div> <div class="form-group"> <div class="col-md-offset-1 col-md-11"> <input type="submit" value="Save" class="btn btn-success" /> </div> </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@{ ViewBag.Title = "View"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>View Score Sheets</h2><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ ViewBag.Title = "Verification Fees"; Layout = "~/Views/Shared/_Layout.cshtml"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/sweetalert.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script type="text/javascript"> $(document).ready(function () { swal("Please!", "Kindly Select Certificate Verification only if you want your certificate verified", "warning"); }); </script> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h2> Verification & Certificate Collection <span class="label label-default"> Search</span> </h2> </div> <hr /> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> @using (Html.BeginForm("VerificationFees", "Transcript", FormMethod.Post, new { id = "frmIndex", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <h4>Enter your matric Number and click on the search button to retrieve your details</h4> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.MatricNumber, new { @class = "control-label " }) @Html.TextBoxFor(model => model.StudentVerification.Student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentVerification.Student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> @if (Model.StudentVerification != null && Model.StudentVerification.Student != null) { <div class="col-md-8"> <div class="well well-sm"> <div class="form-group"> <br /> @if (Model.StudentVerification.Payment == null) { @Html.ActionLink(Model.StudentVerification.Student.FullName + " - " + Model.StudentVerification.Student.MatricNumber + " >> Click to continue", "VerificationRequest", "Transcript", new { sid = Model.StudentVerification.Student.Id }, new { @class = "btn btn-danger btn-sm", target = "_blank" }) } else { @Html.ActionLink(Model.StudentVerification.Student.FullName + " - " + Model.StudentVerification.Student.MatricNumber + " >> Click to check status", "TranscriptPayment", "Transcript", new { tid = Model.StudentVerification.Payment.Id }, new { @class = "btn btn-danger btn-sm", target = "_blank" }) } </div> </div> </div> } </div> </div> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> </div> </div> <br /> } </div> </div> <div class="col-md-1"></div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "EditPayments"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading"> <h4>Edit Payment</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("EditPayment", "Support", FormMethod.Post)) { @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.Payment.Person.Id) @Html.HiddenFor(model => model.Payment.PaymentType.Id) @Html.HiddenFor(model => model.Payment.PersonType.Id) @Html.HiddenFor(model => model.Payment.PaymentType.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.Person.FullName, "Name", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Payment.Person.FullName, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Payment.Person.FullName, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.PaymentMode.Name, "Payment Mode", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Payment.PaymentMode.Id, (IEnumerable<SelectListItem>)ViewBag.PaymentMode, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Payment.PaymentMode.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.PaymentType.Name, "Payment Type", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Payment.PaymentType.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Payment.PaymentType.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.PersonType.Name, "Person Type", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Payment.PersonType.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Payment.PersonType.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.FeeType.Name, "FeeType", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Payment.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeType, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Payment.FeeType.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.SerialNumber, "Payment Serial Number", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Payment.SerialNumber, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Payment.SerialNumber, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.InvoiceNumber, "Invoice Number", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Payment.InvoiceNumber, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Payment.InvoiceNumber, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.Session.Name, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Payment.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Payment.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.DatePaid, "Date Paid", new {@class = "control-label custom-text-black"}) @Html.TextBoxFor(model => model.Payment.DatePaid, new {@class = "form-control", @readonly = "readonly"}) @Html.ValidationMessageFor(model => model.Payment.DatePaid, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentPayment.Level.Name, "Level", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.StudentPayment.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentPayment.Level.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@using GridMvc.Html @model Abundance_Nk.Web.Areas.Admin.ViewModels.FeeDetailViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-body"> @Html.Grid(Model.feeDetails).Columns(columns => { columns.Add() .Encoded(false) .Sanitized(false) .RenderValueAs(d => @<div style="width: 41px"> <a href="@Url.Action("Edit", new {id = d.Id})" title="Edit"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> <a href="@Url.Action("Delete", new {id = d.Id})" title="Delete"> <img src="@Url.Content("~/Content/Images/delete_icon.png")" alt="Delete" /> </a> </div>); columns.Add(f => f.Fee.Name).Titled("Name"); columns.Add(f => f.Fee.Amount).Titled("Amount").Sortable(true); columns.Add(f => f.FeeType.Name).Titled("FeeType").Sortable(true); columns.Add(f => f.Department.Name).Titled("Department").Sortable(true); columns.Add(f => f.Programme.Name).Titled("Programme").Sortable(true); columns.Add(f => f.Level.Name).Titled("Level").Sortable(true); columns.Add(f => f.PaymentMode.Name).Titled("PaymentMode").Sortable(true); }).WithPaging(15).Filterable(true) </div> </div> <br /><file_sep>@model IEnumerable<Abundance_Nk.Web.Models.RefereeFormViewModel> @{ ViewBag.Title = "View Multitple Print Outs"; Layout = "~/Views/Shared/_Layout.cshtml"; } <style> body { overflow-x: hidden !important; } .nodesToRenderAsPDF{ margin-bottom: 20px !important; } .bg-white { background: #fff; } .fs-16 { font-size: 16px; } .fs-15 { font-size: 15px; } .mt-10 { margin-top: 10px !important; } .mt-20 { margin-top: 20px !important; } .mt-30 { margin-top: 30px !important; } .mt-5 { margin-top: 5px !important; } .mb-10 { margin-bottom: 10px !important; } .mb-5 { margin-bottom: 5px !important; } .p-20 { font-size: 20px; } .bb-black { border-bottom: 1px solid #ddd; } .list-inline { display: inline !important; } .no-list-bullet { list-style: none !important; } textarea { width: 100% !important; } </style> @if (TempData["Message"] != null) { <div class="container"> <div class="row"> <div class="col-md-12"> <br /> @Html.Partial("_Message", TempData["Message"]) </div> </div> </div> } @if (Model != null && Model.Count() > 0) { <div class="container"> <div class="row"> <div class="col-xs-12 col-md-12 text-center" style="margin-bottom:20px;"> <button class="btn btn-primary btn-lg" type="button" name="submit" id="print"><i class="fa fa-print mr5"></i> Print All @string.Format("{0} References", Model.Count())</button> </div> </div> @foreach (var item in Model) { <div class="card nodesToRenderAsPDF"> <div class="card-body" style="padding: 50px 20px;"> <div class="row"> <div class="col-xs-12 col-md-12"> <h2 class="text-center"> <img src="~/Content/Images/absu logo.png" style="width:80px;height:80px" /> </h2> <h3 class="text-center mb-5">ABIA STATE UNIVERSITY, UTURU</h3> <h4 class="text-center mt-5">SCHOOL OF POSTGRADUATE</h4> </div> <div class="col-xs-12 col-md-12"> <h3 class="text-center mb-5"> REFEREE'S CONFIDENTIAL REPORT ON A CANDIDATE FOR ADMISSION <br />TO HIGHER/POSTGRADUATE STUDIES </h3> </div> <div class="col-xs-12 col-md-10 offset-md-1 bb-black" style="padding-bottom: 30px !important;"> <p class="p-20"> The candidate whose name is given below wishes to undertake higher degree/postgraduate studies in this university. Your comments(which will be treated in the strictest confidence) on the candidate's suitability for the work, would be appreciated. Please return the completed form direct to the Secondary School of Postgraduate Studies, Abia State University, P.M.B 2000 Uturu, Abia State. </p> </div> <div class="col-xs-12 col-md-8 offset-md-2 mt-30 mb-10"> @using (Html.BeginForm("RefereeForm", "PostGraduateForm", FormMethod.Post, new { id = "frmPostJAMB", enctype = "multipart/form-data" })) { <ol class="no-list-bullet"> <li> <div class="form-group"> @Html.LabelFor(model => item.CandidateName, "Name of Candidate", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@item.CandidateName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => item.DepartmentFacultyName, "Department/Faculty", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@item.DepartmentFacultyName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => item.ProgrammeName, "Programme", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@item.ProgrammeName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => item.LengthOfFamiliarityTime, "Lenght Of Time Referee was familiar with the Candidate", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@string.Format("{0} Year(s)", item.LengthOfFamiliarityTime)</label> </div> </li> </ol> if (item.ApplicantRefereeGradingResponses != null && item.ApplicantRefereeGradingResponses.Count > 0) { <span class="help-block fs-16">Candidate Evaluation By Referee</span> <br /> <table class="table table-bordered"> <thead> <tr> <th></th> @for (int i = 0; i < item.RefereeGradingSystems.Count; i++) { <th>@item.RefereeGradingSystems[i].Score</th> } </tr> </thead> <tbody> @for (int i = 0; i < item.RefereeGradingCategories.Count; i++) { <tr> <td>@item.RefereeGradingCategories[i].GradeCategory</td> @for (int j = 0; j < item.RefereeGradingSystems.Count; j++) { <td> @if (item.ApplicantRefereeGradingResponses[i].RefereeGradingSystem.Id == item.RefereeGradingSystems[j].Id) { <i class="fa fa-check"></i> } </td> } </tr> } </tbody> </table> } <ol class="no-list-bullet"> @if (!string.IsNullOrEmpty(item.CandidateEligibity)) { <li> <div class="form-group"> <label class="control-label">Comment on the Candidate's Personality</label> <label class="text-uppercase" style="font-weight:400;padding: 5px 10px;border:1px solid #ddd;"> @item.CandidateEligibity </label> </div> </li> } <li> <div class="form-group"> <label class="control-label">Would you accept the candidate as a graduate student?</label> <label style="font-weight:400;color:#344E86 !important;">@string.Format("{0}", item.AcceptAsGraduateStudent ? "Yes" : "No")</label> </div> </li> <br /> @if (!string.IsNullOrEmpty(item.OverallPromise)) { <li> <div class="form-group"> <label class="control-label">Please rate this applicant in overall promise</label> <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@item.OverallPromise</label> </div> </li> } @if (!string.IsNullOrEmpty(item.CandidateSuitabilty)) { <li> <div class="form-group"> <label class="control-label">Relevant information to determine the candidate's suitability?</label> <label class="text-uppercase" style="font-weight:400;padding: 5px 10px;border:1px solid #ddd;"> @item.CandidateSuitabilty </label> </div> </li> } <li> <div class="form-group"> <label class="control-label">Do you have any objections about the candidate's eligibity?</label> </div> </li> </ol> <div class="row" style="padding-left: 40px;"> <div class="col-md-12"> <div class="form-group"> <label for="name" class="control-label">FullName</label> <label style="font-weight:400;padding: 3px 15px;border:1px solid #ddd;"> @item.RefereeFullName </label> </div> </div> </div> } </div> </div> </div> <div class="card-footer bg-white"> <div class="row"> <div class="col-xs-12 col-sm-6 offset-sm-6"> <h5 class="text-right"> <span class="fs-15">Powered by </span> <a href="http://lloydant.com" target="_blank"> <img src="~/Content/Images/lloydant.png" style="width: 40px; height:30px;" /> </a> </h5> </div> </div> </div> </div> } </div> } <script src="~/Content/js/jquery.js"></script> <script src="~/Content/js/jsPdf.js"></script> <script src="~/Content/js/html2canvas.js"></script> <script type="text/javascript"> let image = []; initDataURLs(); async function initDataURLs() { let containers = document.getElementsByClassName("nodesToRenderAsPDF"); for (let i = 0; i < containers.length; i++) { const idName = "focus-on-me"; containers[i].setAttribute("id", idName); const el = document.getElementById(idName); window.focus(el); const canvas = await html2canvas(el); image.push(canvas.toDataURL("image/png")); containers[i].removeAttribute("id"); } } document.querySelector("#print").addEventListener("click", (e) => { e.preventDefault(); for (let j = 0; j < image.length; j++) { const filename = `Referal_Fillout_${j + 1}.pdf`; let pdf = new jsPDF('p', 'mm', 'a4'); pdf.addImage(image[j], 'PNG', 0, 0, 211, 278); pdf.addPage(); pdf.save(filename); } }); </script> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ /**/ ViewBag.Title = "E-Course Content"; Layout = "~/Areas/Student/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Update download count }); function updateDownloadCount(id,url) { var EcourseId = id; var url = url; if (EcourseId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("DownloadCount", "Elearning")', // Calling json method dataType: 'json', data: { EcourseId }, // Get Selected Country ID. success: function (result) { if (result != null) { let link = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); link.href = url; link.target = "_blank"; let event = new MouseEvent("click", { "view": window, "bubbles": false, "cancelable": true }); link.dispatchEvent(event); } }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; } }; </script> <br /> <div class="card"> @if (Model.ECourseList != null && Model.ECourseList.Count > 0) { <div> <h2>@Model.ECourseList.FirstOrDefault().Course.Code - @Model.ECourseList.FirstOrDefault().Course.Name</h2> <br /> <h4>Elearning Resources</h4> <br /> <div class="card-body"> <div class=" table-responsive"> <table class="table-bordered table-hover table-striped table"> <tr> <th>S/N</th> <th> Topic </th> <th> Scheduled Between </th> <th> Text/Graphic Content </th> <th> Video content </th> <th> Live Class </th> </tr> @for (int i = 0; i < Model.ECourseList.Count(); i++) { var s = i + 1; DateTime currentDateTime = DateTime.Now; <tr> <td>@s</td> <td> @Model.ECourseList[i].EContentType.Name </td> <td> @Model.ECourseList[i].EContentType.StartTime -@Model.ECourseList[i].EContentType.EndTime </td> <td> @if (Model.ECourseList[i].Url != null) { if (Model.ECourseList[i].EContentType.EndTime < currentDateTime) { <button class="btn btn-secondary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].Url)')" disabled>View</button> } else if (Model.ECourseList[i].EContentType.EndTime > currentDateTime && Model.ECourseList[i].EContentType.StartTime > currentDateTime) { <button class="btn btn-secondary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].Url)')" disabled>View</button> } else { <button class="btn btn-secondary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].Url)')">View</button> } } </td> <td> @if (Model.ECourseList[i].VideoUrl != null) { if (Model.ECourseList[i].EContentType.EndTime < currentDateTime) { <button class="btn btn-primary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].VideoUrl)')" disabled>Watch</button> } else if (Model.ECourseList[i].EContentType.EndTime > currentDateTime && Model.ECourseList[i].EContentType.StartTime > currentDateTime) { <button class="btn btn-primary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].VideoUrl)')" disabled>Watch</button> } else { <button class="btn btn-primary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].VideoUrl)')">Watch</button> } } </td> <td> @if (Model.ECourseList[i].LiveStreamLink != null) { if (Model.ECourseList[i].EContentType.EndTime < currentDateTime) { <button class="btn btn-secondary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].LiveStreamLink)')" disabled>Join</button> } else if (Model.ECourseList[i].EContentType.EndTime > currentDateTime && Model.ECourseList[i].EContentType.StartTime > currentDateTime) { <button class="btn btn-secondary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].LiveStreamLink)')" disabled>Join</button> } else { <button class="btn btn-primary" onclick="updateDownloadCount(@Model.ECourseList[i].Id,'@Url.Content(Model.ECourseList[i].LiveStreamLink)')">Join</button> } } </td> </tr> } </table> </div> </div> </div> } else { <div><h3>No Content Available yet</h3></div> } </div> <file_sep> @model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGViewModel @{ //Layout = null; } @Html.HiddenFor(model => model.PreviousEducation.Id) <div class="panel panel-default p-4"> <div class="col-md-12"> <div class="panel-heading"> <div style="font-size: x-large">Tertiary Education</div> </div> <div class="panel-body"> <!--Enable filling of previous Tertiary academic records--> <div class="table-responsive"> <table id="tertiaryTable" class="table table-condensed" style="background-color: whitesmoke"> <thead> <tr> <th> Institution Name </th> <th> Course Of Study </th> <th> Qualification </th> <th> Class of Degree </th> <th> Admission Year </th> <th> Graduation Year </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.ApplicantPreviousEducations.Count; i++) { <tr> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].SchoolName) </td> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].Course) </td> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].Qualification.ShortName) </td> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].ResultGrade.LevelOfPass) </td> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].StartDate.Year) </td> <td> @Html.DisplayFor(model => model.ApplicantPreviousEducations[i].EndDate.Year) </td> </tr> } </tbody> </table> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBFormPaymentViewModel @{ ViewBag.Title = "Remita Payment"; Layout = "~/Views/Shared/_Layout.cshtml"; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function () { document.getElementById("form1").submit(); }); </script> } @if (TempData["Message"] != null) { <div class="row"> @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) </div> } <div> Processing... <span><img src="~/Content/Images/bx_loader.gif" /></span> </div> <form id="form1" action="https://login.remita.net/remita/ecomm/init.reg" name="SubmitRemitaForm" method="POST"> <input type="hidden" value="@Model.Remita.payerName" name="payerName" id="payerName" /> <input type="hidden" value="@Model.Remita.payerEmail" name="payerEmail" id="payerEmail" /> <input type="hidden" value="@Model.Remita.payerPhone" name="payerPhone" id="payerPhone" /> <input type="hidden" value="@Model.Remita.orderId" name="orderId" id="orderId" /> <input type="hidden" value="@Model.Remita.merchantId" name="merchantId" id="merchantId" /> <input type="hidden" value="@Model.Remita.serviceTypeId" name="serviceTypeId" id="serviceTypeId" /> <input type="hidden" value="@Model.Remita.responseurl" name="responseurl" id="responseurl" /> <input type="hidden" value="@Model.Remita.amt" name="amt" id="amt" /> <input type="hidden" value="@Model.Remita.hash" name="hash" id="hash" /> <input type="hidden" value="@Model.Remita.paymenttype" name="paymenttype" id="paymenttype" /> </form> <file_sep>@model Abundance_Nk.Model.Entity.HOSTEL @{ ViewBag.Title = "Edit"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Edit Hostel</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h5>HOSTEL</h5> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Hostel_Id) <div class="form-group"> @Html.LabelFor(model => model.Hostel_Type_Id, "Hostel Type", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Hostel_Type_Id", String.Empty) @Html.ValidationMessageFor(model => model.Hostel_Type_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Hostel_Name, "Hostel Name", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Hostel_Name) @Html.ValidationMessageFor(model => model.Hostel_Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Capacity, "Hostel Capacity", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Capacity) @Html.ValidationMessageFor(model => model.Capacity) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Description, "Hostel Description", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Description) @Html.ValidationMessageFor(model => model.Description) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Date_Entered, "Date Added", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Date_Entered) @Html.ValidationMessageFor(model => model.Date_Entered) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Activated, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Activated) @Html.ValidationMessageFor(model => model.Activated) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index", "",new { @class = "btn btn-success" }) </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <h3 class="mb-1">FILL BIODATA FORM</h3> <hr/> <div class="container pl-0 ml-0"> <div class="col-md-12 pl-0 ml-0"> <div class="form-group pl-0 ml-0"> <div class="col-sm-12 pl-0 ml-0 "> <div class="form-inline"> <div class="form-group pl-0 ml-0"> @Html.ActionLink("Fill Student Form", "Form", "Information", new { Area = "Student", fid = Model.ApplicationForm.Id, pid = Model.AppliedCourse.Programme.Id }, new { @class = "btn btn-warning mr-2 ", target = "_blank", id = "alCourseRegistration" }) <button class="btn btn-primary" type="button" name="btnStudentFormNext" id="btnStudentFormNext" />Student Form </div> <div class="form-group margin-bottom-0"> <div id="divProcessingSchoolFeesInvoice" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> <br /> <div id="divGenerateSchoolFeesInvoice"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-user"></i>Edit Staff Details</h3> </div> <div class="panel-body"> @using (Html.BeginForm("EditUser", "User", FormMethod.Post,new {enctype = "multipart/form-data"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-colorful"> <div class="panel-body "> <div class="form-group"> @Html.LabelFor(model => model.User.Username, "<NAME>", new { @class = "text-bold" }) @Html.TextBoxFor(model => model.User.Username, new { @class = "form-control", @placeholder = "Enter Username" }) @Html.ValidationMessageFor(model => model.User.Username, null, new { @class = "text-danger" }) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Password, new { @class = "text-bold" }) @Html.TextBoxFor(model => model.User.Password, new { @class = "form-control", @placeholder = "Enter Password", @type = "<PASSWORD>" }) @Html.ValidationMessageFor(model => model.User.Password, null, new { @class = "text-danger" }) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Email, "Email", new { @class = "text-bold" }) @Html.TextBoxFor(model => model.User.Email, new { @class = "form-control", @placeholder = "Enter Email Address" }) @Html.ValidationMessageFor(model => model.User.Email, null, new { @class = "text-danger" }) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Role.Id, "Role", new { @class = "text-bold" }) @Html.DropDownListFor(model => model.User.Role.Id, (IEnumerable<SelectListItem>)ViewBag.RoleList, new { @class = "form-control", @id = "Role", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.User.Role.Id) </div> <div class="form-group"> @Html.LabelFor(model => model.User.SecurityQuestion.Id, "Security Question", new { @class = "text-bold" }) @Html.DropDownListFor(model => model.User.SecurityQuestion.Id, (IEnumerable<SelectListItem>)ViewBag.SecurityQuestionList, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.User.SecurityQuestion.Id) </div> <div class="form-group"> @Html.LabelFor(model => model.User.SecurityAnswer, new { @class = "col-sm-2 control-label " }) @Html.TextBoxFor(model => model.User.SecurityAnswer, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.User.SecurityAnswer) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Activated, new {@class = "col-sm-2 control-label "}) @Html.CheckBoxFor(model => model.User.Activated, new {@class = ""}) @Html.ValidationMessageFor(model => model.User.Activated) </div> <div class="row"> <div class="form-group col-md-6"> @Html.LabelFor(model => model.User.SignatureUrl, "Signature", new {@class = "col-md-2 control-label "}) <div><input type="file" title="Upload Image" id="file" name="file" class="form-control"/> </div> </div> @if (Model.User.SignatureUrl != null) { <div class=" col-md-6"> <div><img src="@Url.Content("~" + Model.User.SignatureUrl)" style="width:70px;height:70px" /></div> </div> } </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> </div> </div> } </div> </div> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "ViewConfirmedpayments"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">View Confirmed payments</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewConfirmedpayments", "StudentCourseRegistration", new { Area = "Admin" }, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.Student.MatricNumber, "Matric Number: ", new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.TextBoxFor(m => m.Student.MatricNumber, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.Student.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-success" /> </div> </div> </div> </div> } </div> <br /> <div class="panel-body"> <div class="col-md-12"> @if (Model.PaymentEtranzacts != null && Model.PaymentEtranzacts.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Name </th> <th> Confirmation Order Number </th> <th> Amount </th> <th> Invoice Number </th> <th> FeeType </th> <th> Session </th> <th> Edit </th> </tr> @for (int i = 0; i < Model.PaymentEtranzacts.Count; i++) { <tr> @Html.HiddenFor(model => model.PaymentEtranzacts[i].Payment.Payment.Id) <td> @Model.PaymentEtranzacts[i].Payment.Payment.Person.FullName </td> <td> @Model.PaymentEtranzacts[i].ConfirmationNo </td> <td> @Model.PaymentEtranzacts[i].TransactionAmount </td> <td> @Model.PaymentEtranzacts[i].Payment.Payment.InvoiceNumber </td> <td> @Model.PaymentEtranzacts[i].Payment.Payment.FeeType.Name </td> <td> @Model.PaymentEtranzacts[i].Payment.Payment.Session.Name </td> <td> @Html.ActionLink("Edit", "EditConfirmedPayment", "StudentCourseRegistration", new { Area = "Admin", pid = Model.PaymentEtranzacts[i].Payment.Payment.Id }, new { @class = "btn btn-success " }) </td> </tr> } </table> </div> </div> } </div> </div> </div> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "E-Learning"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @section Scripts { <script type="text/javascript"> var eAssignmentSubmissionId = 0; $(document).ready(function () { $('#showPdf').modal({ show: false, backdrop: 'static' }); $('.modal').on('hidden.bs.modal', function (e) { $(this).removeData(); }) $('#btnCreate').on('click', function () { $('.Load').show(); var score = $('#score').val(); var remarks = $('#remark').val(); if (score > 0 && eAssignmentSubmissionId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("ScoreAssignment", "Elearning")', // Calling json method dataType: 'json', data: { eAssignmentSubmissionId, score, remarks }, success: function (result) { if (!result.iSError && result.Message != null) { alert(result.Message); window.location.reload(true); } $('#editeModal').modal('hide'); $('.Load').hide(); }, error: function (ex) { $('#editeModal').modal('hide'); $('.Load').hide(); alert('Failed to Create Topic.' + ex); } }); } return false; }); $('#showPdfPreview').on('click', function () { $('#showPdf').modal({ show: false, backdrop: 'static' }); $('#iframeMessage').show(); $('#hidePdfPreview').show(); $('#showPdfPreview').hide(); }) $('#hidePdfPreview').on('click', function () { $('#showPdf').modal({ show: false, backdrop: 'static' }); $('#iframeMessage').hide(); $('#showPdfPreview').show(); $('#hidePdfPreview').hide(); }) }); function showModal(e) { eAssignmentSubmissionId = e; $('#editeModal').modal('show'); } function previewPdf(url, e,name,matricNo,text) { $('#iframeMessage').html(""); var pdfLink = url; eAssignmentSubmissionId = e; var iframe = '<object type="application/pdf" data="' + pdfLink + '" width="100%" height="500"></object>' $('#iframeMessage').append(iframe); $('#matricNo').text(matricNo); $('#fullName').text(name); if (text != "" && text != null) { $('#textSubmission').text(text); } else { $('#textSubmission').text("No Text Submission Check PDF"); } $('#showPdf').modal('show'); return false; } //publish EAssigmnet Result function publishResult(id,status) { var response=false; if (status) { response = confirm("Are you sure You want to Publish this Assignment Results?"); } else { response = confirm("Are you sure You want to Withhold this Assignment Results?"); } if (response) { if (status) { $('.publish').text("...Publishing"); $('.publish').attr('disabled', true); } else { $('.publish').text("...Withholding"); $('.publish').attr('disabled', true); } $.ajax({ type: 'POST', url: '@Url.Action("PublishEAssignmentResult", "Elearning")', // Calling json method traditional: true, data: { id, status }, success: function (result) { if (!result.isError && result.Message) { alert(result.Message); location.reload(true); } }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } else { return false; } } </script> } <style> textarea { resize: none; } </style> <div class="card"> <div class="card-header"> <h3 class="card-title"><i class="fa fa-fw fa-download"></i>Assignment Submissions</h3> </div> <div class="card-body"> @Html.HiddenFor(model => model.eAssignment.Course.Id) @Html.HiddenFor(model => model.CourseAllocation.Id) <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Assignment, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.eAssignment.Assignment, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Assignment, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Instructions, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.eAssignment.Instructions, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Instructions, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.DueDate, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.eAssignment.DueDate, new { @class = "form-control", type = "date" }) @Html.ValidationMessageFor(model => model.eAssignment.DueDate, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.MaxScore, "Max Score", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.eAssignment.MaxScore, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.MaxScore, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.URL, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @if (Model.eAssignment.URL != null) { <a href="@Url.Content(Model.eAssignment.URL)" class="btn btn-primary" target="_blank">View</a> } </div> </div> </div> </div> @if (Model.EAssignmentSubmissionList != null && Model.EAssignmentSubmissionList.Count() > 0) { <div class="panel panel-danger"> <div class="panel-heading"> @if (Model.EAssignmentSubmissionList.FirstOrDefault().EAssignment.Publish) { <button class="pull-right btn btn-info publish font-weight-bold" onclick="publishResult(@Model.EAssignmentSubmissionList.FirstOrDefault().EAssignment.Id,false)">Withhold Result</button> } else { <button class="pull-right btn btn-success publish font-weight-bold" onclick="publishResult(@Model.EAssignmentSubmissionList.FirstOrDefault().EAssignment.Id,true)">Publish Result</button> } </div> <table class="table-bordered table-hover table-striped table table-responsive"> <tr> <th> Fullname </th> <th> Matric Number </th> <th> Assignment </th> <th> Date Submitted </th> <th> Score </th> <th> Remarks </th> </tr> @for (int i = 0; i < Model.EAssignmentSubmissionList.Count(); i++) { var score = ""; if (Model.EAssignmentSubmissionList[i].Score != null) { score = Decimal.Truncate((decimal)(Model.EAssignmentSubmissionList[i].Score)).ToString() + "/" + Model.eAssignment.MaxScore.ToString(); } else { score = "" + "/" + Model.eAssignment.MaxScore.ToString(); } <tr> <td> @Model.EAssignmentSubmissionList[i].Student.FullName </td> <td> @Model.EAssignmentSubmissionList[i].Student.MatricNumber </td> <td> @*@if (Model.EAssignmentSubmissionList[i].AssignmentContent != null) { <a href="@Url.Content(Model.EAssignmentSubmissionList[i].AssignmentContent)" class="btn btn-primary-alt" target="_blank">View</a> }*@ @if (Model.EAssignmentSubmissionList[i].AssignmentContent != null) { <button class="btn btn-primary mr5 " onclick="previewPdf('@Url.Content(Model.EAssignmentSubmissionList[i].AssignmentContent)',@Model.EAssignmentSubmissionList[i].Id,'@Model.EAssignmentSubmissionList[i].Student.FullName','@Model.EAssignmentSubmissionList[i].Student.MatricNumber',`@Model.EAssignmentSubmissionList[i].TextSubmission`)">View</button> } </td> <td> @Model.EAssignmentSubmissionList[i].DateSubmitted </td> <td> @score </td> <td> @Model.EAssignmentSubmissionList[i].Remarks </td> @*<td> <button class="btn btn-primary mr5 " type="button" name="submit" onclick="showModal(@Model.EAssignmentSubmissionList[i].Id)">Grade</button> </td>*@ </tr> } </table> </div> <div class="modal fade" role="dialog" id="showPdf" style="z-index:999999999; width:100%" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" style="float:right">&times;</button> <h4 class="modal-title">Submitted Assignment</h4> </div> <div class="modal-body"> <div> <div class="form-group"> <label class="form-control" id="fullName"></label> </div> <div class="form-group"> <label class="form-control" id="matricNo"></label> </div> </div> <div> <textarea id="textSubmission" cols="105" rows="20" readonly></textarea> </div> <hr /> <button id="showPdfPreview" class="btn btn-invoice">Show PDF</button> <button id="hidePdfPreview" style="display:none" class="btn btn-info">Hide PDF</button> <div id="iframeMessage" style="display:none"> </div> <hr /> <div> <div class="form-group"> <label class="form-control">Score</label> </div> <div class="form-group"> @Html.DropDownList("Text", new SelectList(ViewBag.MaxGrade, "Value", "Text"), new { id = "score", @class = "form-control" }); </div> <div class="form-group"> <label class="form-control">Remarks</label> </div> <div class="form-group"> <input type="text" class="form-control" id="remark" /> </div> </div> </div> <div class="modal-footer form-group"> <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> <button type="button" id="btnCreate" class="btn btn-success">Save Score</button> </div> </div> </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "EditAllocationRequest"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Edit Hostel Allocation Request</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("EditAllocationRequest", "HostelAllocation", FormMethod.Post)) { @Html.HiddenFor(model => model.HostelRequest.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelRequest.Level.Name, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.HostelRequest.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.HostelRequest.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelRequest.Session.Name, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelRequest.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelRequest.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelRequest.Approved, new { @class = "control-label custom-text-black" }) @Html.CheckBoxFor(m => m.HostelRequest.Approved, new { @type = "checkbox" }) @Html.ValidationMessageFor(model => model.HostelRequest.Approved, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update Request" /> </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <style> th.rotate { /* Something you can count on */ height: 120px; white-space: nowrap; } th.rotate > div { font-size: small; transform: translate(0px, 0px) rotate(270deg); width: 10px; } th.rotate > div > span { /*border-bottom: 1px solid #ccc;*/ padding: 5px 10px; } </style> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { if ($("#StudentResult_Programme_Id").val() == "") { $('.uploadReady').attr('disabled', true); } $("#StudentResult_Programme_Id").change(function () { $("#StudentResult_Department_Id").empty(); var programme = $("#StudentResult_Programme_Id").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function (departments) { if (departments != "") { $("#StudentResult_Department_Id").append('<option value="' + 0 + '"> -- Select Department -- </option>'); $.each(departments, function (i, department) { $("#StudentResult_Department_Id").append('<option value="' + department.Id + '">' + department.Name + '</option>'); }); $(".uploadReady").attr('disabled', false) } else { $(".uploadReady").attr('disabled', true) } }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }) }) </script> <h2>Student Result Upload</h2> @using (Html.BeginForm("Upload", "Result", FormMethod.Post, new { id = "frmUpload", enctype = "multipart/form-data" })) { @Html.HiddenFor(model => model.StudentResult.UploadedFileUrl) @*@Html.HiddenFor(model => model.StudentResult.Uploader.Id)*@ <div class="row"> <div class="col-md-12"> <div class="col-md-12 shadow"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> </div> <div class="row"> <h4 style="color:green">Provide upload criteria</h4> <hr style="margin-top:0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.LabelFor(model => model.Programme.Id, new { @class = "control-label " })*@ @Html.DropDownListFor(model => model.StudentResult.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programmes, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentResult.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.LabelFor(model => model.Level.Id, new { @class = "control-label " })*@ @Html.DropDownListFor(model => model.StudentResult.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Levels, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentResult.Level.Id, null, new { @class = "text-danger" }) </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.LabelFor(model => model.StudentResultType.Id, new { @class = "control-label" })*@ @Html.DropDownListFor(model => model.StudentResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.ResultTypes, new { @class = "form-control uploadReady" }) @Html.ValidationMessageFor(model => model.StudentResult.Type.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.LabelFor(model => model.Department.Id, new { @class = "control-label " })*@ @Html.DropDownListFor(model => model.StudentResult.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Departments, new { @class = "form-control uploadReady" }) @Html.ValidationMessageFor(model => model.StudentResult.Department.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.LabelFor(model => model.SessionSemester.Id, new { @class = "control-label " })*@ @Html.DropDownListFor(model => model.StudentResult.SessionSemester.Id, (IEnumerable<SelectListItem>)ViewBag.SessionSemesters, new { @class = "form-control uploadReady" }) @Html.ValidationMessageFor(model => model.StudentResult.SessionSemester.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> <input class="btn btn-default btn-metro" type="file" name="file" id="file" /> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.DropDownListFor(model => model.StudentResult.MaximumObtainableScore, (IEnumerable<SelectListItem>)ViewBag.MaximumObtainableScores, new { @class = "form-control uploadReady" }) @Html.ValidationMessageFor(model => model.StudentResult.MaximumObtainableScore) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> <div class="row"> @*<h4 style="color:green">Select excel file and upload</h4>*@ <h4 style="color:green">Upload or cancel uploaded file</h4> <hr style="margin-top:0" /> <div class="col-md-12"> <div class="form-group"> @*@Html.TextBoxFor(m => m.ExcelFile, new { id = "file", type = "file", @class = "btn btn-default btn-metro", style = "color:red;" })*@ <input class="btn btn-success btn-success" type="submit" name="btnUpload" id="btnUpload" value="Upload" /> <input class="btn btn-white btn-default" type="button" name="btnCancel" id="btnCancel" value="Cancel" /> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> </div> @*</div>*@ } @*@using (Html.BeginForm("SaveUpload", "Result", FormMethod.Post, new { id = "frmUpload2", enctype = "multipart/form-data" }))*@ @using (Ajax.BeginForm("SaveUpload", "Result", new { enctype = "multipart/form-data" }, new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, LoadingElementId = "busy", UpdateTargetId = "divExcelData" })) { <div id="divExcelData"> @Html.HiddenFor(model => model.StudentResult.Programme.Id) @Html.HiddenFor(model => model.StudentResult.Level.Id) @Html.HiddenFor(model => model.StudentResult.Type.Id) @Html.HiddenFor(model => model.StudentResult.Department.Id) @Html.HiddenFor(model => model.StudentResult.SessionSemester.Id) @Html.HiddenFor(model => model.StudentResult.MaximumObtainableScore) @Html.HiddenFor(model => model.StudentResult.UploadedFileUrl) @Html.HiddenFor(model => model.StudentResult.Uploader.Id) @if (Model != null && Model.ExcelData != null && Model.ExcelData.Rows.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12 "> <div class="form-inline pull-right"> <div class="form-group"> <div id="busy" style="display:none"> <span>... Processing</span> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> </div> </div> <div class="form-group" style="margin-right:0; padding-right:0"> <p> @*btn-success btn-success*@ @*<input class="btn btn-white btn-lg" type="submit" name="btnSave" id="btnSave" value="Save" />*@ <input class="btn btn-white btn-lg" type="submit" name="btnSave" id="btnSave" value="Save" /> </p> </div> </div> </div> </div> <hr class="no-top-padding" /> <div class="row"> <div class="col-md-12"> <b>Uploaded File Summary</b> <div class="pull-right record-count-label"> <label class="caption">Sum of Selected Course Unit</label><span id="spFirstSemesterTotalCourseUnit" class="badge">55</span> <label class="caption">Min Unit</label><span id="spFirstSemesterMinimumUnit" class="badge">90</span> <label class="caption">Max Unit</label><span id="spFirstSemesterMaximumUnit" class="badge">8</span> <span class="caption">Total Course</span><span class="badge">56</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive " style="font-size:9pt"> <table class="table table-condensed grid-table table-striped"> <thead> <tr class="well" style="height:35px; vertical-align:middle"> @for (int i = 0; i < Model.ExcelData.Columns.Count; i++) { <th class="rotate" style="border-right: 1px solid gainsboro;"><div><span>@Model.ExcelData.Columns[i].Caption</span></div></th> } </tr> </thead> @for (int i = 0; i < Model.ExcelData.Rows.Count; i++) { <tr> @for (int j = 0; j < Model.ExcelData.Columns.Count; j++) { <td style="border-right: 1px solid gainsboro;"> <span>@Model.ExcelData.Rows[i][j]</span> </td> } </tr> } </table> </div> </div> </div> </div> </div> } </div> } <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ ViewBag.Title = "Purcahse Card"; Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script> alert("Note that if you pay using your atm card or bank account, you are to use your invoice number as the pin when checking your result!") </script> <br /> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h3 class="mb-1">Purchase PUTME Card</h3><hr/> </div> </div> @using (Html.BeginForm("PurchaseCard", "Screening", new { Area = "Applicant" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @*<h5>Please enter your <b>Application Form Number</b> and Etranzact <b>PIN</b> below to check your Application Status.</h5>*@ <div>Please enter your <b>Jamb Number</b> below to generate your invoice.</div> <div id="Name"> <div class="form-group col-md-12 pl-0 ml-0"> @Html.LabelFor(m => m.ApplicantJambDetail.JambRegistrationNumber, "Jamb Number", new { @class = "col-md-12 pl-0 ml-0" }) @Html.TextBoxFor(m => m.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control ", required = "required" }) @Html.ValidationMessageFor(m => m.ApplicantJambDetail.JambRegistrationNumber, null, new { @class = "text-danger" }) </div> <div class="form-group col-md-12 pl-0 ml-0"> <input type="submit" value="Continue" class="btn btn-primary " /> </div> </div> <div class="text-danger"> <p>Note that if you pay using your atm card or bank account, you are to use your invoice number as the pin when checking your result!</p> </div> <div class="col-md-12 pl-0 ml-0"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> } </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") } <file_sep>@model Abundance_Nk.Model.Model.Message @{ ViewBag.Title = "Message"; } <script type="text/javascript"> $(document).ready(function() { $("#btnModal").click(); }); </script> @if (Model != null) { switch (Model.Type) { case 1: { <div class="alert alert-dismissible alert-warning"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@Model.Description</p> </div> break; } case 2: { <div class="alert alert-dismissible alert-danger"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@Model.Description</p> </div> break; } case 3: { <div class="alert alert-dismissible alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@Model.Description</p> </div> break; } } @*<button style="display: none" type="button" id="btnModal" name="btnModal" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>*@ @*<div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> Modal content <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <p>Some text in the modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>*@ }<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ /**/ ViewBag.Title = "Submitted Assignment"; Layout = "~/Areas/Student/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div> <div class="card"> <div class="card-header"> <h3 class="card-title"><i class="fa fa-fw fa-download"></i>My Assignment Submission</h3> </div> <div class="card-body"> <div class="row"> <div class="col-md-12"> <h4><b>Assignment Topic:</b> @Model.EAssignmentSubmission.EAssignment.Assignment</h4> </div> <div class="col-md-12"> <h4><b>Instruction:</b> @Model.EAssignmentSubmission.EAssignment.Instructions</h4> </div> <div class="col-md-12"> <h4><b>Course:</b> @Model.EAssignmentSubmission.EAssignment.Course.Name (@Model.EAssignmentSubmission.EAssignment.Course.Code)</h4> </div> </div> <hr /> <br /> @if (Model.EAssignmentSubmission.EAssignment.Publish) { <div class="row"> <div class="col-md-6"> <h6> <b>Remark:</b> @Model.EAssignmentSubmission.Remarks </h6> </div> <div class="col-md-6"> <h6> <b>Score:</b> @Model.EAssignmentSubmission.Score/@Model.EAssignmentSubmission.EAssignment.MaxScore </h6> </div> </div> <hr /> } <br /> <div class="col-md-12"> <div class="form-group"> <div class="col-sm-10"> @Html.TextAreaFor(model => model.EAssignmentSubmission.TextSubmission, new { @class = "form-control", @readonly = "true", @cols = "120", @rows = "20" }) </div> </div> </div> <br /> <div> <button id="showPdfPreview" class="btn btn-invoice" onclick="showPdf('@Url.Content(Model.EAssignmentSubmission.AssignmentContent)')">Show PDF</button> <button id="hidePdfPreview" style="display:none" class="btn btn-info">Hide PDF</button> </div> <div id="iframeMessage" style="display:none"> @*<object type="application/pdf" data="@Model.EAssignmentSubmission.AssignmentContent" width="100%" height="500"></object>*@ </div> </div> </div> </div> <script> function showPdf(url) { $('#iframeMessage').html(""); var pdfLink = url; var iframe = '<object type="application/pdf" data="' + pdfLink + '" width="100%" height="500"></object>' $('#iframeMessage').append(iframe); $('#iframeMessage').show(); $('#showPdfPreview').hide('false'); $('#hidePdfPreview').show(); return false; } $(document).ready(function () { //$('#showPdfPreview').on('click', function () { // $('#iframeMessage').show('true'); // $('#showPdfPreview').show('false'); // $('#hidePdfPreview').show('true'); //}) $('#hidePdfPreview').on('click', function () { $('#iframeMessage').hide(); $('#showPdfPreview').show(); $('#hidePdfPreview').hide(); }) }) </script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ ViewBag.Title = "Admission List View Criteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function () { $.extend($.fn.dataTable.defaults, { responsive: true }); $('#studentTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Admission List</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("StudentIdData", "UploadAdmission", FormMethod.Post)) { <div class="row"> @*<div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Name, "Session", new {@class = "control-label col-sm-2"}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new {@class = "text-danger"}) </div> </div>*@ <div class="form-group"> @Html.LabelFor(model => model.DateFrom, "Start Date", new { @class = "control-label col-sm-2" }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.DateFrom, new { @class = "form-control", @type = "date" }) @Html.ValidationMessageFor(model => model.DateFrom, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.DateTo, "End Date", new { @class = "control-label col-sm-2" }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.DateTo, new { @class = "form-control", @type = "date" }) @Html.ValidationMessageFor(model => model.DateTo, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } @if (Model == null || Model.AdmissionModelList == null) { return; } @if (Model != null && Model.AdmissionModelList != null) { <div class="col-md-12 table-responsive"> @Html.ActionLink("Get Passport", "DownloadIdCardPassport", new { Controller = "UploadAdmission", Area = "Admin" }, new { @class = "btn btn-success mr5" }) <table class="table table-bordered table-hover table-striped" id="studentTable"> <thead> <tr> <th>SN</th> <th>Person Id</th> <th>Name</th> <th>Image Url</th> <th>Blood Group</th> <th>Matric Number</th> <th>Programme</th> <th>Department</th> <th>Year of admission</th> <th>Year of graduation</th> <th>Session</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.AdmissionModelList.Count; i++) { var SN = i + 1; <tr> <td>@SN</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].PersonId)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].FullName)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].ImageUrl)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].BloodGroup)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].MatricNumber)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].Programme)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].Department)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].YearOfAdmission)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].YearOfGraduation)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].SessionName)</td> </tr> } </tbody> </table> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@{ //Layout = null; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> @*<link href="~/Content/pretty-menu.css" rel="stylesheet" />*@ <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <div class="row"> <div class="col-md-12"> <div class="panel panel-success-head"> <div class="panel-heading"> <h4 class="panel-title">This interface enables users to view, Accept or Reject Application.</h4> <p>Users can Accept or Reject Application Form by simple selecting an Academic Session, Accepted or Rejected from the drop dowm and options respectively. Then click the Find button to search. The search result is displayed in a tabular format below. Users can Accept an Application by selecting the appropriate application and click the Accept button below.</p> </div> </div> </div> </div> @*<div class="row"> <div class="col-md-12 well"> Welcome to admin page. </div> </div>*@ <div class="row"> <div class="col-md-9"> <div id="content" class="content"> </div> </div> </div><file_sep> @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <h5>CLEARANCE DOCUMENTS</h5> <hr /> <div class="container pl-0 ml-0"> <div class="col-md-12 pl-0 ml-0"> <div class="form-group pl-0 ml-0"> <div class="col-md-9 pl-0 ml-0"> <div class="form-inline pl-0 ml-0"> <div class="form-group pl-0 ml-0"> @Html.ActionLink("Print Student Form", "PersonalInformationReport", "Report", new { Area = "PGStudent", studentId = Model.AppliedCourse.Person.Id }, new { @class = "btn btn-warning mr-2 mb-3", target = "_blank", id = "alCourseRegistration" }) @Html.ActionLink("Print Letter of Undertaking", "UnderTakingReport", "Report", new { Area = "PGStudent", studentId = Model.AppliedCourse.Person.Id }, new { @class = "btn btn-warning mb-3", target = "_blank", id = "alCourseRegistration" }) </div> </div> <div class="form-inline"> <div class="form-group"> @Html.ActionLink("Print Clearance Form", "CheckingCredential", "Report", new { Area = "PGStudent", studentId = Model.AppliedCourse.Person.Id }, new { @class = "btn btn-primary mr-2 mt-2", target = "_blank", id = "alCourseRegistration" }) @Html.ActionLink("Print Certificate of Eligibility", "CertificateOfEligibilityReport", "Report", new { Area = "PGStudent", studentId = Model.AppliedCourse.Person.Id }, new { @class = "btn btn-primary mt-2", target = "_blank", id = "alCourseRegistration" }) </div> <div class="form-group margin-bottom-0"> <div id="divProcessingSchoolFeesInvoice" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> <br /> @*<div> <button class="btn btn-primary btn-lg" type="button" name="btnStudentFormLastNext" id="btnStudentFormLastNext" />Next Step </div>*@ </div> <file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Edit O-Level Grade"; } @Html.Partial("BasicSetup/_Edit", @Model)<file_sep> @using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <br /> <div class="bg-warning p-4" style="margin-bottom: 15px; color: #fff; text-align: justify"> <p style="font-weight: bold"> Congratulations! You have been given a Provisional Admission into Abia State University, Uturu </p> <small>This marks the first step of your admission process. Click on the <b>Generate Invoice</b> button below, to generate your invoice and print same by clicking the <b>Print Invoice</b> button. Then proceed to the bank for payment with the generated Invoive Number. Good Luck!<cite title="Source Title"></cite></small> </div> @*TempData.Keep("To")*@ <h5>GENERATE ACCEPTANCE INVOICE</h5> <hr /> <div class="container p-0"> <div class="col-md-12 p-0"> <div class="form-group "> @Html.Label("Application Form Invoice", new { @class = " col-md-12 pl-0" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DisplayFor(model => model.Payment.InvoiceNumber, new { @class = "form-control" }) </div> </div> <div class="form-group "> <div class="col-sm-9 "></div> <div class="col-sm-9 "> <div class="form-inline"> <div class="form-group"> <button class="btn btn-warning mr-3" type="button" name="btnGenerateAcceptanceInvoice" id="btnGenerateAcceptanceInvoice">Generate Invoice</button> @Html.ActionLink("Print Admission Letter", "AdmissionLetter", "Credential", new { Area = "Common", fid = Utility.Encrypt(Model.ApplicationForm.Id.ToString()) }, new { @class = "btn btn-primary ", target = "_blank", id = "alPrintAcceptanceReceipt" }) </div> <div class="form-group margin-bottom-0"> <div id="divProcessingAcceptanceInvoice" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> <div class="form-inline pl-3"> &nbsp;&nbsp;&nbsp; <div class="form-group margin-bottom-0 divAcceptanceInvoice" style="display: none"> <a id="aAcceptanceInvoiceNumber" href="#" target="_blank" class="btn btn-primary btn-lg">Print Invoice</a> </div> </div> <br /> <div id="divAcceptanceInvoiceResult"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBProgrammeViewModel @{ ViewBag.Title = "Post JAMB Programme"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div class="container"> <div class="col-md-12 card p-5"> @using(Html.BeginForm("Index","PostGraduateForm",FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> <h3 style="color: #b78825">Application Form</h3> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="well" style="margin-bottom: 15px"> <blockquote> <p> Kindly enter your Confirmation Order Number in the space provided at the right hand side, and click the Next Button to fill your Application Form. Please endeavor to print your Acknowledgment Slip, Transcript Request Slips and Referee Forms after the submission of your form. </p> </blockquote> </div> </div> <div class="col-md-6"> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> <div class="form-group"> <label style="font-size: 10pt" class=" custom-text-white"> Please enter your Confirmation Order Number</label> @Html.TextBoxFor(model => model.ConfirmationOrderNumber,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ConfirmationOrderNumber,null,new { @class = "text-danger" }) </div> </div> </div> </div> </div> <div class="panel-footer "> <button class="btn btn-primary btn-lg mr5" type="submit" name="submit" id="submit" value="Next"> Submit</button> </div> </div> </div> } </div> </div><file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Admin.ViewModels.VerificationViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="panel panel-default"> <div class="panel-heading"> <h3>Receipt Verification</h3> @using (Html.BeginForm()) { <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.Payment.Payment.SerialNumber, "Serial No", new { @class = "col-sm-2 control-label " }) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.Payment.Payment.SerialNumber, new { @class = "form-control" }) </div> <div class="col-md-4"> <input type="submit" value="Verify" class="btn btn-primary" /> </div> </div> </div> } </div> </div> </div><file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Edit Payment Type"; } @Html.Partial("BasicSetup/_Edit", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentResultViewModel @{ ViewBag.Title = "ConfirmDeleteResultStatus"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Delete StudentResultStatus</h4> </div> @using (Html.BeginForm("DeleteResultStatus", "StudentResult", new {Area = "Admin"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.HiddenFor(m => m.StudentResultStatus.Id) <div> <h3>Are you sure you want to delete this?</h3> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Programme:") </dt> <dd> @Html.DisplayFor(model => model.StudentResultStatus.Programme.Name) </dd> <br /> <dt> @Html.DisplayName("Department:") </dt> <dd> @Html.DisplayFor(model => model.StudentResultStatus.Department.Name) </dd> <br /> <dt> @Html.DisplayName("Level:") </dt> <dd> @Html.DisplayFor(model => model.StudentResultStatus.Level.Name) </dd> <br /> <dt> @Html.DisplayName("Activated:") </dt> <dd> @Html.DisplayFor(model => model.StudentResultStatus.Activated) </dd> <br /> </dl> </div> <div class="form-group"> <div class="col-md-offset-1 col-md-11"> <input type="submit" value="Yes" class="btn btn-success" /> | @Html.ActionLink("Cancel", "ViewStudentResultStatus", "StudentResult", new {@class = "btn btn-success"}) </div> </div> </div> </div> } </div> </div><file_sep>@using Abundance_Nk.Model.Entity @model IEnumerable<Abundance_Nk.Model.Entity.HOSTEL_SERIES> @{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Series</h4> </div> <div class="panel-body"> <div class="col-md-12"> <p> @Html.ActionLink("Create New", "Create", "", new {@class = "btn btn-success"}) </p> <table class="table table-bordered table-hover table-striped"> <tr> <th> @Html.DisplayName("Series Name") </th> <th> @Html.DisplayNameFor(model => model.Activated) </th> <th> @Html.DisplayName("Hostel Name") </th> <th></th> </tr> @foreach (HOSTEL_SERIES item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Series_Name) </td> <td> @Html.DisplayFor(modelItem => item.Activated) </td> <td> @Html.DisplayFor(modelItem => item.HOSTEL.Hostel_Name) </td> <td> @Html.ActionLink("Edit", "Edit", new {id = item.Series_Id}, new {@class = "btn btn-success"}) | @Html.ActionLink("Details", "Details", new {id = item.Series_Id}, new {@class = "btn btn-success"}) | @Html.ActionLink("Delete", "Delete", new {id = item.Series_Id}, new {@class = "btn btn-success"}) </td> </tr> } </table> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ ViewBag.Title = "ViewProcessedStudentResult"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery.validate.min.js"></script> <script src="~/Scripts/jquery.validate.unobtrusive.js"></script> @using (Html.BeginForm("ViewProcessedStudentResult", "Result", new { area = "Admin" }, FormMethod.Post)) { @Html.HiddenFor(model => model.Result.StudentId) <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-book"></i>RAW SCORES</h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Result.MatricNumber, "Matric Number", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Result.MatricNumber, new { @class = "form-control", @id = "MatricNumber" ,@disabled="disabled"}) @Html.ValidationMessageFor(model => model.Result.MatricNumber, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Result.Surname, "Surname", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Result.Surname, new { @class = "form-control", @id = "Surname", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Result.Surname, "Othernames", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Result.firstname_middle, new { @class = "form-control", @id = "Surname", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.Result.firstname_middle, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Result.GPA, "GPA", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Result.GPA, new { @class = "form-control", @id = "GPA", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.Result.GPA, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Result.CGPA, "CGPA", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Result.CGPA, new { @class = "form-control", @id = "CGPA", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.Result.CGPA, null, new { @class = "text-danger" }) </div> </div> </div> @if (Model == null || Model.ResultList == null) { return; } @if (Model != null && Model.ResultList.Count > 0) { <div class="row"> <div class="col-md-3 col-md-offset-5"> <h3> <b>RAW SCORE</b></h3> </div> </div> <table class="table table-responsive table-striped"> <tr> <th>S/N</th> <th> COURSE CODE </th> <th> SCORES </th> <th> AGGREGATE SCORES </th> <th> LETTER GRADE </th> <th> WTD GRADE POINTS </th> </tr> @for (int i = 0; i < Model.ResultList.Count; i++) { <tr> <td> @(i + 1) </td> <td> @Model.ResultList[i].CourseCode </td> <td> @Model.ResultList[i].TestScore / @Model.ResultList[i].ExamScore </td> <td> @Model.ResultList[i].TotalScore </td> <td> @Model.ResultList[i].Grade </td> <td> @Model.ResultList[i].WGP </td> </tr> } </table> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.RejectCategory, "Category ( W / C / S / E)", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.RejectCategory, new { @class = "form-control", @id = "MatricNumber" }) @Html.ValidationMessageFor(model => model.RejectCategory, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Reason, "Reasons", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Reason, new { @class = "form-control", @id = "Surname" }) @Html.ValidationMessageFor(model => model.Reason, null, new { @class = "text-danger" }) </div> </div> <div class="form-group radio-inline col-md-offset-2"> <div class="col-md-6"> @Html.RadioButtonFor(model => model.Enable, "1",true) @Html.LabelFor(model => model.Result.Surname, "ENABLE", new { @class = " control-label " }) </div> <div class="col-md-4"> @Html.RadioButtonFor(model => model.Enable, "0",false) @Html.LabelFor(model => model.Result.Surname, "DISABLE", new { @class = "control-label " }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Process Result" /> </div> </div> </div> } </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentPaymentViewModel @{ ViewBag.Title = "Edit Student Payment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="well panel-body"> <div class="row"> <div class="col-md-12"> <div class=" text-success"> <h1><b>Edit Student Payment</b></h1> </div> <section id="loginForm"> @using (Html.BeginForm("Edit", "StudentPayment", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <h5>Please enter the <b>Invoice Number</b> in the box below to Edit Student's Payment</h5> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.InvoiceNumber,"Invocie Number", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.TextBoxFor(model => model.InvoiceNumber, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.InvoiceNumber, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Next" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ ViewBag.Title = "ProcessResult"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery.validate.min.js"></script> <script src="~/Scripts/jquery.validate.unobtrusive.js"></script> <script type="text/javascript"> $(document).ready(function () { //Programme Drop down Selected-change event $("#Programme").change(function () { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "Result")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function (departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function (i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }) //Session Drop down Selected change event $("#Session").change(function () { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "Result")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function (semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function (i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }) }); </script> @using (Html.BeginForm("ProcessResult", "Result", new { area = "Admin" }, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-book"></i>PROCESS RESULT </h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.AllSession, new { @class = "form-control", @id = "Session" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @id = "Semester" }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, "Programme", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department" }) @Html.ValidationMessageFor(model => model.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level" }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div> @*<div class="form-group"> @Html.LabelFor(model => model.StudentType.Name, "Student Type", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.StudentType.Id, (IEnumerable<SelectListItem>)ViewBag.StudentType, new { @class = "form-control", @id = "Course" }) @Html.ValidationMessageFor(model => model.StudentType.Id, null, new { @class = "text-danger" }) </div> </div>*@ <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> @if (Model == null || Model.ResultList == null) { return; } @if (Model != null && Model.ResultList.Count > 0) { <table class="table table-responsive table-striped"> <tr> <th> S/N </th> <th> MATRIC NUMBER </th> <th> SURNAME </th> <th> FIRSTNAME </th> <th> MIDDLENAME </th> <th> VIEW </th> <th> PRINT NOTIFICATION OF RESULT </th> </tr> @for (int i = 0; i < Model.ResultList.Count; i++) { <tr> <td> @(i+1) </td> <td> @Model.ResultList[i].MatricNumber </td> <td> @Model.ResultList[i].Surname </td> <td> @Model.ResultList[i].Firstname </td> <td> @Model.ResultList[i].Othername </td> <td> @Html.ActionLink("View", "ViewProcessedStudentResult", new { controller="Result",area="Admin",id=Model.ResultList[i].StudentId}, new { target = "_blank"}) </td> <td> @Html.ActionLink("Print", "NotificationOfResult", new { controller = "Result", area = "Admin", id = Model.ResultList[i].StudentId }, new { target = "_blank" }) </td> </tr> } </table> } </div> }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ ViewBag.Title = "Portal Home"; } <div class="panel panel-default" style="padding-top:30px"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <img src="@Url.Content("~/Content/Images/results.jpg")" alt="" width="500px" /> </div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class=" text-center">CHECK PUTME RESULT</h3> </div> <div class="panel-body"> @using (Html.BeginForm("Index", "PostUtmeResult/Index", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Programme</span> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> <br /> <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Jamb Registration No</span> @Html.TextBoxFor(model => model.JambRegistrationNumber, new { @class = "form-control", @placeholder = "Enter your Jamb Registration Number" }) @Html.ValidationMessageFor(model => model.JambRegistrationNumber, null, new { @class = "text-danger" }) </div> <br /> <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Scratch Card Pin No</span> @Html.TextBoxFor(model => model.PinNumber, new { @class = "form-control", @placeholder = "Enter Scratch Card Pin Number" }) @Html.ValidationMessageFor(model => model.PinNumber, null, new { @class = "text-danger" }) </div> <br /> <div class="col-md-offset-6"> <button class="btn btn-default " type="submit">Check Result</button> </div> } </div> <div class="panel-footer"> <p class="text-center"> If you encounter any issues kindly send an email to <cite><EMAIL></cite> or call <cite>07088391544</cite> </p> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.AdmissionProcessingViewModel @{ //Layout = null; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> @*<link href="~/Content/pretty-menu.css" rel="stylesheet" />*@ <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> </head> <body> <div class="row"> <div class="panel panel-success"> <div class="panel-heading"> <h4 class="panel-title">This interface enables users to view, Accept or Reject Application.</h4> <p>Users can Accept or Reject Application Form by simple selecting an Academic Session, Accepted or Rejected from the drop dowm and options respectively. Then click the Find button to search. The search result is displayed in a tabular format below. Users can Accept an Application by selecting the appropriate application and click the Accept button below.</p> </div> </div> </div> @*<div class="row"> <div class="col-md-12 well"> Welcome to admin page. </div> </div>*@ <div class="row"> <div class="col-md-3"> <div class="logopanel"> <h1><span style="color: #428bca">chain</span></h1> </div><!-- logopanel --> <ul class="leftmenu"> <li class="active"><a href="#introduction">Introduction</a></li> <li> <a href="#gettingstarted">Getting Started</a> <ul class="children"> <li><a href="#gettingstarted">HTML Structure</a></li> <li><a href="#basictemplate">Basic Template</a></li> </ul> </li> <li> <a href="#css">CSS</a> <ul class="children"> <li><a href="#bootstrap">Bootstrap</a></li> <li><a href="#filesandstructure">Files &amp; Structure</a></li> </ul> </li> <li> <a href="#javascript">Javascript</a> <ul class="children"> <li><a href="#jquery">jQuery</a></li> <li><a href="#jqueryui">jQuery UI</a></li> <li><a href="#chosen">Select2</a></li> <li><a href="#colorpicker">Colorpicker</a></li> <li><a href="#fileuploads">File Upload</a></li> <li><a href="#calendar">Calendar</a></li> <li><a href="#maps">Maps</a></li> <li><a href="#forms">Forms</a></li> <li><a href="#prettyphoto">Pretty Photo</a></li> <li><a href="#charts">Charts</a></li> <li><a href="#tables">Tables</a></li> <li><a href="#wysiwyg">WYSIWYG</a></li> <li><a href="#codeeditor">Code Editor</a></li> </ul> </li> <li><a href="#angular">Using AngularJS Version</a></li> <li><a href="#credits">Credits</a></li> <li><a href="#changelog">Changelog</a></li> </ul> </div><!-- col-md-3 --> <div class="col-md-9"> <div class="content"> <p style="color: red"> @ViewBag.RejectReason </p> <p>Chain Admin Template Documentation v2.0 by <a href="http://themepixels.com/">ThemePixels</a></p> <h3 id="introduction" class="sectitle">Chain Responsive Bootstrap 3 Admin Template</h3> <p>Created: August 08, 2014 by: <EMAIL> (<EMAIL>)</p> <br /><br /> <div class="alert alert-info"><p>Thank you for purchasing my theme. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form <a href="http://themeforest.net/themepixels">here</a>. Thanks so much!</p></div> <br /> <h3 id="gettingstarted" class="sectitle">Getting Started</h3> <p>Chain is yet another admin template built using Bootstrap and other jQuery plugins that is perfect for your next projects. It provides an easy to use user interface design and a fully responsive layout that is compatible with handheld devices such as phones and tablets. </p> <p>Chain is built to work best in the latest desktop and mobile browsers but older browsers might display differently styled, though fully functional, renderings of certain components.</p> <p class="alert alert-warning"><strong>Note:</strong> Internet Explorer 8 and below are not supported in this template.</p> <h4 id="htmlstructure" class="sectitle">HTML Structure</h4> <p>This theme is a fluid and responsive layout with two columns. The general template structure is the same throughout the template. Below are the general structures.</p> <h5 class="sectitle text-primary">Main Wrapper</h5> <pre>&lt;header&gt; &lt;div class="headerwrapper"&gt;...&lt;/div&gt; &lt;/header&gt; &lt;section&gt; &lt;div class="mainwrapper"&gt; &lt;div class="leftpanel"&gt;...&lt;/div&gt; &lt;div class="mainpanel"&gt;...&lt;/div&gt; &lt;/div&gt; &lt;/section&gt;</pre> <br /> <h5 class="sectitle text-primary">Navigation</h5> <p>This is the navigation menu in the left panel of the template.</p> <pre>&lt;ul class="nav nav-pills nav-stacked"&gt; &lt;li&gt;&lt;a href="index.html"&gt;&lt;i class="fa fa-home"&gt;&lt;/i&gt; &lt;span&gt;Dashboard&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="parent"&gt;&lt;a href=""&gt;&lt;i class="fa fa-edit"&gt;&lt;/i&gt; &lt;span&gt;Forms&lt;/span&gt;&lt;/a&gt; &lt;ul class="children"&gt; &lt;li&gt;&lt;a href="general-forms.html"&gt;&lt;i class="fa fa-caret-right"&gt;&lt;/i&gt; General Forms&lt;/a&gt;&lt;/li&gt; ... &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt;</pre> <p>The top parent element menu name should always wrap with <code>span</code> and a parent menu with sub menus should always have a class of <code>.parent</code>.</p> <p>When a parent menu is active it should have a class of <code>active</code></p> <pre>&lt;li class="active"&gt; ... &lt;/li&gt;</pre> <p>When a parent menu with sub menus is in a dropdown active state the class should be <code>parent parent-focus</code></p> <pre>&lt;li class="parent active"&gt; ... &lt;/li&gt;</pre> <p>When a parent menu with sub menus is active and also in a dropdown active state the class should be <code>parent active</code></p> <pre>&lt;li class="parent active"&gt; ... &lt;/li&gt;</pre> <div class="alert alert-info"><strong>Note:</strong> The navigation menu only has two levels at this time. We may add up to three levels for the coming updates of this template.</div> <br /> <h5 class="sectitle text-primary">Main Panel</h5> <p>The main panel is compose of header, the page header and the main content of the page.</p> <pre>&lt;div class="mainpanel"&gt; &lt;div class="pageheader"&gt; &lt;!-- title and breadcrumb goes here --&gt; &lt;/div&gt; &lt;div class="contentpanel"&gt; &lt;!-- content goes here --&gt; &lt;/div&gt; &lt;/div&gt;</pre> <br /> <h4 id="basictemplate" class="sectitle">Basic Template</h4> <p>For the basic template, open the file <code>blank.html</code> to create a new empty page and then start adding content by adding it inside the <code>contentpanel</code>. You can refer the above structure to create your own page.</p> <br /> <h3 id="css" class="sectitle">CSS</h3> <p>This template uses many css files and most of it are imported in a single css file (style.default.css).</p> <br /> <h4 id="bootstrap" class="sectitle">Bootstrap</h4> <p>We use Bootstrap as the main framework of this template. Bootstrap is open source. It's hosted, developed, and maintained on GitHub. Bootstrap makes front-end web development faster and easier. It's made for folks of all skill levels, devices of all shapes, and projects of all sizes. That's why we use Bootstrap.</p> <p>In this documentation, we will not discuss more about Bootstrap. When using this template it is also important to read their documentation for better understanding and use of the framework. </p> <p><a href="http://getbootstrap.com/" target="_blank" class="btn btn-primary">Learn More About Bootstrap</a></p> <br /> <h4 id="filesandstructure" class="sectitle">Files &amp; Structure</h4> <p>All CSS files are located in the css folder. Some of these files are in minified version so it is not recommended to edit these files but it's also not required so don't worry about it. </p> <p>Below are some of the css files that are allowed for you to edit. </p> <h5 class="sectitle text-primary">style.default.css</h5> <p>This is the main css files of this template. Any new css or changes of the template should be added here.</p> <h5 class="sectitle text-primary">bootstrap.override.css</h5> <p>The css that overrides the css for bootstrap. Any changes that you want to override from bootstrap should be added in here.</p> <p>The rest of the css files are not recommended to edit it but if you know what you're doing then feel free to make changes to it. If you have trouble changing something from it do not hesitate to send us a message.</p> <br /> <h3 id="javascript" class="sectitle">Javascript</h3> <p>This template is powered more by javascript. Disabling javascript in your browser will break the template and some of the features will not work so it is highly recommended that you make sure javascript is enabled.</p> <p>The javascript files can be found in the js/ folder of template. Please be aware that any updates and changes made by yourself on this plugins might break the template. If you have trouble regarding this, please do not hesitate to ask our help.</p> <h4 id="jquery" class="sectitle">jQuery</h4> <p>We use jQuery in all of our pages. For any issues related to jQuery, please contact us for any assistance or you may visit <a href="http://jquery.com/">jQuery Website</a>.</p> <p> The below code should be included in every page of the template by adding it in the <code>&lt;head&gt;</code> or below the page right before the <code>&lt;/body&gt;</code>. </p> <pre>&lt;script src="js/jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery-migrate-1.2.1.min.js"&gt;&lt;/script&gt;</pre> <br /> <h4 id="jquery" class="sectitle">jQuery UI</h4> <p><a href="https://jqueryui.com/">jQuery UI</a> is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.</p> <p>We use this plugin to create animation effects in the elements. Consider visiting their site for more information about using this plugin.</p> <pre>&lt;script src="js/jquery-ui-1.10.3.min.js"&gt;&lt;/script&gt;</pre> <p>Not all pages in the template are using this plugin so if you want to use this just add the code above to the <code>head</code> or below the page.</p> <br /> <h4 id="chosen" class="sectitle">Select 2</h4> <p>Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results. </p> <p><a href="http://ivaynberg.github.io/select2/">See their documentation</a></p> <br /> <h4 id="colorpicker" class="sectitle">Color Picker</h4> <p><span class="text-info">colorpicker.js</span> is a simple jQuery plugin that selects color in the same way you select color in Adobe Photoshop.</p> <p>The use of this plugin is implemented in the <code>general-forms.html</code>. To know more about this plugin, please click the following links below.</p> <p><a href="http://www.eyecon.ro/colorpicker/#about">About</a> | <a href="http://www.eyecon.ro/colorpicker/#download">Download &amp; Updates</a> | <a href="http://www.eyecon.ro/colorpicker/#implement">Implement</a></p> <p>To use this plugin, please refer to Implement link above.</p> <br /> <h4 id="fileuploads" class="sectitle">Dropzone</h4> <p><a href="http://www.dropzonejs.com/">dropzone js</a> is an open source library that provides drag'n'drop file uploads with image previews.</p> <div class="alert alert-info"> <strong>Note:</strong> This does not handle your file uploads on the server. You have to implement the code to receive and store the file yourself. </div> <p>You can see the actual implementation of this in the template of the file <code>general-forms.html</code>. You can learn more about this js code by going to their website.</p> <p><a href="http://www.dropzonejs.com/" class="btn btn-primary btn-small">Learn more about Dropzone</a></p> <br /> <h4 id="chosen" class="sectitle">Calendar</h4> <p>We use Full Calendar as the main calendar for this template.</p> <p><a href="http://arshaw.com/fullcalendar/">FullCalendar</a> is a jQuery plugin that provides a full-sized, drag & drop calendar like the one below. It uses AJAX to fetch events on-the-fly for each month and is easily configured to use your own feed format (an extension is provided for Google Calendar).</p> <p>To learn more about this plugin, please visit <a href="http://arshaw.com/fullcalendar/">http://arshaw.com/fullcalendar/</a>. There you can read their documentation on how to implement the calendar. They also have support to answer your problems related to this plugin.</p> <p>The actual implementation of this plugin to the template can be found in <code>calendar.html</code> or you can view it in demo under the menu <code>Pages -> Calendar</code>.</p> <br /> <h4 id="maps" class="sectitle">Maps</h4> <p>We use two kinds of map for this template, one is the gmaps.js powered by Google map and the other one is jVectorMap.</p> <h5 class="sectitle text-primary">Gmaps</h5> <p>gmaps.js allows you to use the potential of Google Maps in a simple way. No more extensive documentation or large amount of code.</p> <p>You can see the example in our template in <code>maps.html</code>. You can also look for more examples from their website by going to this link - <a href="http://hpneo.github.io/gmaps/examples.html">http://hpneo.github.io/gmaps/examples.html</a>.</p> <p>You can also spend some time reading their documentation in this link - <a href="http://hpneo.github.io/gmaps/documentation.html">http://hpneo.github.io/gmaps/documentation.html</a></p> <br /> <h5 class="sectitle text-primary">jVectorMap</h5> <p>jVectorMap uses only native browser technologies like JavaScript, CSS, HTML, SVG or VML. No Flash or any other proprietary browser plug-in is required.</p> <p> You can view our template by clicking the menu Maps to view the actual implementation of this map to our template. For better understanding you can also read more on this link - <a href="http://jvectormap.com/tutorials/getting-started/">http://jvectormap.com/tutorials/getting-started/</a>. You can also see some of their examples on this link - <a href="http://jvectormap.com/examples/world-gdp/">http://jvectormap.com/examples/world-gdp/</a> </p> <p>jVectorMap also allows you to display map by country as what you see in our demo. We only display the map of the USA but you can display your own country by downloading some additional file in this link - <a href="http://jvectormap.com/maps/world/europe/">http://jvectormap.com/maps/world/europe/</a></p> <br /> <h4 id="forms" class="sectitle">Forms</h4> <p>In this section, we will discuss about form related scripts that we use in our template. Everything discuss here can all be found and implemented under <strong>Forms</strong> menu in our template demo.</p> <h5 class="sectitle text-primary">jQuery Tags Input</h5> <p>This plugin will turn your boring tag list into a magical input that turns each tag into a style-able object with its own delete link. The following code below are needed to add in <code>&lt;head&gt;</code> of your page.</p> <p>The CSS</p> <pre>&lt;link rel="stylesheet" href="css/jquery.tagsinput.css" /&gt;</pre> <p>The Plugin</p> <pre>&lt;script src="js/jquery.tagsinput.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>&lt;script&gt; jQuery(function(){ jQuery('#tags').tagsInput({width:'auto'}); }); &lt;/script&gt;</pre> <p>Markup</p> <pre>&lt;input name="tags" id="tags" class="form-control" value="foo,bar,baz" /&gt;</pre> <br /> <h5 class="sectitle text-primary">Autogrow Textarea</h5> <p><strong>jquery.autogrow-textarea.js</strong> automatically grow and shrink textareas with the content as you type.</p> <p>The Plugin</p> <pre>&lt;script src="js/jquery.autogrow-textarea.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>&lt;script&gt; jQuery(function(){ jQuery('#autoResizeTA').autogrow(); }); &lt;/script&gt;</pre> <p>Markup</p> <pre>&lt;textarea id="autoResizeTA" class="form-control" rows="5"&gt;&lt;/textarea&gt;</pre> <br /> <h5 class="sectitle text-primary">Spinner</h5> <p>Enhance a text input for entering numeric values, with up/down buttons and arrow key handling. This feature is part of jQuery UI</p> <p>The Plugin</p> <pre>&lt;script src="js/jquery-ui-1.10.3.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery(function(){ var spinner = jQuery('#spinner').spinner(); spinner.spinner('value', 0); });</pre> <p>Markup</p> <pre>&lt;input type="text" id="spinner" /&gt;</pre> <br /> <h5 class="sectitle text-primary">Time Picker</h5> <p>Easily select a time for a text input using your mouse or keyboards arrow keys. To lean more about time picker, please go this link - <a href="http://jdewit.github.io/bootstrap-timepicker/">http://jdewit.github.io/bootstrap-timepicker/</a></p> <p>The CSS</p> <pre>&lt;link rel="stylesheet" href="css/bootstrap-timepicker.min.css" /&gt;</pre> <p>The Plugin</p> <pre>&lt;script src="js/bootstrap-timepicker.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery('#timepicker').timepicker({defaultTIme: false});</pre> <p>Markup</p> <pre>&lt;div class="input-group"&gt; &lt;span class="input-group-addon"&gt; &lt;i class="glyphicon glyphicon-time"&gt;&lt;/i&gt; &lt;/span&gt; &lt;div class="bootstrap-timepicker"&gt; &lt;input id="timepicker" type="text" class="form-control"/&gt; &lt;/div&gt; &lt;/div&gt;</pre> <br /> <h5 class="sectitle text-primary">Input Mask</h5> <p>Input masks allows a user to more easily enter fixed width input where you would like them to enter the data in a certain format (dates,phones, etc). To learn more about this plugin, please visit - <a href="http://digitalbush.com/projects/masked-input-plugin">http://digitalbush.com/projects/masked-input-plugin</a></p> <p>The Plugin</p> <pre>&lt;script src="js/jquery.maskedinput.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery(function(){ jQuery("#date").mask("99/99/9999"); });</pre> <p>Markup</p> <pre>&lt;div class="input-group"&gt; &lt;span class="input-group-addon"&gt; &lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt; &lt;/span&gt; &lt;input type="text" placeholder="Date" id="date" class="form-control" /&gt; &lt;/div&gt;</pre> <br /> <h5 class="sectitle text-primary">Form Validation</h5> <p>This jQuery plugin makes simple clientside form validation trivial, while offering lots of option for customization. To learn more about this plugin, please visit - <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></p> <p>The Plugin</p> <pre>&lt;script src="js/jquery.validate.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery("#basicForm").validate({ highlight: function(element) { jQuery(element).closest('.form-group').removeClass('has-success').addClass('has-error'); }, success: function(element) { jQuery(element).closest('.form-group').removeClass('has-error'); } });</pre> <p>Markup</p> <pre>&lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Email &lt;span class="asterisk"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;div class="col-sm-9"&gt; &lt;input type="email" name="email" class="form-control" placeholder="Type your email..." required /&gt; &lt;/div&gt; &lt;/div&gt;</pre> <br /> <h5 class="sectitle text-primary">Bootstrap Wizard</h5> <p> This twitter bootstrap plugin builds a wizard out of a formatter tabbable structure. It allows to build a wizard functionality using buttons to go through the different wizard steps and using events allows to hook into each step individually. To learn more about this template, please visit - <a href="https://github.com/VinceG/twitter-bootstrap-wizard">https://github.com/VinceG/twitter-bootstrap-wizard</a> </p> <p>The Plugin</p> <pre>&lt;script src="js/bootstrap-wizard.min.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery(function(){ jQuery('#basicWizard').bootstrapWizard(); });</pre> <p>Markup</p> <pre>&lt;div id="validationWizard" class="basic-wizard"&gt; &lt;ul class="nav nav-pills nav-justified"&gt; ... &lt;/ul&gt; &lt;div class="tab-content"&gt; &lt;div class="tab-pane" id="tab1"&gt; ... &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre> <br /> <h4 id="prettyphoto" class="sectitle">Pretty Photo</h4> <p>This template uses <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">prettyPhoyo</a> plugin in Media Manager page. PrettyPhoto is a jQuery lightbox clone. Not only does it support images, it also support for videos, flash, YouTube, iframes and ajax. It's a full blown media lightbox.</p> <p>If you need support with prettyPhoto, first take a look at their <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/prettyphoto-faqs/">FAQs</a></p> <p>If you were not able to find an answer, feel free to take look at their <a href="http://forums.no-margin-for-errors.com/categories/prettyphoto-support">Forum</a></p> <p>The CSS</p> <pre>&lt;link href="css/prettyPhoto.css" rel="stylesheet"&gt;</pre> <p>The Plugin</p> <pre>&lt;script src="js/jquery.prettyPhoto.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery("a[rel^='prettyPhoto']").prettyPhoto();</pre> <p>Markup</p> <pre>&lt;a href="images/photos/media3.png" rel="prettyPhoto"&gt; &lt;img src="images/photos/media3.png" class="img-responsive" alt="" /&gt; &lt;/a&gt;</pre> <br /> <h4 id="charts" class="sectitle">Charts</h4> <p>This template uses 3 kinds of charts to be used in your page. You can view the demo of this template in <code>graphs.html</code></p> <br /> <h5 class="sectitle text-primary">Flot</h5> <p>Flot is a pure JavaScript plotting library for jQuery, with a focus on simple usage, attractive looks and interactive features. You can visit their site <a href="http://www.flotcharts.org/">here</a></p> <p>You can view more examples to this link - <a href="http://www.flotcharts.org/flot/examples/">http://www.flotcharts.org/flot/examples/</a></p> <p>The Javascript</p> <pre>&lt;script src="js/flot/flot.min.js"&gt;&lt;/script&gt; &lt;script src="js/flot/flot.resize.min.js"&gt;&lt;/script&gt; &lt;script src="js/flot/flot.symbol.min.js"&gt;&lt;/script&gt; &lt;script src="js/flot/flot.crosshair.min.js"&gt;&lt;/script&gt; &lt;script src="js/flot/flot.categories.min.js"&gt;&lt;/script&gt; &lt;script src="js/flot/flot.pie.min.js"&gt;&lt;/script&gt;</pre> <p><code>flot.resize.min.js</code> is used to resize the graph automatically when it detects an event in resizing the window.</p> <p><code>flot.symbol.min.js</code> is used when you want to use other points instead of the default (circle) points.</p> <p><code>flot.crosshair.min.js</code> is used when you want to have crosshair in pointing your cursor in the graph.</p> <p><code>flot.pie.min.js</code> is used when you want to display a pie chart.</p> <p><code>flot.categories.min.js</code> is used when you want to use a category (i.e month) instead of using numbers in the graph</p> <br /> <h5 class="sectitle text-primary">Morris</h5> <p>Morris is another javascript set for displaying charts in your project.</p> <p><a href="http://www.oesmith.co.uk/morris.js/index.html" class="btn btn-primary">View Examples</a> &nbsp; <a href="http://www.oesmith.co.uk/morris.js/index.html#getting_started" class="btn btn-primary">How to Use</a></p> <br /> <h5 class="sectitle text-primary">Sparkline</h5> <p>This jQuery plugin generates sparklines (small inline charts) directly in the browser using data supplied either inline in the HTML, or via javascript. </p> <p> To add some sparklines to your web page, please follow the quick guides in this link: <br /> <a href="http://omnipotent.net/jquery.sparkline/#s-docs">http://omnipotent.net/jquery.sparkline/#s-docs</a> </p> <br /> <h4 id="tables" class="sectitle">Tables</h4> <p>We use Bootstrap styles for table in our template.</p> <h5 class="sectitle text-primary">Basic Table</h5> <p>For basic styling add the base class <code>.table</code> to any <code>&lt;table&gt;</code></p> <pre>&lt;table class="table"&gt; ... &lt;/table&gt;</pre> <h5 class="sectitle text-primary">Striped Rows</h5> <p>Use <code>.table-striped</code> to add zebra-striping to any table row within the <code>&lt;tbody&gt;</code>.</p> <pre>&lt;table class="table table-striped"&gt; ... &lt;/table&gt;</pre> <h5 class="sectitle text-primary">Responsive Table</h5> <p>Wrap any <code>&lt;table&gt;</code> element in <code>.table-responsive</code> to make them responsive and scroll horizontally when viewed in smaller screens.</p> <pre>&lt;div class="table-responsive"&gt; &lt;table class="table"&gt; ... &lt;/table&gt; &lt;/div&gt;</pre> <br /> <div class="alert alert-info">To view other styles for table visit: <a href="http://getbootstrap.com/css/#tables">http://getbootstrap.com/css/#tables</a></div> <br /> <h4 id="wysiwyg" class="sectitle">WYSIWYG</h4> <p>This template uses 2 kinds of text editor, the <a href="http://jhollingworth.github.io/bootstrap-wysihtml5/">WYSIHTML5</a> and <a href="http://ckeditor.com/">CKEditor</a>.</p> <h5 class="sectitle text-primary">HTML5 WYSIWYG Editor</h5> <p>Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.</p> <p>The CSS</p> <pre>&lt;link rel="stylesheet" href="css/bootstrap-wysihtml5.css" /&gt;</pre> <p>The Javascript</p> <pre>&lt;script src="js/bootstrap-wysihtml5.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery('#wysiwyg').wysihtml5({color: true,html:true});</pre> <p>Markup</p> <pre>&lt;textarea id="wysiwyg" rows="10"&gt;&lt;/textarea&gt;</pre> <br /> <h5 class="sectitle text-primary">CKEditor</h5> <p>CKEditor is a ready-for-use HTML text editor designed to simplify web content creation. It's a WYSIWYG editor that brings common word processor features directly to your web pages.</p> <br /> <p><a href="http://ckeditor.com/" class="btn btn-primary">Visit Their Website</a></p> <br /> <p>The Javasript</p> <pre>&lt;script src="js/ckeditor/ckeditor.js"&gt;&lt;/script&gt; &lt;script src="js/ckeditor/adapters/jquery.js"&gt;&lt;/script&gt;</pre> <p>Usage</p> <pre>jQuery('#ckeditor').ckeditor();</pre> <p>Markup</p> <pre>&lt;textarea id="ckeditor" rows="10"&gt;&lt;/textarea&gt;</pre> <br /> <h4 id="codeeditor" class="sectitle">Code Editor</h4> <p>This template uses CodeMirror for the text editor. You can view more examples and documentation at their website <a href="http://codemirror.net/">here</a></p> <br /> <h3 id="angular" class="sectitle">Using AngularJS Version</h3> <p>By using this version, we assume that you already familiar using NodeJS. If you haven't used this before, be sure to read <a href="http://nodejs.org/">NodeJS</a> documentation to guide you on how to get started and also for the installation guide.<p> <p> The angular version of this template is located in folder <strong>angular</strong>. This angular version are managed by <a href="http://bower.io/">Bower</a> (Dependency Manager) and <a href="http://gruntjs.com/">GruntJS</a> (Task Runner). If you haven't used Bower and Grunt before, be sure to check out the <a href="http://bower.io/#getting-started">Bower Getting Started</a> and <a href="http://gruntjs.com/getting-started">Grunt Getting Started</a> guide as it explains how to use the two. </p> <br> <h5>Install Dependencies</h5> <p>By running commands down below, we assume that you already install Bower and Grunt in your machine. Open the terminal and go inside the angular/ folder. The command below will download and install all dependencies of this template to bower_components/ folder.</p> <br> <pre>$ bower install</pre> <p>After installing all dependencies, run the following command below for grunt task plugins</p> <pre>$ npm install</pre> <p>After running the commands above, you can now run and view it in the browser by running the command below:</p> <pre>grunt serve</pre> <br /> <h3 id="credits" class="sectitle">Credits</h3> <p>I've used the following images, icons or other files as listed.</p> <ul> <li><a href="http://getbootstrap.com/">Bootstrap</a></li> <li><a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome Icons</a> by Font Awesome</li> <li><a href="http://jquery.com/">jQuery</a> by <NAME></li> <li><a href="http://jqueryui.com/">jQuery UI</a></li> <li><a href="http://touchpunch.furf.com/">Touch Punch</a> by <NAME></li> <li><a href="http://arshaw.com/fullcalendar/">Full Calendar</a> by <NAME></li> <li><a href="http://code.google.com/p/flot/">Flot Charts</a></li> <li><a href="http://boedesign.com/blog/2009/07/11/growl-for-jquery-gritter/">Gritter for jQuery (Growl)</a> by <NAME></li> <li><a href="http://www.fontsquirrel.com/fonts/lato">Lato Font</a> by SIL</li> <li><a href="http://jdewit.github.com/bootstrap-timepicker ">Bootstrap Time Picker</a> by <a href="http://twitter.com/joris_dewit"><NAME></a></li> <li><a href="http://github.com/VinceG/twitter-bootstrap-wizard">Bootstrap Wizard</a> by <NAME> & <NAME></li> <li><a href="http://jhollingworth.github.io/bootstrap-wysihtml5/">Bootstrap WYSIWYG</a> by <NAME></li> <li><a href="http://ivaynberg.github.io/select2/">Select 2</a> by ivaynberg</li> <li><a href="http://www.eyecon.ro/colorpicker/">Color Picker</a> by <NAME></li> <li><a href="http://www.dropzonejs.com/">Dropzone</a> by <NAME></li> <li><a href="http://hpneo.github.com/gmaps/">GMaps</a> by <NAME></li> <li><a href="http://imsky.github.io/holder/">Holder JS</a> by <NAME></li> <li><a href="http://jvectormap.com/">jVector Map</a> by <NAME></li> <li><a href="https://github.com/carhartl/jquery-cookie">jQuery Cookie</a> by <NAME></li> <li><a href="http://datatables.net">jQuery Data Tables</a> by Allan Jardine</li> <li><a href="http://digitalbush.com">Masked Input</a> by <NAME></li> <li><a href="http://www.no-margin-for-errors.com">prettyPhoto</a> by <NAME></li> <li><a href="http://omnipotent.net/jquery.sparkline/">jQuery Sparkline</a></li> <li><a href="https://github.com/jzaefferer/jquery-validation">jQuery Form Validation</a> by <NAME></li> <li><a href="http://modernizr.com/">Modernizr</a></li> <li><a href="http://www.oesmith.co.uk/morris.js/">Morris Charts</a> by <NAME></li> </ul> <br /> <h3 id="changelog" class="sectitle">Changelog</h3> <h5 class="sectitle"> Version 2.0</h4> <ul> <li>Added: LESS Files (compiled using Grunt)</li> <li>Added: AngularJS Version (http://themepixels.com/demo/webpage/chain-angular)</li> <li>Added: Bower Dependency Manager for AngularJS Version</li> <li>Added: Grunt Task Runner for Angular JS Version</li> </ul> <br> <h5 class="sectitle"> Version 1.0</h4> <ul> <li>Initial Release</li> </ul> <br /><br /> <p>Once again, thank you so much for purchasing this theme. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.</p> <p class="text-primary">ThemePixels</p> </div><!-- content --> </div><!-- col-md-9 --> </div> </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffDataViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @section Scripts { @*<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" /> <script src="~/Scripts/bootstrap-datepicker.js"></script> <link href="~/Content/jquery-ui-1.10.3.css" rel="stylesheet" /> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script>*@ <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function () { $(".Load").hide(); $('.date').datepicker({ dateFormat: "mm/dd/yy", showOtherMonths: true, selectOtherMonths: true, autoclose: true, changeMonth: true, changeYear: true, yearRange: "-100:+0" }); var src = $('#passport').attr('src'); if (src == undefined) { $('#passport').attr('src', '/Content/Images/default_avatar.png'); } var id = $("#@Html.IdFor(m => m.Staff.Id)").val(); initSimpleFileUpload(); $("#hl-start-upload").on('click', function () { if (jqXHRData) { jqXHRData.submit(); } return false; }); $("#fu-my-simple-upload").on('change', function() { $("#tbx-file-path").val(this.files[0].name); }); function initSimpleFileUpload() { 'use strict'; $('#fu-my-simple-upload').fileupload({ url: '@Url.Content("~/Admin/StaffProfile/UploadFile")', dataType: 'json', add: function(e, data) { jqXHRData = data }, send: function(e) { $('#fileUploadProgress').show(); }, done: function(event, data) { if (data.result.isUploaded) { //alert("success"); } else { $("#tbx-file-path").val(""); alert(data.result.message); } //alert(data.result.imageUrl); //var imageUrl = data.result.imageUrl; $('#passport').attr('src', data.result.imageUrl); $('#fileUploadProgress').hide(); }, fail: function(event, data) { if (data.files[0].error) { alert(data.files[0].error); } } }); } }); $("#Staff_State_Id").change(function () { $("#Staff_LocalGovernment_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetLocalGovernmentsByState")', //we are calling json method dataType: 'json', data: { id: $("#Staff_State_Id").val() }, success: function (lgas) { $("#Staff_LocalGovernment_Id").append('<option value="' + 0 + '">-- Select --</option>'); $.each(lgas, function (i, lga) { $("#Staff_LocalGovernment_Id").append('<option value="' + lga.Value + '">' + lga.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve lgas.' + ex); } }); return false; }); function saveBioData() { var valueArray = populateBioDataRecord(); var myJson = JSON.stringify(valueArray); $.ajax({ type: 'POST', url: '@Url.Action("SavePersonalDetails")', dataType: 'json', data: { myRecordArray: myJson }, beforeSend: function () { $(".Load").show(); $("#loading").show(); $("#preLoading").hide(); }, complete: function () { $(".Load").hide(); $("#loading").hide(); $("#preLoading").show(); }, success: function (result) { if (result.IsError === false) { $("#@Html.IdFor(m => m.Staff.Id)").val(result.Id); alert(result.Message); } else { alert(result.Message); } }, error: function (ex) { alert('Save operation failed.' + ex); } }); } function saveEmploymentDetails() { var valueArray = populateBioDataRecord(); var myJson = JSON.stringify(valueArray); $.ajax({ type: 'POST', url: '@Url.Action("SaveEmploymentInformation")', dataType: 'json', data: { myRecordArray: myJson }, beforeSend: function () { $(".Load").show(); }, complete: function () { $(".Load").hide(); }, success: function (result) { if (result.IsError === false) { $("#@Html.IdFor(m => m.Staff.Id)").val(result.Id); //$("#Staff_Id").val(result.Id); alert(result.Message); } else { alert(result.Message); } }, error: function (ex) { alert('Save operation failed.' + ex); } }); } function populateBioDataRecord() { var valueArray = { "FirstName": $("#Staff_FirstName").val(), "LastName": $("#Staff_LastName").val(), "OtherName": $("#Staff_OtherName").val(), "SexId": $("#Staff_Sex_Id").val(), "MobilePhone": $("#Staff_MobilePhone").val(), "Email": $("#Staff_Email").val(), "ContactAddress": $("#Staff_ContactAddress").val(), "DOBString": $("#Staff_DateOfBirth").val(), "StateId": $("#Staff_State_Id").val(), "LGAId": $("#Staff_LocalGovernment_Id").val(), "ReligionId": $("#Staff_Religion_Id").val(), "MaritalStatusId": $("#Staff_MaritalStatus_Id").val(), "StaffTypeId": $("#Staff_Type_Id").val(), "GenotypeId": $("#Staff_Genotype_Id").val(), "BloodGroupId": $("#Staff_BloodGroup_Id").val(), "Id": $("#Staff_Id").val(), "DepartmentId": $("#EmployeeDetail_Department_Id").val(), "DateOfPresentAppointment": $("#EmployeeDetail_DateOfPresentAppointment").val(), "StaffNumber": $("#EmployeeDetail_StaffNumber").val(), "DesignationId": $("#EmployeeDetail_Designation_Id").val(), "GradeLevelId": $("#EmployeeDetail_GradeLevel_Id").val(), "UnitId": $("#EmployeeDetail_Unit_Id").val(), "DateOfPreviousAppointment": $("#EmployeeDetail_DateOfPreviousApointment").val(), "DateOfRetirement": $("#EmployeeDetail_DateOfRetirement").val(), "InstitutionAttended": $("#StaffQualification_InstitutionAttended").val(), "EducationalQualificationId": $("#StaffQualification_EducationalQualification_Id").val(), "StaffResultGradeId": $("#StaffQualification_StaffResultGrade_Id").val(), "FromDate": $("#StaffQualification_FromDateStr").val(), "ToDate": $("#StaffQualification_ToDateStr").val(), "CertificateNumber": $("#StaffQualification_CertificateNumber").val(), "SignatureFileUrl": $("#Staff_SignatureFileUrl").val() } return valueArray; } function saveQualificationDetails() { var valueArray = populateBioDataRecord(); var myJson = JSON.stringify(valueArray); $.ajax({ type: 'POST', url: '@Url.Action("SaveQualificationInformation")', dataType: 'json', data: { myRecordArray: myJson }, beforeSend: function () { $(".Load").show(); }, complete: function () { $(".Load").hide(); }, success: function (result) { if (result.IsError === false) { $("#@Html.IdFor(m => m.Staff.Id)").val(result.Id); //$("#Staff_Id").val(result.Id); alert(result.Message); } else { alert(result.Message); } }, error: function (ex) { alert('Save operation failed.' + ex); } }); } </script> } <br /> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <h3>Staff Profile</h3> <hr /> <div class="panel panel-default"> <div class="panel-body"> <div class="container"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#bio">Bio-Data</a></li> <li><a data-toggle="tab" href="#employment">Employment Details</a></li> <li><a data-toggle="tab" href="#qualification">Qualification Details</a></li> </ul> <div class="tab-content"> <div id="bio" class="tab-pane fade in active"> <h3>Staff Bio-Data</h3> @Html.HiddenFor(model => model.Person.Id) <hr /> <div style="display: none" class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Id, "ID:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.LastName, "LastName:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.LastName, new { @class = "form-control", @id = "Staff_LastName" }) @Html.ValidationMessageFor(model => model.Staff.Person.LastName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.FirstName, "FirstName:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.FirstName, new { @class = "form-control", @id = "Staff_FirstName" }) @Html.ValidationMessageFor(model => model.Staff.Person.FirstName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.OtherName, "OtherNames:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.OtherName, new { @class = "form-control", @id = "Staff_OtherName" }) @Html.ValidationMessageFor(model => model.Staff.Person.OtherName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.Sex.Id, "Sex:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Person.Sex.Id, (IEnumerable<SelectListItem>)ViewBag.Sex, new { @class = "form-control", @id = "Staff_Sex_Id" }) @Html.ValidationMessageFor(model => model.Staff.Person.Sex.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.MobilePhone, "Phone Number:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.MobilePhone, new { @class = "form-control", @id = "Staff_MobilePhone" }) @Html.ValidationMessageFor(model => model.Staff.Person.MobilePhone) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.Email, "Email:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.Email, new { @class = "form-control", @id = "Staff_Email" }) @Html.ValidationMessageFor(model => model.Staff.Person.Email) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.ContactAddress, "Address:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.ContactAddress, new { @class = "form-control", @id = "Staff_ContactAddress" }) @Html.ValidationMessageFor(model => model.Staff.Person.ContactAddress) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.DateOfBirth, "DateOfBirth:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.Person.DateOfBirth, new { @class = "form-control date", @id = "Staff_DateOfBirth" }) @Html.ValidationMessageFor(model => model.Staff.Person.DateOfBirth) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.State.Id, "State:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.State, new { @class = "form-control", @id = "Staff_State_Id" }) @Html.ValidationMessageFor(model => model.Staff.Person.State.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.LocalGovernment.Id, "Local Government Area:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Person.LocalGovernment.Id, (IEnumerable<SelectListItem>)ViewBag.LGA, new { @class = "form-control", @id = "Staff_LocalGovernment_Id" }) @Html.ValidationMessageFor(model => model.Staff.Person.LocalGovernment.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Person.Religion.Id, "Religion:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Person.Religion.Id, (IEnumerable<SelectListItem>)ViewBag.Religion, new { @class = "form-control", @id = "Staff_Religion_Id" }) @Html.ValidationMessageFor(model => model.Staff.Person.Religion.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.MaritalStatus.Id, "Marital Status:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.MaritalStatus.Id, (IEnumerable<SelectListItem>)ViewBag.MaritalStatus, new { @class = "form-control", @id = "Staff_MaritalStatus_Id" }) @Html.ValidationMessageFor(model => model.Staff.MaritalStatus.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Type.Id, "Staff Type:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Type.Id, (IEnumerable<SelectListItem>)ViewBag.StaffType, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.Type.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Genotype.Id, "Genotype:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.Genotype.Id, (IEnumerable<SelectListItem>)ViewBag.Genotype, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.Genotype.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.BloodGroup.Id, "BloodGroup:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Staff.BloodGroup.Id, (IEnumerable<SelectListItem>)ViewBag.BloodGroup, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.BloodGroup.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.ProfileDescription, "Other Information:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.ProfileDescription, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.ProfileDescription) </div> </div> </div> <div class="row"> <div class="panel-body"> <div class="row"> <div class="col-md-12 padding-bottom-3"> <img id="passport" src="@Url.Content('~' + Model.Staff.Person.SignatureFileUrl)" alt="" style="max-width:150px" /> </div> </div> <div class="row padding-bottom-5"> <div class="col-md-6 "> @Html.HiddenFor(model => model.Staff.Person.SignatureFileUrl, new { id = "hfPassportUrl", name = "hfPassportUrl" }) <input type="text" id="tbx-file-path" readonly="readonly" /> </div> <div class="col-md-6"> @Html.TextBoxFor(m => m.MyFile, new { id = "fu-my-simple-upload", type = "file", style = "color:transparent;" }) </div> </div> <div class="row padding-bottom-10"> <div class="col-md-12"> <input class="btn btn-default btn-metro" type="button" name="hl-start-upload" id="hl-start-upload" value="Upload Signature" /> </div> </div> <div class="row"> <div class="col-md-12"> <div id="fileUploadProgress" style="display:none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Uploading ...</span> </div> </div> </div> </div> </div> <div class="row"> @*<div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.SignatureFileUrl, "Staff Signature:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Staff.SignatureFileUrl, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Staff.SignatureFileUrl) </div> </div>*@ <div class="col-md-6"> <div class="form-group"> <button type="button" id="btnSaveBioData" class="btn btn-primary" onclick="saveBioData()"> <span id="preLoading">Save</span> <span style="display: none;" id="loading"><img class="loading" src="~/Content/images/loading.svg" width="20" height="20"></span> </button> &nbsp; @*<span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span>*@ </div> </div> </div> </div> <div id="employment" class="tab-pane fade"> <h3>Employment Information</h3> <hr /> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.DateOfPresentAppointment, "Employment Date:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.EmployeeDetail.DateOfPresentAppointment, new { @class = "form-control date" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.DateOfPresentAppointment) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.Department.Name, "Department:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.EmployeeDetail.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.Department.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.StaffNumber, "Staff Number:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.EmployeeDetail.StaffNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.StaffNumber) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.Designation.Id, "Designation:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.EmployeeDetail.Designation.Id, (IEnumerable<SelectListItem>)ViewBag.Designation, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.Designation.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.GradeLevel.Id, "Level:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.EmployeeDetail.GradeLevel.Id, (IEnumerable<SelectListItem>)ViewBag.GradeLevel, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.GradeLevel.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.Unit.Id, "Unit:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.EmployeeDetail.Unit.Id, (IEnumerable<SelectListItem>)ViewBag.Unit, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.Unit.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.DateOfPreviousApointment, "Date Of Previous Appointment:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.EmployeeDetail.DateOfPreviousApointment, new { @class = "form-control date" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.DateOfPreviousApointment) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.EmployeeDetail.DateOfRetirement, "Date Of Retirement:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.EmployeeDetail.DateOfRetirement, new { @class = "form-control date" }) @Html.ValidationMessageFor(model => model.EmployeeDetail.DateOfRetirement) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <button type="button" id="btnSaveStudentDetail" class="btn btn-primary" onclick="saveEmploymentDetails()">Save</button> &nbsp; <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> <div id="qualification" class="tab-pane fade"> <h3>Qualification Information</h3> <hr /> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.InstitutionAttended, "Institution Attended:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.StaffQualification.InstitutionAttended, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StaffQualification.InstitutionAttended) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.EducationalQualification.Name, "Educational Qualification:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.StaffQualification.EducationalQualification.Id, (IEnumerable<SelectListItem>)ViewBag.EducationalQualification, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StaffQualification.EducationalQualification.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.StaffResultGrade.Grade, "Grade:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.StaffQualification.StaffResultGrade.Id, (IEnumerable<SelectListItem>)ViewBag.StaffResultGrade, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StaffQualification.StaffResultGrade.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.CertificateNumber, "Certificate Number:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.StaffQualification.CertificateNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StaffQualification.CertificateNumber) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.FromDateStr, "From:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.StaffQualification.FromDateStr, new { @class = "form-control date" }) @Html.ValidationMessageFor(model => model.StaffQualification.FromDateStr) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StaffQualification.ToDateStr, "To:", new { @class = "control-label" }) @Html.TextBoxFor(model => model.StaffQualification.ToDateStr, new { @class = "form-control date" }) @Html.ValidationMessageFor(model => model.StaffQualification.ToDateStr) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <button type="button" id="btnSponsorDetail" class="btn btn-primary" onclick="saveQualificationDetails()">Save</button> &nbsp; <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Windows.Forms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class PaymentReportGeneral : System.Web.UI.Page { //private List<Department> departments; public Programme Programme { get { return new Programme() { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public FeeType SelectedFeeTypes { get { return new FeeType { Id = Convert.ToInt32(ddlFeeTypes.SelectedValue), Name = ddlFeeTypes.SelectedItem.Text }; } set { ddlFeeTypes.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { PopulateAllDropDown(); ddlDepartment.Visible = false; } } catch (Exception) { throw; } } private void PopulateAllDropDown() { try { List<FeeType> feeTypes = Utility.GetAllFeeTypes(); List<Programme> programmes = Utility.GetAllProgrammes(); feeTypes.Insert(1,new FeeType() { Id = 1001, Name = "All" }); programmes.Insert(1,new Programme() { Id = 1001, Name = "All" }); Utility.BindDropdownItem(ddlFeeTypes, feeTypes, Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, programmes, Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReportBy(FeeType Feetype, Programme programme, Department department) { try { PaymentLogic paymentLogic = new PaymentLogic(); var payments = new List<AllPaymentGeneralView>(); payments = paymentLogic.GetPaymentReportBy(Feetype, department,Programme, txtBoxDateTo.Text, txtBoxDateFrom.Text); string reportPath = @"Reports\PaymentReports\PaymentReportGeneral.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "StudentFees Payment"; rv.LocalReport.ReportPath = reportPath; if (payments != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource("PaymentReportGeneralDataSet1", payments)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedDepartment == null || SelectedDepartment.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if (SelectedFeeTypes == null || SelectedFeeTypes.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch (Exception) { throw; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReportBy(SelectedFeeTypes,Programme,SelectedDepartment); } catch (Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender, EventArgs e) { try { if (Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlProgramme.Visible = false; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = new List<Department>(); DepartmentLogic departmentLogic = new DepartmentLogic(); if (programme.Id == 1001) { departments = departmentLogic.GetAll(); departments.Insert(0, new Department() { Id = 0, Name = "-- Select Department --" }); } else { departments = Utility.GetDepartmentByProgramme(programme); } if (departments != null && departments.Count > 0) { departments = departments.OrderBy(d => d.Name).ToList(); departments.Insert(1,new Department() { Id = 1001, Name = "All" }); Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } //protected void btnDisplayReport_Click(object sender, EventArgs e) //{ // try // { // if (InvalidUserInput()) // { // return; // } // DisplayReportBy(SelectedFeeTypes,Programme,SelectedDepartment ,rblSortOption.SelectedValue); // } // catch (Exception ex) // { // lblMessage.Text = ex.Message; // } //} } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "PinRetrieval"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <br /> <br /> @using (Html.BeginForm("ResetPin", "Support", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h3>Pin Reset</h3> </div> <div class="alert alert-warning text-white" style="text-align: center"> <h3> <b>Enter The Application Number Of the Applicant To Tie The Pin To</b> </h3> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ScratchCard.Pin, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ScratchCard.Pin, new { @class = "form-control", @placeholder = "Enter Pin" }) @Html.ValidationMessageFor(model => model.ScratchCard.Pin, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Number, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ApplicationForm.Number, new { @class = "form-control", @placeholder = "Enter Application Form Number" }) @Html.ValidationMessageFor(model => model.ApplicationForm.Number, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 fa fa-search" type="submit" name="submit" id="submit" value="Search" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new { Area = "" }, null) </div> </div> </div> </div> </div> </div> </div> </div> } @using (Html.BeginForm("SavePinReset", "Support", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) if (Model.ScratchCard == null) { return; } <div class="panel-body"> <div class="col-md-12"> <h4 class="alert alert-warning"> <b>The person detail attached to the first box contains information of the person tied to the pin while the other is details for application form</b></h4> <div class="form-group"> @Html.LabelFor(model => model.ScratchCard.person.FullName, "Pin Person Detail", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ScratchCard.person.FullName, new { @class = "form-control", @placeholder = "Enter Pin", disabled = "disabled" }) @Html.ValidationMessageFor(model => model.ScratchCard.person.FullName, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Person.FullName, "Application Form Person Detail", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ApplicationForm.Person.FullName, new { @class = "form-control", @placeholder = "Enter Pin", disabled = "disabled" }) @Html.ValidationMessageFor(model => model.ApplicationForm.Person.FullName, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 fa fa-search-plus" type="submit" value="Update" /> </div> </div> </div> </div> }<file_sep><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PutmeReportDEBulk.aspx.cs" Inherits="Abundance_Nk.Web.Reports.Presenter.PutmeReportDE" %> <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=192.168.3.11, Culture=neutral, PublicKeyToken=<KEY>" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link href="../../Content/bootstrap.min.css" rel="stylesheet" /> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="60000"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <p> <asp:Label ID="lblMessage" runat="server"></asp:Label> </p> <div class="form-inline"> <div class="form-group"> <asp:DropDownList ID="ddlDepartment" class="form-control" runat="server" Height="35px" Width="250px"> </asp:DropDownList> <asp:DropDownList ID="ddlChoice" class="form-control" runat="server" Height="35px" Width="250px"> </asp:DropDownList> <asp:Button ID="Display_Button" runat="server" Text="Display Report" Width="111px" class="btn btn-success " OnClick="Display_Button_Click1" /> </div> </div> </ContentTemplate> </asp:UpdatePanel> </div> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="../../Scripts/jquery-2.1.3.js"></script> <script src="../../Scripts/bootstrap.min.js"></script> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="931px"> </rsweb:ReportViewer> </form> </body> </html> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptBursarViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @{ ViewBag.Title = "Transcript Requests"; } <script> function getnewValue(val) { var dropdownChanged = val.id; var buttonId = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].id; var buttonUrl = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].href; var ur = buttonUrl + "&stat=" + val.value; document.getElementById(buttonId).href = ur; } $("a").click(function() { alert($(this).text); }); </script> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <h2>Incoming Transcript Payment</h2> <a href="@Url.Action("UpdateRRRBulk")">Update All</a> <div class="panel"> <table class="table table-bordered table-hover table-striped table-responsive"> <tr> <th>@Html.ActionLink("Full Name", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Matric Number", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Date Requesterd", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Destination", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("RRR", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>Confirm</th> <th>@Html.ActionLink("Amount Paid", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> @*<th>Reject</th>*@ </tr> @for (int i = 0; i < Model.transcriptRequests.Count; i++) { <tr> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].student.FullName)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].student.MatricNumber)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DateRequested)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DestinationAddress)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].ConfirmationOrderNumber)</td> <td> @if (Model.transcriptRequests[i].remitaPayment != null) { @*@Html.ActionLink("Confirm Payment", "UpdateStatus", "TranscriptBursar", new { tid = Model.transcriptRequests[i].Id, confirmationOrder = Model.transcriptRequests[i].ConfirmationOrderNumber }, new { @class = "btn btn-default", @id = "url" + i })*@ @Html.ActionLink("Get Status", "GetStatus", "TranscriptBursar", new {order_Id = Model.transcriptRequests[i].remitaPayment.OrderId}, new {@class = "btn btn-default"}) } else { @Html.Display("Invoice not yet generated") } </td> <td class="text-bold text-red">@Html.DisplayTextFor(m => m.transcriptRequests[i].Amount)</td> </tr> } </table> </div> </div><file_sep><!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - The Federal Polytechnic Ilaro</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <link rel="apple-touch-icon" sizes="57x57" href="~/Content/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="~/Content/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="~/Content/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="~/Content/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="~/Content/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="~/Content/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="~/Content/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="~/Content/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="~/Content/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="~/Content/favicon/android-icon-192x192.png"> <link rel="icon" type="image/png" sizes="32x32" href="~/Content/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="~/Content/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="~/Content/favicon/favicon-16x16.png"> <link rel="manifest" href="~/Content/favicon/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="~/Content/favicon/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> </head> <body> <!-- Navigation --> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="containerMod"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="http://www.federalpolyilaro.edu.ng/web/" title="Ilaro Poly Home"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" height="65" alt="" /></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav "> <li>@Html.ActionLink("Home", "Index", new {Controller = "Home", Area = ""})</li> <li><a href="#">Portal User Guide</a></li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Applicant<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Generate Invoice", "PostJambFormInvoiceGeneration", "Form", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Fill Application Form", "PostJambProgramme", "Form", new {Area = "Applicant"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Check Result", "Index", "PostUtmeResult", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Search for PUTME Result", "MergeResult", "PostUtmeResult", new {Area = "Applicant"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Check Admission Status", "CheckStatus", "Admission", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Generate Change of Course Invoice", "GenerateChangeOfCourseInvoice", "Admission", new {Area = "Applicant"}, null)</li> </ul> </li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Returning Student<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Generate Invoice", "Index", "Payment", new {Area = "Student"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Session Registration", "Logon", "Registration", new {Area = "Student"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Check Semester Result", "Check", "Result", new {Area = "Student"}, null)</li> </ul> </li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Extra Year Students<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Generate Invoice", "GenerateCarryOverInvoice", "Payment", new {Area = "Student"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Session Registration", "LogonCarryOver", "Registration", new {Area = "Student"}, null)</li> </ul> </li> <li><a href="http://www.federalpolyilaro.edu.ng/web/" target="_blank">School Website</a></li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Complaints<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Submit your Complaint", "Index", "Complain/Index", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Check Complaint status", "Status", "Complain/Status", new {Area = "Applicant"}, null)</li> </ul> </li> @if (User.Identity.IsAuthenticated) { if (User.IsInRole("Admissions")) { <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Admissions<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Application Summary", "ApplicationSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Application Summary By Department", "ApplicationFormSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("List of Applicants", "ListOfApplications", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Photo Card", "PhotoCard", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Matriculation Report", "MatriculationReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Bio-data Report", "BiodatatReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Acceptance Report", "AcceptanceReport", "Report", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("O-level Criteria", "AdmissionCriteria", "Clearance", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Department Courses", "Courses", "Courses/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Department Courses", "Courses", "Courses/Edit", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Result Correction", "Result", "Result/EditResult", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Step", "ResetStep", "Support/ResetStep", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Reset Registered Student", "UpdateStudentData", "Support/UpdateStudentData", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Upload Admission List", "UploadAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Admission List", "SearchAdmittedStudents", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Admission List", "ViewAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> </ul> </li> } else if (User.IsInRole("Support")) { <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Support<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("O-level Criteria", "AdmissionCriteria", "Clearance", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Audit", "ViewAuditReport", "Support/ViewAuditReport", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Department Courses", "Courses", "Courses/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Department Courses", "Courses", "Courses/Edit", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Result Correction", "Result", "Result/EditResult", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Step", "ResetStep", "Support/ResetStep", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Correct Applicant Details", "Index", "Support/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Invoice", "ResetInvoice", "Support/ResetInvoice", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Retrieve Pin", "PinRetrieval", "Support/PinRetrieval", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Registered Student", "UpdateStudentData", "Support/UpdateStudentData", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Complaints", "View", "Complain/View", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Update RRR", "UpdateRRR", "RemitaReport/UpdateRRR", new {Area = "Admin"}, null)</li> </ul> </li> } else if (User.IsInRole("School Admin")) { <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">School Admin<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("O-level Criteria", "AdmissionCriteria", "Clearance", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Audit", "ViewAuditReport", "Support/ViewAuditReport", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Department Courses", "Courses", "Courses/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Department Courses", "Courses", "Courses/Edit", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Result Correction", "Result", "Result/EditResult", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Step", "ResetStep", "Support/ResetStep", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Application Summary", "ApplicationSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Application Summary By Department", "ApplicationFormSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("List of Applicants", "ListOfApplications", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Photo Card", "PhotoCard", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Matriculation Report", "MatriculationReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Bio-data Report", "BiodatatReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Acceptance Report", "AcceptanceReport", "Report", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Upload Admission List", "UploadAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Admission List", "SearchAdmittedStudents", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Admission List", "ViewAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> </ul> </li> } else if (User.IsInRole("Admin")) { <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Admin<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("O-level Criteria", "AdmissionCriteria", "Clearance", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Audit", "ViewAuditReport", "Support/ViewAuditReport", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Department Courses", "Courses", "Courses/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Department Courses", "Courses", "Courses/Edit", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Result Correction", "Result", "Result/EditResult", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Application Summary", "ApplicationSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Application Summary By Department", "ApplicationFormSummary", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("List of Applicants", "ListOfApplications", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Photo Card", "PhotoCard", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Matriculation Report", "MatriculationReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Bio-data Report", "BiodatatReport", "Report", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Acceptance Report", "AcceptanceReport", "Report", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Upload Admission List", "UploadAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Edit Admission List", "SearchAdmittedStudents", "UploadAdmission", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Admission List", "ViewAdmission", "UploadAdmission", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("View School Fees", "AllSchoolFees", "FeeDetail", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View All Fees", "AllFeeDetails", "FeeDetail", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Scholarship Students", "Index", "PaymentScholarship", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Process Application", "Index", "AdmissionProcessing", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Clear Applicant", "ClearApplicant", "AdmissionProcessing", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Generate Invoice with RRR", "RRRApplicationForms", "Form", new {Area = "Applicant"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Correct Applicant Details", "Index", "Support/Index", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Invoice", "ResetInvoice", "Support/ResetInvoice", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Retrieve Pin", "PinRetrieval", "Support/PinRetrieval", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Step", "ResetStep", "Support/ResetStep", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Reset Registered Student", "UpdateStudentData", "Support/UpdateStudentData", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("View Complaints", "View", "Complain/View", new {Area = "Applicant"}, null)</li> <li>@Html.ActionLink("Update RRR", "UpdateRRR", "RemitaReport/UpdateRRR", new {Area = "Admin"}, null)</li> <li>@Html.ActionLink("Unregister Course", "RemoveStudentCourse", "Result/RemoveStudentCourse", new {Area = "Admin"}, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Correct O-LEVEL Details", "CorrectOlevel", "Support/CorrectOlevel", new {Area = "Admin"}, null)</li> </ul> </li> } } </ul> <div> @Html.Partial("_LoginPartial") </div> </div> </div> </nav> <br /> <br /> <div class="container "> @RenderBody() <hr /> <div class="row"> <div class="col-lg-12 "> <p style="color: green; text-align: center">If you experience any difficulties or issues kindly call 07088391544 , 08050436662 , 09053630262 or email <EMAIL></p> </div> </div> <hr /> <!-- Footer --> <footer> <div class="row "> <div class="col-lg-6 "> <p style="color: black">&copy; @DateTime.Now.Year - The Federal Polytechnic Ilaro</p> </div> <div class="col-lg-6 pull-right"> <p class="align-right"><a href="http://www.lloydant.com">Powered by <img src="@Url.Content("~/Content/Images/lloydant.png")" alt="" /></a></p> </div> </div> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", false) </body> @*<body> <div class="container " style="color: #449D44"> <div> <table style="margin-bottom:7px"> <tr> <td style="padding-right:7px"><img src="/Content/Images/school_logo.jpg" alt="" /></td> <td><h3><strong>The Federal Polytechnic Ilaro</strong></h3></td> </tr> </table> </div> </div> <div class="navbar navbar-default " > <div class="container "> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Ilaro Poly", "Index", "Home", null, new { @class = "navbar-brand", @style = "font-size:13pt; font-weight:bold" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-default"> <li>@Html.ActionLink("Admin", "Index", new { Controller = "AdmissionProcessing", Area = "Admin" })</li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Applicant<span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Generate Invoice", "PostJambFormInvoiceGeneration", "Form", new { Area = "Student" }, null)</li> <li>@Html.ActionLink("Fill Application Form", "PostJambProgramme", "Form", new { Area = "Student" }, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Check PUTME Result", "Index", "PostUtmeResult", new { Area = "Student" }, null)</li> <li class="divider"></li> <li>@Html.ActionLink("Check Admission Status", "Index", "Clearance", new { Area = "Student" }, null)</li> </ul> </li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> <div class="container "> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - The Federal Polytechnic Ilaro</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body>*@ </html><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.CarryOverViewModel @{ ViewBag.Title = "Carry-Over Report"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/jquery-1.7.1.js"></script> <script src="~/Scripts/jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Country Dropdown Selectedchange event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "CarryOver")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "CarryOver")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @using (Html.BeginForm("ViewCarryOverStudents", "CarryOver", new {Area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>Carry Over</h3> </div> <div class="panel-body"> <div class="form-group"> <div class="col-md-6"> @Html.LabelFor(model => model.Programme.Name, "Programme", new {@class = "control-label "}) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control", @id = "Programme", @required = "required"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6"> @Html.LabelFor(model => model.Department.Name, "Department", new {@class = "control-label "}) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control", @id = "Department"}) @Html.ValidationMessageFor(model => model.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-6"> @Html.LabelFor(model => model.Session.Name, "Session", new {@class = "control-label "}) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control", @required = "required", @id = "Session"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6"> @Html.LabelFor(model => model.Semester.Name, "Semester", new {@class = "control-label "}) @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>) ViewBag.Semester, new {@class = "form-control", @id = "Semester"}) @Html.ValidationMessageFor(model => model.Semester.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-6"> @Html.LabelFor(model => model.Level.Name, "Level", new {@class = "control-label "}) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.LevelId, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Next" /> </div> </div> </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.MenuViewModel @{ ViewBag.Title = "DeleteMenu"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Delete Menu</h4> </div> @using (Html.BeginForm("DeleteMenu", "Menu", new {Area = "Admin"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.HiddenFor(m => m.Menu.Id) <div> <h3>Are you sure you want to delete this menu?</h3> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Display Name:") </dt> <dd> @Html.DisplayFor(model => model.Menu.DisplayName) </dd> <br /> <dt> @Html.DisplayName("Area:") </dt> <dd> @Html.DisplayFor(model => model.Menu.Area) </dd> <br /> <dt> @Html.DisplayName("Controller:") </dt> <dd> @Html.DisplayFor(model => model.Menu.Controller) </dd> <br /> <dt> @Html.DisplayName("Action:") </dt> <dd> @Html.DisplayFor(model => model.Menu.Action) </dd> <br /> <dt> @Html.DisplayName("Activated:") </dt> <dd> @Html.DisplayFor(model => model.Menu.Activated) </dd> <br /> <dt> @Html.DisplayName("Menu Group:") </dt> <dd> @Html.DisplayFor(model => model.Menu.MenuGroup.Name) </dd> </dl> </div> <div class="form-group"> <div class="col-md-offset-1 col-md-11"> <input type="submit" value="Yes" class="btn btn-success" /> | @Html.ActionLink("Cancel", "ViewMenuByMenuGroup", "Menu", new {@class = "btn btn-success"}) </div> </div> </div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "Edit Faculty"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("EditFacultyUser", "User", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-fw fa-edit"></i> Edit User Faculty</h4> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Username, "Enter Username: ", new { @class = "control-label " }) @Html.TextBoxFor(model => model.User.Username, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.User.Username, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Faculty.Id, "Faculty", new { @class = "control-label" }) @Html.DropDownListFor(model => model.Faculty.Id, (IEnumerable<SelectListItem>)ViewBag.Faculty, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Faculty.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Edit" /> </div> </div> </div> </div> </div> } </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function () { $('.datepicker').bootstrapMaterialDatePicker({ format: 'dddd DD MMMM YYYY', clearButton: true, weekStart: 1, time: false }); $.extend($.fn.dataTable.defaults, { responsive: true }); $('#applicantTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } },, 'colvis' ] }); }); </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">List of applicants</p></h4> </div> @using (Html.BeginForm("ApplicantList", "UploadAdmission", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> </div> </div> <br/> <div class="row"> <div class="col-md-12"> @Html.TextBoxFor(m => m.DateFrom, new { @class = "datepicker col-md-3", @placeholder = "From:", @required = "required" }) <span class="col-md-1"></span> @Html.TextBoxFor(m => m.DateTo, new { @class = "datepicker col-md-3", @placeholder = "To:", @required = "required" }) </div> </div> <br/> <div class="row"> <div class="form-group"> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> </div> } </div> @if (Model == null || Model.Applicants == null) { return; } @if (Model != null && Model.Applicants != null) { <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="applicantTable"> <thead> <tr> <th>SN</th> <th>Name</th> <th>Phone Number</th> <th>Application Number</th> <th>Exam Number</th> <th>Jamb Reg. Number</th> <th>Programme</th> <th>Department</th> <th>Sesion</th> <th>Date Submitted</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.Applicants.Count; i++) { var SN = i + 1; <tr> <td>@SN</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].Name)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].MobilePhone)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].AplicationFormNumber)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].ExamNumber)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].JambRegNumber)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].AppliedProgrammeName)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].FirstChoiceDepartment)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].SessionName)</td> <td>@Html.DisplayTextFor(m => m.Applicants[i].DateSubmitted)</td> </tr> } </tbody> </table> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ Layout = null; ViewBag.Title = "::Acknowlegment Slip::"; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#aPrint").click(function() { $("#aPrint").hide(); $("#printable").show(); window.print(); $("#aPrint").show(); }); }); </script> <div> <div id="printable" class="container"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 "> <div class="row"> <div class="col-xs-2 pull-left"> <img class="img-responsive" src="@Url.Content("~/Content/Images/school_logo.jpg")" width="100px" height="100px" alt="School Logo" /> </div> <div class="col-xs-8 text-left text-bold"> <h4>ABIA STATE UNIVERSITY, UTURU</h4> <h5>@Model.Payment.Session.Name POST GRADUATE APPLICATION</h5> <h5>ACKNOWLEDGMENT SLIP</h5> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> <img class="img-responsive" src="@Url.Content('~' + Model.Person.ImageFileUrl)" width="100px" height="100px" alt="Student Passport" /> </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.FullName,"Fullname:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.Person.FullName) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.MobilePhone,"Mobile No:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.Person.MobilePhone) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.FullName,"Application Number:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.ApplicationForm.SerialNumber) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.FullName,"Department:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.AppliedCourse.Department.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name,"Programme:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.AppliedCourse.Programme.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.FullName,"Field Of Study:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.AppliedCourse.Option.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.AppliedCourse.Programme.Id,"Mode Of Study:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.AppliedCourse.Programme.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-7"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.Person.FullName,"Date Submitted:",new { @class = "",@style = "font-size:small" }) </div> <div class="col-xs-6 text-bold" style="font-size: small"> @Html.DisplayFor(model => model.ApplicationForm.DateSubmitted) </div> </div> </div> </div> <hr /> <div class="row"> <div class=" col-xs-12 text-bold text-danger"> <p class="text-bold"> NB : Please ensure that you instruct your former institution(s) to forward transcript(s) of your academic work direct to : The Secretary School of Post­Graduate Studies, Abia State University PMB 2000 Uturu, Abia State, Nigeria </p> </div> </div> <hr /> <div class="row"> <div class=" col-xs-12 text-bold text-danger"> <p class="text-bold text-center"> <a href="@Url.Action("BuildReport","PostGraduateForm",new { studentId=@Model.Person.Id ,type = 1 })">Click Here to Download Referee Form</a><br /> <a href="@Url.Action("BuildReport","PostGraduateForm",new { studentId = @Model.Person.Id,type = 2 })">Click Here to Download Transcript Request Form</a><br /> Print and Keep this slip </p> </div> </div> </div> </div> </div> <div> <button id="aPrint" class="btn btn-primary btn-lg ">Print Slip</button> </div> </div> </div> </div> </div> </div> </div><file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Admin.ViewModels.VerificationViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="panel panel-default"> <div class="panel-heading"> <h3>Receipt Verification</h3> @using (Html.BeginForm()) { <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ConfirmationNo,"Verification Code",new { @class = "col-sm-2 control-label " }) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.ConfirmationNo,new { @class = "form-control" }) </div> <div class="col-md-4"> <input type="submit" value="Verify" class="btn btn-primary" /> </div> </div> </div> } @if (Model.PaymentVerification != null) { <div class="row"> <table class="table table-responsive"> <thead> <th>Student Name</th> <th>Payment Made</th> <th>Amount Paid</th> <th>Verification Officer</th> <th>Date Verified</th> </thead> <tbody> <td>@Model.PaymentVerification.Payment.Person.FullName</td> <td>@Model.PaymentVerification.Payment.FeeType.Name</td> <td>@Model.PaymentEtranzact.TransactionAmount</td> <td>@Model.PaymentVerification.User.Username</td> <td>@Model.PaymentVerification.DateVerified</td> </tbody> </table> </div> } </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "SetAllocationCount"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> var allocationCounts = []; function reloadTable() { var campusId = event.target.value; if (campusId > 0) { showLoading(); $.ajax({ type: 'POST', url: '@Url.Action("GetHostelAllocationCount", "HostelAllocation")', // Calling json method dataType: 'json', data: { campusId: campusId }, success: function (result) { if (!result.IsError) { if (result.AllocationCountModels && result.AllocationCountModels.length > 0) { allocationCounts = []; $.each(result.AllocationCountModels, function (i, model) { allocationCounts.push(model); }); populateTable(); } } else { alert(result.Message); } dismissLoading(); }, error: function (ex) { alert('Failed.' + ex); dismissLoading(); } }); } } function populateTable() { $("#tbl_count").empty(); $.each(allocationCounts, function(i, model) { $("#tbl_count").append('<tr><td>' + model.Level + '</td><td>' + model.Sex + '</td><td><input type="number" value="' + model.Free + '" onchange="updateCount(1, ' + model.HostelAllocationCountId + ')"/></td><td><input type="number" value="' + model.Reserved + '" onchange="updateCount(2, ' + model.HostelAllocationCountId + ')"/></td><td><input type="number" disabled="disabled" value="' + model.TotalCount + '"/></td><td>' + model.LastModified + '</td></tr>'); }); } function updateCount(countType, allocationId) { if (countType, allocationId) { $.each(allocationCounts, function(i, item) { if (item.HostelAllocationCountId === allocationId) { if (countType === 1) { item.Free = parseInt(event.target.value); } else { item.Reserved = parseInt(event.target.value); } item.TotalCount = item.Free + item.Reserved; } }); populateTable(); } } function saveAllocationCount() { if (allocationCounts.length <= 0) { alert("Nothing to change."); return; } showLoading(); var myAllocationCount = JSON.stringify(allocationCounts); $.ajax({ type: 'POST', url: '@Url.Action("SaveHostelAllocationCount", "HostelAllocation")', // Calling json method dataType: 'json', data: { allocationCounts: myAllocationCount }, success: function (result) { alert(result.Message); dismissLoading(); }, error: function (ex) { alert('Failed.' + ex); dismissLoading(); } }); } function showLoading() { $("#btn_save").hide(); $("#progress").show(); } function dismissLoading() { $("#btn_save").show(); $("#progress").hide(); } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Set Hostel Allocation Count</h4> </div> <div class="panel-body"> @*@if (Model.HostelAllocationCounts != null && Model.HostelAllocationCounts.Count > 0) {*@ <div class="panel panel-danger"> <div class="panel-body"> @*@using (Html.BeginForm("SetAllocationCount", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post)) {*@ <div class="form-group"> @Html.LabelFor(model => model.Campus.Id, "Select Campus", new {@class = "control-label col-md-1"}) <div class="col-md-4"> @Html.DropDownListFor(model => model.Campus.Id, (IEnumerable<SelectListItem>) ViewBag.Campus, new {@class = "form-control", onchange="reloadTable()"}) @Html.ValidationMessageFor(model => model.Campus.Id, null, new { @class = "text-danger" }) </div> </div> <br/> <br/> <table class="table-bordered table-hover table-striped table-responsive table"> <thead> <tr> <th> Level </th> <th> Hostel Type </th> <th> Number For Free Rooms </th> <th> Number For Reserved Rooms </th> <th> Total Number </th> <th> Last Modified Date </th> </tr> </thead> <tbody id="tbl_count"></tbody> </table> <br /> <div class="form-group"> <div class=" col-md-10"> <input type="submit" id="btn_save" value="Save" onclick="saveAllocationCount()" class="btn btn-success"/> <button class="btn btn-success" style="display: none" disabled="disabled" id="progress"><img src="~/Content/Images/bx_loader.gif" style="width: 20px; height: 20px" /></button> </div> </div> @*}*@ </div> </div> @*}*@ </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Model.Entity.APPLICATION_FORM @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Create</title> </head> <body> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h4>APPLICATION_FORM</h4> <hr /> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.Serial_Number, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Serial_Number) @Html.ValidationMessageFor(model => model.Serial_Number) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Application_Form_Number, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Application_Form_Number) @Html.ValidationMessageFor(model => model.Application_Form_Number) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Application_Form_Setting_Id, "Application_Form_Setting_Id", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownList("Application_Form_Setting_Id", String.Empty) @Html.ValidationMessageFor(model => model.Application_Form_Setting_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Application_Programme_Fee_Id, "Application_Programme_Fee_Id", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownList("Application_Programme_Fee_Id", String.Empty) @Html.ValidationMessageFor(model => model.Application_Programme_Fee_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Payment_Id, "Payment_Id", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownList("Payment_Id", String.Empty) @Html.ValidationMessageFor(model => model.Payment_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Person_Id, "Person_Id", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownList("Person_Id", String.Empty) @Html.ValidationMessageFor(model => model.Person_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Date_Submitted, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Date_Submitted) @Html.ValidationMessageFor(model => model.Date_Submitted) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Release, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Release) @Html.ValidationMessageFor(model => model.Release) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Rejected, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Rejected) @Html.ValidationMessageFor(model => model.Rejected) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Reject_Reason, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Reject_Reason) @Html.ValidationMessageFor(model => model.Reject_Reason) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Remarks, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Remarks) @Html.ValidationMessageFor(model => model.Remarks) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index") </div> </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.FeeDetailViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="row"> <h3>View Departmental Fees</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.feeDetail.Programme.Id, "Programme", new {@class = "control-label "}) @Html.DropDownListFor(model => model.feeDetail.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.feeDetail.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.feeDetail.Department.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.feeDetail.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.feeDetail.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.feeDetail.FeeType.Id, "Fee Type", new {@class = "control-label"}) @Html.DropDownListFor(model => model.feeDetail.FeeType.Id, (IEnumerable<SelectListItem>) ViewBag.FeeTypes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.feeDetail.FeeType.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.feeDetail.Session.Id, "Session", new {@class = "control-label"}) @Html.DropDownListFor(model => model.feeDetail.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Sessions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.feeDetail.Session.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="View" class="btn btn-default" /> </div> </div> </div> </div> } <br /> @if (Model.feeDetails != null) { using (Html.BeginForm("SaveFeeDetailChanges", "FeeDetail", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> <h4>Fee Details</h4> <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Fee Amount</th> <th>Payment Mode</th> <th>Fee Type</th> <th>Level</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.feeDetails.Count; i++) { <tr> <td>@Html.DropDownListFor(model => model.feeDetails[i].Fee.Id, (IEnumerable<SelectListItem>) ViewData["FeeIdViewData" + i], new {@class = "form-control olevel"})</td> <td>@Html.DropDownListFor(model => model.feeDetails[i].PaymentMode.Id, (IEnumerable<SelectListItem>) ViewData["PaymentModeIdViewData" + i], new {@class = "form-control olevel"})</td> <td>@Html.DisplayTextFor(model => model.feeDetails[i].FeeType.Name)</td> <td>@Html.DropDownListFor(model => model.feeDetails[i].Level.Id, (IEnumerable<SelectListItem>) ViewData["LevelIdViewData" + i], new {@class = "form-control olevel"})</td> @Html.HiddenFor(model => model.feeDetails[i].Session.Id) @Html.HiddenFor(model => model.feeDetails[i].Department.Id) @Html.HiddenFor(model => model.feeDetails[i].Programme.Id) @Html.HiddenFor(model => model.feeDetails[i].FeeType.Id) @Html.HiddenFor(model => model.feeDetails[i].Id) </tr> } </tbody> </table> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Save Changes" class="btn btn-default" /> </div> </div> } } </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.ResultViewModel @{ ViewBag.Title = "SemesterResult"; //Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#submit').click(function () { $('#submit').submit(); var dataToSend = JSON.parse($('#frmEvaluation').serializeArray()); }); }); </script> <style> .form-control { padding: 0px !important; } </style> <div class="container-fluid"> <div class="card p-2"> <h3>STUDENT EVALUATION OF INSTRUCTIONAL DELIVERY</h3> @using (Html.BeginForm("SemesterResult", "Result", new { Area = "Student" }, FormMethod.Post, new { id = "frmEvaluation" })) { if (Model.CourseEvaluations == null) { return; } if (Model.CourseEvaluations.Count > 0) { <cite style="background-color: white; color: #21c;"> <b>Instruction: </b><br /> The students are to respond to each of the measuring instruments on a rating scale of 1-4 as designated with 4 being the highest (Strongly Agree) 1 = Strongly Disagree, 2 = Disagree, 3 = Agree, 4 = Strongly Agree </cite> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <table class="table table-bordered table-hover table-striped table-responsive"> <tr> <th>Question</th> @for (int j = 0; j < Model.CourseEvaluations.Count; j++) { <th>@Model.CourseEvaluations[j].Course.Code</th> } </tr> @Html.HiddenFor(model => Model.StudentLevel.Student.Id) @for (int k = 0; k < Model.CourseEvaluations.FirstOrDefault().CourseEvaluationQuestion.Count; k++) { <tr> <td>@Model.CourseEvaluations.FirstOrDefault().CourseEvaluationQuestion[k].Question</td> @for (int m = 0; m < Model.CourseEvaluations.Count; m++) { <td>@Html.DropDownListFor(model => model.CourseEvaluations[m].Score, (IEnumerable<SelectListItem>)ViewBag.ScoreId, new { @class = "form-control", id = "Question_" + Model.CourseEvaluations.FirstOrDefault().CourseEvaluationQuestion[k].Id + "Course_Id_" + Model.CourseEvaluations[m].Course.Id, Name = "Question_" + Model.CourseEvaluations.FirstOrDefault().CourseEvaluationQuestion[k].Id + "Course_Id_" + Model.CourseEvaluations[m].Course.Id, required = true }) </td> } </tr> } </table> </div> <br /> <br /> </div> </div> <cite style="background-color: white; color: #21c;"> <b>Instruction: </b><br /> The students are to respond to each of the measuring instruments on a rating scale of 1-4 as designated with 4 being the highest (Strongly Agree) 1 = Strongly Disagree, 2 = Disagree, 3 = Agree, 4 = Strongly Agree </cite> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <br /> <table class="table table-bordered table-hover table-striped table-responsive"> <tr> <th>Question</th> @for (int j = 0; j < Model.CourseEvaluations.Count; j++) { <th>@Model.CourseEvaluations[j].Course.Code</th> } </tr> @for (int k = 0; k < Model.CourseEvaluationsTwo.FirstOrDefault().CourseEvaluationQuestion.Count; k++) { <tr> <td>@Model.CourseEvaluationsTwo.FirstOrDefault().CourseEvaluationQuestion[k].Question</td> @for (int m = 0; m < Model.CourseEvaluationsTwo.Count; m++) { @*@Html.HiddenFor(model => model.CourseEvaluationsTwo[m].Course.Id)*@ <td>@Html.DropDownListFor(model => model.CourseEvaluationsTwo[m].Score, (IEnumerable<SelectListItem>)ViewBag.ScoreId, new { @class = "form-control", id = "SectionQuestion_" + Model.CourseEvaluationsTwo.FirstOrDefault().CourseEvaluationQuestion[k].Id + "Course_Id_" + Model.CourseEvaluationsTwo[m].Course.Id, Name = "SectionQuestion_" + Model.CourseEvaluationsTwo.FirstOrDefault().CourseEvaluationQuestion[k].Id + "Course_Id_" + Model.CourseEvaluationsTwo[m].Course.Id, required = true }) </td> @*<td>@Html.DropDownListFor(model => model.CourseEvaluationsTwo[m].Score,(IEnumerable<SelectListItem>)ViewBag.ScoreId,new { @class = "form-control"}) </td>*@ } </tr> } </table> </div> <div class="row"> <div class="form-group"> <div class="col-sm-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> </div> } } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Vacant BedSpaces"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#myTable').DataTable(); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Vacant Bedspaces</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewVacantBedSpaces", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="form-group"> @Html.LabelFor(m => m.Hostel.Name, "Hostel:", new { @class = "col-md-2 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.Hostel.Id, (IEnumerable<SelectListItem>)ViewBag.Hostel, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.Hostel.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <br/> <div class="panel-body"> @if (Model.HostelAllocations != null && Model.HostelAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-body table-responsive"> <table class="table-bordered table-hover table-striped table-responsive table" id="myTable"> <thead> <tr> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Status </th> <th> BedSpace </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.HostelAllocations.Count; i++) { <tr> @Html.HiddenFor(model => model.HostelAllocations[i].Id) <td> @Model.HostelAllocations[i].HostelName </td> <td> @Model.HostelAllocations[i].SeriesName </td> <td> @Model.HostelAllocations[i].RoomName </td> <td> @Model.HostelAllocations[i].ReserveStatus </td> <td> @Model.HostelAllocations[i].CornerName </td> </tr> } </tbody> </table> </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Model.Model.FeeType @{ ViewBag.Title = "StaffCourseAllocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @using (Html.BeginForm("PaymentReport", "PaymentRegistrationReport", new {area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-money"></i>Payment Report</h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Name, "Select Fee Type", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Id, (IEnumerable<SelectListItem>) ViewBag.Feetype, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Id, null, new {@class = "text-danger"}) </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Model.Model.ComplaintLog @{ ViewBag.Title = "Complain"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>Check Complain Status</h2> @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.TicketID, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.TicketID, new {@class = "form-control", @placeholder = "e.g ILR0000000001"}) @Html.ValidationMessageFor(model => model.TicketID, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Check Status" class="btn btn-default" /> </div> </div> } @if (Model.Id > 0) { <div class="form-horizontal"> <hr /> @Html.HiddenFor(model => model.Id) <div class="form-group"> @Html.LabelFor(model => model.Name, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.MobileNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.MobileNumber) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ApplicationNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.ApplicationNumber) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.RRR, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.RRR) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ExamNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.ExamNumber) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ConfirmationNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.ConfirmationNumber) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Complain, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.Complain) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.DateSubmitted, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.DateSubmitted) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.TicketID, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.TicketID) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Comment, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.Comment) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Status, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.Status) </div> </div> </div> }<file_sep>@using Abundance_Nk.Model.Model @model IEnumerable<Abundance_Nk.Model.Model.ComplaintLog> @{ ViewBag.Title = "View"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>View Complains</h2> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Name) </th> <th> @Html.DisplayNameFor(model => model.MobileNumber) </th> <th> @Html.DisplayNameFor(model => model.Complain) </th> <th> @Html.DisplayNameFor(model => model.Status) </th> <th> @Html.DisplayNameFor(model => model.DateSubmitted) </th> <th> @Html.DisplayNameFor(model => model.TicketID) </th> <th></th> </tr> @foreach (ComplaintLog item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Name) </td> <td> @Html.DisplayFor(modelItem => item.MobileNumber) </td> <td> @Html.DisplayFor(modelItem => item.Complain) </td> <td> @Html.DisplayFor(modelItem => item.Status) </td> <td> @Html.DisplayFor(modelItem => item.DateSubmitted) </td> <td> @Html.DisplayFor(modelItem => item.TicketID) </td> <td> @Html.ActionLink("Resolve", "Resolve", new {id = item.Id}) </td> </tr> } </table><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ClearanceViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ <div class="panel panel-default"> <div class="panel-body"> @if (Model == null || Model.admissionCriteria == null) { return; } @if (Model.admissionCriteria != null) { <h3> @Html.ActionLink("Add new Criteria", "AddAdmissionCriteria")</h3> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>@Html.ActionLink("Department", "AdmissionCriteria", new {sortOrder = ViewBag.Department, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Programme", "AdmissionCriteria", new {sortOrder = ViewBag.Programme, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Minimum Subjects Required", "AdmissionCriteria", new {sortOrder = ViewBag.Minimum, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Date Added", "AdmissionCriteria", new {sortOrder = ViewBag.Date, currentFilter = ViewBag.CurrentFilter})</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int itemIndex = 0; itemIndex < Model.admissionCriteriaList.Count; itemIndex++) { <tr> <td>@Model.admissionCriteriaList[itemIndex].Department.Name</td> <td>@Model.admissionCriteriaList[itemIndex].Programme.Name</td> <td>@Model.admissionCriteriaList[itemIndex].MinimumRequiredNumberOfSubject.ToString()</td> <td>@Model.admissionCriteriaList[itemIndex].DateEntered</td> <td><i class="fa fa-edit"> @Html.ActionLink("Edit", "ViewCriteria", "Clearance", new {Area = "Admin", @Model.admissionCriteriaList[itemIndex].Id}, null)</i></td> </tr> } </tbody> </table> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function () { $("#AdmissionListDetail_Form_ProgrammeFee_Programme_Id").change(function () { $("#AdmissionListDetail_Deprtment_Id").empty(); var selectedProgramme = $("#AdmissionListDetail_Form_ProgrammeFee_Programme_Id").val(); var programme = $("#AdmissionListDetail_Form_ProgrammeFee_Programme_Id").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function (departments) { $("#AdmissionListDetail_Deprtment_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#AdmissionListDetail_Deprtment_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }); }) </script> <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if(TempData["Message"] != null) { @Html.Partial("_Message",(Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">UPLOAD UNREGISTERED STUDENT IN ADMISSION LIST</p></h4> </div> @using(Html.BeginForm("UnregisteredStudent","UploadAdmission",FormMethod.Post,new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <cite><p class="custom-text-black"> Select the programme and department then the excel file to upload</p></cite> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id,new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CurrentSession.Id,(IEnumerable<SelectListItem>)ViewBag.SessionId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id,null,new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListType.Name,new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.AdmissionListType.Id,(IEnumerable<SelectListItem>)ViewBag.AdmissionListTypeId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AdmissionListType.Id,null,new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Form.ProgrammeFee.Programme.Id,new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.AdmissionListDetail.Form.ProgrammeFee.Programme.Id,(IEnumerable<SelectListItem>)ViewBag.ProgrammeId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Form.ProgrammeFee.Programme.Id,null,new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Deprtment.Id,"Course",new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.AdmissionListDetail.Deprtment.Id,(IEnumerable<SelectListItem>)ViewBag.DepartmentId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Deprtment.Id,null,new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.TextBoxFor(m => m.File,new { id = "file",type = "file",style = "color:transparent;",@class = "form-control custom-text-black" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.AdmissionListBatch.IUploadedFilePath,new { id = "",name = "" }) <input type="text" id="tbx-file-path" readonly="readonly" /> </div> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <i class="glyphicon-upload"></i><input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Upload Excel File" /> </div> </div> </div> </div> } </div> @if(Model == null || Model.UnregisteredAdmissionList == null) { return; } @if(Model != null && Model.UnregisteredAdmissionList != null) { using(Html.BeginForm("SaveUnRegisteredAdmissionList","UploadAdmission",FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="col-md-12"> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>Surname</th> <th>First Name</th> <th>Other Name</th> <th>Jamb Number</th> </tr> </thead> <tbody style="color:black;"> @for(var itemIndex = 0;itemIndex < Model.UnregisteredAdmissionList.Count;itemIndex++) { <tr> <td>@Html.DisplayTextFor(m => m.UnregisteredAdmissionList[itemIndex].Surname)</td> <td>@Html.DisplayTextFor(m => m.UnregisteredAdmissionList[itemIndex].Firstname)</td> <td>@Html.DisplayTextFor(m => m.UnregisteredAdmissionList[itemIndex].Othername)</td> <td>@Html.DisplayTextFor(m => m.UnregisteredAdmissionList[itemIndex].JambNumberNumber)</td> @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].Surname) @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].Firstname) @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].Othername) @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].JambNumberNumber) @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].Deprtment.Id) @Html.HiddenFor(m => m.UnregisteredAdmissionList[itemIndex].Programme.Id) </tr> } </tbody> </table> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <i class="glyphicon-upload"></i><input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save Upload" /> </div> </div> } } </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Web.UI; using Ionic.Zip; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AcceptanceReportAll : Page { private List<Department> departments; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } //public Level SelectedLevel //{ // get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } // set { ddlLevel.SelectedValue = value.Id.ToString(); } //} protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, Utility.GetAllProgrammes(), Utility.ID, Utility.NAME); //Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void DisplayReport(Session session, Department department, Programme programme) { try { var paymentLogic = new PaymentLogic(); List<AcceptanceView> report = paymentLogic.GetAcceptanceReport(session, department, programme, txtBoxDateFrom.Text, txtBoxDateTo.Text); string bind_dsStudentPaymentSummary = "DataSet"; string reportPath = @"Reports\PaymentReports\AcceptanceReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Acceptance Report "; ReportViewer1.LocalReport.ReportPath = reportPath; if (report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0 || SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } protected void ddlProgramme_SelectedIndexChanged1(object sender, EventArgs e) { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } protected void Display_Button_Click(object sender, EventArgs e) { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReport(SelectedSession, SelectedDepartment, SelectedProgramme); } protected void btBulk_Click(object sender, EventArgs e) { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return; } DepartmentLogic departmentLogic = new DepartmentLogic(); string downloadPath = "~/Content/temp" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond; if (Directory.Exists(Server.MapPath(downloadPath))) { Directory.Delete(Server.MapPath(downloadPath), true); } Directory.CreateDirectory(Server.MapPath(downloadPath)); string zipName = "Acceptance Report "; List<Department> programmedepartments = departmentLogic.GetBy(SelectedProgramme); for (int j = 0; j < programmedepartments.Count; j++) { Department currentDepartment = programmedepartments[j]; PaymentLogic paymentLogic = new PaymentLogic(); var report = paymentLogic.GetAcceptanceReport(SelectedSession, currentDepartment, SelectedProgramme, txtBoxDateFrom.Text, txtBoxDateTo.Text); if (report.Count > 0) { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string bind_dsStudentPaymentSummary = "DataSet"; string reportPath = @"Reports\PaymentReports\AcceptanceReport.rdlc"; ReportViewer rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Acceptance Report"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath(downloadPath); string savelocation = Path.Combine(path, SelectedProgramme.Name.Replace("/", "_") + " " + currentDepartment.Name.Replace("/", "_") + ".pdf"); File.WriteAllBytes(savelocation, bytes); } } using (ZipFile zip = new ZipFile()) { string file = Server.MapPath(downloadPath); zip.AddDirectory(file, ""); string zipFileName = zipName; zip.Save(file + zipFileName + ".zip"); string export = downloadPath + zipFileName + ".zip"; Response.Redirect(export, false); return; } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@model Abundance_Nk.Model.Model.AdmissionLetter @{ Layout = null; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <link href="~/Content/bootstrap-override.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <br /> <div class="container"> <div class="row"> <div class=" col-xs-10 col-sm-10 col-md-6 col-xs-offset-1 col-sm-offset-1 col-md-offset-3"> <div class="shadow"> <div class="row"> <div class="col-md-12"> <div class="alert alert-success fade in" style="border: 1px solid green"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 7px"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" width="50px" /></td> <td> <h4><strong>ABIA STATE UNIVERSITY, UTURU</strong></h4> <p> P.M.B. 2000, UTURU, ABIA STATE. </p> </td> </tr> </table> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="text-danger"> <h1>Admission Slip</h1> </div> <table class="table table-hover"> <tbody> <tr> <td class="col-md-4"><b>Name</b></td> <td class="col-md-8">@Model.Person.FullName</td> </tr> <tr> <td class="col-md-4"><b>Programme</b></td> <td class="col-md-8">@Model.Programme.Name </td> </tr> <tr> <td class="col-md-4"><b>Department</b></td> <td class="col-md-8">@Model.Department.Name</td> </tr> </tbody> </table> <br /> <div> Instructions on how to complete the admission process <div class="row"> <h5> <ol> <li><p>Confirm that you have met the departmental requirement</p></li> <li><p>Generate an acceptance fee invoice</p></li> <li><p>Proceed to the bank and make payment using the invoice number boldy written on the invoice</p></li> <li><p>Return to the portal and input the confirmation order given at the bank to print admission letter and acceptance receipt</p></li> <li><p>Verify O-level result</p></li> <li><p>Generate school fee invoice</p></li> <li><p>Proceed to the bank and make payment using the invoice number boldy written on the invoice</p></li> <li><p>Return to the portal and input the confirmation order given at the bank to print school fees receipt</p></li> <li><p>Fill course registration form</p></li> <li><p>Fill Student bio-data form</p></li> </ol> </h5> </div> </div> <br /> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "StudentsToRegister"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#payments').hide(); $("#loading").hide(); //Programme Drop down Selected-change event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); }); function ViewPayment(personId) { $("#loading").show(); $.ajax({ type: 'POST', url: '@Url.Action("GetPayments", "StudentCourseRegistration")', // Calling json method data: { id: personId }, success: function (result) { $("#loading").hide(); $('#viewP').html(result); $('#payments').modal("show"); }, error: function (ex) { $("#loading").hide(); alert('Failed to retrieve payments.' + ex); } }); return false; }; function Register(personId) { $("#loading").show(); $.ajax({ type: 'POST', url: '@Url.Action("RegisteStudent", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: personId }, success: function (result) { $("#loading").hide(); if (result = "Success") { alert('Registration Successful for the selected Session'); } }, error: function (ex) { $("#loading").hide(); alert('Registration Failed.' + ex); } }); return false; } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Unregistered Students</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("StudentsToRegister", "StudentCourseRegistration", new {area = "Admin"}, FormMethod.Post)) { <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @id = "Session"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, "Programme", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programme, new {@class = "form-control", @id = "Programme"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Department", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Department, new {@class = "form-control", @id = "Department"}) @Html.ValidationMessageFor(model => model.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @id = "Level"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View"/> </div> </div> } <br/> <div class="col-md-12"> @if (Model.StudentLevelList != null && Model.StudentLevelList.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <div id="loading" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Loading ...</span> </div> <table id="location" class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Name </th> <th> Matric Number </th> <th> Payment/Registration </th> </tr> @for (int i = 0; i < Model.StudentLevelList.Count(); i++) { <tr> <td> @Model.StudentLevelList[i].Student.FullName </td> <td> @Model.StudentLevelList[i].Student.MatricNumber </td> <td> <button class="btn-success btn mr5" onclick="ViewPayment(@Model.StudentLevelList[i].Student.Id)">View Payment</button> | <button href="#" class="btn-success btn mr5" onclick="Register(@Model.StudentLevelList[i].Student.Id)">Register Student</button> </td> </tr> } </table> </div> </div> } </div> <div id="payments" class="modal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Confirmed Payments</h4> </div> <div id="viewP"></div> </div> </div> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.StudentViewModel @{ ViewBag.Title = "ChangePassword"; } <div class="col-md-6 ml-auto mr-auto col-md-offset-3 col-sm-offset-0"> <div class="card card-shadow"> <h2>Change Password</h2> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal custom-text-black"> <h4>Enter your old password and new password to proceed</h4> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Student.MatricNumber) <div class="form-group"> @Html.LabelFor(model => model.OldPassword, new { @class = "control-label col-md-12 p-0" }) @Html.PasswordFor(model => model.OldPassword, new { @class = "form-control p-0" }) @Html.ValidationMessageFor(model => model.OldPassword) </div> <div class="form-group"> @Html.LabelFor(model => model.NewPassword, new { @class = "control-label col-md-12 p-0" }) @Html.PasswordFor(model => model.NewPassword, new { @class = "form-control p-0" }) @Html.ValidationMessageFor(model => model.NewPassword) </div> <div class="form-group"> @Html.LabelFor(model => model.ConfirmPassword, new { @class = "control-label col-md-12 p-0" }) @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "form-control p-0" }) @Html.ValidationMessageFor(model => model.ConfirmPassword) </div> <div class="form-group"> <div class="col-md-10 p-0"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.CourseViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script> $(document).ready(function () { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#divDepartmentOption").hide(); //var level = $("#course_Level_Id").val(); //var DepartmentOption = $("#course_DepartmentOption_Id").val(); //if (level > 2 && DepartmentOption > 0) { // $("#divDepartmentOption").show(); //} //Hide Department Option on Department change //$("#course_Department_Id").change(function() { // $("#divDepartmentOption").hide(); //}); //Load Department Option $("#course_Department_Id").change(function() { var department = $("#course_Department_Id").val(); //var programme = "3"; var programme= $('#course_Programme_Id').val(); //if (level > 2) { if (department > 0 && programme > 0) { $("#course_DepartmentOption_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: department, programmeid: programme }, success: function(departmentOptions) { if (departmentOptions == "" || departmentOptions == null || departmentOptions == undefined) { $("#divDepartmentOption").hide(); } else { $("#course_DepartmentOption_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function(i, Option) { $("#course_DepartmentOption_Id").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); if (programme == 1 || programme > 2) { $("#divDepartmentOption").show(); } } }, error: function(ex) { alert('Failed to retrieve department Options.' + ex); } }); } //} }); }) function DeleteCourse(id) { var response = confirm("Are you sure You want to Deactivate Course?"); if (response) { $.ajax({ type: 'POST', url: '@Url.Action("DeactivateCourse", "Courses")', // Calling json method traditional: true, data: { id }, success: function (result) { if (!result.isError && result.Message) { alert(result.Message); location.reload(true); } }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } else { return false; } } function ActivateCourse(id) { var response = confirm("Are you sure You want to Activate Course?"); if (response) { $.ajax({ type: 'POST', url: '@Url.Action("ActivateCourse", "Courses")', // Calling json method traditional: true, data: { id }, success: function (result) { if (!result.isError && result.Message) { alert(result.Message); location.reload(true); } }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } else { return false; } } </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="row"> <h3>View Departmental Courses</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Programme.Id, "Programme", new { @class = "control-label " }) @Html.DropDownListFor(model => model.course.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programmes, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.course.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Department.Id, "Course", new { @class = "control-label " }) @Html.DropDownListFor(model => model.course.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Departments, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.course.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Level.Id, "Level", new { @class = "control-label" }) @Html.DropDownListFor(model => model.course.Level.Id, (IEnumerable<SelectListItem>)ViewBag.levels, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.course.Level.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group"> @Html.LabelFor(model => model.course.DepartmentOption.Id, "Course", new { @class = "control-label " }) @Html.DropDownListFor(model => model.course.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.course.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="View" class="btn btn-default" /> </div> </div> </div> </div> } <br /> @if (Model != null && Model.Courses != null) { <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th> SN </th> <th> Course Code </th> <th> Course Title </th> <th> Level </th> <th> Semester </th> <th> Status </th> <th> Action </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.Courses.Count; i++) { int sn = i + 1; <tr> <td> @sn </td> <td> @Model.Courses[i].Code </td> <td> @Model.Courses[i].Name </td> <td> @Model.Courses[i].Level.Name </td> <td> @Model.Courses[i].Semester.Name </td> @if (Model.Courses[i].Activated == true) { <td>Active</td> <td><button class="btn btn-Secondary" onclick="DeleteCourse(@Model.Courses[i].Id)">De-Activate</button></td> } else { <td>Not Active</td> <td><button class="btn btn-primary" onclick="ActivateCourse(@Model.Courses[i].Id)">Activate</button></td> } </tr> } </tbody> </table> } </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadReturningStudentViewModel @{ ViewBag.Title = "ReturningStudents"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function() { $.extend($.fn.dataTable.defaults, { responsive: true }); $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); //Country Dropdown Selectedchange event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "UploadReturningStudents")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); }); </script> @if (TempData["Action"] != null) { <div class="alert alert-dismissable alert-success"> @TempData["Action"].ToString() </div> } @using (Html.BeginForm("ReturningStudents", "UploadReturningStudents", new {area = "admin"}, FormMethod.Post, new {enctype = "multipart/form-data"})) { <br /> <div class="panel panel-default"> <div class="panel-heading"> Student List</div> <div class="panel-body"> <div class="row"> <h3></h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control", @id = "Programme" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentId, new { @class = "form-control", @id = "Department" }) @Html.ValidationMessageFor(model => model.Department.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.LevelId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.TextBoxFor(m => m.File, new { id = "file", type = "file", style = "color:transparent;", @class = "form-control custom-text-black" }) </div> </div> <div class="col-md-6"> <div class="form-group"> <input type="text" id="tbx-file-path" readonly="readonly" /> </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Upload Excel File" /> </div> </div> </div> </div> </div> <div class="row"> @*@if (Model == null || Model.ReturningStudentList == null) { return; }*@ @if (Model != null && Model.ReturningStudentList != null && Model.ReturningStudentList.Count() > 0) { <table class="table table-bordered table-striped"> <tr> <th>SURNAME</th> <th>FIRSTNAME</th> <th>OTHERNAMES</th> <th>MATRICULATION NUMBER</th> <th>SEX</th> <th>STATE</th> <th>LOCAL GOVERNMENT AREA</th> </tr> @for (int i = 0; i < Model.ReturningStudentList.Count(); i++) { <tr> <td>@Model.ReturningStudentList[i].Surname</td> <td>@Model.ReturningStudentList[i].Firstname</td> <td>@Model.ReturningStudentList[i].Othername</td> <td>@Model.ReturningStudentList[i].MatricNumber</td> <td>@Model.ReturningStudentList[i].Gender</td> <td>@Model.ReturningStudentList[i].State</td> <td>@Model.ReturningStudentList[i].LocalGovernmentArea</td> </tr> } </table> @Html.ActionLink("Save", "SaveUpload", "UploadReturningStudents", new { Area = "Admin" }, new { @class = "btn btn-success mr5" }) } </div> <div class="row table-responsive"> @if (Model != null && Model.UploadedStudents != null && Model.UploadedStudents.Count > 0) { <table class="table table-bordered table-striped" id="myTable"> <thead> <tr> <th>Name</th> <th>Matric Number</th> <th>Programme</th> <th>Department</th> <th>Level</th> <th>Session</th> </tr> </thead> <tbody> @for (int i = 0; i < Model.UploadedStudents.Count(); i++) { <tr> <td>@Model.UploadedStudents[i].Name</td> <td>@Model.UploadedStudents[i].MatricNumber</td> <td>@Model.UploadedStudents[i].Programme</td> <td>@Model.UploadedStudents[i].Department</td> <td>@Model.UploadedStudents[i].Level</td> <td>@Model.UploadedStudents[i].Session</td> </tr> } </tbody> </table> } </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; } @Html.HiddenFor(model => model.PreviousEducation.Id) <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Tertiary Education</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.SchoolName) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.SchoolName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.Course) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.Course) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.StartDate) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.StartDate, "{0:dd/MM/yyyy}") </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.EndDate) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.EndDate, "{0:dd/MM/yyyy}") </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.Qualification.ShortName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.ResultGrade.LevelOfPass) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.PreviousEducation.ITDuration.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> @*<div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.PreND) </div> <div class="col-md-7 text-bold"> @Html.DisplayFor(model => model.PreviousEducation.PreND) </div>*@ </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> @*<div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.PreNDYearFrom) </div> <div class="col-md-7 text-bold"> @Html.DisplayFor(model => model.PreviousEducation.PreNDYearFrom) </div>*@ </div> </div> <div class="col-md-6"> <div class="form-group"> <div class="form-group margin-bottom-3"> @*<div class="col-md-5"> @Html.LabelFor(model => model.PreviousEducation.PreNDYearTo) </div> <div class="col-md-7 text-bold"> @Html.DisplayFor(model => model.PreviousEducation.PreNDYearTo) </div>*@ </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "Add Staff"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("CreateUser", "User", new {area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-user"></i>Add Staff</h3> </div> <div class="panel-body"> @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.User.Username, "Staff Name", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.User.Username, new {@class = "form-control", @placeholder = "Enter Staff Name", @required = "required"}) @Html.ValidationMessageFor(model => model.User.Username, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.User.Password, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.User.Password, new {@class = "form-control", @placeholder = "Enter Password", @type = "password", @required = "required"}) @Html.ValidationMessageFor(model => model.User.Password, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.User.Email, "Email", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.User.Email, new {@class = "form-control", @placeholder = "Enter Email Address"}) @Html.ValidationMessageFor(model => model.User.Email, null, new {@class = "text-danger"}) </div> </div> @*<div class="form-group"> @Html.LabelFor(model => model.User.Role.Id,"Role", new { @class = "col-sm-2 control-label " }) <div class="col-sm-4"> @Html.DropDownListFor(model => model.User.Role.Id, (IEnumerable<SelectListItem>)ViewBag.RoleList, new { @class = "form-control", @id = "Role" }) @Html.ValidationMessageFor(model => model.User.Role.Id) </div> </div>*@ <div class="form-group"> @Html.LabelFor(model => model.User.SecurityQuestion.Id, "Security Question", new {@class = "col-sm-2 control-label "}) <div class="col-sm-4"> @Html.DropDownListFor(model => model.User.SecurityQuestion.Id, (IEnumerable<SelectListItem>) ViewBag.SecurityQuestionList, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.User.SecurityQuestion.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.User.SecurityAnswer, "Security Answer", new {@class = "col-sm-2 control-label "}) <div class="col-sm-4"> @Html.TextBoxFor(model => model.User.SecurityAnswer, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.User.SecurityAnswer) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <br /> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Create" /> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ ViewBag.Title = "CardPayment"; Layout = "~/Views/Shared/_Layout.cshtml"; } <img src="~/Content/Images/payment_options.png" /> <form action="https://login.remita.net/remita/ecomm/finalize.reg" name="SubmitRemitaForm" method="POST"> <input name="merchantId" value="@Model.RemitaPayment.MerchantCode" type="hidden"> <input name="hash" value="@Model.Hash" type="hidden"> <input name="rrr" value="@Model.RemitaPayment.RRR" type="hidden"> <input name="responseurl" value="http://applications.federalpolyilaro.edu.ng/Admin/RemitaReport/PaymentReceipt" type="hidden"> <input type="submit" name="submit_btn" class="btn btn-default mr5" value="Pay Via Remita using card"> </form><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel <div class="row col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div> <div class="card-body"> <h3 class="font-weight-normal mb-4">Choose Programme</h3> <hr /> <div class="row"> <div class="col-md-6 col-sm-12 form-group"> @Html.LabelFor(model => model.Session.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Sessions, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.LabelFor(model => model.StudentLevel.Programme.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.StudentLevel.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programmes, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.StudentLevel.Programme.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.LabelFor(model => model.StudentLevel.Department.Id, "Course", new { @class = "control-label " }) @Html.DropDownListFor(model => model.StudentLevel.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Departments, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group" id="divDepartmentOption" style="display: none"> @if (Model.StudentLevel.DepartmentOption != null && Model.StudentLevel.DepartmentOption.Id > 0) { @Html.HiddenFor(model => model.StudentLevel.DepartmentOption.Id) } @Html.LabelFor(model => model.StudentLevel.DepartmentOption.Id, "Course Option", new { @class = "control-label" }) @Html.DropDownListFor(model => model.StudentLevel.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptions, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentLevel.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-12"><hr class="bg-info" /></div> <div class="col-md-12"> <h3 class="font-weight-normal">Please enter other personal details</h3> </div> <div class="col-md-12"><hr /></div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Person.LastName) @Html.LabelFor(model => model.Person.LastName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.LastName, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.Person.LastName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Person.FirstName) @Html.LabelFor(model => model.Person.FirstName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.FirstName, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Person.OtherName) @Html.LabelFor(model => model.Person.OtherName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.OtherName, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", required = "required", disabled = true }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Person.State.Id) @Html.LabelFor(model => model.Person.State.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.States, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.HiddenFor(model => model.Person.Email) @Html.LabelFor(model => model.Person.Email, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(model => model.Person.Email, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new { @class = "text-danger" }) </div> <div class="col-md-6 col-sm-12 form-group"> @Html.LabelFor(model => model.StudentLevel.Level.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.StudentLevel.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Levels, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentLevel.Level.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-12 col-sm-12 form-group"> @Html.LabelFor(model => model.PaymentMode.Id, "Payment Option", new { @class = "control-label " }) @Html.DropDownListFor(model => model.PaymentMode.Id, (IEnumerable<SelectListItem>)ViewBag.PaymentModes, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentMode.Id, null, new { @class = "text-danger" }) </div> </div> </div> </div> <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ApplicantInformationReportBulk : System.Web.UI.Page { private List<Department> departments; protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, Utility.GetAllProgrammes(), Utility.ID, Utility.NAME); ddlDepartment.Visible = false; } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } private void BuildReport(Programme programme,Department department, Session session) { try { StudentLevelLogic studentLevelLogic = new StudentLevelLogic(); var studentList= studentLevelLogic.GetModelsBy(f => f.Programme_Id == programme.Id && f.Department_Id==department.Id && f.Level_Id==1 && f.Session_Id==session.Id); if(studentList != null && studentList.Count > 0) { string downloadPath = "~/Content/studentReportFolder" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond; if (Directory.Exists(Server.MapPath(downloadPath))) { Directory.Delete(Server.MapPath(downloadPath), true); Directory.CreateDirectory(Server.MapPath(downloadPath)); } else { Directory.CreateDirectory(Server.MapPath(downloadPath)); } for (int i=0; i<studentList.Count; i++) { var studentId = studentList[i].Student.Id; var studentName = studentList[i].Student.FullName; var person = new Person { Id = studentId }; var studentLogic = new StudentLogic(); var reportData = new List<Model.Model.StudentReport>(); var OLevelDetail = new List<Model.Model.StudentReport>(); //OLevelDetail = studentLogic.GetStudentOLevelDetail(person); reportData = studentLogic.GetStudentBiodata(person); string bind_dsStudentReport = "dsStudentReport"; //string bind_dsStudentResult = "dsStudentResult"; string reportPath = ""; //if (type == 1) //{ // reportPath = @"Reports\AbsuCertificateOfEligibility.rdlc"; //} //if (type == 2) //{ // reportPath = @"Reports\AbsuCheckingCredentials.rdlc"; //} //if (type == 3) //{ reportPath = @"Reports\AbsuPersonalInfo.rdlc"; //} //if (type == 4) //{ // reportPath = @"Reports\AbsuUnderTaking.rdlc"; //} Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Student Information"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentReport.Trim(), reportData)); //rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResult.Trim(), OLevelDetail)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath(downloadPath); string savelocation = ""; savelocation = Path.Combine(path, studentName + ".pdf"); File.WriteAllBytes(savelocation, bytes); //var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); //Response.Redirect( // urlHelp.Action("DownloadReport", // new // { // controller = "Report", // area = "Student", // path = "~/Content/studentReportFolder/StudentInformation.pdf" // }), false); } using (var zip = new ZipFile()) { string file = Server.MapPath(downloadPath); zip.AddDirectory(file, ""); string zipFileName = department.Name.Replace('/', '_'); zip.Save(file + zipFileName + ".zip"); string export = downloadPath + zipFileName + ".zip"; //Response.Redirect(export, false); //var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect(export, false); //Response.Redirect( // urlHelp.Action("DownloadApplicantInfornationReportZip", // new { controller = "Result", area = "Admin", downloadName = department.Name }), false); } } //return File(Server.MapPath(savelocation), "application/zip", reportData.FirstOrDefault().Fullname.Replace(" ", "") + ".zip"); //Response.Redirect(savelocation, false); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void ddlProgramme_SelectedIndexChanged1(object sender, EventArgs e) { try { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } catch (Exception) { throw; } } protected void Display_Button_Click1(object sender, EventArgs e) { Session session = SelectedSession; Programme programme = SelectedProgramme; Department department = SelectedDepartment; BuildReport(programme, department, session); } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ChangeCourseViewModel @{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-12"> @using (Html.BeginForm("SearchResult", "ChangeCourse", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (TempData["Action"] != null) { <div class="alert alert-dismissible alert-warning"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@TempData["Action"].ToString()</p> </div> } </div> </div> <div class="row"> <h3>Enter Application Form Number</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationFormNumber, new {@class = "control-label "}) @Html.TextBoxFor(model => model.ApplicationFormNumber, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicationFormNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> </div> <br /> </div> </div> <div class="col-md-1"></div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.MenuViewModel @{ ViewBag.Title = "EditMenu"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Add Role Menu</h4> </div> <div class="panel-body"> @using (Html.BeginForm("EditMenu", "Menu", new {Area = "Admin"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) @Html.HiddenFor(m => m.Menu.Id) <div class="form-group"> @Html.LabelFor(m => m.MenuGroup.Name, " Menu Group", new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(m => m.MenuGroup.Id, (IEnumerable<SelectListItem>) ViewBag.MenuGroup, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.MenuGroup.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Menu.Area, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.Menu.Area, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Menu.Area, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Menu.Controller, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.Menu.Controller, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Menu.Controller, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Menu.Action, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.Menu.Action, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Menu.Action, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Menu.DisplayName, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.Menu.DisplayName, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Menu.DisplayName, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Menu.Activated, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.CheckBoxFor(m => m.Menu.Activated) @Html.ValidationMessageFor(m => m.Menu.Activated, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> </div> } </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.GstViewModel @{ ViewBag.Title = "View Upload"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @section Scripts{ @Scripts.Render(("~/bundles/jquery")) <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/sweetalert.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script type="text/javascript"> $(document).ready(function () { $(".Load").hide(); $("#gstResultTable").DataTable(); var checkId = $("#resultId").val(); if (checkId != null) { $("#editModal").modal('show'); } }); $("#semId").change(function () { $("#courseId").empty(); var semester = $("#semId").val(); var department = $("#departmentId").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetCourseCodeByDepartment")', // we are calling json method dataType: 'json', data: { id: department, semesterId: semester }, success: function (courseCodes) { $("#courseId").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(courseCodes, function (i, department) { $("#courseId").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve course Codes.' + ex); } }); }); function showBusy() { $(".Load").show(); } </script> } <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("ViewUpload", "UploadGstScanResult", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <p class="custom-text-black"> Select the <b>Department</b>,<b>Semester</b>and <b>Course Code to view Uploaded file</b> </p> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Id, "Depaertment", new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control", Id = "departmentId"}) @Html.ValidationMessageFor(model => model.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Semester.Id, "Semester", new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>) ViewBag.SemesterId, new {@class = "form-control", Id = "semId"}) @Html.ValidationMessageFor(model => model.Semester.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Course.Id, "Course Code", new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Course.Id, (IEnumerable<SelectListItem>) ViewBag.CourseCode, new {@class = "form-control", Id = "courseId"}) @Html.ValidationMessageFor(model => model.Course.Id, null, new {@class = "text-danger"}) </div> </div> </div> <br/> <br/> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="submit"><i class="fa fa-eye"> View </i></button><span class="Load"><img src="~/Content/Images/loading4.gif" /></span> </div> </div> </div> </div> } </div> @if (Model == null || Model.GstScanList == null) { return; } @if (Model != null && Model.GstScanList != null) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="gstResultTable"> <thead> <tr> <th> SN </th> <th> Course Code </th> <th> Course Title </th> <th> Exam Number/Matric_Number </th> <th> Name </th> <th> Department </th> <th> Raw Score </th> <th> CA </th> <th> Total </th> <th> Semester Name </th> <th> </th> </tr> </thead> <tbody style="color: black;"> @for (var itemIndex = 0; itemIndex < Model.GstScanList.Count; itemIndex++) { int SN = itemIndex + 1; <tr> <td>@SN</td> <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].CourseCode)</td> <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].CourseTitle)</td> @if (Model.GstScanList[itemIndex].MatricNumber != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].MatricNumber)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Name != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Name)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].DepartmentName != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].DepartmentName)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].RawScore >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].RawScore)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Ca >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Ca)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Total >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Total)</td> } else { <td></td> } <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].SemesterName)</td> <td class="fa fa-edit">@Html.ActionLink("Edit", "EditGstScanResult", new { area = "Admin", resultId = Model.GstScanList[itemIndex].Id })</td> </tr> } </tbody> </table> </div> } </div> </div> @if( Model == null || Model.GstScan == null ) { return; } @if (Model != null && Model.GstScan != null) { <div class="modal fade" role="dialog" id="editModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Edit Gst Scanned Result </h4> <span class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> @using (Html.BeginForm("SaveEditedGstResult", "UploadGstScanResult", FormMethod.Post, new {enctype = "multipart/form-data"})) { <div class="modal-body"> <div class="form-group"> @Html.LabelFor(model => model.GstScan.Name, "Name", new {@class = "control-label"}) @Html.TextBoxFor(model => model.GstScan.Name, new {@class = "form-control", id = "idEdit"}) @Html.ValidationMessageFor(model => model.GstScan.Name) </div> <div class="form-group"> @Html.LabelFor(model => model.GstScan.MatricNumber, "Matric Number", new {@class = "control-label"}) @Html.TextBoxFor(model => model.GstScan.MatricNumber, new {@class = "form-control", id = "idEdit"}) @Html.ValidationMessageFor(model => model.GstScan.MatricNumber) </div> <div class="form-group"> @Html.LabelFor(model => model.GstScan.RawScore, "Raw Score", new {@class = "control-label"}) @Html.TextBoxFor(model => model.GstScan.RawScore, new {@class = "form-control", id = "idEdit"}) @Html.ValidationMessageFor(model => model.GstScan.RawScore) </div> <div class="form-group"> @Html.LabelFor(model => model.GstScan.Total, "Total", new {@class = "control-label"}) @Html.TextBoxFor(model => model.GstScan.Total, new {@class = "form-control", id = "idEdit"}) @Html.ValidationMessageFor(model => model.GstScan.Total) </div> </div> <div class="modal-footer form-group"> <button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="submit"><i class="fa fa-file"> Save </i></button><span class="Load"><img src="~/Content/Images/loading4.gif" /></span> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> } </div> </div> </div> }<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ExamRawScoreSheet :Page { private readonly List<Semester> semesters = new List<Semester>(); private Course course; private string courseId; private List<Course> courses; private Department department; private List<Department> departments; private string deptId; private Level level; private string levelId; private string progId; private Programme programme; private Semester semester; private string semesterId; private Session session; private string sessionId; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Semester SelectedSemester { get { return new Semester { Id = Convert.ToInt32(ddlSemester.SelectedValue), Name = ddlSemester.SelectedItem.Text }; } set { ddlSemester.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Course SelectedCourse { get { return new Course { Id = Convert.ToInt32(ddlCourse.SelectedValue),Name = ddlCourse.SelectedItem.Text }; } set { ddlCourse.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(Request.QueryString["levelId"] != null && Request.QueryString["semesterId"] != null && Request.QueryString["progId"] != null && Request.QueryString["deptId"] != null && Request.QueryString["sessionId"] != null && Request.QueryString["courseId"] != null) { levelId = Request.QueryString["levelId"]; semesterId = Request.QueryString["semesterId"]; progId = Request.QueryString["progId"]; deptId = Request.QueryString["deptId"]; sessionId = Request.QueryString["sessionId"]; courseId = Request.QueryString["courseId"]; int deptId1 = Convert.ToInt32(deptId); int progId1 = Convert.ToInt32(progId); int sessionId1 = Convert.ToInt32(sessionId); int levelId1 = Convert.ToInt32(levelId); int semesterId1 = Convert.ToInt32(semesterId); int courseId1 = Convert.ToInt32(courseId); session = new Session { Id = sessionId1 }; semester = new Semester { Id = semesterId1 }; course = new Course { Id = courseId1 }; department = new Department { Id = deptId1 }; level = new Level { Id = levelId1 }; programme = new Programme { Id = progId1 }; } else { Display_Button.Visible = true; } if(!Request.IsAuthenticated) { Response.Redirect("http://www.abiastateuniversity.edu.ng/",true); } if(!IsPostBack) { if(string.IsNullOrEmpty(deptId) || string.IsNullOrEmpty(progId) || string.IsNullOrEmpty(sessionId)) { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); ddlSemester.Visible = false; Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; ddlCourse.Visible = false; } else { DisplayStaffReport(session,semester,course,department,level,programme); ddlDepartment.Visible = false; ddlCourse.Visible = false; ddlLevel.Visible = false; ddlProgramme.Visible = false; ddlSemester.Visible = false; ddlSession.Visible = false; } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void DisplayStaffReport(Session session,Semester semester,Course course,Department department, Level level,Programme programme) { try { DisplayReportBy(session,semester,course,department,level,programme); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void Display_Button_Click1(object sender,EventArgs e) { try { if(InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession,SelectedSemester,SelectedCourse,SelectedDepartment,SelectedLevel, SelectedProgramme); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0 || SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } private void DisplayReportBy(Session session,Semester semester,Course course,Department department, Level level,Programme programme) { try { var studentResultLogic = new StudentResultLogic(); List<Model.Model.Result> studeResults = studentResultLogic.GetStudentResultBy(session,semester,level, programme,department,course); string bind_dsStudentResultSummary = "dsExamRawScoreSheet"; string reportPath = @"Reports\Result\ExamRawScoreSheet.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Examination Raw Score Sheet "; ReportViewer1.LocalReport.ReportPath = reportPath; if(studeResults != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResultSummary.Trim(), studeResults)); ReportViewer1.LocalReport.Refresh(); ReportViewer1.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void ddlProgramme_SelectedIndexChanged1(object sender,EventArgs e) { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); departments.Insert(0,new Department { Name = "-- Select Department--" }); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } protected void ddlSession_SelectedIndexChanged1(object sender,EventArgs e) { var session = new Session { Id = Convert.ToInt32(ddlSession.SelectedValue) }; var sessionSemesterLogic = new SessionSemesterLogic(); List<SessionSemester> semesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); foreach(SessionSemester sessionSemester in semesterList) { semesters.Add(sessionSemester.Semester); } semesters.Insert(0,new Semester { Name = "-- Select Semester--" }); Utility.BindDropdownItem(ddlSemester,semesters,Utility.ID,Utility.NAME); ddlSemester.Visible = true; } protected void ddlDepartment_SelectedIndexChanged(object sender,EventArgs e) { try { var courseLogic = new CourseLogic(); courses = courseLogic.GetModelsBy( p => p.Programme_Id == SelectedProgramme.Id && p.Department_Id == SelectedDepartment.Id && p.Level_Id == SelectedLevel.Id && p.Semester_Id == SelectedSemester.Id); courses.Insert(0,new Course { Name = "-- Select Course--" }); Utility.BindDropdownItem(ddlCourse,courses,Utility.ID,Utility.NAME); ddlCourse.Visible = true; } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "Create Geo Zone"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @using (Html.BeginForm("CreateGeoZone", "TranscriptProcessor", new { area = "admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <br /> <div class="panel panel-default"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body"> <h2 style="font-weight: 300; text-align: center">Create Geo Zone</h2> <hr /> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.GeoZone.Name, "Name", new { @class = "control-label " }) @Html.TextBoxFor(model => model.GeoZone.Name, new { @class = "form-control", required = true, @placeholder = "E.g NorthWest or Canada For Forgein Countries" }) @Html.ValidationMessageFor(model => model.GeoZone.Name, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.GeoZone.Description, "Description", new { @class = "control-label " }) @Html.TextBoxFor(model => model.GeoZone.Description, new { @class = "form-control"}) @Html.ValidationMessageFor(model => model.GeoZone.Description, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6" style="margin-top: 20px"> <div class="form-group"> @Html.CheckBoxFor(model => model.GeoZone.Activated, new { @class = "", required = true, }) @Html.LabelFor(model => model.GeoZone.Activated, "Activate", new { @class = "control-label " }) @Html.ValidationMessageFor(model => model.GeoZone.Activated, null, new { @class = "text-danger" }) </div> </div> </div> <hr /> <div class="row"> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" value="Create" /> </div> </div> </div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.CourseRegistrationViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> @section Scripts { @Scripts.Render("~/bundles/jqueryval") <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> $(document).ready(function() { BindCheckBoxes(); UpdateUIState(); //$("frmCourseRegistration").submit(function (e) { // //if ($("frmCourseRegistration").valid()) { // $.post($(this).attr("action"), $(this).serialize()); // //} // e.preventDefault(); //}); //$('input.example').on('change', function () { // $('CTE315').not(this).prop('checked', false); //}); $("#btnRegisterCourse").click(function() { try { var data = $('#frmCourseRegistration').serialize(); $.ajax({ type: "POST", url: "@Url.Action("Form", "CourseRegistration")", dataType: "json", data: $("#frmCourseRegistration").serialize(), beforeSend: function() { $("#processing").show(); }, complete: function() { $("#processing").hide(); }, success: SuccessFunc, error: ErrorFunc, }); } catch (e) { alert(e); } }); function ErrorFunc() { alert("Operation failed!"); } function SuccessFunc(data, status) { if (data.message.indexOf("Error Occurred") <= -1) { $('#btnRegisterCourse').prop('disabled', true); $("#selectAllFirstSemester").prop('disabled', true); $("#selectAllSecondSemester").prop('disabled', true); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); $('#divCourseFormPrintOut').show(); } alert(data.message); } function InvalidUserInput() { try { var firstSemesterMinimumUnit = $('#FirstSemesterMinimumUnit').val(); var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMinimumUnit = $('#SecondSemesterMinimumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); var firstSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb1")); var secondSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb2")); firstSemesterSelectedUnit += parseInt(firstSemesterCarryOverTotalUnit); secondSemesterSelectedUnit += parseInt(secondSemesterCarryOverTotalUnit); return false; } catch (e) { throw e; } } function BindCheckBoxes() { try { BindSelectAll($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectAll($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); BindSelectOne($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectOne($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); UpdateSelectAllCheckBox($("#selectAllFirstSemester"), $(".ckb1")); UpdateSelectAllCheckBox($("#selectAllSecondSemester"), $(".ckb2")); } catch (e) { alert(e); } } function BindSelectAll(chkBox, chkBoxClass, courseUnitLabel) { chkBox.click(function(event) { try { if (this.checked) { chkBoxClass.each(function() { this.checked = true; }); } else { chkBoxClass.each(function() { this.checked = false; }); } var totalUnit = CalculateSelectedCourseUnit(chkBoxClass); courseUnitLabel.html(totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateButtonState() { try { if (InvalidUserInput()) { $('#btnRegisterCourse').prop('disabled', true); } else { $('#btnRegisterCourse').prop('disabled', false); } } catch (e) { throw e; } } function BindSelectOne(chkBox, chkBoxClass, courseUnitLabel) { chkBoxClass.click(function(event) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (!this.checked) { chkBox.removeAttr('checked'); } else { if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } var totalUnit = CalculateSelectedCourseUnit(chkBoxClass); courseUnitLabel.html(totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateSelectAllCheckBox(chkBox, chkBoxClass) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } catch (e) { alert(e); } } function CalculateSelectedCourseUnit(checkBox) { try { var totalUnit = 0; var values = new Array(); $.each(checkBox.filter(":checked").closest("td").siblings('.unit'), function() { values.push($(this).text()); }); if (values != null && values.length > 0) { for (var i = 0; i < values.length; i++) { totalUnit += parseInt(values[i]); } } return totalUnit; } catch (e) { alert(e); } } //function CalculateSelectedCourseUnit(checkBox) { // try // { // var totalUnit = 0; // //var units = checkBox.map(function () { return $(this).val(); }); // var units = checkBox.filter(":checked").map(function () { return $(this).val(); }); // if (units.toArray() != null && units.toArray().length > 0) { // for (var i = 0; i < units.toArray().length; i++) { // totalUnit += units[i] << 0; // } // } // return totalUnit; // } // catch (e) { // throw e; // } //} function UpdateUIState() { try { var courseAlreadyRegistered = $('#CourseAlreadyRegistered').val(); if (courseAlreadyRegistered.toLowerCase() == 'true') { $('#btnRegisterCourse').prop('disabled', false); var approved = $('#RegisteredCourse_Approved').val(); if (approved.toLowerCase() == 'true') { $('#buttons').hide('fast'); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); } else { $('#buttons').show(); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); } $('#divCourseFormPrintOut').show(); } else { $('#buttons').show(); $('#btnRegisterCourse').prop('disabled', true); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); $('#divCourseFormPrintOut').hide('fast'); } var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); if ((parseInt(firstSemesterCarryOverTotalUnit) <= parseInt(firstSemesterMaximumUnit)) && (parseInt(secondSemesterCarryOverTotalUnit) <= parseInt(secondSemesterMaximumUnit))) { $("#selectAllCarryOverCourses").prop('checked', 'checked'); $("#selectAllCarryOverCourses").prop('disabled', true); ////$(".ckb3").prop('checked', true); //$(".ckb3").prop('checked', 'checked'); $(".ckb3").prop('disabled', true); } } catch (e) { throw e; } } }); </script> } <div class="row"> <div class="col-md-3"> <div class="logopanel"> <h1><span style="color: #35925B">Course Registration</span></h1> </div> <div class="panel panel-default"> <div class="panel-body"> <ul class="leftmenu"> <li> <a href="#"><b>Instructions</b></a> </li> </ul> <ol> <li class="margin-bottom-5">Select your courses of choice</li> <li class="margin-bottom-5">All selected course units must not be greater than 24 and must not be less than 15</li> <li class="margin-bottom-5">Click the Register Course button to register the selected courses</li> <li class="margin-bottom-5">After successfully course registration, click on Print Course Form button to print your course form</li> <li class="margin-bottom-5">You can print your course form at any time you want after a successful login.</li> </ol> </div> </div> <div class="panel panel-default"> <div class="panel-body"> </div> </div> </div> <div class="col-md-9"> @using (Html.BeginForm("Form", "CourseRegistration", new {Area = "Student"}, FormMethod.Post, new {id = "frmCourseRegistration"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.CurrentSessionSemester.SessionSemester.Session.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.HiddenFor(model => model.TotalSecondSemesterCarryOverCourseUnit) @Html.HiddenFor(model => model.TotalFirstSemesterCarryOverCourseUnit) @Html.HiddenFor(model => model.FirstSemesterMinimumUnit) @Html.HiddenFor(model => model.FirstSemesterMaximumUnit) @Html.HiddenFor(model => model.SecondSemesterMinimumUnit) @Html.HiddenFor(model => model.SecondSemesterMaximumUnit) @Html.HiddenFor(model => model.CourseAlreadyRegistered) @Html.HiddenFor(model => model.CarryOverExist) @Html.HiddenFor(model => model.RegisteredCourse.Id) @Html.HiddenFor(model => model.RegisteredCourse.Approved) if (Model.Student != null && Model.Student.ApplicationForm != null) { @Html.HiddenFor(model => model.Student.ApplicationForm.Id) } <div class="shadow"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <div class="col-md-12" style="font-size: 15pt; text-transform: uppercase"> @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.DisplayFor(model => model.Student.FullName) (@Html.DisplayFor(model => model.StudentLevel.Level.Name)) DETAILS </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label "}) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.Label("Session", new {@class = "control-label "}) </div> <div class="col-md-7 "> @Html.HiddenFor(model => model.CurrentSessionSemester.SessionSemester.Session.Id) @Html.DisplayFor(model => model.CurrentSessionSemester.SessionSemester.Session.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new {@class = "control-label "}) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.DisplayFor(model => model.StudentLevel.Programme.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new {@class = "control-label "}) </div> <div class="col-md-7 "> @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.DisplayFor(model => model.StudentLevel.Department.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Name, new {@class = "control-label "}) </div> <div class="col-md-8 "> @Html.DisplayFor(model => model.StudentLevel.Department.Faculty.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> if (Model != null && Model.CarryOverCourses != null && Model.CarryOverCourses.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-md-12"> <b>Carry Over Courses</b> <div class="pull-right record-count-label"> <label class="caption">1st Semester Total Unit</label><span class="badge">@Model.TotalFirstSemesterCarryOverCourseUnit</span> <label class="caption">2nd Semester Total Unit</label><span class="badge">@Model.TotalSecondSemesterCarryOverCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.CarryOverCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @Html.CheckBox("selectAllCarryOverCourses") </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> <th> Semester </th> </tr> </thead> @for (int i = 0; i < Model.CarryOverCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.IsRegistered) @Html.CheckBoxFor(model => Model.CarryOverCourses[i].Course.IsRegistered, new {@class = "ckb3", id = Model.CarryOverCourses[i].Course.Id}) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Code) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Unit) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Type.Name) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Semester.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Semester.Name) </td> @Html.HiddenFor(model => Model.CarryOverCourses[i].Id) @Html.HiddenFor(model => Model.CarryOverCourses[i].Mode.Id) @Html.HiddenFor(model => Model.CarryOverCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div> </div> </div> </div> } <div class="panel panel-default"> <div class="panel-body"> <div id="divFirstSemesterCourses"> @if (Model != null && Model.FirstSemesterCourses != null && Model.FirstSemesterCourses.Count > 0) { <div class="row"> <div class="col-md-12"> <b>First Semester Courses</b> <div class="pull-right record-count-label"> <label class="caption">Sum of Selected Course Unit</label><span id="spFirstSemesterTotalCourseUnit" class="badge">@Model.SumOfFirstSemesterSelectedCourseUnit</span> <label class="caption">Min Unit</label><span id="spFirstSemesterMinimumUnit" class="badge">@Model.FirstSemesterMinimumUnit</span> <label class="caption">Max Unit</label><span id="spFirstSemesterMaximumUnit" class="badge">@Model.FirstSemesterMaximumUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.FirstSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @Html.CheckBox("selectAllFirstSemester") </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < Model.FirstSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.CheckBoxFor(model => Model.FirstSemesterCourses[i].Course.IsRegistered, new {@class = "ckb1", id = Model.FirstSemesterCourses[i].Course.Id}) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Code) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Id) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Unit) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Type.Name) </td> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Mode.Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div> } </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <div id="divSecondSemesterCourses"> @if (Model != null && Model.SecondSemesterCourses != null && Model.SecondSemesterCourses.Count > 0) { <div class="row"> <div class="col-md-12"> <b>Second Semester Courses</b> <div class="pull-right record-count-label"> <span class="caption">Sum of Selected Course Unit</span><span id="spSecondSemesterTotalCourseUnit" class="badge">@Model.SumOfSecondSemesterSelectedCourseUnit</span> <label class="caption">Min Unit</label><span id="spSecondSemesterMinimumUnit" class="badge">@Model.SecondSemesterMinimumUnit</span> <label class="caption">Max Unit</label><span id="spSecondSemesterMaximumUnit" class="badge">@Model.SecondSemesterMaximumUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.SecondSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive" style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb5"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @Html.CheckBox("selectAllSecondSemester") </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < Model.SecondSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.CheckBoxFor(model => Model.SecondSemesterCourses[i].Course.IsRegistered, new {@class = "ckb2", id = Model.SecondSemesterCourses[i].Course.Id}) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Code) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Id) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Unit) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Type.Name) </td> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Mode.Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div> } </div> </div> </div> <div class="row" id="buttons" style="display: none"> <div class="col-md-12"> <div> <div class="form-inline "> <div class="form-group"> <input type="button" id="btnRegisterCourse" value="Register Course" class="btn btn-white btn-lg" /> </div> <div id="divCourseFormPrintOut" class="form-group" style="display: none"> @Html.ActionLink("Print Invoice", "invoice", "ExtraYear", new {Area = "Student", ivn = Model.invoiceNumber}, new {@class = "btn btn-white btn-lg ", target = "_blank", id = "alCourseRegistration"}) </div> <div class="form-group"> <div id="processing" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> } </div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ ViewBag.Title = "Post JAMB Invoice"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Scripts/DropZone/dropzone.css" rel="stylesheet" /> <script src="~/Scripts/DropZone/dropzone.js"></script> <div> <script type="text/javascript"> var personId; var formNumber; var personImageUrl; var hasPassport; $(document).ready(function () { formNumber = $("#ApplicationForm_Number").val(); hasPassport = $("#HasJambPassport").val(); $('#loading').hide(); if (formNumber != null) { $('#submitBtn').show(); } if (hasPassport>0) { $('#submitBtn').show(); } var navListItems = $('ul.setup-panel li a'), allWells = $('.setup-content'); allWells.hide(); navListItems.click(function (e) { e.preventDefault(); var $target = $($(this).attr('href')), $item = $(this).closest('li'), $clickId = $target[0].id; var programmeId = $("#@Html.IdFor(m => m.AppliedCourse.Programme.Id)").val(); if ($clickId == "step-2") { var d = new Date(); var sexId = $("#Person_Sex_Id").val(); var dob = $("#Person_DayOfBirth_Id").val(); var yob = $("#Person_YearOfBirth_Id").val(); if (d.getFullYear() - yob < 15) { alert("You must be atleast 15years od to apply!"); } var mob = $("#Person_MonthOfBirth_Id").val(); var stateId = $("#Person_State_Id").val(); var lgaId = $("#Person_LocalGovernment_Id").val(); var homeTown = $("#Person_HomeTown").val(); var mobilePhone = $("#Person_MobilePhone").val(); var email = $("#Person_Email").val(); var religionId = $("#Person_Religion_Id").val(); var homeAddress = $("#Person_HomeAddress").val(); var abilityId = $("#Applicant_Ability_Id").val(); var otherAbility = $("#Applicant_OtherAbility").val(); var extraCurricullarActivities = $("#Applicant_ExtraCurricullarActivities").val(); personId = $("#Person_Id").val(); if (sexId && dob && stateId && lgaId && homeTown && mobilePhone && religionId && homeAddress && abilityId && extraCurricullarActivities && yob && mob && (d.getFullYear() - yob >= 15)) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if ($clickId == "step-1") { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } else { alert("Please fill all the fields!"); } } } else if ($clickId == "step-3" && (programmeId != 7 && programmeId != 3 && programmeId != 15 && programmeId != 16)) { var jambnumber = $('#ApplicantJambDetail_JambRegistrationNumber').val(); var jambscore = $('#ApplicantJambDetail_JambScore').val(); var firstSubject = $('#ApplicantJambDetail_Subject1_Id').val(); var secondSubject = $('#ApplicantJambDetail_Subject2_Id').val(); var thirdsubject = $('#ApplicantJambDetail_Subject3_Id').val(); var fourthSubject = $('#ApplicantJambDetail_Subject4_Id').val(); var institutionChoiceId = $('#ApplicantJambDetail_InstitutionChoice_Id').val(); var courseVal = $('#PreviousEducation_Course').val(); var qualificationIdVal = $('#PreviousEducation_Qualification_Id').val(); var resultGradeIdVal = $('#PreviousEducation_ResultGrade_Id').val(); var itDurationIdVal = $('#PreviousEducation_ITDuration_Id').val(); var previousSchoolIdVal = $('#PreviousEducation_SchoolName').val(); var itStartDateVal = $('#PreviousEducation_ITStartDate').val(); var selectedEndMonth = $("#PreviousEducation_EndMonth_Id").val(), selectedEndYear = $("#PreviousEducation_EndYear_Id").val(), selectedEndDay = $("#PreviousEducation_EndDay_Id").val(), selectedStartMonth = $("#PreviousEducation_StartMonth_Id").val(), selectedStartYear = $("#PreviousEducation_StartYear_Id").val(), selectedStartDay = $("#PreviousEducation_StartDay_Id").val(); var personid = personId; var formSetting = parseInt($('#ApplicationFormSetting_Id').val()); var supplementaryDepartmentId = $('#SupplementaryCourse_Department_Id').val();; var putmeScore = parseInt($('#SupplementaryCourse_Putme_Score').val()); var putmeAverage = parseInt($('#SupplementaryCourse_Average_Score').val()); //if (jambnumber.startsWith("89")) { if (jambnumber.startsWith("2")) { if (programmeId == 2 || programmeId == 5 || programmeId == 6) { if (selectedEndMonth && selectedEndYear && selectedEndDay && selectedStartMonth && selectedStartYear && selectedStartDay && courseVal && institutionChoiceId && qualificationIdVal && resultGradeIdVal && itDurationIdVal) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } } else { if (jambnumber && institutionChoiceId && personid && courseVal && resultGradeIdVal && qualificationIdVal && (formSetting != 18 && formSetting != 22)) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if (supplementaryDepartmentId && putmeScore > 0 && jambnumber && institutionChoiceId && personid && formSetting == 20) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if (jambnumber && institutionChoiceId && personid && courseVal && resultGradeIdVal && qualificationIdVal && personid && (formSetting == 18 || formSetting == 22)) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if (jambnumber && jambscore && firstSubject && secondSubject && thirdsubject && fourthSubject && institutionChoiceId && personid && programmeId == 1 && formSetting == 19 && supplementaryDepartmentId && putmeScore > 0 ) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if (jambnumber && jambscore && firstSubject && secondSubject && thirdsubject && fourthSubject && institutionChoiceId && personid && programmeId == 1 && (formSetting == 17 || formSetting == 21 || formSetting == 1) ) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else { alert("Please fill all the fields!"); } } } else { if (jambnumber && jambscore && firstSubject && secondSubject && thirdsubject && fourthSubject && institutionChoiceId && personid && programmeId == 1 && formSetting != 19) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } else { alert("Please fill all the fields!"); } } else if (jambnumber && jambscore && firstSubject && secondSubject && thirdsubject && fourthSubject && institutionChoiceId && personid && programmeId == 1 && formSetting == 19 && supplementaryDepartmentId && putmeScore > 0 && putmeAverage > 0) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } else { alert("Please fill all the fields!"); } } else if (courseVal && starDateVal && endDateVal && qualificationIdVal && resultGradeIdVal && itDurationIdVal && previousSchoolIdVal && itStartDateVal && itEndDateVal && programmeId == 2 && programmeId == 5 && programmeId == 6) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } else { alert("Please fill all the fields!"); } } } } else if (programmeId == 7 || programmeId == 3 || programmeId == 15 || programmeId == 16 ) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); personId = $("#Person_Id").val(); } } else if ($clickId == "step-1") { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } } else if ($clickId == "step-4") { var firstSittingOLevelResultDetailArray = populateFirstSittingResultDetail(); var secondSittingOLevelResultDetailArray = populateSecondSittingResultDetail(); if (firstSittingOLevelResultDetailArray.lenght > 0 || secondSittingOLevelResultDetailArray.length > 0) { if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } else { alert("Please fill all the fields!"); } } } else { alert("Please fill all the fields!"); } }); $('ul.setup-panel li.active a').trigger('click'); // Disabling clicks // $('#activate-step-1').on('click', function (e) { $('ul.setup-panel li:eq(2)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-1"]').trigger('click'); }); $('#activate-step-2').on('click', function (e) { var programme = $("#@Html.IdFor(m => m.AppliedCourse.Programme.Id)").val(); if (programme == 7 || programme == 3 || programme == 15 || programme == 16) { $('ul.setup-panel li:eq(2)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-3"]').trigger('click'); } else { $('ul.setup-panel li:eq(1)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-2"]').trigger('click'); } }); $('#activate-step-3').on('click', function (e) { $('ul.setup-panel li:eq(2)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-3"]').trigger('click'); }); $('#activate-step-4').on('click', function (e) { $('ul.setup-panel li:eq(3)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-4"]').trigger('click'); }); $('#previous-step-3').on('click', function (e) { var programme = $("#@Html.IdFor(m => m.AppliedCourse.Programme.Id)").val(); if (programme == 7 || programme == 3) { $('ul.setup-panel li:eq(1)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-1"]').trigger('click'); } else { $('ul.setup-panel li:eq(2)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-2"]').trigger('click'); } }); $('#previous-step-4').on('click', function (e) { $('ul.setup-panel li:eq(3)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-3"]').trigger('click'); }); var src = $('#Person_ImageFileUrl').attr('src'); if (src == undefined) { $('#Person_ImageFileUrl').attr('src', '/Content/Images/default_avatar.png'); } $("#Person_State_Id").change(function () { $("#Person_LocalGovernment_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetLocalGovernmentsByState")', //we are calling json method dataType: 'json', data: { id: $("#Person_State_Id").val() }, success: function (lgas) { $("#Person_LocalGovernment_Id").append('<option value="' + 0 + '">-- Select --</option>'); $.each(lgas, function (i, lga) { $("#Person_LocalGovernment_Id").append('<option value="' + lga.Value + '">' + lga.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve lgas.' + ex); } }); return false; }); $("#Person_MonthOfBirth_Id").change(function () { $("#Person_DayOfBirth_Id").empty(); var selectedMonth = $("#Person_MonthOfBirth_Id").val(); var selectedYear = $("#Person_YearOfBirth_Id").val(); if (selectedYear == '') { alert('Please select Year of Birth!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy")', // we are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, success: function (days) { $("#Person_DayOfBirth_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#Person_DayOfBirth_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, beforeSend: function () { $('#spDob').show(); }, complete: function () { $('#spDob').hide(); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); $("#PreviousEducation_StartMonth_Id").change(function () { $("#PreviousEducation_StartDay_Id").empty(); var selectedMonth = $("#PreviousEducation_StartMonth_Id").val(); var selectedYear = $("#PreviousEducation_StartYear_Id").val(); if (selectedYear == '') { alert('Please select Start Year!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy", "Form")', //We are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, beforeSend: function () { $('#spSDate').show(); }, complete: function () { $('#spSDate').hide(); }, success: function (days) { $("#PreviousEducation_StartDay_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#PreviousEducation_StartDay_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); $("#PreviousEducation_EndMonth_Id").change(function () { $("#PreviousEducation_EndDay_Id").empty(); var selectedMonth = $("#PreviousEducation_EndMonth_Id").val(); var selectedYear = $("#PreviousEducation_EndYear_Id").val(); if (selectedYear == '') { alert('Please select End Year!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy", "Form")', // we are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, beforeSend: function () { $('#spEDate').show(); }, complete: function () { $('#spEDate').hide(); }, success: function (days) { $("#PreviousEducation_EndDay_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#PreviousEducation_EndDay_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); initSimpleFileUploadForCredential(); $("#cr-start-upload").on('click', function () { if (jqXHRData) { jqXHRData.submit(); } return false; }); $("#cu-credential-simple-upload").on('change', function () { $("#crx-file-path").val(this.files[0].name); }); function initSimpleFileUploadForCredential() { 'use strict'; $('#cu-credential-simple-upload').fileupload({ url: '@Url.Content("~/Applicant/Form/UploadCredentialFile")', dataType: 'json', add: function (e, data) { jqXHRData = data; }, send: function (e) { $('#fileUploadProgress2').show(); }, done: function (event, data) { if (data.result.isUploaded) { //alert("success"); } else { $("#crx-file-path").val(""); alert(data.result.message); } $('#scannedCredential').attr('src', data.result.imageUrl); $('#fileUploadProgress2').hide(); }, fail: function (event, data) { if (data.files[0].error) { alert(data.files[0].error); } } }); } checkPhoneNumbers(); $("#Sponsor_MobilePhone").on("change", function () { checkPhoneNumbers(); }); $("#Person_MobilePhone").on("change", function () { checkPhoneNumbers(); }); }); (function ($) { // Browser supports HTML5 multiple file? var multipleSupport = typeof $('<input/>')[0].multiple !== 'undefined', isIE = /msie/i.test(navigator.userAgent); $.fn.customFile = function () { return this.each(function () { var $file = $(this).addClass('custom-file-upload-hidden'), // the original file input $wrap = $('<div class="file-upload-wrapper">'), $input = $('<input type="text" class="file-upload-input" />'), // Button that will be used in non-IE browsers $button = $('<button type="button" class="file-upload-button">Select a File</button>'), // Hack for IE $label = $('<label class="file-upload-button" for="' + $file[0].id + '">Select a File</label>'); // Hide by shifting to the left so we // can still trigger events $file.css({ position: 'absolute', left: '-9999px' }); $wrap.insertAfter($file) .append($file, $input, (isIE ? $label : $button)); // Prevent focus $file.attr('tabIndex', -1); $button.attr('tabIndex', -1); $button.click(function () { $file.focus().click(); // Open dialog }); $file.change(function () { var files = [], fileArr, filename; // If multiple is supported then extract // all filenames from the file array if (multipleSupport) { fileArr = $file[0].files; for (var i = 0, len = fileArr.length; i < len; i++) { files.push(fileArr[i].name); } filename = files.join(', '); // If not supported then just take the value // and remove the path to just show the filename } else { filename = $file.val().split('\\').pop(); } $input.val(filename) // Set the value .attr('title', filename) // Show filename in title tootlip .focus(); // Regain focus }); $input.on({ blur: function () { $file.trigger('blur'); }, keydown: function (e) { if (e.which === 13) { // Enter if (!isIE) { $file.trigger('click'); } } else if (e.which === 8 || e.which === 46) { // Backspace & Del // On some browsers the value is read-only // with this trick we remove the old input and add // a clean clone with all the original events attached $file.replaceWith($file = $file.clone(true)); $file.trigger('change'); $input.val(''); } else if (e.which === 9) { // TAB return; } else { // All other keys return false; } } }); }); }; // Old browser fallback if (!multipleSupport) { $(document).on('change', 'input.customfile', function () { var $this = $(this), // Create a unique ID so we // can attach the label to the input uniqId = 'customfile_' + (new Date()).getTime(), $wrap = $this.parent(), // Filter empty input $inputs = $wrap.siblings().find('.file-upload-input') .filter(function () { return !this.value }), $file = $('<input type="file" id="' + uniqId + '" name="' + $this.attr('name') + '"/>'); setTimeout(function () { // Add a new input if ($this.val()) { if (!$inputs.length) { $wrap.after($file); $file.customFile(); } // Remove and reorganize inputs } else { $inputs.parent().remove(); $wrap.appendTo($wrap.parent()); $wrap.find('input').focus(); } }, 1); }); } }(jQuery)); $('input[type=file]').customFile(); function populateFirstSittingResultDetail() { var firstSittingOLevelResultDetailArray = []; var array = $('#firstSittingTable tr:gt(0)').map(function () { return { SubjectId: $(this.cells[0]).find("select").val(), SubjectName: "", GradeId: $(this.cells[1]).find("select").val(), GradeName: "" }; }); for (var i = 0; i < array.length; i++) { var myArray = { "SubjectId": array[i].SubjectId, "SubjectName": array[i].SubjectName, "GradeId": array[i].GradeId, "GradeName": array[i].GradeName }; firstSittingOLevelResultDetailArray.push(myArray); } return firstSittingOLevelResultDetailArray; } function checkPhoneNumbers() { if ($("#Sponsor_MobilePhone").val() != undefined || $("#Sponsor_MobilePhone").val() != "" || $("#Person_MobilePhone").val() != undefined || $("#Person_MobilePhone").val() != "") { if ($("#Person_MobilePhone").val() == $("#Sponsor_MobilePhone").val()) { $("#submit").attr("disabled", "disabled"); alert("Your phone number and the next of kin phone number cannot be the same."); } else { $("#submit").attr("disabled", false); } } } function populateSecondSittingResultDetail() { var secondSittingOLevelResultDetailArray = []; var array2 = $('#secondSittingTable tr:gt(0)').map(function () { return { SubjectId: $(this.cells[0]).find("select").val(), SubjectName: "", GradeId: $(this.cells[1]).find("select").val(), GradeName: "" }; }); for (var i = 0; i < array2.length; i++) { var myArray = { "SubjectId": array2[i].SubjectId, "SubjectName": array2[i].SubjectName, "GradeId": array2[i].GradeId, "GradeName": array2[i].GradeName }; secondSittingOLevelResultDetailArray.push(myArray); } return secondSittingOLevelResultDetailArray; } function showLoading() { $('#loading').show(); } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="container"> <div class="row pt-4"> <div class="col-md-8 pl-0 pr-0"> <div class="card"> <div class="container"> <div class="row form-group"> <div class="col-xs-12 pl-3 pt-3"> <ul class="nav nav-tabs setup-panel"> <li class="nav-item active"> <a class="nav-link" href="#step-1">BIO DATA </a> </li> <li class="nav-item disabled"> <a class="nav-link" href="#step-2">UTME DETAILS </a> </li> <li class="nav-item disabled"> <a class="nav-link" href="#step-3">O/LEVEL DETAILS </a> </li> <li class="nav-item disabled"> <a class="nav-link" href="#step-4">OTHER DETAILS </a> </li> </ul> </div> </div> @using (Html.BeginForm("PostJambForm", "Form", FormMethod.Post, new { id = "frmPostJAMB", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-1"> <div class="col-xs-12"> <div> @if (Model.ApplicationForm != null && Model.ApplicationForm.Id > 0) { @Html.HiddenFor(model => model.ApplicationForm.Id) @Html.HiddenFor(model => model.ApplicationForm.Number) @Html.HiddenFor(model => model.ApplicationForm.ExamNumber) @Html.HiddenFor(model => model.ApplicationForm.Rejected) @Html.HiddenFor(model => model.ApplicationForm.RejectReason) } @Html.HiddenFor(model => model.Session.Id) @Html.HiddenFor(model => model.Session.Name) @Html.HiddenFor(model => model.ApplicationFormSetting.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentMode.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PersonType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.Session.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamDate) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamVenue) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamTime) @Html.HiddenFor(model => model.ApplicationProgrammeFee.FeeType.Id) @Html.HiddenFor(model => model.ApplicationProgrammeFee.Id) @Html.HiddenFor(model => model.Programme.Id, new { Id = "programmeId" }) @Html.HiddenFor(model => model.Programme.Name) @Html.HiddenFor(model => model.Programme.ShortName) @Html.HiddenFor(model => model.AppliedCourse.Programme.Id) @Html.HiddenFor(model => model.AppliedCourse.Programme.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Id) @Html.HiddenFor(model => model.AppliedCourse.Department.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Code) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.remitaPyament.payment.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.FullName) @Html.HiddenFor(model => model.PassportUrl, new { Id = "passportImageId" }) @Html.HiddenFor(model => model.ApplicationAlreadyExist) @Html.HiddenFor(model => model.HasJambPassport) <div class="col-md-12"> <div class="row"> <div class="col-md-12"> <h4>Bio Data</h4> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LastName) @Html.TextBoxFor(model => model.Person.LastName, new { @class = "form-control text-uppercase", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.LastName) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.FirstName) @Html.TextBoxFor(model => model.Person.FirstName, new { @class = "form-control text-uppercase", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.FirstName) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.OtherName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.OtherName, new { @class = "form-control text-uppercase", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.OtherName) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Sex.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.Sex.Id, (IEnumerable<SelectListItem>)ViewBag.SexId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Sex.Id) </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color: black"> @Html.LabelFor(model => model.Person.DateOfBirth, new { @class = "control-label " }) </div> <div class="clearfix"></div> <div> @Html.DropDownListFor(m => m.Person.YearOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.YearOfBirthId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(m => m.Person.MonthOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.MonthOfBirthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(m => m.Person.DayOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.DayOfBirthId, new { @class = "form-control ml-0" }) </div> </div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.Person.State.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LocalGovernment.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.LocalGovernment.Id, (IEnumerable<SelectListItem>)ViewBag.LgaId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.LocalGovernment.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.HomeTown, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeTown, new { @class = "form-control text-uppercase", max = "50" }) @Html.ValidationMessageFor(model => model.Person.HomeTown) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Person.HomeAddress, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeAddress, new { @class = "form-control text-uppercase", max = "250" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control", @readonly = "readonly", max = "15", min = "11", type = "number" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control text-uppercase", @readonly = "readonly", max = "50" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Religion.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Person.Religion.Id, (IEnumerable<SelectListItem>)ViewBag.ReligionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Religion.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Applicant.Ability.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Applicant.Ability.Id, (IEnumerable<SelectListItem>)ViewBag.AbilityId, new { @class = "form-control" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Applicant.OtherAbility) @Html.TextBoxFor(model => model.Applicant.OtherAbility, new { @class = "form-control text-uppercase" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Applicant.ExtraCurricullarActivities) @Html.TextBoxFor(model => model.Applicant.ExtraCurricullarActivities, new { @class = "form-control text-uppercase" }) </div> </div> </div> <div class="col-md-12 text-right"> <a class="btn btn-primary pull-right" style="color: white" id="activate-step-2">NEXT</a> </div> </div> </div> </div> <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-2"> <div class="col-xs-12"> <div class="col-md-12 well" style="height: auto"> <h4>Academic Details</h4> <div class="row"> @if (Model != null && Model.Programme != null) { if (Model.Programme.Id == 2 || Model.Programme.Id == 5 || Model.Programme.Id == 6) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Course, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color: black"> @Html.LabelFor(model => model.PreviousEducation.StartDate, new { @class = "control-label " }) </div> <div class="clearfix"></div> <div> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartDayId, new { @class = "form-control ml-0" }) </div> </div> </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color:black"> @Html.LabelFor(model => model.PreviousEducation.EndDate, new { @class = "control-label " }) </div> <div class="clearfix"></div> <div> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndDayId, new { @class = "form-control pl-2 ml-0 mr-0" }) </div> </div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id, (IEnumerable<SelectListItem>)ViewBag.QualificationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new { @class = "control-label" }) @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id, (IEnumerable<SelectListItem>)ViewBag.ResultGradeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id, "Duration", new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id, (IEnumerable<SelectListItem>)ViewBag.ITDurationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> } //else if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 6 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 12 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 17)) else if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 20 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 12 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 18 || Model.ApplicationFormSetting.Id == 22)) { if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 20)) { if (Model.SupplementaryCourse != null) { if (Model.SupplementaryCourse.Department != null) { if (Model.SupplementaryCourse.Department.Id > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Department", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Department", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Department", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } if (Model.SupplementaryCourse.Putme_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } if (Model.SupplementaryCourse.Average_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label", @readonly = "readonly" }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> } } } <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Course, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color: black"> @Html.LabelFor(model => model.PreviousEducation.StartDate, new { @class = "control-label " }) </div> <div> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartDayId, new { @class = "form-control pl-2 ml-0 mr-0" }) </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black"> @Html.LabelFor(model => model.PreviousEducation.EndDate, new { @class = "control-label " }) </div> <div> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndDayId, new { @class = "form-control pl-2 ml-0 mr-0" }) </div> </div> </div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id, (IEnumerable<SelectListItem>)ViewBag.QualificationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new { @class = "control-label" }) @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id, (IEnumerable<SelectListItem>)ViewBag.ResultGradeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id, "Duration", new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id, (IEnumerable<SelectListItem>)ViewBag.ITDurationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> if (Model.ApplicationFormSetting.Id == 20 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 12 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 17 || Model.ApplicationFormSetting.Id == 18 || Model.ApplicationFormSetting.Id == 22 || Model.ApplicationFormSetting.Id == 21 || Model.ApplicationFormSetting.Id == 1) { if (Model.ApplicantJambDetail != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> if (Model.ApplicantJambDetail.InstitutionChoice != null) { if (Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md- form-group6"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { if (Model.ApplicantJambDetail != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> if (Model.ApplicantJambDetail.JambScore != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> } if (Model.ApplicantJambDetail.InstitutionChoice != null) { if (Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } if (Model.ApplicantJambDetail.Subject1 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> } if (Model.ApplicantJambDetail.Subject2 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> } if (Model.ApplicantJambDetail.Subject3 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> } if (Model.ApplicantJambDetail.Subject4 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Id, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> <div class="col-md-6 form-group"> </div> } } } else if ((Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 19 || Model.ApplicationFormSetting.Id == 7 || Model.ApplicationFormSetting.Id == 9 || Model.ApplicationFormSetting.Id == 11 || Model.ApplicationFormSetting.Id == 13 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 17 || Model.ApplicationFormSetting.Id == 21 || Model.ApplicationFormSetting.Id == 1)) || Model.Programme.Id == 4) { if (Model.ApplicationFormSetting.Id == 20 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 18) { if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 20)) { if (Model.SupplementaryCourse != null) { if (Model.SupplementaryCourse.Department != null) { if (Model.SupplementaryCourse.Department.Id > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } if (Model.SupplementaryCourse.Putme_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } @*@*if (Model.SupplementaryCourse.Average_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label", @readonly = "readonly" }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> }*@ } } if (Model.ApplicantJambDetail != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> if (Model.ApplicantJambDetail.InstitutionChoice != null) { if (Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 19)) { if (Model.SupplementaryCourse != null) { if (Model.SupplementaryCourse.Department != null) { if (Model.SupplementaryCourse.Department.Id > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Course Applied", new { @class = "control-label " }) @Html.DropDownListFor(model => model.SupplementaryCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.SupplementaryDepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Department.Id) </div> </div> } if (Model.SupplementaryCourse.Putme_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Putme_Score) </div> </div> } @*if (Model.SupplementaryCourse.Average_Score > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label", @readonly = "readonly" }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.SupplementaryCourse.Average_Score) </div> </div> }*@ } } if (Model.ApplicantJambDetail != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> if (Model.ApplicantJambDetail.JambScore != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> } if (Model.ApplicantJambDetail.InstitutionChoice != null) { if (Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> } if (Model.ApplicantJambDetail.Subject1 != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> } if (Model.ApplicantJambDetail.Subject2 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> </div> } if (Model.ApplicantJambDetail.Subject3 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> </div> } if (Model.ApplicantJambDetail.Subject4 != null) { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> } <div class="col-md-6 form-group"> </div> } else { <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore, (IEnumerable<SelectListItem>)ViewBag.JambScoreId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, "Institution Choice", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id, (IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Id, "First Subject", new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id, (IEnumerable<SelectListItem>)ViewBag.Subject1Id, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id, (IEnumerable<SelectListItem>)ViewBag.Subject2Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id, (IEnumerable<SelectListItem>)ViewBag.Subject3Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4, new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id, (IEnumerable<SelectListItem>)ViewBag.Subject4Id, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> <div class="col-md-6 form-group"> </div> } } } } </div> <div class="col-md-12 text-right"> <a id="activate-step-1" style="color: white" class="btn btn-primary pull-left">Previous</a> <a id="activate-step-3" style="color: white" class="btn btn-primary pull-right">Next</a> </div> </div> </div> </div> <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-3"> <div class="col-md-12"> <div class="col-md-12 pb-5" style="height: 700px; overflow-y: auto;"> <div class="col-md-12"> <h4>O-Level Information</h4> </div> <div class="row"> <div class="col-md-6 card pt-2"> <h5>First Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.FirstSittingOLevelResult.Id) <div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.FirstSittingOLevelTypeId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.Type.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamNumber) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.FirstSittingExamYearId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamYear) </div> </div> </div> <table id="firstSittingTable" class="table table-condensed table-responsive" style="background-color: whitesmoke"> <thead> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </tbody> </table> </div> <!--col-md-6 end form 1--> <!-- beginning of form 2--> <div class="col-md-6 card pt-2"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.SecondSittingOLevelResult.Id) <div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.SecondSittingOLevelTypeId, new { @class = "form-control olevel" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.SecondSittingExamYearId, new { @class = "form-control olevel" }) </div> </div> </div> <table id="secondSittingTable" class="table table-condensed table-responsive" style="background-color: whitesmoke"> <thead> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </tbody> </table> </div> </div> <!--row--> <div class="col-md-12 text-right"> <a id="previous-step-3" class="btn btn-primary pull-left" style="color: white">Previous</a> <a id="activate-step-4" class="btn btn-primary pull-right" style="color: white">Next</a> </div> </div> </div> </div> <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-4"> <div class="col-xs-12"> <div class="col-md-12 well" style=""> <h4>Other Information</h4> <div class="row"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Sponsor.Name) @Html.TextBoxFor(model => model.Sponsor.Name, new { @class = "form-control text-uppercase", max = "50" }) @Html.ValidationMessageFor(model => model.Sponsor.Name) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.Relationship.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Sponsor.Relationship.Id, (IEnumerable<SelectListItem>)ViewBag.RelationshipId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.Relationship.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.MobilePhone, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.MobilePhone) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Sponsor.ContactAddress, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.ContactAddress, new { @class = "form-control text-uppercase", max = "350" }) @Html.ValidationMessageFor(model => model.Sponsor.ContactAddress) </div> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> @if (Model.Person.ImageFileUrl != null) { <div class="card-img"> <img id="Person_ImageFileUrl" name="Person.ImageFileUrl" src="@Url.Content(Model.Person.ImageFileUrl)" height="100" width="100"> </div> } else { <img id="Person_ImageFileUrl" name="Person.ImageFileUrl" height="100" width="100"> } <div id="dropzone"> <form class="dropzone needsclick" id="demo-upload" action="/"></form> </div> <div class="custom-file-upload"> <div class="col-md-12"> <div id="dropzone"> <form class="dropzone needsclick" id="demo-upload" action="/"></form> </div> </div> </div> </div> <div class="col-md-8 p-4"> <b> I hereby acknowledge that all the details supplied are correct to the best of my knowledge and that if any false information was given, I accept to face whatever penalties appropriate. </b> </div> </div> </div> </div> <div class="col-md-12 text-right"> <a id="previous-step-4" class="btn btn-primary pull-left" style="color: white">Previous</a> <button class="btn btn-primary pull-right" style="display: none" id="submitBtn" onclick="showLoading()">Submit</button> <span class="pull-right" style="display: none;" id="loading"> <img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> } </div> </div> </div> <div class="col-md-4 bg-warning hidden-md-down"> <div class="col-md-12"> <div class="row p-4 mt-5"> <div class="col-md-2"> <img src="~/Content/Images/school_logo.png" alt="absu logo"> </div> <div class="col-md-10"> <b>@Model.ApplicationFormSetting.Name</b> </div> <hr> <p>You are on your way to becoming an undergraduate at our Great University</p> <h4 style="font-size:15px">Welcome to University Of Port-Harcourt</h4> </div> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Model.Model.StateGeoZone @{ ViewBag.Title = "Edit State GeoZone"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @using (Html.BeginForm("EditStateGeoZone", "TranscriptProcessor", new { area = "admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <br /> <div class="panel panel-default"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body"> <h2 style="font-weight: 300; text-align: center">Edit State Geo_Zone</h2> <hr /> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.State.Id, "State", new { @class = "control-label" }) @Html.DropDownListFor(model => model.State.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control", id = "sessionCreate" }) @Html.ValidationMessageFor(model => model.State.Id) </div> </div> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.GeoZone.Id, "Geo Zone", new { @class = "control-label" }) @Html.DropDownListFor(model => model.GeoZone.Id, (IEnumerable<SelectListItem>)ViewBag.GeoZoneId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.GeoZone.Id) </div> </div> <div class="col-md-6" style="margin-top: 20px"> <div class="form-group"> @Html.CheckBoxFor(model => model.Activated, new { @class = "" }) @Html.LabelFor(model => model.Activated, "Activated", new { @class = "control-label" }) @Html.ValidationMessageFor(model => model.Activated) </div> </div> </div> <hr /> <div class="row"> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" value="Save" /> </div> </div> </div> </div> </div> </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SlugViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function() { $("#appliedCourse_Programme_Id").change(function() { $("#appliedCourse_Department_Id").empty(); var selectedProgramme = $("#appliedCourse_Programme_Id").val(); var programme = $("#appliedCourse_Programme_Id").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#appliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#appliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); }); </script> <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("Index", "Slug", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">Download Data</p></h4> </div> <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <cite><p class="custom-text-black"> Select the session, programme and department where neccessary</p></cite> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" , required = true}) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.IsBulk, "Bulk", new { @class = "control-label custom-text-white" }) @Html.CheckBoxFor(model => model.IsBulk, new { @class = "form-control"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.appliedCourse.Programme.Id, new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.appliedCourse.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.appliedCourse.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.appliedCourse.Department.Id, "Course", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.appliedCourse.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.appliedCourse.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="form-group"> <div class="col-sm-2"> <input class="btn btn-success mr5" name="view" id="view" value="View" type="submit" /> </div> <div class="col-sm-10"> </div> </div> </div> </div> </div> } @if (Model == null || Model.applicantDetails == null) { return; } @if (Model != null || Model.applicantDetails != null) { <div class="col-md-12"> <table id="slugtable" class="table table-bordered table-hover table-striped"> <thead> <tr> <th>@Html.ActionLink("ExamNo1", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("ExamNo2", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("JAMB1", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("JAMB2", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("JAMB_SCORE", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("DEPT", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("DEPT2", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("TYPE", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("FULLNAME", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("PHOTO", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.applicantDetails.Count; i++) { <tr> <th>@Model.applicantDetails[i].ExamNumber</th> <th>@Model.applicantDetails[i].ExamNumber</th> <th>@Model.applicantDetails[i].JambNumber</th> <th>@Model.applicantDetails[i].JambNumber</th> <th>@Model.applicantDetails[i].JambScore</th> <th>@Model.applicantDetails[i].FirstChoiceDepartment</th> <th>@Model.applicantDetails[i].SecondChoiceDepartment</th> <th>H</th> <th>@Model.applicantDetails[i].Name.ToUpper()</th> <th>@Model.applicantDetails[i].PassportUrl</th> </tr> } </tbody> </table> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <i class="glyphicon-upload"></i><input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save Upload" /> </div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.RegistrationViewModel @{ ViewBag.Title = "Edit Student Profile"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <h4>Enter Student Matric Number</h4> @using (Html.BeginForm("Index", "Registration", new {Area = "Admin"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.Student.MatricNumber, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.Student.MatricNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(m => m.Student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-default" /> </div> </div> </div> </div> }<file_sep>@{ ViewBag.Title = "Acceptance Letter"; Layout = null; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <br /> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="row"> <div> <center> <table style="margin-bottom: 7px"> <tr style="text-align: center"> <td><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" /></td> </tr> <tr> <td> <h3><strong>ABIA STATE UNIVERSITY, UTURU</strong></h3> </td> </tr> </table> </center> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> </div> </div> <div class="row"> <div class="col-md-6 "> The Registrar, <br /> Abia State University, <br /> Uturu, <br /> Imo State </div> <div class="col-md-6 "> <div class="pull-right"> <img src="@Url.Content(Model.Person.ImageFileUrl)" alt="" /> </div> </div> </div> <br /> <div class="row"> <div class="col-md-12 "> <div> Dear Sir, <br /> </div> </div> </div> <br /> <div class="row"> <div class="col-md-12 text-justify"> <center> <p> <h4 class="sectitle"><b>ACCEPTANCE OF OFFER OF PROVISIONAL ADMISSION </b></h4> </p> </center> <p> I, @Model.Person.FullName of @Model.Person.LocalGovernment.Name LGA in @Model.Person.State.Name State of Nigeria hereby accept the offer of admission into the Abia State University, Uturu to pursue a Diploma course in @Model.Department.Name at the School of @Model.Department.Faculty.Name under the condition stipulated in your letter of admission, reference No. @Model.applicationform.Number I accept to abide by all existing regulations and those that the University will make from time to time concerning fees, academic programmes and other University matters. </p> <br /> <p> I accept that, if any time after admission, it is discovered that I do not posses any of the qualifications or satisfy other conditions, including entry requirements, on which the admission was based, I shall withdraw from the University if and when I am required to do so. </p> <p> I enclose herewith, a non-refundable acceptance fee of =N=40,000 (Forty Thousand Naira Only) in Bank Draft /Money Order / Crossed Postal Order /Teller Number /Cash or University Bursary Receipt No. </p> <br /> <br /> <p> <b>Your's Faithfully</b> <br /> <b>@Model.Person.FullName</b> </p> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Models.RefereeFormViewModel @{ ViewBag.Title = "Applicant Referee Response"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(function () { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <div class="row"> <div class="col-xs-12"> @using (Html.BeginForm("ApplicantRefereeResponse", "PostGraduateForm", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default" style="background:#fff;"> <div class="panel-body"> <div class="col-md-12"> <div class="form-group"> <h5 class="text-center" style="padding: 10px 5px;background:whitesmoke;border-radius: 20% !important;"> VIEW APPLICANTS </h5> </div> </div> <div class="row" style="padding:10px 15px;"> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.SessionId, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.SessionId, (IEnumerable<SelectListItem>)ViewBag.SessionSL, new { @class = "form-control", id = "session-list", required = true }) @Html.ValidationMessageFor(model => model.SessionId, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.ProgrammeId, "Programme", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.ProgrammeId, (IEnumerable<SelectListItem>)ViewBag.ProgrammeSL, new { @class = "form-control", id= "programme-list", required = true }) @Html.ValidationMessageFor(model => model.ProgrammeId, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.DepartmentId, "Department", new { @class = "control-label custom-text-black" }) <select name="DepartmentId" id="department-list" class="form-control" disabled></select> @*@Html.DropDownListFor(model => model.DepartmentId, (IEnumerable<SelectListItem>)ViewBag.DepartmentSL, new { @class = "form-control", required = true })*@ @Html.ValidationMessageFor(model => model.DepartmentId, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6" style="padding-top: 20px"> <i class="glyphicon-upload"></i><input class="btn btn-success btn-block" disabled type="submit" name="submit" id="submit-btn" value="Submit" /> </div> </div> </div> </div> } @if (Model.Applicants != null && Model.Applicants.Count() > 0) { <div class="panel panel-default"> <div class="panel-body"> <div style="background: #fff;padding: 20px;margin-top:30px;"> <div class="col-md-12"> <div class="form-group"> <h5 class="text-center" style="padding: 10px 5px;background:whitesmoke;border-radius: 20% !important;"> APPLICANTS </h5> </div> </div> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th> SN </th> <th> Applicant Name </th> <th> Department </th> <th> Programme </th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.Applicants.Count(); i++) { int sn = i + 1; <tr> <td>@sn</td> <td>@Model.Applicants[i].ApplicantName.ToUpper()</td> <td>@Model.Applicants[i].Department.ToUpper()</td> <td>@Model.Applicants[i].Programme.ToUpper()</td> <td> <a href="@Url.Action("ViewApplicantReferees", "PostGraduateForm", new { Id = Model.Applicants[i].ApplicantFormId })" class="btn btn-success">View Referees</a> </td> </tr> } </tbody> </table> </div> </div> </div> } </div> </div> <script type="text/javascript"> $("#programme-list, #department-list, #session-list").on("change", (e) => { const programmeValue = $("#programme-list").val(); const departmentValue = $("#department-list").val(); const sessionValue = $("#session-list").val(); const submitBtn = $("#submit-btn"); submitBtn.attr("disabled", true); if ((programmeValue && programmeValue > 0) && (departmentValue && departmentValue > 0) && (sessionValue && sessionValue > 0)) { submitBtn.removeAttr("disabled"); } }); $("#programme-list").on("change", (e) => { const programmeId = e.target.value; if (programmeId) { $.ajax({ url: "@Url.Action("SetDepartmentList", "PostGraduateForm")", data: { programmeId }, type: "POST", success: (data) => { const departmentSelectList = $("#department-list"); departmentSelectList.empty(); departmentSelectList.attr("disabled", true); if (data.DepartmentSL.length > 0) { departmentSelectList.removeAttr("disabled"); $.each(data.DepartmentSL, function (i, department) { departmentSelectList.append(`<option value="${department.Value}">${department.Text}</option>`); }); } }, error: (error) => { console.log(error); } }); } }); </script><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; Layout = "~/Views/Shared/_Layout.cshtml"; } @if(Model == null || Model.Person == null) { return; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script src="~/Scripts/jquery.print.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(function() { $('#submit').attr('disabled', 'disabled'); }); $(function() { $('#checkboxDefault').click(function() { if ($(this).is(':checked')) { $('#submit').removeAttr('disabled'); } else { $('#submit').attr('disabled', 'disabled'); } }); }); </script> } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12 "> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> <div id="slip"> @using(Html.BeginForm("FormPreview","PostGraduateForm",FormMethod.Post,new { id = "frmPostJAMBPreview",enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <center> <div class="alert alert-success fade in nomargin" style="background-color: #b78825"> <h2><b>@Model.AppliedCourse.Programme.Name</b></h2> </div> <br /> </center> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Bio Data</div> @if(Model.ApplicationForm != null && Model.ApplicationForm.Id > 0) { @Html.HiddenFor(model => model.ApplicationForm.Id) @Html.HiddenFor(model => model.ApplicationForm.Number) @Html.HiddenFor(model => model.ApplicationForm.ExamNumber) @Html.HiddenFor(model => model.ApplicationForm.Rejected) @Html.HiddenFor(model => model.ApplicationForm.RejectReason) } @Html.HiddenFor(model => model.Session.Id) @Html.HiddenFor(model => model.Session.Name) @Html.HiddenFor(model => model.ApplicationFormSetting.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentMode.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PersonType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.Session.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamDate) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamVenue) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamTime) @Html.HiddenFor(model => model.ApplicationProgrammeFee.FeeType.Id) @Html.HiddenFor(model => model.ApplicationProgrammeFee.Id) @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Programme.Name) @Html.HiddenFor(model => model.Programme.ShortName) @Html.HiddenFor(model => model.AppliedCourse.Programme.Id) @Html.HiddenFor(model => model.AppliedCourse.Programme.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Id) @Html.HiddenFor(model => model.AppliedCourse.Department.Code) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.remitaPyament.payment.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.FullName) @Html.HiddenFor(model => model.ApplicationAlreadyExist) </div> <div class="panel-body"> <div class="row"> <div class="col-md-6 custom-text-black"> </div> <div class="col-md-6"> <img src="@Url.Content('~' + Model.Person.ImageFileUrl)" alt=" " style="max-width: 150px" /> @*<img src="@Url.Content(@Model.PassportUrl)" alt=" " style=" max-width:150px" />*@ </div> </div> <br /> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.LastName,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.LastName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.FirstName,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.FirstName) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.OtherName,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.OtherName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.Sex.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.Sex.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.DateOfBirth,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.DateOfBirth,"{0:dd/MM/yyyy}",new { @class = "form-control datepicker" }) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.State.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.State.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.LocalGovernment.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.LocalGovernment.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.HomeTown,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.HomeTown) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.MobilePhone,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.MobilePhone) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.Email,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.Email) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.Religion.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.Religion.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.HomeAddress,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Person.HomeAddress) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Applicant.Ability.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Applicant.Ability.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Applicant.OtherAbility,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Applicant.OtherAbility) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Applicant.ExtraCurricullarActivities,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Applicant.ExtraCurricullarActivities) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Next of Kin</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Sponsor.Name,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Sponsor.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Sponsor.ContactAddress,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Sponsor.ContactAddress) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Sponsor.MobilePhone,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Sponsor.MobilePhone) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Sponsor.Relationship.Id,new { @class = "control-label " }) </div> <div class="col-md-8 text-bold custom-text-black"> @Html.DisplayFor(model => model.Sponsor.Relationship.Name) </div> </div> </div> </div> </div> </div> if(Model != null) { @Html.Partial("_OLevelResultPreview",Model) } if(Model != null && Model.Programme != null) { if(Model.Programme.Id == 2 || Model.Programme.Id == 5 || Model.Programme.Id == 6 || Model.Programme.Id == 8 || Model.Programme.Id == 9 || Model.Programme.Id == 10) { @Html.Partial("_TertiaryEducationPreview",Model) } } if(Model != null) { @Html.Partial("_RefereePreview",Model) } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Academic Details</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name,new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Programme.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Faculty.Name,new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Faculty.Name,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Faculty.Name) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name,new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.AppliedCourse.Option.Id) @Html.LabelFor(model => model.AppliedCourse.Option.Id,"Department option",new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Option.Name,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Option.Id) </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Declaration</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <blockquote> <p> I hereby acknowledge by ticking this check box that if it is discovered at any time that I do not possess any of the qualifications which I claim I have obtained, I will be expelled from the university and shall not be re-admitted for the same or any other programme, even if I have upgraded my previous qualifications or possess additional qualifications. </p> </blockquote> <div class="ckbox ckbox-default"> <input type="checkbox" id="checkboxDefault" /> <label for="checkboxDefault"><b style="font-size: 13pt">I Agree</b></label> </div> </div> </div> </div> </div> <div class="form-actions no-color"> <button class="btn btn-white btn-lg" type="submit" name="submit" id="submit"><i class="fa fa-save mr5"></i> Submit</button> @Html.ActionLink("Back to Form","Form",null,new { @class = "btn btn-white btn-lg mr5" }) <div id="busy" style="display: none">Processing ...</div> </div> <br /> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> } </div> </div> </div> </div> </div> </div> </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Areas.Student.Models; using Abundance_Nk.Web.Areas.Student.ViewModels; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Abundance_Nk.Web.Reports.Presenter { public partial class StudentPaymentClearanceReport : System.Web.UI.Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue), Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void Display_Button_Click1(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } StudentLogic studentLogic = new StudentLogic(); StudentLevelLogic studentLevelLogic = new StudentLevelLogic(); StudentLevel studentLevel = new StudentLevel(); Student student = new Student(); student = studentLogic.GetModelsBy(u => u.Matric_Number == User.Identity.Name).FirstOrDefault(); if (student == null) { ReportViewer1.Reset(); lblMessage.Text = "Please, login to continue"; return; } if (student != null) { studentLevel = studentLevelLogic.GetModelBy(x => x.Person_Id == student.Id); if (studentLevel != null) { var validated = ValidateSessionLevel(SelectedSession, SelectedLevel, student, studentLevel); if (!validated) { ReportViewer1.Reset(); lblMessage.Text = "The Session-Level Selected does not Exist "; return; } DisplayReportBy(student,SelectedSession, studentLevel.Department, studentLevel.Programme, SelectedLevel); } } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; return; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0 || SelectedLevel==null || SelectedLevel.Id<=0) { return true; } return false; } catch (Exception) { throw; } } private void DisplayReportBy( Student student,Session session, Department department, Programme programme, Level level) { try { List<PersonReportModel> listPersonReportModel = new List<PersonReportModel>(); PersonReportModel personReportModel = new PersonReportModel(); var duePaymentList=AllDuePayment(session, department, programme, level); var madePaymentList = PaymentMade(student, session); personReportModel.LevelName = level.Name; personReportModel.SessionName = session.Name; personReportModel.FullName = student.FullName.ToUpper(); personReportModel.Department = department.Name; personReportModel.Programme = programme.Name; personReportModel.MatricNo = student.MatricNumber; personReportModel.Date = DateTime.Now.Date.ToShortDateString(); listPersonReportModel.Add(personReportModel); string reportPath = Server.MapPath("~/Reports/PaymentClearance.rdlc"); ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Student Payment Clearance Report "; ReportViewer1.LocalReport.ReportPath = reportPath; ReportDataSource rdc2 = new ReportDataSource("dsPaymentclearanceDue", duePaymentList); ReportDataSource rdc3 = new ReportDataSource("dsPaymentclearancePaid", madePaymentList); ReportDataSource rdc1 = new ReportDataSource("dsStudentInfo", listPersonReportModel); ReportViewer1.LocalReport.DataSources.Add(rdc1); ReportViewer1.LocalReport.DataSources.Add(rdc2); ReportViewer1.LocalReport.DataSources.Add(rdc3); ReportViewer1.LocalReport.Refresh(); ReportViewer1.DataBind(); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private List<PaymentClearance> AllDuePayment(Session session, Department department, Programme programme, Level level) { List<PaymentClearance> listofPayment = new List<PaymentClearance>(); try { FeeDetailLogic feeDetailLogic = new FeeDetailLogic(); FeeDetail feeDetail = new FeeDetail(); if (level.Id == 1) { var groupedPaymentDetails = feeDetailLogic.GetModelsBy(x => x.DEPARTMENT.Department_Id == department.Id && x.LEVEL.Level_Id == level.Id && x.PROGRAMME.Programme_Id == programme.Id && x.SESSION.Session_Id == session.Id && x.PAYMENT_MODE.Payment_Mode_Id == 1 && x.FEE_TYPE.Fee_Type_Id==2|| x.FEE_TYPE.Fee_Type_Id == 3).OrderBy(x => x.FeeType.Id).GroupBy(x=>x.FeeType.Id); if (groupedPaymentDetails != null) { foreach(var groupedPaymentDetail in groupedPaymentDetails) { var specificFee=feeDetailLogic.GetModelsBy(x => x.DEPARTMENT.Department_Id == department.Id && x.LEVEL.Level_Id == level.Id && x.PROGRAMME.Programme_Id == programme.Id && x.SESSION.Session_Id == session.Id && x.PAYMENT_MODE.Payment_Mode_Id == 1 && x.FEE_TYPE.Fee_Type_Id==groupedPaymentDetail.Key); if (specificFee != null) { PaymentClearance paymentClearance = new PaymentClearance(); paymentClearance.SessionName = specificFee.FirstOrDefault().Session.Name; paymentClearance.TotalAmount = specificFee.Sum(x => x.Fee.Amount); paymentClearance.Feetype = specificFee.FirstOrDefault().FeeType.Name.ToUpper(); listofPayment.Add(paymentClearance); } } } } else { var groupedPaymentDetails = feeDetailLogic.GetModelsBy(x => x.DEPARTMENT.Department_Id == department.Id && x.LEVEL.Level_Id == level.Id && x.PROGRAMME.Programme_Id == programme.Id && x.SESSION.Session_Id == session.Id && x.PAYMENT_MODE.Payment_Mode_Id == 1 && !x.FEE.Fee_Name.Contains("Acceptance Fee") && x.FEE_TYPE.Fee_Type_Id == 3).OrderBy(x => x.FeeType.Id).GroupBy(x => x.FeeType.Id); if (groupedPaymentDetails != null) { foreach (var groupedPaymentDetail in groupedPaymentDetails) { var specificFee = feeDetailLogic.GetModelsBy(x => x.DEPARTMENT.Department_Id == department.Id && x.LEVEL.Level_Id == level.Id && x.PROGRAMME.Programme_Id == programme.Id && x.SESSION.Session_Id == session.Id && x.PAYMENT_MODE.Payment_Mode_Id == 1 && x.FEE_TYPE.Fee_Type_Id == groupedPaymentDetail.Key); if (specificFee != null) { PaymentClearance paymentClearance = new PaymentClearance(); paymentClearance.SessionName = specificFee.FirstOrDefault().Session.Name; paymentClearance.TotalAmount = specificFee.Sum(x => x.Fee.Amount); paymentClearance.Feetype = specificFee.FirstOrDefault().FeeType.Name.ToUpper(); listofPayment.Add(paymentClearance); } } } } } catch(Exception ex) { throw ex; } return listofPayment; } private List<PaymentClearance> PaymentMade(Student student, Session session) { List<PaymentClearance> listofPayment = new List<PaymentClearance>(); try { PaymentLogic paymentLogic = new PaymentLogic(); var paystackPayment=paymentLogic.GetPaystackBy(student, session); if (paystackPayment != null && paystackPayment.Count>0) { var groupByFeetypes= paystackPayment.OrderBy(x=>x.FeeTypeId).GroupBy(x => x.FeeTypeId); foreach(var groupByFeetype in groupByFeetypes) { var remitaSpecific= paystackPayment.Where(x => x.FeeTypeId == groupByFeetype.Key); PaymentClearance paymentClearance = new PaymentClearance(); paymentClearance.SessionName = remitaSpecific.FirstOrDefault().SessionName; paymentClearance.Feetype = remitaSpecific.FirstOrDefault().FeeTypeName.ToUpper(); var amount = (decimal)remitaSpecific.Sum(x => x.Amount); paymentClearance.TotalAmount = Math.Round(amount, 2); listofPayment.Add(paymentClearance); } } var etranzactPayment=paymentLogic.GetEtranzactBy(student, session); if (etranzactPayment != null && etranzactPayment.Count>0) { var groupEtranzactPaymentByFeetypes = etranzactPayment.GroupBy(x => x.FeeTypeId); foreach(var groupEtranzactPaymentByFeetype in groupEtranzactPaymentByFeetypes) { var etranzactSpecific = etranzactPayment.Where(x => x.FeeTypeId == groupEtranzactPaymentByFeetype.Key); PaymentClearance paymentClearance = new PaymentClearance(); paymentClearance.SessionName = etranzactSpecific.FirstOrDefault().SessionName; paymentClearance.Feetype = etranzactSpecific.FirstOrDefault().FeeTypeName.ToUpper(); var amount= (decimal)etranzactSpecific.Sum(x => x.Amount); paymentClearance.TotalAmount = Math.Round(amount, 2); if(paymentClearance.TotalAmount>0) { listofPayment.Add(paymentClearance); } } } } catch(Exception ex) { throw ex; } return listofPayment; } private bool ValidateSessionLevel(Session session, Level level, Student student, StudentLevel studentLevel) { try { CourseRegistrationLogic courseRegistrationLogic = new CourseRegistrationLogic(); var exist=courseRegistrationLogic.GetModelsBy(x => x.Session_Id == session.Id && x.Level_Id == level.Id && x.Person_Id == student.Id && x.Department_Id == studentLevel.Department.Id && x.Programme_Id == studentLevel.Programme.Id).LastOrDefault(); if (exist != null) { return true; } } catch(Exception ex) { throw ex; } return false; } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "UpdatePayment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Update Payment</div> </div> <div class="panel-body"> @using (Html.BeginForm("UpdatePayment", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ConfirmationNo, "Confirmation Order", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.ConfirmationNo, new {@class = "form-control", @placeholder = "Enter Confirmation Order", @required = "required"}) @Html.ValidationMessageFor(model => model.PaymentEtranzact.ConfirmationNo, "", new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.FeeType.Id, "Fee Type", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.FeeType.Id, (IEnumerable<SelectListItem>) ViewBag.FeeTypeId, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, "Session", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> @if (Model == null || Model.PaymentEtranzact == null) { return; } @if (Model.PaymentEtranzact.ConfirmationNo != null && Model.PaymentEtranzact.ReceiptNo != null) { using (Html.BeginForm("SavePayment", "Support", new {area = "Admin"}, FormMethod.Post)) { @Html.HiddenFor(model => model.PaymentEtranzact.BankCode) @Html.HiddenFor(model => model.PaymentEtranzact.BranchCode) @Html.HiddenFor(model => model.PaymentEtranzact.ConfirmationNo) @Html.HiddenFor(model => model.PaymentEtranzact.ReceiptNo) @Html.HiddenFor(model => model.PaymentEtranzact.TransactionDate) @Html.HiddenFor(model => model.PaymentEtranzact.TransactionDescription) @Html.HiddenFor(model => model.PaymentEtranzact.Used) @Html.HiddenFor(model => model.PaymentEtranzact.PaymentCode) @Html.HiddenFor(model => model.PaymentEtranzact.Terminal) <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ReceiptNo, "Receipt Number", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.ReceiptNo, new {@class = "form-control", @placeholder = "Receipt Number", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ConfirmationNo, "Confirmation Order", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.ConfirmationNo, new {@class = "form-control", @placeholder = "Confirmation Order Number", @disabled = "disabled"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.CustomerID, "Invoice Number", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.CustomerID, new {@class = "form-control", @placeholder = "Enter Invocie Number"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.TransactionAmount, "Amount Paid", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.TransactionAmount, new {@class = "form-control", @placeholder = ""}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.BankCode, "Bank Code", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.BankCode, new {@class = "form-control", @placeholder = "", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.BranchCode, "Branch Code", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.BranchCode, new {@class = "form-control", @placeholder = "", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.CustomerName, "Customer Name", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.CustomerName, new {@class = "form-control", @placeholder = ""}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.CustomerAddress, "Customer Addess", new {@class = "control-label col-md-6"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.PaymentEtranzact.CustomerAddress, new {@class = "form-control", @placeholder = ""}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.Payment.Payment.FeeType.Id,"FeeType",new { @class = "control-label col-md-6" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.PaymentEtranzact.Payment.Payment.FeeType.Id,(IEnumerable<SelectListItem>)ViewBag.FeeTypeId,new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Payment.Session.Id,"Session",new { @class = "control-label col-md-6" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.Payment.Session.Id,(IEnumerable<SelectListItem>)ViewBag.SessionId,new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Payment.PaymentMode.Id,"Payment Mode",new { @class = "control-label col-md-6" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.Payment.PaymentMode.Id,(IEnumerable<SelectListItem>)ViewBag.PaymentModeId,new { @class = "form-control" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-success mr5" /> </div> </div> </div> } } </div> </div><file_sep>@model Abundance_Nk.Model.Model.PostUtmeResult @{ ViewBag.Title = "PUTME RESULT SLIP"; Layout = "~/Views/Shared/_Layout.cshtml"; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>PUTME Result Slip</title> </head> <body> <div class="alert alert-success fade in" style="border: 1px solid green"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 17px"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" /></td> <td> <h2>PUTME Result Slip</h2> </td> </tr> </table> </div> </div> <div> <div class="row"> <div class="col-md-12" style="text-align: justify"> <p> <h3>@Html.DisplayFor(model => model.Fullname)</h3> </p> <p> <div class="panel panel-default"> <div class="panel-body"> <table class="table table-responsive table-condensed "> <thead> <tr> <td><b>Course</b></td> <td><b>Score</b></td> <td><b>Remarks</b></td> </tr> </thead> <tbody> <tr> <td>ENGLISH</td> <td>@Html.DisplayFor(model => model.Eng)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub2)</td> <td>@Html.DisplayFor(model => model.Scr2)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub3)</td> <td>@Html.DisplayFor(model => model.Scr3)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub4)</td> <td>@Html.DisplayFor(model => model.Scr4)</td> <td>--</td> </tr> </tbody> </table> <br /> Your Total Score is <strong> @Html.DisplayFor(model => model.Total)</strong> and your Jamb Registration Number/Application Number is <strong> @Html.DisplayFor(model => model.Regno)</strong> </div> </div> </p> </div> </div> </div> </body> </html><file_sep>@model Abundance_Nk.Model.Model.PreviousEducation @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Tertiary Education</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.SchoolName, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.SchoolName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.Course, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.Course) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.StartDate, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.StartDate, "{0:dd/MM/yyyy}") </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.EndDate, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.EndDate, "{0:dd/MM/yyyy}") </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.Qualification.Id, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.Qualification.ShortName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ResultGrade.Id, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.ResultGrade.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ITDuration.Id, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.ITDuration.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> </div> </div> </div> </div> </div><file_sep>@{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ @*@section Scripts { @Scripts.Render("~/bundles/jqueryval") }*@ <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> <div style="color:black"> <h3> Application Form Summary </h3> </div> <div class="alert alert-dismissible alert-success"> <p> <b>Result By Course Report</b> can be viewed by selecting Session, Level. Programme, Department and specific Course from the drop dowms below, then click the Display Report button to display an exportable and printable report. </p> </div> <iframe src="~/Reports/Presenter/Result/CourseResult.aspx" style="width:100%; " frameborder="0" scrolling="no" id="iframe" onload='javascript:resizeIframe(this);'></iframe> <br /> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "Assign HOD"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "User")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "User")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> @using (Html.BeginForm("AssignHOD", "User", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-fw fa-edit"></i> Assign HOD </h4> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Username, "Enter Username: ", new { @class = "control-label " }) @Html.TextBoxFor(model => model.User.Username, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.User.Username, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> </div> } @if (Model.User == null) { return; } @if (Model.User != null) { <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("SaveAssignHOD", "User", FormMethod.Post)) { @Html.HiddenFor(model => model.User.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Department.Name, "Department ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Staff.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @required = "required", @id = "Department" }) @Html.ValidationMessageFor(model => model.Staff.Department.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Role.Name, "Role ", new { @class = "control-label " }) @Html.DropDownListFor(model => model.User.Role.Id, (IEnumerable<SelectListItem>)ViewBag.Role, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.User.Role.Name) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.isHead, "HOD ? ", new { @class = "control-label " }) @Html.CheckBoxFor(model =>model.Staff.isHead, new { @class = "", @id = "isHead" }) @Html.ValidationMessageFor(model => model.Staff.isHead) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Staff.isManagement, "Dean ? ", new { @class = "control-label " }) @Html.CheckBoxFor(model => model.Staff.isManagement,new { @class = "" }) @Html.ValidationMessageFor(model => model.Staff.isManagement) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> } </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep> @using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ /**/ /**/ /**/ ViewBag.Title = "Class Assignment List"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @section Scripts { <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function () { $.extend($.fn.dataTable.shadows, { responsive: false }); $("#attendanceTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); }) </script> <style> .btn-success { color: #1cc88a; background-color: transparent; border: 2px solid #eee; border-radius: 3px !important; } .btn-danger { color: #ca2819; background-color: transparent; border: 2px solid #eee; border-radius: 3px !important; } </style> } <br /> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table-bordered table-hover table-striped table" id="attendanceTable"> <thead> <tr class="table-head-alt text-center"> <th colspan="7" style="font-weight:600"> @Model.eAssignment.Course.Code - @Model.eAssignment.Course.Name</th> </tr> <tr lass="table-head-alt text-center"> <th colspan="7" style="font-weight:400"></th> </tr> <tr> <th>S/N</th> <th> Student Name </th> <th> Matric Number </th> <th> Submitted? </th> <th>Date of Submission</th> <th> Score </th> <th> Remark </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.EAssignmentClassList.Count; i++) { var sn = i + 1; <tr> <td>@sn</td> <td> @Model.EAssignmentClassList[i].CourseRegistrationDetail.CourseRegistration.Student.FullName </td> <td> @Model.EAssignmentClassList[i].CourseRegistrationDetail.CourseRegistration.Student.MatricNumber </td> @if (Model.EAssignmentClassList[i].IsSubmission) { <td>Yes</td> <td> @Model.EAssignmentClassList[i].EAssignmentSubmission.DateSubmitted </td> <td> @Model.EAssignmentClassList[i].EAssignmentSubmission.Score </td> <td> @Model.EAssignmentClassList[i].EAssignmentSubmission.Remarks </td> } else { <td>No</td> <td></td> <td></td> <td></td> } </tr> } </tbody> </table> </div> </div> </div> <file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Delete O-Level Subject"; } @Html.Partial("BasicSetup/_Delete", @Model)<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ApplicationSummary :Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { PopulateAllDropDown(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; //throw ex; } } private void DisplayReportBy(Session session) { try { var applicationFormLogic = new ApplicationFormLogic(); List<PhotoCard> photoCards = applicationFormLogic.GetPostJAMBApplications(session); string bind_dsPostJambApplicant = "dsApplicant"; string reportPath = @"Reports\ApplicantionSummary.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Applicantion Summary for" + session.Name; rv.LocalReport.ReportPath = reportPath; if(photoCards != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPostJambApplicant.Trim(),photoCards)); rv.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); //if (ddlSession.Items.Count > 1) //{ // ddlSession.SelectedIndex = 1; //} } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } DisplayReportBy(SelectedSession); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } } }<file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Student.ViewModels.CourseRegistrationViewModel @{ Layout = null; var firstSemesterCourses = new List<CourseRegistrationDetail>(); var secondSemesterCourses = new List<CourseRegistrationDetail>(); firstSemesterCourses = Model.FirstSemesterCourses.ToList(); secondSemesterCourses = Model.SecondSemesterCourses.ToList(); } <style> .ts-sidebar a { font-size: 12px; font-family: 'Quicksand', sans-serif; } .sofia { font-family: 'Quicksand', sans-serif !important; } p, a, li, span, input, b { font-family: 'Quicksand', sans-serif !important; } table tr td { font-family: 'Quicksand', sans-serif !important; } div { font-family: 'Quicksand', sans-serif !important; } </style> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500&display=swap" rel="stylesheet"> <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 "> <div class="col-xs-1"></div> <div class="col-xs-10"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <center class="col-xs-12"> <img src="@Url.Content("~/Content/Images/school_logo.png")" alt="" height="150px" /> </center> </div> <div class="form-group"> <center class="col-xs-12"> <div style="font-size: large">University Of Port-Harcourt </div> </center> </div> </div> </div> <div class="shadow"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <center class="col-xs-12"> <h4>Course Registration Form</h4> </center> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <div class="col-xs-12" style="font-size: 12pt; text-transform: uppercase"> @Html.DisplayFor(model => model.Student.FullName) (@Html.DisplayFor(model => model.StudentLevel.Level.Name)) DETAILS <img class="pull-right" src="@Url.Content('~' + Model.Student.ImageFileUrl)" alt="" style="max-height: 100px" /> </div> </div> </div> </div> <div class="row small"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.Label("Session", new {@class = "control-label "}) </div> <div class="col-xs-7 "> @Html.DisplayFor(model => model.CurrentSessionSemester.SessionSemester.Session.Name) </div> </div> </div> </div> <div class="row small"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.StudentLevel.Programme.Name) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new {@class = "control-label "}) </div> <div class="col-xs-7 "> @Html.DisplayFor(model => model.StudentLevel.Department.Name) </div> </div> </div> </div> <div class="row small"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Name, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.StudentLevel.Department.Faculty.Name) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> @if (Model != null && Model.CarryOverCourses != null && Model.CarryOverCourses.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-xs-12"> <b>Carry Over Courses</b> <div class="pull-right record-count-label"> <label class="caption">1st Semester Total Unit</label><span class="badge">@Model.TotalFirstSemesterCarryOverCourseUnit</span> <label class="caption">2nd Semester Total Unit</label><span class="badge">@Model.TotalSecondSemesterCarryOverCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.CarryOverCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well text-muted" style="height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> <th> Semester </th> </tr> </thead> @for (int i = 0; i < Model.CarryOverCourses.Count; i++) { <tr class="small"> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Type.Name) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Semester.Name) </td> </tr> } </table> </div> </div> </div> </div> </div> </div> } @if (firstSemesterCourses.Count > 0 && secondSemesterCourses.Count <= 0) { <div class="panel panel-default"> <div class="panel-body"> <div id="divFirstSemesterCourses"> @if (Model != null && firstSemesterCourses != null && firstSemesterCourses.Count > 0) { <div class="row"> <div class="col-xs-12"> <b>First Semester Courses</b> <div class="pull-right record-count-label"> <label class="caption">Total Course Unit</label><span id="spFirstSemesterTotalCourseUnit" class="badge">@Model.SumOfFirstSemesterSelectedCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@firstSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well text-muted" style="font-size: 12px; height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < firstSemesterCourses.Count; i++) { <tr class="small" style="font-size: 11px"> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Type.Name) </td> </tr> } </table> </div> </div> </div> } </div> </div> </div> } @if (secondSemesterCourses.Count > 0 && firstSemesterCourses.Count <= 0) { <div class="panel panel-default"> <div class="panel-body"> <div id="divSecondSemesterCourses"> @if (Model != null && secondSemesterCourses != null && secondSemesterCourses.Count > 0) { <div class="row"> <div class="col-xs-12"> <b>Second Semester Courses</b> <div class="pull-right record-count-label"> <label class="caption">Total Course Unit</label><span id="spSecondSemesterTotalCourseUnit" class="badge">@Model.SumOfSecondSemesterSelectedCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@secondSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well text-muted" style="font-size: 12px; height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < secondSemesterCourses.Count; i++) { <tr class="small" style="font-size: 11px"> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Type.Name) </td> </tr> } </table> </div> </div> </div> } </div> </div> </div> } <div class="row"> <br /> <div class="col-md-3 pull-left text-center" style="border-top: solid; color: black"> HOD's Sign & Date </div> <div class="col-md-2 pull-right" style="border-top: solid; color: black">Academic Adviser's Sign & Date</div> </div> </div> <div class="col-xs-1"></div> </div> </div> </div> </div> </div> </div><file_sep><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VerifcationReport.aspx.cs" Inherits="Abundance_Nk.Web.Reports.Presenter.VerifcationReport" %> <%@ Register TagPrefix="rsweb" Namespace="Microsoft.Reporting.WebForms" Assembly="Microsoft.ReportViewer.WebForms, Version=192.168.127.12, Culture=neutral, PublicKeyToken=<KEY>" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="../../Content/bootstrap.min.css" rel="stylesheet" /> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="60000"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <p> <asp:Label ID="lblMessage" runat="server"></asp:Label> </p> <div class="row table-responsive"> <table class="table"> <tr> <td>&nbsp;</td> <td> <asp:TextBox ID="txtBoxDateFrom" runat="server" RepeatDirection="Horizontal" class="form-control txtDatePicker" placeholder="Start Date"></asp:TextBox> </td> <td>&nbsp;</td> <td> <asp:TextBox ID="txtBoxDateTo" runat="server" RepeatDirection="Horizontal" class="form-control txtDatePicker" placeholder="End Date"></asp:TextBox> </td> <td>&nbsp;</td> <td> <asp:DropDownList ID="ddlFeeType" class="form-control" runat="server" Height="35px" Width="250px"> </asp:DropDownList></td> </tr> <tr> <td></td> <td> <asp:DropDownList ID="ddlSession" class="form-control" runat="server" Height="35px" Width="250px"></asp:DropDownList> </td> <td></td> <td> <asp:DropDownList ID="ddlLevel" class="form-control" runat="server" Height="35px" Width="250px"></asp:DropDownList> </td> <td></td> <td> <asp:DropDownList ID="ddlProgramme" class="form-control" runat="server" Height="35px" Width="200px" AutoPostBack="True" OnSelectedIndexChanged="ddlProgramme_SelectedIndexChanged"> </asp:DropDownList></td> </tr> <tr> <td></td> <td> <asp:DropDownList ID="ddlDepartment" class="form-control" runat="server" Height="35px" Width="250px"> </asp:DropDownList></td> <td></td> <td></td> <td></td> <td> <asp:Button ID="Display_Button" runat="server" Text="Display Report" Width="111px" class="btn btn-success " OnClick="Display_Button_Click1" /> </td> </tr> </table> </div> </ContentTemplate> </asp:UpdatePanel> </div> <script src="../../Scripts/jquery-2.1.3.js"></script> <script src="../../Scripts/bootstrap.min.js"></script> <link href="../../Content/jquery-ui-1.10.3.css" rel="stylesheet" /> <script src="../../Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript"> $(function () { $('.txtDatePicker').datepicker( { dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: '1950:2100' }); }) </script> <div class="row"> <table class="table"> <tr> <td></td> <td> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="900px" ></rsweb:ReportViewer> </td> </tr> </table> </div> </form> </body> </html> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Edit"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Edit Hostel Type</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("EditHostelType", "Hostel", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h5>HOSTEL TYPE</h5> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.HostelType.Hostel_Type_Id) <div class="form-group"> @Html.LabelFor(model => model.HostelType.Hostel_Type_Name, "Hostel Type Name", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.HostelType.Hostel_Type_Name, new {@required = "required"}) @Html.ValidationMessageFor(model => model.HostelType.Hostel_Type_Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.HostelType.Hostel_Type_Description, "Hostel Description", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.HostelType.Hostel_Type_Description) @Html.ValidationMessageFor(model => model.HostelType.Hostel_Type_Description) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "ViewHostelTypes", "",new { @class = "btn btn-success" }) </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Abundance_Nk.Web.Models.Intefaces; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Configuration; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class Transcript :Page,IReport { public Level Level { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Student Student { get { return new Student { Id = Convert.ToInt32(ddlStudent.SelectedValue),Name = ddlStudent.SelectedItem.Text }; } set { ddlStudent.SelectedValue = value.Id.ToString(); } } public Session CurrentSession { get { return new Session { Id = Convert.ToInt32(hfSession.Value) }; } set { hfSession.Value = value.Id.ToString(); } } public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } public int ReportType { get { throw new NotImplementedException(); } } protected void Page_Load(object sender,EventArgs e) { try { Message = ""; if(!IsPostBack) { PopulateAllDropDown(); ddlStudent.Visible = false; ddlDepartment.Visible = false; SetCurrentSession(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void SetCurrentSession() { try { var currentSessionSemesterLogic = new CurrentSessionSemesterLogic(); CurrentSessionSemester currentSessionSemester = currentSessionSemesterLogic.GetCurrentSessionSemester(); CurrentSession = currentSessionSemester.SessionSemester.Session; } catch(Exception) { throw; } } private void DisplayReportBy(Student student,Programme programme,Department department,Faculty faculty) { try { var scoreGradeLogic = new ScoreGradeLogic(); var resultLogic = new StudentResultLogic(); var academicStandingLogic = new AcademicStandingLogic(); List<Model.Model.Result> results = resultLogic.GetTranscriptBy(student); string abbreviations = academicStandingLogic.GetAbbreviations(); string scoreGradingKeys = scoreGradeLogic.GetScoreGradingKey(); string reportPath = @"Reports\Result\ResultTranscript.rdlc"; //string reportPath = @"Reports\Transcript1.rdlc"; string bind_ds = "dsMasterSheet"; if(results != null && results.Count > 0) { string appRoot = ConfigurationManager.AppSettings["AppRoot"]; foreach(Model.Model.Result result in results) { if(!string.IsNullOrWhiteSpace(result.PassportUrl)) { result.PassportUrl = appRoot + result.PassportUrl; } else { result.PassportUrl = appRoot + Utility.DEFAULT_AVATAR; } } } rv.Reset(); rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; rv.LocalReport.DisplayName = "Statement of Result"; string programmeName = "Undergraduate"; //ReportParameter programmeParam = new ReportParameter("Programme", programmeName); //ReportParameter departmentParam = new ReportParameter("Department", department.Name); //ReportParameter facultyParam = new ReportParameter("Faculty", faculty.Name); //ReportParameter abbreviationsParam = new ReportParameter("Abbreviations", abbreviations); //ReportParameter scoreGradingKeysParam = new ReportParameter("ScoreGradingKeys", scoreGradingKeys); //ReportParameter[] reportParams = new ReportParameter[] { departmentParam, facultyParam, programmeParam, abbreviationsParam, scoreGradingKeysParam }; //rv.LocalReport.SetParameters(reportParams); if(results != null && results.Count > 0) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(),results)); rv.LocalReport.Refresh(); //rv.Visible = true; } else { lblMessage.Text = "No result to display"; rv.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlDepartment_SelectedIndexChanged(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } rv.LocalReport.DataSources.Clear(); List<Student> students = Utility.GetStudentsBy(Level,Programme,Department,CurrentSession); if(students != null && students.Count > 0) { Utility.BindDropdownItem(ddlStudent,students,Utility.ID,"FirstName"); ddlStudent.Visible = true; rv.Visible = true; } else { ddlStudent.Visible = false; rv.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(Level == null || Level.Id <= 0) { lblMessage.Text = "Please select Level"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if(Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } if(CurrentSession == null || CurrentSession.Id <= 0) { lblMessage.Text = "Current Session not set! Please contact your system administrator."; return true; } return false; } catch(Exception) { throw; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } if(Student == null || Student.Id <= 0) { lblMessage.Text = "Please select Student"; return; } var studentLevelLogic = new StudentLevelLogic(); StudentLevel studentLevel = studentLevelLogic.GetBy(Student,CurrentSession); DisplayReportBy(Student,Programme,Department,studentLevel.Department.Faculty); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { try { if(Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if(departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment,Utility.GetDepartmentByProgramme(programme),Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class ElearningTestResult : System.Web.UI.Page { long courseAllocationId; protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { if (Request.QueryString["courseAllocationId"] != null) { courseAllocationId = Convert.ToInt64(Request.QueryString["courseAllocationId"]); BuildReport(courseAllocationId); } } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void BuildReport(long courseAllocationId) { CourseAllocationLogic courseAllocationLogic = new CourseAllocationLogic(); EAssignmentLogic eAssignmentLogic = new EAssignmentLogic(); try { List<ElearningResult> results = null; var courseAllocation = courseAllocationLogic.GetModelBy(g => g.Course_Allocation_Id == courseAllocationId); if (courseAllocation?.Id > 0) { results = eAssignmentLogic.GetEAssignmentResult(courseAllocation); string bind_dsElearningResult = "dsElearningResult"; string reportPath = ""; reportPath = @"Reports\Result\ElearningTestAverage.rdlc"; //var rptViewer = new ReportViewer(); rptViewer.Visible = true; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "ELearning Result"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsElearningResult.Trim(), results)); rptViewer.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Entity; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class GstReport :System.Web.UI.Page { private Abundance_NkEntities db = new Abundance_NkEntities(); private readonly List<Semester> semesters = new List<Semester>(); private Course course; private string courseId; private List<Course> courses; private Department department; private List<Department> departments; private string deptId; private Level level; private string levelId; private string progId; private Programme programme; private Semester semester; private string semesterId; private Session session; private string sessionId; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Semester SelectedSemester { get { return new Semester { Id = Convert.ToInt32(ddlSemester.SelectedValue), Name = ddlSemester.SelectedItem.Text }; } set { ddlSemester.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Course SelectedCourse { get { return new Course { Id = Convert.ToInt32(ddlCourse.SelectedValue),Name = ddlCourse.SelectedItem.Text }; } set { ddlCourse.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(Request.QueryString["levelId"] != null && Request.QueryString["semesterId"] != null && Request.QueryString["progId"] != null && Request.QueryString["deptId"] != null && Request.QueryString["sessionId"] != null && Request.QueryString["courseId"] != null) { levelId = Request.QueryString["levelId"]; semesterId = Request.QueryString["semesterId"]; progId = Request.QueryString["progId"]; deptId = Request.QueryString["deptId"]; sessionId = Request.QueryString["sessionId"]; courseId = Request.QueryString["courseId"]; int deptId1 = Convert.ToInt32(deptId); int progId1 = Convert.ToInt32(progId); int sessionId1 = Convert.ToInt32(sessionId); int levelId1 = Convert.ToInt32(levelId); int semesterId1 = Convert.ToInt32(semesterId); int courseId1 = Convert.ToInt32(courseId); session = new Session { Id = sessionId1 }; semester = new Semester { Id = semesterId1 }; course = new Course { Id = courseId1 }; department = new Department { Id = deptId1 }; level = new Level { Id = levelId1 }; programme = new Programme { Id = progId1 }; } else { Display_Button.Visible = true; } if(!IsPostBack) { if(string.IsNullOrEmpty(deptId) || string.IsNullOrEmpty(progId) || string.IsNullOrEmpty(sessionId)) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); ddlSemester.Visible = false; Utility.BindDropdownItem(ddlProgramme, Utility.GetAllProgrammes(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); ddlDepartment.Visible = false; ddlCourse.Visible = false; //BulkOperations(); } else { DisplayStaffReport(session,semester,course,department,level,programme); ddlDepartment.Visible = false; ddlCourse.Visible = false; ddlLevel.Visible = false; ddlProgramme.Visible = false; ddlSemester.Visible = false; ddlSession.Visible = false; } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void DisplayStaffReport(Session session,Semester semester,Course course,Department department, Level level,Programme programme) { try { DisplayReportBy(session,semester,course,department,level,programme); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } public void BulkOperations() { try { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; if(Directory.Exists(Server.MapPath("~/Content/temp"))) { Directory.Delete(Server.MapPath("~/Content/temp"),true); } Directory.CreateDirectory(Server.MapPath("~/Content/temp")); List<Course> courses = new List<Course>(); var courseLogic = new CourseLogic(); var programmeLogic = new ProgrammeLogic(); var departmentLogic = new DepartmentLogic(); var levelLogic = new LevelLogic(); var scanCourses = db.GST_SCAN_RESULT.Select(x => x.COURSE_CODE).Distinct().ToList(); for (int i =0; i < scanCourses.Count; i++) { Course course = new Course(); course.Id = i; course.Name = scanCourses[i]; courses.Add(course); } List<Level> levels = levelLogic.GetAll(); List<Department> departments = departmentLogic.GetAll(); List<Programme> programmes = programmeLogic.GetAll(); List<Course> courseList = courses; Model.Model.Session seSession = new Session(){Id = 7,Name = "2016/2017"}; Semester seSemester = new Semester(){Id = 2}; Programme programme = new Programme(){Id = 4}; //Course coCourse = new Course(){Id=0,Name = "GST 107"}; // foreach(Programme prProgramme in programmes) // { foreach (Department deptDepartment in departments) { foreach (Level levlevel in levels) { foreach (Course coCourse in courseList) { var studentResultLogic = new StudentResultLogic(); List<Model.Model.Result> report = studentResultLogic.GetStudentGSTResultBy(seSession,seSemester,levlevel, programme,deptDepartment,coCourse); if(report.Count > 0) { string bind_dsStudentResultSummary = "dsExamRawScoreSheet"; string reportPath = null; if (coCourse.Name.Contains("ENT")) { reportPath = @"Reports\Result\ExamRawScoreSheetENT.rdlc"; } else { reportPath = @"Reports\Result\ExamRawScoreSheetGST.rdlc"; } var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "GST Result"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResultSummary.Trim(),report)); byte[] bytes = rptViewer.LocalReport.Render("PDF",null,out mimeType,out encoding, out extension,out streamIds,out warnings); string name = deptDepartment.Code.Replace(" ","") + coCourse.Name.Replace(" ","")+ levlevel.Name.Replace(" ","") ; string path = Server.MapPath("~/Content/temp"); string savelocation = Path.Combine(path,name + ".pdf"); File.WriteAllBytes(savelocation,bytes); } } } } // } //using(var zip = new ZipFile()) //{ // string file = Server.MapPath("~/Content/temp/"); // zip.AddDirectory(file,""); // string zipFileName = SelectedDepartment.Name; // zip.Save(file + zipFileName + ".zip"); // string export = "~/Content/temp/" + zipFileName + ".zip"; // //Response.Redirect(export, false); // var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); // Response.Redirect( // urlHelp.Action("DownloadZip", // new // { // controller = "StaffCourseAllocation", // area = "Admin", // downloadName = SelectedDepartment.Name // }),false); //} } catch (Exception ex) { throw ex; } } protected void Display_Button_Click1(object sender,EventArgs e) { try { if(InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession,SelectedSemester,SelectedCourse,SelectedDepartment,SelectedLevel, SelectedProgramme); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0 || SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } private void DisplayReportBy(Session session,Semester semester,Course course,Department department, Level level,Programme programme) { try { var studentResultLogic = new StudentResultLogic(); List<Model.Model.Result> studeResults = studentResultLogic.GetStudentGSTResultBy(session,semester,level, programme,department,course); string bind_dsStudentResultSummary = "dsExamRawScoreSheet"; string reportPath = null; if (course.Name.Contains("ENT")) { reportPath = @"Reports\Result\ExamRawScoreSheetENT.rdlc"; } else { reportPath = @"Reports\Result\ExamRawScoreSheetGST.rdlc"; } ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Examination Raw Score Sheet "; ReportViewer1.LocalReport.ReportPath = reportPath; if(studeResults != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResultSummary.Trim(), studeResults)); ReportViewer1.LocalReport.Refresh(); ReportViewer1.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void ddlProgramme_SelectedIndexChanged1(object sender,EventArgs e) { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); departments.Insert(0,new Department { Name = "-- Select Department--" }); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } protected void ddlSession_SelectedIndexChanged1(object sender,EventArgs e) { var session = new Session { Id = Convert.ToInt32(ddlSession.SelectedValue) }; var sessionSemesterLogic = new SessionSemesterLogic(); List<SessionSemester> semesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); foreach(SessionSemester sessionSemester in semesterList) { semesters.Add(sessionSemester.Semester); } semesters.Insert(0,new Semester { Name = "-- Select Semester--" }); Utility.BindDropdownItem(ddlSemester,semesters,Utility.ID,Utility.NAME); ddlSemester.Visible = true; } protected void ddlDepartment_SelectedIndexChanged(object sender,EventArgs e) { try { courses = new List<Course>(); var courseLogic = new CourseLogic(); var scanCourses = db.GST_SCAN_RESULT.Select(x => x.COURSE_CODE).Distinct().ToList(); for (int i =0; i < scanCourses.Count; i++) { Course course = new Course(); course.Id = i; course.Name = scanCourses[i]; courses.Add(course); } Utility.BindDropdownItem(ddlCourse,courses,Utility.ID,Utility.NAME); ddlCourse.Visible = true; } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } } <file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Edit Fee Type"; } @Html.Partial("BasicSetup/_Edit", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "E-Learning EContentType"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("EditEContentType", "Elearning", new { area = "Admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="card"> <div class="card-header"> <h3 class="card-title"><i class="fa fa-fw fa-download"></i>Edit E-Content Topic Module</h3> </div> <div class="card-body"> @Html.HiddenFor(model => model.eContentType.Id) <div class="form-group"> @Html.LabelFor(model => model.eContentType.Name, "Content Topic", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eContentType.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eContentType.Name, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eContentType.Description, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eContentType.Description, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eContentType.Description, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eContentType.StartTime, "Start Time", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eContentType.StartTime, new { @class = "form-control myDate", @type = "datetime", required = "true" }) @Html.ValidationMessageFor(model => model.eContentType.StartTime, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eContentType.EndTime, " Stop Time", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eContentType.EndTime, new { @class = "form-control", @type = "datetime", required = "true" }) @Html.ValidationMessageFor(model => model.eContentType.EndTime, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.eContentType.Active, "Activate", new { @class = "control-label" }) <div> @Html.CheckBoxFor(model => model.eContentType.Active, new { @checked = Model.eContentType.Active, Id = "active" }) @Html.ValidationMessageFor(model => model.eContentType.Active) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> </div> } <link href="~/Content/jquery-ui-1.10.3.css" rel="stylesheet" /> <link href="~/Content/gridmvc.datepicker.min.css" rel="stylesheet" /> <script> //$(function () { // $(".myDate").datepicker(); //}); </script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ClearanceViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> @using (Html.BeginForm("EditCriteria", "Clearance/EditCriteria", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div> </div> <div class="row"> <h5>Choose Programme</h5> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.admissionCriteriaForOLevelSubject[0].MainCriteria.Programme.Id, new {@class = "control-label custom-text-black"}) @Html.DisplayFor(model => model.admissionCriteriaForOLevelSubject[0].MainCriteria.Programme.Name, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.admissionCriteriaForOLevelSubject[0].MainCriteria.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.admissionCriteriaForOLevelSubject[0].Id) @Html.HiddenFor(model => model.admissionCriteriaForOLevelSubject[0].MainCriteria.Department.Id, new {@class = "control-label custom-text-black"}) @Html.DisplayFor(model => model.admissionCriteriaForOLevelSubject[0].MainCriteria.Department.Name, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div id="divJambNo" class="form-group" style="display: none"> </div> </div> </div> </div> </div> <div> <div class="row" id="divOLevel" style="color: black"> <div class="col-md-6"> <h5>Main Subject</h5> <hr class="no-top-padding" /> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Compulsory </th> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < Model.admissionCriteriaForOLevelSubject.Count(); i++) { <tr> <td> @Html.CheckBoxFor(model => Model.admissionCriteriaForOLevelSubject[i].IsCompulsory, new {@class = "ckb3"}) </td> <td> @Html.DropDownListFor(model => Model.admissionCriteriaForOLevelSubject[i].Subject.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelSubjectId" + i], new {@class = "form-control olevel"}) @Html.HiddenFor(model => model.admissionCriteriaForOLevelSubject[i].Id) </td> <td> @Html.DropDownListFor(model => Model.admissionCriteriaForOLevelSubject[i].MinimumGrade.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelGradeId" + i], new {@class = "form-control olevel"}) </td> </tr> } </table> </div> <div class="col-md-6"> <h5>Subject Alternative</h5> <hr class="no-top-padding" /> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> </th> <th></th> </tr> @for (int i = 0; i < Model.admissionCriteriaForOLevelSubject.Count(); i++) { if (Model.admissionCriteriaForOLevelSubject[i].Alternatives.Count > 0) { <tr> <td> @Html.DropDownListFor(model => Model.admissionCriteriaForOLevelSubject[i].Alternatives[0].OLevelSubject.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelSubjectId" + i], new {@class = "form-control olevel"}) @Html.HiddenFor(model => model.admissionCriteriaForOLevelSubject[i].Alternatives[0].Id) @Html.HiddenFor(model => model.admissionCriteriaForOLevelSubject[i].Alternatives[0].OLevelSubject.Name) </td> <td> </td> </tr> } else { <tr> <td> @Html.DropDownListFor(model => Model.admissionCriteriaForOLevelSubject[i].Alternatives[0].OLevelSubject.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelSubjectId" + i], new {@class = "form-control olevel"}) @Html.HiddenFor(model => Model.admissionCriteriaForOLevelSubject[i].Id) </td> <td> </td> </tr> } } </table> </div> </div> </div> <div> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update Criteria" /> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "ChangeRoomName"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#Series").change(function () { $("#Room").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetRooms", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Series").val() }, success: function(rooms) { $("#Room").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(rooms, function(i, rooms) { $("#Room").append('<option value="' + rooms.Value + '">' + rooms.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve Room.' + ex); } }); return false; }); $("#Hostel").change(function () { $("#Series").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetHostelSeries", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Hostel").val() }, // Get Selected Campus ID. success: function (series) { $("#Series").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(series, function (i, series) { $("#Series").append('<option value="' + series.Value + '">' + series.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve series.' + ex); } }); return false; }); }) </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Change Hostel Room Name</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ChangeRoomName", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocation.Hostel.Name, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.HostelAllocation.Hostel.Id, (IEnumerable<SelectListItem>) ViewBag.HostelId, htmlAttributes: new {@class = "form-control", @required = "required", @id = "Hostel"}) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Hostel.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocation.Series.Name, "Series/Floor", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocation.Series.Id, (IEnumerable<SelectListItem>)ViewBag.HostelSeriesId, htmlAttributes: new { @class = "form-control", @required = "required", @id = "Series" }) @Html.ValidationMessageFor(model => model.HostelAllocation.Series.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocation.Room.Number, "Room Name",new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.HostelAllocation.Room.Id, (IEnumerable<SelectListItem>) ViewBag.RoomId, htmlAttributes: new {@class = "form-control", @required = "required", @id = "Room"}) @Html.ValidationMessageFor(model => model.HostelAllocation.Room.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <div class="panel-body"> @if (Model.HostelRoom != null) { using (Html.BeginForm("SaveChangedRoomName", "HostelAllocation", FormMethod.Post)) { @Html.HiddenFor(model => model.HostelRoom.Id) <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoom.Number, "Room Name", new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.HostelRoom.Number, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelRoom.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> </div> } } </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Student.ViewModels.RegistrationIndexViewModel @{ ViewBag.Title = "Index"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> $(document).ready(function() { BindCheckBoxes(); UpdateUIState(); $("#btnRegisterCourse").click(function() { try { var data = $('#frmCourseRegistration').serialize(); $.ajax({ type: "POST", url: "@Url.Action("Form", "CourseRegistration")", dataType: "json", data: $("#frmCourseRegistration").serialize(), beforeSend: function() { $("#processing").show(); }, complete: function() { $("#processing").hide(); }, success: SuccessFunc, error: ErrorFunc, }); function SuccessFunc(data, status) { //$("#data").html(data); //BindCheckBoxes(); if (data.message.indexOf("Error Occurred") <= -1) { $('#btnRegisterCourse').prop('disabled', true); $("#selectAllFirstSemester").prop('disabled', true); $("#selectAllSecondSemester").prop('disabled', true); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); } alert(data.message); } function ErrorFunc() { alert("Operation failed!"); } } catch (e) { alert(e); } }); function InvalidUserInput() { try { var firstSemesterMinimumUnit = $('#FirstSemesterMinimumUnit').val(); var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMinimumUnit = $('#SecondSemesterMinimumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); var firstSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb1")); var secondSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb2")); firstSemesterSelectedUnit += parseInt(firstSemesterCarryOverTotalUnit); secondSemesterSelectedUnit += parseInt(secondSemesterCarryOverTotalUnit); if (firstSemesterSelectedUnit < firstSemesterMinimumUnit) { //alert("Total selected Course Unit of " + firstSemesterSelectedUnit + " cannot be less than First Semester Min Unit of " + firstSemecterMinimumUnit + "! Please modify to continue."); return true; } else if (firstSemesterMaximumUnit < firstSemesterSelectedUnit) { //alert("Total selected Course Unit of " + firstSemesterSelectedUnit + " cannot be less than First Semester Max Unit of " + firstSemecterMaximumUnit + "! Please modify to continue."); return true; } else if (secondSemesterSelectedUnit < secondSemesterMinimumUnit) { //alert("Total selected Course Unit of " + secondSemesterSelectedUnit + " cannot be less than Second Semester Min Unit of " + secondSemecterMinimumUnit + "! Please modify to continue."); return true; } else if (secondSemesterMaximumUnit < secondSemesterSelectedUnit) { //alert("Total selected Course Unit of " + secondSemesterSelectedUnit + " cannot be less than Second Semester Max Unit of " + secondSemecterMaximumUnit + "! Please modify to continue."); return true; } return false; } catch (e) { throw e; } } function BindCheckBoxes() { try { BindSelectAll($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectAll($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); BindSelectOne($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectOne($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); UpdateSelectAllCheckBox($("#selectAllFirstSemester"), $(".ckb1")); UpdateSelectAllCheckBox($("#selectAllSecondSemester"), $(".ckb2")); } catch (e) { alert(e); } } function BindSelectAll(chkBox, chkBoxClass, courseUnitLabel) { chkBox.click(function(event) { try { if (this.checked) { chkBoxClass.each(function() { this.checked = true; }); } else { chkBoxClass.each(function() { this.checked = false; }); } var totalUnit = CalculateSelectedCourseUnit(chkBoxClass); courseUnitLabel.html(totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateButtonState() { try { if (InvalidUserInput()) { $('#btnRegisterCourse').prop('disabled', true); } else { $('#btnRegisterCourse').prop('disabled', false); } } catch (e) { throw e; } } function BindSelectOne(chkBox, chkBoxClass, courseUnitLabel) { chkBoxClass.click(function(event) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (!this.checked) { chkBox.removeAttr('checked'); } else { if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } var totalUnit = CalculateSelectedCourseUnit(chkBoxClass); courseUnitLabel.html(totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateSelectAllCheckBox(chkBox, chkBoxClass) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } catch (e) { alert(e); } } function CalculateSelectedCourseUnit(checkBox) { try { var totalUnit = 0; var values = new Array(); $.each(checkBox.filter(":checked").closest("td").siblings('.unit'), function() { values.push($(this).text()); }); if (values != null && values.length > 0) { for (var i = 0; i < values.length; i++) { totalUnit += parseInt(values[i]); } } return totalUnit; } catch (e) { alert(e); } } function UpdateUIState() { try { var courseAlreadyRegistered = $('#CourseAlreadyRegistered').val(); if (courseAlreadyRegistered.toLowerCase() == 'true') { $('#btnRegisterCourse').prop('disabled', false); var approved = $('#RegisteredCourse_Approved').val(); if (approved.toLowerCase() == 'true') { $('#buttons').hide('fast'); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); } else { $('#buttons').show(); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); } $('#divCourseFormPrintOut').show(); } else { $('#buttons').show(); $('#btnRegisterCourse').prop('disabled', true); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); $('#divCourseFormPrintOut').hide('fast'); } var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); if ((parseInt(firstSemesterCarryOverTotalUnit) <= parseInt(firstSemesterMaximumUnit)) && (parseInt(secondSemesterCarryOverTotalUnit) <= parseInt(secondSemesterMaximumUnit))) { $("#selectAllCarryOverCourses").prop('checked', 'checked'); $("#selectAllCarryOverCourses").prop('disabled', true); $(".ckb3").prop('disabled', true); } } catch (e) { throw e; } } }); </script> } <div class="row custom-text-black"> <div class="col-md-3"> <div class="logopanel"> <h1><span style="color: #35925B">Session Registration</span></h1> </div> <div class="panel panel-default"> <div class="panel-body"> <ul class="leftmenu "> <li> <a href="#"><b>Instructions</b></a> </li> </ul> <ol> <li class="margin-bottom-7">The list of all payment made is displayed on the payment list</li> <li class="margin-bottom-7">To print payment receipt or invoice, click on item (first column) on payment list, a pop menu will appear with two links (invoice and receipt). Click on any one of your choice to print it</li> <li class="margin-bottom-7">Click on the <b>Fill Student Form</b> button to fill your bio data form or click on <b>Fill Course Registration Form</b> button to fill and print your Course Form</li> </ol> </div> </div> </div> <div class="col-md-9"> @using (Html.BeginForm("Form", "CourseRegistration", new {Area = "Student"}, FormMethod.Post, new {id = "frmCourseRegistration"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="shadow"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <div class="col-md-12" style="font-size: 15pt; text-transform: uppercase"> @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.DisplayFor(model => model.Student.FullName) (<b>@Html.DisplayFor(model => model.StudentLevel.Level.Name)</b>) DETAILS </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label "}) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new {@class = "control-label "}) </div> <div class="col-md-7 "> @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.DisplayFor(model => model.StudentLevel.Department.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new {@class = "control-label "}) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.DisplayFor(model => model.StudentLevel.Programme.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Name, new {@class = "control-label "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.StudentLevel.Department.Faculty.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> @*<div id="divFirstSemesterCourses">*@ @if (Model != null && Model.PaymentHistory != null && Model.PaymentHistory.Payments != null && Model.PaymentHistory.Payments.Count > 0) { <div class="row"> <div class="col-md-12"> <b>Payments</b> <div class="pull-right record-count-label"> <span class="caption">No of Payment</span><span class="badge">@Model.PaymentHistory.Payments.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12 "> <table class="table grid-table table-condensed grid-wrap table-head-alt mb30"> <thead> <tr class="well grid-wrap" style="height: 35px; vertical-align: middle"> <th> Item </th> <th> Bank </th> <th> Invoice No </th> <th> Confirmation Order No </th> <th style="text-align: right"> Amount (₦) </th> </tr> </thead> @for (int i = 0; i < Model.PaymentHistory.Payments.Count; i++) { <tr> <td> <ul class="nav navbar-nav2 "> <li class="dropdown"> <a style="padding: 1px;" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">@Html.DisplayFor(modelItem => Model.PaymentHistory.Payments[i].FeeTypeName)</a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li class="divider"></li> <li>@Html.ActionLink("Reprint Invoice", "Invoice", "Credential", new {Area = "Common", pmid = Utility.Encrypt(Model.PaymentHistory.Payments[i].PaymentId.ToString())}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li>@Html.ActionLink("Print Receipt", "Receipt", "Credential", new {Area = "Common", pmid = Model.PaymentHistory.Payments[i].PaymentId}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> </ul> </li> </ul> </td> <td> @Html.DisplayFor(modelItem => Model.PaymentHistory.Payments[i].BankName) </td> <td> @Html.DisplayFor(modelItem => Model.PaymentHistory.Payments[i].InvoiceNumber) </td> <td> @Html.DisplayFor(modelItem => Model.PaymentHistory.Payments[i].ConfirmationOrderNumber) </td> <td style="text-align: right"> @Html.DisplayFor(modelItem => Model.PaymentHistory.Payments[i].Amount) </td> </tr> } </table> @*</div>*@ </div> </div> <br /> <div class="row" id="buttons"> <div class="col-md-12"> <div> <div class="form-inline "> <div class="form-group"> @Html.ActionLink("Fill Student Form", "Form", "Registration", new {Area = "Student", sid = Utility.Encrypt(Model.Student.Id.ToString()), pid = Utility.Encrypt(Model.StudentLevel.Programme.Id.ToString())}, new {@class = "btn btn-primary btn-lg ", target = "_blank", id = "alStudentInformationForm"}) @Html.ActionLink("Fill Course Registration Form", "CourseRegistration", "Registration", new {Area = "Student", sid = Utility.Encrypt(Model.Student.Id.ToString())}, new {@class = "btn btn-primary btn-lg ", target = "_blank", id = "alCourseRegistration"}) </div> <div class="form-group"> <div id="processing" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> } else { <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> } </div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "StudentRegisteredCourses"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="container"> <div class="col-md-12 card p-5"> <div class=" text-success"> <h1><b>Students That have Registered Courses</b></h1> </div> <section id="loginForm"> @using (Html.BeginForm("StudentRegisteredCourses", "Report", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <h5>Please enter your <b>Matriculation Number</b> in the box below to generate your School Fees invoice</h5> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(m => m.Session.Id, "Session", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.HiddenFor(m => m.Session.Id) @Html.DropDownListFor(m => m.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Sessions, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Programme.Id, "Programme", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.HiddenFor(m => m.Programme.Id) @Html.DropDownListFor(m => m.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programmes, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Semester.Id, "Semester", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.HiddenFor(m => m.Semester.Id) @Html.DropDownListFor(m => m.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Department.Id, "Department", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.HiddenFor(m => m.Department.Id) @Html.DropDownListFor(m => m.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Departments, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Next" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGRefereeViewModel @{ ViewBag.Title = "PGForm"; Layout = "~/Views/Shared/_Layout.cshtml"; } <style> body { overflow-x: hidden !important; } .bg-white { background: #fff; } .fs-16 { font-size: 16px; } .fs-15 { font-size: 15px; } .mt-10 { margin-top: 10px !important; } .mt-20 { margin-top: 20px !important; } .mt-30 { margin-top: 30px !important; } .mt-5 { margin-top: 5px !important; } .mb-10 { margin-bottom: 10px !important; } .mb-5 { margin-bottom: 5px !important; } .p-20 { font-size: 20px; } .bb-black { border-bottom: 1px solid #ddd; } .list-inline { display: inline !important; } .no-list-bullet { list-style: none !important; } textarea { width: 100% !important; } </style> @if (TempData["Message"] != null) { <div class="container"> <div class="row"> <div class="col-md-12"> <br /> @Html.Partial("_Message", TempData["Message"]) </div> </div> </div> } @if (!Model.Completed) { <div class="container"> <div class="card"> <div class="card-body" style="padding: 50px 20px;"> <div class="row"> <div class="col-xs-12 col-md-12"> <h2 class="text-center"> <img src="~/Content/Images/absu logo.png" style="width:80px;height:80px" /> </h2> <h3 class="text-center mb-5">ABIA STATE UNIVERSITY, UTURU</h3> <h4 class="text-center mt-5">SCHOOL OF POSTGRADUATE</h4> </div> <div class="col-xs-12 col-md-12"> <h3 class="text-center mb-5"> REFEREE'S CONFIDENTIAL REPORT ON A CANDIDATE FOR ADMISSION <br />TO HIGHER/POSTGRADUATE STUDIES </h3> </div> <div class="col-xs-12 col-md-10 offset-md-1 bb-black" style="padding-bottom: 30px !important;"> <p class="p-20"> The candidate whose name is given below wishes to undertake higher degree/postgraduate studies in this university. Your comments(which will be treated in the strictest confidence) on the candidate's suitability for the work, would be appreciated. Please return the completed form direct to the Secondary School of Postgraduate Studies, Abia State University, P.M.B 2000 Uturu, Abia State. </p> </div> <div class="col-xs-12 col-md-8 offset-md-2 mt-30 mb-10"> @using (Html.BeginForm("RefereeForm", "PostGraduateForm", FormMethod.Post, new { id = "frmPostJAMB", enctype = "multipart/form-data" })) { @*<form>*@ @Html.HiddenFor(m => m.ApplicantReferee.Id) <ol class="no-list-bullet"> <li> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferee.ApplicationForm.Person, "Name of Candidate", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferee.ApplicationForm.Person.FullName, new { @class = "form-control", @readonly = "readonly" }) </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, "Department/Faculty", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name, "Programme", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control", @readonly = "readonly" }) </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.ApplicantRefereeResponse.DurationKnownApplicant, "How long have you know the candidate(In Years)?", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantRefereeResponse.DurationKnownApplicant, new { @class = "form-control", @type = "number", min = 1, @required=true }) </div> </li> </ol> <span class="help-block fs-16">Please, Evaluate the candidate with the checklist below:</span> <br /> <span class="help-block fs-15">(Please, tick as appropriate)</span> <br /> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <th></th> <th>Outstanding(top 5%)</th> <th>Excellent(15%)</th> <th>Very Good(top 25%)</th> <th>Good(top 35%)</th> <th>Average</th> <th>Below Average</th> <th>No Information</th> </tr> </thead> <tbody> @for (int i = 0; i < Model.RefereeEvaluations.Count; i++) { <tr> @Html.HiddenFor(m => m.RefereeEvaluations[i].GradeCategoryId) @Html.HiddenFor(m => m.RefereeEvaluations[i].GradeSystemId) <td>@Html.DisplayFor(model => model.RefereeEvaluations[i].GradeCategory)</td> @for (int j = 0; j < Model.RefereeEvaluations[i].GradingSystems.Count; j++) { <td> @Html.HiddenFor(m => m.RefereeEvaluations[i].GradeCategoryId) @Html.HiddenFor(m => m.RefereeEvaluations[i].GradingSystems[j].Id) @Html.RadioButtonFor(m => m.RefereeEvaluations[i].GradeCategory, Model.RefereeEvaluations[i].GradingSystems[j].isChecked, new { @type = "radio", @onClick = "setCheckValue(" + i + ',' + Model.RefereeEvaluations[i].GradingSystems[j].Id + ");", @class = "collect-status" }) </td> } </tr> } </tbody> </table> </div> <ol class="no-list-bullet"> <li> <div class="form-group"> <label class="control-label">Comment on the Candidate's Personality</label> @Html.TextAreaFor(model => model.ApplicantRefereeResponse.RelevantInformation, new { @class = "form-control", rows = 6 }) </div> </li> <li> <div class="form-group"> <label class="control-label">Would you accept the candidate as a graduate student?</label> <br /> <p>Yes</p> @Html.RadioButtonFor(model => model.ApplicantRefereeResponse.CanAcceptApplicant, true, new { @class = "", @type = "radio" }) &nbsp;&nbsp; <p>No</p> @Html.RadioButtonFor(model => model.ApplicantRefereeResponse.CanAcceptApplicant, false, new { @class = "", @type = "radio" }) </div> </li> <br /> <li> <div class="form-group"> <label class="control-label">Please rate this applicant in overall promise</label> <br /><br /> <table class="table table-bordered"> <thead> <tr> @for (int k = 0; k < Model.OverallGradingSystems.Count; k++) { <td> @Html.DisplayFor(model => model.OverallGradingSystems[k].score) </td> } </tr> </thead> <tbody> <tr> @for (int k = 0; k < Model.OverallGradingSystems.Count; k++) { <td> @Html.RadioButtonFor(model => model.OverallRating, @Model.OverallGradingSystems[k].Id, new { @class = "", @type = "radio" }) @*<input type="radio" name="Overrall" id=@Model.OverallRating value=@Model.OverallGradingSystems[k].Id />*@ </td> } </tr> </tbody> </table> </div> </li> <li> <div class="form-group"> <label class="control-label">Relevant information to determine the candidate's suitability?</label> @Html.TextAreaFor(model => model.ApplicantRefereeResponse.Remark, new { @class = "form-control", rows = 6 }) </div> </li> <li> <div class="form-group"> <label class="control-label">Do you have any objections about the candidate's eligibity?</label> </div> </li> </ol> <div class="row" style="padding-left: 40px;"> <div class="col-md-12"> <div class="form-group"> <label for="name" class="control-label">FullName</label> @Html.TextBoxFor(model => model.ApplicantRefereeResponse.FullName, new { @class = "form-control" }) </div> </div> </div> <div class="form-actions no-color col-md-12"> <button class="btn btn-primary btn-lg" type="submit" name="submit" id="submit">Next @*<i class="fa fa-chevron-right mr5"></i><i class="fa fa-chevron-right mr5"></i>*@</button> <div id="busy" style="display: none">Processing ...</div> <div id="result"></div> </div> @*</form>*@ } </div> </div> </div> <div class="card-footer bg-white"> <h5 class="text-right"> <span class="fs-15">Powered by </span> <a href="http://lloydant.com" target="_blank"> <img src="~/Content/Images/lloydant.png" style="width: 40px; height:30px;" /> </a> </h5> </div> </div> </div> } <script type="text/javascript"> //function editRadioButtonState(ref) { // //Get all instances of the css class: ".collect-status" // const nodes = document.querySelectorAll(".collect-status"); // //Cast all instances of the css class: ".collect-status" to an array // const trigger = Array.prototype.slice.call(nodes, document.body); // //get the index which the clicked element belongs to from the list of element // const index = trigger.indexOf(ref); // //Get the exact radio button that was clicked on based on its index // const el = trigger[index]; // /** // * Get all radio buttons that share a common "name", so all their values can be == false // * and the selected radio button can then be set == true // * */ // const elementName = el.getAttribute("name"); // //returns an array of radiobutton/html elements that share a common name // let fields = document.getElementsByName(`${elementName}`); // //console.log("Number of elements on this row: ", fields.length); // for (let i = 0; i < fields.length; i++) { // fields[i].value = false; // } // //Reset the clicked element's value to true after turning its sibling element values to false // el.value = true; //} function setCheckValue(i, j) { $(`#RefereeEvaluations_${i}__GradeSystemId`).val(j); } </script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "Delivery Service Zone"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="panel panel-custom"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body text-justify"> <h2 style="font-weight: 300; text-align: center">Delivery Service Zone</h2> <hr /> <br /> @using (Html.BeginForm("CreateDeliveryServiceZone", "TranscriptProcessor", new { area = "Admin" }, FormMethod.Get)) { <div class="row" style="margin-bottom: 3px"> <div class="col-md-10"></div> <div class="col-md-2" style="padding-bottom: 3px"> <button class="btn btn-success mr5" type="submit" name="submit"><i class="fa fa-plus"> Create New </i></button> </div> </div> } <table class="table-responsive table-striped table-condensed" style="width: 100%" id="MyTable"> <thead> <tr> <th>SN</th> <th>Delivery Service Name</th> <th>Geo Zone Name</th> <th>FeeType</th> <th>Delivery Service Amount</th> <th>lloydant Amount</th> <th>School Amount</th> <th>Activated</th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.DeliveryServiceZones.Count; i++) { var sN = i + 1; <tr> <td>@sN</td> <td>@Model.DeliveryServiceZones[i].DeliveryService.Name</td> <td>@Model.DeliveryServiceZones[i].GeoZone.Name</td> <td>@Model.DeliveryServiceZones[i].FeeType.Name</td> <td>@Model.DeliveryServiceZones[i].DeliveryServiceAmount</td> <td>@Model.DeliveryServiceZones[i].LLoydantAmount</td> <td>@Model.DeliveryServiceZones[i].SchoolAmount</td> <td>@Model.DeliveryServiceZones[i].Activated</td> <td>@Html.ActionLink("Edit", "EditDeliveryServiceZone", new { Id = @Model.DeliveryServiceZones[i].Id, area = "admin" }, new { @class = "btn btn-success" })</td> </tr> } </tbody> </table> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Models.RefereeFormViewModel @{ ViewBag.Title = "View Referee Print Out"; Layout = "~/Views/Shared/_Layout.cshtml"; } <style> body { overflow-x: hidden !important; } .bg-white { background: #fff; } .fs-16 { font-size: 16px; } .fs-15 { font-size: 15px; } .mt-10 { margin-top: 10px !important; } .mt-20 { margin-top: 20px !important; } .mt-30 { margin-top: 30px !important; } .mt-5 { margin-top: 5px !important; } .mb-10 { margin-bottom: 10px !important; } .mb-5 { margin-bottom: 5px !important; } .p-20 { font-size: 20px; } .bb-black { border-bottom: 1px solid #ddd; } .list-inline { display: inline !important; } .no-list-bullet { list-style: none !important; } textarea { width: 100% !important; } </style> @if (TempData["Message"] != null) { <div class="container"> <div class="row"> <div class="col-md-12"> <br /> @Html.Partial("_Message", TempData["Message"]) </div> </div> </div> } @if (Model != null && !string.IsNullOrEmpty(Model.DepartmentFacultyName)) { <div class="container"> <div class="card" id="nodeToRenderAsPDF"> <div class="card-body" style="padding: 50px 20px;"> <div class="row"> <div class="col-xs-12 col-md-12"> <h2 class="text-center"> <img src="~/Content/Images/absu logo.png" style="width:80px;height:80px" /> </h2> <h3 class="text-center mb-5">ABIA STATE UNIVERSITY, UTURU</h3> <h4 class="text-center mt-5">SCHOOL OF POSTGRADUATE</h4> </div> <div class="col-xs-12 col-md-12"> <h3 class="text-center mb-5"> REFEREE'S CONFIDENTIAL REPORT ON A CANDIDATE FOR ADMISSION <br />TO HIGHER/POSTGRADUATE STUDIES </h3> </div> <div class="col-xs-12 col-md-10 offset-md-1 bb-black" style="padding-bottom: 30px !important;"> <p class="p-20"> The candidate whose name is given below wishes to undertake higher degree/postgraduate studies in this university. Your comments(which will be treated in the strictest confidence) on the candidate's suitability for the work, would be appreciated. Please return the completed form direct to the Secondary School of Postgraduate Studies, Abia State University, P.M.B 2000 Uturu, Abia State. </p> </div> <div class="col-xs-12 col-md-8 offset-md-2 mt-30 mb-10"> @using (Html.BeginForm("RefereeForm", "PostGraduateForm", FormMethod.Post, new { id = "frmPostJAMB", enctype = "multipart/form-data" })) { @*<form>*@ @Html.HiddenFor(m => m.ApplicantRefereeId) <ol class="no-list-bullet"> <li> <div class="form-group"> @Html.LabelFor(model => model.CandidateName, "Name of Candidate", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@Model.CandidateName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.DepartmentFacultyName, "Department/Faculty", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@Model.DepartmentFacultyName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.ProgrammeName, "Programme", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@Model.ProgrammeName</label> </div> </li> <li> <div class="form-group"> @Html.LabelFor(model => model.LengthOfFamiliarityTime, "Lenght Of Time Referee was familiar with the Candidate", new { @class = "control-label " }) <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@string.Format("{0} Year(s)", Model.LengthOfFamiliarityTime)</label> </div> </li> </ol> if (Model.ApplicantRefereeGradingResponses != null && Model.ApplicantRefereeGradingResponses.Count > 0) { <span class="help-block fs-16">Candidate Evaluation By Referee</span> <br /> <table class="table table-bordered"> <thead> <tr> <th></th> @for (int i = 0; i < Model.RefereeGradingSystems.Count; i++) { <th>@Model.RefereeGradingSystems[i].Score</th> } </tr> </thead> <tbody> @for (int i = 0; i < Model.RefereeGradingCategories.Count; i++) { <tr> <td>@Model.RefereeGradingCategories[i].GradeCategory</td> @for (int j = 0; j < Model.RefereeGradingSystems.Count; j++) { <td> @if (Model.ApplicantRefereeGradingResponses[i].RefereeGradingSystem.Id == Model.RefereeGradingSystems[j].Id) { <i class="fa fa-check"></i> } </td> } </tr> } </tbody> </table> } <ol class="no-list-bullet"> @if (!string.IsNullOrEmpty(Model.CandidateEligibity)) { <li> <div class="form-group"> <label class="control-label">Comment on the Candidate's Personality</label> <label class="text-uppercase" style="font-weight:400;padding: 5px 10px;border:1px solid #ddd;"> @Model.CandidateEligibity </label> </div> </li> } <li> <div class="form-group"> <label class="control-label">Would you accept the candidate as a graduate student?</label> <label style="font-weight:400;color:#344E86 !important;">@string.Format("{0}", Model.AcceptAsGraduateStudent ? "Yes" : "No")</label> </div> </li> <br /> @if (!string.IsNullOrEmpty(Model.OverallPromise)) { <li> <div class="form-group"> <label class="control-label">Please rate this applicant in overall promise</label> <label class="text-uppercase" style="font-weight:400;color:#344E86 !important;">@Model.OverallPromise</label> </div> </li> } @if (!string.IsNullOrEmpty(Model.CandidateSuitabilty)) { <li> <div class="form-group"> <label class="control-label">Relevant information to determine the candidate's suitability?</label> <label class="text-uppercase" style="font-weight:400;padding: 5px 10px;border:1px solid #ddd;"> @Model.CandidateSuitabilty </label> </div> </li> } <li> <div class="form-group"> <label class="control-label">Do you have any objections about the candidate's eligibity?</label> </div> </li> </ol> <div class="row" style="padding-left: 40px;"> <div class="col-md-12"> <div class="form-group"> <label for="name" class="control-label">FullName</label> <label style="font-weight:400;padding: 3px 15px;border:1px solid #ddd;"> @Model.RefereeFullName </label> </div> </div> </div> } </div> </div> </div> <div class="card-footer bg-white"> <div class="row"> <div class="col-xs-12 col-sm-6"> <button class="btn btn-primary btn-lg" type="button" name="submit" id="print"><i class="fa fa-print mr5"></i> Print</button> </div> <div class="col-xs-12 col-sm-6"> <h5 class="text-right"> <span class="fs-15">Powered by </span> <a href="http://lloydant.com" target="_blank"> <img src="~/Content/Images/lloydant.png" style="width: 40px; height:30px;" /> </a> </h5> </div> </div> </div> </div> </div> } <script src="~/Content/js/jquery.js"></script> <script src="~/Content/js/jsPdf.js"></script> <script src="~/Content/js/html2canvas.js"></script> <script type="text/javascript"> let image = ""; initDataURLs(); async function initDataURLs() { let container = document.querySelector('#nodeToRenderAsPDF'); const canvas = await html2canvas(container); image = canvas.toDataURL("image/png") } //html2canvas(container).then(function (canvas) { // image = canvas.toDataURL("image/png") // //var link = document.createElement("a"); // //document.body.appendChild(link); // //link.download = "html_image.png"; // //link.href = canvas.toDataURL("image/png"); // //link.target = '_blank'; // //link.click(); // }); document.querySelector("#print").addEventListener("click", (e) => { e.preventDefault(); const filename = 'Referal_Fillout.pdf'; let pdf = new jsPDF('p', 'mm', 'a4'); pdf.addImage(image, 'PNG', 0, 0, 211, 278); pdf.addPage(); pdf.save(filename); }); </script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.AdmissionProcessingViewModel @{ ViewBag.Title = "View Applicants Per Session"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <link href="~/Content/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <link href="~/Content/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/jquery-2.1.3.js"></script> <script src="~/Scripts/dataTables.js"></script> <script src="~/Content/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <script src="~/Content/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Content/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Content/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Content/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Content/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Content/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Content/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Content/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Content/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> let jqXHRData; let jqueryVersion = $.noConflict(true); jqueryVersion(document).ready(() => { jqueryVersion("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); }); </script> <div class="panel panel-default"> <div class="panel-body"> <section class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">APPLICANT LIST PER SESSION</p></h4> </div> @using (Html.BeginForm("ViewApplicantsPerSession", "AdmissionProcessing", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default"> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <cite><p class="custom-text-black"> Select the Session and Programme</p></cite> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control", required = true }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, "Programme", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control", required = true }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group "> @Html.LabelFor(model => model.DateFrom, "Start:", new { @class = "control-label custom-text-black date" }) @Html.TextBoxFor(model => model.DateFrom, new { @class = "form-control date", @id = "datafrom", @type = "date" }) @Html.ValidationMessageFor(model => model.DateFrom) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.DateTo, "End:", new { @class = "control-label custom-text-black date" }) @Html.TextBoxFor(model => model.DateTo, new { @class = "form-control date", @id = "datato", @type = "date" }) @Html.ValidationMessageFor(model => model.DateTo) </div> </div> </div> <div class="row"> <div class="col-md-8"> </div> <div class="col-sm-4" style="padding-top: 25px;"> <i class="glyphicon-upload"></i><input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </section> @if (Model.ApplicationSummaryReport != null && Model.ApplicationSummaryReport.Count() > 0) { <section class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div class="form-group"> <cite><p class="custom-text-black"> Download Selected Applicant Passports</p></cite> </div> </div> <div class="row"> <div class="col-sm-8"> @*<a class="btn btn-success mr5" id="ancDownloadFiles" href="@Html.AttributeEncode(Url.Action("DownloadFile", "AdmissionProcessing", new { Area = "Admin" }))"> Download Password </a>*@ @Html.ActionLink("Download Passports", "DownloadIdCardPassport", new { Controller = "AdmissionProcessing", Area = "Admin" }, new { @class = "btn btn-success mr5" }) </div> </div> </div> </section> } @if (Model.ApplicationSummaryReport == null) { return; } @if (Model.ApplicationSummaryReport != null) { <div class="col-md-12"> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th>SN</th> <th>Image</th> <th>Name</th> <th>Phone Number </th> <th>Application Number</th> <th>Programme</th> <th>Department</th> <th>Date Of Submission</th> </tr> </thead> <tbody style="color:black;"> @{ int N = 0; } @for (var i = 0; i < Model.ApplicationSummaryReport.Count; i++) { <tr> @{ N = i + 1; } <td>@N</td> <td style="word-break:break-all;"> @Html.DisplayTextFor(model => Model.ApplicationSummaryReport[i].ImageUrl) </td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].FullName)</td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].PhoneNo)</td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].ApplicationFormNo)</td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].Programme)</td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].Department)</td> <td>@Html.DisplayTextFor(model => model.ApplicationSummaryReport[i].ApplicationSubmittedOn)</td> </tr> } </tbody> </table> </div> } </div> </div> <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Web; using System.Web.Mvc; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ApplicantInformationReport :Page { private int reportType; private long studentId; protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { if(Request.QueryString["studentId"] != null && Request.QueryString["reportType"] != null) { studentId = Convert.ToInt64(Request.QueryString["studentId"]); reportType = Convert.ToInt32(Request.QueryString["reportType"]); BuildReport(studentId,reportType); } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void BuildReport(long studentId,int type) { try { var person = new Person { Id = studentId }; var studentLogic = new StudentLogic(); var reportData = new List<Model.Model.StudentReport>(); var OLevelDetail = new List<Model.Model.StudentReport>(); OLevelDetail = studentLogic.GetStudentOLevelDetail(person); reportData = studentLogic.GetStudentBiodata(person); string bind_dsStudentReport = "dsStudentReport"; string bind_dsStudentResult = "dsStudentResult"; string reportPath = ""; string returnAction = ""; if(type == 1) { reportPath = @"Reports\AbsuCertificateOfEligibility.rdlc"; } if(type == 2) { reportPath = @"Reports\AbsuCheckingCredentials.rdlc"; } if(type == 3) { reportPath = @"Reports\AbsuPersonalInfo.rdlc"; } if(type == 4) { reportPath = @"Reports\AbsuUnderTaking.rdlc"; } if(Directory.Exists(Server.MapPath("~/Content/studentReportFolder"))) { Directory.Delete(Server.MapPath("~/Content/studentReportFolder"),true); Directory.CreateDirectory(Server.MapPath("~/Content/studentReportFolder")); } else { Directory.CreateDirectory(Server.MapPath("~/Content/studentReportFolder")); } Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Student Information"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentReport.Trim(),reportData)); rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResult.Trim(),OLevelDetail)); byte[] bytes = rptViewer.LocalReport.Render("PDF",null,out mimeType,out encoding,out extension, out streamIds,out warnings); string path = Server.MapPath("~/Content/studentReportFolder"); string savelocation = ""; savelocation = Path.Combine(path,"StudentInformation.pdf"); File.WriteAllBytes(savelocation,bytes); var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect( urlHelp.Action("DownloadReport", new { controller = "Report", area = "Student", path = "~/Content/studentReportFolder/StudentInformation.pdf" }),false); //return File(Server.MapPath(savelocation), "application/zip", reportData.FirstOrDefault().Fullname.Replace(" ", "") + ".zip"); //Response.Redirect(savelocation, false); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel @{ var generatedSchoolFeesReceiptStatus = (int)ApplicantStatus.Status.GeneratedSchoolFeesReceipt; } <h5 class="mt-2">GENERATE SCHOOL FEES RECEIPT </h5> <hr/> <div class="container pl-0"> <div class="col-md-12 row pl-0"> <div class="form-group col-md-4 pl-0 ml-0"> @Html.LabelFor(model => model.SchoolFeesInvoiceNumber, new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-6 pl-0 ml-0"> <b> @Html.DisplayFor(model => model.SchoolFeesInvoiceNumber, new {@class = "form-control", @readonly = "readonly"})</b> </div> </div> <div class="form-group col-md-12 pl-0 ml-0"> @Html.LabelFor(model => model.SchoolFeesConfirmationOrderNumber, new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-12 pl-0 ml-0 text-bold"> @Html.TextBoxFor(model => model.SchoolFeesConfirmationOrderNumber, new { @class = "form-control ml-0" }) </div> </div> <div class="form-group col-md-12 pl-0 ml-0"> <div class="form-inline"> <div class="form-group"> <button class="btn btn-primary mr5" type="button" name="btnGenerateSchoolFeesReceipt" id="btnGenerateSchoolFeesReceipt" value="Next">Generate Receipt</button> </div> <div class="form-group margin-bottom-0"> <div id="divProcessingSchoolFeesReceipt" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> @*<br />*@ <div id="divGenerateSchoolFeesReceipt"></div> </div> </div> <div class="form-inline"> <div class="form-group margin-bottom-0 divSchoolFeesReceipt" style="display: none"> @Html.ActionLink("Print Receipt", "Receipt", new { ivn = Model.SchoolFeesInvoiceNumber, fid = Model.ApplicationForm.Id, st = generatedSchoolFeesReceiptStatus }, new { @class = "btn btn-primary btn-lg ", target = "_blank" }) @*@Html.ActionLink("Print Financial Clearance Slip", "FinancialClearanceSlip", "Credential", new { Area = "Common", pid = Abundance_Nk.Web.Models.Utility.Encrypt(Model.ApplicationForm.Person.Id.ToString()) }, new { @class = "btn btn-white btn-lg ", target = "_blank", id = "alFinancialClearanceSlip" })*@ @*<button class="btn btn-primary btn-lg" type="button" name="btnSchoolFeesReceiptNext" id="btnSchoolFeesReceiptNext">Next Step</button>*@ </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "Create Delivery Service"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @using (Html.BeginForm("CreateDeliveryService", "TranscriptProcessor", new { area = "admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <br /> <div class="panel panel-default"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body"> <h2 style="font-weight: 300; text-align: center">Create Delivery Service</h2> <hr /> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.DeliveryService.Name, "Name", new { @class = "control-label " }) @Html.TextBoxFor(model => model.DeliveryService.Name, new { @class = "form-control", required = true, @placeholder = "E.g DHL" }) @Html.ValidationMessageFor(model => model.DeliveryService.Name, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6 mt-5"> <div class="form-group"> @Html.LabelFor(model => model.DeliveryService.Description, "Description", new { @class = "control-label " }) @Html.TextBoxFor(model => model.DeliveryService.Description, new { @class = "form-control",}) @Html.ValidationMessageFor(model => model.DeliveryService.Description, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6" style="margin-top: 20px"> <div class="form-group"> @Html.CheckBoxFor(model => model.DeliveryService.Activated, new { @class = "", required = true,}) @Html.LabelFor(model => model.DeliveryService.Activated, "Activate", new { @class = "control-label " }) @Html.ValidationMessageFor(model => model.DeliveryService.Activated, null, new { @class = "text-danger" }) </div> </div> </div> <hr /> <div class="row"> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" value="Create" /> </div> </div> </div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Model.Model.PaymentHistory @{ Layout = null; ViewBag.Title = "Financial Clearance Slip"; } <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <br /> <div class="printable"> <div class="container"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null || Model.Student == null || Model.Payments == null) { return; } </div> <div class="row"> <div class="col-xs-6"> <div> <strong>@Model.Student.ApplicationForm.Person.FullName</strong><br> <abbr title="Phone">Email:</abbr> @Model.Student.ApplicationForm.Person.Email <br> <abbr title="Phone">Phone:</abbr> @Model.Student.ApplicationForm.Person.MobilePhone <br /> @if (!string.IsNullOrEmpty(Model.Student.MatricNumber)) { <span><b>Matric No.:</b>: @Model.Student.MatricNumber</span> } </div> </div><!-- col-sm-6 --> <div class="col-xs-6 text-right"> @*<h5 class="subtitle mb10">Invoice No.</h5> <h4 class="text-primary">@Model.Payment.InvoiceNumber</h4>*@ @*<h5 class="subtitle mb10">To</h5>*@ <div> <strong>The Federal Polytechnic, Ilaro</strong><br> P.M.B. 50, Ilaro, Ogun State.<br> </div> <br /> <p><strong>Invoice Date:</strong> @DateTime.Now.ToLongDateString()</p> </div> </div> <h3>FINANCIAL CLEARANCE SLIP</h3> <div> <table class="table table-bordered table-dark table-invoice"> <thead> <tr> <th> Item </th> <th> Bank </th> <th> Invoice No </th> <th> Receipt No </th> <th> Confirmation Order No </th> <th> Amount (₦) </th> @*<th> Date Paid </th>*@ </tr> </thead> @for (int i = 0; i < Model.Payments.Count; i++) { <tr> <td> @Html.DisplayFor(modelItem => Model.Payments[i].FeeTypeName) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].BankName) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].InvoiceNumber) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].ReceiptNumber) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].ConfirmationOrderNumber) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].Amount) </td> </tr> } </table> </div><!-- table-responsive --> <table class="table table-total"> <tbody> <tr> <td>Sub Total:</td> <td>@Model.Payments.Sum(p => p.Amount.Value).ToString("n")</td> </tr> <tr> <td>VAT:</td> <td>0.00</td> </tr> <tr> <td>TOTAL:</td> <td>@Model.Payments.Sum(p => p.Amount.Value).ToString("n")</td> </tr> </tbody> </table> </div><!-- panel-body --> </div><!-- panel --> </div> </div><file_sep><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaymentReceipt.aspx.cs" Inherits="Abundance_Nk.Web.PaymentReceipt" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div style="text-align: center;"> <% if(statuscode == "01" || statuscode == "00") { %> <h2>Transaction Successful</h2> <p><b>Remita Retrieval Reference: </b><% Response.Write(rrr); %></p> <p><b>Invoice / Reference: </b><% Response.Write(order_Id); %></p> <% } else if(statuscode == "021") { %> <h2>RRR Generated Successfully</h2> <p><b>Remita Retrieval Reference: </b><% Response.Write(rrr); %></p> <% } else { %> <h2>Your Transaction was not Successful</h2> <% if(rrr != null) { %> <p>Your Remita Retrieval Reference is <span><b><% Response.Write(rrr); %></b></span><br /> </p> <% } %> <p><b>Reason: </b><% Response.Write(message); %></p> <% } %> </div> </form> </body> </html><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class CourseRegistrationReport :Page { private List<Department> departments; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0 || SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } protected void ddlProgramme_SelectedIndexChanged1(object sender,EventArgs e) { try { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } catch(Exception) { throw; } } private void DisplayReportBy(Session session,Programme programme,Department department,Level level) { try { var courseRegistrationDetailLogic = new CourseRegistrationDetailLogic(); List<CourseRegistrationReportModel> report = courseRegistrationDetailLogic.GetCourseRegistrationBy(session,programme,department,level); string bind_dsCourseRegistration = "dsCourseRegistration"; string reportPath = @"Reports\CourseRegistrationReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Course Registration Report"; ReportViewer1.LocalReport.ReportPath = reportPath; if(report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsCourseRegistration.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void Display_Button_Click1(object sender,EventArgs e) { try { if(InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession,SelectedProgramme,SelectedDepartment,SelectedLevel); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } //protected void ddlSession_SelectedIndexChanged(object sender, EventArgs e) //{ // try // { // //Session session = new Session() { Id = Convert.ToInt32(ddlSession.SelectedValue) }; // //SemesterLogic semesterLogic = new SemesterLogic(); // //SessionSemesterLogic sessionSemesterLogic = new SessionSemesterLogic(); // //sessionSemesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); // //semesters = new List<Semester>(); // //foreach (SessionSemester item in sessionSemesterList) // //{ // // semesters.Add(item.Semester); // //} // ////SemesterLogic SemesterLogic = new SemesterLogic(); // ////semesters = SemesterLogic.GetAll(); // //Utility.BindDropdownItem(ddlSemester, semesters, Utility.ID, Utility.NAME); // //ddlSemester.Visible = true; // } // catch (Exception) // { // throw; // } //} protected void rbnDepartment_CheckedChanged(object sender,EventArgs e) { ddlLevel.Visible = false; } protected void rbnLevel_CheckedChanged(object sender,EventArgs e) { ddlLevel.Visible = true; } } }<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "E-Learning"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <h2>ViewContent</h2> @using (Html.BeginForm("AssignmentAddContent", "Elearning", new { area = "Admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>Test|Assignment Content Manager</h3> </div> <div class="panel-body"> @Html.HiddenFor(model => model.eAssignment.Course.Id) @Html.HiddenFor(model => model.CourseAllocation.Id) <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Assignment, "Assignment Topic", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.eAssignment.Assignment, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Assignment, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Instructions, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.eAssignment.Instructions, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Instructions, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.AssignmentinText, "Enter Test/Assignment Questions Directly ", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.eAssignment.AssignmentinText, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.AssignmentinText, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div> <fieldset> <legend>Due Date and Time</legend> <div class="form-group"> @Html.LabelFor(model => model.eAssignment.DueDate, "Date", new { @class = "col-sm-2 control-label" }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eAssignment.DueDate, new { @class = "form-control", require = true, type = "date", id = "fromDate" }) @Html.ValidationMessageFor(model => model.eAssignment.DueDate) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.startTime, "Time", new { @class = "col-sm-2 control-label" }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.startTime, new { @class = "form-control", require = true, type = "time", id = "fromTime" }) @Html.ValidationMessageFor(model => model.startTime) </div> </div> </fieldset> </div> @*<div class="form-group"> @Html.LabelFor(model => model.eAssignment.DueDate, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eAssignment.DueDate, new { @class = "form-control", type = "datetime-local" }) @Html.ValidationMessageFor(model => model.eAssignment.DueDate, null, new { @class = "text-danger" }) </div> </div>*@ &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.MaxScore, "Max Score", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.eAssignment.MaxScore, (IEnumerable<SelectListItem>)ViewBag.MaxGrade, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.MaxScore, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.Label("File", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="file" title="Upload Result" id="fileInput" name="file" class="form-control" /> </div> &nbsp; </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="Add Content" /> </div> </div> </div> </div> } @if (Model.EAssignmentList != null && Model.EAssignmentList.Count() > 0) { <div class="panel panel-danger"> <div class="table-responsive"> <table class="table-bordered table-hover table-striped table"> <tr> <th colspan="7">@Model.EAssignmentList.FirstOrDefault().Course.Code - @Model.EAssignmentList.FirstOrDefault().Course.Name</th> </tr> <tr> <th> S/N </th> <th> Assignment </th> <th> Date Set </th> <th> Due Date </th> <th> </th> <th> @Html.ActionLink("Report", "AverageElearningTestResult", "Elearning", new { Area = "Admin", cid = Utility.Encrypt(Model.EAssignmentList.FirstOrDefault().CourseAllocation.Id.ToString()) }, new { @class = "btn btn-primary " }) </th> <th> </th> </tr> @for (int i = 0; i < Model.EAssignmentList.Count(); i++) { var s = i + 1; <tr> <td> @s </td> <td> @Model.EAssignmentList[i].Assignment </td> <td> @Model.EAssignmentList[i].DateSet </td> <td> @Model.EAssignmentList[i].DueDate </td> <td> @Html.ActionLink("View Submissions", "AssignmentSubmission", "Elearning", new { Area = "Admin", AssignmentId = Utility.Encrypt(Model.EAssignmentList[i].Id.ToString()) }, new { @class = "btn btn-primary " }) </td> <td> @Html.ActionLink("Report on this Topic", "GetAssignmentList", "Elearning", new { Area = "Admin", eAssignmentId = Utility.Encrypt(Model.EAssignmentList[i].Id.ToString()) }, new { @class = "btn btn-secondary " }) </td> <td> @Html.ActionLink("Edit", "EditAssignment", "Elearning", new { Area = "Admin", eAssignmentId = Utility.Encrypt(Model.EAssignmentList[i].Id.ToString()) }, new { @class = "btn btn-info " }) </td> </tr> } </table> </div> </div> } <script> document.querySelector("#fileInput").addEventListener("change", (e) => { const fileEl = document.querySelector("#fileInput"); const file = e.target.files[0]; const fileType = file.type; const fileSize = file.size; if (fileSize > 1048576) { alert("File size is too much. Allowed size is 1MB") $("#fileInput").val(""); $("#fileInput").text(""); return false; } //If file type is Video, Return False; ask user to insert a youtube link if (fileType.split("/")[0] === "video") { alert("Videos are not allowed, enter a youtube link"); //Reset the file selector to application/pdf fileEl.setAttribute("accept", "application/pdf"); //Clear the inout type field $("#fileInput").val(""); $("#fileInput").text(""); //$('#videoUrl').show(); return false; } }) </script> <file_sep>@using GridMvc.Html @model IEnumerable<Abundance_Nk.Model.Entity.NEWS> @{ ViewBag.Title = "Index"; } <h2>News</h2> <p> @Html.ActionLink("Create New", "Create") </p> @Html.Grid(Model).Columns(columns => { columns.Add() .Encoded(false) .Sanitized(false) .RenderValueAs(d => @<div style="width: 65px"> <a href="@Url.Action("Edit", new {id = d.News_Id})" title="Edit"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> <a href="@Url.Action("Details", new {id = d.News_Id})" title="Details"> <img src="@Url.Content("~/Content/Images/list_icon3.png")" alt="Details" /> </a> <a href="@Url.Action("Delete", new {id = d.News_Id})" title="Delete"> <img src="@Url.Content("~/Content/Images/delete_icon.png")" alt="Delete" /> </a> </div>); columns.Add(f => f.Title).Titled("Title"); columns.Add(f => f.Description).Titled("Description"); columns.Add(f => f.Venue).Titled("Venue"); columns.Add(f => f.Date).Titled("Date").Format("{0:d}"); }).WithPaging(25) @*<div class="table-responsive"> <table class="table"> <tr> <th></th> <th> @Html.DisplayNameFor(model => model.Title) </th> <th> @Html.DisplayNameFor(model => model.Description) </th> <th> @Html.DisplayNameFor(model => model.Date) </th> <th> @Html.DisplayNameFor(model => model.Image_Title) </th> <th> @Html.DisplayNameFor(model => model.Venue) </th> </tr> @foreach (var item in Model) { <tr> <td> <div style="width:65px"> <a href="@Url.Action("Edit", new { id = item.News_Id })"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> <a href="@Url.Action("Details", new { id = item.News_Id })"> <img src="@Url.Content("~/Content/Images/details_icon.png")" alt="Details" /> </a> <a href="@Url.Action("Delete", new { id = item.News_Id })"> <img src="@Url.Content("~/Content/Images/delete_icon.png")" alt="Delete" /> </a> </div> </td> <td> @Html.DisplayFor(modelItem => item.Title) </td> <td> @Html.DisplayFor(modelItem => item.Description) </td> <td> @Html.DisplayFor(modelItem => item.Date) </td> <td> @Html.DisplayFor(modelItem => item.Image_Title) </td> <td> @Html.DisplayFor(modelItem => item.Venue) </td> </tr> } </table> </div>*@<file_sep>@model Abundance_Nk.Web.Models.LoginViewModel @{ ViewBag.Title = "Portal Home"; Layout = "~/Views/Shared/_IndexPageLayout.cshtml"; } <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery-ui.min.js"></script> <style> .Design1 { min-height: 279px; } .btn-warning { font-weight:500; } </style> <div class="container-fluid pl-5 pr-5"> <div class="row mt-5" style="min-height: 510px;"> @*<div class="col-md-8 col-sm-12 hidden-md-down"> <div class="col-md-6"> <div class="card shadow p-4"> <div class="card-body"> <h5>Students Portal</h5> <div class="separator separator-primary"></div> “Preparing to succeed in an era of global uncertainty requires developing your intellect, building your character, and learning pratical capabilities”. </div> </div> </div> </div>*@ @if (!Request.IsAuthenticated) { <div class="col-lg-5 col-md-8 col-sm-12 " id="pablo1"> <div class="card bg-primary-opacity p-4"> <h5 class="text-white" style="font-size:19px">WELCOME TO THE UNIVERSITY OF PORT-HARCOURT</h5> <hr /> @*<div class="separator01 separator-primary"></div>*@ @using (Html.BeginForm("Login", "Account", new {Area = "Security", ReturnUrl = ViewBag.ReturnUrl}, FormMethod.Post)) { <h4 class="text-white" style="font-size:16px">Pursuit of academic excellence, advancement of knowledge and community service through quality teaching , life-long learning, social inclusion, strengthening civil society and policy-relevant research that addresses the challenges of contemporary society</h4> <small class="text-white">– Our Mission</small> @*@Html.AntiForgeryToken() <div class="form-group"> <div class="col-md-12 p-0"> @Html.LabelFor(model => model.UserName, new {@class = "control-label text-white"}) @Html.TextBoxFor(m => m.UserName, new {@class = "form-control", placeholder = "2016/1111111", required = "required", type = "text"}) @Html.ValidationMessageFor(m => m.UserName) </div> </div> <div class="form-group"> <div class="col-md-12 p-0"> @Html.LabelFor(model => model.Password, new {@class = "control-label text-white"}) @Html.PasswordFor(m => m.Password, new {@class = "form-control", placeholder = "*******", type = "password", required = "required"}) @Html.ValidationMessageFor(m => m.Password) </div> </div> <div class="form-group pl-1 mt-5"> <button class="btn btn-warning btn-block font-weight-bolder" type="submit">LOGIN</button> </div>*@ } </div> </div> } </div> </div> @*<div class="container-fluid Design1 m-0"> </div>*@ <div class="container pt-5 pb-1"> <div class="row statement mb-5"> <div class="col-md-6 col-lg-4 text-center"> <div class="card student1"> <div class="blu-tp p-4"> <a href="#" class="Toplink"> @*<img src="~/Content/assets/img/prospectiveStu.svg" class="mb-4" alt="prospective student" height="60px" />*@ <h5 class="text-white">PROSPECTIVE STUDENT</h5> </a> <div class="card-block p-0 text-white" style="min-height:100px;"> To Apply for a programme, generate an invoice and take to any of the designated banks for payment </div> @Html.ActionLink("APPLICATION FORMS", "PostJambFormInvoiceGeneration", "Form", new { Area = "Applicant" }, new { @class = "btn btn-warning btn-block" }) </div> </div> </div> <div class="col-md-6 col-lg-4 text-center"> <div class="card student2"> <div class="blu-tp p-4"> <a href="#" class="Toplink"> @*<img src="~/Content/assets/img/newStudent.svg" class="mb-4" alt="New student" height="60px" />*@ <h5 class="text-white">NEW STUDENT</h5> </a> <div class="card-block p-0 text-white" style="min-height:100px;"> To check your admission status, Pay acceptance fees &amp; school fees or register your courses, click link below </div> <a href="#" class="btn btn-warning btn-block">NEW STUDENT GUIDE</a> </div> </div> </div> <div class="col-md-6 col-lg-4 text-center"> <div class="card student3"> <div class="blu-tp p-4"> <a href="#" class="Toplink"> @*<img src="~/Content/assets/img/returningStu.svg" class="mb-4" alt="returning student" height="60px" />*@ <h5 class="text-white">RETURNING STUDENT</h5> </a> <div class="card-block p-0 text-white" style="min-height:100px;"> Returning students can generate fees invoice, print receipts e.t.c </div> @Html.ActionLink("RETURNING STUDENT", "Index", "Payment", new { Area = "Student" }, new { @class = "btn btn-warning btn-block" }) </div> </div> </div> @*<div class="col-md-6 col-lg-3 text-center"> <div class="card student4"> <div class="blu-tp p-4"> <a href="#" class="Toplink"> <img src="~/Content/assets/img/semesterResu.svg" class="mb-4" alt="SEMESTER RESULTS" height="60px" /> <h5 class="text-white">SEMESTER RESULTS</h5> </a> <div class="card-block p-0 text-left text-white" style="min-height:100px;"> To check Semester results status, please use the button below. </div> @Html.ActionLink("CHECK SEMESTER RESULT", "Check", "Result", new { Area = "Student" }, new { @class = "btn btn-warning btn-block" }) </div> </div> </div>*@ </div> </div> <div class="container-fluid pt-5 pb-5 Design2"> <div class="container"> <div class="row justify-content-center"> <div class="col-md-7 col-sm-12 pt-1 text-center"> <span class="font-1 text-center"><b>ARE YOU EXPERIENCING ANY DIFFICULTIES OR ISSUES?</b></span><br /> <b>CALL:</b> 07088391544 or 090838920222<br /> <b>EMAIL SUPPORT:</b> <EMAIL> </div> </div> </div> </div> @*<div class="container-fluid blueBg"> <div class="row bg-primary-opacity"> <div class="col-md-4 col-sm-12 text-white pt-5 pb-4"> <h5>EMPLOYEE EXTERNAL LINKS</h5> <div class="separator separator-primary"></div> <ul> <li>Administrative Guide</li> <li>Faculty &amp; Staff Help center</li> <li>Services</li> </ul> </div> <div class="col-md-4 col-sm-12 text-white pt-5 pb-4"> <h5>ACADEMIC EXTERNAL LINKS </h5> <div class="separator separator-primary"></div> <ul> <li>Explore Courses </li> <li>Student services center</li> <li>Explore Degrees</li> </ul> </div> <div class="col-md-4 col-sm-12 bg-warning p-5"> <h5 class="mb-0">ABIA STATE UNIVERSITY</h5> <sub>UTURU</sub> <br /><br /> <h6>BRIEF HISTORY</h6> As a foremost state University in Nigeria founded in 1981, Abia State University has maintained its leadership within and beyond the Eastern heartlands of Nigeria. </div> </div> </div>*@ <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class CarryOverCourse :Page { private string courseId; private string departmentId; private string levelId; private string programmeId; private string semesterId; private string sessionId; protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(Request.QueryString["departmentId"] != null && Request.QueryString["programmeId"] != null && Request.QueryString["sessionId"] != null && Request.QueryString["levelId"] != null && Request.QueryString["semesterId"] != null && Request.QueryString["courseId"] != null) { departmentId = Request.QueryString["departmentId"]; programmeId = Request.QueryString["programmeId"]; sessionId = Request.QueryString["sessionId"]; levelId = Request.QueryString["levelId"]; semesterId = Request.QueryString["semesterId"]; courseId = Request.QueryString["courseId"]; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void Button1_Click(object sender,EventArgs e) { int departmentIdNew = Convert.ToInt32(departmentId); int programmeIdNew = Convert.ToInt32(programmeId); int sessionIdNew = Convert.ToInt32(sessionId); int levelIdNew = Convert.ToInt32(levelId); int semesterIdNew = Convert.ToInt32(semesterId); int courseIdNew = Convert.ToInt32(courseId); BuildCarryOverCourseList(departmentIdNew,programmeIdNew,levelIdNew,sessionIdNew,courseIdNew, semesterIdNew); } private void BuildCarryOverCourseList(int departmentId,int programmeId,int levelId,int sessionId, int courseId,int semesterId) { try { var department = new Department { Id = departmentId }; var programme = new Programme { Id = programmeId }; var level = new Level { Id = levelId }; var session = new Session { Id = sessionId }; var course = new Course { Id = courseId }; var semester = new Semester { Id = semesterId }; var courseRegistrationLogic = new CourseRegistrationLogic(); List<CarryOverReportModel> carryOverCourseList = courseRegistrationLogic.GetCarryOverCourseList( session,semester,programme,department,level,course); string bind_dsCarryOverCourseList = "dsCarryOverCourseList"; string reportPath = @"Reports\CarryOverCourseReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Carry Over Report"; ReportViewer1.LocalReport.ReportPath = reportPath; if(carryOverCourseList != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsCarryOverCourseList.Trim(), carryOverCourseList)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI.WebControls; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AbiaStateIndigenesReport : System.Web.UI.Page { private List<Department> departments; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlDepartment, Utility.GetAllDepartments(), Utility.ID, Utility.NAME); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } private bool InvalidUserInputForBulk() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } private void DisplayReportBy(Department department, Session session) { try { var studentLogic = new StudentLogic(); List<Model.Model.Result> report = studentLogic.GetAbuaStateIndigenesRecord(session,department.Id ); string bind_dsMasterSheet = "dsMasterSheet"; string reportPath = ""; reportPath = @"Reports\IndigeneReport.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "List Of Indigene For" + session.Name + " Session"; rv.LocalReport.ReportPath = reportPath; if (report != null) { report.FirstOrDefault().SessionName = session.Name; report.FirstOrDefault().DepartmentName = department.Name; rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsMasterSheet.Trim(), report)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedDepartment, SelectedSession); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void btnBulkReport_Click(object sender, EventArgs e) { try { if (InvalidUserInputForBulk()) { lblMessage.Text = "You are required to select session"; return; } BulkOperations(SelectedSession); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public void BulkOperations(Session session) { try { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string downloadPath = "/Content/tempIndigene/"; string downloadPathZip = "/Content/tempIndigene/IndigeneDetailReport_" + SelectedSession.Name.Replace("/", "_") + ".zip"; if (Directory.Exists(Server.MapPath(downloadPath))) { Directory.Delete(Server.MapPath(downloadPath), true); Directory.CreateDirectory(Server.MapPath(downloadPath)); } else { Directory.CreateDirectory(Server.MapPath(downloadPath)); } if (Directory.Exists(Server.MapPath(downloadPathZip))) { Directory.Delete(Server.MapPath(downloadPath), true); } var departmentLogic = new DepartmentLogic(); List<Department> departments = departmentLogic.GetAll(); foreach (Department deptDepartment in departments) { var studentLogic = new StudentLogic(); List<Model.Model.Result> report = studentLogic.GetAbuaStateIndigenesRecord(session, deptDepartment.Id); if (report.Count > 0) { string bind_dsMasterSheet = "dsMasterSheet"; string reportPath = ""; reportPath = @"Reports\IndigeneReport.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "List Of Indigene For" + session.Name + " Session"; rv.LocalReport.ReportPath = reportPath; if (report != null) { report.FirstOrDefault().SessionName = session.Name; report.FirstOrDefault().DepartmentName = deptDepartment.Name; rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsMasterSheet.Trim(), report)); rv.LocalReport.Refresh(); } byte[] bytes = rv.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string name = deptDepartment.Code.Replace(" ", "") + "_" + SelectedSession.Name.Replace("/", "_"); string path = Server.MapPath(downloadPath); string savelocation = Path.Combine(path, name + ".pdf"); if (File.Exists(savelocation)) { File.Delete(savelocation); } File.WriteAllBytes(savelocation, bytes); } } using (var zip = new ZipFile()) { string file = Server.MapPath(downloadPath); zip.AddDirectory(file, ""); string zipFileName = "IndigeneDetailReport_" + SelectedSession.Name.Replace("/", "_"); zip.Save(file + zipFileName + ".zip"); string export = downloadPath + zipFileName + ".zip"; //Response.Redirect(export, false); var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect( urlHelp.Action("DownloadIndigeneZip", new { controller = "StaffCourseAllocation", area = "Admin", downloadName = zipFileName }), false); } } catch (Exception ex) { throw ex; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "CreateHostelRooms"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#Hostel").change(function () { $("#Series").empty(); var hostel = $("#Hostel").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetHostelSeries", "HostelAllocation")', // we are calling json method dataType: 'json', data: { id: hostel }, success: function (series) { $("#Series").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(series, function (i, Option) { $("#Series").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve hostel series.' + ex); } }); }); }); function ReserveAll() { if ($('#ReserveAllId').is(':checked')) { $('.Reserve').prop('checked', true); } else { $('.Reserve').prop('checked', false); } } function checkAllNumber(model, id) { var myId = "row" + id; if (model.checked) { $("." + myId).prop('checked', true); } else { $("." + myId).prop('checked', false); } } function ActivateAll() { if ($('#ActivateAllId').is(':checked')) { $('.Activate').prop('checked', true); } else { $('.Activate').prop('checked', false); } } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="row"> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Rooms Setup</h4> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> @using (Html.BeginForm("CreateHostelRooms", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoom.Hostel.Id, "Select Hostel: ", new { @class = "control-label col-md-4" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.HostelRoom.Hostel.Id, (IEnumerable<SelectListItem>)ViewBag.HostelId, new { @class = "form-control", @required = "required", @Id = "Hostel" }) @Html.ValidationMessageFor(model => model.HostelRoom.Hostel.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoom.Series.Id, "Select Series/Floor: ", new { @class = "control-label col-md-4" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.HostelRoom.Series.Id, (IEnumerable<SelectListItem>)ViewBag.HostelSeriesId, new { @class = "form-control", @required = "required", @Id = "Series" }) @Html.ValidationMessageFor(model => model.HostelRoom.Series.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoom.RoomCapacity, "Number Of Rooms: ", new { @class = "control-label col-md-4" }) <div class="col-md-6"> @Html.TextBoxFor(model => model.HostelRoom.RoomCapacity, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelRoom.RoomCapacity, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.HostelRoom.Corners, "Number Of Bed Spaces: ", new { @class = "control-label col-md-4" }) <div class="col-md-6"> @Html.TextBoxFor(model => model.HostelRoom.Corners, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelRoom.Corners, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-4 col-md-6"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } </div> </div> </div> </div> @if (Model.RoomSettings != null && Model.RoomSettings.Count > 0) { using (Html.BeginForm("SaveRooms", "HostelAllocation", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <table class="table table-bordered table-hover table-striped" id="docTable"> <tr> <th>Room Number</th> <th><input type="checkbox" id="ReserveAllId" onclick="ReserveAll()" /> Reserved</th> <th><input type="checkbox" id="ActivateAllId" onclick="ActivateAll()" /> Room Activation</th> @foreach (var corner in Model.RoomSettings[0].HostelRoomCorners) { <th>Bed Space @corner.Name</th> } </tr> @for (int i = 0; i < Model.RoomSettings.Count; i++) { var myId = i; <tr id="row"> @Html.HiddenFor(model => model.RoomSettings[i].HostelRoom.Number) @Html.HiddenFor(model => model.HostelRoom.Series.Id) @Html.HiddenFor(model => model.HostelRoom.Hostel.Id) <td>@Model.RoomSettings[i].HostelRoom.Number <input type="checkbox" id="CheckAllNumberId" onchange="checkAllNumber(this,@myId)" /></td> <td>@Html.CheckBoxFor(model => model.RoomSettings[i].HostelRoom.Reserved, new { @type = "checkbox", @class = "Reserve" })</td> <td>@Html.CheckBoxFor(model => model.RoomSettings[i].HostelRoom.Activated, new { @type = "checkbox", @class = "Activate" })</td> @for (int j = 0; j < Model.RoomSettings[i].HostelRoomCorners.Count; j++) { var className = "row" + i; <td>@Html.CheckBoxFor(model => model.RoomSettings[i].HostelRoomCorners[j].Activated, new { @type = "checkBox", @class = @className })</td> @Html.HiddenFor(model => model.RoomSettings[i].HostelRoomCorners[j].Name) } </tr> } </table> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input type="submit" value="Save" class="btn btn-success" /> </div> </div> </div> </div> </div> </div> </div> } } </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.CourseViewModel @{ ViewBag.Title = "ViewStudentCourses"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-2.1.3.js"></script> <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script type="text/javascript"> $(document).ready(function() { }); function AllSelected() { if ($('#AllSelectedId').is(':checked')) { $('.SelectAll').prop('checked', true); } else { $('.SelectAll').prop('checked', false); } } function AllCarryOver() { if ($('#AllCarryOverId').is(':checked')) { $('.AllCarryOver').prop('checked', true); } else { $('.AllCarryOver').prop('checked', false); } } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Student Courses</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("ViewStudentCourses", "Courses", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, "Matric Number: ", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session: ", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.level.Name, "Level: ", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-6"> <input type="submit" value="View" class="btn btn-success" /> </div> </div> </div> } </div> </div> </div> @if (Model.Courses != null && Model.Courses.Count > 0) { using (Html.BeginForm("SaveStudentCourses", "Courses", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> <blockquote><i>NB: Checked Courses are registered courses</i></blockquote> <div class="row"> <div class="col-md-12"> <table class="table table-bordered table-hover table-striped"> <tr> <th>Course Code</th> <th>Course Name</th> <th>Semester</th> <th><input type="checkbox" id="AllSelectedId" onclick=" AllSelected() " /> Select Course</th> <th><input type="checkbox" id="AllCarryOverId" onclick=" AllCarryOver() " /> Carry Over Course</th> </tr> @for (int i = 0; i < Model.Courses.Count; i++) { <tr> @Html.HiddenFor(model => model.Courses[i].Id) @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.CourseRegistration.Id) <td>@Model.Courses[i].Code</td> <td>@Model.Courses[i].Name</td> <td>@Model.Courses[i].Semester.Name</td> <td>@Html.CheckBoxFor(model => model.Courses[i].IsRegistered, new {@type = "checkbox", @class = "SelectAll"})</td> <td>@Html.CheckBoxFor(model => model.Courses[i].isCarryOverCourse, new {@type = "checkbox", @class = "AllCarryOver"})</td> </tr> } </table> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input type="submit" value="Save" class="btn btn-success" /> </div> </div> </div> </div> </div> </div> </div> } } </div> <div class="col-md-1"></div> </div><file_sep>@using Abundance_Nk.Model.Model @model DateTime @{ var january = new Value {Id = 1, Name = "January"}; var february = new Value {Id = 1, Name = "February"}; var march = new Value {Id = 1, Name = "March"}; var april = new Value {Id = 1, Name = "April"}; var may = new Value {Id = 1, Name = "May"}; var june = new Value {Id = 1, Name = "June"}; var july = new Value {Id = 1, Name = "July"}; var august = new Value {Id = 1, Name = "August"}; var september = new Value {Id = 1, Name = "September"}; var october = new Value {Id = 1, Name = "October"}; var november = new Value {Id = 1, Name = "November"}; var december = new Value {Id = 1, Name = "December"}; var months = new List<Value> { january, february, march, april, may, june, july, august, september, october, november, december }; var monthList = new List<SelectListItem>(); var list = new SelectListItem(); list.Value = ""; list.Text = ""; monthList.Add(list); foreach (Value month in months) { var selectList = new SelectListItem(); selectList.Value = month.Id.ToString(); selectList.Text = month.Name; monthList.Add(selectList); } } <div class="form-inline"> <div class="form-group"> @Html.DropDownListFor(m => m.Month, (IEnumerable<SelectListItem>) ViewBag.MonthId, new {@class = "form-control"}) </div> <div class="form-group"> @Html.DropDownListFor(m => m.Day, (IEnumerable<SelectListItem>) ViewBag.DayId, new {@class = "form-control"}) </div> <div class="form-group"> @Html.DropDownListFor(m => m.Year, (IEnumerable<SelectListItem>) ViewBag.YearId, new {@class = "form-control"}) </div> </div><file_sep>@model IEnumerable<Abundance_Nk.Model.Entity.DEGREE_AWARDS_BY_PROGRAMME_DEPARTMENT> @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @section Scripts { @*<script src="~/Scripts/jquery-3.1.1.min.js"></script>*@ <script type="text/javascript" src="~/Scripts/DataTables/datatables.js"></script> <script src="~/Scripts/DataTables/DataTables-1.10.15/js/jquery.dataTables.min.js"></script> <link href="~/Scripts/DataTables/datatables.css" rel="stylesheet" /> <link href="~/Scripts/DataTables/DataTables-1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" /> <script src="~/Scripts/DataTables/Buttons-1.3.1/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables/JSZip-3.1.3/jszip.min.js"></script> <script src="~/Scripts/DataTables/pdfmake-0.1.27/build/pdfmake.js"></script> <script src="~/Scripts/DataTables/pdfmake-0.1.27/build/vfs_fonts.js"></script> <script src="~/Scripts/DataTables/Buttons-1.3.1/js/buttons.print.min.js"></script> <script src="~/Scripts/DataTables/Buttons-1.3.1/js/buttons.html5.min.js"></script> <script> $(document).ready(function () { // $('table.table-striped').DataTable(); $('table.table-striped').DataTable({ dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ] }); }); </script> } <div class="row"> <p> @Html.ActionLink("Create New", "Create",null,new{@class="btn btn-primary"}) </p> <table class="table table-striped"> <tr> <th> @Html.DisplayNameFor(model => model.Degree_Name) </th> <th> @Html.DisplayNameFor(model => model.Duration) </th> <th> @Html.DisplayNameFor(model => model.DEPARTMENT.Department_Name) </th> <th> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Degree_Name) </td> <td> @Html.DisplayFor(modelItem => item.Duration) </td> <td> @Html.DisplayFor(modelItem => item.DEPARTMENT.Department_Name) </td> <td> @Html.DisplayFor(modelItem => item.PROGRAMME.Programme_Name) </td> <td> @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | @Html.ActionLink("Details", "Details", new { id=item.Id }) | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) </td> </tr> } </table> </div> <file_sep> @model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGViewModel @{ //Layout = null; } <div class="panel panel-default p-4"> <div class="col-md-12"> <div class="panel-heading"> <div style="font-size: x-large">Tertiary Education</div> </div> <hr> <br /> <div class="panel-body"> <div class="col-md-12"> @Html.HiddenFor(model => model.PreviousEducation.Id) <div class="panel-body"> <!--Enable filling of previous Tertiary academic records--> <div class="table-responsive"> <table id="tertiaryTable" class="table table-condensed" style="background-color: whitesmoke"> <thead> <tr> <th> Institution Name </th> <th> Course Of Study </th> <th> Qualification </th> <th> Class of Degree </th> <th> Admission Year </th> <th> Graduation Year </th> </tr> </thead> <tbody> @for (int i = 0; i < 5; i++) { <tr> <td> @Html.TextBoxFor(model => model.ApplicantPreviousEducations[i].SchoolName, new { @class = "form-control" }) </td> <td> @Html.TextBoxFor(model => model.ApplicantPreviousEducations[i].Course, new { @class = "form-control" }) </td> <td> @Html.DropDownListFor(model => model.ApplicantPreviousEducations[i].Qualification.Id, (IEnumerable<SelectListItem>)ViewBag.QualificationId, new { @class = "form-control" }) </td> <td> @Html.DropDownListFor(model => model.ApplicantPreviousEducations[i].ResultGrade.Id, (IEnumerable<SelectListItem>)ViewBag.ResultGradeId, new { @class = "form-control" }) </td> <td> @Html.DropDownListFor(model => model.ApplicantPreviousEducations[i].StartYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartYearId, new { @class = "form-control pl-2 mr-0" }) </td> <td> @Html.DropDownListFor(model => model.ApplicantPreviousEducations[i].EndYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndYearId, new { @class = "form-control pl-2 mr-0" }) </td> </tr> } </tbody> </table> </div> @*<div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, "Last Institution Attended", new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Course, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black">Start Date <span id="spSDate" style="color: green; display: none; font-weight: bold;">...Loading</span></div> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartYearId, new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartMonthId, new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartDayId, new { @class = "form-control" }) <div> <div class="form-group"> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black">End Date <span id="spEDate" style="color: green; display: none; font-weight: bold;">...Loading</span></div> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndYearId, new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndMonthId, new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndDayId, new { @class = "form-control" }) <div> <div class="form-group"> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id, (IEnumerable<SelectListItem>)ViewBag.QualificationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new { @class = "control-label" }) @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id, (IEnumerable<SelectListItem>)ViewBag.ResultGradeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id, (IEnumerable<SelectListItem>)ViewBag.ITDurationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> <label style="color:red">Were you a previous ABSU Student with valid Matric No?</label> <input type="checkbox" value="Yes" id="wasMatricStudent" /> </div> <div class="form-group" id="absuMatricno" style="display:none"> @Html.LabelFor(model => model.PreviousEducation.MatricNumber, "ABSU UNDERGRADUATE MATRIC NO.", new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.MatricNumber) </div> </div> <div class="col-md-6"> </div> </div>*@ </div> </div> </div> </div> </div><file_sep>@using Abundance_Nk.Model.Model @using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <h3>Next of Kin Details</h3> <div class="row"> <div class="well"> <div class="form-group "> @Html.LabelFor(model => model.Sponsor.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Sponsor.Name,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.Name) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Sponsor.ContactAddress,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Sponsor.ContactAddress,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.ContactAddress) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Sponsor.Relationship.Id,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.Sponsor.Relationship.Id,(IEnumerable<SelectListItem>)ViewBag.RelationshipId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.Relationship.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Sponsor.MobilePhone,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Sponsor.MobilePhone,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.MobilePhone) </div> </div> <div class="form-group "> <div class="col-sm-3 "></div> <div class="col-sm-9 "> <div class="form-inline"> <div class="form-group"> <button class="btn btn-primary btn-metro mr5" type="button" value="Next">Next</button> </div> <div class="form-group margin-bottom-0"> <div style="display: none"> </div> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="container"> <div class="col-md-12 card p-5"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Transcript Requests</h4> </div> <div class="panel-body"> <div class="col-md-12"> <table class="table table-bordered table-hover table-striped"> <tr> <th>Name</th> <th>Reg. NO</th> <th>Date Requested</th> <th>Dest. Address</th> <th>Dest. State</th> <th>Dest. Country</th> <th>Invoice Generated ?</th> <th>Request Type</th> <th></th> </tr> @for (int i = 0; i < @Model.TranscriptRequests.Count; i++) { <tr> <td>@Model.TranscriptRequests[i].student.FullName</td> <td>@Model.TranscriptRequests[i].student.MatricNumber</td> <td>@Model.TranscriptRequests[i].DateRequested</td> <td>@Model.TranscriptRequests[i].DestinationAddress</td> <td>@Model.TranscriptRequests[i].DestinationState.Name</td> <td>@Model.TranscriptRequests[i].DestinationCountry.CountryName</td> @if (Model.TranscriptRequests[i].payment != null) { <td> Yes </td> <td>@Model.TranscriptRequests[i].payment.FeeType.Name</td> } else { <td> No </td> } @if (Model.TranscriptRequests[i].payment != null) { <td>@Html.ActionLink("Continue", "TranscriptPayment", new { tid = @Model.TranscriptRequests[i].Id }, new { @class = "btn btn-success" })</td> } else { <td>@Html.ActionLink("Make Payment", "TranscriptPayment", new { tid = @Model.TranscriptRequests[i].Id }, new { @class = "btn btn-success" })</td> } </tr> } </table> <br /> <div class="col-md-12"> @Html.ActionLink("Make Request", "Request", new { sid = @Model.TranscriptRequests.FirstOrDefault().student.Id }, new { @class = "btn btn-success" }) </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "E-Learning Assignment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <h2>ViewContent</h2> @using (Html.BeginForm("EditAssignment", "Elearning", new { area = "Admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="card"> <div class="card-header"> <h3 class="card-title"><i class="fa fa-fw fa-download"></i>Edit Test|Assignment Module</h3> </div> <div class="card-body"> @Html.HiddenFor(model => model.eAssignment.Id) <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Assignment, "Assignment Topic", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.eAssignment.Assignment, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Assignment, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.Instructions, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.eAssignment.Instructions, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.eAssignment.Instructions, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eAssignment.DueDate, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eAssignment.DueDate, new { @class = "form-control", @type = "datetime-local" }) @Html.ValidationMessageFor(model => model.eAssignment.DueDate, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.Label("File", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="file" title="Upload Result" id="file" name="file" class="form-control" /> </div> &nbsp; </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="Add Content" /> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Model.Entity.PROGRAMME_DEPARTMENT @{ ViewBag.Title = "Details"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Details</h2> <div> <h4>PROGRAMME_DEPARTMENT</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.DEPARTMENT.Department_Name) </dt> <dd> @Html.DisplayFor(model => model.DEPARTMENT.Department_Name) </dd> <dt> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </dt> <dd> @Html.DisplayFor(model => model.PROGRAMME.Programme_Name) </dd> </dl> </div> <p> @Html.ActionLink("Edit", "Edit", new { id = Model.Programme_Department_Id }) | @Html.ActionLink("Back to List", "Index") </p> <file_sep>@using Abundance_Nk.Web.Models @using ZXing.QrCode.Internal @model Abundance_Nk.Model.Model.AdmissionLetter @{ Layout = null; ViewBag.Title = "Admission Letter"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <div class="container"> <div class="row"> </div> <div class="row"> <div class="col-md-12"> <div class="col-md-2"> <img class="pull-left" src="@Url.Content("~/Content/Images/school_logo.jpg")" width="100px" height="100px" /> </div> <div class="col-md-10"> <div class="row"> <h3>ABIA STATE UNIVERSITY, UTURU</h3> <div class="pull-left"> <p class="text-capitalize"> p.m.b 2000 <br /> Uturu <br /> Abia state, nigeria </p> </div> <div class="pull-right"> <p> website: www.abiastateuniversity.edu.ng <br /> email: <EMAIL> <br /> phone: 0803-681-1454; 0805-261-0681 </p> </div> </div> </div> </div> </div> <hr /> <div> <div class="col-md-12"> <div class="row pull-left"> <b>Vice Chancellor:</b> <br /> Professor <NAME> <cite>OD, MHA, PhD, FNCO, FNOA, FWASH</cite> <br /> </div> </div> </div> <div class="row"> <div class="col-md-12 text-center"> <br/> <p class="text-center"> <h4><strong>SCHOOL OF POSTGRADUATE STUDIES</strong> </h4> </p> </div> </div> <div class="row"> <div class="col-md-12 text-justify"> <p> Dean: Professor <NAME><br /> Our Ref: ABSU/SPGS/01/IV<br /><br /> </p> </div> </div> <div class="row"> <div class="col-md-12 text-justify"> <p> <strong>@Model.Person.FullName</strong> <br /><br /> Dear @Model.Person.LastName ,<br /> </p> <div class="col-md-12 text-center"> <p class="text-center"> <h4 class="sectitle"><strong>NOTIFICATION OF ADMISSION INTO POSTGRADUATE PROGRAMME</strong> </h4> </p> </div> </div> </div> <p> <ol> <li> I have the pleasure to inform you that your application for admission into the postgraduate programme of Abia State University is successful. You have been offered provisional Admission to pursue a @Model.Programme.Description programme leading to the award of @Model.DegreeAwarded.Degree @Model.DegreeAwarded.Department.Name with effect from the @Model.Session.Name.ToUpper() academic session</li> <li> The programme shall involve course work and a comprehensive research Dissertation/Project report for a minimum of <strong>@Model.DegreeAwarded.Duration</strong> months</li> <li> If the offer is acceptable to you, please complete the acceptance letter on payment of <strong>60,000</strong> non-refundable deposit, not later than one month after which the offer of admission shall be deemed to have lapsed. Please remember to attach to the acceptance letter a copy of the Bursary receipt for the payment of the non-refundable deposit</li> <li> Confirmation of this offer is subject to your possession of the university minimum university entry requirements as well as the specific requirements for the course of study to which you have been offered admission. Information relating to registration and commencement of lectures are obtainable from the secretary, School Of Postgraduate Studies</li> <li> You are required to present the originals of your certificates on which this offer of admission has been based during registration. If it is discovered that any time that you do not possess any of the qualifications which you claim, or have misled the university into making this offer to you, you will be required to withdraw from the university.</li> <li> Information relating to school fees, accommodation, medical report, screening of certificates and submission of letter of release from your employer is obtainable from the secretary, School Of Postgraduate Studies</li> <li> On behalf of the Dean and the Board of the school of Postgraduate studies, please accept our congratulations</li> </ol> </p> <p> Yours Faithfully </p> <p class="pull-left"> <img src=@Url.Content("~/Content/Images/pg_registrar.png") alt="" style="max-height: 50px" /> <br /> <strong>Egbo Ejike</strong> <em>B.A(HONS)</em> IBADAN <br /> <strong>Deputy Registrar / Secretary</strong> <br /> <strong>School of Postgraduate studies</strong> <br /> cc: Dean school of Postgraduate studies<br /> Registrar<br /> Bursar<br /> Dean Faculty of @Model.Department.Faculty.Name<br /> Head Department of @Model.Department.Name<br /> </p> <div class="pull-right"> @Html.GenerateQrCode(Model.QRVerification) </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.RemitaPaymentViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @{ ViewBag.Title = "Index"; } <h2>Remita Transactions</h2> <div> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>@Html.ActionLink("Full name", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Remita Retrieval Reference", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Transaction Amount", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Transaction Date", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Transaction Status", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int itemIndex = 0; itemIndex < Model.remitaPaymentList.Count; itemIndex++) { <tr> <td>@Html.DisplayTextFor(m => m.remitaPaymentList[itemIndex].payment.Person.FullName)</td> <td>@Html.DisplayTextFor(m => m.remitaPaymentList[itemIndex].RRR)</td> <td>@Html.DisplayTextFor(m => m.remitaPaymentList[itemIndex].TransactionAmount)</td> <td>@Html.DisplayTextFor(m => m.remitaPaymentList[itemIndex].TransactionDate)</td> <td>@Html.DisplayTextFor(m => m.remitaPaymentList[itemIndex].Status)</td> <td>@Html.ActionLink("Get Status", "GetStatus", "RemitaReport", new {order_Id = Model.remitaPaymentList[itemIndex].OrderId}, new {@class = "btn btn-default"})</td> </tr> } </tbody> </table> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffCourseAllocationViewModel @{ ViewBag.Title = "StaffCourseAllocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Programme Drop down Selected-change event $("#Programme").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> @using (Html.BeginForm("AllocateCourseByDepartment", "StaffCourseAllocation", new {area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-toggle-left"></i>Allocate Course</h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Session.Name, "Session", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @id = "Session", @required = "required"}) @Html.ValidationMessageFor(model => model.CourseAllocation.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Semester.Name, "Semester", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Semester.Id, (IEnumerable<SelectListItem>) ViewBag.Semester, new {@class = "form-control", @id = "Semester", @required = "required"}) @Html.ValidationMessageFor(model => model.CourseAllocation.Semester.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Programme.Name, "Programme", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programme, new {@class = "form-control", @id = "Programme", @required = "required"}) @Html.ValidationMessageFor(model => model.CourseAllocation.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Department.Name, "Department", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Department, new {@class = "form-control", @id = "Department", @required = "required"}) @Html.ValidationMessageFor(model => model.CourseAllocation.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Level.Name, "Level", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @id = "Level", @required = "required"}) @Html.ValidationMessageFor(model => model.CourseAllocation.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Allocate Course" /> </div> </div> </div> </div> } @if (Model != null) { using (Html.BeginForm("SavedAllocateCourseByDepartment", "StaffCourseAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> <h4>First Semester</h4> @if (Model.Courses != null) { <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Code</th> <th>Course Title</th> <th>Course Unit</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.Courses.Count; i++) { <tr> @Html.HiddenFor(model => model.CourseAllocationList[i].Session.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Department.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Level.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Semester.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Programme.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Course.Id) <td>@Html.DisplayFor(model => model.CourseAllocationList[i].Course.Code, new {@class = "form-control olevel"})</td> <td>@Html.DisplayFor(model => model.CourseAllocationList[i].Course.Name, new {@class = "form-control olevel"})</td> <td>@Html.DropDownListFor(model => model.CourseAllocationList[i].User.Id, (IEnumerable<SelectListItem>) ViewBag.User, new {@class = "form-control", @id = "User", @required = "required"})</td> </tr> } </tbody> </table> } </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Save Changes" class="btn btn-primary" /> </div> </div> } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ChangeCourseViewModel @{ ViewBag.Title = "CreateShortFall"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-12"> @using (Html.BeginForm("CreateShortFall", "ChangeCourse", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (TempData["Action"] != null) { <div class="alert alert-dismissible alert-warning"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@TempData["Action"].ToString()</p> </div> } </div> </div> <div class="row"> <h3>Enter Application Form Number or Matric Number</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationFormNumber, "Application Form No / Matric No", new {@class = "control-label "}) @Html.TextBoxFor(model => model.ApplicationFormNumber, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicationFormNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> </div> <br /> </div> </div> <div class="col-md-1"></div> </div> } </div> </div> @if (Model == null || Model.Person == null) { return; } @using (Html.BeginForm("CreateShortFallInvoice", "ChangeCourse", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.ApplicationFormNumber) @Html.HiddenFor(model => model.Person) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> </div> <div class="row"> <div class="form-group"> <label class="col-md-2 control-label">Surname</label> <div class="col-md-10"> @Html.DisplayFor(model => model.Person.LastName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.LastName) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-md-2 control-label">First Name</label> <div class="col-md-10"> @Html.DisplayFor(model => model.Person.FirstName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.FirstName) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-md-2 control-label">Other Names</label> <div class="col-md-10"> @Html.DisplayFor(model => model.Person.OtherName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.OtherName) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-md-2 control-label">Phone Number</label> <div class="col-md-10"> @Html.DisplayFor(model => model.Person.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-md-2 control-label">Email</label> <div class="col-md-10"> @Html.DisplayFor(model => model.Person.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Email) </div> </div> </div> @if (Model.AppliedCourse != null) { <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Programme</label> <div class="col-sm-10"> @Html.DisplayFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Programme.Id) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Department</label> <div class="col-sm-10"> @Html.DisplayFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Application Form Number</label> <div class="col-sm-10"> @Html.DisplayFor(model => model.ApplicationFormNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicationFormNumber) </div> </div> </div> } <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Enter ShortFall Amount</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.ShortFallAmount, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ShortFallAmount) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Enter ShortFall Description</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.ShortFallDescription, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.ShortFallDescription) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Level</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (List<SelectListItem>)ViewBag.Levels, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.Level.Id) </div> </div> </div> <div class="row"> <div class="form-group"> <label class="col-sm-2 control-label">Session</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (List<SelectListItem>)ViewBag.Sessions, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.Session.Id) </div> </div> </div> <br/> <div class="row"> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Generate Invoice" /> </div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Name Correction"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Name Correction</div> </div> <div class="panel-body"> @using (Html.BeginForm("CorrectJambDetail", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, "Jamb Number", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new {@class = "form-control", @placeholder = "Enter Jamb Number", @required = "required"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber, "", new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> @if (Model.ApplicantJambDetail == null) { return; } @if (Model.ApplicantJambDetail != null && Model.ApplicantJambDetail.JambRegistrationNumber != null || Model.ApplicantJambDetail.Person.FirstName != null || Model.ApplicantJambDetail.Person.OtherName != null) { using (Html.BeginForm("UpdateJambDetail", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @Html.HiddenFor(model => model.ApplicantJambDetail.Person.Id) <div class="row"> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Person.LastName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.ApplicantJambDetail.Person.LastName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Person.LastName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Person.FirstName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.ApplicantJambDetail.Person.FirstName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Person.FirstName, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Person.OtherName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.ApplicantJambDetail.Person.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Person.OtherName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new {@class = "control-label"}) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber, null, new {@class = "text-danger"}) </div> </div> </div> </div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10 "> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-primary btn-lg mr5" type="submit" value="Update" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <div class="col-md-1"></div> </div> } } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "HostelAllocationCriteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-body"> @if (Model == null || Model.HostelAllocationCriterias == null || Model.HostelAllocationCriterias.Count == 0) { return; } @if (Model.HostelAllocationCriterias != null || Model.HostelAllocationCriterias.Count >0 ) { <h3> @Html.ActionLink("Add New Allocation Criteria", "CreateHostelAllocationCriteria")</h3> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>@Html.ActionLink("Programme", "HostelAllocationCriteria", new { sortOrder = ViewBag.Programme, currentFilter = ViewBag.CurrentFilter })</th> <th>@Html.ActionLink("Department", "HostelAllocationCriteria", new { sortOrder = ViewBag.Department, currentFilter = ViewBag.CurrentFilter })</th> <th>@Html.ActionLink("Level", "HostelAllocationCriteria", new { sortOrder = ViewBag.Level, currentFilter = ViewBag.CurrentFilter })</th> <th>@Html.ActionLink("Hostel", "HostelAllocationCriteria", new { sortOrder = ViewBag.Hostel, currentFilter = ViewBag.CurrentFilter })</th> <th>@Html.ActionLink("Series", "HostelAllocationCriteria", new { sortOrder = ViewBag.Series, currentFilter = ViewBag.CurrentFilter })</th> <th>@Html.ActionLink("Corner", "HostelAllocationCriteria", new { sortOrder = ViewBag.Corner, currentFilter = ViewBag.CurrentFilter })</th> <th></th> </tr> </thead> <tbody style="color:black;"> @for (var i = 0; i < Model.HostelAllocationCriterias.Count; i++) { <tr> <td>@Model.HostelAllocationCriterias[i].Programme.Name</td> <td>@Model.HostelAllocationCriterias[i].Department.Name</td> <td>@Model.HostelAllocationCriterias[i].Level.Name</td> <td>@Model.HostelAllocationCriterias[i].Hostel.Name</td> <td>@Model.HostelAllocationCriterias[i].Series.Name</td> <td>@Model.HostelAllocationCriterias[i].Corner.Name</td> <td><i class="fa fa-edit"> @Html.ActionLink("Edit", "EditHostelAllocationCriteria", "HostelAllocation", new { Area = "Admin", hostelCriteriaId = @Model.HostelAllocationCriterias[i].Id }, null)</i></td> </tr> } </tbody> </table> } </div> </div> <file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Create Payment Type"; } @Html.Partial("BasicSetup/_Create", @Model)<file_sep> @model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGViewModel @{ //Layout = null; } <div class="panel panel-default p-4"> <div class="panel-heading"> <div style="font-size: x-large">O-Level Result</div> </div> <hr> <br /> <div class="panel-body"> <div class="row" id="divOLevel"> <div class="col-md-6 custom-text-black"> <h5>First Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.FirstSittingOLevelResult.Id) <div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.FirstSittingOLevelTypeId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.Type.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamNumber) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.FirstSittingExamYearId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamYear) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </table> </div> <div class="col-md-6 custom-text-black"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.SecondSittingOLevelResult.Id) <div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.SecondSittingOLevelTypeId, new { @class = "form-control olevel" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "form-control olevel" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "control-label col-md-3" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.SecondSittingExamYearId, new { @class = "form-control olevel" }) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </table> </div> </div> </div> </div> @*<div class="panel panel-default"> <div class="panel-heading"> <div style="font-size:x-large">O-LEVEL Credentials</div> </div> <div class="panel-body"> <div class="row "> <div class="col-md-6 "> </div> <div class="col-md-6 "> <div class="panel-body"> <div class="row"> <div> <img id="scannedCredential" src="@Model.FirstSittingOLevelResult.ScannedCopyUrl" alt="" style="max-width:150px" /> </div> </div> <div class="row padding-bottom-5"> <div class="col-md-6 "> @Html.HiddenFor(model => model.FirstSittingOLevelResult.ScannedCopyUrl,new { id = "hfCredentialUrl",name = "hfCredentialUrl" }) <input type="text" id="crx-file-path" readonly="readonly" /> </div> <div class="col-md-6"> @Html.TextBoxFor(m => m.MyCredentialFile,new { id = "cu-credential-simple-upload",type = "file",style = "color:transparent;" }) </div> </div> <div class="row padding-bottom-10"> <div class="col-md-12"> <input class="btn btn-default btn-metro" type="button" name="cr-start-upload" id="cr-start-upload" value="Upload Credential" /> </div> </div> <div class="row"> <div class="col-md-12"> <div id="fileUploadProgress2" style="display:none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Uploading ...</span> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <blockquote> <i class="fa fa-quote-left"></i> <p> To upload your o-level result, scan and save the result in the computer file system. Click on the Choose File button shown above to display the file dialog box. Select the passport file from the saved location. Then click on the Upload Passport button above to upload your passport to the system. </p> <small>Please note that the if you have more than one sitting you are required to scan both sittings as one file. The size should not be more than 500kb. The file format must be in either .gif, .jpeg, .jpg or .bmp file format.<cite title="Source Title"></cite></small> </blockquote> </div> </div> </div> </div>*@<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ZXing; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ResultTranscriptReporter : System.Web.UI.Page { string studentId; protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { lblMessage.Text = ""; if (Request.QueryString["Id"] != null) { studentId = Request.QueryString["Id"]; BuildStudentTranscript(studentId); } } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void BuildStudentTranscript(string sId) { try { string addreessUrl = ""; long stdId = Convert.ToInt64(sId); StudentLevel studentLevel = new StudentLevel(); StudentLogic studentLogic = new StudentLogic(); List<Model.Model.Result> rawresults = new List<Model.Model.Result>(); List<Model.Model.Result> results = new List<Model.Model.Result>(); studentLevel =GetStudentCurrentLevel(stdId); if (studentLevel != null) { var student = studentLogic.GetModelsBy(x => x.Person_Id == stdId).FirstOrDefault(); rawresults = studentLogic.GetTranscriptBy(student, studentLevel.Department); if (rawresults?.Count > 0) { var groupedByCourse = rawresults.GroupBy(c => c.CourseId).ToList(); var orderedResult = rawresults.OrderBy(f => f.LevelId).ToList(); foreach (var item in groupedByCourse) { var individualResult = orderedResult.Where(g => g.CourseId == item.Key && g.Score >= 40).ToList(); if (individualResult?.Count > 1) { var firstResult = individualResult.FirstOrDefault(); results.Add(firstResult); } else { //Get all the results of the course Id var allResult = orderedResult.Where(g => g.CourseId == item.Key).ToList(); results.AddRange(allResult); } } } if (results.Count>0 && results != null) { GenerateTranscriptForOtherDepartments(results, student, stdId); string bind_ds = "dsMasterSheet"; string reportPath = Server.MapPath("~/Reports/ResultTranscript2.rdlc"); ReportViewer1.Reset(); ReportViewer1.LocalReport.ReportPath = reportPath; string replacRegNumber = results[0].MatricNumber.Replace('/', '_'); ReportViewer1.LocalReport.DisplayName = results[1].Name + " " + "Transcript Result"; ReportViewer1.LocalReport.EnableExternalImages = true; ReportViewer1.ProcessingMode = ProcessingMode.Local; // //addreessUrl = results[0].WaterMark; ReportDataSource rdc1 = new ReportDataSource(bind_ds, results); ReportViewer1.LocalReport.DataSources.Add(rdc1); string imageFilePath = "~/Content/ExcelUploads/" + replacRegNumber + ".Jpeg"; string imagePath = new Uri(Server.MapPath(imageFilePath)).AbsoluteUri; //string addressPath = new Uri(Server.MapPath(addreessUrl)).AbsoluteUri; string reportMark = Server.MapPath("/Content/Images/absu.bmp"); string addressPath = new Uri(reportMark).AbsoluteUri; ReportParameter parameter = new ReportParameter("ImagePath", imagePath); ReportParameter parameter1 = new ReportParameter("AddressPath", addressPath); ReportViewer1.LocalReport.SetParameters(new[] { parameter, parameter1 }); ReportViewer1.LocalReport.Refresh(); //ReportDataSource rdc2 = new ReportDataSource("dsPaymentclearanceDue", duePaymentList); //ReportDataSource rdc3 = new ReportDataSource("dsPaymentclearancePaid", madePaymentList); //ReportDataSource rdc1 = new ReportDataSource("dsMasterSheet", results); //ReportViewer1.LocalReport.DataSources.Add(rdc1); //ReportViewer1.LocalReport.DataSources.Add(rdc2); //ReportViewer1.LocalReport.DataSources.Add(rdc3); //ReportViewer1.LocalReport.Refresh(); //ReportViewer1.DataBind(); //var groupedResults = results.OrderBy(x=>x.SessionId).GroupBy(x => x.SessionId); //if(groupedResults.Count()>0 && groupedResults != null) //{ // foreach(var groupedResult in groupedResults) // { // var min=results.Where(x => x.SessionId == groupedResult.Key); // } //} } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public StudentLevel GetStudentCurrentLevel(long sId) { try { StudentLevelLogic studentLevelLogic = new StudentLevelLogic(); var studentLevel=studentLevelLogic.GetModelsBy(x => x.Person_Id == sId).FirstOrDefault(); return studentLevel; } catch(Exception ex) { throw ex; } } private void GenerateTranscriptForOtherDepartments(List<Model.Model.Result> results, Student student, long sId) { try { StudentAcademicInformationLogic studentAcademicInformationLogic = new StudentAcademicInformationLogic(); StudentAcademicInformation studentAcademicInformation = new StudentAcademicInformation(); studentAcademicInformation=studentAcademicInformationLogic.GetModelsBy(x => x.STUDENT.Person_Id == sId).FirstOrDefault(); //if (studentAcademicInformation != null) //{ List<int> totalUnits = new List<int>(); List<decimal> totalGradePoint = new List<decimal>(); StudentLogic resultLogic = new StudentLogic(); string imageUrl = ""; string remark = ""; string graduationDate = ""; string admissionDate = ""; int distinctSession = 0; var numberOfCompletedSessions = 0; if (!sId.ToString().Contains('_')) { imageUrl = GenerateQrCode(results[0].MatricNumber); } if (studentAcademicInformation != null) { string yearofEntry = studentAcademicInformation != null ? studentAcademicInformation.YearOfAdmission.ToString() : null; string yearofGraduation = studentAcademicInformation != null ? studentAcademicInformation.YearOfGraduation.ToString() : null; string[] yearofEntryText = yearofEntry.Split('/'); string[] yearofGraduationText = yearofGraduation.Split('/'); graduationDate = yearofGraduationText.LastOrDefault(); admissionDate = yearofEntryText.FirstOrDefault(); numberOfCompletedSessions = Convert.ToInt32(graduationDate) - Convert.ToInt32(admissionDate); } string addreessUrl = GenerateWaterMark(results[0].Address); var firstOrDefault = results.FirstOrDefault(); DegreeAwarded degreeAward = new DegreeAwarded(); foreach (Model.Model.Result result in results) { if (firstOrDefault != null) { var id = firstOrDefault.DepartmentId; var programmeId = firstOrDefault.ProgrammeId; distinctSession = results.Select(s => s.SessionId).ToList().Distinct().Count(); DegreeAwardedLogic degreeAwardsLogic = new DegreeAwardedLogic(); degreeAward = degreeAwardsLogic.GetModelBy(ad => ad.Department_Id == id && ad.Programme_Id == programmeId); } if (degreeAward != null && degreeAward.Id > 0) { remark = degreeAward.Degree; } else { throw new Exception("No Degree Award Was Set For The Department kindly Set Degree And Try Again."); } if (degreeAward.Programme.Id == 11) { result.Semestername = "LONG VACATION"; } if (string.IsNullOrWhiteSpace(result.Grade)) { result.GradePoints = " "; } else { string converttodecimal = Math.Round((Decimal)result.GPCU, 2).ToString("0.0"); result.GradePoints = converttodecimal; } result.GraduationDate = graduationDate!=""? graduationDate:""; result.AdmissionDate = admissionDate!=""?admissionDate:""; result.QrCode = imageUrl; result.Address = studentAcademicInformation!=null?studentAcademicInformation.YearOfAdmission.ToString():null; result.WaterMark = addreessUrl; totalUnits.Add(result.CourseUnit); if (result.GPCU == null) { result.GPCU = 0; } totalGradePoint.Add((decimal)result.GPCU); } for (int i = 0; i < totalUnits.Count; i++) { if (string.IsNullOrEmpty(results[i].cGPA)) { results[i].TotalSemesterCourseUnit = totalUnits.Sum(); results[i].TotalGradePoint = totalGradePoint.Sum(); string cGPA = Math.Round((decimal)(results[i].TotalGradePoint / results[i].TotalSemesterCourseUnit), 2).ToString("0.00"); results[i].CGPA = Convert.ToDecimal(cGPA); //results[i].CGPA = Math.Round(Convert.ToDecimal(results[i].cGPA), 2); results[i].cGPA = cGPA; results[i].Remark = remark; results[i].DegreeClassification = resultLogic.GetGraduationStatus(results[i].CGPA, results[i].GraduationDate); results[i].Date = resultLogic.GetTodaysDateFormat(); results[i].DateOfBirth = studentAcademicInformation!=null?studentAcademicInformation.Student.DateOfBirth:null; //results[i].WesVerificationNumber = student.WesVerificationNumber; results[i].NumberOfNonCompletedSession = numberOfCompletedSessions==0? 0 :CheckIfStudiesWhereComplete(numberOfCompletedSessions, distinctSession); } else { results[i].Remark = remark; results[i].CGPA = Convert.ToDecimal(results[i].cGPA); results[i].DegreeClassification = resultLogic.GetGraduationStatus(results[i].CGPA, results[i].GraduationDate); results[i].Date = resultLogic.GetTodaysDateFormat(); results[i].DateOfBirth = studentAcademicInformation!=null?studentAcademicInformation.Student.DateOfBirth :null; results[i].TotalSemesterCourseUnit = totalUnits.Sum(); results[i].TotalGradePoint = totalGradePoint.Sum(); //results[i].WesVerificationNumber = !string.IsNullOrEmpty(student.WesVerificationNumber) ? student.WesVerificationNumber : " "; } } //} } catch(Exception ex) { throw ex; } } public string GenerateQrCode(string regNo, string alt = "QR code", int height = 100, int width = 100, int margin = 0) { string replacRegNumber = regNo.Replace('/', '_'); string folderPath = "~/Content/ExcelUploads/"; string imagePath = "~/Content/ExcelUploads/" + replacRegNumber + ".Jpeg"; string verifyUrl = "localhost:6390/Student/Result/VerifyTranscript/" + replacRegNumber; string wildCard = replacRegNumber + "*.*"; IEnumerable<string> files = Directory.EnumerateFiles(Server.MapPath("~/Content/ExcelUploads/"), wildCard, SearchOption.TopDirectoryOnly); if (files != null && files.Count() > 0) { return imagePath; } // If the directory doesn't exist then create it. if (!Directory.Exists(Server.MapPath(folderPath))) { Directory.CreateDirectory(folderPath); } var barcodeWriter = new BarcodeWriter(); barcodeWriter.Format = BarcodeFormat.QR_CODE; var result = barcodeWriter.Write(verifyUrl); string barcodePath = Server.MapPath(imagePath); var barcodeBitmap = new Bitmap(result); using (MemoryStream memory = new MemoryStream()) { using (FileStream fs = new FileStream(barcodePath, FileMode.Create)) { barcodeBitmap.Save(memory, ImageFormat.Jpeg); byte[] bytes = memory.ToArray(); fs.Write(bytes, 0, bytes.Length); } } return imagePath; } public string GenerateWaterMark(string address) { string returnImagePath = "~/Content/Junk/defaultImage1.bmp"; string imagePath = Server.MapPath("~/Content/Junk/defaultImage1.bmp"); string defultImagePath = Server.MapPath("~/Content/Junk/defaultImage.bmp"); Bitmap bmp = new Bitmap(defultImagePath); RectangleF rectf = new RectangleF(0, 0, bmp.Width, bmp.Height); Graphics g = Graphics.FromImage(bmp); g.SmoothingMode = SmoothingMode.AntiAlias; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.PixelOffsetMode = PixelOffsetMode.HighQuality; g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit; StringFormat format = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; g.DrawString(address, new Font("Tahoma", 16), Brushes.Gainsboro, rectf, format); g.Flush(); using (MemoryStream memory = new MemoryStream()) { using (FileStream fs = new FileStream(imagePath, FileMode.Create)) { bmp.Save(memory, ImageFormat.Bmp); byte[] bytes = memory.ToArray(); fs.Write(bytes, 0, bytes.Length); } } return returnImagePath; } private int CheckIfStudiesWhereComplete(int startAndEndSessionDifference, int numberofSessions) { int numberNotCompleted; try { numberNotCompleted = startAndEndSessionDifference - numberofSessions; } catch (Exception ex) { throw ex; } return numberNotCompleted; } } }<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class HostelAllocationReport : System.Web.UI.Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Hostel SelectedHostel { get { return new Hostel { Id = Convert.ToInt32(ddlHostel.SelectedValue), Name = ddlHostel.SelectedItem.Text }; } set { ddlHostel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlHostel, Utility.GetAllHostels(), Utility.ID, Utility.NAME); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0 || SelectedHostel == null ||SelectedHostel.Id <= 0 ) { return true; } return false; } catch (Exception) { throw; } } private void DisplayReportBy(Session session, Hostel hostel) { try { var hostelLogic = new HostelLogic(); List<Model.Model.HostelAllocationReport> report = hostelLogic.GetHostelReportBy(session, hostel); string bind_dsHostel = "dsHostelReport"; string reportPath = @"Reports\HostelAllocationReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Hostel Allocation Report"; ReportViewer1.LocalReport.ReportPath = reportPath; if (report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsHostel.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void Display_Button_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession,SelectedHostel); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void Display_Bulk_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession,SelectedHostel); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@model Abundance_Nk.Model.Model.Setup @*<h3>@ViewBag.Title</h3>*@ <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> <div class="confirm-delete-text">Are you sure you want to delete this?</div> <div> <hr /> <dl class="dl-horizontal"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null) { return; } <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Name) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Name) </dd> </dl> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-actions no-color"> <input type="submit" value="Delete" class="btn btn-default" /> | @Html.ActionLink("Back to List", "Index") </div> } </div> <hr /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentResultViewModel @{ ViewBag.Title = "ViewStudentResultStatus"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script type="text/javascript"> function ActivateAll() { if ($('#ActivateAllId').is(':checked')) { $('.Activate').prop('checked', true); } else { $('.Activate').prop('checked', false); } } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>View Student Result Status</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("ViewStudentResultStatus", "StudentResult", new {Area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(m => m.Programme.Name, "Programme", new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(m => m.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programme, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Level.Name, "Level", new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(m => m.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-success" /> </div> </div> </div> } </div> </div> <br /> <div class="panel-body"> <div class="col-md-12"> @if (Model.StudentResultStatusList != null && Model.StudentResultStatusList.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> @using (Html.BeginForm("SaveEditedStudentResultStatus", "StudentResult", new {Area = "Admin"}, FormMethod.Post)) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Department </th> <th> <input type="checkbox" id="ActivateAllId" onclick=" ActivateAll() " /> Approved </th> <th> Delete </th> </tr> @for (int i = 0; i < Model.StudentResultStatusList.Count; i++) { <tr> @Html.HiddenFor(model => model.StudentResultStatusList[i].Id) @Html.HiddenFor(model => model.StudentResultStatusList[i].Department.Id) @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Level.Id) <td> @Model.StudentResultStatusList[i].Department.Name </td> <td> @Html.CheckBoxFor(m => m.StudentResultStatusList[i].Activated, new {@type = "checkbox", @class = "Activate"}) </td> <td> @Html.ActionLink("Delete", "ConfirmDeleteResultStatus", "StudentResult", new {Area = "Admin", rid = Model.StudentResultStatusList[i].Id}, new {@class = "btn btn-success "}) </td> </tr> } </table> <br /> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Save" class="btn btn-success" /> </div> </div> } </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>$(document).ready(function() { if ($(".sortableContent").length > 0) { var scid = 'sc-' + $(".sortableContent").attr('id'); var sCdata = portlet_get_data(scid); if (null != sCdata) { for (row = 0; row < Object.size(sCdata); row++) { for (column = 0; column < Object.size(sCdata[row]); column++) { for (block = 0; block < Object.size(sCdata[row][column]); block++) { $("#" + sCdata[row][column][block]).appendTo(".sortableContent .scRow:eq(" + row + ") .scCol:eq(" + column + ")"); } } } onload(); } $(".sortableContent .scCol").sortable({ connectWith: ".sortableContent .scCol", items: "> .panel", handle: ".panel-heading", placeholder: "scPlaceholder", start: function(event, ui) { $(".scPlaceholder").height(ui.item.height() + 1); }, stop: function(event, ui) { var sorted = {}; var row = 0; $(".sortableContent .scRow").each(function() { sorted[row] = {}; $(this).find(".scCol").each(function() { var column = $(this).index(); sorted[row][column] = {}; $(this).find('.panel').each(function() { sorted[row][column][$(this).index()] = $(this).attr('id'); }); }); row++; }); portlet_save_data(scid, JSON.stringify(sorted)); onload(); } }).disableSelection(); $(".sc-set-default").on("click", function() { portlet_delete_data(scid); location.reload(); }); } }); function portlet_get_data(portlet_id) { if (typeof(Storage) !== "undefined") { if (typeof(sessionStorage[portlet_id]) !== "undefined") { return $.parseJSON(sessionStorage[portlet_id]); } else { return null; } } } function portlet_save_data(portlet_id, portlet_data) { if (typeof(Storage) !== "undefined") { sessionStorage[portlet_id] = portlet_data; } else { return false; } } function portlet_delete_data(portlet_id) { if (typeof(Storage) !== "undefined") { if (sessionStorage[portlet_id] != '') sessionStorage.removeItem(portlet_id); } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div> <p class="text-center"><h3>CORRECT O-LEVEL DETAILS</h3></p> </div> @if (TempData["Message"] != null) { <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["Message"]</strong> </div> } @using (Html.BeginForm("CorrectOlevel", "Support/CorrectOlevel", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h4>Enter Invoice Number or Confirmation Order Number</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.InvoiceNumber, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.InvoiceNumber, new {@class = "form-control", @placeholder = "Enter Invoice No"}) @Html.ValidationMessageFor(model => model.InvoiceNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new {Area = ""}, null) </div> </div> </div> </div> </div> } @if (Model == null || Model.Person == null || Model.Payment == null) { return; } @using (Html.BeginForm("UpdateOlevel", "Support/UpdateOlevel", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.DateOfBirth) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.Sex.Id) @Html.HiddenFor(model => model.Person.State.Id) @Html.HiddenFor(model => model.Person.Nationality.Id) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.LocalGovernment.Id) @Html.HiddenFor(model => model.Person.Religion.Id) @Html.HiddenFor(model => model.Person.Role.Id) @Html.HiddenFor(model => model.ApplicationForm.Id) @Html.HiddenFor(model => model.ApplicationForm.Person.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.AppliedCourse.Option.Id) @Html.HiddenFor(model => model.AppliedCourse.ApplicationForm.Id) @Html.HiddenFor(model => model.FirstSittingOLevelResult.Id) @Html.HiddenFor(model => model.SecondSittingOLevelResult.Id) <div class="panel panel-default "> <div class="panel-body " style="color: black"> <div class="col-md-12"> </div> <div class="form-group"> <label class="col-sm-6 control-label">Surname</label> <label class="col-sm-6 control-label">First name</label> </div> <div class="form-group"> <div class="col-sm-6"> @Html.DisplayFor(model => model.Person.LastName, new {@class = "form-control"}) </div> <div class="col-sm-6"> @Html.DisplayFor(model => model.Person.FirstName, new {@class = "form-control", @placeholder = "Enter Firstname"}) </div> </div> <div class="form-group"> <label class="col-sm-6 control-label">Other Names</label> <label class="col-sm-6 control-label">Department</label> </div> <div class="form-group"> <div class="col-sm-6"> @Html.DisplayFor(model => model.Person.OtherName, new {@class = "form-control", @placeholder = "Enter Mobile Number"}) </div> <div class="col-sm-6"> @Html.DisplayFor(model => model.AppliedCourse.Department.Name, new {@class = "form-control", @placeholder = "Enter Mobile Number"}) </div> </div> <hr></hr> <div class="row" id="divOLevel"> <div class="col-md-6 custom-text-black"> <h5>First Sitting</h5> <hr class="no-top-padding" /> <div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>) ViewBag.FirstSittingOLevelTypeId, new {@class = "form-control olevel"}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.Type.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "form-control olevel"}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamNumber) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>) ViewBag.FirstSittingExamYearId, new {@class = "form-control olevel"}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamYear) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < Model.FirstSittingOLevelResultDetails.Count; i++) { <tr> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelSubjectId" + i], new {@class = "form-control olevel"}) </td> <td> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelGradeId" + i], new {@class = "form-control olevel"}) </td> </tr> } </table> </div> <div class="col-md-6 custom-text-black"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> <div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>) ViewBag.SecondSittingOLevelTypeId, new {@class = "form-control olevel"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "form-control olevel"}) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>) ViewBag.SecondSittingExamYearId, new {@class = "form-control olevel"}) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < Model.SecondSittingOLevelResultDetails.Count; i++) { <tr> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Id) @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelSubjectId" + i], new {@class = "form-control olevel"}) </td> <td> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelGradeId" + i], new {@class = "form-control olevel"}) </td> </tr> } </table> </div> </div> <hr /> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> </div> </div> } </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/vue.min.js"></script> <div class="container"> <div class="col-md-12 card p-5"> <div id="payFee"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> <h3> Transcript Payment </h3> <hr style="margin-top: 0" /> <div class="row"> <div class="col-md-12"> <p>Enter your Confirmation order number, select session and click on the submit button </p> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ConfirmationNo, "Confirmation Number:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.PaymentEtranzact.ConfirmationNo, new { @class = "form-control", required = "required", @ref = "con" }) @Html.ValidationMessageFor(model => model.PaymentEtranzact.ConfirmationNo, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, "Session:", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Session.Id, (List<SelectListItem>)ViewBag.Sessions, new { @class = "form-control", required = "required", @ref = "session" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> </div> <br /> <br /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <input class="btn btn-success btn-lg mr5" v-on:click="verifyCon" type="button" name="submit" id="submit" value="Search" /> <span v-show="load"> <img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> </div> <br /> </div> </div> </div> </div> </div> </div> <script> new Vue({ el: '#payFee', data: { load: false }, methods: { verifyCon: function () { this.load = true; $.ajax({ type: 'POST', url: '@Url.Action("PayTranscriptFee", "Transcript")', // Calling json method dataType: 'json', data: { con: this.$refs.con.value, sessionId: this.$refs.session.value }, success: function (result) { this.load = false; if (result.IsError) { alert(result.Message); } else { var id = result.Operation; window.location.href = "/Common/Credential/Receipt?pmid=" + id; } }, error: function (ex) { this.load = false; alert('Request Cannot be Processed.'); } }); } } }); </script> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "HostelRequestCount"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>SHostel Request Count</h4> </div> <div class="panel-body"> @if (Model.HostelRequestCounts != null && Model.HostelRequestCounts.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> @using (Html.BeginForm("HostelRequestCount", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post)) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Level </th> <th> Hostel Type </th> <th> Approved </th> <th> Total Number </th> <th> Last Modified Date </th> </tr> @for (int i = 0; i < Model.HostelRequestCounts.Count; i++) { <tr> @Html.HiddenFor(model => model.HostelRequestCounts[i].Id) <td> @Model.HostelRequestCounts[i].Level.Name.ToUpper() </td> <td> @Model.HostelRequestCounts[i].Sex.Name.ToUpper() </td> <td> @Html.EditorFor(model => model.HostelRequestCounts[i].Approved) </td> <td> @Html.EditorFor(model => model.HostelRequestCounts[i].TotalCount) </td> <td> @Model.HostelRequestCounts[i].LastModified </td> </tr> } </table> <br /> <div class="form-group"> <div class=" col-md-10"> <input type="submit" value="Save" class="btn btn-success" /> </div> </div> } </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Delete School"; } @Html.Partial("BasicSetup/_Delete", @Model)<file_sep> @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <br /> <div id="divRejectReason" style="display: none; margin-bottom: 15px; text-align: justify;"> <blockquote> <p style="color: red; font-weight: bold"> We regret to inform you that you did not qualify for admission into the above programme and department due to following reason: </p> <small>@Model.ApplicationForm.RejectReason<cite title="Source Title"></cite></small> </blockquote> </div> <h5>UPDATE YOUR O-LEVEL RESULT </h5> <hr /> <div class="container p-0"> <div class="col-md-12 p-0"> <div class="col-md-1 "></div> <div class=" "> @using (Html.BeginForm("VerifyOlevelResult", "PGAdmission", FormMethod.Post)) { @Html.HiddenFor(m => m.ApplicantStatusId) @Html.HiddenFor(m => m.AppliedCourse.Programme.Id) @Html.HiddenFor(m => m.ApplicationForm.Id) @Html.HiddenFor(m => m.ApplicationForm.Person.Id) @Html.HiddenFor(m => m.ApplicationForm.RejectReason) @Html.HiddenFor(m => m.ApplicationForm.Rejected) @Html.HiddenFor(m => m.ApplicationForm.Number) <div class="row" id="divOLevel"> <div class="col-md-6"> <h5>First Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.FirstSittingOLevelResult.Id) <div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new { @class = "control-label " }) <div> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.FirstSittingOLevelTypeId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.Type.Id) </div> </div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "control-label" }) <div class=""> @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamNumber) </div> </div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "control-label " }) <div class=""> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.FirstSittingExamYearId, new { @class = "form-control olevel" }) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamYear) </div> </div> </div> <table class="table table-striped table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["FirstSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </table> </div> <div class="col-md-6"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> @Html.HiddenFor(model => model.SecondSittingOLevelResult.Id) <div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new { @class = "control-label " }) <div class=""> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>)ViewBag.SecondSittingOLevelTypeId, new { @class = "form-control olevel" }) </div> </div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "control-label" }) <div class=""> @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "form-control olevel" }) </div> </div> <div class="form-group col-md-12 p-0"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "control-label" }) <div class=""> @Html.DropDownListFor(model => model.SecondSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>)ViewBag.SecondSittingExamYearId, new { @class = "form-control olevel" }) </div> </div> </div> <table class="table table-striped table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelSubjectId" + i], new { @class = "form-control olevel" }) </td> <td> @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>)ViewData["SecondSittingOLevelGradeId" + i], new { @class = "form-control olevel" }) </td> </tr> } </table> </div> </div> <br /> <hr /> <div class="form-inline"> <button class="btn btn-primary" type="submit" name="submit">Submit</button> @*<button class="btn btn-primary btn-lg" type="button" name="btnVerifyOlevelNext" id="btnVerifyOlevelNext" />Next Step*@ </div> <br /> <div id="divVerifyOlevelResultData"></div> } </div> <div class="col-md-1"></div> </div> </div> <file_sep>@model Abundance_Nk.Model.Entity.PAYMENT_ETRANZACT_TYPE @{ ViewBag.Title = " "; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h4>PAYMENT ETRANZACT TYPE</h4> <hr /> @Html.ValidationSummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @Html.LabelFor(model => model.Payment_Etranzact_Type_Id,"SN", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Payment_Etranzact_Type_Id, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Payment_Etranzact_Type_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Payment_Etranzact_Type_Name, "Payment Type Name" ,htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Payment_Etranzact_Type_Name, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Payment_Etranzact_Type_Name, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Fee_Type_Id, "Fee Type", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Fee_Type_Id", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Fee_Type_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme_Id, "Programme", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Programme_Id", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level_Id, "Level", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Level_Id", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Level_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Payment_Mode_Id, "Payment Mode", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Payment_Mode_Id", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Payment_Mode_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Session_Id, "Session", htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Session_Id", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Session_Id, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index") </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "ViewAllAllocationRequest"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> function ActivateAll() { if ($('#ActivateAllId').is(':checked')) { $('.Activate').prop('checked', true); } else { $('.Activate').prop('checked', false); } } </script> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Allocation Requests</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewAllAllocationRequest", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Sessions, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <div class="panel-body"> @if (Model.HostelRequests != null && Model.HostelRequests.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> @using (Html.BeginForm("RemoveHostelRequest", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post)) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Picture </th> <th> Name </th> <th> Matric NO. </th> <th> State </th> <th> Address </th> <th> Programme </th> <th> Department </th> <th> Status </th> <th> <input type="checkbox" id="ActivateAllId" onclick="ActivateAll()"/> Remove </th> <th> Edit </th> </tr> @for (int i = 0; i < Model.HostelRequests.Count; i++) { <tr> @Html.HiddenFor(model => model.HostelRequests[i].Id) @if (Model.HostelRequests[i].Student != null) { if (!string.IsNullOrEmpty(Model.HostelRequests[i].Student.ImageFileUrl)) { <td> <img src="@Url.Content(@Model.HostelRequests[i].Student.ImageFileUrl)" class="img img-rounded" style="width: 200px; height: 200px" /> </td> } else { <td> <img src="@Url.Content("~/Content/Images/default_avatar.png")" class="img img-rounded" style="width: 200px; height: 200px" /> </td> } <td> @Model.HostelRequests[i].Student.FullName.ToUpper() </td> if (Model.HostelRequests[i].Student.MatricNumber != null) { <td> @Model.HostelRequests[i].Student.MatricNumber.ToUpper() </td> } else { <td></td> } if (Model.HostelRequests[i].Student.State != null) { <td> @Model.HostelRequests[i].Student.State.Name.ToUpper() </td> } else { <td></td> } <td> @Model.HostelRequests[i].Student.SchoolContactAddress </td> } else { if (!string.IsNullOrEmpty(Model.HostelRequests[i].Person.ImageFileUrl)) { <td> <img src="@Url.Content(@Model.HostelRequests[i].Person.ImageFileUrl)" class="img img-rounded" style="width: 200px; height: 200px" /> </td> } else { <td> <img src="@Url.Content("~/Content/Images/default_avatar.png")" class="img img-rounded" style="width: 200px; height: 200px" /> </td> } <td> @Model.HostelRequests[i].Person.FullName.ToUpper() </td> <td></td> if (Model.HostelRequests[i].Person.State != null) { <td> @Model.HostelRequests[i].Person.State.Name.ToUpper() </td> } else { <td></td> } <td> @Model.HostelRequests[i].Person.ContactAddress </td> } <td> @Model.HostelRequests[i].Programme.Name </td> <td> @Model.HostelRequests[i].Department.Name </td> @if (Model.HostelRequests[i].Approved) { <td>Approved</td> } else { <td>Not Approved</td> } <td> @Html.CheckBoxFor(m => m.HostelRequests[i].Remove, new { @type = "checkbox", @class = "Activate" }) </td> <td> @Html.ActionLink("Edit", "EditAllocationRequest", new { area = "Admin", controller = "HostelAllocation", rid = @Model.HostelRequests[i].Id }, new { @class = "btn btn-success mr5"}) </td> </tr> } </table> <br /> <div class="form-group"> <div class=" col-md-10"> <input type="submit" value="Submit" class="btn btn-success" /> </div> </div> } </div> </div> } </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <h3>Referee</h3> @for(int i = 0;i < Model.ApplicantReferees.Count;i++) { <div class="row"> <div class="well"> <div class="form-group "> @Html.LabelFor(model => model.ApplicantReferees.FirstOrDefault().Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.ApplicantReferees[i].Name,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Name) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.ApplicantReferees.FirstOrDefault().Rank,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.ApplicantReferees[i].Rank,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Rank) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.ApplicantReferees.FirstOrDefault().Department,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.ApplicantReferees[i].Department,(IEnumerable<SelectListItem>)ViewBag.RelationshipId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Department) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.ApplicantReferees.FirstOrDefault().Institution,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.ApplicantReferees[i].Institution,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Institution) </div> </div> <div class="form-group "> <div class="col-sm-3 "></div> <div class="col-sm-9 "> <div class="form-inline"> <div class="form-group"> <button class="btn btn-primary btn-metro mr5" type="button" value="Next">Next</button> </div> <div class="form-group margin-bottom-0"> <div style="display: none"> </div> </div> </div> </div> </div> </div> </div> }<file_sep><!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="~/Content/putme/css/bootstrap.min.css"> <!-- Now-ui-kit CSS --> <link rel="stylesheet" href="~/Content/putme/css/now-ui-kit.css"> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <!-- Include the above in your HEAD tag --> <title>ABSU PORTAL</title> </head> <body> <nav class="navbar navbar-expand-lg bg-primary"> <div class="container"> <div class="navbar-translate"> <a class="navbar-brand bg-warning p-1" href="#pablo" style="position:absolute; top:-5px;"> <img src="~/Content/putme/img/logo1.png" alt="abiastateunivertsity" height="65"> </a> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navigation" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-bar bar1"></span> <span class="navbar-toggler-bar bar2"></span> <span class="navbar-toggler-bar bar3"></span> </button> </div> <div class="collapse navbar-collapse justify-content-end" id="navigation"> <ul class="navbar-nav"> <li class="nav-item dropdown"> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false"> Applicant <span class="caret"></span> </a> <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink1"> <li>@Html.ActionLink("Generate Invoice", "PostJambFormInvoiceGeneration", "Form", new { Area = "Applicant" }, new { @class = "dropdown-item"})</li> <li>@Html.ActionLink("Fill Application Form", "PostJambProgramme", "Form", new { Area = "Applicant" }, new { @class = "dropdown-item"})</li> <li class="divider"></li> <li>@Html.ActionLink("Check PUTME Result", "Index", "Screening", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li class="divider"></li> <li>@Html.ActionLink("Check Admission Status", "CheckStatus", "Admission", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li class="divider"></li> <li>@Html.ActionLink("Request For Hostel Allocation", "CreateHostelRequest", "Hostel", new { Area = "Student" }, new { @class = "dropdown-item" })</li> <li>@Html.ActionLink("Hostel Allocation Status", "HostelAllocationStatus", "Hostel", new { Area = "Student" }, new { @class = "dropdown-item" })</li> </ul> </li> <li class="nav-item dropdown"> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false"> Returning Students </a> </li> <li class="nav-item dropdown"> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false"> Remedial Studies <span class="caret"></span> </a> <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink1"> <li>@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, new { @class = "dropdown-item" })</li> </ul> </li> <li class="nav-item dropdown"> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false">Post Graduate School <span class="caret"></span> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Generate Application Form Invoice", "PostJambFormInvoiceGeneration", "Form", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li>@Html.ActionLink("Fill Application Form", "Index", "PostGraduateForm", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li>@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, new { @class = "dropdown-item" })</li> <li class="divider"></li> <li>@Html.ActionLink("Check Admission Status", "CheckStatus", "Admission", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li class="divider"></li> <li>@Html.ActionLink("Old Fees", "OldFees", "Payment", new { Area = "Student" }, new { @class = "dropdown-item" })</li> <li>@Html.ActionLink("Print Receipt", "PrintReceipt", "Registration", new { Area = "Student" }, new { @class = "dropdown-item" })</li> </ul> </li> <li class="dropdown nav-item"> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#">Graduate <span class="caret"></span> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Apply for Transcript", "Index", "Transcript", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> <li>@Html.ActionLink("Generate Transcript Receipt", "PayForTranscript", "Transcript", new { Area = "Applicant" }, new { @class = "dropdown-item" })</li> </ul> </li> <li class="nav-item"> <a class="nav-link" href="#">Login</a> </li> </ul> </div> </div> </nav> <div class="container-fluid"> <div class="container"> @RenderBody() </div> </div> <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="~/Content/putme/js/jquery.3.2.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="~/Content/putme/js/bootstrap.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <!-- Start of Smartsupp Live Chat script --> <script type="text/javascript"> var _smartsupp = _smartsupp || {}; _smartsupp.key = "8d8c5c64fa82b02ea860a7f80d5a93c351259935"; // _smartsupp.cookieDomain = '.abiastateuniversity.edu.ng'; _smartsupp.requireLogin = true; // disable email _smartsupp.loginEmailControl = false; // append checkbox control to confirm something _smartsupp.loginControls = [ { xtype: 'textinput', name: 'number', label: 'Phone', required: true }, { xtype: 'textinput', name: 'identifier', label: 'Application / Matric No', required: true } ]; window.smartsupp || (function(d) { var s, c, o = smartsupp = function() { o._.push(arguments); }; o._ = []; s = d.getElementsByTagName('script')[0]; c = d.createElement('script'); c.type = 'text/javascript'; c.charset = 'utf-8'; c.async = true; c.src = '//www.smartsuppchat.com/loader.js'; s.parentNode.insertBefore(c, s); })(document); </script> <!-- End of Smartsupp Live Chat script --> <script> // customize banner & logo smartsupp('banner:set', 'bubble'); //smartsupp('chat:avatar', '/assets/images/demo-logo-1.png'); // customize texts smartsupp('chat:translate', { online: { title: 'Support', infoTitle: 'LLOYDANT' }, offline: { title: 'OFFLINE' } }); // customize colors smartsupp('theme:colors', { primary: '#b78825', banner: '#999999', primaryText: '#ffffff' }); </script> </body> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", false) </html><file_sep>@{ ViewBag.Title = "RemoveDuplicateCourseRegistration"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>RemoveDuplicateCourseRegistration</h2><file_sep>@model Abundance_Nk.Model.Model.Invoice @{ Layout = null; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script src="~/Scripts/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { alert(""); window.print(); }); </script> } @if (TempData["Message"] != null) { <div class="container"> <div class="row"> <div class="col-md-12"> <br /> @Html.Partial("_Message", TempData["Message"]) </div> </div> </div> } @if (Model != null) { @Html.Partial("_Invoice", Model) } @*@using (Html.BeginForm("Invoice", "Admission", FormMethod.Get, new { target = "_blank" })) { if(Model != null ) { @Html.Partial("_Invoice", Model) } }*@<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; namespace Abundance_Nk.Web.Reports.Presenter { public partial class VerifcationReport :System.Web.UI.Page { private List<Department> departments; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public FeeType SelectedFeeType { get { return new FeeType { Id = Convert.ToInt32(ddlFeeType.SelectedValue),Name = ddlFeeType.SelectedItem.Text }; } set { ddlFeeType.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlFeeType,Utility.GetAllFeeTypes(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if(SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0 || SelectedSession == null || SelectedSession.Id <= 0 || SelectedLevel == null || SelectedLevel.Id <= 0 || SelectedFeeType == null || SelectedFeeType.Id <= 0 || String.IsNullOrEmpty(txtBoxDateFrom.Text) || String.IsNullOrEmpty(txtBoxDateTo.Text)) { return true; } return false; } catch(Exception) { throw; } } private void DisplayReportBy(Session session,Department department,Programme programme,Level level,FeeType feeType,string StartDate, string EndDate) { try { var paymentVerificationLogic = new PaymentVerificationLogic(); List<PaymentVerificationReportAlt> report = paymentVerificationLogic.GetVerificationReport(department, session, programme, level, feeType, StartDate, EndDate); string bind_dsStudentPaymentSummary = "dsScreeningReport"; string reportPath = @"Reports\PaymentReports\AbsuPaymentVerificationReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Payment Report "; ReportViewer1.LocalReport.ReportPath = reportPath; if(report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } protected void Display_Button_Click1(object sender,EventArgs e) { try { if(InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } string StartDate = txtBoxDateFrom.Text; string EndDate = txtBoxDateTo.Text; DisplayReportBy(SelectedSession, SelectedDepartment, SelectedProgramme, SelectedLevel, SelectedFeeType, StartDate, EndDate); } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } } }<file_sep>@model Abundance_Nk.Model.Entity.DEGREE_AWARDS_BY_PROGRAMME_DEPARTMENT @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div> <h4>DEGREE AWARDS</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.Degree_Name) </dt> <dd> @Html.DisplayFor(model => model.Degree_Name) </dd> <dt> @Html.DisplayNameFor(model => model.Duration) </dt> <dd> @Html.DisplayFor(model => model.Duration) </dd> <dt> @Html.DisplayNameFor(model => model.DEPARTMENT.Department_Name) </dt> <dd> @Html.DisplayFor(model => model.DEPARTMENT.Department_Name) </dd> <dt> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </dt> <dd> @Html.DisplayFor(model => model.PROGRAMME.Programme_Name) </dd> </dl> </div> <p> @Html.ActionLink("Edit","Edit",new { id = Model.Id },new{@class="btn btn-primary"}) | @Html.ActionLink("Back to List","Index",null,new { @class = "btn btn-primary" }) </p> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; ViewBag.Title = "Clearance Desk"; } <script> function getnewValue(val) { var dropdownChanged = val.id; var buttonId = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].id; var buttonUrl = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].href; var ur = buttonUrl + "&stat=" + val.value; document.getElementById(buttonId).href = ur; } $("a").click(function() { alert($(this).text); }); </script> <h2>Incoming Clearance Requests</h2> <div> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>@Html.ActionLink("FULLNAME", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("MATRIC NO", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("DATE REQUESTED", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("DESTINATION", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("CLEARANCE STATUS", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.transcriptRequests.Count; i++) { <tr> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].student.FullName)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].student.MatricNumber)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DateRequested)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DestinationAddress)</td> <td>@Html.DropDownListFor(m => m.transcriptRequests[i].transcriptClearanceStatus.TranscriptClearanceStatusId, (IEnumerable<SelectListItem>) ViewData["clearanceStatus" + i], new {@class = "form-control", @onChange = "getnewValue(this)"})</td> <td>@Html.ActionLink("Update", "UpdateClearance", "TranscriptProcessor", new {tid = Model.transcriptRequests[i].Id}, new {@class = "btn btn-default", @id = "url" + i})</td> </tr> } </tbody> </table> </div><file_sep>@model IEnumerable<Abundance_Nk.Model.Entity.MIGRATION_APPLICANTS> @{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.JAMB_REG_NO) </th> <th> @Html.DisplayNameFor(model => model.NAMES) </th> <th> @Html.DisplayNameFor(model => model.STATE) </th> <th> @Html.DisplayNameFor(model => model.LGA) </th> <th> @Html.DisplayNameFor(model => model.FIRST_CHOICE) </th> <th> @Html.DisplayNameFor(model => model.SCORE) </th> <th> @Html.DisplayNameFor(model => model.QUALIFICATION_1) </th> <th> @Html.DisplayNameFor(model => model.QUALIFICATION_2) </th> <th> @Html.DisplayNameFor(model => model.DEPARTMENT) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.JAMB_REG_NO) </td> <td> @Html.DisplayFor(modelItem => item.NAMES) </td> <td> @Html.DisplayFor(modelItem => item.STATE) </td> <td> @Html.DisplayFor(modelItem => item.LGA) </td> <td> @Html.DisplayFor(modelItem => item.FIRST_CHOICE) </td> <td> @Html.DisplayFor(modelItem => item.SCORE) </td> <td> @Html.DisplayFor(modelItem => item.QUALIFICATION_1) </td> <td> @Html.DisplayFor(modelItem => item.QUALIFICATION_2) </td> <td> @Html.DisplayFor(modelItem => item.DEPARTMENT) </td> <td> @Html.ActionLink("Edit", "Edit", new { id=item.SNO }) | @Html.ActionLink("Details", "Details", new { id=item.SNO }) | @Html.ActionLink("Delete", "Delete", new { id=item.SNO }) </td> </tr> } </table> <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class ApplicantResult :Page { public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { Message = ""; if(!IsPostBack) { ddlDepartment.Visible = false; PopulateAllDropDown(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReport(Session session,Department department) { try { var resultLogic = new ApplicantJambDetailLogic(); List<Model.Model.ApplicantResult> resultList = resultLogic.GetApplicantResults(department,session); string reportPath = ""; string bind_ds = "dsApplicantResult"; reportPath = @"Reports\Result\ApplicantResult.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Applicant Result Detail"; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; if(resultList != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(),resultList)); rv.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { var programmeLogic = new ProgrammeLogic(); List<Programme> programmeList = programmeLogic.GetModelsBy(p => p.Programme_Id == 1); programmeList.Insert(0,new Programme { Id = 0,Name = "-- Select Programme --" }); Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,programmeList,Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if(Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch(Exception) { throw; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } DisplayReport(SelectedSession,Department); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { try { if(Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if(departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment,Utility.GetDepartmentByProgramme(programme),Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ Layout = null; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <br /> <div class="container"> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) return; } </div> </div> <div class="row"> <div class="col-md-12"> <div class="row"> <div> <center> <table style="margin-bottom: 7px"> <tr> <td> <h3><strong>THE FEDERAL POLYTECHNIC, ILARO</strong></h3> </td> </tr> <tr style="text-align: center"> <td><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" width="100px" height="100px" /></td> </tr> <tr style="text-align: center"> <td>P.M.B. 50, ILARO, OGUN STATE NIGERIA.</td> </tr> <tr style="text-align: center"> <td><b>OFFICE OF THE REGISTRAR</b></td> </tr> </table> </center> </div> </div> </div> </div> <div class="row"> <div class="col-md-12 "> <div class="pull-right"> <b><p>Date:</p></b> @DateTime.Now.ToLongDateString() <br /> </div> </div> </div> <br /> <div class="row"> <div class="col-md-12 "> <div> <b>To: @Model.ApplicationDetail.Person.FullName</b> <br /> <b>Application No: @Model.ApplicationDetail.Number </b> <br /> </div> </div> </div> <img src="@Url.Content(@Model.ApplicationDetail.Person.ImageFileUrl)" alt="" width="100px" height="100px" /> <br /> <div class="row"> <div class="col-md-12 text-justify"> <center> <p> <h4 class="sectitle"><b>SCREENING RESULT</b></h4> </p> </center> Dear @Model.ApplicationDetail.Person.FullName.ToUpper(), <br /> Below is your result for the 2015/2016 PUTME screening examinations <br /> <br /> <p><strong>Examination Number: @Model.ApplicationDetail.ExamNumber</strong></p> @if (Model.jambDetail != null) { <p><strong>Jamb Registration Number: @Model.jambDetail.JambRegistrationNumber</strong></p> <p><strong>Jamb Score: @Model.jambDetail.JambScore</strong></p> } <p><strong>Screening Score: @Model.Result.Total</strong></p> <p> <cite>Note: This is not an offer of admission neither is it an Admission Letter</cite> </p> <br /> <p> <img src="@Url.Content("~/Content/Images/Registrar_signature.jpg")" alt="" width="50px" height="30px" /> </p> <p> <small> <b><NAME></b> <br /> <b>Registrar</b> </small> </p> </div> </div> </div><file_sep>@model Abundance_Nk.Model.Model.Invoice @{ ViewBag.Title = "Invoice"; Layout = null; } <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <br /> @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function() { $("#aPrint").on('click', function() { $(".printable").print(); return false; }); }); </script> } <div class="printable"> <div class="container"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null || Model.Person == null || Model.Payment == null) { return; } </div> <div class="row"> <div class="col-xs-6"> <h5 class="lg-title mb10">From</h5> <div> <strong>@Model.Person.FullName</strong><br> <abbr title="Phone">Email:</abbr> @Model.Person.Email <br> <abbr title="Phone">Phone:</abbr> @Model.Person.MobilePhone <br /> <br /> @if (Model != null) { if (!string.IsNullOrEmpty(Model.JambRegistrationNumber)) { <span><b>Payment Type:</b>: @Model.Payment.FeeType.Name</span> } else if (Model.Payment != null && Model.Payment.FeeType != null && !string.IsNullOrEmpty(Model.JambRegistrationNumber)) { <br /> <span><b>JAMB Reg. No.</b>: @Model.JambRegistrationNumber</span> } if (!string.IsNullOrEmpty(Model.MatricNumber)) { <span><b>Matric Number:</b>: @Model.MatricNumber</span> } } </div> </div><!-- col-sm-6 --> <div class="col-xs-6 text-right"> <h5 class="subtitle mb10">Invoice No.</h5> <h4 class="text-primary">@Model.Payment.InvoiceNumber</h4> @if (Model.remitaPayment != null && Model.remitaPayment.RRR != null) { <h5 class="subtitle mb10">RRR No.</h5> <h4 class="text-primary">@Model.remitaPayment.RRR</h4> } @if (Model.paymentEtranzactType != null) { <h5 class="subtitle mb10">Etranzact Payment Type</h5> <h4 class="text-primary">@Model.paymentEtranzactType.Name</h4> } <h5 class="subtitle mb10">To</h5> <div> <strong>The Federal Polytechnic, Ilaro</strong><br> P.M.B. 50, Ilaro, Ogun State.<br> </div> <br /> <p><strong>Invoice Date:</strong> @DateTime.Now.ToLongDateString()</p> </div> </div><!-- row --> <div class="table-responsive"> <table class="table table-bordered table-dark table-invoice"> <thead> <tr> <th>Item</th> <th>Quantity</th> <th>Unit Price (₦)</th> <th>Total Price (₦)</th> </tr> </thead> <tbody> <tr> <td> <h5><a href="">@Model.Payment.FeeType.Name</a></h5> </td> <td>1</td> <td>@Model.Amount.ToString("n")</td> <td>@Model.Amount.ToString("n")</td> </tr> <tr> <td> <h5><a href=""></a></h5> <p></p> </td> <td></td> <td></td> <td></td> </tr> <tr> <td> <h5><a href=""></a></h5> <p> </p> </td> <td></td> <td></td> <td></td> </tr> <tr> <td> <h5><a href=""></a></h5> <p></p> </td> <td></td> <td></td> <td></td> </tr> </tbody> </table> </div><!-- table-responsive --> <table class="table table-total"> <tbody> <tr> <td>Sub Total:</td> <td>@Model.Amount.ToString("n")</td> @*<td>@Model.Payment.Fee.Amount</td>*@ </tr> <tr> <td>VAT:</td> <td>0.00</td> </tr> <tr> <td>TOTAL:</td> <td>@Model.Amount.ToString("n")</td> </tr> </tbody> </table> </div><!-- panel-body --> <div class="well nomargin" style="margin: 20px"> Thank you for choosing our school. </div> </div><!-- panel --> </div> </div><file_sep><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaymentReportGeneral.aspx.cs" Inherits="Abundance_Nk.Web.Reports.Presenter.PaymentReportGeneral" %> <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=172.16.17.32, Culture=neutral, PublicKeyToken=<KEY>" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link href="../../Content/bootstrap.min.css" rel="stylesheet" /> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="6000000"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <p> <asp:Label ID="lblMessage" runat="server"></asp:Label> </p> <div class="form-inline"> <br /> <div class="form-group"> <div class="form-group"> <asp:TextBox ID="txtBoxDateFrom" runat="server" RepeatDirection="Horizontal" class="form-control" placeholder="Start Date"></asp:TextBox> <asp:TextBox ID="txtBoxDateTo" runat="server" RepeatDirection="Horizontal" class="form-control" placeholder="End Date"></asp:TextBox> </div> <div class="form-group"> <label class="sr-only" for="ddlProgramme"></label> <asp:DropDownList ID="ddlProgramme" CssClass="form-control" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProgramme_SelectedIndexChanged"></asp:DropDownList> </div> <div class="form-group"> <label class="sr-only" for="ddlDepartment"></label> <asp:DropDownList ID="ddlDepartment" CssClass="form-control" runat="server"></asp:DropDownList> </div> <div class="form-group"> <label class="sr-only" for="ddlFeeTypes"></label> <asp:DropDownList ID="ddlFeeTypes" CssClass="form-control" runat="server"></asp:DropDownList> </div> <asp:Button ID="Display_Button" runat="server" Text="Display Report" Width="111px" class="btn btn-success " OnClick="btnDisplayReport_Click" /> <div class="form-group"> <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/Content/Images/bx_loader.gif" /> Loading... </ProgressTemplate> </asp:UpdateProgress> </div> </div> </div> <rsweb:ReportViewer ID="rv" runat="server" Font-Names="Verdana" Font-Size="8pt" ShowBackButton="False" ShowCredentialPrompts="False" ShowDocumentMapButton="False" ShowFindControls="False" ShowPageNavigationControls="False" ShowParameterPrompts="False" ShowPromptAreaButton="False" ShowPrintButton="true" Height="800px" Width="100%" BackColor="White" BorderStyle="None"> </rsweb:ReportViewer> </ContentTemplate> </asp:UpdatePanel> </div> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="../../Scripts/jquery-2.1.3.js"></script> <script src="../../Scripts/bootstrap.min.js"></script> <link href="../../Content/jquery-ui-1.10.3.css" rel="stylesheet" /> <script src="../../Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript"> $(function () { $('#txtBoxDateFrom').datepicker( { dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: '1950:2100' }); $('#txtBoxDateTo').datepicker( { dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: '1950:2100' }); ////function myAlrt() { // alert("Hi"); ////}; }) </script> </form> </body> </html><file_sep>@model Abundance_Nk.Model.Model.Fee @{ ViewBag.Title = "Edit Fee"; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function() { $('.datepicker').datepicker({ format: 'dd/mm/yyyy', autoclose: true, }); }); </script> } <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @Html.Partial("_IndexSetupHeader", -1) @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Id) @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null) { return; } <div class="form-group"> @Html.LabelFor(model => model.Name, "Fee Type", new {@class = "control-label col-md-2"}) <div class="col-md-10 "> @*@Html.DropDownList("TypeId", String.Empty)*@ @Html.DropDownListFor(f => f.Name, null, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Amount, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.Amount, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Amount) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index") </div> <hr /><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class NotificationOfResultBulk :Page { private List<Department> departments; private List<Semester> semesters; private List<SessionSemester> sessionSemesterList; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Semester SelectedSemester { get { return new Semester { Id = Convert.ToInt32(ddlSemester.SelectedValue), Name = ddlSemester.SelectedItem.Text }; } set { ddlSemester.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!Page.IsPostBack) { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; ddlSemester.Visible = false; } } catch(Exception) { throw; } } protected void Display_Button_Click1(object sender,EventArgs e) { try { Session session = SelectedSession; Semester semester = SelectedSemester; Programme programme = SelectedProgramme; Department department = SelectedDepartment; Level level = SelectedLevel; if(InvalidUserInput(session,semester,department,level,programme)) { lblMessage.Text = "All fields must be selected"; return; } if(Directory.Exists(Server.MapPath("~/Content/temp"))) { Directory.Delete(Server.MapPath("~/Content/temp"),true); } else { DirectoryInfo folder = Directory.CreateDirectory(Server.MapPath("~/Content/temp")); int filesInFolder = folder.GetFiles().Count(); if(filesInFolder > 0) { //complete the code } } List<Model.Model.Result> StudentList = GetResultList(session,semester,department,level,programme); foreach(Model.Model.Result item in StudentList) { var student = new Student { Id = item.StudentId }; List<Model.Model.Result> resultList = GetReportList(semester,session,programme,department,level, student); Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string bind_dsStudentPaymentSummary = "dsNotificationOfResult"; string reportPath = @"Reports\Result\NotificationOfResult.rdlc"; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Notification Of Result"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), resultList)); byte[] bytes = rptViewer.LocalReport.Render("PDF",null,out mimeType,out encoding,out extension, out streamIds,out warnings); string path = Server.MapPath("~/Content/temp"); string savelocation = Path.Combine(path,item.Name + ".pdf"); File.WriteAllBytes(savelocation,bytes); } using(var zip = new ZipFile()) { string file = Server.MapPath("~/Content/temp/"); zip.AddDirectory(file,""); string zipFileName = department.Name; zip.Save(file + zipFileName + ".zip"); string export = "~/Content/temp/" + zipFileName + ".zip"; //Response.Redirect(export, false); var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect( urlHelp.Action("DownloadZip", new { controller = "Result",area = "Admin",downloadName = department.Name }),false); } } catch(Exception) { throw; } } protected void ddlProgramme_SelectedIndexChanged1(object sender,EventArgs e) { try { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } catch(Exception) { throw; } } protected void ddlSession_SelectedIndexChanged(object sender,EventArgs e) { try { var session = new Session { Id = Convert.ToInt32(ddlSession.SelectedValue) }; var semesterLogic = new SemesterLogic(); var sessionSemesterLogic = new SessionSemesterLogic(); sessionSemesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); semesters = new List<Semester>(); foreach(SessionSemester item in sessionSemesterList) { semesters.Add(item.Semester); } Utility.BindDropdownItem(ddlSemester,semesters,Utility.ID,Utility.NAME); ddlSemester.Visible = true; } catch(Exception) { throw; } } private List<Model.Model.Result> GetReportList(Semester semester,Session session,Programme programme, Department department,Level level,Student student) { List<Model.Model.Result> resultList = null; var studentResultLogic = new StudentResultLogic(); if(semester.Id == 1) { List<Model.Model.Result> result = null; result = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student,semester, programme); decimal? firstSemesterGPCUSum = result.Sum(p => p.GPCU); int? firstSemesterTotalSemesterCourseUnit = 0; var studentResultFirstSemester = new Model.Model.Result(); studentResultFirstSemester = result.FirstOrDefault(); firstSemesterTotalSemesterCourseUnit = studentResultFirstSemester.TotalSemesterCourseUnit; decimal? firstSemesterGPA = firstSemesterGPCUSum / firstSemesterTotalSemesterCourseUnit; studentResultFirstSemester.GPA = firstSemesterGPA; studentResultFirstSemester.CGPA = firstSemesterGPA; studentResultFirstSemester.StudentTypeName = GetGraduatingDegree(studentResultFirstSemester.ProgrammeId); studentResultFirstSemester.GraduationStatus = GetGraduationStatus(studentResultFirstSemester.CGPA); resultList = new List<Model.Model.Result>(); resultList.Add(studentResultFirstSemester); } else { List<Model.Model.Result> result = null; var firstSemester = new Semester { Id = 1 }; result = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student, firstSemester,programme); decimal? firstSemesterGPCUSum = result.Sum(p => p.GPCU); int? firstSemesterTotalSemesterCourseUnit = 0; var studentResultFirstSemester = new Model.Model.Result(); studentResultFirstSemester = result.FirstOrDefault(); firstSemesterTotalSemesterCourseUnit = studentResultFirstSemester.TotalSemesterCourseUnit; decimal? firstSemesterGPA = firstSemesterGPCUSum / firstSemesterTotalSemesterCourseUnit; studentResultFirstSemester.GPA = firstSemesterGPA; var secondSemester = new Semester { Id = 2 }; var studentResultSecondSemester = new Model.Model.Result(); List<Model.Model.Result> secondSemesterResultList = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student,secondSemester, programme); decimal? secondSemesterGPCUSum = secondSemesterResultList.Sum(p => p.GPCU); studentResultSecondSemester = secondSemesterResultList.FirstOrDefault(); studentResultSecondSemester.GPA = Decimal.Round( (decimal)(secondSemesterGPCUSum / studentResultSecondSemester.TotalSemesterCourseUnit),2); studentResultSecondSemester.CGPA = Decimal.Round( (decimal) ((firstSemesterGPCUSum + secondSemesterGPCUSum) / (studentResultSecondSemester.TotalSemesterCourseUnit + firstSemesterTotalSemesterCourseUnit)), 2); studentResultSecondSemester.StudentTypeName = GetGraduatingDegree(studentResultSecondSemester.ProgrammeId); studentResultSecondSemester.GraduationStatus = GetGraduationStatus(studentResultSecondSemester.CGPA); resultList = new List<Model.Model.Result>(); resultList.Add(studentResultSecondSemester); } return resultList; } private string GetGraduationStatus(decimal? CGPA) { string title = null; try { if(CGPA >= 3.5M && CGPA <= 4.0M) { title = "DISTICTION"; } else if(CGPA >= 3.0M && CGPA <= 3.49M) { title = "UPPER CREDIT"; } else if(CGPA >= 2.5M && CGPA <= 2.99M) { title = "LOWER CREDIT"; } else if(CGPA >= 2.0M && CGPA <= 2.49M) { title = "PASS"; } else if(CGPA < 2.0M) { title = "POOR"; } } catch(Exception) { throw; } return title; } private string GetGraduatingDegree(int? progId) { try { if(progId == 1 || progId == 2) { return "NATIONAL DIPLOMA"; } return "HIGHER NATIONAL DIPLOMA"; } catch(Exception) { throw; } } private List<Model.Model.Result> GetResultList(Session session,Semester semester,Department department, Level level,Programme programme) { try { var filteredResult = new List<Model.Model.Result>(); var studentResultLogic = new StudentResultLogic(); List<string> resultList = studentResultLogic.GetProcessedResutBy(session,semester,level,department,programme) .Select(p => p.MatricNumber) .AsParallel() .Distinct() .ToList(); List<Model.Model.Result> result = studentResultLogic.GetProcessedResutBy(session,semester,level, department,programme); foreach(string item in resultList) { Model.Model.Result resultItem = result.Where(p => p.MatricNumber == item).FirstOrDefault(); filteredResult.Add(resultItem); } return filteredResult.OrderBy(p => p.Name).ToList(); } catch(Exception) { throw; } } private bool InvalidUserInput(Session session,Semester semester,Department department,Level level, Programme programme) { try { if(session == null || session.Id <= 0 || semester == null || semester.Id <= 0 || department == null || department.Id <= 0 || programme == null || programme.Id <= 0 || level == null || level.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBFormPaymentViewModel @{ ViewBag.Title = "Post JAMB Programme"; Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function() { //var items = $('#AppliedCourse_Option_Id option').size(); //if (items > 0) { // $("#divDepartmentOption").show(); //} //else { // $("#divDepartmentOption").hide(); //} var selectedProgramme = $("#Programme_Id").val(); if (selectedProgramme == 1) { $("#divJambNo").show(); } else { $("#divJambNo").hide(); } $("#Programme_Id").change(function() { var programme = $("#Programme_Id").val(); if (programme == 1) { $("#divJambNo").show(); $("#divDepartmentOption").hide(); } else if (programme == 2) { $("#divJambNo").hide(); $("#divDepartmentOption").hide(); } else if (programme == 3) { $("#divJambNo").hide(); $("#divDepartmentOption").show(); } else if (programme == 4) { $("#divJambNo").hide(); $("#divDepartmentOption").show(); } else { $("#divJambNo").hide(); $("#divDepartmentOption").hide(); } $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); //Load Department Option $("#AppliedCourse_Department_Id").change(function() { var department = $("#AppliedCourse_Department_Id").val(); var programme = $("#Programme_Id").val(); $("#AppliedCourse_Option_Id").empty(); //if (department == 9 || department == 15 || department == 20) { $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: department, programmeid: programme }, success: function(departmentOptions) { //$("#hfDepartmentOptionExist").val(departmentOptions[0]); if (departmentOptions == "" || departmentOptions == null || departmentOptions == undefined) { $("#divDepartmentOption").hide(); } else { $("#AppliedCourse_Option_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function(i, Option) { $("#AppliedCourse_Option_Id").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); if (programme > 2) { $("#divDepartmentOption").show(); } } }, error: function(ex) { alert('Failed to retrieve department Options.' + ex); } }); }); //alert("Please double-check all entries you have made; you cannot change any of your information once you have generated an invoice."); }) </script> @using (Html.BeginForm("RRRApplicationForms", "Form", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> <div class="panel panel-success-head"> <div class="panel-heading"> <h2>Application Form Invoice</h2> <p><b>Provide your programme and course of choice, then fill other personal details below. </b></p> </div> </div> <div class="panel panel-custom"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="row"> <h3>Choose Programme</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, "Course", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.AppliedCourse.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div id="divJambNo" class="form-group" style="display: none"> @Html.LabelFor(model => model.JambRegistrationNumber, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.JambRegistrationNumber, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.JambRegistrationNumber, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group" style="display: none"> @Html.LabelFor(model => model.AppliedCourse.Option.Id, "Course Option", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.AppliedCourse.Option.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentOptionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Option.Id, null, new {@class = "text-danger"}) </div> </div> </div> </div> </div> <br /> <div class="row"> <h3>Please enter other personal details</h3> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.LastName, null, new {@class = "text-danger"}) </div><!-- form-group --> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new {@class = "text-danger"}) </div> </div><!-- form-group --> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.State.Id, new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>) ViewBag.StateId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new {@class = "text-danger"}) </div> </div><!-- form-group --> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control", @placeholder = "080XXXXXXXX"}) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new {@class = "text-danger"}) </div> </div><!-- form-group --> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Email, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.Email, null, new {@class = "text-danger"}) </div> </div><!-- form-group --> </div><!-- row --> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.remitaPayment.RRR, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.remitaPayment.RRR, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.remitaPayment.RRR, null, new {@class = "text-danger"}) </div> </div><!-- form-group --> <div class="col-md-6"> <div class="form-group"> </div> </div><!-- form-group --> </div><!-- row --> </div> </div> <div class="col-md-1"></div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-sm-10 "> <div class="form-inline"> <div class="form-group"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Generate Invoice" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <!-- panel-footer --> </div><!-- panel --> </div> <!-- panel-body --> }<file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel @{ ViewBag.Title = "Generate Invoice"; Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var items = $('#StudentLevel_DepartmentOption_Id option').size(); if (items > 0) { $("#divDepartmentOption").show(); } else { $("#divDepartmentOption").hide(); } $("#StudentLevel_Programme_Id").change(function() { var programme = $("#StudentLevel_Programme_Id").val(); $("#StudentLevel_Department_Id").empty(); $("#StudentLevel_Level_Id").empty(); $.ajax({ type: 'GET', url: '@Url.Action("GetDepartmentAndLevelByProgrammeId", "Payment")', dataType: 'json', data: { id: programme }, success: function(data) { var levels = data.Levels; var departments = data.Departments; if (departments != "" && departments != null && departments != undefined) { $("#StudentLevel_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#StudentLevel_Department_Id").append('<option value="' + department.Id + '">' + department.Name + '</option>'); }); } if (levels != "" && levels != null && levels != undefined) { $("#StudentLevel_Level_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(levels, function(i, level) { $("#StudentLevel_Level_Id").append('<option value="' + level.Id + '">' + level.Name + '</option>'); }); } }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); //Load Department Option $("#StudentLevel_Department_Id").change(function() { var department = $("#StudentLevel_Department_Id").val(); var programme = $("#StudentLevel_Programme_Id").val(); $("#StudentLevel_DepartmentOption_Id").empty(); if (programme > 2) { $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: department, programmeid: programme }, success: function(departmentOptions) { if (departmentOptions == "" || departmentOptions == null || departmentOptions == undefined) { $("#divDepartmentOption").hide(); } else { $("#StudentLevel_DepartmentOption_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function(i, Option) { $("#StudentLevel_DepartmentOption_Id").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); $("#divDepartmentOption").show(); } }, error: function(ex) { alert('Failed to retrieve department Options.' + ex); } }); } }); //alert("Please Cross-check all the fields as changes would not be allowed afterwards"); }) </script> @using (Html.BeginForm("Step_1", "ExtraYear", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.FeeType.Id) @Html.HiddenFor(model => model.PaymentMode.Id) @Html.HiddenFor(model => model.PaymentType.Id) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.StudentAlreadyExist) if (Model.StudentAlreadyExist) { @Html.HiddenFor(model => model.StudentLevel.Department.Faculty.Id) ; } <div class="row"> <div class="col-md-12"> <div class="panel panel-success"> <div class="panel-heading"> <h2>School Fees Invoice</h2> <p><b>Provide your programme, course of choice, fill other personal details below and then click the Generate Invoice button to generate your invoice.</b></p> </div> </div> @if (Model.StudentAlreadyExist) { @Html.Partial("_RegisteredStudent", Model) ; } else { @Html.Partial("_UnRegisteredStudent", Model) ; } <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10 "> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Next" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.PostjambResultSupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function () { $.extend($.fn.dataTable.defaults, { responsive: true }); $('#studentTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } },, 'colvis' ] }); }); </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">Student Details</p></h4> </div> @using (Html.BeginForm("StudentDetails", "PostJamb", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> </div> <br/> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit"/> </div> </div> </div> </div> </div> </div> } <div class="row"> @if (Model == null || Model.StudentDetailList == null) { return; } @if (Model != null && Model.StudentDetailList != null) { <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="studentTable"> <thead> <tr> <th>SN</th> <th>Name</th> <th>Sex</th> <th>Phone Number</th> <th>Matric Number</th> <th>Application Number</th> <th>Programme</th> <th>Department</th> <th>Level</th> <th>Sesion</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.StudentDetailList.Count; i++) { var SN = i + 1; <tr> <td>@SN</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].FullName)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].Sex)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].PhoneNumber)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].MatricNumber)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].ApplicationForm)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].Program)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].Department)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].Level)</td> <td>@Html.DisplayTextFor(m => m.StudentDetailList[i].Session)</td> </tr> } </tbody> </table> </div> } </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "ManageDepartment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <br /> <br /> <br /> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="panel panel-default"> <div class="panel-heading"> <h2 style="font-size: large">Manage Programme Department</h2> </div> <div class="row panel-body"> <div class="col-md-10"> @using (Html.BeginForm("ManageDepartment", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, "Programme",new { @class = "control-label col-md-2" }) <div class="col-md-6"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } </div> </div> @if (Model.ShowTable==true) { <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("DeactivateActivateProgrammeDepartment", "Support", new { area = "Admin" }, FormMethod.Post)) { @*<h3 class="text-center">Departments</h3>*@ <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th>S/N</th> <th>DEPARTMENT NAME</th> <th>ACTIVE</th> <th>ACTIVE FOR PUTME</th> <th>ACTIVATE</th> <th>FOR PUTME APPLICATION</th> </tr> </thead> <tbody> @for (int i = 0; i < @Model.ProgrammeDepartments.Count; i++) { int sn = i + 1; var active = Model.ProgrammeDepartments[i].Activate == true ? "Active" : "In-Active"; var activePUTME = Model.ProgrammeDepartments[i].ActivePUTMEApplication == true ? "Active" : "In-Active"; <tr> @Html.HiddenFor(model => model.ProgrammeDepartments[i].Id) @Html.HiddenFor(model => model.ProgrammeDepartments[i].Programme.Id) <td>@sn</td> <td>@Model.ProgrammeDepartments[i].Department.Name.ToUpper()</td> <td>@active</td> <td>@activePUTME</td> <td>@Html.CheckBoxFor(m => m.ProgrammeDepartments[i].Activate, new { @type = "checkbox", @class = "checkbox" })</td> <td>@Html.CheckBoxFor(m => m.ProgrammeDepartments[i].ActivePUTMEApplication, new { @type = "checkbox", @class = "checkbox" })</td> </tr> } </tbody> </table> <br /> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> } </div> </div> } </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "EditRole"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("EditRole", "User", FormMethod.Post)) { @Html.HiddenFor(model => model.User.Id) <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-edit"> Edit</i></h4> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Username, "Username: ", new {@class = "control-label "}) @Html.DisplayFor(model => model.User.Username, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Role.Name, "Role", new {@class = "control-label "}) @Html.DropDownListFor(model => model.User.Role.Id, (IEnumerable<SelectListItem>) ViewBag.Role, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.User.Role.Name) </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "EditHostelAllocationCriteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Edit Hostel Allocation Criteria</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("EditHostelAllocationCriteria", "HostelAllocation", FormMethod.Post)) { @Html.HiddenFor(model=>model.HostelAllocationCriteria.Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Series.Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Hostel.Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Room.Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Corner.Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Level.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.LevelId, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> Edit All BedSpaces: @Html.CheckBoxFor(model => model.HostelAllocationCriteria.EditAll, new { @type = "checkbox" }) </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update Criteria" /> | @Html.ActionLink("Back", "ViewHostelAllocationCriteria", null, new { @class = "btn btn-success mr5" }) </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Referee Details</div> </div> @for(int i = 0;i < Model.ApplicantReferees.Count;i++) { <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Name,new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Name,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Rank,new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Rank,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Rank) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Department,new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Department,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Department) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Institution,new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Institution,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Institution) </div> </div> </div> </div> } </div><file_sep>@model Abundance_Nk.Web.Areas.PGStudent.ViewModels.PGCourseRegistrationViewModel @{ /**/ } <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/custom.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> @* ReSharper disable once UnusedLocals *@ <script type="text/javascript"> $(document).ready(function () { BindCheckBoxes(); UpdateUIState(); $("#btnRegisterCourse").click(function () { try { //disable the button to avoid several clickingpreventing duplicate course registration $('#btnRegisterCourse').off('click'); var data = $('#frmCourseRegistration').serialize(); $.ajax({ type: "POST", url: "@Url.Action("Form", "CourseRegistration")", dataType: "json", data: $("#frmCourseRegistration").serialize(), beforeSend: function () { $("#processing").show(); }, complete: function () { $("#processing").hide(); }, success: SuccessFunc, error: ErrorFunc, }); function SuccessFunc(data, status) { if (data.message.indexOf("Error Occurred") <= -1) { $('#btnRegisterCourse').prop('disabled', true); $("#selectAllFirstSemester").prop('disabled', true); $("#selectAllSecondSemester").prop('disabled', true); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); $('#divCourseFormPrintOut').show(); } alert(data.message); } function ErrorFunc() { alert("Operation failed!"); } } catch (e) { alert(e); } }); function InvalidUserInput() { try { var firstSemesterMinimumUnit = $('#FirstSemesterMinimumUnit').val(); var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMinimumUnit = $('#SecondSemesterMinimumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); var firstSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb1")); var secondSemesterSelectedUnit = CalculateSelectedCourseUnit($(".ckb2")); firstSemesterSelectedUnit += parseInt(firstSemesterCarryOverTotalUnit); secondSemesterSelectedUnit += parseInt(secondSemesterCarryOverTotalUnit); console.log("first semester unit: " + firstSemesterSelectedUnit); console.log("second semester unit: " + secondSemesterSelectedUnit); if (firstSemesterSelectedUnit < firstSemesterMinimumUnit) { console.log("firstSemesterSelectedUnit: "+firstSemesterSelectedUnit + " is less than 15"); return true; } else if (firstSemesterMaximumUnit < firstSemesterSelectedUnit) { console.log("24 is less than: " + firstSemesterSelectedUnit); return true; } //else if (secondSemesterSelectedUnit < secondSemesterMinimumUnit) { // console.log("SecondSemesterSelectedUnit: " + secondSemesterSelectedUnit + " is less than 15"); // return true; //} //else if (secondSemesterMaximumUnit < secondSemesterSelectedUnit) { // console.log("24 is less than: " + SecondSemesterSelectedUnit ); // return true; //} return false; } catch (e) { throw e; } } function BindCheckBoxes() { try { BindSelectAll($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectAll($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); BindSelectOne($("#selectAllFirstSemester"), $(".ckb1"), $('#spFirstSemesterTotalCourseUnit')); BindSelectOne($("#selectAllSecondSemester"), $(".ckb2"), $('#spSecondSemesterTotalCourseUnit')); UpdateSelectAllCheckBox($("#selectAllFirstSemester"), $(".ckb1")); UpdateSelectAllCheckBox($("#selectAllSecondSemester"), $(".ckb2")); } catch (e) { alert(e); } } function BindSelectAll(chkBox, chkBoxClass, courseUnitLabel) { chkBox.click(function (event) { try { if (this.checked) { chkBoxClass.each(function () { this.checked = true; }); } else { chkBoxClass.each(function () { this.checked = false; }); } var carryOverUnit = CalculateSelectedCourseUnit($(".ckb3")); var totalUnit = CalculateSelectedCourseUnit(chkBoxClass) + parseInt(carryOverUnit); courseUnitLabel.html(totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateButtonState() { try { console.log("input status: " + InvalidUserInput()); if (InvalidUserInput()) { $('#btnRegisterCourse').prop('disabled', true); } else { $('#btnRegisterCourse').prop('disabled', false); } } catch (e) { throw e; } } function BindSelectOne(chkBox, chkBoxClass, courseUnitLabel) { chkBoxClass.click(function (event) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (!this.checked) { chkBox.removeAttr('checked'); } else { if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } var totalUnit = CalculateSelectedCourseUnit(chkBoxClass); courseUnitLabel.html(totalUnit); //console.log("total unit: " + totalUnit); UpdateButtonState(); } catch (e) { alert(e); } }); } function UpdateSelectAllCheckBox(chkBox, chkBoxClass) { try { var totalSelected = chkBoxClass.filter(":checked").length; var totalCheckBoxCount = chkBoxClass.length; if (totalSelected == totalCheckBoxCount) { chkBox.prop('checked', 'checked'); } } catch (e) { alert(e); } } function CalculateSelectedCourseUnit(checkBox) { try { var totalUnit = 0; var values = new Array(); $.each(checkBox.filter(":checked").closest("td").siblings('.unit'), function () { values.push($(this).text()); }); if (values != null && values.length > 0) { for (var i = 0; i < values.length; i++) { totalUnit += parseInt(values[i]); } } //loop through carryover boxes //values = new Array(); //clear old values //$.each($(".ckb3").filter(":checked").closest("td").siblings('.unit'), // function () { // values.push($(this).text()); // }); //if (values.length > 0) { // for (var i = 0; i < values.length; i++) { // totalUnit += parseInt(values[i]); // } //} return totalUnit; } catch (e) { alert(e); } } function UpdateUIState() { try { var courseAlreadyRegistered = $('#CourseAlreadyRegistered').val(); //console.log("courseAlreadyRegistered:" + courseAlreadyRegistered); if (courseAlreadyRegistered.toLowerCase() == 'true') { $('#btnRegisterCourse').prop('disabled', false); var approved = $('#RegisteredCourse_Approved').val(); if (approved.toLowerCase() == 'true') { $('#buttons').hide('fast'); $(".ckb1").prop('disabled', true); $(".ckb2").prop('disabled', true); //$(".ckb3").prop('disabled', true); } else { $('#buttons').show(); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); } $('#divCourseFormPrintOut').show(); } else { $('#buttons').show(); $('#btnRegisterCourse').prop('disabled', true); $(".ckb1").prop('disabled', false); $(".ckb2").prop('disabled', false); $('#divCourseFormPrintOut').hide('fast'); } var firstSemesterMaximumUnit = $('#FirstSemesterMaximumUnit').val(); var secondSemesterMaximumUnit = $('#SecondSemesterMaximumUnit').val(); var firstSemesterCarryOverTotalUnit = $('#TotalFirstSemesterCarryOverCourseUnit').val(); var secondSemesterCarryOverTotalUnit = $('#TotalSecondSemesterCarryOverCourseUnit').val(); $(".ckb3").prop('disabled', true); if ((parseInt(firstSemesterCarryOverTotalUnit) <= parseInt(firstSemesterMaximumUnit)) && (parseInt(secondSemesterCarryOverTotalUnit) <= parseInt(secondSemesterMaximumUnit))) { $("#selectAllCarryOverCourses").prop('checked', 'checked'); $("#selectAllCarryOverCourses").prop('disabled', true); $(".ckb3").prop('disabled', true); } } catch (e) { throw e; } } }); </script> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="col-md-3"> <div class="logopanel"> <h1><span style="color: #21c">Post Graduate Course Registration</span></h1> </div> <div class="panel panel-default"> <div class="panel-body"> <ul class="leftmenu"> <li> <a href="#"><b>Instructions</b></a> </li> </ul> <ol> <li class="margin-bottom-5">Select your courses of choice</li> <li class="margin-bottom-5">All selected course units must not be greater than 24 and must not be less than 15</li> <li class="margin-bottom-5">Click the Register Course button to register the selected courses</li> <li class="margin-bottom-5">After successful course registration, click on Print Course Form button to print your course form</li> <li class="margin-bottom-5">You can print your course form at any time you want after a successful login.</li> </ol> </div> </div> <div class="panel panel-default"> <div class="panel-body"> </div> </div> </div> <div class="col-md-9"> @using (Html.BeginForm("Form", "CourseRegistration", new { Area = "PGStudent" }, FormMethod.Post, new { id = "frmCourseRegistration" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.CurrentSessionSemester.SessionSemester.Session.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.HiddenFor(model => model.TotalSecondSemesterCarryOverCourseUnit) @Html.HiddenFor(model => model.TotalFirstSemesterCarryOverCourseUnit) @Html.HiddenFor(model => model.FirstSemesterMinimumUnit) @Html.HiddenFor(model => model.FirstSemesterMaximumUnit) @Html.HiddenFor(model => model.SecondSemesterMinimumUnit) @Html.HiddenFor(model => model.SecondSemesterMaximumUnit) @Html.HiddenFor(model => model.CourseAlreadyRegistered) @Html.HiddenFor(model => model.CarryOverExist) @Html.HiddenFor(model => model.RegisteredCourse.Id) @Html.HiddenFor(model => model.RegisteredCourse.Approved) if (Model.Student != null && Model.Student.ApplicationForm != null) { @Html.HiddenFor(model => model.Student.ApplicationForm.Id) } <div class="shadow custom-text-black"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <div class="col-md-12" style="font-size: 15pt; text-transform: uppercase"> @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.DisplayFor(model => model.Student.FullName) (@Html.DisplayFor(model => model.StudentLevel.Level.Name)) DETAILS </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label " }) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.Label("Session", new { @class = "control-label " }) </div> <div class="col-md-7 "> @Html.HiddenFor(model => model.CurrentSessionSemester.SessionSemester.Session.Id) @Html.DisplayFor(model => model.CurrentSessionSemester.SessionSemester.Session.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new { @class = "control-label " }) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.DisplayFor(model => model.StudentLevel.Programme.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-5"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new { @class = "control-label " }) </div> <div class="col-md-7 "> @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.DisplayFor(model => model.StudentLevel.Department.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Name, new { @class = "control-label " }) </div> <div class="col-md-8 "> @Html.DisplayFor(model => model.StudentLevel.Department.Faculty.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> if (Model != null && Model.CarryOverCourses != null && Model.CarryOverCourses.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-md-12"> <b>Carry Over Courses</b> <div class="pull-right record-count-label"> @if (Model.TotalFirstSemesterCarryOverCourseUnit > 0) { <label class="caption">1st Semester Total Unit</label><span class="badge">@Model.TotalFirstSemesterCarryOverCourseUnit</span> } else if (Model.TotalSecondSemesterCarryOverCourseUnit > 0) { <label class="caption">2nd Semester Total Unit</label><span class="badge">@Model.TotalSecondSemesterCarryOverCourseUnit</span> } <span class="caption">Total Course</span><span class="badge">@Model.CarryOverCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @Html.CheckBox("selectAllCarryOverCourses") </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> <th> Semester </th> </tr> </thead> @for (int i = 0; i < Model.CarryOverCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.IsRegistered) @Html.CheckBoxFor(model => Model.CarryOverCourses[i].Course.IsRegistered, new { @class = "ckb3", id = Model.CarryOverCourses[i].Course.Id }) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Code) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Unit) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Type.Name) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.CarryOverCourses[i].Semester.Id) @Html.DisplayFor(model => Model.CarryOverCourses[i].Semester.Name) </td> @Html.HiddenFor(model => Model.CarryOverCourses[i].Id) @Html.HiddenFor(model => Model.CarryOverCourses[i].Mode.Id) @Html.HiddenFor(model => Model.CarryOverCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div> </div> </div> </div> } <div class="panel panel-default"> <div class="panel-body"> <div id="divFirstSemesterCourses"> @if (Model != null && Model.FirstSemesterCourses != null && Model.FirstSemesterCourses.Count > 0) { @Html.Partial("_PGFirstSemester") } </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <div id="divSecondSemesterCourses"> @if (Model != null && Model.SecondSemesterCourses != null && Model.SecondSemesterCourses.Count > 0) { @Html.Partial("_PGSecondSemester") } </div> </div> </div> <div class="row" id="buttons" style="display: none"> <div class="col-md-12"> <div> <div class="form-inline "> <div class="form-group"> <input type="button" id="btnRegisterCourse" value="Register Course" class="btn btn-white btn-lg" /> </div> <div id="divCourseFormPrintOut" class="form-group" style="display: none"> @Html.ActionLink("Print Course Form", "CourseFormPrintOut", "CourseRegistration", new { Area = "PGStudent", sid = Model.Student.Id, semesterId = Model.Semester.Id, sessionId = Model.CurrentSessionSemester.SessionSemester.Session.Id }, new { @class = "btn btn-primary btn-lg ", target = "_blank", id = "alCourseRegistration" }) </div> <div class="form-group"> <div id="processing" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> </div> } </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.MenuViewModel @{ ViewBag.Title = "ViewMenuByMenuGroup"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>View Menu</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("ViewMenuByMenuGroup", "Menu", new {Area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.MenuGroup.Name, "Menu Group", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.MenuGroup.Id, (IEnumerable<SelectListItem>) ViewBag.MenuGroup, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.MenuGroup.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } </div> </div> <br /> <div class="panel-body"> <div class="col-md-12"> @if (Model.MenuList != null && Model.MenuList.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Area </th> <th> Controller </th> <th> Action </th> <th> Display Name </th> <th> Activated </th> <th> Edit </th> <th> Delete </th> </tr> @for (int i = 0; i < Model.MenuList.Count; i++) { <tr> <td> @Model.MenuList[i].Area </td> <td> @Model.MenuList[i].Controller </td> <td> @Model.MenuList[i].Action </td> <td> @Model.MenuList[i].DisplayName </td> <td> @Model.MenuList[i].Activated </td> <td> @Html.ActionLink("Edit", "EditMenu", "Menu", new {Area = "Admin", mid = Model.MenuList[i].Id}, new {@class = "btn btn-success "}) </td> <td> @Html.ActionLink("Delete", "ConfirmDeleteMenu", "Menu", new {Area = "Admin", mid = Model.MenuList[i].Id}, new {@class = "btn btn-success "}) </td> </tr> } </table> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; ViewBag.Title = "View Duplicates"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> @*<script src="~/Scripts/dataTables.js"></script> <link href="~/Content/dataTables.css" rel="stylesheet"/>*@ <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } },, 'colvis' ] }); }); </script> <div class="container"> <div class="well"> <p class="text-success">These records already exist on the admission list, the others have been uploaded successfully</p> </div> <div class="panel panel-default"> <div class="panel-body"> <table class="table" id="myTable"> <thead> <tr> <th> Jamb Number </th> <th> Surname </th> <th> Firstname </th> <th> Othername </th> <th> Department Admitted </th> </tr> </thead> <tbody> @foreach (var item in Model.ExistingAdmissions) { <tr> <td> @Html.DisplayFor(modelItem => item.ApplicantJambDetail.JambRegistrationNumber) </td> <td> @Html.DisplayFor(modelItem => item.ApplicantJambDetail.Person.LastName) </td> <td> @Html.DisplayFor(modelItem => item.ApplicantJambDetail.Person.FirstName) </td> <td> @Html.DisplayFor(modelItem => item.ApplicantJambDetail.Person.OtherName) </td> <td> @Html.DisplayFor(modelItem => item.Deprtment.Name) </td> </tr> } </tbody> </table> </div> </div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "E-Learning"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function () { //$('#videoUrl').hide(); $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, retrieve: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); $('#btnCreate').on('click', function () { $('.Load').show(); var courseTopic = $('#topic').val(); var description = $('#description').val(); var active = false; var from = $('#fromDate').val(); var to = $('#toDate').val(); var fromtime = $('#fromTime').val(); var totime = $('#toTime').val(); var courseAllocationId=$('#CourseAllocation_Id').val(); if ($('#active').is(':checked')) { active = true; } $('#econtentType').empty(); $.ajax({ type: 'POST', url: '@Url.Action("CreateTopic", "Elearning")', // Calling json method dataType: 'json', data: { topic: courseTopic, coursedescription: description, active: active, to: to, from: from, courseAllocationId: courseAllocationId, fromtime: fromtime, totime: totime }, success: function (result) { if (!result.IsError) { var topics = result.EContentTypes; $("#econtentType").append('<option value="' + 0 + '">' + '-- Select Topic --' + '</option>'); $.each(topics, function (i, topic) { $("#econtentType").append('<option value="' + topic.Id + '">' + topic.Name + '</option>'); }); swal({ title: "success", text: result.Message, type: "success" }); } else { swal({ title: "info", text: result.Message, type: "success" }); } $('#editeModal').modal('hide'); $('.Load').hide(); }, error: function (ex) { $('#editeModal').modal('hide'); $('.Load').hide(); alert('Failed to Create Topic.' + ex); } }); return false; }); $('#btnShowModal').on('click', function () { $('#editeModal').modal('show'); }); }); function DeleteEcourseContent(id) { var response = confirm("Are you sure You want to Delete Content?"); if (response) { $.ajax({ type: 'POST', url: '@Url.Action("DeleteEContent", "Elearning")', // Calling json method traditional: true, data: { id }, success: function (result) { if (!result.isError && result.Message) { alert(result.Message); location.reload(true); } }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } else { return false; } } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <h2>View Content</h2> @using (Html.BeginForm("AddContent", "Elearning", new { area = "Admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>E-Learning Content Manager</h3> </div> <div class="panel-body"> @Html.HiddenFor(model => model.eCourse.Course.Id) @Html.HiddenFor(model => model.CourseAllocation.Id) <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Id, "Topic", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.eCourse.EContentType.Id, (IEnumerable<SelectListItem>)ViewBag.Topics, new { @class = "form-control", @id = "econtentType" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Id, null, new { @class = "text-danger" }) </div> </div> &nbsp; <div class="form-group"> @Html.Label("File", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="file" accept="application/pdf" title="Upload Result" id="fileInput" name="file" class="form-control" /> </div> &nbsp; </div> <div class="form-group" id="videoUrl"> @Html.LabelFor(model => model.eCourse.VideoUrl, "Enter Video Link", new { @class = "col-sm-2 control-label" }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.eCourse.VideoUrl, new { @class = "form-control", placeholder = "Youtube-Link" }) </div> </div> &nbsp; <div class="form-group"> @Html.LabelFor(model => model.eCourse.LiveStreamLink, "Zoom Link", new { @class = "col-sm-2 control-label" }) <div class="col-sm-10"> <div class="row"> <div class="col-sm-6"> @Html.TextBoxFor(model => model.eCourse.LiveStreamLink, new { @class = "form-control", placeholder = "Zoom-Link" }) </div> <div class="col-sm-6"> <h6 style="color:red">*Copy and Paste the link on the Zoom-Link Textbox</h6> <div class="col-sm-4"> <a href="https://zoom.us" class="btn btn-primary" target="_blank">Schedule Live Class</a> </div> </div> </div> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="Save" />| <input class="btn btn-primary mr5 " type="button" name="submit" id="btnShowModal" value="Add Topic" /> </div> </div> </div> </div> } @if (Model.ECourseList != null && Model.ECourseList.Count() > 0) { <div class="panel panel-danger"> <div class="panel-body"> <div class=" table-responsive"> <table class="table-bordered table-hover table-striped table" id="myTable" style="width:100%"> <thead> <tr> <th> Course Code </th> <th> Course Name </th> <th> Topic </th> <th> Start Time </th> <th> End Time </th> <th> No of Views </th> <th> Status </th> <th> Text/Graphic </th> <th> Video </th> <th> Live Streaming </th> <th> Attendance </th> <th> General Attendance </th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.ECourseList.Count(); i++) { <tr> <td> @Model.ECourseList[i].Course.Code </td> <td> @Model.ECourseList[i].Course.Name </td> <td> @Model.ECourseList[i].EContentType.Name </td> <td> @Model.ECourseList[i].EContentType.StartTime </td> <td> @Model.ECourseList[i].EContentType.EndTime </td> <td> @Model.ECourseList[i].views </td> @if (@Model.ECourseList[i].EContentType.Active == true) { <td>Active</td> } else { <td>Not Active</td> } <td> @if (Model.ECourseList[i].Url != null) { <a href="@Url.Content(Model.ECourseList[i].Url)" class="btn btn-secondary" target="_blank">View</a> } </td> <td> @if (Model.ECourseList[i].VideoUrl != null) { <a href="@Url.Content(Model.ECourseList[i].VideoUrl)" class="btn btn-primary" target="_blank">View</a> } </td> <td> @if (Model.ECourseList[i].LiveStreamLink != null) { <a href="@Url.Content(Model.ECourseList[i].LiveStreamLink)" class="btn btn-primary" target="_blank">Host</a> } </td> <td> @Html.ActionLink("View", "GetClassAttendanceList", "Elearning", new { Area = "Admin", eContentId = Utility.Encrypt(Model.ECourseList[i].Id.ToString()) }, new { @class = "btn btn-success" }) </td> <td> @Html.ActionLink("View", "GetClassAttendanceForAllTopics", "Elearning", new { Area = "Admin", courseAllocationId = Utility.Encrypt(Model.ECourseList[i].EContentType.CourseAllocation.Id.ToString()) }, new { @class = "btn btn-success" }) </td> <td> <button class="btn btn-primary" onclick="DeleteEcourseContent(@Model.ECourseList[i].Id)">Delete</button> </td> </tr> } </tbody> </table> </div> </div> </div> } <div class="modal fade" role="dialog" id="editeModal" style="z-index:999999999; display:none"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" style="float:right">&times;</button> <h4 class="modal-title">Create Course Topic</h4> </div> <div class="modal-body"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Name, "Topic", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EContentType.Name, new { @class = "form-control", require = true, Id = "topic", placeholder = "Components of Computers" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Name) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Description, "Description", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EContentType.Description, new { @class = "form-control", require = true, Id = "description", placeholder = "These are the Systems that make up a computer" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Description) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Active, "Activate", new { @class = "control-label" }) @Html.CheckBoxFor(model => model.eCourse.EContentType.Active, new { require = true, Id = "active" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Active) </div> <fieldset> <legend>Start Date and Time</legend> <div class=" row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.StartTime, "Date", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.StartTime, new { @class = "form-control", require = true, type = "date", id = "fromDate" }) @Html.ValidationMessageFor(model => model.eCourse.StartTime) </div> </div> <div class="col-md-6"> @Html.LabelFor(model => model.startTime, "Time", new { @class = "control-label" }) @Html.TextBoxFor(model => model.startTime, new { @class = "form-control", require = true, type = "time", id = "fromTime" }) @Html.ValidationMessageFor(model => model.startTime) </div> </div> </fieldset> <fieldset> <legend>Stop Date and Time</legend> <div class=" row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EndTime, "Date", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EndTime, new { @class = "form-control", require = true, type = "date", id = "toDate" }) @Html.ValidationMessageFor(model => model.eCourse.EndTime) </div> </div> <div class="col-md-6"> @Html.LabelFor(model => model.endTime, "Time", new { @class = "control-label" }) @Html.TextBoxFor(model => model.endTime, new { @class = "form-control", require = true, type = "time", id = "toTime" }) @Html.ValidationMessageFor(model => model.endTime) </div> </div> </fieldset> @*<div class="form-group"> @Html.LabelFor(model => model.eCourse.StartTime, "From", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.StartTime, new { @class = "form-control", require = true, type = "dateTime-local", id = "fromDate" }) @Html.ValidationMessageFor(model => model.eCourse.StartTime) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EndTime, "To", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EndTime, new { @class = "form-control", require = true, type = "dateTime-local", id = "toDate" }) @Html.ValidationMessageFor(model => model.eCourse.EndTime) </div>*@ </div> <div class="modal-footer form-group"> <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> <button type="submit" id="btnCreate" class="btn btn-success">Save</button> </div> </div> </div> </div> <script> document.querySelector("#fileInput").addEventListener("change", (e) => { const fileEl = document.querySelector("#fileInput"); const file = e.target.files[0]; const fileType = file.type; const fileSize = file.size; if (fileSize > 1048576) { alert("File size is too much. Allowed size is 1MB") $("#fileInput").val(""); $("#fileInput").text(""); return false; } //If file type is Video, Return False; ask user to insert a youtube link if (fileType.split("/")[0] === "video") { alert("Videos are not allowed, enter a youtube link"); //Reset the file selector to application/pdf fileEl.setAttribute("accept", "application/pdf"); //Clear the inout type field $("#fileInput").val(""); $("#fileInput").text(""); $('#videoUrl').show(); return false; } }) </script><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Details"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Type Details</h4> </div> <div class="panel-body"> <div class="col-md-12"> <div> <h5>HOSTEL TYPE</h5> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Hostel Type Name:") </dt> <dd> @Html.DisplayFor(model => model.HostelType.Hostel_Type_Name) </dd> <br/> <dt> @Html.DisplayName("Hostel Type Description:") </dt> <dd> @Html.DisplayFor(model => model.HostelType.Hostel_Type_Description) </dd> <br /> </dl> </div> <p> @Html.ActionLink("Edit", "EditHostelType", new { id = Model.HostelType.Hostel_Type_Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("Back to List", "ViewHostelTypes", "", new { @class = "btn btn-success" }) </p> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptRequestViewModel @using Abundance_Nk.Business @{ ViewBag.Title = "Transcript Request"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.min.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script type="text/javascript"> var incidentIds = []; $(function () { //this master checkbox $("#checkMaster").click(function (event) { //on click if (this.checked) { // check select status $(":checkbox").each(function () { //loop through each checkbox this.checked = true; //select all checkboxes with class "checkbox1" }); } else { $(":checkbox").each(function () { //loop through each checkbox this.checked = false; //deselect all checkboxes with class "checkbox1" }); } }); //this is where the to checkboxes are bond $(":checkbox").change(function () { var values = this.id.split('*'); getMaxCheckedId = values[0]; //getting the autogenerated Id if (getMaxCheckedId > 0) { var i; for (i = 0; i <= getMaxCheckedId; i++) { var getUpperId = "#" + i;// getting the tr id $(getUpperId).find('[type=checkbox]').prop('checked', true); } } }) // close the selected Tickets By Their Ids $('#logClose').on('click', function () { $("#showLoad").show(); checkedIds = $(":checkbox").filter(":checked").map(function () { return this.id; }); if (checkedIds.length > 0) { $.ajax({ type: "POST", url: "@Url.Action("CloseLog")", traditional: true, data: { logIds: checkedIds.toArray() }, success: function (result) { if (result.IsError === false) { swal("Info", result.Message, "success"); $("#showLoad").hide(); location.reload(true); } // error: errorFunc }, error: function (ex) { alert('Failed to Close Ticket.' + ex); } }) } else { $("#showLoad").hide(); swal("Info", "You have not selected an applicant", "error"); } }) $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier:{ orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); function logRecord(e,y) { requestId = e; departmentId = y; } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <div class="panel panel-default"> <div class="panel-heading" style="font:larger"> VIEW LOG </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("ViewTranscriptIncidentLog", "TranscriptProcessor", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="col-md-12"> <div style="overflow: hidden;"> <div class="form-group"> <div class="row"> <div class="col-md-4"> From: @Html.TextBoxFor(model => model.From, "", new { @class = "form-control col-md-3", @type = "date", @id = "datefrom" }) </div> <div class="col-md-4"> To: @Html.TextBoxFor(model => model.To, new { @class = "form-control col-md-3", @type = "date", @id = "dateto" }) </div> <div class="col-md-4"> View Closed Ticket: @Html.CheckBoxFor(model => model.Active, new { @class = "" }) </div> </div> <br /> <div class="row"> <div class="col-md-12"> <div class="col-md-3"> <input type="submit" id="submit" value="Search" class="btn btn-success mr5" /> </div> </div> </div> </div> </div> </div> </div> } </div> </div> </div> </div> @if (Model == null || Model.TranscriptIncidentLogs == null) { return; } @if (Model != null && Model.TranscriptIncidentLogs != null && Model.ShowClosedTicket == false) { <div class="col-sm-12" style="padding: 20px;"> <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">OPEN TICKETS</h3> </div> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> STUDENT NAME </th> <th> MATRIC NO. </th> <th> DEPARTMENT </th> <th> DESTINATION ADDRESS </th> <th> PAYMENT DATE </th> <th> STATUS </th> <th> LOG DATE </th> @*<th>@Html.CheckBox("MasterBox", false, new { @class = "checkMaster", @id = "checkMaster" })</th>*@ <th></th> </tr> </thead> <tbody> @{ int startId = 1;} @for (int i = 0; i < Model.TranscriptIncidentLogs.Count; i++) { var cId = startId++; int sn = i + 1; var pid = Model.TranscriptIncidentLogs[i].TranscriptRequest.payment.Id; var status = Model.TranscriptIncidentLogs[i].TranscriptRequest.transcriptStatus.TranscriptStatusId == 5 ? "Dispatched" : "Processing"; PaymentEtranzactLogic paymentEtranzactLogic = new PaymentEtranzactLogic(); PaymentInterswitchLogic paymentInterswitchLogic = new PaymentInterswitchLogic(); var paymentEtranzact = paymentEtranzactLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentInterswitch = paymentInterswitchLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentDate = paymentEtranzact != null ? paymentEtranzact.TransactionDate : paymentInterswitch.TransactionDate; <tr id=@cId> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.student.FullName </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.student.MatricNumber </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].Department.Name.ToUpper(); </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.DestinationAddress </td> <td class="col-lg-3 col-md-3 col-sm-3"> @paymentDate </td> <td class="col-lg-3 col-md-3 col-sm-3"> @status </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].Date_Opened </td> <td> @Html.CheckBox(Model.TranscriptIncidentLogs[i].TicketId, false, new { @class = "checkedAppNo", @id = cId + "*" + Model.TranscriptIncidentLogs[i].Id }) </td> </tr> } </tbody> </table> @if (Model.TranscriptIncidentLogs.Count > 0) { <button class="admitButton btn-primary" id="logClose"> CLOSE SELECTED<img src="~/Content/Images/bx_loader.gif" alt="Loading........" style="display:none;" id="showLoad" /> </button> } </div> } @if (Model != null && Model.TranscriptIncidentLogs != null && Model.ShowClosedTicket==true) { <div class="col-sm-12" style="padding: 20px;"> <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">CLOSED TICKETS</h3> </div> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> STUDENT NAME </th> <th> MATRIC NO. </th> <th> DEPARTMENT </th> <th> DESTINATION ADDRESS </th> <th> PAYMENT DATE </th> <th> STATUS </th> <th> LOG DATE </th> <th>CLOSE DATE</th> </tr> </thead> <tbody> @for (int i = 0; i < Model.TranscriptIncidentLogs.Count; i++) { int sn = i + 1; var pid = Model.TranscriptIncidentLogs[i].TranscriptRequest.payment.Id; var status = Model.TranscriptIncidentLogs[i].TranscriptRequest.transcriptStatus.TranscriptStatusId == 5 ? "Dispatched" : "Processing"; PaymentEtranzactLogic paymentEtranzactLogic = new PaymentEtranzactLogic(); PaymentInterswitchLogic paymentInterswitchLogic = new PaymentInterswitchLogic(); var paymentEtranzact = paymentEtranzactLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentInterswitch = paymentInterswitchLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentDate = paymentEtranzact != null ? paymentEtranzact.TransactionDate : paymentInterswitch.TransactionDate; <tr> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.student.FullName </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.student.MatricNumber </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].Department.Name.ToUpper(); </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].TranscriptRequest.DestinationAddress </td> <td class="col-lg-3 col-md-3 col-sm-3"> @paymentDate </td> <td class="col-lg-3 col-md-3 col-sm-3"> @status </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptIncidentLogs[i].Date_Opened </td> <td> @Model.TranscriptIncidentLogs[i].Date_Closed </td> </tr> } </tbody> </table> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Hostel Rooms"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Rooms Setup</h4> </div> <div class="panel-body"> @using(Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <div class="form-group"> @Html.LabelFor(model => model.HostelSeries.Id,"Select Series" ,new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownListFor(model => model.HostelSeries.Id,(IEnumerable<SelectListItem>)ViewBag.HostelSeriesId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.HostelSeries.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } </div> </div> </div> <file_sep>@model IEnumerable<Abundance_Nk.Model.Entity.PAYMENT_ETRANZACT_TYPE> @{ ViewBag.Title = "AddStaff"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#myTable").DataTable(); }); </script> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table" id="myTable"> <thead> <tr> <th> @Html.DisplayNameFor(model => model.Payment_Etranzact_Type_Name) </th> <th> @Html.DisplayNameFor(model => model.FEE_TYPE.Fee_Type_Name) </th> <th> @Html.DisplayNameFor(model => model.LEVEL.Level_Name) </th> <th> @Html.DisplayNameFor(model => model.PAYMENT_MODE.Payment_Mode_Name) </th> <th> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </th> <th> @Html.DisplayNameFor(model => model.SESSION.Session_Name) </th> <th></th> </tr> </thead> <tbody> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Payment_Etranzact_Type_Name) </td> <td> @Html.DisplayFor(modelItem => item.FEE_TYPE.Fee_Type_Name) </td> <td> @Html.DisplayFor(modelItem => item.LEVEL.Level_Name) </td> <td> @Html.DisplayFor(modelItem => item.PAYMENT_MODE.Payment_Mode_Name) </td> <td> @Html.DisplayFor(modelItem => item.PROGRAMME.Programme_Name) </td> <td> @Html.DisplayFor(modelItem => item.SESSION.Session_Name) </td> <td> @Html.ActionLink("Edit", "Edit", new { id = item.Payment_Etranzact_Type_Id }) | @Html.ActionLink("Details", "Details", new { id = item.Payment_Etranzact_Type_Id }) | @Html.ActionLink("Delete", "Delete", new { id = item.Payment_Etranzact_Type_Id }) </td> </tr> } </tbody> </table> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ ViewBag.Title = "rofile Update"; Layout = "~/Views/Shared/_Layout.cshtml"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var selectedProgramme = $("#Programme_Id").val(); if (selectedProgramme == 1) { $("#divJambNo").show(); $("#divFormSetting").show(); } else if (selectedProgramme == 4) { $("#divJambNo").show(); $("#divFormSetting").show(); } else { $("#divJambNo").hide(); } $("#Programme_Id").change(function () { var programme = $("#Programme_Id").val(); $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function (departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }); $("#Person_State_Id").change(function () { $("#Person_LocalGovernment_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetLocalGovernmentsByState")', //we are calling json method dataType: 'json', data: { id: $("#Person_State_Id").val() }, success: function (lgas) { $("#Person_LocalGovernment_Id").append('<option value="' + 0 + '">-- Select --</option>'); $.each(lgas, function (i, lga) { $("#Person_LocalGovernment_Id").append('<option value="' + lga.Value + '">' + lga.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve lgas.' + ex); } }); return false; }); $('#continue').on('click', function () { let filledMatricNo = $('#Student_MatricNumber').val(); if (filledMatricNo == null || filledMatricNo == '') return; $('#displayMatricNo').val(filledMatricNo); $('#mymodal').modal('show'); }) $('#no').on('click', function () { $('#mymodal').modal('hide'); return; }) $('#save').on('click', function () { $('#mymodal').modal('hide'); $('#submit').click(); }) }); </script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="container"> <div class="col-md-12"> <div class="container"> @using (Html.BeginForm("UpdateAcademicRecord", "Account", FormMethod.Post, new { id = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Student.Id) @Html.HiddenFor(model => model.StudentLevel.Id) @Html.HiddenFor(model => model.StudentId) <h4 class="text-center font-weight-bold mt-5">Student Biodata Form</h4> <div class="card"> <div class="col-md-12 mb-2"> <hr class="bg-primary m-0"> </div> <div class="p-4"> <div class="row"> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LastName, "Surname", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.LastName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.LastName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.FirstName, "First Name", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.FirstName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.OtherName, "Other Name", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.OtherName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, "Personl Email-Address", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Email, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.InstitutionalEmail, "Institutional Email-Address", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.InstitutionalEmail, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.InstitutionalEmail, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Student.MatricNumber, "Confirm your Matriculation No.", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.ContactAddress, "Contact Address", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.ContactAddress, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.ContactAddress, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Sex.Id, "Sex", new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.Sex.Id, (IEnumerable<SelectListItem>)ViewBag.SexId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Sex.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, "Mobile Phone No.", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Id, "State of Origin", new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.Person.State.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Religion.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.Religion.Id, (IEnumerable<SelectListItem>)ViewBag.ReligionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Religion.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LocalGovernment.Id, "LGA", new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.LocalGovernment.Id, (IEnumerable<SelectListItem>)ViewBag.LgaId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.LocalGovernment.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Id, "Programme", new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.StudentLevel.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentLevel.Programme.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Id, "Department", new { @class = "control-label " }) @Html.DropDownListFor(f => f.StudentLevel.Department.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentId, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.StudentLevel.Level.Id, "Level", new { @class = "control-label " }) @Html.DropDownListFor(f => f.StudentLevel.Level.Id, (IEnumerable<SelectListItem>)ViewBag.LevelId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentLevel.Level.Id) </div> <div class="col-md-12 text-right"> <button class="btn btn-primary pull-right" type="submit" style="visibility:hidden" id="submit">Submit</button> <button class="btn btn-primary pull-right" type="button" id="continue">Submit</button> </div> </div> </div> </div> } </div> </div> </div> <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <div> <h3>Is this your Matriculation No.?</h3> <input id="displayMatricNo" class="form-control" readonly/> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" id="no">No</button> <button type="button" class="btn btn-primary" id="save">Yes</button> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffCourseAllocationViewModel @{ ViewBag.Title = "Course Evaluation Report"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-3.3.1.min.js"></script> <script src="~/Scripts/Chart.bundle.js"></script> <script src="~/Scripts/utils.js"></script> <script type="text/javascript"> $(document).ready(function() { //Programme Drop down Selected-change event $("#Programme").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); $("#Department").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } }); $("#Session").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } }); $("#Level").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } }); }); function GetChartData(courseId) { $('#canvasDiv').html(' '); $.ajax({ type: 'POST', url: '@Url.Action("GetCourseEvaulationReport", "StaffCourseAllocation")', // we are calling json method dataType: 'json', data: { courseId: courseId }, success: function (model) { $('#canvasDiv').append("<canvas id=" + "canvas" + "></canvas>"); var evaluationSection1 = []; var evaluationSection2 = []; for (var i = 0; i < model.Count; i++) { if (model.Section == 1) { evaluationSection1.push(model.Score); } if (model.Section == 2) { evaluationSection2.push(model.Score); } } var ctx = document.getElementById('canvas').getContext('2d'); var config = { type: 'line', data: { labels: ['Question 1', 'Question 2', 'Question 3', 'Question 4', 'Question 5', 'Question 6', 'Question 7', 'Question 8', 'Question 9', 'Question 10', 'Question 11', 'Question 12', 'Question 13', 'Question 14', 'Question 15', 'Question 16'], datasets: [ { label: 'Evaluation Question Section 1', backgroundColor: window.chartColors.red, borderColor: window.chartColors.red, data: evaluationSection1 , fill: false },{ label: 'Evaluation Question Section 2', fill: false, backgroundColor: window.chartColors.blue, borderColor: window.chartColors.blue, data: evaluationSection2 }] }, options: { responsive: true, title: { display: true, text: 'Course Evaluation Report' }, tooltips: { mode: 'index', intersect: false, }, hover: { mode: 'nearest', intersect: true }, scales: { xAxes: [ { display: true, scaleLabel: { display: true, labelString: 'Question' } } ], yAxes: [ { display: true, scaleLabel: { display: true, labelString: 'Average Score per No. of Student' } } ] } } }; window.myLine = new Chart(ctx, config); config = { type: 'doughnut', data: { datasets: [{ data: [ model.Products[0].Visits, model.Products[1].Visits, model.Products[2].Visits, model.Products[3].Visits, model.Products[4].Visits ], backgroundColor: [ window.chartColors.red, window.chartColors.orange, window.chartColors.yellow, window.chartColors.green, window.chartColors.blue, ], label: 'Dataset 1' }], labels: [ model.Products[0].Name, model.Products[1].Name, model.Products[2].Name, model.Products[3].Name, model.Products[4].Name ] }, options: { responsive: true, legend: { position: 'top', }, animation: { animateScale: true, animateRotate: true } } }; ctx = document.getElementById('chart-area').getContext('2d'); window.myDoughnut = new Chart(ctx, config); config = { type: 'doughnut', data: { datasets: [{ data: [ model.SalesLogs[0].Quantity, model.SalesLogs[1].Quantity, model.SalesLogs[2].Quantity, model.SalesLogs[3].Quantity, model.SalesLogs[4].Quantity ], backgroundColor: [ window.chartColors.Maroon, window.chartColors.Navy, window.chartColors.Teal, window.chartColors.brown, window.chartColors.green ], label: 'Dataset 1' }], labels: [ model.SalesLogs[0].Product.Name, model.SalesLogs[1].Product.Name, model.SalesLogs[2].Product.Name, model.SalesLogs[3].Product.Name, model.SalesLogs[4].Product.Name ] }, options: { responsive: true, legend: { position: 'top', }, animation: { animateScale: true, animateRotate: true } } }; ctx = document.getElementById('chart-area').getContext('2d'); window.myDoughnut = new Chart(ctx, config); }, error: function (ex) { swal("Error Occured", "Product Brand could not be Added", "error"); } }); }; </script> <style> canvas { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } .border-right-line { border-right: 1px solid #f2f2f2; } </style> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-toggle-left"></i>Evaluation Report </h3> </div> <div class="panel-body"> @using (Html.BeginForm("CourseEvaulationReport", "StaffCourseAllocation", new { area = "Admin" }, FormMethod.Post)) { <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Session.Name, "Session", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @id = "Session", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @id = "Semester", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Programme.Name, "Programme", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View"/> </div> </div> } @if (Model.CourseEvaluationReports == null) { return; } @if (Model.CourseEvaluationReports.Count > 0) { <div class="col-md-12"> <table class="table"> <thead> <tr> <th scope="col">#</th> <th scope="col">Lecturer</th> <th scope="col">Score</th> <th scope="col">Details</th> </tr> </thead> <tbody> @for (int i = 0; i < Model.CourseEvaluationReports.Count; i++) { int sn = i + 1; <tr> <th scope="row">@sn</th> <td><a href="#" onclick="GetChartData(@Model.CourseEvaluationReports[i].CourseId)">@Model.CourseEvaluationReports[i].LecturerName</a></td> <td>@Model.CourseEvaluationReports[i].Score</td> <td></td> </tr> } </tbody> </table> </div> } <div style="width: 100%;" id="canvasDiv"> <canvas id="canvas"></canvas> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $("#aPrint").on('click', function() { $(".printable").print(); return false; }); </script> } <div> <div class="printable"> <br /> <div class="alert alert-success fade in" style="border: 1px solid green"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 7px"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" width="100px" height="100px" alt="" /></td> <td> <h3><strong>ABIA STATE UNIVERSITY, UTURU</strong></h3> <p> P.M.B. 2000, UTURU, ABIA STATE. </p> </td> </tr> </table> </div> </div> <br /> <h2><p class="custom-text-black">Screening Slip For @Model.Session.Name Session Admission </h2> <hr class="no-top-padding" /> <dl class="dl-horizontal"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null) { return; } <dt> </dt> <dd> <div class="row "> <div class="col-md-12 custom-text-black"> @*<img src="@Model.Person.ImageFileUrl" alt="" style="max-height:150px" />*@ <img src="@Url.Content('~' + Model.Person.ImageFileUrl)" alt="" style="max-height: 150px" /> </div> </div> </dd> <br /> <dt class="space-bottom custom-text-black"> @Html.DisplayNameFor(model => model.Person.FullName) </dt> <dd class="space-bottom custom-text-black"> @Html.DisplayFor(model => model.Person.FullName) </dd> <dt class="space-bottom custom-text-black"> Application Number </dt> <dd class="space-bottom custom-text-black"> @Model.ApplicationFormNumber </dd> <dt class="space-bottom custom-text-black"> Screening Number </dt> <dd class="space-bottom custom-text-black"> @Model.ApplicationForm.ExamNumber </dd> @if (Model.ApplicantJambDetail != null) { if (Model.ApplicantJambDetail.JambRegistrationNumber != null) { <dt class="space-bottom custom-text-black"> UTME No </dt> <dd class="space-bottom custom-text-black"> @Model.ApplicantJambDetail.JambRegistrationNumber </dd> } } <dt class="space-bottom custom-text-black"> @Html.DisplayNameFor(model => model.AppliedCourse.Department.Name) </dt> <dd class="space-bottom custom-text-black"> @Html.DisplayFor(model => model.AppliedCourse.Department.Name) </dd> <dt class="space-bottom custom-text-black"> @Html.DisplayNameFor(model => model.ApplicationFormSetting.ExamDate) </dt> @if (Model.AppliedCourse.Programme.Id == 1) { <dd class="space-bottom custom-text-black"> To be announced shortly </dd> } else if (Model.AppliedCourse.Programme.Id == 2) { <dd class="space-bottom custom-text-black"> To be announced shortly<br /> </dd> } else if (Model.AppliedCourse.Programme.Id == 3) { <dd class="space-bottom custom-text-black"> To be announced shortly </dd> } else if (Model.AppliedCourse.Programme.Id == 4) { <dd class="space-bottom custom-text-black"> August 18th 2016 </dd> } <dt class="space-bottom custom-text-black"> @Html.DisplayNameFor(model => model.ApplicationFormSetting.ExamVenue) </dt> <dd class="space-bottom custom-text-black"> @Html.DisplayFor(model => model.ApplicationFormSetting.ExamVenue) </dd> <dt class="space-bottom custom-text-black"> @Html.DisplayNameFor(model => model.ApplicationFormSetting.ExamTime) </dt> <dd class="space-bottom custom-text-black"> @Html.DisplayFor(model => model.ApplicationFormSetting.ExamTime) </dd> </dl> <div> <blockquote> <i class="fa fa-quote-left"></i> <p> Kindly come with this printout, your acknowledgment slip and a <b>2B Pencil</b> on the date of screening. Good luck ! </p> </blockquote> </div> <hr /> </div> <div class="row"> <div class="col-md-12"> <div class="form-actions no-color"> <div class="panel " style="padding-top: 0px"> <button id="aPrint" class="btn btn-white btn-lg "><i class="fa fa-print mr5"></i> Print Slip</button> @Html.ActionLink("Fill Another Form", "PostJambProgramme", null, new {@class = "btn btn-white btn-lg "}) <a class="btn btn-primary btn-lg " href="#"><i class="fa fa-home mr5"></i>Back to Home</a> </div> </div> </div> </div> </div><file_sep>@using GridMvc.Html @model Abundance_Nk.Web.Areas.Admin.ViewModels.CourseViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script> $(document).ready(function() { $("#divDepartmentOption").hide(); var level = $("#course_Level_Id").val(); var DepartmentOption = $("#course_DepartmentOption_Id").val(); if (level > 2 && DepartmentOption > 0) { $("#divDepartmentOption").show(); } //Hide Department Option on Department change $("#course_Department_Id").change(function() { $("#divDepartmentOption").hide(); }); //Load Department Option $("#course_Level_Id").change(function() { var department = $("#course_Department_Id").val(); var level = $("#course_Level_Id").val(); var programme = "3"; if (level > 2) { $("#course_DepartmentOption_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: department, programmeid: programme }, success: function(departmentOptions) { if (departmentOptions == "" || departmentOptions == null || departmentOptions == undefined) { $("#divDepartmentOption").hide(); } else { $("#course_DepartmentOption_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function(i, Option) { $("#course_DepartmentOption_Id").append('<option value="' + Option.Value + '">' + Option.Text + '</option>'); }); if (programme > 2) { $("#divDepartmentOption").show(); } } }, error: function(ex) { alert('Failed to retrieve department Options.' + ex); } }); } }); }) </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="row"> <h3>View Departmental Courses</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Programme.Id, "Programme", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Department.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.course.Level.Id, "Level", new {@class = "control-label"}) @Html.DropDownListFor(model => model.course.Level.Id, (IEnumerable<SelectListItem>) ViewBag.levels, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group"> @Html.LabelFor(model => model.course.DepartmentOption.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.course.DepartmentOption.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentOptionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.course.DepartmentOption.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="View" class="btn btn-default" /> </div> </div> </div> </div> } <br /> @if (Model != null) { <div class="row"> <h4>First Semester</h4> @if (Model.firstSemesterCourses != null) { @Html.Grid(Model.firstSemesterCourses).Columns(columns => { columns.Add(f => f.Code).Titled("Code"); columns.Add(f => f.Name).Titled("Course").Sortable(true); columns.Add(f => f.Type.Name).Titled("Course Type").Sortable(true); columns.Add(f => f.Unit).Titled("Unit").Sortable(true); columns.Add(f => f.Department.Name).Titled("Department").Sortable(true); columns.Add(f => f.Programme.Name).Titled("Programme").Sortable(true); columns.Add(f => f.Level.Name).Titled("Level").Sortable(true); }).WithPaging(15).Filterable(true) } </div> <div class="row"> <h4>Second Semester</h4> @if (Model.secondSemesterCourses != null) { @Html.Grid(Model.secondSemesterCourses).Columns(columns => { columns.Add(f => f.Code).Titled("Code"); columns.Add(f => f.Name).Titled("Course").Sortable(true); columns.Add(f => f.Type.Name).Titled("Course Type").Sortable(true); columns.Add(f => f.Unit).Titled("Unit").Sortable(true); columns.Add(f => f.Department.Name).Titled("Department").Sortable(true); columns.Add(f => f.Level.Name).Titled("Level").Sortable(true); }).WithPaging(15).Filterable(true) } </div> } </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.GstViewModel @{ ViewBag.Title = "Gst Result Upload"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @section Scripts{ @Scripts.Render(("~/bundles/jquery")) <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/sweetalert.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script type="text/javascript"> $(document).ready(function () { $(".Load").hide(); $("#gstResultTable").DataTable(); }); function showBusy() { swal("Please!", "Kindly CrossCheck the excel details displayed before Upload", "warning"); $("#save").prop('disabled', 'disabled'); $(".Load").show(); } </script> } <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">@ViewBag.Title</h3> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("ViewUpload", "UploadGstScanResult", FormMethod.Get, new {enctype = "multipart/form-data"})) { <div class="row"> <div class="col-md-10"></div> <div class="col-md-2"> <button class="btn btn-success mr5" type="submit" name="submit" id="submit"><i class="fa fa-eye"> View Upload</i></button><span class="Load"><img src="~/Content/Images/loading4.gif" /></span> </div> </div> } @using (Html.BeginForm("UploadGstScanResult", "UploadGstScanResult", FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <p class="custom-text-black"> Select the <b>Department</b>,<b>Semester</b>and the excel file to upload</p> <marquee>Please the execel file should be arranged in the following format: SN,CourseCode,CourseTitle,Exam_Number/Matric_Number,Name,RawScore,CA,Total</marquee> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Id,"Depaertment", new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id, "Session", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Semester.Id,"Semester",new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.SemesterId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ScannedFilePath, "Select File", new { @class = "col-md-2 control-label " }) <div><input type="file" title="Upload Gst Excel" id="file" name="file" class="form-control" /></div> </div> </div> </div> <br/> <br/> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="upload"><i class="fa fa-eject"> Upload</i></button><span class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> } </div> @if (Model == null || Model.GstScanList == null) { return; } @if (Model != null && Model.GstScanList != null) { using (Html.BeginForm("SaveGstScanResult", "UploadGstScanResult", FormMethod.Post)) { <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="gstResultTable"> <thead> <tr> <th> SN </th> <th> Course Code </th> <th> Course Title </th> <th> Exam Number/Matric_Number </th> <th> Name </th> <th> Department </th> <th> Raw Score </th> <th> CA </th> <th> Total </th> <th> Semester Name </th> </tr> </thead> <tbody style="color:black;"> @for (var itemIndex = 0; itemIndex < Model.GstScanList.Count; itemIndex++) { <tr> <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].SN)</td> <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].CourseCode)</td> <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].CourseTitle)</td> @if (Model.GstScanList[itemIndex].MatricNumber != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].MatricNumber)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Name != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Name)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].DepartmentName != null) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].DepartmentName)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].RawScore >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].RawScore)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Ca >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Ca)</td> } else { <td></td> } @if (Model.GstScanList[itemIndex].Total >= 0) { <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].Total)</td> } else { <td></td> } <td>@Html.DisplayTextFor(m => m.GstScanList[itemIndex].SemesterName)</td> </tr> } </tbody> </table> </div> <br /> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <button class="btn btn-success mr5" type="submit" name="submit" id="save"><i class="fa fa-eject"> Save Upload</i></button><span class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> } } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel @{ ViewBag.Title = "Pay Fee"; Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="row"> <div class="well col-xs-10 col-sm-10 col-md-6 col-xs-offset-1 col-sm-offset-1 col-md-offset-3 panel-body"> <div class="row"> <div class="col-md-12"> <div class=" text-success"> <h1><b>Generate Extra Year Invoice</b></h1> </div> <section id="loginForm"> @using (Html.BeginForm("CarryIndex", "Payment", new {Area = "Student"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <h5>Please enter your <b>Matriculation Number</b> in the box below to generate your School Fees invoice</h5> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "col-md-4 control-label"}) <div class="col-md-8"> @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.FeeType.Id, new {@class = "col-md-4 control-label"}) <div class="col-md-8"> @Html.HiddenFor(m => m.FeeType.Id) @Html.DropDownListFor(m => m.FeeType.Id, (IEnumerable<SelectListItem>) ViewBag.FeeTypes, new {@class = "form-control", disabled = true}) @Html.ValidationMessageFor(m => m.FeeType.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Next" class="btn btn-default" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <br /> <h3>Previous Education</h3> @Html.HiddenFor(model => model.PreviousEducation.Id) <div class="row"> <div class="well"> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.SchoolName,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.PreviousEducation.SchoolName,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.Course,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.PreviousEducation.Course,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.Id,"Start Date",new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartYearId,new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartMonthId,new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartDayId,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Sponsor.MobilePhone,"End Date",new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndYearId,new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndMonthId,new { @class = "form-control" }) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id,(IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndDayId,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id,(IEnumerable<SelectListItem>)ViewBag.QualificationId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id,(IEnumerable<SelectListItem>)ViewBag.ResultGradeId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id,"Work Experience",new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id,(IEnumerable<SelectListItem>)ViewBag.ITDurationId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> </div> <div class="form-group "> <div class="col-sm-3 "></div> <div class="col-sm-9 "> <div class="form-inline"> <div class="form-group"> <button class="btn btn-primary btn-metro mr5" type="button" value="Next">Next</button> </div> <div class="form-group margin-bottom-0"> <div style="display: none"> </div> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.PGStudent.ViewModels.PGPaymentViewModel @{ ViewBag.Title = "Pay Fee"; Layout = "~/Views/Shared/_Layout.cshtml"; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <div class="jumbotron" style="display: none"> </div> <div class="container"> <div class="col-md-12 card p-4"> <h3><b>Pay Fee</b></h3> <section id="loginForm"> @using (Html.BeginForm("Index", "Payment", new { Area = "PGStudent" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <p>Please enter your <b>Matriculation Number</b> in the box below to generate your School Fees invoice</p> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "col-md-4 control-label" }) <div class="col-md-12"> @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(m => m.FeeType.Id, new { @class = "col-md-4 control-label" }) <div class="col-md-12"> @Html.HiddenFor(m => m.FeeType.Id) @Html.DropDownListFor(m => m.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeTypes, new { @class = "form-control", disabled = true }) @Html.ValidationMessageFor(m => m.FeeType.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="col-md-12"> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Next" class="btn btn-primary" /> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> <file_sep>@using Abundance_Nk.Model.Model @model IEnumerable<Abundance_Nk.Model.Model.ApplicationForm> @if (Model != null && Model.Count() > 0) { <div class="table-responsive custom-text-black"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 38px; vertical-align: middle"> <th> @Html.CheckBox("selectAll", new {@class = "ckbox ckbox-default"}) </th> <th> Form Number </th> <th> Name </th> <th> Reject Reason </th> </tr> </thead> @foreach (ApplicationForm item in Model) { <tr> <td> @Html.CheckBox(" ", false, new {@class = "ckb ", id = item.Id}) </td> <td> <ul class="nav navbar-nav2 "> <li class="dropdown"> <a style="padding: 1px;" class="dropdown-toggle" data-toggle="dropdown" href="#">@Html.DisplayFor(modelItem => item.Number)<span></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li class="divider"></li> <li>@Html.ActionLink("Application Form", "ApplicationForm", "AdmissionProcessing", new {Area = "Admin", fid = item.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> @*<li>@Html.ActionLink("PUTME Result Slip", "Index", "PostUtmeResult", new { Area = "Applicant", fid = item.Id }, new { target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px" })</li>*@ </ul> </li> </ul> </td> <td> @Html.DisplayFor(modelItem => item.Person.FullName) </td> <td> @Html.DisplayFor(modelItem => item.RejectReason) </td> </tr> } </table> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="row"> <h3>Choose Programme</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Sessions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.StudentLevel.Programme.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group" style="display: none"> @Html.LabelFor(model => model.StudentLevel.DepartmentOption.Id, "Course Option", new {@class = "control-label"}) @Html.DropDownListFor(model => model.StudentLevel.DepartmentOption.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentOptions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.DepartmentOption.Id, null, new {@class = "text-danger"}) </div> </div> </div> </div> </div> <div class="row"> <h3>Select Extra Year Details</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.extraYear.LastSessionRegistered, new {@class = "control-label "}) @Html.DropDownListFor(model => model.extraYear.LastSessionRegistered.Id, (IEnumerable<SelectListItem>) ViewBag.LastSessions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.extraYear.LastSessionRegistered.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.extraYear.Sessions_Registered, new {@class = "control-label "}) @Html.DropDownListFor(model => model.extraYear.Sessions_Registered, (IEnumerable<SelectListItem>) ViewBag.SessionsRegistered, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.extraYear.Sessions_Registered, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @if (Model.IsDeferred) { @Html.LabelFor(model => model.extraYear.DeferementCommencedSession.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.extraYear.DeferementCommencedSession.Id, (IEnumerable<SelectListItem>) ViewBag.DeferredSessions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.extraYear.DeferementCommencedSession.Id, null, new {@class = "text-danger"}) } </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div> <br /> <div class="row"> <h3>Please enter other personal details</h3> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.LastName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.State.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>) ViewBag.States, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Email, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.Email, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Level.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Levels, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div class=" row-dashboard"> <table class="table table-bordered"> <thead> <tr> <th>@Html.ActionLink("Surname", "ViewAuditReport", new {sortOrder = ViewBag.Department, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("First name", "ViewAuditReport", new {sortOrder = ViewBag.Programme, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Middle Name", "ViewAuditReport", new {sortOrder = ViewBag.Minimum, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Email ", "ViewAuditReport", new {sortOrder = ViewBag.Date, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Mobile Number ", "ViewAuditReport", new {sortOrder = ViewBag.Date, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Old Surname", "ViewAuditReport", new {sortOrder = ViewBag.Department, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Old First name", "ViewAuditReport", new {sortOrder = ViewBag.Programme, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Old Middle Name", "ViewAuditReport", new {sortOrder = ViewBag.Minimum, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Old Email ", "ViewAuditReport", new {sortOrder = ViewBag.Date, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Old Mobile Number ", "ViewAuditReport", new {sortOrder = ViewBag.Date, currentFilter = ViewBag.CurrentFilter})</th> </tr> </thead> <tbody style="color: black;"> <tr> <td>@Model.PersonAuditDetails.LastName</td> <td>@Model.PersonAuditDetails.FirstName</td> <td>@Model.PersonAuditDetails.OtherName</td> <td>@Model.PersonAuditDetails.Email</td> <td>@Model.PersonAuditDetails.MobilePhone</td> <td>@Model.PersonAuditDetails.OldLastName</td> <td>@Model.PersonAuditDetails.OldFirstName</td> <td>@Model.PersonAuditDetails.OldOtherName</td> <td>@Model.PersonAuditDetails.OldEmail</td> <td>@Model.PersonAuditDetails.OldMobilePhone</td> </tr> </tbody> </table> </div> <div class="row"> @Html.ActionLink("Back", "ViewAuditReport") </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "EditUserRole"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("EditUserRole", "User", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-edit"> Edit Role</i></h4> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <h4>Select User-Role Category to Edit</h4> <hr /> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.User.Role.Name, "Role", new {@class = "control-label "}) @Html.DropDownListFor(model => model.User.Role.Id, (IEnumerable<SelectListItem>) ViewBag.Role, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.User.Role.Name) </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> </div> } @if (Model.Users != null && Model.Users.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <table class="table table-bordered table-striped table-responsive table-hover"> <tr> <th>Username</th> <th>Role</th> <th>Edit</th> </tr> @for (int i = 0; i < Model.Users.Count; i++) { <tr> <td>@Model.Users[i].Username</td> <td>@Model.Users[i].Role.Name</td> <td><i class="fa fa-edit"></i> @Html.ActionLink("Edit", "EditRole", new {controller = "User", area = "Admin", @id = @Model.Users[i].Id}, new {@class = "btn btn-success btn-sm"})</td> </tr> } </table> </div> </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Course, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color: black"> @Html.LabelFor(model => model.PreviousEducation.StartDate, new { @class = "control-label " }) </div> <div class="clearfix"></div> <div> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id, (IEnumerable<SelectListItem> )ViewBag.PreviousEducationStartYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id, (IEnumerable<SelectListItem> )ViewBag.PreviousEducationStartMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationStartDayId, new { @class = "form-control ml-0" }) </div> </div> </div> <div class="col-md-6 form-group"> <div class="form-inline"> <div class="form-inline" style="color:black"> @Html.LabelFor(model => model.PreviousEducation.EndDate, new { @class = "control-label " }) </div> <div class="clearfix"></div> <div> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id, (IEnumerable<SelectListItem> )ViewBag.PreviousEducationEndYearId, new { @class = "form-control pl-2 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id, (IEnumerable<SelectListItem> )ViewBag.PreviousEducationEndMonthId, new { @class = "form-control pl-2 ml-0 mr-0" }) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id, (IEnumerable<SelectListItem>)ViewBag.PreviousEducationEndDayId, new { @class = "form-control pl-2 ml-0 mr-0" }) </div> </div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id, (IEnumerable<SelectListItem> )ViewBag.QualificationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new { @class = "control-label" }) @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id, (IEnumerable<SelectListItem> )ViewBag.ResultGradeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id, "Duration", new { @class = "control-label " }) @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id, (IEnumerable<SelectListItem> )ViewBag.ITDurationId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> <file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.ResultViewModel @{ ViewBag.Title = "Semester Result Login"; //Layout = "~/Views/Shared/_Layout.cshtml"; } <br /> <div class="row"> <div class="container"> <div class="card card-shadow"> <div class="col-md-12"> <h2 style="padding-top:0; margin-top:0;">@ViewBag.Title</h2> </div> <section id="loginForm"> @using (Html.BeginForm("Check", "Result", new {Area = "Student"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(m => m.StudentLevel.Session,"Session" ,new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.StudentLevel.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.StudentLevel.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Semester.Id, "Semester", new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Check" class="btn btn-default" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") }<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Hostel Allocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, retrieve: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); }) </script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Hostel Allocation</h4> </div> <div class="panel-body"> @using (Html.BeginForm("HostelAllocationReport", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.HostelAllocation.Hostel.Name, "Hostel", new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.HostelAllocation.Hostel.Id, (IEnumerable<SelectListItem>)ViewBag.HostelId, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.HostelAllocation.Hostel.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.HostelAllocation.Session.Id, "Session", new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.HostelAllocation.Session.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.HostelAllocation.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-success" /> </div> </div> </div> </div> } </div> <br /> <div class="panel-body"> <div class="col-md-12"> @if (Model.HostelAllocations != null && Model.HostelAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table class="table-bordered table-hover table-striped table-responsive table" id="myTable"> <thead> <tr> <th> Series/Floor </th> <th> Room </th> <th> Bed Space </th> <th> Occupant </th> <th> Matric No </th> <th> Session </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.HostelAllocations.Count; i++) { <tr> <td> @Model.HostelAllocations[i].Series.Name </td> <td> @Model.HostelAllocations[i].Room.Number </td> <td> @Model.HostelAllocations[i].Corner.Name </td> @if (Model.HostelAllocations[i].Occupied) { <td> @Model.HostelAllocations[i].Person.FullName </td> <td> @Model.HostelAllocations[i].Student.MatricNumber </td> } else { <td> - </td> <td> - </td> } <td> @Model.HostelAllocations[i].Session.Name </td> </tr> } </tbody> </table> </div> </div> } </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptRequestViewModel @using Abundance_Nk.Business @{ ViewBag.Title = "Transcript Request"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.min.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script type="text/javascript"> var requestId; var departmentId; $(function () { // Log Student Detail from the modal $('#log').on('click', function () { $('#log').text("loading..."); $('#log').prop('disabled', true); var email = $("#email").val(); var phone = $("#phone").val(); var note = $('#note').val(); if (email != null && email != "" && email != undefined && requestId > 0 && requestId != undefined) { $.ajax({ type: 'POST', url: '@Url.Action("LogTranscriptIncidentRequest")', // we are calling json method dataType: 'json', data: { email: email, phone: phone, requestId: requestId, note: note, departmentId: departmentId}, success: function (result) { if (!result.IsError) { $('#admitmodal').modal('toggle'); swal("Operation Successful", result.Message, "success"); location.reload(true); } else { $('#admitmodal').modal('toggle'); swal("Info", result.Message, "error"); location.reload(true); } }, error: function(ex) { alert('Failed to Open Ticket.' + ex); } }); } else { swal("Info", "Please, Provide All required detail", "error"); $('#log').text("log"); $('#log').prop('disabled', false); } }) $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier:{ orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); function logRecord(e,y) { requestId = e; departmentId = y; } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <div class="panel panel-default"> <div class="panel-heading" style="font:larger"> TRANSCRIPT INCIDENT LOG </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("TranscriptIncidentLog", "TranscriptProcessor", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="col-md-12"> <div style="overflow: hidden;"> <div class="form-group"> <div class="row"> <div class="col-md-6"> Matric Number: @Html.TextBoxFor(model => model.MatricNo, "", new { @class = "form-control col-md-3", @required = true }) </div> <div class="col-md-6"> <input type="submit" id="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> </div> </div> </div> } </div> </div> </div> </div> @if (Model == null || Model.TranscriptRequests == null) { return; } @if (Model != null && Model.TranscriptRequests != null) { <div class="col-sm-12" style="padding: 20px;"> <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">LOG REQUEST</h3> </div> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> <NAME> </th> <th> <NAME>. </th> <th> DEPARTMENT </th> <th> DESTINATION ADDRESS </th> <th> PAYMENT DATE </th> <th> STATUS </th> <th> </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.TranscriptRequests.Count; i++) { int sn = i + 1; var pid = Model.TranscriptRequests[i].payment.Id; var status = Model.TranscriptRequests[i].transcriptStatus.TranscriptStatusId == 5 ? "Dispatched" : "Processing"; PaymentEtranzactLogic paymentEtranzactLogic = new PaymentEtranzactLogic(); PaymentInterswitchLogic paymentInterswitchLogic = new PaymentInterswitchLogic(); var paymentEtranzact = paymentEtranzactLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentInterswitch = paymentInterswitchLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var amountPaid = paymentEtranzact != null ? paymentEtranzact.TransactionAmount : paymentInterswitch.Amount; var paymentDate = paymentEtranzact != null ? paymentEtranzact.TransactionDate : paymentInterswitch.TransactionDate; var Department = Model.StudentLevels[0] != null ? Model.StudentLevels[0].Department.Name.ToUpper() : ""; <tr> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.FullName </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.MatricNumber </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Department </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].DestinationAddress </td> <td class="col-lg-3 col-md-3 col-sm-3"> @paymentDate </td> <td class="col-lg-3 col-md-3 col-sm-3"> @status </td> <td> <button class="btn btn-success" data-toggle="modal" data-target="#admitmodal" onclick=logRecord(@Model.TranscriptRequests[i].Id,@Model.StudentLevels[0].Department.Id) id="@Model.TranscriptRequests[i].Id +"-btnId"">Log</button> </td> </tr> } </tbody> </table> </div> } <!----------------------------------ADMIT MODAL------------------------------------> <div class="modal fade" id="admitmodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">ENTER DETAIL</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <div class="form-group"> <label class = "control-label">Email:</label> <input type="email" class = "form-control" id="email" required /> <label class="control-label">Phone:</label> <input type="tel" class="form-control" id="phone" /> <label class="control-label">Note:</label> <textarea type="text" class="form-control" id="note" maxlength="180"></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary" id="log">LOG</button> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "AddExtraCourse"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { //Programme Drop down Selected-change event $("#Programme").change(function () { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); function CheckAll() { if ($('#CourseId').is(':checked')) { $('.checkAll').prop('checked', true); } else { $('.checkAll').prop('checked', false); } } function CheckAllCarryOver() { if ($('#CarryOverId').is(':checked')) { $('.checkAllCarryOver').prop('checked', true); } else { $('.checkAllCarryOver').prop('checked', false); } } </script> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Register Course</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("AddExtraCourse", "StudentCourseRegistration", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.FullName, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Student.FullName,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber,new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Student.MatricNumber,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Session.Name,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Courses.FirstOrDefault().Semester.Name,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Name,"Programme",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.StudentLevel.Programme.Name,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Name,"Department",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.StudentLevel.Department.Name,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Level.Name,"Level",new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.StudentLevel.Level.Name,new { @class = "form-control",@disabled = "disabled" }) </div> </div> </div> } </div> </div> </div> @if (Model.Courses == null) { return;} @if (Model.Courses.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("SaveAddedCourse", "StudentCourseRegistration", FormMethod.Post)) { @Html.HiddenFor(model => model.Student.MatricNumber) @Html.HiddenFor(model => model.Semester.Id) @Html.HiddenFor(model => model.Session.Id) @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.HiddenFor(model => model.StudentLevel.Department.Name) @Html.HiddenFor(model => model.StudentLevel.Level.Id) @Html.HiddenFor(model => model.StudentLevel.Level.Name) <table class="table table-bordered table-hover table-striped table-responsive"> <tr> <th>Department</th> <th>Department Option</th> <th>Level</th> <th>Course Code</th> <th>Course Name</th> <th>Course Unit</th> <th>Course Semester</th> <th><input type="checkbox" id="CourseId" onclick="CheckAll()"/> Select Course</th> <th><input type="checkbox" id="CarryOverId" onclick="CheckAllCarryOver()"/> Carry Over</th> </tr> @for (int i = 0; i < Model.Courses.Count; i++) { <tr> @Html.HiddenFor(model => model.Courses[i].Id) @Html.HiddenFor(model => model.Courses[i].Unit) @Html.HiddenFor(model => model.Courses[i].Code) @Html.HiddenFor(model => model.Courses[i].Name) @Html.HiddenFor(model => model.Courses[i].Department.Name) @Html.HiddenFor(model => model.Courses[i].Level.Name) @Html.HiddenFor(model => model.Courses[i].Semester.Id) @Html.HiddenFor(model => model.Courses[i].Semester.Name) <td>@Model.Courses[i].Department.Name</td> @if (Model.Courses[i].DepartmentOption != null) { <td>@Model.Courses[i].DepartmentOption.Name</td> } else { <td></td> } <td>@Model.Courses[i].Level.Name</td> <td>@Model.Courses[i].Code</td> <td>@Model.Courses[i].Name</td> <td>@Model.Courses[i].Unit</td> <td>@Model.Courses[i].Semester.Name</td> <td>@Html.CheckBoxFor(model => model.Courses[i].IsRegistered, new { @type = "checkbox", @class = "checkAll" })</td> <td>@Html.CheckBoxFor(model => model.Courses[i].isCarryOverCourse, new { @type = "checkbox", @class = "checkAllCarryOver" })</td> </tr> } </table> <br/> <div class="row"> <div class="form-group"> <div class="col-sm-12"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> } </div> </div> </div> } </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBProgrammeViewModel @{ ViewBag.Title = "Post JAMB Programme"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { swal({ title: "Attention!", text: "If you made payment using your card, kindly use your invoice number as pin", type: "warning", timer: 10000 }); var selectedProgramme = $("#Programme_Id").val(); if (selectedProgramme == 1 || selectedProgramme == 2) { $("#divJambNo").show(); } else { $("#divJambNo").hide(); } $("#Programme_Id").change(function () { var programme = $("#Programme_Id").val(); if (programme == 3) { $("#divJambNo").hide(); } else { $("#divJambNo").show(); } $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', //calling json method dataType: 'json', data: { id: programme }, success: function (departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }); $('#rdNoRadio').click(function () { if ($(this).is(':checked')) { $('#divProgramme').hide(); $('#divOrderNo').show(); } }); $('#rdYesRadio').click(function () { if ($(this).is(':checked')) { $('#divOrderNo').hide(); $('#divProgramme').show(); } }); }) </script> <div class="container"> <h4 class="text-center font-weight-bold">Application Form</h4> <div class="col-md-12 card p-5"> @using (Html.BeginForm("PostJambProgramme", "Form", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> @*<h3 style="color: #b78825">Application Form</h3>*@ <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="well" style="margin-bottom: 15px"> <blockquote> <p> Kindly enter your Confirmation Order Number in the space provided at the right hand side, and click the Next Button to fill your Application Form. Please endeavour to print your Acknowledgment Slip and Exam Slip after the submission of your form. </p> </blockquote> </div> </div> <div class="col-md-6"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="form-group"> <label style="font-size: 10pt" class=" custom-text-white"> Please enter your RRR</label> @Html.TextBoxFor(model => model.ConfirmationOrderNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ConfirmationOrderNumber, null, new { @class = "text-danger" }) </div> <button class="btn btn-primary pull-right" type="submit" name="submit" id="submit" value="Next"> Submit</button> </div> </div> </div> </div> <div class="panel-footer "> </div> </div> </div> } </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Abundance_Nk.Web.Reports.Presenter { public partial class StudentNominalReportSummary : System.Web.UI.Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } private bool InvalidUserInputForBulk() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } private void DisplayReportBy(Session session) { try { List<Model.Model.Result> DepartmentStudentList = new List<Model.Model.Result>(); var studentLogic = new StudentLogic(); var departmentLogic = new DepartmentLogic(); List<Department> departments = departmentLogic.GetAll().OrderBy(f=>f.Name).ToList(); foreach (var dept in departments) { List<Model.Model.Result> reportByDepartment = studentLogic.UndergraduateNominalReport(session, dept.Id); if (reportByDepartment?.Count > 0) { Model.Model.Result deptResult = new Model.Model.Result() { DepartmentName = dept.Name, Count = reportByDepartment.Count, SessionName = session.Name, ReportTitle = "UNDERGRADUATE NOMINAL ROLL ", }; DepartmentStudentList.Add(deptResult); } } string bind_dsMasterSheet = "dsMasterSheet"; string reportPath = ""; reportPath = @"Reports\StudentNominalReportSummary.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Summary" + session.Name + " Session"; rv.LocalReport.ReportPath = reportPath; if (DepartmentStudentList != null) { DepartmentStudentList.FirstOrDefault().SessionName = session.Name; rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsMasterSheet.Trim(), DepartmentStudentList)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void DisplayPGReportBy(Session session) { try { List<Model.Model.Result> DepartmentStudentList = new List<Model.Model.Result>(); var studentLogic = new StudentLogic(); var departmentLogic = new DepartmentLogic(); List<Department> departments = departmentLogic.GetAll(); foreach (var dept in departments) { List<Model.Model.Result> reportByDepartment = studentLogic.PGNominalReport(session, dept.Id); if (reportByDepartment?.Count > 0) { Model.Model.Result deptResult = new Model.Model.Result() { DepartmentName = dept.Name, Count = reportByDepartment.Count, SessionName = session.Name, ReportTitle = "POST GRADUATE NOMINAL ROLL ", }; DepartmentStudentList.Add(deptResult); } } string bind_dsMasterSheet = "dsMasterSheet"; string reportPath = ""; reportPath = @"Reports\StudentNominalReportSummary.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Summary" + session.Name + " Session"; rv.LocalReport.ReportPath = reportPath; if (DepartmentStudentList != null) { DepartmentStudentList.FirstOrDefault().SessionName = session.Name; rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsMasterSheet.Trim(), DepartmentStudentList)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedSession); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void btnDisplayPGReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayPGReportBy(SelectedSession); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } } <file_sep>@model IEnumerable<Abundance_Nk.Model.Model.Setup> @{ ViewBag.Title = "Result Grades"; ViewBag.IsIndex = true; } @Html.Partial("Setup/_Index", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var selectedProgramme = $("#AppliedCourse_Programme_Id").val(); if (selectedProgramme == 1 || selectedProgramme == 4) { $("#ApplicantJambDetail_JambRegistrationNumber").show(); } else { $("#ApplicantJambDetail_JambRegistrationNumber").hide(); $('#ApplicantJambDetail_JambRegistrationNumber').val(''); } $("#AppliedCourse_Programme_Id").change(function() { var programme = $("#AppliedCourse_Programme_Id").val(); if ((programme == 1 || programme == 4)) { $("#ApplicantJambDetail_JambRegistrationNumber").show(); } else { $("#ApplicantJambDetail_JambRegistrationNumber").hide(); $('#ApplicantJambDetail_JambRegistrationNumber').val(''); } $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); }) </script> <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div> <p class="text-center"><h3>CORRECT INVOICE DETAILS</h3></p> </div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("Index", "Support/Index", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h4>Enter Invoice Number or Confirmation Order Number</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.InvoiceNumber, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.InvoiceNumber, new {@class = "form-control", @placeholder = "Enter Invoice No"}) @Html.ValidationMessageFor(model => model.InvoiceNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new {Area = ""}, null) </div> </div> </div> </div> </div> } @if (Model == null || Model.Person == null || Model.Payment == null) { return; } @using (Html.BeginForm("UpdateInvoice", "Support/UpdateInvoice", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.DateOfBirth) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.Sex.Id) @Html.HiddenFor(model => model.Person.State.Id) @Html.HiddenFor(model => model.Person.Nationality.Id) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.LocalGovernment.Id) @Html.HiddenFor(model => model.Person.Religion.Id) @Html.HiddenFor(model => model.Person.Role.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.Payment.InvoiceNumber) @*@Html.HiddenFor(model => model.AppliedCourse.Person.Id)*@ @Html.HiddenFor(model => model.AppliedCourse.Option.Id) @Html.HiddenFor(model => model.AppliedCourse.ApplicationForm.Id) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> </div> <div class="form-group"> <label class="col-sm-2 control-label">Surname</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control", @placeholder = "Enter Surname"}) @Html.ValidationMessageFor(model => model.Person.LastName) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">First Name</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control", @placeholder = "Enter Firstname"}) @Html.ValidationMessageFor(model => model.Person.FirstName) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Other Names</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control", @placeholder = "Enter Other Names"}) @Html.ValidationMessageFor(model => model.Person.OtherName) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Phone Number</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control", @placeholder = "Enter Mobile Number"}) @Html.ValidationMessageFor(model => model.Person.MobilePhone) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Email</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control", @placeholder = "Enter Email address"}) @Html.ValidationMessageFor(model => model.Person.Email) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Programme</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.AppliedCourse.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Programme.Id) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Department</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.AppliedCourse.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Jamb Reg Number</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Form Type</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.AppliedCourse.Setting.Id, (IEnumerable<SelectListItem>)ViewBag.SettingId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Setting.Id) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> </div> </div> } </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ ViewBag.Title = "RemoveStudentCourse"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Action"] != null) { <div class="alert alert-dismissible alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <p>@TempData["Action"].ToString()</p> </div> } @using (Html.BeginForm("RemoveStudentCourse", "Result", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.MatricNumber, new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.TextBoxFor(m => m.MatricNumber, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(m => m.MatricNumber, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.CourseCode, new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.TextBoxFor(m => m.CourseCode, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(m => m.CourseCode, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Session, new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.Session.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-default" /> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.CourseRegistrationViewModel <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <div class="row"> <div class="col-md-12"> <b>Second Semester Courses</b> <div class="pull-right record-count-label"> <span class="caption">Sum of Selected Course Unit</span><span id="spSecondSemesterTotalCourseUnit" class="badge">@Model.SumOfSecondSemesterSelectedCourseUnit</span> <label class="caption">Min Unit</label><span id="spSecondSemesterMinimumUnit" class="badge">@Model.SecondSemesterMinimumUnit</span> <label class="caption">Max Unit</label><span id="spSecondSemesterMaximumUnit" class="badge">@Model.SecondSemesterMaximumUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.SecondSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive" style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb5"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @*@Html.CheckBox("selectAllSecondSemester")*@ </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < Model.SecondSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.CheckBoxFor(model => Model.SecondSemesterCourses[i].Course.IsRegistered, new {@class = "ckb2", id = Model.SecondSemesterCourses[i].Course.Id}) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Code) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Id) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Unit) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.SecondSemesterCourses[i].Course.Type.Name) </td> @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Mode.Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].Id) @Html.HiddenFor(model => Model.SecondSemesterCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentPaymentViewModel @{ ViewBag.Title = "Edit Student Payment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-2.1.3.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#btnEdit").click(function () { $("#myModal").modal(); }); $('#backBtn').click(function() { window.location.href = "/Admin/StudentPayment"; }); }); </script> <div class="jumbotron" style="display: none"> </div> <div class="row"> <div class="well panel-body"> @using(Html.BeginForm("EditPayment","StudentPayment",new { Area = "Admin" },FormMethod.Post,new { @class = "form-horizontal",role = "form" })) { <div class="modal-body"> @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Payment_Id) @Html.HiddenFor(model => model.Person_Id) @Html.HiddenFor(model => model.Session_Id) @Html.HiddenFor(model => model.Level_Id) @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } @if(Model == null) { return; } <div class="form-group"> @Html.LabelFor(model => model.person.Id,"Student Name",new { @class = "control-label col-md-2" }) <div class="col-md-10 "> @Html.DisplayFor(model => model.person.FullName,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.FullName) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Amount,"Amount",new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.TextBoxFor(model => model.Amount,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Amount) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name,"Level",htmlAttributes:new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownListFor(model => model.Level.Id,(IEnumerable<SelectListItem>)ViewBag.Level,new { @class = "form-control",@required = "required" }) @Html.ValidationMessageFor(model => model.Level.Name,"",new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Session.Name,"Session",htmlAttributes:new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownListFor(model => model.Session.Id,(IEnumerable<SelectListItem>)ViewBag.Session,new { @class = "form-control",@required = "required" }) @Html.ValidationMessageFor(model => model.Session.Name,"",new { @class = "text-danger" }) </div> </div> </div> </div> <div class="modal-footer"> <button id="Save" type="submit" class="btn btn-success">Save</button> <button type="button" class="btn btn-danger"id="backBtn">Back</button> </div> } </div> </div> <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Edit Student Payment</h4> </div> </div> </div> </div><file_sep> @model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGViewModel <div class="panel panel-default p-4"> <div class="col-md-12"> <div class="panel-heading"> <div style="font-size: x-large">Referee Details</div> </div> @for (int i = 0; i < Model.ApplicantReferees.Count; i++) { <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Rank, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Rank, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Rank) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Department, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Department, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Department) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Institution, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Institution, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Institution) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].PhoneNo, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].PhoneNo, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].PhoneNo) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantReferees[i].Email, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantReferees[i].Email, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantReferees[i].Email) </div> </div> </div> </div> <br /> <hr /> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "UpdatePassport"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script> function show1(input) { if (input.files && input.files[0]) { var filerdr = new FileReader(); filerdr.onload = function(e) { $('#passport').attr('src', e.target.result); }; filerdr.readAsDataURL(input.files[0]); } } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Update Student Passport</div> </div> <div class="panel-body"> @using (Html.BeginForm("UpdatePassport", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Number, "Application Form Number", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.ApplicationForm.Number, new {@class = "form-control", @placeholder = "Enter Application Form Number", @required = "required"}) @Html.ValidationMessageFor(model => model.ApplicationForm.Number, "", new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> @if (Model == null || Model.Person == null) { return; } @if (Model != null && Model.Person != null) { using (Html.BeginForm("SaveStudentPassport", "Support", FormMethod.Post, new {area = "Admin", enctype = "multipart/form-data"})) { @Html.HiddenFor(model => model.Person.Id) ; <div class="row"> <div class="form-group"> @if (Model.Person.ImageFileUrl == null) { <div class="bg-light pull-left col-xs-offset-2 text-center media-large thumb-large"> <img id="passport" src="" height="100" width="90" /> @*<i class="icon-user inline icon-light icon-3x m-t-large m-b-large"></i>*@ </div> } else { <div class="bg-light pull-left col-xs-offset-2 text-center media-large thumb-large"> <img id="passport" src="@Url.Content("~" + Model.Person.ImageFileUrl)" height="100" width="90" /> @*<i class="icon-user inline icon-light icon-3x m-t-large m-b-large"></i>*@ </div> } @*<input type="file" title="Upload" name="txtPassport" id="txtPassport" class="btn btn-small btn-info m-b-small" readonly="readonly"><br>*@ <input type="file" title="Upload" id="file" name="file" onchange=" show1(this) " class=" btn btn-default btn-sm " /> </div> <div class="form-group"> @Html.LabelFor(model => model.Person.FullName, "Full Name", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.Person.FullName, new {@class = "form-control", @placeholder = "", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, "Mobile Phone", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control", @placeholder = "", @disabled = "disabled"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-success mr5" /> </div> </div> </div> } } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/jquery-1.7.1.js"></script> <script src="~/Scripts/jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { //$("#State").hide(); //$("#StateName").hide(); $('#activatedDiv').hide() $("#deliveryService").hide(); $("#deliveryServiceZone").hide(); $("#Country").change(function () { $.ajax({ type: 'POST', url: '/Applicant/Transcript/GetState', // Calling json method dataType: 'json', data: { id: $("#Country").val() }, // Get Selected Country ID. success: function (country) { if (country == "NIG") { $("#State").show(); $("#StateName").show(); } else { $("#State").hide(); $("#StateName").hide(); } }, error: function (ex) { alert('Request Cannot be Processed.'); } }); return false; }); $("#Country").on("change", function () { $("#DeliveryServiceZone_Id").empty(); var ched = $('#courierCheckbox').prop("checked"); if ($("#Country").val() == "OTH") { if ($('#courierCheckbox').prop("checked")) { $("#DeliveryService_Id").empty(); $("#deliveryServiceZone").show(); loadDeliveryServices($("#Country").val(), "OT"); } } else if ($("#Country").val() != undefined && $("#State").val() != undefined) { if ($('#courierCheckbox').prop("checked")) { $("#DeliveryService_Id").empty(); loadDeliveryServices($("#Country").val(), $("#State").val()); } } else { $("#DeliveryService_Id").empty(); $("#deliveryService").hide(); } if ($("#Country").val() != undefined && $("#State").val() != undefined && $("#DeliveryService_Id").val() != undefined) { if ($('#courierCheckbox').prop("checked")) { loadDeliveryServiceZones($("#Country").val(), $("#State").val(), $("#DeliveryService_Id").val()); } } else { $("#DeliveryServiceZone_Id").empty(); $("#deliveryServiceZone").hide(); } return; }); $("#State").on("change", function () { $("#DeliveryServiceZone_Id").empty(); ; if ($("#Country").val() != undefined && $("#State").val() != undefined) { if ($('#courierCheckbox').prop("checked")) { $("#DeliveryService_Id").empty(); $("#deliveryServiceZone").show(); loadDeliveryServices($("#Country").val(), $("#State").val()); } } else { $("#DeliveryService_Id").empty(); $("#deliveryService").hide(); } if ($("#Country").val() != undefined && $("#State").val() != undefined && $("#DeliveryService_Id").val() != undefined) { if ($('#courierCheckbox').prop("checked")) { loadDeliveryServiceZones($("#Country").val(), $("#State").val(), $("#DeliveryService_Id").val()); } } else { $("#DeliveryServiceZone_Id").empty(); $("#deliveryServiceZone").hide(); } return; }); $("#feeTypeId").on("change", function () { if ($("#feeTypeId").val() == 13) { $("#activatedDiv").show(); } else { $("#activatedDiv").hide(); } }); $("#DeliveryService_Id").on("change", function () { $("#DeliveryServiceZone_Id").empty(); if ($("#Country").val() != undefined && $("#State").val() != undefined && $("#DeliveryService_Id").val() != undefined) { if ($("#Country").val() == "OTH") { $("#State").val("OT"); } loadDeliveryServiceZones($("#Country").val(), $("#State").val(), $("#DeliveryService_Id").val()); } else { $("#DeliveryServiceZone_Id").empty(); $("#deliveryServiceZone").hide(); } return; }); $("#DeliveryServiceZone_Id").on("change", function () { $("#submit").attr("disabled", false); }); }); function loadDeliveryServices(country, state) { $("#DeliveryService_Id").empty(); if (country != undefined && state != undefined) { $.ajax({ type: 'POST', url: '/Applicant/Transcript/GetDeliveryServices', // Calling json method dataType: 'json', data: { countryId: country, stateId: state }, success: function (services) { $("#DeliveryService_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(services, function (i, service) { $("#DeliveryService_Id").append('<option value="' + service.Value + '">' + service.Text + '</option>'); }); }, error: function (ex) { alert('Request Cannot be Processed.'); } }); $("#deliveryService").show(); } } function loadDeliveryServiceZones(country, state, deliveryService) { $("#DeliveryServiceZone_Id").empty(); if (country != undefined && state != undefined && deliveryService != undefined) { $.ajax({ type: 'POST', url: '/Applicant/Transcript/GetDeliveryServiceZones', // Calling json method dataType: 'json', data: { countryId: country, stateId: state, deliveryServiceId: deliveryService }, success: function (zones) { $("#DeliveryServiceZone_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(zones, function (i, zone) { $("#DeliveryServiceZone_Id").append('<option value="' + zone.Value + '">' + zone.Text + '</option>'); }); $("#submit").attr("disabled", false); }, error: function (ex) { alert('Request Cannot be Processed.'); } }); $("#deliveryServiceZone").show(); } } function checkTranscriptZone() { if ($("#Country").val() != undefined) { var checked = $('#courierCheckbox').prop("checked"); if (checked) { if ($("#DeliveryService_Id").val() == undefined || $("#DeliveryServiceZone_Id").val() == undefined || $("#DeliveryService_Id").val() == 0 || $("#DeliveryServiceZone_Id").val() == 0) { alert("You did not select a delivery service or zone."); $("#submit").attr("disabled", "disabled"); } else { $("#submit").attr("disabled", false); } } } } function showDeliveryServiceZone() { if ($('#courierCheckbox').prop("checked")) { $("#courierId").show(); $("#deliveryService").show(); $("#deliveryServiceZone").show(); if ($("#Country").val() == "OTH") { $("#DeliveryService_Id").empty(); loadDeliveryServices($("#Country").val(), "OT"); } else if ($("#Country").val() != undefined && $("#State").val() != undefined) { $("#DeliveryService_Id").empty(); loadDeliveryServices($("#Country").val(), $("#State").val()); } } else { $("#courierId").hide(); $("#deliveryService").hide(); $("#deliveryServiceZone").hide(); } } </script> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h2> Transcript <span class="label label-default"> Request Form</span> </h2> </div> <hr /> </div> @using (Html.BeginForm("Request", "Transcript", FormMethod.Post, new { id = "frmIndex", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.transcriptRequest.student.Id) @Html.HiddenFor(model => model.transcriptRequest.Id) @Html.HiddenFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusId) <div class="col-md-12"> <h6 style="color:red">* Transcript Request Should be done using Names on Statement of Result/Certificate</h6> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.LastName) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.LastName, new { @class = "form-control", @placeholder = "Enter Surname" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.LastName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.LastName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.FirstName) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.FirstName, new { @class = "form-control", @placeholder = "Enter Firstname" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.FirstName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.FirstName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.OtherName, new { @class = "control-label " }) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.OtherName, new { @class = "form-control", @placeholder = "Enter Other Name" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.OtherName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.OtherName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "control-label " }) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "form-control", @placeholder = "Enter Matric Number" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.MatricNumber) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.Email, new { @class = "control-label " }) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.Email, new { @class = "form-control", @placeholder = "Enter Email" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.Email, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.Email) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MobilePhone, new { @class = "control-label " }) @if (Model.transcriptRequest.student == null) { @Html.TextBoxFor(model => model.transcriptRequest.student.MobilePhone, new { @class = "form-control", @placeholder = "Enter Phone No" }) } else { @Html.TextBoxFor(model => model.transcriptRequest.student.MobilePhone, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.transcriptRequest.student.MobilePhone) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme, "Programme", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Programme.Id, (List<SelectListItem>)ViewBag.Programme, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department, "Department", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Department.Id, (List<SelectListItem>)ViewBag.Department, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Department) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level, "Level", new { @class = "control-label " }) @Html.DropDownListFor(model => model.Level.Id, (List<SelectListItem>)ViewBag.Level, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Level) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.payment.FeeType.Id, "Request Type", new { @class = "control-label " }) @Html.DropDownListFor(model => model.transcriptRequest.payment.FeeType.Id, (List<SelectListItem>)ViewBag.FeeType, new { @class = "form-control",id ="feeTypeId" }) @Html.ValidationMessageFor(model => model.transcriptRequest.payment.FeeType.Id) </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationAddress, new { @class = "control-label " }) @Html.TextAreaFor(model => model.transcriptRequest.DestinationAddress, new { @class = "form-control", @placeholder = "The Registrar Abia State University, School of Postgraduate Studies" }) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationAddress) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationCountry, new { @class = "control-label " }) @Html.DropDownListFor(model => model.transcriptRequest.DestinationCountry.Id, (IEnumerable<SelectListItem>)ViewBag.CountryId, new { @class = "form-control", @id = "Country" }) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationCountry) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationState, new { @class = "control-label ", @id = "StateName" }) @Html.DropDownListFor(model => model.transcriptRequest.DestinationState.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control", @id = "State" }) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationState) </div> </div> </div> <div class="row" id="activatedDiv"> <div class="col-md-12"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationState, "Tick the box to make use of courier for this transcript request", new {@class = "control-label ", @id = "StateName"}) @Html.CheckBoxFor(model => model.Activated, new { @id = "courierCheckbox", onclick = "showDeliveryServiceZone()"}) @Html.ValidationMessageFor(model => model.Activated) </div> </div> </div> <div class="row" id="courierId"> <div class="col-md-6" style="" id="deliveryService"> <div class="form-group"> @Html.LabelFor(model => model.DeliveryService.Name,"Delivery Service",new {@class = "control-label "}) @Html.DropDownListFor(model => model.DeliveryService.Id, (IEnumerable<SelectListItem>) ViewBag.DeliveryServices, new {@class = "form-control", @id = "DeliveryService_Id"}) @Html.ValidationMessageFor(model => model.DeliveryService.Id) </div> </div> <div class="col-md-6" style="" id="deliveryServiceZone"> <div class="form-group"> @Html.LabelFor(model => model.DeliveryServiceZone.Name,"Zone",new { @class = "control-label " }) @Html.DropDownListFor(model => model.DeliveryServiceZone.Id, (IEnumerable<SelectListItem>)ViewBag.DeliveryServiceZones, new { @class = "form-control", @id = "DeliveryServiceZone_Id" }) @Html.ValidationMessageFor(model => model.DeliveryServiceZone.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> </div> </div> <div class="col-md-12"> <div class="form-group"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" onclick="checkTranscriptZone()" id="submit" value="Submit" /> </div> </div> </div> </div> <h6 style="color:red">* For any Trancript Request or Enquiry, Please call 08102683267</h6> } </div> </div><file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Edit Nationality"; } @Html.Partial("Setup/_Edit", @Model)<file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Student.ViewModels.CourseRegistrationViewModel @{ Layout = null; var firstSemesterCourses = new List<CourseRegistrationDetail>(); var secondSemesterCourses = new List<CourseRegistrationDetail>(); if (Model.FirstSemesterCourses != null) { firstSemesterCourses = Model.FirstSemesterCourses.Where(c => c.Course.IsRegistered).ToList(); } if (Model.SecondSemesterCourses != null) { secondSemesterCourses = Model.SecondSemesterCourses.Where(c => c.Course.IsRegistered).ToList(); } } <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 "> <div class="col-xs-1"></div> <div class="col-xs-10"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <center class="col-xs-12"> <img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" width="150px" /> </center> </div> <div class="form-group"> <center class="col-xs-12"> <div style="font-size: large">The Federal Polytechnic, Ilaro</div> </center> </div> </div> </div> <div class="shadow"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <center class="col-xs-12"> <h2>Course Registration Form</h2> </center> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <div class="col-xs-12"> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <div class="col-xs-12" style="font-size: 25pt; text-transform: uppercase"> @Html.DisplayFor(model => model.Student.FullName) (@Html.DisplayFor(model => model.StudentLevel.Level.Name)) DETAILS <img class="pull-right" src="@Url.Content('~' + Model.Student.ImageFileUrl)" alt="" style="max-height: 150px" /> </div> </div> </div> </div> <div class="row"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.Label("Session", new {@class = "control-label "}) </div> <div class="col-xs-7 "> @Html.DisplayFor(model => model.CurrentSessionSemester.SessionSemester.Session.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.StudentLevel.Programme.Name) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-5"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new {@class = "control-label "}) </div> <div class="col-xs-7 "> @Html.DisplayFor(model => model.StudentLevel.Department.Name) </div> </div> </div> </div> <div class="row"> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Name, new {@class = "control-label "}) </div> <div class="col-xs-8 "> @Html.DisplayFor(model => model.StudentLevel.Department.Faculty.Name) </div> </div> </div> <div class="col-xs-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> @if (Model != null && Model.CarryOverCourses != null && Model.CarryOverCourses.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-xs-12"> <b>Carry Over Courses</b> <div class="pull-right record-count-label"> <label class="caption">1st Semester Total Unit</label><span class="badge">@Model.TotalFirstSemesterCarryOverCourseUnit</span> <label class="caption">2nd Semester Total Unit</label><span class="badge">@Model.TotalSecondSemesterCarryOverCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.CarryOverCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> <th> Semester </th> </tr> </thead> @for (int i = 0; i < Model.CarryOverCourses.Count; i++) { if (Model.CarryOverCourses[i].Course.IsRegistered) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Course.Type.Name) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => Model.CarryOverCourses[i].Semester.Name) </td> </tr> } } </table> </div> </div> </div> </div> </div> </div> } <div class="panel panel-default"> <div class="panel-body"> <div id="divFirstSemesterCourses"> @if (Model != null && firstSemesterCourses != null && firstSemesterCourses.Count > 0) { <div class="row"> <div class="col-xs-12"> <b>First Semester Courses</b> <div class="pull-right record-count-label"> <label class="caption">Total Course Unit</label><span id="spFirstSemesterTotalCourseUnit" class="badge">@Model.SumOfFirstSemesterSelectedCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@firstSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < firstSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => firstSemesterCourses[i].Course.Type.Name) </td> </tr> } </table> </div> </div> </div> } </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <div id="divSecondSemesterCourses"> @if (Model != null && secondSemesterCourses != null && secondSemesterCourses.Count > 0) { <div class="row"> <div class="col-xs-12"> <b>Second Semester Courses</b> <div class="pull-right record-count-label"> <span class="caption">Total Course Unit</span><span id="spSecondSemesterTotalCourseUnit" class="badge">@Model.SumOfSecondSemesterSelectedCourseUnit</span> <span class="caption">Total Course</span><span class="badge">@secondSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="table-responsive" style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb5"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < secondSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.DisplayFor(model => secondSemesterCourses[i].Course.Type.Name) </td> </tr> } </table> </div> </div> </div> } </div> </div> </div> </div> <div class="col-xs-1"></div> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Create Returning Student"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#StudentLevel_Programme_Id").change(function() { var programme = $("#StudentLevel_Programme_Id").val(); $("#StudentLevel_Department_Id").empty(); $("#StudentLevel_Level_Id").empty(); $.ajax({ type: 'GET', url: '@Url.Action("GetDepartmentAndLevelByProgrammeId", "Support")', dataType: 'json', data: { id: programme }, success: function(data) { var levels = data.Levels; var departments = data.Departments; if (departments != "" && departments != null && departments != undefined) { $("#StudentLevel_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#StudentLevel_Department_Id").append('<option value="' + department.Id + '">' + department.Name + '</option>'); }); } if (levels != "" && levels != null && levels != undefined) { $("#StudentLevel_Level_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(levels, function(i, level) { $("#StudentLevel_Level_Id").append('<option value="' + level.Id + '">' + level.Name + '</option>'); }); } }, error: function(ex) { alert('Failed to retrieve departments.' + ex.message); } }); }); }) </script> @using (Html.BeginForm("CreateReturningStudentAsync", "Support", FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="row"> <h3>Choose Programme</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Sessions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.StudentLevel.Programme.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Id, "Course", new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div id="divDepartmentOption" class="form-group" style="display: none"> </div> </div> </div> </div> </div> <br /> <div class="row"> <h3>Please enter other personal details</h3> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.LastName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.State.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>) ViewBag.States, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Email, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.Email, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new {@class = "control-label"}) @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Level.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Levels, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.Level.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> </div> </div> <div class="col-md-6"> </div> </div> </div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10 "> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-primary btn-lg mr5" type="submit" value="Create Student" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <div class="col-md-1"></div> </div> }<file_sep>@model Abundance_Nk.Model.Model.PostUtmeResult @{ ViewBag.Title = "PUTME RESULT SLIP"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>PUTME Result Slip</title> </head> <body> <div class="alert alert-success fade in" style="border: 1px solid green"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 7px"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" /></td> <td> <h3><strong>THE FEDERAL POLYTECHNIC, ILARO</strong></h3> <p> P.M.B. 50, ILARO, OGUN STATE. </p> </td> </tr> </table> </div> </div> <br /> <div> <h2>PUTME Result Slip</h2> <hr class="no-top-padding" /> <div class="row"> <div class="col-md-12" style="text-align: justify"> <br /> <p> Dear @Html.DisplayFor(model => model.Fullname), </p> <p> We are happy to announce that your result for the past PUTME are as follows; <div class="panel panel-default"> <div class="panel-body"> <table class="table table-responsive table-condensed "> <thead> <tr> <td>Course</td> <td>Score</td> <td>Remarks</td> </tr> </thead> <tbody> <tr> <td>ENGLISH</td> <td>@Html.DisplayFor(model => model.Eng)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub2)</td> <td>@Html.DisplayFor(model => model.Scr2)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub3)</td> <td>@Html.DisplayFor(model => model.Scr3)</td> <td>--</td> </tr> <tr> <td>@Html.DisplayFor(model => model.Sub4)</td> <td>@Html.DisplayFor(model => model.Scr4)</td> <td>--</td> </tr> </tbody> </table> <br /> Your Total Score is <strong> @Html.DisplayFor(model => model.Total)</strong> and your Jamb Registration Number/Application Number is <strong> @Html.DisplayFor(model => model.Result.Regno)</strong> </div> </div> </p> </div> </div> <div class="row"> <div class="col-md-12"> <h5><NAME></h5> <br /> <p>Registrar</p> </div> </div> </div> </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel @{ ViewBag.Title = "Pay Fee"; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#FeeType_Id option[value='13']").remove(); swal({ title: "Attention!", text: "Ensure that you have not made payment for the fee you are about to process ELSE you risk loosing the processed fee.", type: "warning" }); }); </script> <div class="container"> <div class=" card card-shadow"> <div class=" text-success"> <h1><b>Pay Fee</b></h1> </div> <section id="loginForm"> @using (Html.BeginForm("OldFees", "Payment", new { Area = "Student" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <h5>Please enter your <b>Matriculation Number</b> in the box below and select the fee you want to generate an invoice for</h5> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", disabled = "disabled" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.FeeType.Id, new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(m => m.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeTypes, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.FeeType.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Next" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel <br /> <div style="margin-bottom: 15px; text-align: justify"> <blockquote> <p style="color: darkgreen; font-weight: bold"> Please fill in the required details and click on the next button to proceed </p> <small>This marks the first step of your application process.<cite title="Source Title"></cite></small> </blockquote> </div> <h3>Personal Details</h3> <div class="row"> <div class="well"> <div class="form-group "> @Html.LabelFor(model => model.Person.Sex.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(f => f.Person.Sex.Id,(IEnumerable<SelectListItem>)ViewBag.SexId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Sex.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.DateOfBirth,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(m => m.Person.YearOfBirth.Id,(IEnumerable<SelectListItem>)ViewBag.YearOfBirthId,new { @class = "form-control" }) @Html.DropDownListFor(m => m.Person.MonthOfBirth.Id,(IEnumerable<SelectListItem>)ViewBag.MonthOfBirthId,new { @class = "form-control" }) @Html.DropDownListFor(m => m.Person.DayOfBirth.Id,(IEnumerable<SelectListItem>)ViewBag.DayOfBirthId,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.State.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(f => f.Person.State.Id,(IEnumerable<SelectListItem>)ViewBag.StateId,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.State.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.LocalGovernment.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(f => f.Person.LocalGovernment.Id,(IEnumerable<SelectListItem>)ViewBag.LgaId,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.LocalGovernment.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.HomeTown,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Person.HomeTown,new { @class = "form-control " }) @Html.ValidationMessageFor(model => model.Person.HomeTown) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.Religion.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.Person.Religion.Id,(IEnumerable<SelectListItem>)ViewBag.ReligionId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Religion.Id) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Person.HomeAddress,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Person.HomeAddress,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Applicant.Ability.Name,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.DropDownListFor(model => model.Applicant.Ability.Id,(IEnumerable<SelectListItem>)ViewBag.AbilityId,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Applicant.OtherAbility,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Applicant.OtherAbility,new { @class = "form-control" }) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.Applicant.ExtraCurricullarActivities,new { @class = "control-label col-sm-3" }) <div class="col-sm-9" style="font-weight: bold"> @Html.TextBoxFor(model => model.Applicant.ExtraCurricullarActivities,new { @class = "form-control" }) </div> </div> <div class="form-group "> <div class="col-sm-3 "></div> <div class="col-sm-9 "> <div class="form-inline"> <div class="form-group"> <button class="btn btn-primary btn-metro mr5" type="button" value="Next">Next</button> </div> <div class="form-group margin-bottom-0"> <div style="display: none"> </div> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <h5 class="mt-2">GENERATE SCHOOL FEES INVOICE</h5> <hr/> <div class="container p-0 ml-0"> <div class="col-md-12 row p-0 ml-0"> <div class="form-group col-md-4 p-0 ml-0"> @Html.LabelFor(model => model.AcceptanceReceiptNumber, new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-6 pl-0 ml-0" style="font-weight: bold"> @Html.DisplayFor(model => model.AcceptanceReceiptNumber, new { @class = "form-control" }) </div> </div> <div class="form-group col-md-12 p-0 ml-0"> @Html.LabelFor(model => model.PaymentMode.Id, "Payment Option", new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-12 pl-0 ml-0" style="font-weight:bold"> @Html.DropDownListFor(model => model.PaymentMode.Id, (IEnumerable<SelectListItem>)ViewBag.PaymentModes, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(model => model.PaymentMode.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group col-md-12 p-0 ml-0"> <div class="form-inline"> <div class="form-group"> <button class="btn btn-warning mr5" type="button" name="btnGenerateSchoolFeesInvoice" id="btnGenerateSchoolFeesInvoice">Generate Invoice</button> </div> <div class="form-group margin-bottom-0"> <div id="divProcessingSchoolFeesInvoice" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> </div> <div class="form-inline"> <div class="form-group margin-bottom-0 divSchoolFeesInvoice" style="display: none"> <a id="aSchoolFeesInvoiceNumber" href="#" target="_blank" class="btn btn-primary btn-lg">Print Invoice</a> </div> </div> <br /> <div id="divGenerateSchoolFeesInvoice"></div> </div> <file_sep>@using Abundance_Nk.Web.Models @using Microsoft.AspNet.Identity @{ Layout = null; } <!DOCTYPE html> <html lang="en"> <head> <title>@ViewBag.Title - University Of Port-Harcourt</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <!-- END META SECTION --> <!-- CSS INCLUDE --> <link href="~/Content/theme-default.css" rel="stylesheet" /> @*<link href="~/Content/assets/css/now-ui-kit.css" rel="stylesheet"/>*@ <link href="~/Content/dataTables.css" rel="stylesheet" /> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> <link href="~/Scripts/DataTables-1.10.15/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css" rel="stylesheet" /> <style> .x-navigation ul li a { /*font-size: 12px!important;*/ font-family: 'Quicksand', sans-serif; } .xn-openable a { font-size: 11px !important; } .sofia { font-family: 'Quicksand', sans-serif !important; } p, a, li, span, input, b { font-family: 'Quicksand', sans-serif !important; } table tr td { font-family: 'Quicksand', sans-serif !important; } div { font-family: 'Quicksand', sans-serif !important; } </style> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500&display=swap" rel="stylesheet"> </head> <body> <!-- START PAGE CONTAINER --> <div class="page-container"> <!-- START PAGE SIDEBAR --> <div class="page-sidebar"> <!-- START X-NAVIGATION --> <ul class="x-navigation"> @*<li class="xn-logo"> <a href="@Url.Action("Home", "Account", new {Area = "Security"})"></a> <a href="#" class="x-navigation-control"></a> </li>*@ <li class="xn-profile"> <a href="#" class="profile-mini"> <img class="img-responsive" src="@Url.Content("~/Content/Images/school_logo.png")" alt="school logo" /> </a> <div class="profile"> <div class="profile-image"> <a href="@Url.Action("Home", "Account", new {Area = "Security"})"> <img src="@Url.Content("~/Content/Images/school_logo.png")" alt="school logo" /> </a> </div> <div class="profile-data"> <div class="profile-data-name"> <p class="font-weight-700 text-light text-capitalize">Hello, @User.Identity.GetUserName() </p> </div> </div> @*<div class="profile-controls"> <a href="@Url.Action("ChangePassword", "Account", new {Area = "Security"})" class="profile-control-left"><span class="fa fa-info"></span></a> <a href="#" class="profile-control-right"><span class="fa fa-envelope"></span></a> </div>*@ </div> </li> @*<li class="xn-title">Menu</li>*@ @if (User.Identity.IsAuthenticated) { string role = Menu.GetUserRole(User.Identity.Name); List<Abundance_Nk.Model.Model.Menu> menuList = Menu.GetMenuList(role); if (menuList != null && menuList.Count > 0) { List<string> menuGroups = menuList.Select(m => m.MenuGroup.Name).Distinct().ToList(); for (int i = 0; i < menuGroups.Count; i++) { string currentMenuGroup = menuGroups[i]; List<Abundance_Nk.Model.Model.Menu> menuListForGroup = menuList.Where(m => m.MenuGroup.Name == currentMenuGroup).OrderBy(a => a.DisplayName).ToList(); string scriptId = "#demo" + (i); string ulId = "demo" + (i); <li class="xn-openable"> <a href="javascript:;" data-toggle="collapse" data-target=@scriptId> @currentMenuGroup</a> <ul id=@ulId class="collapse"> @for (int j = 0; j < menuListForGroup.Count; j++) { Abundance_Nk.Model.Model.Menu currentMenu = menuListForGroup[j]; <li>@Html.ActionLink(currentMenu.DisplayName, currentMenu.Action, currentMenu.Controller, new {currentMenu.Area}, null)</li> } </ul> </li> } } } </ul> <!-- END X-NAVIGATION --> </div> <!-- END PAGE SIDEBAR --> <!-- PAGE CONTENT --> <div class="page-content"> <!-- START X-NAVIGATION VERTICAL --> <ul class="x-navigation x-navigation-horizontal x-navigation-panel"> <!-- TOGGLE NAVIGATION --> <li class="xn-icon-button"> <a href="#" class="x-navigation-minimize"><span class="fa fa-dedent"></span></a> </li> <!-- END TOGGLE NAVIGATION --> <!-- SIGN OUT --> <li class="xn-icon-button pull-right"> <a href="#" class="mb-control" data-box="#mb-signout">Log out<span class="fa fa-sign-out"></span></a> </li> <!-- END SIGN OUT --> </ul> <!-- END X-NAVIGATION VERTICAL --> <!-- PAGE CONTENT WRAPPER --> <div class="page-content-wrap"> <div class="container-fluid"> @RenderBody() </div> </div> <!-- END PAGE CONTENT WRAPPER --> </div> <!-- END PAGE CONTENT --> </div> <!-- MESSAGE BOX--> <div class="message-box animated fadeIn" data-sound="alert" id="mb-signout"> <div class="mb-container"> <div class="mb-middle"> @if (Request.IsAuthenticated) { using (Html.BeginForm("LogOff", "Account", new { Area = "Security" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { @Html.AntiForgeryToken() <div class="mb-title"><span class="fa fa-sign-out"></span> Log <strong>Out</strong> ?</div> <div class="mb-content"> <p>Are you sure you want to log out?</p> <p>Press No if you want to continue working. Press Yes to logout current user.</p> </div> <div class="mb-footer"> <div class="pull-right"> <a href="javascript:document.getElementById('logoutForm').submit()" class="btn btn-success btn-lg">Yes</a> <button class="btn btn-default btn-lg mb-control-close">No</button> </div> </div> } } </div> </div> </div> <!-- END MESSAGE BOX--> <!-- END PAGE CONTAINER --> <!-- START PRELOADS --> <audio id="audio-alert" src="~/Content/audio/alert.mp3" preload="auto"></audio> <audio id="audio-fail" src="~/Content/audio/fail.mp3" preload="auto"></audio> <!-- END PRELOADS --> <!-- START SCRIPTS --> <!-- START PLUGINS --> <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery-ui.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/bootstrap/bootstrap.min.js"></script> <!-- END PLUGINS --> <!-- THIS PAGE PLUGINS --> <script type='text/javascript' src='~/Scripts/js/plugins/icheck/icheck.min.js'></script> <script type="text/javascript" src="~/Scripts/js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/bootstrap/bootstrap-datepicker.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/bootstrap/bootstrap-file-input.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/bootstrap/bootstrap-select.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/tagsinput/jquery.tagsinput.min.js"></script> <!-- END THIS PAGE PLUGINS --> <!-- START TEMPLATE --> <script type="text/javascript" src="~/Scripts/js/plugins.js"></script> <script type="text/javascript" src="~/Scripts/js/actions.js"></script> <script src="~/Scripts/dataTables.js"></script> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/DataTables-1.10.15/momentjs/moment.js"></script> <script src="~/Scripts/DataTables-1.10.15/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"></script> <!-- END TEMPLATE --> <!-- END SCRIPTS --> </body> @RenderSection("scripts",required:false) </html><file_sep>@model Abundance_Nk.Model.Entity.PAYMENT_ETRANZACT_TYPE @{ ViewBag.Title = " "; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div> <h4>PAYMENT ETRANZACT TYPE</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Payment Etranzact Name") </dt> <dd> @Html.DisplayFor(model => model.Payment_Etranzact_Type_Name) </dd> <dt> @Html.DisplayName("Fee Type") </dt> <dd> @Html.DisplayFor(model => model.FEE_TYPE.Fee_Type_Name) </dd> <dt> @Html.DisplayName("Level") </dt> <dd> @Html.DisplayFor(model => model.LEVEL.Level_Name) </dd> <dt> @Html.DisplayName("Payment Mode") </dt> <dd> @Html.DisplayFor(model => model.PAYMENT_MODE.Payment_Mode_Name) </dd> <dt> @Html.DisplayName("Programme") </dt> <dd> @Html.DisplayFor(model => model.PROGRAMME.Programme_Name) </dd> <dt> @Html.DisplayName("Session") </dt> <dd> @Html.DisplayFor(model => model.SESSION.Session_Name) </dd> </dl> </div> <p> @Html.ActionLink("Edit", "Edit", new { id = Model.Payment_Etranzact_Type_Id }) | @Html.ActionLink("Back to List", "Index") </p><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel <br /> <div class="bg-warning p-4" style="color: #fff;"> <blockquote> <p style=" font-weight: bold"> Welcome to the final step of your admission process. </p> <small>Please confirm your Order Number for Acceptance and School Fees payment below. In case of any discrepancy, report immediately to the appropriate authority. <b>Please proceed to ICS for your ID Card</b><cite title="Source Title"></cite></small> </blockquote> </div> <h5>CONFIRM YOUR DETAILS</h5><hr /> <div class="container pl-0 ml-0"> <div class="col-md-12 pl-0 ml-0"> @*<div class="form-group margin-bottom-0"> @Html.LabelFor(model => model.ApplicationForm.Number, new { @class = "control-label col-sm-3" }) <div class="col-sm-9 text-bold"> @Html.DisplayFor(model => model.ApplicationForm.Number) </div> </div>*@ <div class="form-group row pl-0 ml-0"> @Html.LabelFor(model => model.AcceptanceInvoiceNumber, new { @class = "pl-0 ml-0 col-sm-4" }) <div class="col-md-6 pl-0 ml-0 text-bold"> <b> @Html.DisplayFor(model => model.AcceptanceInvoiceNumber, new { @class = "pl-0 ml-0 form-control" }) </b> </div> </div> <div class="form-group row pl-0 ml-0"> @Html.LabelFor(model => model.SchoolFeesInvoiceNumber, new { @class = "pl-0 ml-0 col-sm-4" }) <div class="col-md-6 text-bold"> <b> @Html.DisplayFor(model => model.SchoolFeesInvoiceNumber, new { @class = "pl-0 ml-0 form-control" })</b> </div> </div> @*<div class="form-group margin-bottom-0"> @Html.LabelFor(model => model.AcceptanceConfirmationOrderNumber, new { @class = "control-label col-sm-3" }) <div class="col-sm-9 text-bold"> @Html.DisplayFor(model => model.AcceptanceConfirmationOrderNumber, new { @class = "form-control" }) </div> </div> <div class="form-group margin-bottom-0"> @Html.LabelFor(model => model.SchoolFeesConfirmationOrderNumber, new { @class = "control-label col-sm-3" }) <div class="col-sm-9 text-bold"> @Html.DisplayFor(model => model.SchoolFeesConfirmationOrderNumber, new { @class = "form-control" }) </div> </div>*@ <div class="form-group row pl-0 ml-0"> @Html.LabelFor(model => model.AcceptanceReceiptNumber, new { @class = "pl-0 ml-0 col-sm-4" }) <div class="col-sm-6 text-bold"> <b>@Html.DisplayFor(model => model.AcceptanceReceiptNumber, new { @class = "form-control" })</b> </div> </div> <div class="form-group row pl-0 ml-0"> @Html.LabelFor(model => model.SchoolFeesReceiptNumber, new { @class = "pl-0 ml-0 col-sm-4" }) <div class="col-sm-6 text-bold"> <b> @Html.DisplayFor(model => model.SchoolFeesReceiptNumber, new { @class = "form-control" })</b> </div> </div> </div> <div class="form-inline"> <div class="form-group pl-0 ml-0"> @Html.ActionLink("Fill Course Registration Form", "CourseRegistration", "Registration", new { Area = "PGStudent", sid = Utility.Encrypt(Model.ApplicationForm.Person.Id.ToString()) }, new { @class = "btn btn-primary btn-lg ", target = "_blank", id = "alCourseRegistration" }) </div> <div class="form-group "> <div id="divProcessingAcceptanceInvoice" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> @*<br />*@ </div> <file_sep>@using Abundance_Nk.Model.Model @using Microsoft.AspNet.Identity @using Abundance_Nk.Web.Models <!doctype html> <html lang="en" class="no-js"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <meta name="theme-color" content="#3e454c"> <title>Virtual School UNIPORT</title> <!-- Font awesome --> <link rel="stylesheet" href="~/Content/font-awesome/css/font-awesome.min.css"> <!-- Sandstone Bootstrap CSS --> <link rel="stylesheet" href="~/Content/bootstrap.min.css"> <!-- Admin Stye --> <link rel="stylesheet" href="~/Content/StudentAreaStyle.css"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <style> .ts-sidebar a { font-size: 12px; font-family: 'Quicksand', sans-serif; } .sofia { font-family: 'Quicksand', sans-serif!important; } p, a,li, span, input, b { font-family: 'Quicksand', sans-serif !important; } table tr td { font-family: 'Quicksand', sans-serif !important; } div { font-family: 'Quicksand', sans-serif !important; } </style> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500&display=swap" rel="stylesheet"> </head> @{ Student student = null; if(User.Identity.Name != null && User.Identity.Name !="") { student = Utility.GetStudent(@User.Identity.Name); } else { Response.Redirect("/Security/Account/Login"); } } <body> @if(student != null) { <div class="brand clearfix"> NAU <a href="#" class="logo"><img src="~/Content/Images/school_logo.png" class="img-responsive" alt=""></a> <span class="menu-btn"><i class="fa fa-bars"></i></span> <ul class="ts-profile-nav"> @using(Html.BeginForm("LogOff","Account",new { Area = "Security" },FormMethod.Post,new { id = "logoutForm",@class = "navbar-right" })) { @Html.AntiForgeryToken() <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> <small></small> <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="javascript:document.getElementById('logoutForm').submit()">Logout</a></li> </ul> </li> } </ul> </div> <div class="ts-main-content"> <nav class="ts-sidebar"> <ul class="ts-sidebar-menu"> <div class="text-center ts-main"> @if (File.Exists("~/" + student.ImageFileUrl)) { <img src="~/Content/Images/@student.ImageFileUrl" /> } else { <img src="~/Content/Images/default_avatar.png" /> } </div> <li class="ts-label">@student.FullName</li> <li><a href="@Url.Action("ChangePassword","Home")"><i class="fa fa-dashboard"></i> Change Password</a></li> <li><a href="@Url.Action("CourseRegistration", "Home")"><i class="fa fa-paperclip"></i> Course Registration</a></li> <li><a href="@Url.Action("RegisteredCourse", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Content</a></li> <li><a href="@Url.Action("Assignment", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Assignment</a></li> <li><a href="@Url.Action("DownloadElearningGuide", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Manual </a></li> @*<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class=""><i class="fa fa-paperclip"></i>E-Learning</span></a> <ul class="dropdown-menu" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item"><a href="@Url.Action("RegisteredCourse", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Content</a></li> <li class="dropdown-item"><a href="@Url.Action("Assignment", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Assignment</a></li> <li class="dropdown-item"><a href="@Url.Action("DownloadElearningGuide", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning Manual </a></li> </ul> </li>*@ <li><a href="@Url.Action("index", "Home")"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li><a href="@Url.Action("HostelAllocationStatus", "Hostel")"><i class="fa fa-building"></i>Hostel Allocation Status</a></li> <!-- Account from above --> <li><a href="@Url.Action("Fees", "Home")"><i class="fa fa-money"></i> Invoices</a></li> <li><a href="@Url.Action("OtherFees","Home")"><i class="fa fa-money"></i>Other Fees</a></li> <li><a href="@Url.Action("PayFees","Home")"><i class="fa fa-money"></i> Pay Fees</a></li> <li><a href="@Url.Action("PaymentReceipt", "Home")"><i class="fa fa-barcode"></i> Print Other Receipt</a></li> <li><a href="@Url.Action("PayHostelFee", "Hostel")"><i class="fa fa-building"></i>Print Hostel Slip</a></li> <li><a href="@Url.Action("profile", "Home")"><i class="fa fa-user"></i> Profile</a></li> <li><a href="@Url.Action("PaymentHistory", "Home")"><i class="fa fa-barcode"></i> Receipts</a></li> <li><a href="@Url.Action("Result", "Home")"><i class="fa fa-dashboard"></i> Results</a></li> <li><a href="@Url.Action("CreateHostelRequest", "Hostel")"><i class="fa fa-building"></i>Request Hostel Allocation</a></li> <ul class="ts-profile-nav"> <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> Account <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="#">Logout</a></li> </ul> </li> </ul> </ul> </nav> <div class="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-12 "> @RenderBody() </div> </div> </div> </div> </div> } else { <div class="brand clearfix"> NAU <a href="#" class="logo"><img src="~/Content/Images/school_logo.png" class="img-responsive" alt=""></a> <span class="menu-btn"><i class="fa fa-bars"></i></span> <ul class="ts-profile-nav"> @using(Html.BeginForm("LogOff","Account",new { Area = "Security" },FormMethod.Post,new { id = "logoutForm",@class = "navbar-right" })) { <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> <small></small> <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="javascript:document.getElementById('logoutForm').submit()">Logout</a></li> </ul> </li> } </ul> </div> <div class="ts-main-content"> <div class="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-12 "> @RenderBody() </div> </div> </div> </div> </div> } <!-- Loading Scripts --> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/main.js"></script> @*@Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap")*@ @RenderSection("scripts",false) </body> </html><file_sep>@{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="row"> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Setup</h4> </div> <div class="panel-body"> <a href="@Url.Action("Index","Hostel",null)" class="btn btn-success">Hostels</a><br /><br /> <a href="@Url.Action("Index","HostelSeries",null)" class="btn btn-success">Hostel Series/Floor</a><br /><br /> <a href="@Url.Action("CreateHostelRooms","HostelAllocation",null)" class="btn btn-success">Create Hostel Rooms</a><br /><br /> <a href="@Url.Action("EditHostelRooms","HostelAllocation",null)" class="btn btn-success">Edit Hostel Rooms</a><br /><br /> <a href="@Url.Action("CreateHostelAllocationCriteria","HostelAllocation",null)" class="btn btn-success">Create Allocation Criteria</a><br /> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Model.Model.PaymentHistory @{ Layout = "~/Areas/Student/Views/Shared/_Layout.cshtml"; ViewBag.Title = "Index"; } @*<script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script>*@ @*<script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script>*@ <div class="row custom-text-black"> <div class="col-md-3"> <div class="logopanel"> <h1><span style="color: #35925B">All Payments</span></h1> </div> <div class="panel panel-default"> <div class="panel-body"> <ul class="leftmenu "> <li> <a href="#"><b>Instructions</b></a> </li> </ul> <ol> <li class="margin-bottom-7">The list of all payment made is displayed on the payment list</li> <li class="margin-bottom-7">To print payment receipt or invoice, click on item (first column) on payment list, a pop menu will appear with two links (invoice and receipt). Click on any one of your choice to print it</li> </ol> </div> </div> </div> <div class="col-md-9"> @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="shadow"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <div class="col-md-12" style="font-size: 15pt; text-transform: uppercase"> @Html.DisplayFor(model => model.Student.FullName) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-0"> <div class="col-md-4"> @Html.LabelFor(model => model.Student.MatricNumber,new { @class = "control-label " }) </div> <div class="col-md-8 "> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.DisplayFor(model => model.Student.MatricNumber) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> </div> <div class="col-md-6"> <div class="form-group margin-bottom-0"> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-body"> @if(Model != null && Model != null && Model.Payments != null && Model.Payments.Count > 0) { <div class="row"> <div class="col-md-12"> <b>Payments</b> <div class="pull-right record-count-label"> <span class="caption">No of Payment</span><span class="badge">@Model.Payments.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12 "> <table class="table grid-table table-condensed grid-wrap table-head-alt mb30"> <thead> <tr class="well grid-wrap" style="height: 35px; vertical-align: middle"> <th> Item </th> <th> Session </th> <th> Bank </th> <th> Invoice No </th> <th> Confirmation Order No </th> <th style="text-align: right"> Amount (₦) </th> </tr> </thead> @for(int i = 0;i < Model.Payments.Count;i++) { <tr> <td> <ul class="nav navbar-nav2 "> <li class="dropdown"> <a style="padding: 1px;" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">@Html.DisplayFor(modelItem => Model.Payments[i].FeeTypeName)</a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li class="divider"></li> @*<li>@Html.ActionLink("Reprint Invoice","Invoice","Credential",new { Area = "Common",pmid = Utility.Encrypt(Model.Payments[i].PaymentId.ToString()) },new { target = "_blank",style = "line-height:5px; font-size:10pt; margin-bottom:5px" })</li>*@ <li>@Html.ActionLink("Print Receipt", "Receipt", "Credential", new {Area = "Common", pmid = Model.Payments[i].PaymentId}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> </ul> </li> </ul> </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].SessionName) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].BankName) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].InvoiceNumber) </td> <td> @Html.DisplayFor(modelItem => Model.Payments[i].ConfirmationOrderNumber) </td> <td style="text-align: right"> @Html.DisplayFor(modelItem => Model.Payments[i].Amount) </td> </tr> } </table> @*</div>*@ </div> </div> <br /> } else { <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> } </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ ViewBag.Title = "EditAdmittedStudentDepartment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function() { $("#optionId").hide(); $("#AdmissionListDetail_Programme_Id").change(function () { $("#AdmissionListDetail_Deprtment_Id").empty(); var selectedProgramme = $("#AdmissionListDetail_Programme_Id").val(); var programme = $("#AdmissionListDetail_Programme_Id").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#AdmissionListDetail_Deprtment_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#AdmissionListDetail_Deprtment_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); $("#AdmissionListDetail_Deprtment_Id").change(function () { $("#AdmissionListDetail_DepartmentOption_Id").empty(); var selectedProgramme = $("#AdmissionListDetail_Programme_Id").val(); var selectedDepartment = $("#AdmissionListDetail_Deprtment_Id").val(); if (selectedProgramme != null && selectedDepartment != null) { $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptionByDepartment")', // we are calling json method dataType: 'json', data: { id: selectedDepartment, programmeid: selectedProgramme }, success: function (departmentOptions) { if (departmentOptions.length > 0) { $("#AdmissionListDetail_DepartmentOption_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departmentOptions, function (i, options) { $("#AdmissionListDetail_DepartmentOption_Id").append('<option value="' + options.Value + '">' + options.Text + '</option>'); }); } $("#optionId").show(); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); } }); }); </script> @using (Html.BeginForm("EditAdmittedStudentDepartment", "UploadAdmission", new {area = "Admin"}, FormMethod.Post)) { @Html.HiddenFor(model => model.AdmissionListDetail.Id) @Html.HiddenFor(model => model.AdmissionListDetail.Form.Id) <div class="col-md-12"> <div class="form-group" style="color: black"> <h4>Edit Admission Details</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Form.Person.FullName, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.AdmissionListDetail.Form.Person.FullName, new {@class = "form-control", @readonly = "readonly"}) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Form.Person.FullName, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Form.Number, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.AdmissionListDetail.Form.Number, new {@class = "form-control", @readonly = "readonly"}) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Form.Number, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Programme.Id,new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.AdmissionListDetail.Programme.Id,(IEnumerable<SelectListItem>)ViewBag.ProgrammeId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Programme.Id,null,new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Deprtment.Id, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.AdmissionListDetail.Deprtment.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Deprtment.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group" style="display:none" id="optionId"> @Html.LabelFor(model => model.AdmissionListDetail.DepartmentOption.Id, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.AdmissionListDetail.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AdmissionListDetail.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AdmissionListDetail.Activated, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.CheckBoxFor(model => model.AdmissionListDetail.Activated, new { @class = "" }) @Html.ValidationMessageFor(model => model.AdmissionListDetail.Activated, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> }<file_sep>@using GridMvc.Html @model IEnumerable<Abundance_Nk.Model.Model.BasicSetup> <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @if (@Model != null) { @Html.Partial("_IndexSetupHeader", @Model.Count()) } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-body"> @Html.Grid(Model).Columns(columns => { columns.Add() .Encoded(false) .Sanitized(false) .RenderValueAs(d => @<div style="width: 41px"> <a href="@Url.Action("Edit", new {id = d.Id})" title="Edit"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> @*<a href="@Url.Action("Details", new { id = d.Id })" title="Details"> <img src="@Url.Content("~/Content/Images/list_icon3.png")" alt="Details" /> </a>*@ <a href="@Url.Action("Delete", new {id = d.Id})" title="Delete"> <img src="@Url.Content("~/Content/Images/delete_icon.png")" alt="Delete" /> </a> </div>); columns.Add(f => f.Name).Titled("Name"); columns.Add(f => f.Description).Titled("Description").Sortable(true); }).WithPaging(15) </div> </div> <br /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptRequestViewModel @using Abundance_Nk.Business @{ ViewBag.Title = "Transcript Request"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(function () { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> @*@using (Html.BeginForm("ViewTranscriptRequest", "TranscriptProcessor", new { area = "admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="col-md-12" style="padding: 20px;"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.TranscriptStatus.TranscriptStatusId, "Status", new { @class = "control-label" }) @Html.DropDownListFor(model => model.TranscriptStatus.TranscriptStatusId, (IEnumerable<SelectListItem>)ViewBag.Transcript, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.TranscriptStatus.TranscriptStatusId, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <br /> <input type="submit" class="btn-primary" value="Submit" /> </div> </div> </div> }*@ <div class="col-sm-12" style="padding: 20px;"> <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">ALL PAID TRANSCRIPT REQUEST</h3> </div> @if (Model != null && Model.GroupTranscriptByYears.Count > 0) { @*<div class="table-responsive">*@ <h3>Yearly Count - @ViewBag.Title</h3> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th> SN </th> <th> Year </th> <th> Count </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.GroupTranscriptByYears.Count; i++) { int sn = i + 1; <tr> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Html.ActionLink(@Model.GroupTranscriptByYears[i].Year.ToString(), "TranscriptCountByMonth", new { year = @Model.GroupTranscriptByYears[i].Year, area = "admin", controller = "TranscriptProcessor" }) </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.GroupTranscriptByYears[i].TranscriptCount </td> </tr> } </tbody> </table> @*</div>*@ } @if (Model != null && Model.GroupTranscriptByMonths.Count > 0) { @*<div class="table-responsive">*@ <h3>@Model.GroupTranscriptByMonths.FirstOrDefault().Year - @ViewBag.Title - Count</h3> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> @*<th> Year </th>*@ <th> Month </th> <th> Count </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.GroupTranscriptByMonths.Count; i++) { int sn = i + 1; <tr> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> @*<td class="col-lg-2 col-md-2 col-sm-2"> @Model.GroupTranscriptByMonths[i].Year.ToString() </td>*@ <td class="col-lg-3 col-md-3 col-sm-3"> @Html.ActionLink(@Model.GroupTranscriptByMonths[i].Month, "TranscriptRequestByMonth", new { month = @Model.GroupTranscriptByMonths[i].intMonth, year = @Model.GroupTranscriptByMonths[i].Year, area = "admin", controller = "TranscriptProcessor" }) </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.GroupTranscriptByMonths[i].TranscriptCount </td> </tr> } </tbody> </table> @*</div>*@ } @if (Model != null && Model.TranscriptRequests.Count > 0) { @*<div class="table-responsive">*@ <h3>@Model.TranscriptRequests.FirstOrDefault().DateRequested.Year - @ViewBag.Title</h3> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> Student Name </th> <th> Matric Number </th> <th> Phone Number </th> <th> Email </th> <th> Destination Address </th> <th> State </th> <th> Country </th> <th> Date Requested </th> <th> Processing Fee </th> <th> Courier Service </th> <th> Status </th> <th> </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.TranscriptRequests.Count; i++) { int sn = i + 1; var pid = Model.TranscriptRequests[i].payment.Id; var status = Model.TranscriptRequests[i].transcriptStatus.TranscriptStatusId == 5 ? "Dispatched" : "Processing"; PaymentEtranzactLogic paymentEtranzactLogic = new PaymentEtranzactLogic(); PaymentInterswitchLogic paymentInterswitchLogic = new PaymentInterswitchLogic(); var paymentEtranzact = paymentEtranzactLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var paymentInterswitch = paymentInterswitchLogic.GetModelsBy(x => x.Payment_Id == pid).FirstOrDefault(); var amountPaid = paymentEtranzact != null ? paymentEtranzact.TransactionAmount : paymentInterswitch.Amount; var courierService = Model.TranscriptRequests[i].DeliveryServiceZone != null ? Model.TranscriptRequests[i].DeliveryServiceZone.DeliveryService.Name.ToUpper() : null; <tr> <td class="col-lg-1 col-md-1 col-sm-1"> @sn </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.Name </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.MatricNumber </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.MobilePhone </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.Email </td> @*<td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i]..department.Name </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].student.de.ProgrammeType.Name </td>*@ <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].DestinationAddress </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].DestinationState.Name </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].DestinationCountry.CountryName </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.TranscriptRequests[i].DateRequested </td> <td> ₦ @string.Format("{0:0,0.00}", amountPaid) </td> <td> @courierService </td> <td class="col-lg-3 col-md-3 col-sm-3"> @status </td> <td> <span class="glyphicon glyphicon-add" aria-hidden="true"></span> @Html.ActionLink("Dispatch", "DispatchTranscript", new { trId = @Model.TranscriptRequests[i].Id, area = "admin", controller = "TranscriptProcessor" }, new { @class = "btn btn-success", target = "_blank" }) </td> </tr> } </tbody> </table> @*</div>*@ } </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">O-Level Result</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6 custom-text-black"> <h5>First Sitting</h5> <hr class="no-top-padding" /> @if (Model.FirstSittingOLevelResult != null && !string.IsNullOrEmpty(Model.FirstSittingOLevelResult.ExamNumber) && Model.FirstSittingOLevelResult.ExamYear > 0) { @Html.HiddenFor(model => model.FirstSittingOLevelResult.ScannedCopyUrl) @Html.HiddenFor(model => model.FirstSittingOLevelResult.Id) <div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.FirstSittingOLevelResult.Type.Name, new {@class = "form-control"}) </div> </div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "form-control"}) </div> </div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.FirstSittingOLevelResult.ExamYear, new {@class = "form-control"}) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th class="custom-text-black"> Subject </th> <th class="custom-text-black"> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td class="custom-text-black"> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Id) @Html.DisplayFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name) </td> <td class="custom-text-black"> @Html.DisplayFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name) </td> </tr> } </table> } </div> <div class="col-md-6 custom-text-black"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> @if (Model.SecondSittingOLevelResult != null && !string.IsNullOrEmpty(Model.SecondSittingOLevelResult.ExamNumber) && Model.SecondSittingOLevelResult.ExamYear > 0) { @Html.HiddenFor(model => model.SecondSittingOLevelResult.Id) <div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.SecondSittingOLevelResult.Type.Name, new {@class = "form-control"}) </div> </div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "form-control"}) </div> </div> <div class="form-group margin-bottom-3"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3 custom-text-black"}) <div class="col-md-9 text-bold custom-text-black"> @Html.DisplayFor(model => model.SecondSittingOLevelResult.ExamYear, new {@class = "form-control"}) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th class="custom-text-black"> Subject </th> <th class="custom-text-black"> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td class="custom-text-black"> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Id) @Html.DisplayFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name) </td> <td class="custom-text-black"> @Html.DisplayFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name) </td> </tr> } </table> } </div> </div> </div> </div><file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Edit Relationship"; } @Html.Partial("Setup/_Edit", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "ViewStudentPayments"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-eye"></i>View Payments</h3> </div> <div class="panel-body"> @using (Html.BeginForm("ViewStudentPayments", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="col-md-2"> @Html.LabelFor(model => model.Student.MatricNumber,"Matric Number",new { @class = "control-label " }) </div> <div class="row col-md-8"> <div class="col-md-6"> <div class="form-group"> @Html.TextBoxFor(model => model.Student.MatricNumber,new { @class = "form-control",@placeholder = "Enter Matric Number",@required = "required" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber,"The Matric Number is required",new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-12"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> </div> } </div> </div> @if (Model.Payments == null) { return;} @if (Model.Payments != null && Model.Payments.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Name </th> <th> Payment Mode </th> <th> Fee Type </th> <th> Invoice Number </th> <th> Session </th> <th> Date </th> <th> Edit </th> </tr> @for (int i = 0; i < Model.Payments.Count(); i++) { <tr> <td> @Model.Payments[i].Person.FullName </td> <td> @Model.Payments[i].PaymentMode.Name </td> <td> @Model.Payments[i].FeeType.Name </td> <td> @Model.Payments[i].InvoiceNumber </td> <td> @Model.Payments[i].Session.Name </td> <td> @Model.Payments[i].DatePaid.ToLongDateString() </td> <td> @Html.ActionLink("Edit", "EditPayment", "Support", new { area = "Admin", pmid = Model.Payments[i].Id }, new { @class = "btn btn-success btn-md " }) </td> </tr> } </table> </div> </div> </div> </div> } </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.PaymentPaystackViewModel @{ ViewBag.Title = "Create PaystackCommission"; } <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @using (Html.BeginForm("CreatePaystackCommission","PaymentPaystack",new {area = "Admin"},FormMethod.Post)) { @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true) @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Programme.Id, "Programme", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownListFor(f => f.PaymentPaystackCommission.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Programme.Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.FeeType.Id, "Fee Type", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownListFor(f => f.PaymentPaystackCommission.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeType, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.FeeType.Name) </div> </div> @*<div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Fee.Id, "Fee", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(f => f.PaymentPaystackCommission.Fee.Id, (IEnumerable<SelectListItem>) ViewBag.Fee, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Fee.Id) </div> </div>*@ <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Amount, "Amount", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.TextBoxFor(f => f.PaymentPaystackCommission.Amount, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Amount) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.AddOnFee, "Add On", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.TextBoxFor(f => f.PaymentPaystackCommission.AddOnFee, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.AddOnFee) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Session.Id, "Session", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(f => f.PaymentPaystackCommission.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Session.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Activated, "Activated", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.CheckBoxFor(f => f.PaymentPaystackCommission.Activated) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Activated) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.PGStudent.ViewModels.PGCourseRegistrationViewModel <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <div class="row"> <div class="col-md-12"> <b>First Semester Courses</b> <div class="pull-right record-count-label"> <label class="caption">Sum of Selected Course Unit</label><span id="spFirstSemesterTotalCourseUnit" class="badge">@Model.SumOfFirstSemesterSelectedCourseUnit</span> <label class="caption">Min Unit</label><span id="spFirstSemesterMinimumUnit" class="badge">@Model.FirstSemesterMinimumUnit</span> <label class="caption">Max Unit</label><span id="spFirstSemesterMaximumUnit" class="badge">@Model.FirstSemesterMaximumUnit</span> <span class="caption">Total Course</span><span class="badge">@Model.FirstSemesterCourses.Count</span> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive " style="font-size: 9pt"> <table class="table table-condensed grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @*@Html.CheckBox("selectAllFirstSemester")*@ </th> <th> Course Code </th> <th> Course Title </th> <th> Course Unit </th> <th> Course Type </th> </tr> </thead> @for (int i = 0; i < Model.FirstSemesterCourses.Count; i++) { <tr> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.CheckBoxFor(model => Model.FirstSemesterCourses[i].Course.IsRegistered, new { @class = "ckb1", id = Model.FirstSemesterCourses[i].Course.Id }) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Code) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Code) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Id) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Name) </td> <td class="unit" style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Unit) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Unit) </td> <td style="margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle;"> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Course.Type.Id) @Html.DisplayFor(model => Model.FirstSemesterCourses[i].Course.Type.Name) </td> @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Semester.Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Mode.Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].Id) @Html.HiddenFor(model => Model.FirstSemesterCourses[i].CourseRegistration.Id) </tr> } </table> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.FeeDetailViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script type="text/javascript"> var jqXHRData; $(document).ready(function() { $("#Programme_Id").change(function() { $("#Department_Id").empty(); var selectedProgramme = $("#Programme_Id").val(); var programme = $("#Programme_Id").val(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); }); </script> <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true) @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control", @placeholder = "Select Session"}) @Html.ValidationMessageFor(model => model.CurrentSession.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.feeType.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.feeType.Id, (IEnumerable<SelectListItem>) ViewBag.FeeTypeId, new {@class = "form-control", @placeholder = "Select Fee Type"}) @Html.ValidationMessageFor(model => model.feeType.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.level.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.level.Id, (IEnumerable<SelectListItem>) ViewBag.LevelId, new {@class = "form-control", @placeholder = "Select Level"}) @Html.ValidationMessageFor(model => model.level.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.paymentMode.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.paymentMode.Id, (IEnumerable<SelectListItem>) ViewBag.PaymentModeId, new {@class = "form-control", @placeholder = "Select Payment Mode"}) @Html.ValidationMessageFor(model => model.paymentMode.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control", @placeholder = "Select Programme"}) @Html.ValidationMessageFor(model => model.Programme.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control", @placeholder = "Select Department"}) @Html.ValidationMessageFor(model => model.Department.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.fee.Id, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(model => model.fee.Id, (IEnumerable<SelectListItem>) ViewBag.feeId, new {@class = "form-control", @placeholder = "Select Fee"}) @Html.ValidationMessageFor(model => model.fee.Id) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Add" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index") </div> <hr /><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ Layout = null; ViewBag.Title = "::Form Preview::"; } <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="~/Content/putme/css/bootstrap.min.css"> <!-- Now-ui-kit CSS --> <link rel="stylesheet" href="~/Content/putme/css/now-ui-kit.css"> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!-- Include the above in your HEAD tag --> <title>UNIPORT post utme form</title> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#aPrint").click(function () { $("#aPrint").hide(); $("#printable").show(); window.print(); $("#aPrint").show(); }); }); </script> </head> <body> <div class="container-fluid"> <div class="container"> <div class="row pt-4"> <div class="col-md-12 pl-0 pr-0"> <div class="card printable"> <div class="container"> <div class="col-md-12 text-center pt-3"> <img src="~/Content/Images/school_logo.png" alt="schoollogo" /> <h4>UNIVERSITY OF PORT-HARCOURT</h4> <b>@Model.ApplicationFormSetting.Name</b> <b>PREVIEW PAGE</b> </div> <hr class="bg-warning"> <div class="row pr-4 pl-4 pb-4 pt-0"> @using (Html.BeginForm("PostJambPreview", "Form", FormMethod.Post, new { id = "frmPostJAMBPreview", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <div class="col-md-9"> @if (Model.ApplicationForm != null && Model.ApplicationForm.Id > 0) { @Html.HiddenFor(model => model.ApplicationForm.Id) @Html.HiddenFor(model => model.ApplicationForm.Number) @Html.HiddenFor(model => model.ApplicationForm.ExamNumber) @Html.HiddenFor(model => model.ApplicationForm.Rejected) @Html.HiddenFor(model => model.ApplicationForm.RejectReason) } @Html.HiddenFor(model => model.Session.Id) @Html.HiddenFor(model => model.Session.Name) @Html.HiddenFor(model => model.ApplicationFormSetting.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentMode.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PersonType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.Session.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamDate) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamVenue) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamTime) @Html.HiddenFor(model => model.ApplicationProgrammeFee.FeeType.Id) @Html.HiddenFor(model => model.ApplicationProgrammeFee.Id) @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Programme.Name) @Html.HiddenFor(model => model.Programme.ShortName) @Html.HiddenFor(model => model.AppliedCourse.Programme.Id) @Html.HiddenFor(model => model.AppliedCourse.Programme.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Id) @Html.HiddenFor(model => model.AppliedCourse.Department.Code) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.remitaPyament.payment.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.FullName) @Html.HiddenFor(model => model.ApplicationAlreadyExist) <div> <div class="col-md-12"> <div class="row"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Person.FullName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.FullName, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label ", }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, "Email:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Sex.Name, "Sex", new { @class = "control-label ", }) @Html.TextBoxFor(model => model.Person.Sex.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.DateOfBirth, "Date of Birth", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.DateOfBirth, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.State.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LocalGovernment.Name, "LGA of Origin", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.LocalGovernment.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.HomeTown, "HomeTown:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeTown, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.HomeAddress, "HomeAddress:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeAddress, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Religion.Name, "Religion:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.Religion.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Applicant.Ability.Name, "Disability:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Applicant.Ability.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.Relationship.Name, "Realtionship", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.Relationship.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.ContactAddress, "Contact Address", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.ContactAddress, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Sponsor.MobilePhone, "Phone Number", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.MobilePhone, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @*<div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Id, "Programme", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, "Department of Choice", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div>*@ <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-12 p-0"> <div class="row"> <div class="col-md-6"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.Type.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @for (int i = 0; i < Model.FirstSittingOLevelResultDetails.Count; i++) { if (Model.FirstSittingOLevelResultDetails[i].Subject != null) { <div class="col-md-12"> <div class="row"> <div class="col-md-8 form-group"> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id) @Html.TextBoxFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-4 form-group"> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id) @Html.TextBoxFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> </div> </div> } } </div> <!--col-md-6 end form 1--> <!-- beginning of form 2--> @if (Model.SecondSittingOLevelResultDetails != null && Model.SecondSittingOLevelResultDetails.Count > 0) { <div class="col-md-6"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.Type.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @for (int i = 0; i < Model.SecondSittingOLevelResultDetails.Count; i++) { if (Model.SecondSittingOLevelResultDetails[i].Subject != null) { <div class="col-md-12"> <div class="row"> <div class="col-md-8 form-group"> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id) @Html.TextBoxFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-4 form-group"> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id) @Html.TextBoxFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> </div> </div> } } </div> } </div> </div> @if (Model.ApplicationFormSetting.Id == 20 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 12 || Model.ApplicationFormSetting.Id == 14 || Model.ApplicationFormSetting.Id == 22) { <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.InstitutionChoice.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> } else if (Model.AppliedCourse.Programme.Id != 7 && Model.AppliedCourse.Programme.Id != 3) { <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambScore, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Name, "Choice of institution", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.InstitutionChoice.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Name, "ENGLISH", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.Subject1.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Name, "SUBJECT 2", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.Subject2.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Name, "SUBJECT 3", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.Subject3.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Name, "SUBJECT 4", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantJambDetail.Subject4.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> } <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Faculty.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Faculty.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 19 || Model.ApplicationFormSetting.Id == 20 || Model.ApplicationFormSetting.Id == 13 || Model.ApplicationFormSetting.Id == 14)) { @Html.HiddenFor(model => model.SupplementaryCourse.Department.Id) <div class="col-md-6 form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Name, "Supplementary Department", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Department.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @*<div class="col-md-6 form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Average_Score, "PUTME Average", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Average_Score, new { @class = "form-control", disabled = true, @style = "color: black" }) </div>*@ } @if (Model.Programme.Id == 1 && (Model.ApplicationFormSetting.Id == 10 || Model.ApplicationFormSetting.Id == 14 )) { <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Course, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.StartDate, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.StartDate, "{0:dd/MM/yyyy}", new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.EndDate, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.EndDate, "{0:dd/MM/yyyy}", new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.Qualification.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.ResultGrade.LevelOfPass, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id, "Duration", new { @class = "control-label " }) @Html.TextBoxFor(model => model.PreviousEducation.ITDuration.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> } </div> </div> </div> </div> <div class="col-md-3"> <div class="col-md-12 pt-1" style="height: 85%"> <img src="@Url.Content(Model.Person.ImageFileUrl)" class="mt-2" alt="photo"> </div> </div> <div class="clearfix"></div> <div class="col-md-12 pl-4 mt-2"> @Html.ActionLink("Back to Form", "PostJambForm", null, new { @class = "btn btn-primary" }) <button class="btn btn-warning" type="submit" name="submit" id="submit"><i class="fa fa-save mr5"></i> Submit</button> </div> } </div> </div> </div> </div> </div> </div> </div> </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.PostjambResultSupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div> <p class="text-center"><h3>CORRECT PUTME RESULT </h3></p> </div> @if (TempData["Message"] != null) { <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["Message"]</strong> </div> } @using (Html.BeginForm("Index", "PostJamb/Index", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h4>Enter Jamb Number or Exam Number</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.JambNumber, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.JambNumber, new {@class = "form-control", @placeholder = "Enter Invoice No"}) @Html.ValidationMessageFor(model => model.JambNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new {Area = ""}, null) </div> </div> </div> </div> </div> } @if (Model == null || Model.putmeResult == null) { return; } @using (Html.BeginForm("UpdateResult", "PostJamb", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.putmeResult.Id) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> </div> <div class="form-group"> <label class="col-sm-2 control-label">Edit Jamb Number</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.putmeResult.RegNo, new { @class = "form-control", @placeholder = "Enter Regno" }) @Html.ValidationMessageFor(model => model.putmeResult.RegNo) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Exam Number</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.putmeResult.ExamNo, new { @class = "form-control", @placeholder = "Enter Exam" }) @Html.ValidationMessageFor(model => model.putmeResult.ExamNo) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">FullName</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.putmeResult.FullName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.putmeResult.FullName) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">FullName</label> <div class="col-sm-10"> @Html.TextBoxFor(model => model.putmeResult.Total, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.putmeResult.Total) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> </div> </div> } </div> </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Configuration; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class ApplicantPhotoCard :Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public int Option { get { return Convert.ToInt32(rblSortOption.SelectedValue); } set { rblSortOption.SelectedValue = value.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { rblSortOption.SelectedIndex = 0; ddlDepartment.Visible = false; PopulateAllDropDown(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReportBy(Session session,Programme programme,Department department,SortOption sortOption) { try { List<PhotoCard> photoCards = null; var applicationformLogic = new ApplicationFormLogic(); photoCards = applicationformLogic.GetPostJAMBApplicationsBy(session,programme,department,sortOption); //if (programme.Id == -100) //{ // photoCards = applicationformLogic.GetPostJAMBApplications(session); //} //else //{ // photoCards = applicationformLogic.GetPostJAMBApplicationsBy(session, programme); //} string bind_dsPhotoCard = "dsPhotoCard"; string reportPath = @"Reports\PhotoCard.rdlc"; if(photoCards != null && photoCards.Count > 0) { string appRoot = ConfigurationManager.AppSettings["AppRoot"]; foreach(PhotoCard photocard in photoCards) { if(!string.IsNullOrWhiteSpace(photocard.PassportUrl)) { photocard.PassportUrl = appRoot + photocard.PassportUrl; } else { photocard.PassportUrl = appRoot + Utility.DEFAULT_AVATAR; } } } rv.Reset(); rv.LocalReport.DisplayName = "Applicant Photo Card"; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; if(photoCards != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPhotoCard.Trim(),photoCards)); rv.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if(Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch(Exception) { throw; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } SortOption sortOption = Option == 2 ? SortOption.ExamNo : Option == 3 ? SortOption.ApplicationNo : SortOption.Name; DisplayReportBy(SelectedSession,Programme,Department,sortOption); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { try { if(Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if(departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment,Utility.GetDepartmentByProgramme(programme),Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep>@model Abundance_Nk.Model.Entity.NEWS @{ ViewBag.Title = "Details"; } <h3>News Details</h3> <div> @*<h4>NEWS</h4>*@ <hr /> <dl class="dl-horizontal"> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Title) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Title) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Description) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Description) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Date) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Date) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Image_File_Url) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Image_File_Url) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Image_Title) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Image_Title) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Session_Term_Id) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Session_Term_Id) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Entered_By_Id) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Entered_By_Id) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Venue) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Venue) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Hour) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Hour) </dd> <dt class="space-bottom"> @Html.DisplayNameFor(model => model.Minute) </dt> <dd class="space-bottom"> @Html.DisplayFor(model => model.Minute) </dd> </dl> </div> <p> @Html.ActionLink("Edit", "Edit", new {id = Model.News_Id}) | @Html.ActionLink("Back to List", "Index") </p> <hr /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Name Correction"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Name Correction</div> </div> <div class="panel-body"> @using (Html.BeginForm("CorrectionAsync", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, "Matriculation Number", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control", @placeholder = "Enter Matric Number", @required = "required"}) @Html.ValidationMessageFor(model => model.Student.MatricNumber, "", new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> @if (Model.Student == null) { return; } @if (Model.Role.Name == "Faculty Officer") { if (Model.Student != null && Model.Student.LastName != null || Model.Student.FirstName != null || Model.Student.OtherName != null) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> </div> <div class="row"> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.LastName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Student.LastName, new { @class = "form-control",@disabled=true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.FirstName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.FirstName, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.OtherName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.OtherName, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Email, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.Email, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MobilePhone, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MobilePhone, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> } } else { if (Model.Student != null && Model.Student.LastName != null || Model.Student.FirstName != null || Model.Student.OtherName != null) { Html.HiddenFor(model => model.Level.Id); using (Html.BeginForm("SaveName", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> </div> @Html.HiddenFor(model => model.ApplicantJambDetail.Person.Id) <div class="row"> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.LastName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Student.LastName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.LastName, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.FirstName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.FirstName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.FirstName, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.OtherName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.OtherName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.OtherName, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Name, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Email, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.Email, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MobilePhone, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.MobilePhone, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Department.Name, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, new { @class = "control-label" }) @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Level.Name, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10 "> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-primary btn-lg mr5" type="submit" value="Update" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <div class="col-md-1"></div> </div> } } } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "CreateHostelAllocationCriteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#Hostel").change(function () { $("#Series").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetHostelSeries", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Hostel").val() }, // Get Selected Campus ID. success: function (series) { $("#Series").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(series, function (i, series) { $("#Series").append('<option value="' + series.Value + '">' + series.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve series.' + ex); } }); return false; }); $("#Series").change(function() { $("#Corner").empty(); if ($("#Hostel").val() != "0" && $("#Series").val() != "0") { $.ajax({ type: 'POST', url: '@Url.Action("GetCorners", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Series").val() }, success: function(corners) { //$("#Corner").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(corners, function(i, corners) { $("#Corner").append('<option value="' + corners.Text + '">' + corners.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve corners.'); } }); } else { } return false; }); }) </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Allocation Criteria</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("CreateHostelAllocationCriteria", "HostelAllocation", FormMethod.Post)) { <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocationCriteria.Level.Name, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocationCriteria.Level.Id, (IEnumerable<SelectListItem>)ViewBag.LevelId, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocationCriteria.Hostel.Name, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocationCriteria.Hostel.Id, (IEnumerable<SelectListItem>)ViewBag.HostelId, new { @class = "form-control", @id = "Hostel", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Hostel.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocationCriteria.Series.Name, "Series/Floor",new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocationCriteria.Series.Id, (IEnumerable<SelectListItem>)ViewBag.HostelSeriesId, new { @class = "form-control", @id = "Series", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Series.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocationCriteria.Corner.Name, "Bed Space",new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.SelectedCorners, (MultiSelectList)ViewBag.CornerId, new { @class = "form-control", @multiple = "multiple", @id = "Corner", @required = "required" }) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Corner.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Create Criteria" /> </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AdmittedStudentBreakdown : System.Web.UI.Page { public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { PopulateAllDropDown(); } } catch (Exception) { throw; } } private void PopulateAllDropDown() { try { List<Session> session = Utility.GetAllSessions(); Utility.BindDropdownItem(ddlSession, session, Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReportBy(Session session) { try { AdmissionListLogic admissionListLogic = new AdmissionListLogic(); var admittedBreakDowns = new List<AdmittedStudentBreakdownView>(); admittedBreakDowns = admissionListLogic.GetAdmittedBreakDownBy(session); string reportPath = @"Reports\AdmittedStudentBreakdown.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Admitted Student Breakdown"; rv.LocalReport.ReportPath = reportPath; if (admittedBreakDowns != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource("DataSet", admittedBreakDowns)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReportBy(SelectedSession); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } return false; } catch (Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel <div class="panel-body"> @if (Model.Payments != null && Model.Payments.Count > 0) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Payment </th> <th> Session </th> <th> Invoice </th> </tr> @for (int i = 0; i < Model.Payments.Count; i++) { <tr> <td> @Model.Payments[i].FeeType.Name </td> <td> @Model.Payments[i].Session.Name </td> <td> @Model.Payments[i].InvoiceNumber </td> </tr> } </table> } </div><file_sep>@model Abundance_Nk.Model.Entity.HOSTEL_SERIES @{ ViewBag.Title = "Details"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Series Details</h4> </div> <div class="panel-body"> <div class="col-md-12"> <div> <h5>HOSTEL SERIES</h5> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Series Name") </dt> <dd> @Html.DisplayFor(model => model.Series_Name) </dd> <br/> <dt> @Html.DisplayNameFor(model => model.Activated) </dt> <dd> @Html.DisplayFor(model => model.Activated) </dd> <br /> <dt> @Html.DisplayName("Hostel") </dt> <dd> @Html.DisplayFor(model => model.HOSTEL.Hostel_Name) </dd> </dl> </div> <p> @Html.ActionLink("Edit", "Edit", new {id = Model.Series_Id}, new {@class = "btn btn-success"}) | @Html.ActionLink("Back to List", "Index", "", new {@class = "btn btn-success"}) </p> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.CourseViewModel @{ ViewBag.Title = "Upload Courses By Excel Sheet"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <div class="row"> <div class="col-xs-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> @using (Html.BeginForm("UploadCoursesByExcelSheet", "Courses", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default" style="background:#fff;"> <div class="panel-body"> <div class="col-md-12"> <div class="form-group"> <h5 class="text-center" style="padding: 10px 5px;background:whitesmoke;border-radius: 20% !important;"> UPLOAD COURSE BY EXCEL SHEET </h5> </div> </div> <div class="row" style="padding:10px 15px;"> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.programme.Id, "Select Programme", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeSL, new { @class = "form-control", id = "programme-list", required = true }) @Html.ValidationMessageFor(model => model.programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Id, "Select Department", new { @class = "control-label custom-text-black" }) <select name="Department.Id" id="department-list" class="form-control" disabled></select> @Html.ValidationMessageFor(model => model.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.level.Id, "Select Level", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.level.Id, (IEnumerable<SelectListItem>)ViewBag.LevelSL, new { @class = "form-control", id = "level-list", required = true }) @Html.ValidationMessageFor(model => model.level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group"> @Html.LabelFor(model => model.CourseType.Id, "Select Course Type", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CourseType.Id, (IEnumerable<SelectListItem>)ViewBag.CourseTypeSL, new { @class = "form-control", id = "course-type-list", required = true }) @Html.ValidationMessageFor(model => model.CourseType.Id, null, new { @class = "text-danger" }) </div> </div> <div class="col-xs-12 col-sm-6"> <div class="form-group" style="padding-top:5px;"> <input type="file" name="CourseExcelFile" id="course-excel-file" accept=".xlsb,.xls,.xlsx,.xlsm" required /> </div> </div> <div class="col-xs-12 col-sm-6" style="padding-top: 20px"> <input class="btn btn-success btn-block" disabled type="submit" name="submit" id="submit-btn" value="Submit" /> </div> </div> </div> </div> } <div class="panel panel-default" id="preview-excelsheet" style="display:none;"> <div class="col-md-12"> <div class="form-group"> <h5 class="text-center" id="excel-sheet-header-name" style="padding: 10px 5px;background:whitesmoke;border-radius: 20% !important;"> </h5> </div> </div> <div class="panel-body"> <div id="dvExcel"></div> </div> </div> </div> </div> <script src="~/Content/js/xlsx.js"></script> <script type="text/javascript"> const ProcessExcel = (data, fileName) => { //Read the Excel File data. let workbook = XLSX.read(data, { type: 'binary' }); //Fetch the name of First Sheet. let firstSheet = workbook.SheetNames[0]; //Read all rows from First Sheet into an JSON array. let excelRows = XLSX.utils.sheet_to_json(workbook.Sheets[firstSheet]); let containerDiv = document.getElementById("preview-excelsheet"); containerDiv.style.display = "none"; console.log(fileName); document.getElementById("excel-sheet-header-name").innerHTML = `PREVIEW OF ${fileName?.toUpperCase()}`; //Create a HTML Table element. let table = document.createElement("table"); table.setAttribute("class", "table table-striped"); table.setAttribute("style", "width: 100%;"); table.border = "1"; //Add the header row. let row = table.insertRow(-1); const rows = excelRows[0]; //Add the header cells. for (const key of Object.keys(rows)) { let headerCell = document.createElement("TH"); headerCell.innerHTML = key; row.appendChild(headerCell); } for (let i = 0; i < excelRows.length; i++) { //Add the data row. let row = table.insertRow(-1); for (let [key, value] of Object.entries(excelRows[i])) { //Add the data cells. let cell = row.insertCell(-1); cell.innerHTML = value; } containerDiv.style.display = "block"; } let dvExcel = document.getElementById("dvExcel"); dvExcel.innerHTML = ""; dvExcel.appendChild(table); }; document.querySelector("#course-excel-file").addEventListener("change", (e) => { let fileUpload = e.target.files[0]; console.log({ fileUpload }); //Validate whether File is valid Excel file. let regex = /^([a-zA-Z0-9\s_\\.\-:])+(.xls|.xlsx)$/; if (regex.test(fileUpload.name?.toLowerCase())) { if (typeof (FileReader) != "undefined") { let reader = new FileReader(); //For Browsers other than IE. if (reader.readAsBinaryString) { reader.onload = (e) => { ProcessExcel(e.target.result, fileUpload.name); }; reader.readAsBinaryString(fileUpload); } else { //For IE Browser. reader.onload = (e) => { let data = ""; let bytes = new Uint8Array(e.target.result); for (let i = 0; i < bytes.byteLength; i++) { data += String.fromCharCode(bytes[i]); } ProcessExcel(data, fileUpload.name); }; reader.readAsArrayBuffer(fileUpload); } } else { alert("This browser does not support HTML5."); } } else { alert("Please upload a valid Excel file."); } }); $("#programme-list, #department-list, #level-list, #course-type-list, #course-excel-file").on("change", (e) => { e.preventDefault(); const programmeValue = $("#programme-list").val(); const departmentValue = $("#department-list").val(); const levelValue = $("#level-list").val(); const courseTypeValue = $("#course-type-list").val(); const submitBtn = $("#submit-btn"); const fileBtn = $("#course-excel-file"); submitBtn.attr("disabled", true); if ((programmeValue && programmeValue > 0) && (departmentValue && departmentValue > 0) && (levelValue && levelValue > 0) && (courseTypeValue && courseTypeValue > 0) && fileBtn[0].files.length > 0) { submitBtn.removeAttr("disabled"); } }); $("#programme-list").on("change", (e) => { const programmeId = e.target.value; if (programmeId) { $.ajax({ url: "@Url.Action("SetDepartmentList", "PostGraduateForm", new { Area = "PGApplicant" })", data: { programmeId }, type: "POST", success: (data) => { const departmentSelectList = $("#department-list"); departmentSelectList.empty(); departmentSelectList.attr("disabled", true); if (data.DepartmentSL.length > 0) { departmentSelectList.removeAttr("disabled"); $.each(data.DepartmentSL, function (i, department) { departmentSelectList.append(`<option value="${department.Value}">${department.Text}</option>`); }); } }, error: (error) => { console.log(error); } }); } }); </script><file_sep>@model Abundance_Nk.Model.Entity.HOSTEL_SERIES @{ ViewBag.Title = "Edit"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Edit Hostel Series</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h5>HOSTEL SERIES</h5> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Series_Id) <div class="form-group"> @Html.LabelFor(model => model.Series_Name, "Series name", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Series_Name) @Html.ValidationMessageFor(model => model.Series_Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Hostel_Id, "Hostel", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownList("Hostel_Id", String.Empty) @Html.ValidationMessageFor(model => model.Hostel_Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Activated, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.EditorFor(model => model.Activated) @Html.ValidationMessageFor(model => model.Activated) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index", "", new {@class = "btn btn-success"}) </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "MakeManualPayment"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*<script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script>*@ <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> var approvalCode; var ivn; var amount; $(document).ready(function () { $("#myTable").DataTable(); $('#approveBtn').on('click', function () { $('#approveBtn').off('click'); var loading = "Loading...." $('#approveBtn').text(loading); approvalCode = $('#approveVal').val(); amount = $('#amount').val(); if (approvalCode == null || approvalCode == '') { alert("Please, provide your Authorization Code") return; } if (amount <= 0) { alert("No Amount is Attached to this invoice") return; } ivn = $('#ivn').val(); manualAutomation(); @*$.ajax({ type: 'POST', url: '@Url.Action("ApproveManualPayment", "Support")', // Calling json method dataType: 'json', data: { code: approvalCode, ivn: ivn, amount: amount }, success: function (result) { if (!result.IsError) { alert(result.Message); var url2 = '@Url.Action("MakeManualPayment", "Support")'; window.location.href = url2; //$('#ivn').val(''); //$('#invoiceDetail').hide(); } else { alert(result.Message); } }, error: function (ex) { alert('Failed to retrieve approval.' + result.Message); } });*@ }) $('#approveBtn2').on('click', function () { $('#approveBtn2').off('click'); var loading="Loading...." $('#approveBtn2').text(loading); approvalCode = $('#approveVal2').val(); amount = $('#amount2').val(); if (approvalCode == null || approvalCode == '') { alert("Please, provide your Authorization Code") return; } if (amount <= 0) { alert("No Amount is Attached to this invoice") return; } ivn = $('#ivn').val(); manualAutomation(); }) }) function manualAutomation() { $.ajax({ type: 'POST', url: '@Url.Action("ApproveManualPayment", "Support")', // Calling json method dataType: 'json', data: { code: approvalCode, ivn: ivn, amount: amount }, success: function (result) { if (!result.IsError) { alert(result.Message); var url2 = '@Url.Action("MakeManualPayment", "Support")'; window.location.href = url2; //$('#ivn').val(''); //$('#invoiceDetail').hide(); } else { alert(result.Message); var url = '@Url.Action("MakeManualPayment", "Support")'; window.location.href = url; } }, error: function (ex) { alert('Failed to retrieve approval.' + result.Message); } }); }; $(function () { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <br /> <br /> <br /> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="panel panel-default"> <div class="panel-heading"> <h2 style="font-size: large">Manual Payment</h2> </div> <div class="row panel-body"> <div class="col-md-10"> @using (Html.BeginForm("MakeManualPayment", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.InvoiceNumber, "Generated Invoice Number", new { @class = "control-label col-md-2" }) <div class="col-md-6"> @Html.TextBoxFor(model => model.InvoiceNumber, new { @class = "form-control", @required = "required", @id="ivn" }) @Html.ValidationMessageFor(model => model.InvoiceNumber, "", new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } </div> <div class="col-md-2"> @using (Html.BeginForm("ViewManualPayment", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-primary btn-sm mr5" type="submit" name="submit" id="submit" value="View Approved Payment" /> </div> </div> </div> } </div> </div> @if (Model.Student.FirstName == null && Model.ManualPayments.Count<=0 && Model.AdmissionList==null) { return; } @if (Model.Student != null && Model.Student.FirstName!=null) { <div class="panel panel-default" id="invoiceDetail"> <div class="panel-body"> <div class="col-md-12"> <div class="col-md-12 text-center"> <h3>Invoice Detail</h3> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.InvoiceNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Payment.InvoiceNumber, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentPayment.Amount, new { @class = "control-label" }) @Html.TextBoxFor(model => model.StudentPayment.Amount, new { @class = "form-control", @disabled = true , id="amount"}) </div> </div> </div> <div class="row"> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.LastName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Student.LastName, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.FirstName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.FirstName, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.OtherName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.OtherName, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.StudentLevel.Programme.Name, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Email, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.Email, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MobilePhone, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MobilePhone, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.StudentLevel.Department.Name, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentPayment.Level.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.StudentPayment.Level.Name, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-12 "> <div class="form-group"> <div class="col-md-6"> <button class="btn btn-primary btn-lg mr5" id="approveBtn">Approve</button> </div> <div class="col-md-6"> <div class="row"> <label class="col-md-6">Authorization Code</label> <input class="col-md-6" type="password" id="approveVal" /> </div> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <div class="col-md-1"></div> </div> } else if (Model.AdmissionList!=null && Model.ApplicationForm!=null) { <div class="panel panel-default" id="invoiceDetail2"> <div class="panel-body"> <div class="col-md-12"> <div class="col-md-12 text-center"> <h3>Invoice Detail</h3> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.InvoiceNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Payment.InvoiceNumber, new { @class = "form-control", @disabled = true}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Payment.Amount, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Payment.Amount, new { @class = "form-control", @disabled = true, id = "amount2" }) </div> </div> </div> <div class="row"> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Person.LastName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicationForm.Person.LastName, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Person.FirstName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicationForm.Person.FirstName, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Person.OtherName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicationForm.Person.OtherName, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AdmissionList.Programme.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AdmissionList.Programme.Name, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Email, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.Email, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MobilePhone, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Student.MobilePhone, new { @class = "form-control", @disabled = true }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AdmissionList.Deprtment.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AdmissionList.Deprtment.Name, new { @class = "form-control", @disabled = true }) </div> </div> <div class="col-md-6"> @*<div class="form-group"> @Html.LabelFor(model => model.StudentPayment.Level.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.StudentPayment.Level.Name, new { @class = "form-control", @disabled = true }) </div>*@ </div> </div> </div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-12 "> <div class="form-group"> <div class="col-md-6"> <button class="btn btn-primary btn-lg mr5" id="approveBtn2">Approve</button> </div> <div class="col-md-6"> <div class="row"> <label class="col-md-6">Authorization Code</label> <input class="col-md-6" type="password" id="approveVal2" /> </div> </div> </div> </div> <div class="col-md-1"></div> </div> </div> <div class="col-md-1"></div> </div> } @if (Model.ManualPayments.Count > 0 && Model.ManualPayments != null) { <div class="panel-body"> <div class="col-md-12"> <h3 class="text-center">All Manual Approved Payment</h3> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th>S/N</th> <th>FULL NAME</th> <th>FEE-TYPE</th> <th>SESSION</th> <th>INVOICE NO.</th> <th>AMOUNT</th> <th>APPROVER</th> </tr> </thead> <tbody> @for (int i = 0; i < @Model.ManualPayments.Count; i++) { int sn = i + 1; <tr> <td>@sn</td> <td>@Model.ManualPayments[i].Person.FullName.ToUpper()</td> <td>@Model.ManualPayments[i].FeeType.Name.ToUpper()</td> <td>@Model.ManualPayments[i].Session.Name.ToUpper()</td> <td>@Model.ManualPayments[i].InvoiceNumber.ToUpper()</td> <td>₦@string.Format("{0:0,0.00}",Model.ManualPayments[i].Amount)</td> <td>@Model.ManualPayments[i].User.Username.ToUpper()</td> </tr> } </tbody> @*<tfoot> <tr> <th>S/N</th> <th>FULL NAME</th> <th>MATRIC NO.</th> <th>ACTION</th> </tr> </tfoot>*@ </table> <br /> </div> </div> } </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Model.Model.RemitaPayment @{ ViewBag.Title = "Update RRR"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Update RRR</h2> @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.payment.InvoiceNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.payment.InvoiceNumber, new {@class = "form-control", @placeholder = "Enter Invoice Number / RRR"}) @Html.ValidationMessageFor(model => model.payment.InvoiceNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Search" class="btn btn-default" /> </div> </div> } @if (Model != null) { <div class="form-horizontal"> <hr /> @using (Html.BeginForm("SaveRRR", "RemitaReport/SaveRRR", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.payment.Id) <div class="form-group"> @Html.LabelFor(model => model.payment.Person.FullName, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.payment.Person.FullName, new {@class = "form-control"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.payment.InvoiceNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.payment.InvoiceNumber, new {@class = "form-control"}) </div> </div> <div class="form-group"> @Html.Label("Fee", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DisplayFor(model => model.payment.FeeType.Name, new {@class = "form-control"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.RRR, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.RRR, new {@class = "form-control"}) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Update" class="btn btn-default" /> </div> </div> } </div> }<file_sep>@model Abundance_Nk.Model.Model.Fee @{ ViewBag.Title = "Create Fee"; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function() { // will trigger when the document is ready $('.datepicker').datepicker ({ format: 'dd/mm/yyyy', autoclose: true, }); //Initialise any date pickers }); </script> } <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @Html.Partial("_IndexSetupHeader", -1) @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true) @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="form-group"> @Html.LabelFor(model => model.Name, "Fee Type", new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.DropDownListFor(f => f.Name, (IEnumerable<SelectListItem>) ViewBag.TypeId, "-- Select --", new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Name) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Amount, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.Amount, new {@class = "form-control", @placeholder = "Enter Amount"}) @Html.ValidationMessageFor(model => model.Amount) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> } <div> @Html.ActionLink("Back to List", "Index") </div> <hr /> @*<div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date datepicker'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> </div>*@ @*<div class='input-group date datepicker col-md-5'> @Html.TextBoxFor(model => model.DateEntered, "{0:dd/mm/yyyy}", new { @class = "form-control ", placeholder = "Specify Date" }) <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> @Html.ValidationMessageFor(model => model.DateEntered)*@<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Unlock Student Data"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Unlock Student Data</div> </div> <div class="panel-body"> @using (Html.BeginForm("UnlockStudentData", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.studentModel.MatricNumber, "Matriculation Number", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.studentModel.MatricNumber, new {@class = "form-control", @placeholder = "Enter Matric Number", @required = "required"}) @Html.ValidationMessageFor(model => model.studentModel.MatricNumber, "", new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> @if (Model.studentModel == null) { return; } @if (Model.studentModel != null && Model.studentModel.LastName != null || Model.studentModel.FirstName != null || Model.studentModel.OtherName != null) { using (Html.BeginForm("SaveUnlockedData", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.studentModel.LastName, "Last Name", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.studentModel.LastName, new {@class = "form-control", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.studentModel.FirstName, "First Name", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.studentModel.FirstName, new {@class = "form-control", @disabled = "disabled"}) </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.studentModel.OtherName, "Other Name", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.studentModel.OtherName, new {@class = "form-control", @disabled = "disabled"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.studentModel.Category.Id, "Student Category", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.studentModel.Category.Id, (IEnumerable<SelectListItem>) ViewBag.Category, new {@class = "form-control", @required = "required"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" class="btn btn-success mr5" /> </div> </div> </div> } } </div> </div><file_sep>@model IEnumerable<Abundance_Nk.Model.Entity.HOSTEL> @{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostels</h4> </div> <div class="panel-body"> <div class="col-md-12"> <p> @Html.ActionLink("Create New Hostel", "Create", new{controller = "Hostel", area = "Admin"}, new{@class = "btn btn-success"}) </p> <table class="table table-bordered table-hover table-striped"> <tr> <th> @Html.DisplayName("Hostel Name") </th> <th> @Html.DisplayName("Hostel Capacity") </th> <th> @Html.DisplayName("Hostel Description") </th> <th> @Html.DisplayName("Date Added") </th> <th> @Html.DisplayName("Activated") </th> <th> @Html.DisplayName("Hostel Type") </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Hostel_Name) </td> <td> @Html.DisplayFor(modelItem => item.Capacity) </td> <td> @Html.DisplayFor(modelItem => item.Description) </td> <td> @Html.DisplayFor(modelItem => item.Date_Entered) </td> <td> @Html.DisplayFor(modelItem => item.Activated) </td> <td> @Html.DisplayFor(modelItem => item.HOSTEL_TYPE.Hostel_Type_Name) </td> <td> @Html.ActionLink("Edit", "Edit", new { id = item.Hostel_Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("Details", "Details", new { id = item.Hostel_Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("Delete", "Delete", new { id = item.Hostel_Id }, new { @class = "btn btn-success" }) </td> </tr> } </table> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Upload Hostel Allocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet"/> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet"/> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> @*<script src="~/Scripts/dataTables.js"></script> <link href="~/Content/dataTables.css" rel="stylesheet"/>*@ <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function() { $.extend($.fn.dataTable.defaults, { responsive: true }); $('.dataTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } },, 'colvis' ] }); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Allocation</h4> </div> <div class="panel-body"> @using (Html.BeginForm("UploadHostelAllocation", "HostelAllocation", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="form-group"> @Html.LabelFor(m => m.Session.Name, "Session:", new {@class = "col-md-2 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(m => m.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(m => m.Session.Id, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-9"> <input type="file" title="Upload Result" id="file" name="file" class="form-control" /> </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <br/> <div class="panel-body"> @if (Model.HostelAllocations != null && Model.HostelAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-body table-responsive"> <table class="table-bordered table-hover table-striped table-responsive table dataTable"> <thead> <tr> <th> SN </th> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Name </th> <th> Matric Number </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.HostelAllocations.Count; i++) { var sn = i + 1; <tr> <td>@sn</td> <td> @Model.HostelAllocations[i].HostelName </td> <td> @Model.HostelAllocations[i].SeriesName </td> <td> @Model.HostelAllocations[i].RoomName </td> <td> @Model.HostelAllocations[i].FullName </td> <td> @Model.HostelAllocations[i].Student.MatricNumber </td> </tr> } </tbody> </table> <div class="row"> @Html.ActionLink("Save", "SaveHostelAllocation", new {controller = "HostelAllocation", area = "Admin"}, new { @class = "btn btn-success"}) </div> </div> </div> } </div> @if (Model.SuccessfulAllocations != null && Model.SuccessfulAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-heading">Successful Allocations</div> <div class="panel-body table-responsive"> <table class="table-bordered table-hover table-striped table-responsive table dataTable" > <thead> <tr> <th> SN </th> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Name </th> <th> Matric Number </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.SuccessfulAllocations.Count; i++) { var sn = i + 1; <tr> <td>@sn</td> <td> @Model.SuccessfulAllocations[i].HostelName </td> <td> @Model.SuccessfulAllocations[i].SeriesName </td> <td> @Model.SuccessfulAllocations[i].RoomName </td> <td> @Model.SuccessfulAllocations[i].FullName </td> <td> @Model.SuccessfulAllocations[i].Student.MatricNumber </td> </tr> } </tbody> </table> </div> </div> } @if (Model.FailedAllocations != null && Model.FailedAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-heading">Failed Allocations</div> <div class="panel-body table-responsive"> <table class="table-bordered table-hover table-striped table-responsive table dataTable"> <thead> <tr> <th> SN </th> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Name </th> <th> Matric Number </th> <th> Reason </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.FailedAllocations.Count; i++) { var sn = i + 1; <tr> <td>@sn</td> <td> @Model.FailedAllocations[i].HostelName </td> <td> @Model.FailedAllocations[i].SeriesName </td> <td> @Model.FailedAllocations[i].RoomName </td> <td> @Model.FailedAllocations[i].FullName </td> <td> @Model.FailedAllocations[i].Student.MatricNumber </td> <td> @Model.FailedAllocations[i].Reason </td> </tr> } </tbody> </table> </div> </div> } </div> </div> <div class="col-md-1"></div> </div> <file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class NotificationOfResult :Page { private string strDepartmentId = ""; private string strLevelId = ""; private string strPersonId = ""; private string strProgrammeId = ""; private string strSemesterid = ""; private string strSessionId = ""; protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!Page.IsPostBack) { strPersonId = Request.QueryString["personId"]; strSemesterid = Request.QueryString["semesterId"]; strSessionId = Request.QueryString["sessionId"]; strProgrammeId = Request.QueryString["programmeId"]; strDepartmentId = Request.QueryString["departmentId"]; strLevelId = Request.QueryString["levelId"]; if(!string.IsNullOrEmpty(strPersonId)) { long personId = Convert.ToInt64(strPersonId); int semesterId = Convert.ToInt32(strSemesterid); int sessionId = Convert.ToInt32(strSessionId); int programmeId = Convert.ToInt32(strProgrammeId); int departmentId = Convert.ToInt32(strDepartmentId); int levelId = Convert.ToInt32(strLevelId); var student = new Student { Id = personId }; var semester = new Semester { Id = semesterId }; var session = new Session { Id = sessionId }; var programme = new Programme { Id = programmeId }; var department = new Department { Id = departmentId }; var level = new Level { Id = levelId }; DisplayReportBy(session,semester,student,department,level,programme); } } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void DisplayReportBy(Session session,Semester semester,Student student,Department department, Level level,Programme programme) { try { List<Model.Model.Result> resultList = null; var studentResultLogic = new StudentResultLogic(); if(semester.Id == 1) { List<Model.Model.Result> result = null; result = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student, semester,programme); decimal? firstSemesterGPCUSum = result.Sum(p => p.GPCU); int? firstSemesterTotalSemesterCourseUnit = 0; var studentResultFirstSemester = new Model.Model.Result(); studentResultFirstSemester = result.FirstOrDefault(); firstSemesterTotalSemesterCourseUnit = studentResultFirstSemester.TotalSemesterCourseUnit; decimal? firstSemesterGPA = firstSemesterGPCUSum / firstSemesterTotalSemesterCourseUnit; studentResultFirstSemester.GPA = firstSemesterGPA; studentResultFirstSemester.CGPA = firstSemesterGPA; studentResultFirstSemester.StudentTypeName = GetGraduatingDegree(studentResultFirstSemester.ProgrammeId); studentResultFirstSemester.GraduationStatus = GetGraduationStatus(studentResultFirstSemester.CGPA); resultList = new List<Model.Model.Result>(); resultList.Add(studentResultFirstSemester); } else { List<Model.Model.Result> result = null; var firstSemester = new Semester { Id = 1 }; result = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student, firstSemester,programme); decimal? firstSemesterGPCUSum = result.Sum(p => p.GPCU); int? firstSemesterTotalSemesterCourseUnit = 0; var studentResultFirstSemester = new Model.Model.Result(); studentResultFirstSemester = result.FirstOrDefault(); firstSemesterTotalSemesterCourseUnit = studentResultFirstSemester.TotalSemesterCourseUnit; decimal? firstSemesterGPA = firstSemesterGPCUSum / firstSemesterTotalSemesterCourseUnit; studentResultFirstSemester.GPA = firstSemesterGPA; var secondSemester = new Semester { Id = 2 }; var studentResultSecondSemester = new Model.Model.Result(); List<Model.Model.Result> secondSemesterResultList = studentResultLogic.GetStudentProcessedResultBy(session,level,department,student, secondSemester,programme); decimal? secondSemesterGPCUSum = secondSemesterResultList.Sum(p => p.GPCU); studentResultSecondSemester = secondSemesterResultList.FirstOrDefault(); studentResultSecondSemester.GPA = Decimal.Round( (decimal)(secondSemesterGPCUSum / studentResultSecondSemester.TotalSemesterCourseUnit),2); studentResultSecondSemester.CGPA = Decimal.Round( (decimal) ((firstSemesterGPCUSum + secondSemesterGPCUSum) / (studentResultSecondSemester.TotalSemesterCourseUnit + firstSemesterTotalSemesterCourseUnit)),2); studentResultSecondSemester.StudentTypeName = GetGraduatingDegree(studentResultSecondSemester.ProgrammeId); studentResultSecondSemester.GraduationStatus = GetGraduationStatus(studentResultSecondSemester.CGPA); resultList = new List<Model.Model.Result>(); resultList.Add(studentResultSecondSemester); } string bind_dsStudentPaymentSummary = "dsNotificationOfResult"; string reportPath = @"Reports\Result\NotificationOfResult.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Notification of Result "; ReportViewer1.LocalReport.ReportPath = reportPath; ReportViewer1.LocalReport.EnableExternalImages = true; if(resultList != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), resultList)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private string GetGraduationStatus(decimal? CGPA) { string title = null; try { if(CGPA >= 3.5M && CGPA <= 4.0M) { title = "DISTICTION"; } else if(CGPA >= 3.0M && CGPA <= 3.49M) { title = "UPPER CREDIT"; } else if(CGPA >= 2.5M && CGPA <= 2.99M) { title = "LOWER CREDIT"; } else if(CGPA >= 2.0M && CGPA <= 2.49M) { title = "PASS"; } else if(CGPA < 2.0M) { title = "POOR"; } } catch(Exception) { throw; } return title; } private string GetGraduatingDegree(int? progId) { try { if(progId == 1 || progId == 2) { return "NATIONAL DIPLOMA"; } return "HIGHER NATIONAL DIPLOMA"; } catch(Exception) { throw; } } private List<Model.Model.Result> GetResultList(Session session,Semester semester,Student student, Department department,Level level,Programme programme) { try { var filteredResult = new List<Model.Model.Result>(); var studentResultLogic = new StudentResultLogic(); List<string> resultList = studentResultLogic.GetProcessedResutBy(session,semester,level,department,programme) .Select(p => p.MatricNumber) .AsParallel() .Distinct() .ToList(); List<Model.Model.Result> result = studentResultLogic.GetProcessedResutBy(session,semester,level, department,programme); foreach(string item in resultList) { Model.Model.Result resultItem = result.Where(p => p.MatricNumber == item).FirstOrDefault(); filteredResult.Add(resultItem); } return filteredResult.OrderBy(p => p.Name).ToList(); } catch(Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.PaymentPaystackViewModel @{ ViewBag.Title = "Payment Paystack Commission"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-2.1.3.js"></script> <script type="text/javascript"> var ItemId = 0; var activate; $(document).ready(function () { $('#MyTable').dataTable(); $('#btnEditCommission').on('click', function () { var programmeId = $('#PaymentPaystackCommission_Programme_Id').val(); var feeTypeId = $('#PaymentPaystackCommission_FeeType_Id').val(); //var feeId = $('#PaymentPaystackCommission_Fee_Id').val(); var sessionId = $('#PaymentPaystackCommission_Session_Id').val(); var activated = false; if ($('#PaymentPaystackCommission_Activated').is(':checked')) { activated = true; } var amount = $('#PaymentPaystackCommission_Amount').val(); var addOn = $('#PaymentPaystackCommission_AddOnFee').val(); var id = ItemId; if (feeTypeId && sessionId && id > 0 && programmeId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("EditPaystackCommission","PaymentPaystack")', dataType: 'json', data: { Id: id, feeType: feeTypeId, addOn: addOn, session: sessionId, activated: activated, amount: amount, programmeId: programmeId }, beforeSend: function () { $(".Load").show(); }, complete: function () { $(".Load").hide(); }, success: function (result) { window.location.reload(); $('#createModal').modal('hide'); alert(result); }, error: function (ex) { alert('Save operation failed.' + ex); } }); } else { alert("Kindly Select All parameters to continue"); } }); }); function showCreateModal(editId, feeType, session, amount, addOn, programme, activated) { $('#createModal').modal('show'); ItemId = editId; activate = activated; $('#PaymentPaystackCommission_FeeType_Id').val(feeType); //$('#PaymentPaystackCommission_Fee_Id').val(fee); $('#PaymentPaystackCommission_Amount').val(amount); $('#PaymentPaystackCommission_Session_Id').val(session); $('#PaymentPaystackCommission_Programme_Id').val(programme); $('#PaymentPaystackCommission_AddOnFee').val(addOn); if (activate == 1) { $('#PaymentPaystackCommission_Activated').attr('checked', true); } else { $('#PaymentPaystackCommission_Activated').attr('checked', false); } } function deleteRecord(commissionId) { var agree = confirm("You Are About to Delete the record Permanently"); if (agree == true) { if (commissionId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("DeletePaystackCommission","PaymentPaystack")', dataType: 'json', data: { commissionId: commissionId}, beforeSend: function () { $(".Load").show(); }, complete: function () { $(".Load").hide(); }, success: function (result) { window.location.reload(); $('#createModal').modal('hide'); alert(result); }, error: function (ex) { alert('Delete operation failed.' + ex); } }); } } else { return false; } } </script> <div class="col-md-12"> <div class="panel panel-custom"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message) TempData["Message"]) } <div class="panel-body text-justify"> <h2 style="font-weight: 300; text-align: center">Paystack Payment Commission</h2> <hr/> <br/> @using (Html.BeginForm("CreatePaystackCommission", "PaymentPaystack", new {area = "Admin"}, FormMethod.Get)) { <div class="row" style="margin-bottom: 3px"> <div class="col-md-10"></div> <div class="col-md-2" style="padding-bottom: 3px"> <button class="btn btn-success mr5" type="submit" name="submit"><i class="fa fa-plus"> Create New </i></button> </div> </div> } <table class="table-responsive table-striped table-condensed" style="width: 100%" id="MyTable"> <thead> <tr> <th>SN</th> <th>Programme</th> <th>FeeType</th> <th>Commission</th> <th>Add On</th> <th>Session</th> <th>EnteredBy</th> <th>Activated</th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.PaymentPaystackCommissions.Count; i++) { var sN = i + 1; var id = Model.PaymentPaystackCommissions[i].Id; var addedBy = Model.PaymentPaystackCommissions[i].User != null ? Model.PaymentPaystackCommissions[i].User.Username : null; var active = @Model.PaymentPaystackCommissions[i].Activated == true ? 1 : 0; //var feeAmount = Model.PaymentPaystackCommissions[i].Fee.Name + "__" + Model.PaymentPaystackCommissions[i].Fee.Amount; <tr> <td>@sN</td> <td>@Model.PaymentPaystackCommissions[i].Programme.Name</td> <td>@Model.PaymentPaystackCommissions[i].FeeType.Name</td> <td>@Model.PaymentPaystackCommissions[i].Amount</td> <td>@Model.PaymentPaystackCommissions[i].AddOnFee</td> <td>@Model.PaymentPaystackCommissions[i].Session.Name</td> <td>@addedBy</td> <td>@Model.PaymentPaystackCommissions[i].Activated</td> <td><button type="button" class="btn btn-success" id="editBtn" onclick="showCreateModal(@id,@Model.PaymentPaystackCommissions[i].FeeType.Id,@Model.PaymentPaystackCommissions[i].Session.Id,@Model.PaymentPaystackCommissions[i].Amount,@Model.PaymentPaystackCommissions[i].AddOnFee,@Model.PaymentPaystackCommissions[i].Programme.Id,@active)">Edit</button></td> @*<td><button type="button" class="btn btn-success" id="deleteBtn" onclick="deleteRecord(@id)">Delete</button></td>*@ </tr> } </tbody> </table> </div> </div> </div> <div class="modal fade" role="dialog" id="createModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Edit PaymentPayStack Commission</h4> </div> <div class="modal-body"> @Html.HiddenFor(m => m.PaymentPaystackCommission.Id) <div class="form-group" id="programmeTextBox2"> @Html.LabelFor(model => model.PaymentPaystackCommission.Programme.Id, "Programme:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.PaymentPaystackCommission.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Programme.Id) </div> <div class="form-group" id="programmeTextBox"> @Html.LabelFor(model => model.PaymentPaystackCommission.FeeType.Id, "FeeType:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.PaymentPaystackCommission.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeType, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.FeeType.Id) </div> @*<div class="form-group" id="levelTextBox"> @Html.LabelFor(model => model.PaymentPaystackCommission.Fee.Id, "Fee:", new {@class = "control-label"}) @Html.DropDownListFor(model => model.PaymentPaystackCommission.Fee.Id, (IEnumerable<SelectListItem>) ViewBag.Fee, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Fee.Id) </div>*@ <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.Amount, "Commission", new { @class = "control-label" }) @Html.TextBoxFor(model => model.PaymentPaystackCommission.Amount, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Amount) </div> <div class="form-group"> @Html.LabelFor(model => model.PaymentPaystackCommission.AddOnFee, "Add On", new { @class = "control-label" }) @Html.TextBoxFor(model => model.PaymentPaystackCommission.AddOnFee, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.AddOnFee) </div> <div class="form-group" id="departmentTextBox"> @Html.LabelFor(model => model.PaymentPaystackCommission.Session.Id, "Session:", new { @class = "control-label" }) @Html.DropDownListFor(model => model.PaymentPaystackCommission.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Session.Id) </div> <div class="form-group" id="terminalIdTextBox"> @Html.LabelFor(model => model.PaymentPaystackCommission.Activated, "Activated", new { @class = "control-label" }) @Html.CheckBoxFor(model => model.PaymentPaystackCommission.Activated, new { @checked = true }) @Html.ValidationMessageFor(model => model.PaymentPaystackCommission.Activated) </div> </div> <div class="modal-footer form-group"> <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> <button type="button" id="btnEditCommission" class="btn btn-success">Save</button> </div> </div> </div> </div> <file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Student.ViewModels.HostelViewModel @{ Layout = null; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> </div> <div class="printable"> <div class="container"> <div class="panel panel-default"> <div class="row pad-top-botm "> <div class="col-lg-5 col-md-6 col-sm-6 "> </div> <div class="row"> <div> <img src="~/Content/Images/school_logo.png" height="200" width="200"/> </div> </div> </div> <div class="row text-center contact-info"> <div class="col-lg-12 col-md-12 col-sm-12"> <hr /> <span> <strong>Email : </strong> <EMAIL> </span> <span> <strong>Call : </strong> 08164958768 </span> <span> <strong>Contact Address : </strong>University of Port-Harcourt, Choba. </span> <hr /> </div> </div> <div class="row pad-top-botm client-info"> <div class="col-lg-5"> </div> <div class="col-lg-6 col-md-6 col-sm-6"> <h4> <strong>Hostel Information</strong></h4> </div> </div> @if (Model.Payment.Session != null) { <div style="text-align: center;" > <h4> <strong>@Model.Payment.Session.Name Academic Session</strong></h4> </div> } <div class="row"> <div class="col-md-12"> <b>Student Name :</b> @if (Model != null && Model.HostelAllocation != null) { @Model.HostelAllocation.Person.FullName } <br /> <b>Student Registeration Number :</b> @if (Model != null && Model.Student != null) { @Model.Student.MatricNumber } <br /> <b>Hostel :</b> @if (Model != null && Model.HostelAllocation != null) { @Model.HostelAllocation.Hostel.Name } <br /> <b>Series/Floor :</b> @if (Model != null && Model.HostelAllocation != null) { @Model.HostelAllocation.Series.Name } <br /> <b>Room :</b> @if (Model != null && Model.HostelAllocation != null) { @Model.HostelAllocation.Room.Number } </div> <hr /> <div class="ttl-amts col-md-12"> <h4> <strong> Bill Amount : N @if (Model != null && Model.Payment != null) { @Model.Payment.FeeDetails.Sum(p => p.Fee.Amount) } </strong> </h4> </div> </div> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <strong> Important: </strong> <ol> <li> This is an electronically generated receipt so it doesn't require any signature. </li> <li> Please read all terms and polices on www.uniport.edu.ng for returns, replacement and other issues. </li> </ol> </div> </div> <div class="row"> <div class="col-md-4"> @Html.GenerateQrCode(Model.QRVerification) </div> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Model.Model.ComplaintLog @{ ViewBag.Title = "Complain Form"; Layout = "~/Views/Shared/_Layout.cshtml"; } @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="form-horizontal"> <h4>Complaint Form</h4> <p>Kindly provide the available details in the text boxes provided</p> <hr /> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.Name, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.Name, new {@class = "form-control", @placeholder = "your name as it appears on your document"}) @Html.ValidationMessageFor(model => model.Name, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.MobileNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.MobileNumber, new {@class = "form-control", @placeholder = "e.g 080XXXXXXXX"}) @Html.ValidationMessageFor(model => model.MobileNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ApplicationNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.ApplicationNumber, new {@class = "form-control", @placeholder = "e.g FPI/ND/150000000001"}) @Html.ValidationMessageFor(model => model.ApplicationNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.RRR, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.RRR, new {@class = "form-control", @placeholder = "e.g Q6567366"}) @Html.ValidationMessageFor(model => model.RRR, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ExamNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.ExamNumber, new {@class = "form-control", @placeholder = "e.g ST000012"}) @Html.ValidationMessageFor(model => model.ExamNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ConfirmationNumber, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.ConfirmationNumber, new {@class = "form-control", @placeholder = "e.g 078372362563623 / 262544545454"}) @Html.ValidationMessageFor(model => model.ConfirmationNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Complain, new {@class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextAreaFor(model => model.Complain, new {@class = "form-control", @placeholder = "e.g I am unable to check my admission"}) @Html.ValidationMessageFor(model => model.Complain, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Submit" class="btn btn-default" /> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ClearanceViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> @if (Model == null || Model.admissionCriteriaForOLevelSubject == null) { return; } @if (Model.admissionCriteriaForOLevelSubject != null) { @Html.ActionLink("Back", "AdmissionCriteria", null, new {@class = "btn btn-white btn-lg mr5"}) <div class="panel panel-default" style="color: black"> <!-- Default panel contents --> <h2>@Model.admissionCriteriaForOLevelSubject[0].MainCriteria.Department.Name Criteria</h2> <div class="panel-heading"><b>O-Level Subjects</b></div> <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Subject</th> <th>Minimum Grade</th> <th>Compulsory</th> <th>Alternative</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int itemIndex = 0; itemIndex < Model.admissionCriteriaForOLevelSubject.Count; itemIndex++) { <tr> <td>@Model.admissionCriteriaForOLevelSubject[itemIndex].Subject.Name</td> <td>@Model.admissionCriteriaForOLevelSubject[itemIndex].MinimumGrade.Name</td> <td>@Model.admissionCriteriaForOLevelSubject[itemIndex].IsCompulsory</td> @if (Model.admissionCriteriaForOLevelSubject[itemIndex].Alternatives.Count > 0) { <td>@Model.admissionCriteriaForOLevelSubject[itemIndex].Alternatives[0].OLevelSubject.Name</td> } else { <td>-</td> } <td><i class="fa fa-edit"> @Html.ActionLink("Edit", "EditCriteria", "Clearance", new {Area = "Admin", id = @Model.admissionCriteriaForOLevelSubject[itemIndex].MainCriteria.Id}, null)</i></td> </tr> } </tbody> </table> </div> <div class="panel panel-default" style="color: black"> <!-- Default panel contents --> <div class="panel-heading"><b>O-Level Type</b></div> <!-- Table --> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>O-Level Type</th> <th>Minimum Required Subjects</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int itemIndex = 0; itemIndex < Model.admissionCriteriaForOLevelType.Count; itemIndex++) { <tr> <td>@Model.admissionCriteriaForOLevelType[itemIndex].OLevelType.Name</td> <td>@Model.admissionCriteriaForOLevelType[itemIndex].MainCriteria.MinimumRequiredNumberOfSubject</td> <td><i class="fa fa-edit"> @Html.ActionLink("Edit", "ViewCriteria", "Clearance", new {Area = "Admin"}, null)</i></td> </tr> } </tbody> </table> </div> @Html.ActionLink("Back", "AdmissionCriteria", null, new {@class = "btn btn-white btn-lg mr5"}) }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.FeeDetailViewModel @{ ViewBag.Title = "Fee Detail Upload"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(document).ready(function () { $(".Load").hide(); $("#feeDetailTable").DataTable(); }); function showBusy() { alert("Ensure that the ids are very correct before upload!"); $(".Load").show(); $("#save").attr('disabled', 'disabled'); } </script> <div class="alert alert-success fade in nomargin"> <h3 style="text-align: center">@ViewBag.Title</h3> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("UploadFeeDetail", "FeeDetail", FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <p class="custom-text-black"> Select the Session then the excel file to upload</p> <marquee>Please the execel file should be arranged in the following format: SN,Fee,FeeType,Programme,Level,PaymentMode,Department</marquee> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Id, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>)ViewBag.SessionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.UploadedFilePath, "Select File", new { @class = "col-md-2 control-label " }) <div><input type="file" title="Upload Fee Detail" id="file" name="file" class="form-control" /></div> </div> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="upload"><i class="fa fa-eject"> Upload</i></button><span class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> } </div> @if (Model == null || Model.feeDetails == null) { return; } @if (Model != null && Model.feeDetails != null) { <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="feeDetailTable"> <thead> <tr> <th> SN </th> <th> Fee </th> <th> FeeType </th> <th> Programme </th> <th> Level </th> <th> Payment Mode </th> <th> Department </th> <th> Session </th> </tr> </thead> <tbody style="color:black;"> @for (var itemIndex = 0; itemIndex < Model.feeDetails.Count; itemIndex++) { <tr> <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].SN)</td> <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].Fee.Name)</td> <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].FeeType.Name)</td> @if (Model.feeDetails[itemIndex].Programme != null) { <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].Programme.Name)</td> } else { <td></td> } @if (Model.feeDetails[itemIndex].Level != null) { <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].Level.Name)</td> } else { <td></td> } @if (Model.feeDetails[itemIndex].PaymentMode != null) { <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].PaymentMode.Name)</td> } else { <td></td> } @if (Model.feeDetails[itemIndex].Department != null) { <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].Department.Name)</td> } else { <td></td> } <td>@Html.DisplayTextFor(m => m.feeDetails[itemIndex].Session.Id)</td> </tr> } </tbody> </table> </div> <br /> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> @*<button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="save" ><i class="fa fa-eject"> Save Upload</i></button>*@ @Html.ActionLink("Save Upload", "SaveUploadedFeeDetail", new { Controller = "FeeDetail", Area = "Admin" }, new { @class = "btn btn-success mr5", onclick = "showBusy()", id = "save" })<span class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffCourseAllocationViewModel @{ ViewBag.Title = "UploadResultSheet"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("ResultUploadSheet", "StaffCourseAllocation", new {area = "Admin"}, FormMethod.Post, new {enctype = "multipart/form-data"})) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-upload"></i>Upload Result Sheet</h3> </div> <div class="panel-body"> <div class="alert alert-warning alert-dismissable"><h4>Endeavor to Cross Check Fields and Verify Excel Data</h4></div> <br /> @if (Model == null || Model.resultFormatList == null) { return; } @if (Model != null && Model.resultFormatList.Count > 0) { <table class="table table-responsive table-striped"> <tr> <th> S/N </th> <th> MATRIC NUMBER </th> <th> FULLNAME </th> <th> STUDENT DEPARTMENT </th> <th> IN COURSE </th> <th> EXAM SCORE </th> <th> COURSE CODE </th> </tr> @for (int i = 0; i < Model.resultFormatList.Count; i++) { <tr> <td> @Model.resultFormatList[i].SN </td> <td> @Model.resultFormatList[i].MatricNo </td> <td> @Model.resultFormatList[i].Fullname </td> <td> @Model.resultFormatList[i].Department </td> <td> @Model.resultFormatList[i].CA </td> <td> @Model.resultFormatList[i].Exam </td> <td> @Model.resultFormatList[i].CourseCode </td> </tr> } </table> <br /> <div class="form-group" style="text-align: center"> <div class="col-sm-10 pull-left"> @Html.ActionLink("Save Upload", "SaveUploadedResultSheet", new {controller = "StaffCourseAllocation", area = "Admin"}, new {@class = "btn btn-primary mr5"}) </div> </div> } </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ ViewBag.Title = "Admission List View Criteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function() { $('.datepicker').bootstrapMaterialDatePicker({ format: 'dddd DD MMMM YYYY', clearButton: true, weekStart: 1, time: false }); $('#applicantTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } },, 'colvis' ] }); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Applicants</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("ApplicantListBulk", "UploadAdmission", FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Name, "Session", new {@class = "control-label col-sm-2"}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.DateFrom, "Date", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.DateFrom, new { @class = "datepicker", @placeholder = "From:", @required = "required", id = "dateFrom" }) @Html.TextBoxFor(model => model.DateTo, new { @class = "datepicker", @placeholder = "To:", @required = "required", id = "dateTo" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } </div> </div> </div> </div> <div class="col-md-1"> </div> </div> <file_sep>@using Abundance_Nk.Model.Model @model IEnumerable<Abundance_Nk.Model.Model.DepartmentalSchoolFees> @{ ViewBag.Title = "AllSchoolFees"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>All School Fees</h2> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Programme</th> <th>Department</th> <th>Level </th> <th>Amount</th> </tr> </thead> <tbody style="color: black;"> @foreach (DepartmentalSchoolFees fee in Model) { <tr> <td>@Html.DisplayFor(modelItem => fee.programme.Name)</td> <td>@Html.DisplayFor(modelItem => fee.department.Name)</td> <td>@Html.DisplayFor(modelItem => fee.level.Name)</td> <td>@Html.DisplayFor(modelItem => fee.Amount)</td> </tr> } </tbody> </table><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "ViewTranscriptDetails"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("ViewTranscriptDetails", "TranscriptProcessor", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> <h3> View Transcript Details </h3> </div> <hr /> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, "Matric Number:", new {@class = "control-label "}) @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.student.MatricNumber, null, new {@class = "text-danger"}) </div> </div> </div> </div> <div class="col-md-12"> <div class="row"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> </div> </div> </div> </div> } @if (Model.transcriptRequests != null && Model.Person != null) { <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @Html.HiddenFor(model => model.transcriptRequest.student.Id) <div class="row"> <div class="col-md-12"> <div class="alert in nomargin"> <h3><b>TRANSCRIPT DETAILS</b></h3> </div> </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequests.FirstOrDefault().student.LastName, "Surname: ", new {@class = "control-label"}) @Html.DisplayFor(model => model.transcriptRequests.FirstOrDefault().student.LastName, new {@class = "form-control"}) </div> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequests.FirstOrDefault().student.FirstName, "First Name: ", new {@class = "control-label"}) @Html.DisplayFor(model => model.transcriptRequests.FirstOrDefault().student.FirstName, new {@class = "form-control"}) </div> </div> <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequests.FirstOrDefault().student.OtherName, "Other Name: ", new {@class = "control-label "}) @Html.DisplayFor(model => model.transcriptRequests.FirstOrDefault().student.OtherName, new {@class = "form-control"}) </div> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequests.FirstOrDefault().student.MatricNumber, "Matric Number: ", new {@class = "control-label "}) @Html.DisplayFor(model => model.transcriptRequests.FirstOrDefault().student.MatricNumber, new {@class = "form-control"}) </div> </div> <table class="table table-responsive"> <tr> <th>Destination Address</th> <th>Date Requested</th> <th>Destination Country</th> <th>Destination State</th> <th>Clearance Status</th> <th>Transcript Status</th> <th></th> <th></th> </tr> @for (int i = 0; i < Model.transcriptRequests.Count; i++) { <tr> <td>@Model.transcriptRequests[i].DestinationAddress</td> <td>@Model.transcriptRequests[i].DateRequested.ToShortDateString()</td> <td>@Model.transcriptRequests[i].DestinationCountry.CountryName</td> <td>@Model.transcriptRequests[i].DestinationState.Name</td> <td>@Model.transcriptRequests[i].transcriptClearanceStatus.TranscriptClearanceStatusName</td> <td>@Model.transcriptRequests[i].transcriptStatus.TranscriptStatusName</td> <td>@Html.ActionLink("Edit", "EditTranscriptDetails", new {controller = "TranscriptProcessor", area = "Admin", @Model.transcriptRequests[i].Id}, new {@class = "btn btn-success btn-sm"})</td> <td>@Html.ActionLink("Delete", "DeleteTranscriptDetails", new {controller = "TranscriptProcessor", area = "Admin", @Model.transcriptRequests[i].Id}, new {@class = "btn btn-success btn-sm"})</td> </tr> } </table> </div> </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep>@model IEnumerable<Abundance_Nk.Model.Model.BasicSetup> @{ ViewBag.Title = "Payment Modes"; ViewBag.IsIndex = true; } @Html.Partial("BasicSetup/_Index", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Upload Student Summary"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.min.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function() { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); //go back function goBack() { window.history.back() } </script> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Upload Student Summary</h3> </div> <br /> @if (Model != null && Model.UploadStudentDataList.Count > 0) { <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> LAST NAME </th> <th> FIRST NAME </th> <th> OTHER NAME </th> <th> JAMB NO </th> <th> EMAIL ADDRESS </th> <th> Remarks </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.UploadStudentDataList.Count; i++) { <tr> <td> @Model.UploadStudentDataList[i].SN </td> <td> @Model.UploadStudentDataList[i].LastName </td> <td> @Model.UploadStudentDataList[i].FirstName </td> <td> @Model.UploadStudentDataList[i].OtherName </td> <td> @Model.UploadStudentDataList[i].JambNo </td> <td> @Model.UploadStudentDataList[i].EmailAddress </td> <td> @Model.UploadStudentDataList[i].Remarks </td> </tr> } </tbody> </table> <br /> <div class="form-group" style="text-align: center"> <div class="col-sm-2 pull-left"> <button class="btn btn-success mr5" onclick="goBack()">Back</button> </div> </div> } </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Reset Student Data"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script type="text/javascript"> $(document).ready(function() { var selectedProgramme = $("#studentLevel_Programme_Id").val(); $("#studentLevel_Programme_Id").change(function() { var programme = $("#studentLevel_Programme_Id").val(); $("#studentLevel_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function(departments) { $("#studentLevel_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#studentLevel_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); }) </script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <h3>Update Student Data</h3> <hr /> @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Number, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ApplicationForm.Number, new {@class = "form-control", @placeholder = "Enter Application Number"}) @Html.ValidationMessageFor(model => model.ApplicationForm.Number, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Reset Student" /> </div> </div> } </div> </div><file_sep>@{ ViewBag.Title = "Attendance Sheet"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*@section Scripts { @Scripts.Render("~/bundles/jqueryval")*@ <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> <div style="color: black"> <h3> Attendance Sheet </h3> </div> <div class="alert alert-dismissible alert-success"> <p> <b>Attendance Sheet </b> </p> </div> <iframe src="@Url.Content("~/Reports/Presenter/AttendanceReport.aspx?sessionId=" + (string) ViewBag.SessionId + "&semesterId=" + (string) ViewBag.SemesterId + "&levelId=" + (string) ViewBag.LevelId + "&courseId=" + ViewBag.CourseId + "&programmeId=" + (string) ViewBag.ProgrammeId + "&departmentId=" + (string) ViewBag.DepartmentId)" style="width: 100%;" frameborder="0" scrolling="no" id="iframe" onload=' javascript:resizeIframe(this); '></iframe> <br /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "Delete"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Are you sure you want to delete this?</h4> </div> <div class="panel-body"> <div class="col-md-12"> <div> <h5>HOSTEL TYPE</h5> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Hostel Type Name:") </dt> <dd> @Html.DisplayFor(model => model.HostelType.Hostel_Type_Name) </dd> <br/> <dt> @Html.DisplayName("Description:") </dt> <dd> @Html.DisplayFor(model => model.HostelType.Hostel_Type_Description) </dd> </dl> @using (Html.BeginForm("DeleteHostelType", "Hostel", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.HostelType.Hostel_Type_Id) <div class="form-actions no-color"> <input type="submit" value="Delete" class="btn btn-default" /> | @Html.ActionLink("Back to List", "ViewHostelTypes", "", new { @class = "btn btn-success" }) </div> } </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; ViewBag.Title = "Transcript Requests"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script> $(document).ready(function() { $("#myTable").DataTable(); }); function getnewValue(val) { var dropdownChanged = val.id; var buttonId = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].id; var buttonUrl = document.getElementById(dropdownChanged).offsetParent.nextElementSibling.childNodes[0].href; var ur = buttonUrl + "&stat=" + val.value; document.getElementById(buttonId).href = ur; } $("a").click(function() { alert($(this).text); }); </script> <div class="col-sm-12" style="padding: 20px;"> <h2>Incoming Transcript Requests</h2> <div class="row"> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th>FULLNAME</th> <th>MATRIC NO</th> <th>DATE REQUESTED</th> <th>DESTINATION</th> <th>DELIVERY SERVICE</th> <th>CLEARANCE STATUS</th> <th>STATUS</th> <th></th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.transcriptRequests.Count; i++) { <tr> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].Name)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].student.MatricNumber)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DateRequested)</td> <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DestinationAddress)</td> @if (string.IsNullOrEmpty(Model.transcriptRequests[i].DeliveryService)) { <td>-</td> } else { <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].DeliveryService)</td> } <td>@Html.DisplayTextFor(m => m.transcriptRequests[i].transcriptClearanceStatus.TranscriptClearanceStatusName)</td> <td>@Html.DropDownListFor(m => m.transcriptRequests[i].transcriptStatus.TranscriptStatusId, (IEnumerable<SelectListItem>)ViewData["Dispatchstatus" + i], new { @class = "form-control", @onChange = "getnewValue(this)" })</td> <td>@Html.ActionLink("Update", "UpdateStatus", "TranscriptProcessor", new { tid = Model.transcriptRequests[i].Id }, new { @class = "btn btn-default", @id = "url" + i })</td> </tr> } </tbody> </table> </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; namespace Abundance_Nk.Web.Reports.Presenter { public partial class PutmeReportDEBulk : System.Web.UI.Page { private List<Department> departments; private List<InstitutionChoice> choices; public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Name.ToString(); } } public InstitutionChoice SelectedChoice { get { return new InstitutionChoice { Id = Convert.ToInt32(ddlChoice.SelectedValue), Name = ddlChoice.SelectedItem.Text }; } set { ddlChoice.SelectedValue = value.Name.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { DepartmentLogic departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(new Programme() { Id = 1 }); Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID, Utility.NAME); InstitutionChoiceLogic choiceLogic = new InstitutionChoiceLogic(); choices = choiceLogic.GetAll(); Utility.BindDropdownItem(ddlChoice, choices, Utility.ID, Utility.NAME); ddlDepartment.Visible = true; ddlChoice.Visible = true; BulkOperations(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedDepartment == null || SelectedDepartment.Id <= 0) { return true; } if (SelectedChoice == null || SelectedChoice.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } private void DisplayReportBy(Department department,InstitutionChoice choice) { try { var putmeResultLogic = new PutmeResultLogic(); List<PutmeSlip> report = putmeResultLogic.GetPUTMEReport(department, 18, choice.Id); string bind_dsStudentPaymentSummary = "dsReport"; string reportPath = @"Reports\PUTMEReportDE.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "PUTME Report "; ReportViewer1.LocalReport.ReportPath = reportPath; if (report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } protected void Display_Button_Click1(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReportBy(SelectedDepartment, SelectedChoice); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; ; } } public void BulkOperations() { try { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string downloadPath = "/Content/tempPUTME/" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond + "/"; if (Directory.Exists(Server.MapPath(downloadPath))) { Directory.Delete(Server.MapPath(downloadPath), true); Directory.CreateDirectory(Server.MapPath(downloadPath)); } else { Directory.CreateDirectory(Server.MapPath(downloadPath)); } List<Course> courses = new List<Course>(); var departmentLogic = new DepartmentLogic(); var choiceLogic = new InstitutionChoiceLogic(); List<Department> departments = departmentLogic.GetAll(); List<InstitutionChoice> choices = choiceLogic.GetAll(); foreach (Department deptDepartment in departments) { foreach (InstitutionChoice choice in choices) { var putmeResultLogic = new PutmeResultLogic(); List<PutmeSlip> report = putmeResultLogic.GetPUTMEReport(deptDepartment, 6, choice.Id); if (report.Count > 0) { string bind_dsStudentPaymentSummary = "dsReport"; string reportPath = @"Reports\PUTMEReportDE.rdlc"; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "PUTME Report"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string name = deptDepartment.Code.Replace(" ", "") +"_"+ choice.Name.Replace(" ", ""); string path = Server.MapPath(downloadPath); string savelocation = Path.Combine(path, name + ".pdf"); File.WriteAllBytes(savelocation, bytes); } } } using (var zip = new ZipFile()) { string file = Server.MapPath(downloadPath); zip.AddDirectory(file, ""); string zipFileName = SelectedDepartment.Name; zip.Save(file + zipFileName + ".zip"); string export = downloadPath + zipFileName + ".zip"; //Response.Redirect(export, false); var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect( urlHelp.Action("DownloadZip", new { controller = "StaffCourseAllocation", area = "Admin", downloadName = SelectedDepartment.Name }), false); } } catch (Exception ex) { throw ex; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ Layout = null; ViewBag.Title = "ResultSlip"; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#aPrint").click(function () { $("#aPrint").hide(); $("#printable").show(); window.print(); $("#aPrint").show(); }); }); </script> <div> <div id="printable" class="container"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 "> <div class="row"> <div class="col-xs-2 pull-left"> <img class="img-responsive" src="@Url.Content("~/Content/Images/school_logo.jpg")" width="100px" height="100px" alt="School Logo" /> </div> <div class="col-xs-6 text-center text-bold"> <center> ABIA STATE UNIVERSITY, UTURU <br /> OFFICE OF THE REGISTRAR <br /> <p>PUTME RESULT SLIP</p> </center><br /> </div> <div class="col-xs-2 pull-right"> <img class="img-responsive" src="@Url.Content('~' + Model.ResultSlip.passportUrl)" width="100px" height="100px" alt="Student Passport" /> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div class="text-center text-bold">Result Slip</div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.Fullname, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.Fullname) </div> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.ApplicationNumber, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.ApplicationNumber) </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.Department, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.Department) </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.JambNumber, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.JambNumber) </div> </div> </div> </div> <div class="row"> @*<div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.JambScore, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.JambScore) </div> </div> </div>*@ </div> <div class="row"> <div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.ExamNumber, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.ExamNumber) </div> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.ExamScore, "Screening Score", new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.ExamScore) </div> </div> </div> </div> @*<div class="row"> <div class="col-xs-12"> <div class="form-group margin-bottom-0"> <div class="col-xs-4"> @Html.LabelFor(model => model.ResultSlip.AverageScore, new { @class = "control-label ", @style = "font-size:x-small" }) </div> <div class="col-xs-8 text-bold" style="font-size: x-small"> @Html.DisplayFor(model => model.ResultSlip.AverageScore) </div> </div> </div> <div class="col-xs-6"> </div> </div>*@ </div> </div> </div> <div> <button id="aPrint" class="btn btn-primary btn-lg ">Print Slip</button> </div> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "EditMatricNumber"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-pencil"></i>Edit Matric Number</h3> </div> <div class="panel-body"> @using (Html.BeginForm("SaveEditedMatricNumber", "Support", new { area = "Admin" }, FormMethod.Post)) { @Html.HiddenFor(model => model.Student.Id) <div class="row"> <div class="col-md-2"> @Html.LabelFor(model => model.Student.MatricNumber,"Matric Number",new { @class = "control-label " }) </div> <div class="row col-md-8"> <div class="col-md-6"> <div class="form-group"> @Html.TextBoxFor(model => model.Student.MatricNumber,new { @class = "form-control",@placeholder = "Enter New Matric Number",@required = "required" }) </div> </div> <div class="form-group"> <div class="col-md-12"> <input type="submit" value="Save" class="btn btn-success mr5" /> </div> </div> </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptProcessorViewModel @{ ViewBag.Title = "EditTranscriptDetails"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //$("#State").hide(); $("#Country").change(function() { if ($("#Country").val() == "NIG") { $("#State").fadeIn("slow"); } else { $("#State").fadeOut("slow"); } }); }) </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @*@using (Html.BeginForm("EditTranscriptDetails", "TranscriptProcessor", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> <h3> Edit Transcript Details </h3> </div> <hr /> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, "Matric Number:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.transcriptRequest.student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> </div> </div> <div class="col-md-12"> <div class="row"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Edit" /> </div> </div> </div> </div> </div> </div> </div> }*@<div class="row"> <div class="col-md-12"> <h3> Edit Transcript Details </h3> </div> <hr /> </div> @if (Model.transcriptRequest != null) { <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("SaveTranscriptDetails", "TranscriptProcessor", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.transcriptRequest.student.Id) @Html.HiddenFor(model => model.transcriptRequest.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.LastName) @Html.TextBoxFor(model => model.transcriptRequest.student.LastName, new {@class = "form-control", @required = "required"}) @*@Html.ValidationMessageFor(model => model.transcriptRequest.student.LastName)*@ </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.FirstName) @Html.TextBoxFor(model => model.transcriptRequest.student.FirstName, new {@class = "form-control", @required = "required"}) @*@Html.ValidationMessageFor(model => model.transcriptRequest.student.FirstName)*@ </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.OtherName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.transcriptRequest.student.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.transcriptRequest.student.OtherName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, new {@class = "control-label "}) @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.student.MatricNumber) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationAddress, new {@class = "control-label "}) @Html.TextAreaFor(model => model.transcriptRequest.DestinationAddress, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationAddress) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DateRequested, new {@class = "control-label "}) @Html.TextBoxFor(model => model.RequestDateString, new {@class = "form-control", @readonly = "readonly"}) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationAddress) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationCountry, "Destination Country", new {@class = "control-label "}) @Html.DropDownListFor(model => model.transcriptRequest.DestinationCountry.Id, (IEnumerable<SelectListItem>) ViewBag.Country, new {@class = "form-control", @id = "Country", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationCountry) </div> </div> <div class="col-md-6" id="State"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.DestinationState, "Destination State", new {@class = "control-label ", @id = "StateName"}) @Html.DropDownListFor(model => model.transcriptRequest.DestinationState.Id, (IEnumerable<SelectListItem>) ViewBag.State, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.DestinationState) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusName, new {@class = "control-label "}) @Html.DropDownListFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusId, (IEnumerable<SelectListItem>) ViewBag.TranscriptClearanceStatus, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.transcriptStatus.TranscriptStatusName, new {@class = "control-label ", @id = "StateName"}) @Html.DropDownListFor(model => model.transcriptRequest.transcriptStatus.TranscriptStatusId, (IEnumerable<SelectListItem>) ViewBag.TranscriptStatus, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.transcriptRequest.transcriptStatus.TranscriptStatusName) </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <input class="btn btn-success btn-sm mr5" type="submit" name="submit" id="submit" value="Save" /> </div> </div> </div> } </div> </div> } </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Model.Model.AdmissionLetter @{ Layout = null; ViewBag.Title = "Acceptance Letter"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <br /> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="text-center"> <img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" height="60px" /> <h3><strong>ABIA STATE UNIVERSITY, UTURU</strong></h3> <h5><strong>SCHOOL OF POSTGRADUATE STUDIES</strong></h5> <h5><strong>ACCEPTANCE OF OFFER SLIP</strong></h5> <br /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12 text-justify " style="font-size: 15px"> <ol> <li><p class="text-bold">Name in Full (Surname First): <strong> <u>@Model.Person.FullName</u> </strong></p></li> <li><p class="text-bold">Department: <strong> <u>@Model.Department.Name</u> </strong></p></li> <li><p class="text-bold">Faculty: <strong> <u>@Model.Department.Faculty.Name</u> </strong></p></li> <li><p class="text-bold">Mode of study : <strong> <u>@Model.Programme.ShortName</u> </strong></p></li> <li><p class="text-bold">Degree in View: <strong> <u>@Model.DegreeAwarded.Degree</u> </strong></p></li> <li><p class="text-bold">Area of Specialization: <strong> <u>@Model.Department.Name</u> </strong></p></li> <li><p class="text-bold">Declaration of Acceptance </li> <p>I accept the offer of admission into:-the programme of <u>@Model.Programme.Name</u> in the department of <u>@Model.Department.Name</u> for the <u> @Model.Session.Name Session</u> </p> <br /> <p>I hereby attach photocopies of the admission letter and the receipt (@Model.AcceptancePin) in the department for the payment of N @Model.AcceptanceAmount non-refundable fee</u> </p> <br /> <p>Signed:__________________________________________________________________</p> <p>Date:____________________________________________________________________</p> <mark>Note: Request for deferment of admission would be entertained only after registration</mark> </ol> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBFormPaymentViewModel @{ ViewBag.Title = "Post JAMB Invoice"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var selectedProgramme = $("#Programme_Id").val(); if (selectedProgramme == 1) { $("#divJambNo").show(); $("#divFormSetting").show(); } else if (selectedProgramme == 4) { $("#divJambNo").show(); $("#divFormSetting").show(); } else { $("#divJambNo").hide(); } $("#formsettingdropdown").change(function () { var formSetting = $("#formsettingdropdown").val(); if (formSetting == 19 || formSetting == 20) { swal({ title: "Attention!", text: "Ensure you go to the JAMB portal to change your first choice course to your supplementary admission choice course. Also ensure you upload!", type: "warning", timer: 10000 }); } }); $("#Programme_Id").change(function () { var programme = $("#Programme_Id").val(); if (programme == 1) { swal({ title: "Attention!", text: "1. Use your personal telephone number and email address for registration of this screening. Direct entry students should select the direct entry form", type: "warning", timer: 20000 }); $("#divJambNo").show(); $("#divFormSetting").show(); } else if (programme == 2) { $("#divJambNo").hide(); } else if (programme == 3) { $("#divJambNo").hide(); } else if (programme == 4) { $("#divJambNo").show(); } else { $("#divJambNo").hide(); } $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function (departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); //search for jambrecord on blur of jambnumber $('#JambNumber').on('blur', function () { let jambNo = $('#JambNumber').val(); if (jambNo != null && jambNo != "") { FetchJambRecord(jambNo); } else { RemoveReadOnly(); } }); }); //alert("Please double-check all entries you have made; you cannot change any of your information once you have generated an invoice."); }); //Populate existing Jambrecord function FetchJambRecord(jambNumber) { if (jambNumber != null && jambNumber != undefined) { $.ajax({ type: 'POST', url: '@Url.Action("FetchJambRecord")', // we are calling json method dataType: 'json', data: { jambNumber }, success: function (result) { if (result != null && !result.IsError && result.JambNo != null) { $('#Person_LastName').val(result.LastName); $('#Person_LastName').attr('readonly', 'readonly'); $('#Person_FirstName').val(result.FirstName); $('#Person_FirstName').attr('readonly', 'readonly'); $('#Person_OtherName').val(result.OtherName); $('#Person_OtherName').attr('readonly', 'readonly'); if (result.CourseId != null) { $('#AppliedCourse_Department_Id ').val(result.CourseId); } if (result.StateId != null) { $('#Person_State_Id').val(result.StateId); } } else { RemoveReadOnly(); } }, error: function (ex) { alert(result.Message); } }); } } function RemoveReadOnly() { $('#Person_LastName').removeAttr('readonly'); $('#Person_FirstName').removeAttr('readonly'); $('#Person_OtherName').removeAttr('readonly'); } </script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="container"> <div class="col-md-12"> <div class="row pt-4 justify-content-center"> <div class="col-lg-8 col-md-12 pl-0 pr-0"> <h4 class="text-center font-weight-bold">Application Form Invoice</h4> <div class="card"> <div class="container"> @*<div class="row form-group"> <div class="col-xs-12 pl-3 pt-3 mb-3"> <ul class="nav nav-tabs setup-panel"> <li class="nav-item active"> <a class="nav-link" href="#step-1">Invoice Generation </a> </li> </ul> </div> </div>*@ @using (Html.BeginForm("PostJambFormInvoiceGeneration", "Form", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-1"> <div class="col-xs-12"> <div> <div class="col-md-12"> <div class="row"> <div class="col-md-12 mb-2"> <hr class="bg-primary m-0"> @*<div class="ruleBg"></div>*@ </div> <div class="col-md-12 mt-4"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Programme.Id, new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, "Course", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.AppliedCourse.Department.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group" style="display: none" id="divJambNo"> @Html.LabelFor(model => model.JambRegistrationNumber, "Jamb No.", new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.JambRegistrationNumber, new {@class = "form-control", @id="JambNumber"}) @Html.ValidationMessageFor(model => model.JambRegistrationNumber, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group" id="divDepartmentOption" style="display: none"> @Html.LabelFor(model => model.AppliedCourse.Option.Id, "Course Option", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.AppliedCourse.Option.Id, (IEnumerable<SelectListItem>) ViewBag.DepartmentOptionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Option.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group" style="display: none" id="divFormSetting"> @Html.LabelFor(model => model.ApplicationFormSetting.Name, "Form", new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.ApplicationFormSetting.Id, (IEnumerable<SelectListItem>) ViewBag.FormSettings, new {@class = "form-control", @id="formsettingdropdown"}) @Html.ValidationMessageFor(model => model.ApplicationFormSetting.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-12 mb-2"> @*<hr class="bg-primary m-0">*@ @*<div class="ruleBg"></div>*@ </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.LastName, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Id, new {@class = "control-label custom-text-white"}) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>) ViewBag.StateId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control", @placeholder = "080XXXXXXXX"}) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new {@class = "text-danger"}) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, new {@class = "control-label custom-text-white"}) @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.Email, null, new {@class = "text-danger"}) </div> </div> </div> <div class="col-md-12 text-right"> <button class="btn btn-primary pull-right" id="submitBtn" onclick="showLoading()">Generate Invoice</button> <span class="pull-right" style="display: none;" id="loading"> <img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> } </div> </div> </div> </div> </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Configuration; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class PostJambApplicant :Page { public Session AcademicSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public int Option { get { return Convert.ToInt32(rblSortOption.SelectedValue); } set { rblSortOption.SelectedValue = value.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { Option = 1; PopulateAllDropDown(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReportBy(Session session,Programme programme,SortOption sortOption) { try { List<PhotoCard> photoCards = null; var applicationformLogic = new ApplicationFormLogic(); photoCards = applicationformLogic.GetPostJAMBApplicationsBy(session,programme,sortOption); //if (programme.Id == -100) //{ // photoCards = applicationformLogic.GetPostJAMBApplications(session); //} //else //{ // photoCards = applicationformLogic.GetPostJAMBApplicationsBy(session, programme); //} string bind_dsPostJambApplicant = "dsApplicant"; string reportPath = @"Reports\PostJambApplicant.rdlc"; if(photoCards != null && photoCards.Count > 0) { string appRoot = ConfigurationManager.AppSettings["AppRoot"]; foreach(PhotoCard photocard in photoCards) { if(!string.IsNullOrWhiteSpace(photocard.PassportUrl)) { photocard.PassportUrl = appRoot + photocard.PassportUrl; } else { photocard.PassportUrl = appRoot + Utility.DEFAULT_AVATAR; } } } rv.Reset(); rv.LocalReport.DisplayName = "List of Applicants for " + session.Name; rv.LocalReport.ReportPath = reportPath; if(photoCards != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPostJambApplicant.Trim(),photoCards)); rv.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } SortOption sortOption = Option == 2 ? SortOption.ExamNo : Option == 3 ? SortOption.ApplicationNo : SortOption.Name; DisplayReportBy(AcademicSession,Programme,sortOption); } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(AcademicSession == null || AcademicSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } //else if (Department == null || Department.Id <= 0) //{ // lblMessage.Text = "Please select Department"; // return true; //} return false; } catch(Exception) { throw; } } //protected void ddlProgramme_SelectedIndexChanged(object sender, EventArgs e) //{ // try // { // if (Programme != null && Programme.Id > 0) // { // PopulateDepartmentDropdownByProgramme(Programme); // } // } // catch (Exception ex) // { // lblMessage.Text = ex.Message; // } //} //private void PopulateDepartmentDropdownByProgramme(Programme programme) //{ // try // { // Utility.BindDropdownItem(ddlDepartment, Utility.GetDepartmentByProgramme(programme), Utility.ID, Utility.NAME); // } // catch (Exception ex) // { // lblMessage.Text = ex.Message; // } //} } }<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffCourseAllocationViewModel @{ ViewBag.Title = "StaffCourseAllocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> <div class="container"> @using(Html.BeginForm("AllocateCourseByDepartment","Deans",new { area = "Admin" },FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-toggle-left"></i>Manage Department Results</h3> </div> <div class="panel-body"> @Html.HiddenFor(model => model.Staff.Id) @Html.HiddenFor(model => model.Staff.Department.Id) @Html.HiddenFor(model => model.Staff.Department.Name) @Html.HiddenFor(model => model.Staff.Department.Faculty.Id) @Html.HiddenFor(model => model.Staff.isHead) @Html.HiddenFor(model => model.Staff.isManagement) <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Session.Name, "Session", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @id = "Session", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @id = "Semester", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Programme.Name, "Programme", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Programme.Id, null, new { @class = "text-danger" }) </div> </div> @if (Model.Staff.isHead && !(bool)Model.Staff.isManagement) { <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.HiddenFor(model => model.CourseAllocation.Department.Id) @Html.DropDownListFor(model => model.CourseAllocation.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Department.Id, null, new { @class = "text-danger" }) </div> </div> if (Model.CourseAllocation.DepartmentOption != null) { <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.DepartmentOption.Name, "Department Option", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOption, new { @class = "form-control", @id = "DepartmentOption" }) @Html.ValidationMessageFor(model => model.CourseAllocation.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> </div> } } else if (Model.Staff.isHead && (bool)Model.Staff.isManagement) { <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Department.Id, null, new { @class = "text-danger" }) </div> </div> if (ViewBag.DepartmentOption != null && ViewBag.DepartmentOption.Count>0) { <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.DepartmentOption.Name, "Department Option", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOption, new { @class = "form-control", @id = "DepartmentOption" }) @Html.ValidationMessageFor(model => model.CourseAllocation.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> </div> } } <div class="form-group"> @Html.LabelFor(model => model.CourseAllocation.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocation.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level", @required = "required" }) @Html.ValidationMessageFor(model => model.CourseAllocation.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View Course Allocation" /> </div> </div> </div> </div> } @if(Model != null) { if(Model.Staff != null) { if((bool)Model.Staff.isManagement) { <div class="row"> @if(Model.CourseAllocationList != null) { <!-- Table --> <table class="table table-responsive"> <thead> <tr> <th>Code</th> <th>Course Title</th> <th>Course Lecturer</th> <th>View Attendance Sheet</th> <th>View Result Sheet</th> </tr> </thead> <tbody style="color: black;"> @for(int i = 0;i < Model.CourseAllocationList.Count;i++) { <tr> @Html.HiddenFor(model => model.Staff.Id) @Html.HiddenFor(model => model.Staff.Department.Id) @Html.HiddenFor(model => model.Staff.Department.Name) @Html.HiddenFor(model => model.Staff.Department.Faculty.Id) @Html.HiddenFor(model => model.Staff.isHead) @Html.HiddenFor(model => model.Staff.isManagement) @Html.HiddenFor(model => model.CourseAllocationList[i].Session.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Department.Id) @if (@Model.CourseAllocationList[i].DepartmentOption != null && @Model.CourseAllocationList[i].DepartmentOption.Id > 0) { @Html.HiddenFor(model => model.CourseAllocationList[i].DepartmentOption.Id) } @Html.HiddenFor(model => model.CourseAllocationList[i].Level.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Semester.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Programme.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Course.Id) <td>@Html.TextBoxFor(model => model.CourseAllocationList[i].Course.Code, new { @class = "form-control olevel", @disabled = "disbaled" })</td> <td>@Html.TextBoxFor(model => model.CourseAllocationList[i].Course.Name, new { @class = "form-control olevel", @disabled = "disbaled" })</td> <td>@Html.TextBoxFor(model => model.CourseAllocationList[i].User.Username, new { @class = "form-control", @disabled = "disbaled" })</td> <td>@Html.ActionLink("View", "AttendanceSheet", new { Controller = "Deans", Area = "Admin", Level = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Level.Id.ToString()), Semester = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Semester.Id.ToString()), programme = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Programme.Id.ToString()), department = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Department.Id.ToString()), session = Utility.Encrypt(@Model.CourseAllocationList[i].Session.Id.ToString()), course = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Id.ToString()) }, new { @class = "btn btn-success" })</td> <td>@Html.ActionLink("View", "AttendanceSheet", new { Controller = "Deans", Area = "Admin", Level = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Level.Id.ToString()), Semester = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Semester.Id.ToString()), programme = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Programme.Id.ToString()), department = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Department.Id.ToString()), session = Utility.Encrypt(@Model.CourseAllocationList[i].Session.Id.ToString()), course = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Id.ToString()) }, new { @class = "btn btn-success" })</td> </tr> } </tbody> </table> } </div> } else if(Model.Staff.isHead) { using(Html.BeginForm("SavedAllocateCourseByDepartment","Deans",FormMethod.Post)) { @Html.AntiForgeryToken() <div class="row"> @if(Model.CourseAllocationList != null) { <!-- Table --> <table class="table table-responsive"> <thead> <tr> <th>Code</th> <th>Course Title</th> <th>Course Lecturer</th> <th>View Attendance Sheet</th> <th>View Result Sheet</th> </tr> </thead> <tbody style="color: black;"> @for(int i = 0;i < Model.CourseAllocationList.Count;i++) { <tr> @Html.HiddenFor(model => model.Staff.Id) @Html.HiddenFor(model => model.Staff.Department.Id) @Html.HiddenFor(model => model.Staff.Department.Name) @Html.HiddenFor(model => model.Staff.Department.Faculty.Id) @Html.HiddenFor(model => model.Staff.isHead) @Html.HiddenFor(model => model.Staff.isManagement) @Html.HiddenFor(model => model.CourseAllocationList[i].Session.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Department.Id) @if (@Model.CourseAllocationList[i].DepartmentOption != null && @Model.CourseAllocationList[i].DepartmentOption.Id > 0) { @Html.HiddenFor(model => model.CourseAllocationList[i].DepartmentOption.Id) } @Html.HiddenFor(model => model.CourseAllocationList[i].Level.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Semester.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Programme.Id) @Html.HiddenFor(model => model.CourseAllocationList[i].Course.Id) <td>@Html.DisplayFor(model => model.CourseAllocationList[i].Course.Code, new { @class = "form-control olevel" })</td> <td>@Html.DisplayFor(model => model.CourseAllocationList[i].Course.Name, new { @class = "form-control olevel" })</td> <td>@Html.DropDownListFor(model => model.CourseAllocationList[i].User.Id, (IEnumerable<SelectListItem>)ViewData["lecturer" + i], new { @class = "form-control", @id = "User", @required = "required" })</td> <td>@Html.ActionLink("View", "AttendanceSheet", new { Controller = "Deans", Area = "Admin", Level = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Level.Id.ToString()), Semester = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Semester.Id.ToString()), programme = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Programme.Id.ToString()), department = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Department.Id.ToString()), session = Utility.Encrypt(@Model.CourseAllocationList[i].Session.Id.ToString()), course = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Id.ToString()) }, new { @class = "btn btn-success" })</td> <td>@Html.ActionLink("View Result", "ResultSheet", new { Controller = "Deans", Area = "Admin", Level = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Level.Id.ToString()), Semester = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Semester.Id.ToString()), programme = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Programme.Id.ToString()), department = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Department.Id.ToString()), session = Utility.Encrypt(@Model.CourseAllocationList[i].Session.Id.ToString()), course = Utility.Encrypt(@Model.CourseAllocationList[i].Course.Id.ToString()) }, new { @class = "btn btn-success" })</td> </tr> } </tbody> </table> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Save Changes" class="btn btn-primary" /> </div> </div> } </div> } } } } </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AttendanceReportBulk :Page { private List<Department> departments; private List<Semester> semesters; private List<SessionSemester> sessionSemesterList; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue),Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Semester SelectedSemester { get { return new Semester { Id = Convert.ToInt32(ddlSemester.SelectedValue), Name = ddlSemester.SelectedItem.Text }; } set { ddlSemester.SelectedValue = value.Id.ToString(); } } public Programme SelectedProgramme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department SelectedDepartment { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(!IsPostBack) { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); ddlDepartment.Visible = false; ddlSemester.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0 || SelectedSemester == null || SelectedSemester.Id <= 0 || SelectedDepartment == null || SelectedDepartment.Id <= 0 || SelectedProgramme == null || SelectedProgramme.Id <= 0 || SelectedLevel == null || SelectedLevel.Id <= 0) { return true; } return false; } catch(Exception) { throw; } } protected void ddlProgramme_SelectedIndexChanged1(object sender,EventArgs e) { try { var programme = new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue) }; var departmentLogic = new DepartmentLogic(); departments = departmentLogic.GetBy(programme); Utility.BindDropdownItem(ddlDepartment,departments,Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } catch(Exception) { throw; } } protected void Display_Button_Click1(object sender, EventArgs e) { RunReportTask(); } private void RunReportTask() { try { Session session = SelectedSession; Semester semester = SelectedSemester; Programme programme = SelectedProgramme; Department department = SelectedDepartment; Level level = SelectedLevel; if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string downloadPath = "~/Content/temp" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond; if (Directory.Exists(Server.MapPath(downloadPath))) { Directory.Delete(Server.MapPath(downloadPath), true); } Directory.CreateDirectory(Server.MapPath(downloadPath)); List<Course> courseList = Utility.GetCourseListByLevelDepartmentAndSemester(level, department, semester, programme); if (courseList != null && courseList.Count > 0) { foreach (Course course in courseList) { var courseRegistrationDetailLogic = new CourseRegistrationDetailLogic(); List<AttendanceFormat> report = courseRegistrationDetailLogic.GetCourseAttendanceSheet(session, semester, programme, department, level, course); if (report.Count > 0) { string bind_dsAttendanceList = "dsAttendanceList"; string reportPath = @"Reports\AttendanceReport.rdlc"; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Attendance Sheet"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsAttendanceList.Trim(), report)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); var courseLogic = new CourseLogic(); Course courseGenerated = courseLogic.GetBy(course.Id); string path = Server.MapPath(downloadPath); string savelocation = Path.Combine(path, courseGenerated.Code.Replace("/","_").Replace("-","") + ".pdf"); File.WriteAllBytes(savelocation, bytes); } } } using (var zip = new ZipFile()) { string file = Server.MapPath(downloadPath); zip.AddDirectory(file, ""); string zipFileName = SelectedDepartment.Name.Replace('/', '_'); zip.Save(file + zipFileName + ".zip"); string export = downloadPath + zipFileName + ".zip"; Response.Redirect(export, false); //var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); //Response.Redirect( // urlHelp.Action("DownloadZip", // new // { // controller = "StaffCourseAllocation", // area = "Admin", // downloadName = SelectedDepartment.Name // }), false); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void ddlSession_SelectedIndexChanged(object sender,EventArgs e) { try { var session = new Session { Id = Convert.ToInt32(ddlSession.SelectedValue) }; var semesterLogic = new SemesterLogic(); var sessionSemesterLogic = new SessionSemesterLogic(); sessionSemesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); semesters = new List<Semester>(); foreach(SessionSemester item in sessionSemesterList) { semesters.Add(item.Semester); } Utility.BindDropdownItem(ddlSemester,semesters,Utility.ID,Utility.NAME); ddlSemester.Visible = true; } catch(Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null || Model.Person == null || Model.AppliedCourse == null) { return; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $("#aPrint").on('click', function() { $(".printable").print(); return false; }); </script> } <div id="printable" class="custom-text-black printable"> <div class="alert alert-success fade in" style="background-color: #b78825; border: 1px solid;"> <center> <div> <img src="@Url.Content("~/Content/Images/school_logo.jpg")" width="100px" height="100px" alt="" /> <td> <h3><strong>ABIA STATE UNIVERSITY, UTURU</strong></h3> <p> P.M.B. 2000, UTURU, ABIA STATE. </p> </div> </center> </div> <br /> <center> <h2> <p>Acknowledgment Slip For @Model.Session.Name Session Admission </p></h2> </center> <hr class="no-top-padding" /> <div class="row "> <div class="col-md-12"> <img src="@Url.Content('~' + Model.Person.ImageFileUrl)" alt="" style="max-height: 150px" /> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: justify"> <br /> Dear @Model.Person.FullName, @if (Model.Programme.Id == 1 || Model.Programme.Id == 2) { <p> I hereby acknowledge the receipt of your application with Application No. <b>@Model.ApplicationFormNumber</b> for admission to this Polytechnic for a course of study leading to <b>@Model.Programme.ShortName (@Html.DisplayFor(model => model.AppliedCourse.Department.Name))</b>. Please print your Acknowledgment for record purposes. </p> } else { if (Model.ApplicationForm.Rejected == false) { <p> I hereby acknowledge the receipt of your application with Application No. <b>@Model.ApplicationFormNumber</b> for admission to this Polytechnic for a course of study leading to <b>@Model.Programme.ShortName (@Html.DisplayFor(model => model.AppliedCourse.Department.Name))</b>. Please print your Acknowledgment and Screening Slip by clicking on appropriate button below. Come with the slips on the screening date. </p> } else { <p> I regret to inform you that your application into the polytechnic was declined because you failed to meet the entry requirements for the applied course.<br /> <cite>Reject Reason : @Model.ApplicationForm.RejectReason</cite> </p> } } </div> </div> <div class="row"> <div class="col-md-12 custom-text-black"> <h5>---</h5> <br /> <img src=@Url.Content("~/Content/Images/Registrar_signature.jpg") alt="" style="max-height: 50px" /> <br /> <p>Registrar</p> </div> </div> <hr class="no-top-padding" /> </div> <div class="row"> <div class="col-md-12"> <div class="form-actions no-color"> <div class="panel " style="padding-top: 0px"> <button id="aPrint" class="btn btn-white btn-lg "><i class="fa fa-print mr5"></i> Print Slip</button> @if (Model.Programme.Id == 1 || Model.Programme.Id == 2) { @*@Html.ActionLink("Print Screening Slip","ExamSlip",null,new { @class = "btn btn-white btn-lg ",target = "_blank" })*@ } else { if (Model.ApplicationForm.Rejected == false) { @Html.ActionLink("Print Screening Slip", "ExamSlip", null, new {@class = "btn btn-white btn-lg", target = "_blank"}) } else { @Html.ActionLink("Fill Another Form", "PostJambProgramme", null, new {@class = "btn btn-white btn-lg"}) } } <a class="btn btn-white btn-lg " href="https://portal.abiastateuniversity.edu.ng/"><i class="fa fa-home mr5"></i>Back to Home</a> </div> </div> </div> </div><file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using System.Configuration; using System.IO; using Microsoft.Reporting.WebForms; using Abundance_Nk.Web.Models; using System.Threading.Tasks; using Ionic.Zip; namespace Abundance_Nk.Web.Reports.Presenter { public partial class FullPaymentDebtorsCount : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { PopulateAllDropDown(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } public Level SelectedLevel { get { return new Level() { Id = Convert.ToInt32(ddlLevel.SelectedValue), Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Session SelectedSession { get { return new Session() { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } private void DisplayReportBy(Session session, Level level, string sortOption) { try { PaymentMode paymentMode = new PaymentMode() { Id = Convert.ToInt32(sortOption) }; PaymentModeLogic paymentModeLogic = new PaymentModeLogic(); List<PaymentView> payments = paymentModeLogic.GetDebtorsCountFullPayment(session, paymentMode, level, txtBoxDateFrom.Text, txtBoxDateTo.Text); if (payments.Count <= 0) { lblMessage.Text = "No records found."; return; } string bind_dsPhotoCard = "dsStudentPayment"; string reportPath = ""; reportPath = @"Reports\DebtorsReportCountFullPayment.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Debtors Report"; rv.LocalReport.ReportPath = reportPath; if (payments != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPhotoCard, payments)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } else if (SelectedLevel == null || SelectedLevel.Id <= 0) { lblMessage.Text = "Please select Level"; return true; } return false; } catch (Exception) { throw; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReportBy(SelectedSession, SelectedLevel, rblSortOption.SelectedValue); } catch (Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Delete Result Grade"; } @Html.Partial("Setup/_Delete", @Model)<file_sep><!DOCTYPE html> <html> <head> <meta charset="utf-8" /> @*<meta name="viewport" content="width=device-width, initial-scale=1.0">*@ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>@ViewBag.Title - The Federal Polytechnic Ilaro</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") <script type="text/javascript"> function SetMenuStyle() { var mainPage = window.location.pathname.toString(); //var page = mainPage.split("/").pop(); var basicSetupMenus = ["FeeType", "Fee", "PersonType", "PaymentMode", "PaymentType", "Nationality", "State", "Lga", "ResultGrade", "Genotype", "Religion", "MaritalStatus", "Relationship", "Title", "StudentCategory", "StudentType", "ModeOfStudy", "ModeOfStudy", "CourseType", "Course", "OLevelGrade", "Cgpa", "Faculty", "Department", "Programme", "OLevelType", "OLevelSubject", "News"]; for (var i = 0; i < basicSetupMenus.length; i++) { if (mainPage.indexOf(basicSetupMenus[i]) > -1) { document.getElementById('lnkBasicSetup').className = "parent active"; document.getElementById('lnk' + basicSetupMenus[i]).className = "active"; break; } } ////alert(document.getElementById('lnk' + page).id); //if (mainPage.indexOf(mainPage) > -1) { // document.getElementById('lnk' + page).className = "active"; // document.getElementById('lnkBasicSetup').className = "parent active" //} //var str = "This is testing for javascript search !!!"; //if (str.search("for") != -1) { // //logic //} } </script> </head> <body onload=" javascript:SetMenuStyle(); "> @*<div class="container" style="color: #428bca">*@ <div class="container " style="color: #369d44"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 7px"><img src="@Url.Content("~/Content/Images/school_logo.jpg")" alt="" /></td> <td><h3><strong>The Federal Polytechnic, Ilaro</strong></h3></td> </tr> </table> </div> </div> @*<div class="container " style="color:#2ec875; "> <h1><strong>Federal Polytechnic Ilaro</strong></h1> </div>*@ <header> <div class="headerwrapper"> <div class="container "> <div class="header-left" style="padding: 15px 0 15px 0;"> <div class="pull-right"> <a href="" class="menu-collapse"> <i class="fa fa-bars"></i> </a> </div> </div><!-- header-left --> @*<div class="header-right"> <div class="pull-right"> <div class="navbar navbar-default "> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav "> <li>@Html.ActionLink("Home", "Index", "Home", new { Area = "" }, null)</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Fee Type", "Index", "FeeType")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> </div> </div> @Html.Partial("_LoginPartial") </div><!-- pull-right --> </div>*@<!-- header-right --> </div><!-- headerwrapper --> </div> </header> <section> <div class="container "> <div class="mainwrapper"> <div class="leftpanel"> <div class="media profile-left"> @*<a class="pull-left profile-thumb" href="profile.html"> <img class="img-circle" src="~/Content/Images/Photos/profile.png" alt=""> </a>*@ <div class="media-body"> @*<h4 class="media-heading"><NAME></h4> <small class="text-muted">Beach Lover</small>*@ </div> </div><!-- media --> <h5 class="leftpanel-title" style="color: transparent">Navigation</h5> <h5 class="leftpanel-title"> </h5> <ul class="nav nav-stacked"> @*<li><a href="index.html"><i class="fa fa-home"></i> <span>Dashboard</span></a></li> <li id="lnkBasicSetup" class="parent active"> <a href=""><i class="fa fa-cog"></i> <span>Activities</span></a> <ul class="children "> <li id="lnkProfile">@Html.ActionLink("My Profile", "Index", "Profile", new { Area = "Student" }, null)</li> <li id="lnkCourses">@Html.ActionLink("Courses", "Index", "Courses", new { Area = "Student" }, null)</li> <li id="lnkResult">@Html.ActionLink("Result", "Index", "Result", new { Area = "Student" }, null)</li> <li id="lnkPayments">@Html.ActionLink("Payments", "Index", "Payments", new { Area = "Student" }, null)</li> <li id="lnkRelationship">@Html.ActionLink("Relationship", "Index", "Relationship", new { Area = "Admin" }, null)</li> <li id="lnkPersonType">@Html.ActionLink("Person Type", "Index", "PersonType", new { Area = "Admin" }, null)</li> <li id="lnkStudentType">@Html.ActionLink("Student Type", "Index", "StudentType", new { Area = "Admin" }, null)</li> <li id="lnkOLevelGrade">@Html.ActionLink("O-Level Grade", "Index", "OLevelGrade", new { Area = "Admin" }, null)</li> <li id="lnkFaculty">@Html.ActionLink("School", "Index", "Faculty", new { Area = "Admin" }, null)</li> <li id="lnkOLevelType">@Html.ActionLink("O-Level Type", "Index", "OLevelType", new { Area = "Admin" }, null)</li> <li id="lnkOLevelSubject">@Html.ActionLink("O-Level Subject", "Index", "OLevelSubject", new { Area = "Admin" }, null)</li> <li id="lnkInstitutionType">@Html.ActionLink("Institution Type", "Index", "InstitutionType", new { Area = "Admin" }, null)</li> <li id="lnkNews">@Html.ActionLink("News", "Index", "News", new { Area = "Common" }, null)</li> </ul> </li>*@ @*<li class="parent"> <a href=""><i class="fa fa-edit"></i> <span>Forms</span></a> <ul class="children"> <li><a href="code-editor.html">Code Editor</a></li> <li><a href="general-forms.html">General Forms</a></li> <li><a href="form-layouts.html">Layouts</a></li> <li><a href="wysiwyg.html">Text Editor</a></li> <li><a href="form-validation.html">Validation</a></li> <li><a href="form-wizards.html">Wizards</a></li> </ul> </li>*@ @*<li class="parent"> <a href=""><i class="fa fa-bars"></i><span>Tables</span></a> <ul class="children"> <li><a href="basic-tables.html">Basic Tables</a></li> <li><a href="data-tables.html">Data Tables</a></li> </ul> </li>*@ @*<li class="parent"> <a href=""><i class="fa fa-envelope-o"></i><span>Messages</span></a> <ul class="children"> <li class="active"><a href="">SMS</a></li> <li><a href="">Email</a></li> </ul> </li>*@ @*<li class="parent "> <a href=""><i class="fa fa-file-text"></i> <span>Reports</span></a> <ul class="children"> <li><a href="notfound.html">404 Page</a></li> <li class="active"><a href="blank.html">Blank Page</a></li> <li><a href="calendar.html">Calendar</a></li> <li><a href="invoice.html">Invoice</a></li> <li><a href="locked.html">Locked Screen</a></li> <li><a href="media-manager.html">Media Manager</a></li> <li><a href="people-directory.html">People Directory</a></li> <li><a href="profile.html">Profile</a></li> <li><a href="search-results.html">Search Results</a></li> <li><a href="signin.html">Sign In</a></li> <li><a href="signup.html">Sign Up</a></li> </ul> </li>*@ </ul> </div><!-- leftpanel --> <div class="mainpanel"> <div class="pageheader"> <div class="media"> <div class="pageicon pull-left" style="margin-right: 7px"> @*<i class="fa fa-users"></i>*@ <i class="fa fa-graduation-cap"></i> @*<i class="fa fa-home"></i>*@ </div> <div class="media-body"> <ul class="breadcrumb" > @*<span class="glyphicons glyphicons-education"></span>*@ <li><a href=""><i class="glyphicons glyphicons-education"></i></a></li> </ul> <h4>Student</h4> </div> </div><!-- media --> </div><!-- pageheader --> <div id="contentArea" class="contentpanel" style="margin-top: 0px; padding-top: 0px"> @RenderBody() <!-- CONTENT GOES HERE --> </div><!-- contentpanel --> </div> </div><!-- mainwrapper --> </div> </section> @*<script src="js/jquery-1.11.1.min.js"></script> <script src="js/jquery-migrate-1.2.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/modernizr.min.js"></script> <script src="js/pace.min.js"></script> <script src="js/retina.min.js"></script> <script src="js/jquery.cookies.js"></script> <script src="js/custom.js"></script>*@ @*<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Ilaro Poly", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> </footer> </div>*@ @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", false) </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ ViewBag.Title = "MakePayment"; Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="container"> <div class="col-md-12 card p-5"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="row"> <div class="col-md-12"> <h2> Make payment </h2> </div> <hr /> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> @using (Html.BeginForm("MakePayment", "Transcript", FormMethod.Post, new { id = "frmIndex", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <h4>Enter your confirmation order number and click on the pay button to make payment</h4> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> <div class="form-group"> @Html.LabelFor(model => model.PaymentEtranzact.ConfirmationNo, "Confirmation Order Number", new { @class = "control-label " }) @Html.TextBoxFor(model => model.PaymentEtranzact.ConfirmationNo, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PaymentEtranzact.ConfirmationNo, null, new { @class = "text-danger" }) </div> </div> </div> </div> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Pay" /> </div> </div> </div> </div> </div> </div> <br /> } </div> </div> <div class="col-md-1"></div> </div> @if (Model == null || Model.PaymentEtranzact == null) { return; } @if (Model != null || Model.PaymentEtranzact != null) { <div class="col-md-8"> <div class="well well-sm"> <div class="form-group"> <br /> @if (Model.Paymentstatus) { <div class="alert alert-success"> Payment Successful </div> } else { <div class="alert alert-danger"> Payment Failed, please try again later. </div> } </div> </div> </div> } </div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h2> TRANSCRIPT <span class="badge badge-warning">STATUS</span> </h2> </div> <hr/> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"></h3> </div> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> </div> <img src="@Url.Content('~' + Model.transcriptRequest.student.ImageFileUrl)" alt="" style="max-height: 150px"/> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.student.LastName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.student.LastName, new {@class = "form-control", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.student.FirstName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.student.FirstName, new {@class = "form-control", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.student.OtherName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.student.OtherName, new {@class = "form-control ", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new {@class = "form-control ", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.DateRequested, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.DateRequested, new {@class = "form-control ", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.DestinationAddress, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.DestinationAddress, new {@class = "form-control ", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.DestinationState, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.DestinationState.Name, new {@class = "form-control", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.DestinationCountry.CountryName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.DestinationCountry.CountryName, new {@class = "form-control", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.transcriptClearanceStatus.TranscriptClearanceStatusName, new {@class = "form-control ", disabled = true}) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> @Html.LabelFor(model => model.transcriptRequest.transcriptStatus.TranscriptStatusName, new {@class = "control-label "}) </div> <div class="col-md-12 text-bold"> @Html.TextBoxFor(model => model.transcriptRequest.transcriptStatus.TranscriptStatusName, new {@class = "form-control", disabled = true}) </div> </div> </div> </div> @if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId <= 3) { <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12"> <img src="@Url.Content("~/Content/Images/download.jpg")" alt="" height="70px"/> </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-12 text-bold"> @Html.ActionLink("Make Payment >> Click to continue", "ProcessPayment", "Transcript", new {tid = Model.transcriptRequest.Id, fid = Model.transcriptRequest.payment.FeeType.Id}, new {@class = "btn btn-primary btn-lg btn-block", target = "_blank"}) </div> </div> </div> </div> } else { <div class="row"> <div class="col-md-4 text-bold"> <p></p> </div> <div class="col-md-4 text-bold"> <p></p> </div> </div> <div class="row"> <div class="col-md-4 text-bold"> <p></p> </div> <div class="col-md-4 text-bold"> <p></p> </div> </div> @*<div class="row">*@ @*<div class="col-md-12 p-5 text-bold"> <p>Transcript Request Status</p> </div>*@ <div class="col-md-12 p-5"> <p>Transcript Request Status</p> @if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId==4) { <div style="background-color:navy; font:bolder; text-align:center"><h3 style="color:white">Processing ...</h3></div> } @if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId == 5) { <div style="background-color:navy; font:bolder; text-align:center"><h3 style="color:white">Dispatched</h3></div> } @*<div class="progress"> @if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId == 3) { <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> </div> } else if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId == 4) { <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100" style="width: 65%"> </div> } else if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId == 5) { <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 85%"> </div> } else if (Model.transcriptRequest.transcriptStatus.TranscriptStatusId == 6) { <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"> </div> } </div>*@ </div> @*</div>*@ @*<div> @Html.ActionLink("Regenerate Invoice", "Invoice", "Credential", new {area = "Common", pmid = Utility.Encrypt(Model.transcriptRequest.payment.Id.ToString())}, new {@class = "btn btn-primary btn-lg", target = "_blank"}) </div>*@ } </div> </div> <div class="col-md-1"></div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/jquery-1.7.1.js"></script> <script src="~/Scripts/jquery-1.7.1.min.js"></script> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h2> Verification/Collection <span class="label label-default"> Request Form</span> </h2> </div> <hr /> </div> @using (Html.BeginForm("VerificationRequest", "Transcript", FormMethod.Post, new { id = "frmIndex", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.StudentVerification.Student.Id) <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.LastName) @if (Model.StudentVerification.Student == null) { @Html.TextBoxFor(model => model.StudentVerification.Student.LastName, new { @class = "form-control", @placeholder = "Enter Surname" }) } else { @Html.TextBoxFor(model => model.StudentVerification.Student.LastName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.StudentVerification.Student.LastName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.FirstName) @if (Model.StudentVerification.Student == null) { @Html.TextBoxFor(model => model.StudentVerification.Student.FirstName, new { @class = "form-control", @placeholder = "Enter Firstname" }) } else { @Html.TextBoxFor(model => model.StudentVerification.Student.FirstName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.StudentVerification.Student.FirstName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.OtherName, new { @class = "control-label " }) @if (Model.StudentVerification.Student == null) { @Html.TextBoxFor(model => model.StudentVerification.Student.OtherName, new { @class = "form-control", @placeholder = "Enter Other Name" }) } else { @Html.TextBoxFor(model => model.StudentVerification.Student.OtherName, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.StudentVerification.Student.OtherName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.MatricNumber, new { @class = "control-label " }) @if (Model.StudentVerification.Student == null) { @Html.TextBoxFor(model => model.StudentVerification.Student.MatricNumber, new { @class = "form-control", @placeholder = "Enter Matric Number" }) } else { @Html.TextBoxFor(model => model.StudentVerification.Student.MatricNumber, new { @class = "form-control", @readonly = "readonly" }) } @Html.ValidationMessageFor(model => model.StudentVerification.Student.MatricNumber) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.MobilePhone, new { @class = "control-label " }) @Html.TextBoxFor(model => model.StudentVerification.Student.MobilePhone, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.StudentVerification.Student.MobilePhone) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.Student.Email, new { @class = "control-label " }) @Html.TextBoxFor(model => model.StudentVerification.Student.Email, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.StudentVerification.Student.Email) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentVerification.FeeType.Id, new { @class = "control-label ", @id = "Select Fee" }) @Html.DropDownListFor(model => model.StudentVerification.FeeType.Id, (IEnumerable<SelectListItem>)ViewBag.FeeTypeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentVerification.FeeType.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> </div> </div> <div class="col-md-6"> <div class="form-group"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div> } </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> } <div class="row"> @if (Model.remita != null) { <div class="panel panel-primary-head"> <div class="panel-heading"> <h3 class="panel-title text-center text-uppercase">Online Payment</h3> </div> <div class="panel-body"> <div class="row"> @using (Html.BeginForm(null, null, FormMethod.Post, new {@action = "http://www.remitademo.net/remita/ecomm/finalize.reg"})) { <div class="well well-lg"> <p class="text-center"> Kindly select a method of payment then click on the Pay button to proceed. </p> @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.remitaResponse.RRR, new {@Name = "rrr", id = "rrr"}) @Html.HiddenFor(model => model.remita.hash, new {@Name = "hash", id = "hash"}) @Html.HiddenFor(model => model.remita.merchantId, new {@Name = "merchantId", id = "merchantId"}) @Html.HiddenFor(model => model.remita.responseurl, new {@Name = "responseurl", id = "responseurl"}) <p> <b>Customer Name:</b> @Model.remita.payerName </p> <p> <b>Customer Phone:</b> @Model.remita.payerPhone </p> <p> <b>Total Amount:</b> N @Model.remita.totalAmount </p> <p> <b>Remita Retrieval Reference(RRR):</b> @Model.remitaResponse.RRR </p> <p> <b>Invoice Number:</b> @Model.remita.orderId </p> <cite>For Bank payments, kindly copy the Remita Retrieval Reference(RRR) and proceed to the bank to make payment. Tell the teller that you want to make payment using Remita then hand them the RRR number</cite> </div> <div class="col-md-12"> <div class="col-md-3"> <p class="text-bold">Select Payment Option</p> </div> <div class="col-md-6 "> <div class="form-group"> <select class="form-control" name="paymenttype"> <option value="Interswitch"> Verve Card</option> <option value="UPL"> Visa</option> <option value="UPL"> MasterCard</option> <option value="PocketMoni"> PocketMoni</option> </select> </div> </div> <div class="col-md-3"> <div class="form-inline"> <div class="form-group"> <input class="btn btn-primary btn-lg mr5" type="submit" name="submit" id="submit" value="PAY" /> </div> </div> </div> </div> } </div> <div class="row"> <img src="~/Content/Images/remita-payment-logo-horizonal.png" /> </div> <div class="row"> @Html.ActionLink("Back", "Index", new {@Model.ApplicationForm.Id}, new {@class = ""}) </div> </div> </div> } else { <div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="sr-only">Error: </span> Communication Could not be established with the Server </div> } </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="container"> <div class="col-md-12 card p-5"> <div class="col-md-12"> <h3> Transcript Request <span class="label label-default"> Search</span> </h3> </div> <hr/> <div class="panel panel-default"> <div class="panel-body"> @using (Html.BeginForm("IndexAlt", "Transcript", FormMethod.Post, new {id = "frmIndex", enctype = "multipart/form-data"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row"> <div class="col-md-12"> <p>Enter your matric Number and click on the search button to retrieve your details</p> <div class="row"> <div class="col-md-12"> <div class="form-group"> @Html.LabelFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "control-label " }) @Html.TextBoxFor(model => model.transcriptRequest.student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.transcriptRequest.student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> @if (Model.transcriptRequest.student != null) { <div class="col-md-12"> <div class="well well-sm"> <div class="form-group"> <br /> @if (Model.transcriptRequest.payment == null) { @Html.ActionLink(Model.transcriptRequest.student.FullName + " - " + Model.transcriptRequest.student.MatricNumber + " >> Click to continue", "Request", "Transcript", new { sid = Model.transcriptRequest.student.Id }, new { @class = "btn btn-danger btn-sm", target = "_blank" }) } else { @Html.ActionLink(Model.transcriptRequest.student.FullName + " - " + Model.transcriptRequest.student.MatricNumber + " >> Click to check status", "TranscriptPayment", "Transcript", new { tid = Model.transcriptRequest.Id }, new { @class = "btn btn-danger btn-sm", target = "_blank" }) } </div> </div> </div> } <div class="col-md-12"> <div class="form-group"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> </div> <br/> } </div> </div> <div class="col-md-1"></div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "Staff"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#myTable").DataTable(); }); </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-users"></i>Staff</h3> </div> <div class="panel-body"> <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> Staff Name </th> <th> Role Name </th> <th> View </th> <th> Edit </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.Users.Count; i++) { <tr> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.Users[i].Username </td> <td class="col-lg-3 col-md-3 col-sm-3"> @Model.Users[i].Role.Name </td> <td> <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> @Html.ActionLink("Details", "ViewUserDetails", new { id = Model.Users[i].Id }) @*@Html.ActionLink("Delete", "Delete", new { id = Model.Users[i].Id })*@ </td> <td> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> @Html.ActionLink("Edit", "EditUser", new { id = Model.Users[i].Id }) </td> </tr> } </tbody> </table> </div> </div><file_sep>@model Abundance_Nk.Model.Entity.DEGREE_AWARDS_BY_PROGRAMME_DEPARTMENT @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <h3>Are you sure you want to delete this?</h3> <div> <h4>DEGREE AWARDS</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.Degree_Name) </dt> <dd> @Html.DisplayFor(model => model.Degree_Name) </dd> <dt> @Html.DisplayNameFor(model => model.Duration) </dt> <dd> @Html.DisplayFor(model => model.Duration) </dd> <dt> @Html.DisplayNameFor(model => model.DEPARTMENT.Department_Name) </dt> <dd> @Html.DisplayFor(model => model.DEPARTMENT.Department_Name) </dd> <dt> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </dt> <dd> @Html.DisplayFor(model => model.PROGRAMME.Programme_Name) </dd> </dl> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-actions no-color"> <input type="submit" value="Delete" class="btn btn-default" /> | @Html.ActionLink("Back to List","Index",null,new { @class = "btn btn-primary" }) </div> } </div> </div> <file_sep>@model Abundance_Nk.Model.Model.ApplicantJambDetail @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">UTME Details/Mode of Reference</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6 custom-text-black"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.JambRegistrationNumber, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.JambRegistrationNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.JambScore, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.JambScore) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.InstitutionChoice.Id, new {@class = "control-label text-bold "}) </div> <div class="col-md-7 "> @Html.DisplayFor(model => model.InstitutionChoice.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div><file_sep>@{ ViewBag.Title = "Unathorized Access"; Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="jumbotron"> <div class="text-danger text-center" style="background: rgba(255, 255, 255, .5); padding: 0 0 0 0;"> <h2><i class="fa fa-exclamation"></i> You have tried to access a page that is not meant for you.</h2> <cite>An alert has been submitted to the admin. If you feel that your access was revoked please contact <EMAIL></cite> </div> </div> <file_sep>using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class CourseEvaluationReport : System.Web.UI.Page { public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } protected void Page_Load(object sender, EventArgs e) { try { Message = ""; if (!IsPostBack) { PopulateAllDropDown(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } public SessionSemester SelectedSession { get { return new SessionSemester() { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Level Level { get { return new Level() { Id = Convert.ToInt32(ddlLevel.SelectedValue), Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme() { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } private void DisplayReportBy(SessionSemester session, Level level, Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); departments.RemoveAt(0); ProgrammeLogic programmeLogic = new ProgrammeLogic(); LevelLogic levelLogic = new LevelLogic(); Programme thisProgramme = programmeLogic.GetModelBy(p => p.Programme_Id == programme.Id); Level thisLevel = levelLogic.GetModelBy(l => l.Level_Id == level.Id); if (Directory.Exists(Server.MapPath("~/Content/EvaluationTempFolder"))) { Directory.Delete(Server.MapPath("~/Content/EvaluationTempFolder"), true); Directory.CreateDirectory(Server.MapPath("~/Content/EvaluationTempFolder")); } else { Directory.CreateDirectory(Server.MapPath("~/Content/EvaluationTempFolder")); } for (int i = 0; i < departments.Count; i++) { Department currentDepartment = departments[i]; List<Model.Model.CourseEvaluationReport> reportList = new List<Model.Model.CourseEvaluationReport>(); CourseEvaluationAnswerLogic courseEvaluationAnswerLogic = new CourseEvaluationAnswerLogic(); reportList = courseEvaluationAnswerLogic.GetCourseEvaluationReport(programme, currentDepartment, level, session); if (reportList.Count > 0) { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string bind_dsCourseEvaluationReport = "dsCourseEvaluationReport"; string reportPath = @"Reports\CourseEvaluationReport.rdlc"; rv.Visible = false; rv.Reset(); rv.LocalReport.DisplayName = "Course Evaluation Report"; rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsCourseEvaluationReport.Trim(), reportList)); byte[] bytes = rv.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath("~/Content/EvaluationTempFolder"); string savelocation = Path.Combine(path, currentDepartment.Name.Replace("/", "_") + ".pdf"); File.WriteAllBytes(savelocation, bytes); } } using (ZipFile zip = new ZipFile()) { string file = Server.MapPath("~/Content/EvaluationTempFolder/"); zip.AddDirectory(file, ""); string zipFileName = thisProgramme.Name + "_" + thisLevel.Name; zip.Save(file + zipFileName + ".zip"); string export = "~/Content/EvaluationTempFolder/" + zipFileName + ".zip"; //Response.Redirect(export, false); UrlHelper urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect(urlHelp.Action("CourseEvaluationReport", new { controller = "Report", area = "Admin", downloadPath = export, downloadName = zipFileName }), false); //return; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessionSemesters(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, Utility.GetAllProgrammes(), Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } else if (Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } else if (Level == null || Level.Id <= 0) { lblMessage.Text = "Please select Level"; return true; } return false; } catch (Exception) { throw; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReportBy(SelectedSession, Level, Programme); } catch (Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep><!DOCTYPE html> <html lang="en"> <head> <title>UNIPORT | Web Portal</title> <!-- Fonts and icons --> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" /> <!-- CSS Files --> <link href="~/Content/assets/css/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/assets/css/now-ui-kit.css" rel="stylesheet" /> <link href="~/Content/assets/css/wfmi-style.css" rel="stylesheet" /> <link href="~/Content/index.css" rel="stylesheet" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <style> body { overflow-x: hidden; } ul.navbar-nav { text-decoration: none !important; height: 75px; } .navbar .navbar-nav .nav-link { padding-top: 20px; } ul.navbar-nav li.nav-item:hover, .navbar .navbar-nav .nav-link:hover { background: #d25400 !important; text-decoration: none !important; } ul.dropdown-menu.bg-primary { margin-top: 0px; } li.dropdown-item:hover, li.dropdown-item a:hover { background: #d25400 !important; text-decoration: none !important; } </style> </head> <body> <div class="container-fluid"></div> <div class="col-md-12 bodi m-0 p-0"> <!-- Image and text --> @*<div class="col-md-12 m-0 p-0"> <div class="row"> <div class="col-md-9"></div> <div class="col-md-3 col-sm-12"> <nav class="navbar navbar-light bg-warning p-0 m-0 h50"> <div class="row pr-0"> <div class="col-md-12 nav-item pt-1"> <a class="nav-link" href="#"> <p>RETURN TO SCHOOL WEBSITE</p> </a> </div> </div> </nav> </div> </div> </div>*@ <nav class="navbar navbar-toggleable-md navbar-expand-lg bg-primary p-0"> <div class=" pl-2" style="width: 100%;"> <div class="row"> <div class="col-md-3 col-sm-12"> <div class="navbar-translate"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navigation" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-bar bar1"></span> <span class="navbar-toggler-bar bar2"></span> <span class="navbar-toggler-bar bar3"></span> </button> <a class="navbar-brand ml-4" href="@Url.Action("Index", "Home", new {area = ""})"> <img src="~/Content/Images/school_logo.png" style='height: 50px; width: 60px; object-fit: contain'; alt="NAU"/> @*<span class="hidden-xs"><img src="~/Content/Images/unizik_Index_logo.png" alt=" NAU" style="height: 50px; width: 100px;" /></span>*@ <h6 style="font-size: 16px" class="d-inline mb-0">University of Port-Harcourt</h6> </a> </div> </div> <div class="col-md-9 col-sm-12" style="margin: -5px 0;"> <div class="collapse navbar-collapse justify-content-end" id="navigation" data-nav-image="assets/img/blurred-image-1.jpg"> <ul class="navbar-nav" style="z-index:2147483647"> <li class="nav-item"> <a class="nav-link" href="https://www.web.unizik.edu.ng"> <p>Website</p> </a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">APPLICANTS</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "PostJambFormInvoiceGeneration", "Form", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Fill Application Form", "PostJambProgramme", "Form", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("PUTME Hall Allocation", "PUTMEScreenVenueSchedule", "Screening", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check PUTME Result", "Index", "Screening", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Purchase Admission Status Card", "PurchaseCard", "Admission", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Check Admission Status", "CheckStatus", "Admission", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("JUPEB Check Admission Status", "JUPEBCheckStatus", "Admission", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Request For Hostel Allocation", "CreateHostelRequest", "Hostel", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Hostel Allocation Status", "HostelAllocationStatus", "Hostel", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">RETURNING STUDENT</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Session Registration", "Logon", "Registration", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check Semester Result", "Check", "Result", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Old Fees", "OldFees", "Payment", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Print Receipt", "PrintReceipt", "Registration", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">POST GRADUATE SCHOOL</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Application Form Invoice", "PostGraduateApplicationInvoiceGeneration", "Form", new { Area = "PGApplicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Fill Application Form", "Index", "PostGraduateForm", new { Area = "Applicant" }, null)</li> @*<li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li>*@ <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check Admission Status", "PGCheckStatus", "PGAdmission", new { Area = "Applicant" }, null)</li> <li class="divider"></li> @*<li class="dropdown-item">@Html.ActionLink("Old Fees", "OldFees", "Payment", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Print Receipt", "PrintReceipt", "Registration", new { Area = "Student" }, null)</li>*@ </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">REMEDIAL STUDIES</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">GRADUATE</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Apply for Transcript", "Index", "Transcript", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Generate Transcript Receipt", "PayForTranscript", "Transcript", new { Area = "Applicant" }, null)</li> </ul> </li> <li class="nav-item pl-4 pr-5"> @if (Request.IsAuthenticated) { <a class="nav-link" href="@Url.Action("SignOff","Account", new { Area = "Security" })"> <p>LOG OUT</p> </a> } else { <a class="nav-link" href="@Url.Action("Login","Account", new { Area = "Security" })"> <p>LOG IN</p> </a> } </li> </ul> </div> </div> </div> </div> </nav> <!-- End Navbar --> <div class="clearfix"></div> <div class="clearfix"></div> <div class="" id="wapper" style="overflow-x: hidden;"> @RenderBody() <div class="clearfix"></div> <div class="container-fluid bg-warning line-1"></div> <div class="container-fluid bg-primary py-3 pl-5 pr-5"> <div class="row"> <div class="col-md-8 col-sm-12"> &copy; UNIVERSITY OF PORT-HARCOURT </div> <div class="col-md-4 col-sm-12 text-right"> Powered by <img class="image" style="height: 30px; width: 30px" src="~/Content/images/lloydant.png" /> </div> </div> </div> </div> </div> <!----------------------------------PUTME HALL MODAL------------------------------------> <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Click <a href="~/Applicant/Screening/PUTMEScreenVenueSchedule"><b>HERE</b></a> to Download 2020 PUTME Hall Allocation</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> </div> <div class="modal-footer"> @*<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>*@ @*<button class="btn btn-primary">@Html.ActionLink("DOWNLOAD", "PUTMEScreenVenueSchedule", "Screening", new { Area = "Applicant" }, null)</button>*@ @*<button type="button" class="btn btn-primary" id="save">DOWNLOAD</button>*@ </div> </div> </div> </div> <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/jquery/jquery-ui.min.js"></script> <script type="text/javascript" src="~/Scripts/js/plugins/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="~/Scripts/js/core/jquery.3.2.1.min.js"></script> <script type="text/javascript" src="~/Scripts/js/now-ui-kit.js"></script> <script type="text/javascript" src="~/Scripts/js/vendor.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script type="text/javascript" src="~/Scripts/js/core/bootstrap.min.js"></script> <script type="text/javascript" src="~/Scripts/dashboard.js"></script> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> @*<script> swal({ title: "Attention!", text: "All student's who are to sit for the GST Exams should come to the exam hall with 2B Pencils!", type: "warning" }); </script>*@ <script type="text/javascript"> function w3_open() { document.getElementById("main").style.marginLeft = "25%"; document.getElementById("mySidebar").style.width = "25%"; document.getElementById("mySidebar").style.display = "block"; document.getElementById("openNav").style.display = 'none'; } function w3_close() { document.getElementById("main").style.marginLeft = "0%"; document.getElementById("mySidebar").style.display = "none"; document.getElementById("openNav").style.display = "inline-block"; } </script> <!--New Chat box--> <!--Start of Tawk.to Script--> <script type="text/javascript"> jQuery.noConflict(); $(document).ready(function () { //$('#mymodal').modal('show'); }) var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date(); (function () { var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0]; s1.async = true; s1.src = 'https://embed.tawk.to/5e1c9b0b7e39ea1242a465b4/1eojovc27'; s1.charset = 'UTF-8'; s1.setAttribute('crossorigin', '*'); s0.parentNode.insertBefore(s1, s0); })(); </script> <!--End of Tawk.to Script--> </body> @RenderSection("scripts", required: false) </html> <file_sep>@model Abundance_Nk.Model.Model.Receipt @{ Layout = null; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <link href="~/Content/bootstrap-override.css" rel="stylesheet" /> @if (TempData["Message"] != null) { <div class="container"> <div class="row"> <div class="col-md-12"> <br /> @Html.Partial("_Message", TempData["Message"]) </div> </div> </div> } @if (Model != null) { @Html.Partial("_Receipt", Model) }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ ViewBag.Title = "Graduation Date"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } @section Scripts { @Scripts.Render("~/bundles/jquery") <link href="~/Content/bootstrap-datepicker3.css" rel="stylesheet"/> <script src="~/Content/js/bootstrap.js"></script> <script src="~/Scripts/bootstrap-datepicker.js"></script> <script type="text/javascript"> $(document).ready(function() { $('.datepicker').datepicker(); $('.datetimepicker12').datepicker({ inline: true, sideBySide: true }); //Programme Drop down Selected-change event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "Result")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); }); function checkAllAction() { if ($("#checkAll").is(':checked')) { $(".check").prop("checked", true); } else { $(".check").prop("checked", false); } } </script> } @using (Html.BeginForm("AddGraduationDate", "Result", new {area = "Admin"}, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-book"></i>Manage Student Graduation Date </h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.AllSession, new {@class = "form-control", @id = "Session"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, "Programme", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programme, new {@class = "form-control", @id = "Programme"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Department", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Department, new {@class = "form-control", @id = "Department"}) @Html.ValidationMessageFor(model => model.Department.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @id = "Level"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View"/> </div> </div> </div> </div> } @if (Model == null || Model.StudentLevels == null) { return; } @if (Model != null && Model.StudentLevels.Count > 0) { <div class="row"> @using (Html.BeginForm("SaveGraduationDate", "Result", FormMethod.Post)) { <div class="form-group"> <div class="col-sm-2 control-label"> <b>Date For: </b> </div> <div class="col-sm-4"> Graduation: @Html.CheckBoxFor(m => m.IsGraduationDate, new { @class = "check" }) Transcript: @Html.CheckBoxFor(m => m.IsTranscriptDate, new { @class = "check" }) </div> </div> <div class="form-group"> <div class="col-sm-2 control-label"><b>Graduation Date:</b> </div> <div class="col-sm-10"> @Html.TextBoxFor(m => m.Date, new {@class = "datetimepicker12", placeholder = "Please choose a date..."}) &nbsp; <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Save" /> </div> </div> <table class="table table-responsive table-striped"> <tr> <th> S/N </th> <th> MATRIC NUMBER </th> <th> NAME </th> <th> GRADUATION DATE </th> <th> TRANSCRIPT DATE </th> <th> CHECK <input id="checkAll" type="checkbox" onclick="checkAllAction()" /> </th> </tr> @for (int i = 0; i < Model.StudentLevels.Count; i++) { <tr> @Html.HiddenFor(m => m.StudentLevels[i].Student.Id) <td> @(i + 1) </td> <td> @Model.StudentLevels[i].Student.MatricNumber </td> <td> @Model.StudentLevels[i].Student.FullName </td> <td> @Model.StudentLevels[i].GraduationDate </td> <td> @Model.StudentLevels[i].TranscriptDate </td> <td> @Html.CheckBoxFor(m => m.StudentLevels[i].Active, new { @class = "check", type = "checkbox" }) </td> </tr> } </table> } </div> } <file_sep>@model Abundance_Nk.Model.Model.DeliveryService @{ ViewBag.Title = "Edit Delivery Service"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @using (Html.BeginForm("EditDeliveryService", "TranscriptProcessor", new { area = "admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <br /> <div class="panel panel-default"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel-body"> <h2 style="font-weight: 300; text-align: center">Edit Delivery Service </h2> <hr /> <div class="row"> <div class="col-md-12"> @Html.HiddenFor(model => model.Id) <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Name, "Name", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Description, "Description", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Description, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Description, null, new { @class = "text-danger" }) </div> </div> <div class="col-md-6" style="margin-top:20px"> <div class="form-group"> @Html.CheckBoxFor(model => model.Activated, new { @class = "" }) @Html.LabelFor(model => model.Activated, "Activated", new { @class = "control-label " }) @Html.ValidationMessageFor(model => model.Activated, null, new { @class = "text-danger" }) </div> </div> </div> <br /> <div class="row"> <div class="form-group"> <div class="col--2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" value="Save" /> </div> </div> </div> </div> </div> </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Tertiary Education</div> </div> @*@Html.HiddenFor(model => model.PreviousEducation.Id)*@ <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.SchoolName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.PreviousEducation.SchoolName, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PreviousEducation.SchoolName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.Course, new {@class = "control-label "}) @Html.TextBoxFor(model => model.PreviousEducation.Course, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PreviousEducation.Course) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black">Start Date <span id="spSDate" style="color: green; display: none; font-weight: bold;">...Loading</span></div> @Html.DropDownListFor(model => model.PreviousEducation.StartYear.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationStartYearId, new {@class = "form-control"}) @Html.DropDownListFor(model => model.PreviousEducation.StartMonth.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationStartMonthId, new {@class = "form-control"}) @Html.DropDownListFor(model => model.PreviousEducation.StartDay.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationStartDayId, new {@class = "form-control"}) <div> <div class="form-group"> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black">End Date <span id="spEDate" style="color: green; display: none; font-weight: bold;">...Loading</span></div> @Html.DropDownListFor(model => model.PreviousEducation.EndYear.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationEndYearId, new {@class = "form-control"}) @Html.DropDownListFor(model => model.PreviousEducation.EndMonth.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationEndMonthId, new {@class = "form-control"}) @Html.DropDownListFor(model => model.PreviousEducation.EndDay.Id, (IEnumerable<SelectListItem>) ViewBag.PreviousEducationEndDayId, new {@class = "form-control"}) <div> <div class="form-group"> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.Qualification.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.PreviousEducation.Qualification.Id, (IEnumerable<SelectListItem>) ViewBag.QualificationId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PreviousEducation.Qualification.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.ResultGrade.Id, new {@class = "control-label"}) @Html.DropDownListFor(model => model.PreviousEducation.ResultGrade.Id, (IEnumerable<SelectListItem>) ViewBag.ResultGradeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PreviousEducation.ResultGrade.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.PreviousEducation.ITDuration.Id,"Duration", new {@class = "control-label "}) @Html.DropDownListFor(model => model.PreviousEducation.ITDuration.Id, (IEnumerable<SelectListItem>) ViewBag.ITDurationId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.PreviousEducation.ITDuration.Id) </div> </div> <div class="col-md-6"> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGPaymentViewModel @{ ViewBag.Title = "PG Application Invoice Generation"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var selectedProgramme = $("#Programme_Id").val(); if (selectedProgramme == 1) { $("#divJambNo").show(); $("#divFormSetting").show(); } else if (selectedProgramme == 4) { $("#divJambNo").show(); $("#divFormSetting").show(); } else { $("#divJambNo").hide(); } $("#formsettingdropdown").change(function () { var formSetting = $("#formsettingdropdown").val(); if (formSetting == 19 || formSetting == 20) { swal({ title: "Attention!", text: "Ensure you go to the JAMB portal to change your first choice course to your supplementary admission choice course. Also ensure you upload!", type: "warning", timer: 10000 }); } }); $("#Programme_Id").change(function () { var programme = $("#Programme_Id").val(); if (programme == 1) { swal({ title: "Attention!", text: "Direct entry students should select the direct entry form", type: "warning", timer: 10000 }); $("#divJambNo").show(); $("#divFormSetting").show(); } else if (programme == 2) { $("#divJambNo").hide(); } else if (programme == 3) { $("#divJambNo").hide(); } else if (programme == 4) { $("#divJambNo").show(); } else { $("#divJambNo").hide(); } $("#AppliedCourse_Department_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentByProgrammeId")', // we are calling json method dataType: 'json', data: { id: programme }, success: function (departments) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }); //alert("Please double-check all entries you have made; you cannot change any of your information once you have generated an invoice."); }); </script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="container"> <div class="col-md-12"> <div class="row pt-4"> <div class="col-md-8 pl-0 pr-0"> <div class="card"> <div class="container"> <div class="row form-group"> <div class="col-xs-12 pl-3 pt-3 mb-3"> <ul class="nav nav-tabs setup-panel"> <li class="nav-item active"> <a class="nav-link" href="#step-1">Invoice Generation </a> </li> </ul> </div> </div> @using (Html.BeginForm("PostGraduateApplicationInvoiceGeneration", "Form", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="row setup-content pr-4 pl-4 pb-4 pt-0" id="step-1"> <div class="col-xs-12"> <div> <div class="col-md-12"> <div class="row"> <div class="col-md-12 mb-2"> <hr class="bg-warning m-0"> <div class="ruleBg"></div> </div> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Programme.Id, new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, "Course", new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.AppliedCourse.Department.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group" style="display: none" id="divJambNo"> @Html.LabelFor(model => model.JambRegistrationNumber, "Jamb No.", new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.JambRegistrationNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.JambRegistrationNumber, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group" id="divDepartmentOption" style="display: none"> @Html.LabelFor(model => model.AppliedCourse.Option.Id, "Course Option", new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.AppliedCourse.Option.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Option.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group" style="display: none" id="divFormSetting"> @Html.LabelFor(model => model.ApplicationFormSetting.Name, "Form", new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.ApplicationFormSetting.Id, (IEnumerable<SelectListItem>)ViewBag.FormSettings, new { @class = "form-control", @id = "formsettingdropdown" }) @Html.ValidationMessageFor(model => model.ApplicationFormSetting.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-12 mb-2"> <hr class="bg-warning m-0"> <div class="ruleBg"></div> </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LastName, new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.Person.LastName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.LastName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.FirstName, new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.Person.FirstName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.FirstName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.OtherName, new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.Person.OtherName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.OtherName, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Id, new { @class = "control-label custom-text-white" }) @Html.DropDownListFor(model => model.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.State.Id, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control", @placeholder = "080XXXXXXXX" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new { @class = "text-danger" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, new { @class = "control-label custom-text-white" }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Email, null, new { @class = "text-danger" }) </div> </div> </div> <div class="col-md-12 text-right"> <button class="btn btn-primary pull-right" id="submitBtn" onclick="showLoading()">Generate Invoice</button> <span class="pull-right" style="display: none;" id="loading"> <img src="~/Content/Images/bx_loader.gif" /></span> </div> </div> </div> </div> } </div> </div> </div> <div class="col-md-4 bg-warning hidden-md-down"> <div class="col-md-12"> <div class="row p-4 mt-5"> <div class="col-md-3"><img src="~/Content/Images/absu logo.png" alt="absu logo"></div> <div class="col-md-9 pt-2"><b>Application Form Invoice</b></div> <hr><br /> <p class="mt-3">You are on your way to becoming an Post Graduate Student at our Great University</p> <h5>Welcome to Abia State University</h5> </div> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "HostelTypes"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Hostel Types</h4> </div> <div class="panel-body"> <div class="col-md-12"> <p> @Html.ActionLink("Create New Hostel Type", "CreateHostelType", new{controller = "Hostel", area = "Admin"}, new{@class = "btn btn-success"}) </p> <table class="table table-bordered table-hover table-striped"> <tr> <th> @Html.DisplayName("Hostel Type Name") </th> <th> @Html.DisplayName("Hostel Type Description") </th> <th></th> </tr> @foreach (var item in Model.HostelTypes) { <tr> <td> @Html.DisplayFor(modelItem => item.Hostel_Type_Name) </td> <td> @Html.DisplayFor(modelItem => item.Hostel_Type_Description) </td> <td> @Html.ActionLink("Edit", "EditHostelType", new { id = item.Hostel_Type_Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("Details", "HostelTypeDetails", new { id = item.Hostel_Type_Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("Delete", "DeleteHostelType", new { id = item.Hostel_Type_Id }, new { @class = "btn btn-success" }) </td> </tr> } </table> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel @{ ViewBag.Title = "Status Checking"; Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#btnSubmit").prop('disabled', true); //Applicant Form $("#ApplicationForm_Number").focusout(function() { if ($("#ApplicationForm_Number").val().startsWith("9")) { $("#ScratchCard").toggle(); } $("#btnSubmit").prop('disabled', false); }); }); </script> <br /> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h2>@ViewBag.Title</h2> <hr class="no-top-padding" /> </div> </div> <section id="loginForm"> @using (Html.BeginForm("CheckStatus", "Admission", new { Area = "Applicant" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() <div class="col-md-12 pl-0">Please enter your <b>Application Form Number OR Jamb Number</b> and Scratch Card <b>PIN</b> below to check your Application Status.</div> <div class="panel panel-default"> <div class="row"> @Html.ValidationSummary(true) <div class="form-group col-md-6 pl-0 pt-3"> @Html.LabelFor(m => m.ApplicationForm.Number, "Jamb Number / Application Number", new { @class = "pl-0 ml-0 col-md-12" }) <div class="col-md-12 pl-0"> @Html.TextBoxFor(m => m.ApplicationForm.Number, new { @class = "form-control ml-0", required = "required" }) @Html.ValidationMessageFor(m => m.ApplicationForm.Number, null, new { @class = "text-danger" }) </div> </div> <div class="form-group col-md-6 pl-0 pt-3" id="ScratchCard" style="display: none;"> @Html.LabelFor(m => m.ScratchCard.Pin, new { @class = "col-md-12" }) <div class="col-md-12"> @Html.PasswordFor(m => m.ScratchCard.Pin, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.ScratchCard.Pin, null, new { @class = "text-danger" }) </div> </div> <div class="form-group col-md-12 pl-0"> <div class="col-md-offset-3 col-md-12 pl-0"> <input type="submit" id="btnSubmit" value="Check" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "ResetCourseRegistration"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Course Resgistration Reset</div> </div> <div class="panel-body"> @using (Html.BeginForm("ResetCourseRegistration", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.studentModel.MatricNumber, "Matric Number", htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.TextBoxFor(model => model.studentModel.MatricNumber, new {@class = "form-control", @placeholder = "Enter Matric Number"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new {@class = "control-label col-md-2"}) <div class="col-md-6"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Reset" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.StaffDataViewModel @{ ViewBag.Title = "View Class List"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); }) </script> @using (Html.BeginForm("Report", "StaffProfile", new { area = "Admin" }, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>Staff Details Report</h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Staff.Department.Id, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Staff.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @required = "required" }) @Html.ValidationMessageFor(model => model.Staff.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Get Report" /> </div> </div> </div> </div> } @if (Model != null && Model.StaffList != null && Model.StaffList.Count > 0) { <div class="col-md-12"> <table id="myTable" class="table table-bordered table-hover table-striped"> <thead> <tr> <th>Full Name</th> <th>Designation</th> <th>Department</th> <th>Sex</th> <th>State of Origin</th> <th>Local Government Area</th> <th>Phone</th> <th>Email</th> <th>Date Of Present Appointment</th> <th>Date Of Retirement</th> <th>Grade Level</th> </tr> </thead> <tbody style="color: black;"> @for (int itemIndex = 0; itemIndex < Model.StaffList.Count; itemIndex++) { <tr> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.FullName)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Designation.Name)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Department.Name)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.Sex.Name)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.State.Name)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.LocalGovernment.Name)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.MobilePhone)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].Person.Email)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].DateOfPresentAppointment.ToString())</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].DateOfRetirement)</td> <td>@Html.DisplayTextFor(m => m.StaffList[itemIndex].GradeLevel.Name)</td> </tr> } </tbody> </table> </div> } <file_sep>@model Abundance_Nk.Model.Entity.MIGRATION_APPLICANTS @{ ViewBag.Title = "Details"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Details</h2> <div> <h4>MIGRATION_APPLICANTS</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.JAMB_REG_NO) </dt> <dd> @Html.DisplayFor(model => model.JAMB_REG_NO) </dd> <dt> @Html.DisplayNameFor(model => model.NAMES) </dt> <dd> @Html.DisplayFor(model => model.NAMES) </dd> <dt> @Html.DisplayNameFor(model => model.STATE) </dt> <dd> @Html.DisplayFor(model => model.STATE) </dd> <dt> @Html.DisplayNameFor(model => model.LGA) </dt> <dd> @Html.DisplayFor(model => model.LGA) </dd> <dt> @Html.DisplayNameFor(model => model.FIRST_CHOICE) </dt> <dd> @Html.DisplayFor(model => model.FIRST_CHOICE) </dd> <dt> @Html.DisplayNameFor(model => model.SCORE) </dt> <dd> @Html.DisplayFor(model => model.SCORE) </dd> <dt> @Html.DisplayNameFor(model => model.QUALIFICATION_1) </dt> <dd> @Html.DisplayFor(model => model.QUALIFICATION_1) </dd> <dt> @Html.DisplayNameFor(model => model.QUALIFICATION_2) </dt> <dd> @Html.DisplayFor(model => model.QUALIFICATION_2) </dd> <dt> @Html.DisplayNameFor(model => model.DEPARTMENT) </dt> <dd> @Html.DisplayFor(model => model.DEPARTMENT) </dd> </dl> </div> <p> @Html.ActionLink("Edit", "Edit", new { id = Model.SNO }) | @Html.ActionLink("Back to List", "Index") </p> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel @{ ViewBag.Title = "GenerateChangeOfCourseInvoice"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h4>Enter your application form number</h4> @using (Html.BeginForm("GenerateChangeOfCourseInvoice", "Admission", new {Area = "Applicant"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.ApplicationForm.Number, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.ApplicationForm.Number, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(m => m.ApplicationForm.Number, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-default" /> </div> </div> </div> </div> }<file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Ionic.Zip; namespace Abundance_Nk.Web.Reports.Presenter { public partial class AcceptanceCount : System.Web.UI.Page { List<Department> departments; protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public Session SelectedSession { get { return new Session() { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } private void DisplayReport(Session session) { try { PaymentLogic paymentLogic = new PaymentLogic(); var report = paymentLogic.GetAcceptanceCount(session, txtBoxDateFrom.Text, txtBoxDateTo.Text); string bind_dsStudentPaymentSummary = "DataSet"; string reportPath = @"Reports\AcceptanceCountReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Acceptance Report "; ReportViewer1.LocalReport.ReportPath = reportPath; if (report != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentPaymentSummary.Trim(), report)); ReportViewer1.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } protected void Display_Button_Click(object sender, EventArgs e) { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } DisplayReport(SelectedSession); } } }<file_sep>@model Abundance_Nk.Web.Models.RefereeFormViewModel @{ ViewBag.Title = "View Applicant Referees"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script type="text/javascript"> $(function () { $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <br /> <div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <div style="background: #fff;padding: 20px;margin-top:30px;"> <div class="col-md-12"> <div class="form-group"> <h5 class="text-center" style="padding: 10px 5px;background:whitesmoke;border-radius: 20% !important;"> Referee List For: <span class="text-success">@Model.CandidateName</span> </h5> </div> </div> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th> SN </th> <th> Referee Name </th> <th> Rank </th> <th> Department </th> <th> Institution </th> <th>Response</th> <th></th> </tr> </thead> <tbody> @for (int i = 0; i < Model.ApplicantReferees.Count(); i++) { int sn = i + 1; <tr> <td>@sn</td> <td>@Model.ApplicantReferees[i].RefereeName.ToUpper()</td> <td>@Model.ApplicantReferees[i].Rank.ToUpper()</td> <td>@Model.ApplicantReferees[i].Department.ToUpper()</td> <td>@Model.ApplicantReferees[i].Institution.ToUpper()</td> <td>@Model.ApplicantReferees[i].RespondedTo</td> <td> @if (Model.ApplicantReferees[i].IsRespondedTo) { <a target="_blank" href="@Url.Action("ViewRefereePrintOut", "PostGraduateForm", new { Id = Model.ApplicantReferees[i].RefereeId })" class="btn btn-success">View Reference</a> } else { <h5>No Preview available</h5> } </td> </tr> } </tbody> </table> </div> <div class="panel-footer"> <a class="pull-right btn btn-primary" href="@Url.Action("ViewMultitplePrintOuts", "PostGraduateForm", new { Id = Model.ApplicationFormId })">Preview All References</a> </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">UTME Details</div> </div> <div class="panel-body"> @if(Model.ApplicationFormSetting.Id == 6 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10) { <div class="row"> <div class="col-md-6 custom-text-black"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.InstitutionChoice.Name) </div> </div> </div> </div> } else { <div class="row"> <div class="col-md-6 custom-text-black"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.JambScore) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.InstitutionChoice.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.Label("English") </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.Subject1.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.Subject2.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.Subject3.Name) </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-5"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4) </div> <div class="col-md-7 text-bold custom-text-black"> @Html.DisplayFor(model => model.ApplicantJambDetail.Subject4.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> </div> </div> </div> } </div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "Manage E-Learning Course Content"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> @*@section Scripts {*@ <link href="~/Content/jquery-ui-1.10.3.css" rel="stylesheet" /> <link href="~/Content/sweetalert.css" rel="stylesheet" /> @*@Scripts.Render("~/bundles/jquery")*@ <script type="text/javascript"> $(document).ready(function() { if ($("#courseAllocated").val() > 0) { $('#btnModal').show(); } //Programme Drop down Selected-change event $("#Programme").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $("#Session").change(function() { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); $("#Semester").change(function() { if ($("#Session").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { //populateCourses(); populateAllocatedCourses($("#Session").val(), $("#Semester").val(), $("#Level").val()); } }); $("#Session").change(function() { if ($("#Session").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { //populateCourses(); populateAllocatedCourses($("#Session").val(), $("#Semester").val(), $("#Level").val()); } }); $("#Level").change(function() { if ($("#Session").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { //populateCourses(); populateAllocatedCourses($("#Session").val(), $("#Semester").val(), $("#Level").val()); } }); $("#courseAllocated").change(function () { if ($("#courseAllocated").val() > 0) { $('#btnModal').show(); } }); $('#btnModal').on('click', function () { $('#editeModal').modal('show'); }); $('#btnCreate').on('click', function () { $('.Load').show(); var courseTopic = $('#topic').val(); var description = $('#description').val(); var active = false; var from = $('#fromDate').val(); var to = $('#toDate').val(); var fromtime = $('#fromTime').val(); var totime = $('#toTime').val(); var courseAllocationId = $('#courseAllocated').val(); if ($('#active').is(':checked')) { active = true; } $('#econtentType').empty(); $.ajax({ type: 'POST', url: '@Url.Action("CreateTopic", "Elearning")', // Calling json method dataType: 'json', data: { topic: courseTopic, coursedescription: description, active: active, to: to, from: from, courseAllocationId: courseAllocationId, fromtime: fromtime, totime: totime }, success: function (result) { if (!result.IsError) { var topics = result.EContentTypes; $("#econtentType").append('<option value="' + 0 + '">' + '-- Select Topic --' + '</option>'); $.each(topics, function (i, topic) { $("#econtentType").append('<option value="' + topic.Id + '">' + topic.Name + '</option>'); }); swal({ title: "success", text: result.Message, type: "success" }); } else { swal({ title: "info", text: result.Message, type: "success" }); } $('#editeModal').modal('hide'); $('.Load').hide(); }, error: function (ex) { $('#editeModal').modal('hide'); $('.Load').hide(); alert('Failed to Create Topic.' + ex); } }); return false; }); }); function populateAllocatedCourses(sessionId,semesterId,levelId) { $("#courseAllocated").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetAllocatedCourses", "Elearning")', // Calling json method traditional: true, data: { sessionId,levelId,semesterId }, success: function(courses) { $("#courseAllocated").append('<option value="' + 0 + '">' + '-- Select Course --' + '</option>'); $.each(courses, function (i, course) { $("#courseAllocated").append('<option value="' + course.Value + '">' + course.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } function DeleteTopic(id) { var response = confirm("Are you sure You want to Delete Topic?"); if (response) { $.ajax({ type: 'POST', url: '@Url.Action("DeleteTopic", "Elearning")', // Calling json method traditional: true, data: { id }, success: function (result) { if (!result.isError && result.Message) { alert(result.Message); location.reload(true); } }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } else { return false; } } </script> @using (Html.BeginForm("ManageCourseContent", "Elearning", new { area = "Admin" }, FormMethod.Post)) { <div class="card "> <div class="card-header"> <h3 class="card-title"><i class="fa fa-fw fa-download"></i>E-Learning Course Topic Module</h3> </div> <div class="card-body"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @id = "Session", requiredt = true }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @id = "Semester", requiredt = true }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level", requiredt = true }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.CourseAllocationId, "Allocated Course(s)", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CourseAllocationId, (IEnumerable<SelectListItem>)ViewBag.AllocatedCourse, new { @class = "form-control", @id = "courseAllocated", requiredt = true }) @Html.ValidationMessageFor(model => model.CourseAllocationId, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="View" /> </div> <div><button type="button" class="pull-right btn btn-info fa fa-plus" id="btnModal" style="display:none">Create Topic</button></div> </div> </div> </div> } <br /> <div class="card"> @if (Model.EContentTypeList != null && Model.EContentTypeList.Count() > 0) { <div class="card-body"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th colspan="6">@Model.EContentTypeList.FirstOrDefault().CourseAllocation.Course.Code - @Model.EContentTypeList.FirstOrDefault().CourseAllocation.Course.Name - @Model.EContentTypeList.FirstOrDefault().CourseAllocation.Department.Name </th> </tr> <tr> <th> Topic </th> <th> Description </th> <th> Schedule Between </th> <th> Status </th> <th> </th> <th> </th> </tr> @for (int i = 0; i < Model.EContentTypeList.Count(); i++) { <tr> <td> @Model.EContentTypeList[i].Name </td> <td> @Model.EContentTypeList[i].Description </td> <td> @Model.EContentTypeList[i].StartTime.ToString() - @Model.EContentTypeList[i].EndTime.ToString() </td> @if (Model.EContentTypeList[i].Active) { <td>Active</td> } else { <td>Not Active</td> } <td> @Html.ActionLink("Edit", "EditEContentType", "Elearning", new { Area = "Admin", eContentTypeId = Utility.Encrypt(Model.EContentTypeList[i].Id.ToString()) }, new { @class = "btn btn-info " }) </td> <td> <button class="btn btn-primary" onclick="DeleteTopic(@Model.EContentTypeList[i].Id)">Delete</button> @*@Html.ActionLink("View Content", "ViewContent", "Elearning", new { Area = "Admin", cid = Utility.Encrypt(Model.CourseAllocations[i].Id.ToString()) }, new { @class = "btn btn-primary " })*@ </td> </tr> } </table> </div> } </div> <div class="modal fade" role="dialog" id="editeModal" style="z-index:999999999"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" style="float:right">&times;</button> <h4 class="modal-title">Create Course Topic</h4> </div> <div class="modal-body"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Name, "Topic", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EContentType.Name, new { @class = "form-control", require = true, Id = "topic", placeholder = "Components of Computers" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Name) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Description, "Description", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EContentType.Description, new { @class = "form-control", require = true, Id = "description", placeholder = "These are the Systems that make up a computer" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Description) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EContentType.Active, "Activate", new { @class = "control-label" }) @Html.CheckBoxFor(model => model.eCourse.EContentType.Active, new { require = true, Id = "active" }) @Html.ValidationMessageFor(model => model.eCourse.EContentType.Active) </div> <fieldset> <legend>Start Date and Time</legend> <div class=" row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.StartTime, "Date", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.StartTime, new { @class = "form-control", require = true, type = "date", id = "fromDate" }) @Html.ValidationMessageFor(model => model.eCourse.StartTime) </div> </div> <div class="col-md-6"> @Html.LabelFor(model => model.startTime, "Time", new { @class = "control-label" }) @Html.TextBoxFor(model => model.startTime, new { @class = "form-control", require = true, type = "time", id = "fromTime" }) @Html.ValidationMessageFor(model => model.startTime) </div> </div> </fieldset> <fieldset> <legend>Stop Date and Time</legend> <div class=" row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EndTime, "Date", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EndTime, new { @class = "form-control", require = true, type = "date", id = "toDate" }) @Html.ValidationMessageFor(model => model.eCourse.EndTime) </div> </div> <div class="col-md-6"> @Html.LabelFor(model => model.endTime, "Time", new { @class = "control-label" }) @Html.TextBoxFor(model => model.endTime, new { @class = "form-control", require = true, type = "time", id = "toTime" }) @Html.ValidationMessageFor(model => model.endTime) </div> </div> </fieldset> @*<div class="form-group"> @Html.LabelFor(model => model.eCourse.StartTime, "From", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.StartTime, new { @class = "form-control", require = true, type = "dateTime-local", id = "fromDate" }) @Html.ValidationMessageFor(model => model.eCourse.StartTime) </div> <div class="form-group"> @Html.LabelFor(model => model.eCourse.EndTime, "To", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eCourse.EndTime, new { @class = "form-control", require = true, type = "dateTime-local", id = "toDate" }) @Html.ValidationMessageFor(model => model.eCourse.EndTime) </div>*@ </div> <div class="modal-footer form-group"> <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> <button type="submit" id="btnCreate" class="btn btn-success">Save</button> </div> </div> </div> </div><file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using Abundance_Nk.Web.Models.Intefaces; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class MasterSheetHOD :Page,IReport { public SessionSemester SelectedSession { get { return new SessionSemester { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Level Level { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public int Type { get { return Convert.ToInt32(rblSortOption.SelectedValue); } set { rblSortOption.SelectedValue = value.ToString(); } } public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } public int ReportType { get { throw new NotImplementedException(); } } protected void Page_Load(object sender,EventArgs e) { try { Message = ""; if(!IsPostBack) { rblSortOption.SelectedIndex = 0; ddlDepartment.Visible = false; PopulateAllDropDown(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void DisplayReportBy(SessionSemester session,Level level,Programme programme,Department department, int type) { try { var resultLogic = new StudentResultLogic(); List<Model.Model.Result> resultList = resultLogic.GetMaterSheetDetailsBy(session,level,programme, department); string reportPath = ""; string bind_ds = "dsMasterSheet"; if(type == 1) { reportPath = @"Reports\Result\MasterGradeSheet.rdlc"; } else { reportPath = @"Reports\Result\MasterGradeSheet.rdlc"; } rv.Reset(); rv.LocalReport.DisplayName = "Student Master Sheet"; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; string programmeName = programme.Id > 2 ? "Undergraduate" : "PostGraduate"; var programmeParam = new ReportParameter("Programme",programmeName); var departmentParam = new ReportParameter("Department",department.Name); var sessionSemesterParam = new ReportParameter("SessionSemester",session.Name); ReportParameter[] reportParams = { departmentParam,programmeParam,sessionSemesterParam }; rv.LocalReport.SetParameters(reportParams); if(resultList != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(),resultList)); rv.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessionSemesters(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if(Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch(Exception) { throw; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { if(InvalidUserInput()) { return; } DisplayReportBy(SelectedSession,Level,Programme,Department,Type); } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { try { if(Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { var loggeduser = new UserLogic(); var user = loggeduser.GetModelBy(u => u.User_Name == User.Identity.Name); if (user != null && user.Id > 0) { StaffLogic staffLogic = new StaffLogic(); Staff staff = staffLogic.GetBy(user.Id); if (staff != null && staff.Id > 0) { List<Department> departments; if ((bool)staff.isManagement) { departments = Utility.PopulateDepartmentByFacultyId(staff.Department.Faculty.Id); } else { departments = Utility.PopulateDepartmentById(staff.Department.Id); } //List<Department> departments = Utility.GetDepartmentByProgramme(programme); if (departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID,Utility.NAME); ddlDepartment.Visible = true; } } } } catch(Exception ex) { lblMessage.Text = ex.Message; } } } }<file_sep>@using Microsoft.AspNet.Identity <!DOCTYPE html> <html lang="en"> <head> <title>UNIPORT | Student Portal</title> <!-- Fonts and icons --> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" /> <!-- CSS Files --> <link href="~/Content/assets/css/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/assets/css/now-ui-kit.css" rel="stylesheet" /> <link href="~/Content/assets/css/wfmi-style.css" rel="stylesheet" /> <link href="~/Content/index.css" rel="stylesheet" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <style> .nav-item:hover { /*background: #e2a03f !important*/ } .navbar ul li a:hover { /*background-color: #e2a03f !important*/ } </style> </head> <body> <div class="container-fluid"></div> <div class="col-md-12 bodi1 m-0 p-0"> <!-- Image and text --> <nav class="navbar navbar-toggleable-md navbar-expand-lg bg-primary p-0" color-on-scroll="500"> <div class=" pl-2" style="width: 100%;"> <div class="row"> <div class="col-md-3 col-sm-12"> <div class="navbar-translate"> <button class="navbar-toggler navbar-toggler-right" type="button" onclick="w3_open()" data-toggle="collapse" data-target="#navigation" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-bar bar1"></span> <span class="navbar-toggler-bar bar2"></span> <span class="navbar-toggler-bar bar3"></span> </button> <a class="navbar-brand ml-2" href="#"> <img src="~/Content/Images/school_logo.png" style='height: 50px; width: 60px; object-fit: contain' alt="NAU" /> @*<span class="hidden-xs"><img src="~/Content/Images/abiastate.png" alt=" NAU" style="height: 50px; width: 100px;" /></span>*@ <h6 style="font-size: 16px" class="d-inline mb-0" >University Of Port-Harcourt</h6> </a> </div> </div> <div class="col-md-9 col-sm-12 text-right pt-2"> <div class="collapse navbar-collapse justify-content-end" id="mySidebar" data-nav-image="assets/img/blurred-image-1.jpg"> @*id="navigation"*@ <ul class="navbar-nav mySidebar" style="z-index:2147483647"> <li class="nav-item"> <a class="nav-link" href="https://www.web.unizik.edu.ng"><span class="menu-title">WEBSITE</span></a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">APPLICANTS</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "PostJambFormInvoiceGeneration", "Form", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Fill Application Form", "PostJambProgramme", "Form", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check PUTME Result", "Index", "Screening", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Purchase Admission Status Card", "PurchaseCard", "Admission", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Check Admission Status", "CheckStatus", "Admission", new { Area = "Applicant" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Request For Hostel Allocation", "CreateHostelRequest", "Hostel", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Hostel Allocation Status", "HostelAllocationStatus", "Hostel", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">RETURNING STUDENT</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Session Registration", "Logon", "Registration", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check Semester Result", "Check", "Result", new { Area = "Student" }, null)</li> <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Old Fees", "OldFees", "Payment", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Print Receipt", "PrintReceipt", "Registration", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">REMEDIAL STUDIES</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">POST GRADUATE SCHOOL</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Generate Application Form Invoice", "PostGraduateApplicationInvoiceGeneration", "Form", new { Area = "PGApplicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Fill Application Form", "Index", "PostGraduateForm", new { Area = "Applicant" }, null)</li> @*<li class="dropdown-item">@Html.ActionLink("Generate Invoice", "Index", "Payment", new { Area = "Student" }, null)</li>*@ <li class="divider"></li> <li class="dropdown-item">@Html.ActionLink("Check Admission Status", "PGCheckStatus", "PGAdmission", new { Area = "Applicant" }, null)</li> <li class="divider"></li> @*<li class="dropdown-item">@Html.ActionLink("Old Fees", "OldFees", "Payment", new { Area = "Student" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Print Receipt", "PrintReceipt", "Registration", new { Area = "Student" }, null)</li>*@ </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"><span class="menu-title">GRADUATE</span></a> <ul class="dropdown-menu bg-primary" aria-labelledby="dropdown" style="color: #333 !important;"> <li class="dropdown-item">@Html.ActionLink("Apply for Transcript", "Index", "Transcript", new { Area = "Applicant" }, null)</li> <li class="dropdown-item">@Html.ActionLink("Generate Transcript Receipt", "PayForTranscript", "Transcript", new { Area = "Applicant" }, null)</li> </ul> </li> </ul> <div class="col-md-2 bg-warning hidden-md-down text-center pt-4" style="margin:-12px 0 -20px 0"> @using (Html.BeginForm("LogOff", "Account", new { Area = "Security" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { if (Request.IsAuthenticated) { <span class="navbar-text"> <button style="background: transparent; color: #fff; border: none;">LOG OFF</button> </span> } } @using (Html.BeginForm("Login", "Account", new { Area = "Security" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { @Html.AntiForgeryToken() if (!Request.IsAuthenticated) { <span class="navbar-text"> <button style="background: transparent; color: #fff; border: none;"> LOGIN </button> </span> } } </div> </div> </div> </div> </div> </nav> <!-- End Navbar --> <div class="clearfix"></div> <div class="" id="wapper"> <div class="min-vh-70 portal-content"> @RenderBody() </div> <div class="container-fluid pt-5 pb-5 mt-5 Design2"> <div class="container"> <div class="row justify-content-center"> <div class="col-md-7 col-sm-12 pt-1 text-center"> <span class="font-1 text-center"><b>ARE YOU EXPERIENCING ANY DIFFICULTIES OR ISSUES?</b></span><br /> <b>CALL:</b> 07088391544 or 090838920222<br /> <b>EMAIL SUPPORT:</b> <EMAIL> </div> </div> </div> </div> <div class="clearfix"></div> <div class="container-fluid bg-warning line-1"></div> <div class="container-fluid bg-primary py-3 pl-5 pr-5"> <div class="row"> <div class="col-md-8 col-sm-12"> &copy; UNIVERSITY OF PORT-HARCOURT </div> <div class="col-md-4 col-sm-12 text-right"> Powered by <img class="image" style="height: 30px; width: 30px" src="~/Content/images/lloydant.png" /> </div> </div> </div> </div> </div> <script src="~/Scripts/js/core/jquery.3.2.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="~/Scripts/js/core/bootstrap.min.js"></script> <script src="~/Scripts/dashboard.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> //var _smartsupp = _smartsupp || {}; //_smartsupp.key = "8d8c5c64fa82b02ea860a7f80d5a93c351259935"; // //_smartsupp.cookieDomain = '.<EMAIL>'; // _smartsupp.requireLogin = true; // disable email // _smartsupp.loginEmailControl = false; // append checkbox control to confirm something //_smartsupp.loginControls = [ // { // xtype: 'textinput', // name: 'number', // label: 'Phone', // required: true // }, { // xtype: 'textinput', // name: 'identifier', // label: 'Application / Matric No', // required: true // } //]; //window.smartsupp || (function (d) { // var s, c, o = smartsupp = function () { o._.push(arguments); }; // o._ = []; // s = d.getElementsByTagName('script')[0]; // c = d.createElement('script'); // c.type = 'text/javascript'; // c.charset = 'utf-8'; // c.async = true; // c.src = '//www.smartsuppchat.com/loader.js'; // s.parentNode.insertBefore(c, s); //})(document); </script> <!-- End of Smartsupp Live Chat script --> <script> // customize banner & logo //smartsupp('banner:set', 'bubble'); // customize texts //smartsupp('chat:translate', { // online: { // title: 'Support', // infoTitle: 'LLOYDANT' // }, // offline: { // title: 'OFFLINE' // } //}); // customize colors //smartsupp('theme:colors', { // primary: '#b78825', // banner: '#999999', // primaryText: '#ffffff' //}); </script> <!--New Chat box--> <!--Start of Tawk.to Script--> <script type="text/javascript"> var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date(); (function () { var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0]; s1.async = true; s1.src = 'https://embed.tawk.to/5e1c9b0b7e39ea1242a465b4/1eojovc27'; s1.charset = 'UTF-8'; s1.setAttribute('crossorigin', '*'); s0.parentNode.insertBefore(s1, s0); })(); </script> <!--End of Tawk.to Script--> </body> @RenderSection("scripts", required: false) </html> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "ViewUnoccupiedAllocations"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script type="text/javascript"> function ActivateAll() { if ($('#ActivateAllId').is(':checked')) { $('.Activate').prop('checked', true); } else { $('.Activate').prop('checked', false); } } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Un-Occupied Allocations</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewUnoccupiedAllocations", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="form-group"> @Html.LabelFor(m => m.Session.Name, "Session:", new { @class = "col-md-2 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.Session.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <br/> <div class="panel-body"> @if (Model.HostelAllocations != null && Model.HostelAllocations.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> @using (Html.BeginForm("DeleteUnoccupiedAllocations", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post)) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> SN </th> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Bed Space </th> <th> Name Of Student </th> <th> Matric Number </th> <th> Date of Allocation </th> <th> <input type="checkbox" id="ActivateAllId" onclick="ActivateAll()" /> Select </th> </tr> @for (int i = 0; i < Model.HostelAllocations.Count; i++) { var SN = i + 1; <tr> @Html.HiddenFor(model => model.HostelAllocations[i].Id) <td> @SN </td> <td> @Model.HostelAllocations[i].Hostel.Name </td> <td> @Model.HostelAllocations[i].Series.Name </td> <td> @Model.HostelAllocations[i].Room.Number </td> <td> @Model.HostelAllocations[i].Corner.Name </td> @if (Model.HostelAllocations[i].Student != null) { <td> @Model.HostelAllocations[i].Student.FullName </td> <td> @Model.HostelAllocations[i].Student.MatricNumber </td> } else { <td> @Model.HostelAllocations[i].Person.FullName </td> <td> NIL </td> } <td> @Model.HostelAllocations[i].Payment.DatePaid.ToLongDateString() </td> <td> @Html.CheckBoxFor(m => m.HostelAllocations[i].Occupied, new { @type = "checkbox", @class = "Activate" }) </td> </tr> } </table> <br /> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Delete" class="btn btn-success" /> </div> </div> } </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Model.Model.GstScan @{ ViewBag.Title = "EditGstScanResult"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @section Scripts{ @Scripts.Render(("~/bundles/jquery")) <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/sweetalert.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script type="text/javascript"> $(document).ready(function () { $(".Load").hide(); }); function showBusy() { $(".Load").show(); } </script> } <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("SaveEditedGstResult", "UploadGstScanResult", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.HiddenFor(model => model.Id) @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <div class="alert alert-success text-white" style="text-align: center"> <h3> <b>Edit Gst Result</b> </h3> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Name, "Name", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control", id = "idEdit",disable ="disable" }) @Html.ValidationMessageFor(model => model.Name) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.MatricNumber, "Matric Number", new { @class = "control-label" }) @Html.TextBoxFor(model => model.MatricNumber, new { @class = "form-control", id = "idEdit" }) @Html.ValidationMessageFor(model => model.MatricNumber) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.RawScore, "Raw Score", new { @class = "control-label" }) @Html.TextBoxFor(model => model.RawScore, new { @class = "form-control", id = "idEdit" }) @Html.ValidationMessageFor(model => model.RawScore) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Ca, "CA", new { @class = "control-label" }) @Html.TextBoxFor(model => model.Ca, new { @class = "form-control", id = "idEdit" }) @Html.ValidationMessageFor(model => model.Ca) </div> </div> </div> <br /> <br /> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <button onclick="showBusy()" class="btn btn-success mr5" type="submit" name="submit" id="submit"><i class="fa fa-eye"> Save </i></button><span class="Load"><img src="~/Content/Images/loading4.gif" /></span> </div> </div> </div> </div> } </div> </div> </div> <file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Web.Areas.Admin.ViewModels.AdmissionProcessingViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*@section Scripts { @Scripts.Render("~/bundles/jqueryval") }*@ <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> @*<link href="~/Content/pretty-menu.css" rel="stylesheet" />*@ <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#buttons").hide(); $('#divDisabledDetails').show(); $('#divDetails').hide(); //BindSelectAll(); BindSelectOne(); $('#btnAccept').prop('disabled', true); $('#btnReject').prop('disabled', true); $("#btnAccept").click(function() { checkedIds = $(".ckb").filter(":checked").map(function() { return this.id; }); var rejected = false; var selectedSession = $("#Session_Id").val(); if (selectedSession == "" || undefined) { alert("No Session selected! Please select Session."); return; } $.ajax({ type: "POST", url: "@Url.Action("AcceptOrReject", "AdmissionProcessing")", traditional: true, data: { ids: checkedIds.toArray(), sessionId: selectedSession, isRejected: rejected }, beforeSend: function() { $("#processing").show(); }, complete: function() { $("#processing").hide(); }, success: SuccessFunc, error: ErrorFunc, }); function SuccessFunc(data, status) { $("#data").html(data); //BindSelectAll(); BindSelectOne(); } function ErrorFunc() { alert("Operation failed!"); } }); $("#btnReject").click(function() { checkedIds = $(".ckb").filter(":checked").map(function() { return this.id; }); var rejected = true; var selectedSession = $("#Session_Id").val(); if (selectedSession == "" || undefined) { alert("No Session selected! Please select Session."); return; } $.ajax({ type: "POST", url: "@Url.Action("AcceptOrReject", "AdmissionProcessing")", traditional: true, data: { ids: checkedIds.toArray(), sessionId: selectedSession, isRejected: rejected }, beforeSend: function() { $("#processing").show(); }, complete: function() { $("#processing").hide(); }, success: SuccessFunc, error: ErrorFunc, }); function SuccessFunc(data, status) { $("#data").html(data); //BindSelectAll(); BindSelectOne(); } function ErrorFunc() { alert("Operation failed!"); } }); $("#find").click(function() { if ($("#rdYesRadio").is(':checked')) { rejected = true; } else { rejected = false; } var session = $("#Session_Id").val(); if (session == "" || undefined) { alert("No Session selected! Please select Session."); return; } $.ajax({ type: "POST", url: "@Url.Action("FindBy", "AdmissionProcessing")", traditional: true, data: { sessionId: session, isRejected: rejected }, beforeSend: function() { $("#loading").show(); }, complete: function() { $("#loading").hide(); }, success: SuccessFunc, error: ErrorFunc, }); function SuccessFunc(data) { $("#data").html(data); $("#buttons").show(); //BindSelectAll(); BindSelectOne(); } function ErrorFunc() { alert("Operation failed!"); } }); //function BindSelectAll() { // if ($("#rdYesRadio").is(':checked')) { // rejected = true; // } // else { // rejected = false; // } // $("#selectAll").click(function (event) { // if (this.checked) { // $(".ckb").each(function () { // this.checked = true; // if (rejected) { // $('#btnAccept').prop('disabled', false); // $('#btnReject').prop('disabled', true); // } // else { // $('#btnReject').prop('disabled', false); // $('#btnAccept').prop('disabled', true); // } // }); // $('#divDisabledDetails').hide(); // $('#divDetails').show(); // } // else { // $(".ckb").each(function () { // this.checked = false; // $('#btnAccept').prop('disabled', true); // $('#btnReject').prop('disabled', true); // }); // $('#divDisabledDetails').show(); // $('#divDetails').hide(); // } // }); //} function BindSelectOne() { $(".ckb").click(function(event) { if (this.checked) { $('#divDisabledDetails').hide(); $('#divDetails').show(); checkedIds = $(".ckb").filter(":checked").map(function() { return this.id; }); $('#txtApplicationFormNumber').val(checkedIds[0]); $("#hfApplicationFormNumber").val(checkedIds[0]); alert($("#hfApplicationFormNumber").val()); } else { $('#divDisabledDetails').show(); $('#divDetails').hide(); } }); } $('.mnu').click(function(e) { e.preventDefault(); $('#vwViewDetails').submit(); //alert('wow!'); }); }); </script> @*<h3> Clear Applicant </h3>*@ <div class="row"> <div class="col-md-12"> <div class="panel panel-success"> <div class="panel-heading"> <h3>This interface enables Admission Officer to Clear Applicant</h3> <p> Kindly enter Applicant's Application Number in the field provided below and Click the Search button. The system will search and display the Applicant's detail if he/she has completed the Admission process. </p> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default"> <div class="panel-body "> <div class="form-inline "> <div class="form-group"> <span style="font-size: 11pt">Please enter Application Number</span> </div> <div class="form-group"> @Html.TextBoxFor(m => m.Session.Name, new {@class = "form-control", @placeholder = "Enter Application Number"}) <button class="btn btn-default btn-metro mr5" type="button" name="btnSearch" id="btnSearch" value="Search">Search</button> </div> <div class="form-group"> <div id="loading" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Loading ...</span> </div> </div> </div> </div> </div> <div> @if (Model != null && Model.Applicants.Count > 0) { <table class="table table-condensed table-responsive grid-table table-head-alt mb30"> <thead> <tr class="well" style="height: 35px; vertical-align: middle"> <th> @Html.CheckBox("selectAll") </th> <th> Links </th> <th> Form Number </th> <th> Name </th> <th> Reject Reason </th> </tr> </thead> @foreach (Applicant item in Model.Applicants) { <tr> <td> @Html.CheckBox(" ", false, new {@class = "ckb", id = item.ApplicationForm.Id}) </td> <td> <ul class="nav navbar-nav2 "> <li class="dropdown"> <a style="padding: 1px;" class="dropdown-toggle" data-toggle="dropdown" href="#">View Details<span></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li>@Html.ActionLink("Application Form", "ApplicationForm", "AdmissionProcessing", new {Area = "Admin", fid = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li>@Html.ActionLink("PUTME Result Slip", "Index", "PostUtmeResult", new {Area = "Applicant", fid = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> <li>@Html.ActionLink("Admission Letter", "AdmissionLetter", "Admission", new {Area = "Applicant", fid = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> <li>@Html.ActionLink("Acceptance Receipt", "Receipt", "Admission", new {Area = "Applicant", ivn = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li>@Html.ActionLink("School Fees Receipt", "Receipt", "Admission", new {Area = "Applicant", ivn = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> <li class="divider"></li> <li>@Html.ActionLink("Student Form", "StudentForm", "AdmissionProcessing", new {Area = "Admin", fid = item.ApplicationForm.Id}, new {target = "_blank", style = "line-height:5px; font-size:10pt; margin-bottom:5px"})</li> </ul> </li> </ul> </td> <td> @Html.DisplayFor(modelItem => item.ApplicationForm.Number) </td> <td> @Html.DisplayFor(modelItem => item.Person.FullName) </td> <td> </td> </tr> } </table> @*</div>*@ } </div> } </div> @*<div class="col-md-3"> @using (Html.BeginForm("ViewDetails", "AdmissionProcessing", FormMethod.Post, new { id = "vwViewDetails", target = "_blank" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.Hidden("hfApplicationFormNumber", null, new { id = "hfApplicationFormNumber" }) <div class="panel panel-default"> <div id="divDetails" class="panel-body"> <ul class="leftmenu"> <li> <a href="#gettingstarted">View Applicant's Details</a> <ul class="children"> <li class="mnu">@Html.ActionLink("Application Form", "Index", "PersonType", new { Area = "Admin", mid = 1 } )</li> <li class="mnu">@Html.ActionLink("PUTME Result Slip", "Index", "StudentType", new { Area = "Admin", mid = 2 })</li> <li class="mnu">@Html.ActionLink("Admission Notification", "Index", "Religion", new { Area = "Admin", mid = 3 })</li> <li class="mnu">@Html.ActionLink("Acceptance Receipt", "Index", "Relationship", new { Area = "Admin", mid = 4 })</li> <li class="mnu">@Html.ActionLink("Admission Letter", "Index", "FeeType", new { Area = "Admin", mid = 5 })</li> <li class="mnu">@Html.ActionLink("School Fees Receipt", "Index", "PaymentType", new { Area = "Admin", mid = 6 })</li> <li class="mnu">@Html.ActionLink("Bio Data form", "Index", "PaymentMode", new { Area = "Admin", mid = 7 }, new { target = "_blank" })</li> </ul> </li> </ul> </div> <input type="submit" /> <div id="divDisabledDetails" class="panel-body"> <ul class="leftmenu"> <li> <a class="disabledChildren">View Applicant's Details</a> <ul class="disabledChildren"> <li><a style="color:lightgray">Application Form</a></li> <li><a style="color:lightgray">PUTME Result Slip</a></li> <li><a style="color:lightgray">Admission Notification</a></li> <li><a style="color:lightgray">Acceptance Receipt</a></li> <li><a style="color:lightgray">Admission Letter</a></li> <li><a style="color:lightgray">School Fees Receipt</a></li> <li><a style="color:lightgray">Bio Data form</a></li> </ul> </li> </ul> </div> </div> } </div>*@ </div> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ChangeCourseViewModel @{ ViewBag.Title = "SearchResult"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var items = $('#StudentLevel_DepartmentOption_Id option').size(); if (items > 0) { $("#divDepartmentOption").show(); } else { $("#divDepartmentOption").hide(); } $("#AppliedCourse_Programme_Id").change(function() { var programme = $("#AppliedCourse_Programme_Id").val(); $("#AppliedCourse_Department_Id").empty(); //$("#AppliedCourse_Level_Id").empty(); $.ajax({ type: 'GET', url: '@Url.Action("GetDepartmentAndLevelByProgrammeId", "ChangeCourse")', dataType: 'json', data: { id: programme }, success: function(data) { var levels = data.Levels; var departments = data.Departments; if (departments != "" && departments != null && departments != undefined) { $("#AppliedCourse_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function(i, department) { $("#AppliedCourse_Department_Id").append('<option value="' + department.Id + '">' + department.Name + '</option>'); }); } }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); }); }) </script> @using (Html.BeginForm("GenerateInvoice", "ChangeCourse", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.ApplicationForm.Id) <div class="row"> <div class="col-md-12"> <div class="panel panel-success"> <div class="panel-heading"> <h2>Change of Course Invoice</h2> <p><b>Provide your Application Form Number, fill change of course form and then click the Generate Invoice button to generate your invoice.</b></p> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> </div> <div class="row"> <h3>Student Details</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.Person.FirstName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.Person.LastName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.Person.OtherName) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.ApplicationForm.Number, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.ApplicationForm.Number) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.AppliedCourse.Department.Name) </div> </div> </div> <div class="col-md-6"> <div class="form-group margin-bottom-3"> <div class="col-md-4"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name, new {@class = "control-label "}) </div> <div class="col-md-8 text-bold"> @Html.DisplayFor(model => model.AppliedCourse.Programme.Name) </div> </div> </div> <br /> </div> </div> <br /> </div> <div class="row"> <h3>Change of Course Form</h3> <hr style="margin-top: 0" /> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.AppliedCourse.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Programme.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.AppliedCourse.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Id, null, new {@class = "text-danger"}) </div> </div> </div> </div> <div class="col-md-1"></div> </div> <div class="panel-footer"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10 "> <div class="form-group"> <div class="col-md-12"> <input class="btn btn-success btn-lg mr5" type="submit" name="submit" id="submit" value="Next" /> </div> </div> </div> <div class="col-md-1"></div> </div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "StudentHostelAllocation"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Student Hostel Allocation</h4> </div> <div class="panel-body"> @using (Html.BeginForm("EditStudentHostelAllocation", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, new { @class = "control-label custom-text-black" }) @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.Student.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "ViewReservedRooms"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#Hostel").change(function () { $("#Series").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetHostelSeries", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Hostel").val() }, // Get Selected Campus ID. success: function (series) { $("#Series").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(series, function (i, series) { $("#Series").append('<option value="' + series.Value + '">' + series.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve series.' + ex); } }); return false; }); }) </script> <script type="text/javascript"> function ActivateAll() { if ($('#ActivateAllId').is(':checked')) { $('.Activate').prop('checked', true); } else { $('.Activate').prop('checked', false); } } </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Reserved Hostel Rooms</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewReservedRooms", "HostelAllocation", FormMethod.Post)) { @Html.AntiForgeryToken() <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocation.Hostel.Name, new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocation.Hostel.Id, (IEnumerable<SelectListItem>)ViewBag.HostelId, htmlAttributes: new { @class = "form-control", @required = "required", @id = "Hostel" }) @Html.ValidationMessageFor(model => model.HostelAllocationCriteria.Hostel.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.HostelAllocation.Series.Name, "Series/Floor", new { @class = "control-label custom-text-black" }) @Html.DropDownListFor(model => model.HostelAllocation.Series.Id, (IEnumerable<SelectListItem>)ViewBag.HostelSeriesId, htmlAttributes: new { @class = "form-control", @required = "required", @id = "Series" }) @Html.ValidationMessageFor(model => model.HostelAllocation.Series.Id, null, new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-6"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Submit" /> </div> </div> </div> </div> } </div> <div class="panel-body"> @if (Model.HostelRoomList != null && Model.HostelRoomList.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> @using (Html.BeginForm("ReleaseReservedRooms", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post)) { <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Room Name </th> <th> Hostel </th> <th> Series/Floor </th> <th> Allocate Room </th> <th> <input type="checkbox" id="ActivateAllId" onclick="ActivateAll()" /> Reserve </th> </tr> @for (int i = 0; i < Model.HostelRoomList.Count; i++) { <tr> @Html.HiddenFor(model => model.HostelRoomList[i].Id) <td> @Model.HostelRoomList[i].Number </td> <td> @Model.HostelRoomList[i].Hostel.Name </td> <td> @Model.HostelRoomList[i].Series.Name </td> <td> @Html.ActionLink("Allocate", "AllocateReservedRoom", "HostelAllocation", new { Area = "Admin", rid = Model.HostelRoomList[i].Id }, new { @class = "btn btn-success " }) </td> <td> @Html.CheckBoxFor(m => m.HostelRoomList[i].Reserved, new { @type = "checkbox", @class = "Activate" }) </td> </tr> } </table> <br /> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Make Available" class="btn btn-success" /> </div> </div> } </div> </div> } </div> </div> </div> <div class="col-md-1"></div> </div><file_sep> @using Abundance_Nk.Model.Model @using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.AdmissionViewModel @{ var generatedAcceptanceReceiptStatus = (int)ApplicantStatus.Status.GeneratedAcceptanceInvoice; } <h5 class="mt-1">GENERATE ACCEPTANCE RECEIPT</h5><hr /> <div class="container pl-0"> <div class="col-md-12 pl-0"> <div class="form-group "> @Html.LabelFor(model => model.AcceptanceInvoiceNumber, new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-12 text-bold pl-0 ml-0"> <b> @Html.DisplayFor(model => model.AcceptanceInvoiceNumber, new { @class = "form-control pl-0 ml-0", @readonly = "readonly" }) </b> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.AcceptanceConfirmationOrderNumber, new { @class = "pl-0 ml-0 col-sm-12" }) <div class="col-sm-12 text-bold pl-0 ml-0"> @Html.TextBoxFor(model => model.AcceptanceConfirmationOrderNumber, new { @class = "form-control pl-0 ml-0" }) </div> </div> <div class="form-group col-md-12 p-0"> <div class="row"> <div class="form-group col-md-6 ml-0"> <button class="btn btn-warning mr5" type="button" name="btnGenerateAcceptanceReceipt" id="btnGenerateAcceptanceReceipt" value="Next">Generate Receipt</button> </div> <div class="form-group col-md-6"> <div id="divProcessingAcceptanceReceipt" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> <div class="form-group"> <div class="col-sm-12" id="divGenerateAcceptanceReceipt"></div> </div> <div class="form-inline divAcceptanceReceipt" style="display: none"> <div class="form-group "> @Html.ActionLink("Print Receipt", "Receipt", new { ivn = Model.AcceptanceInvoiceNumber, fid = Model.ApplicationForm.Id, st = generatedAcceptanceReceiptStatus }, new { @class = "btn btn-primary btn-lg ", target = "_blank", id = "alPrintAcceptanceReceipt" }) @Html.ActionLink("Print Acceptance Letter", "AcceptanceLetter", "Credential", new { Area = "Common", fid = Utility.Encrypt(Model.ApplicationForm.Id.ToString()), pmid = Utility.Encrypt(Model.AcceptanceInvoiceNumber) }, new { @class = "btn btn-primary btn-lg ", target = "_blank", id = "alPrintAcceptanceReceipt" }) @*<button class="btn btn-primary btn-lg" type="button" name="btnAcceptanceReceiptNext" id="btnAcceptanceReceiptNext">Next Step</button>*@ </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.CourseRegistrationViewModel @{ ViewBag.Title = "Course Registration"; Layout = "~/Views/Shared/_Layout.cshtml"; } <br /> <div class="row"> <div class="col-md-4 " style="vertical-align: bottom"> <div class="panel panel-default well" style="height: 315px"> <div class="panel-body"> </div> </div> </div> <div class="col-md-8"> <div class="row"> <div class="col-md-12"> <h2>@ViewBag.Title</h2> </div> </div> <div class="row"> <div class="col-md-12"> <section id="loginForm"> @using (Html.BeginForm("Logon", "CourseRegistration", new {Area = "Student"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <h5>Please enter your <b>Matric. No.</b> and Scratch Card <b>PIN</b> below to fill your course form.</h5> <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(m => m.MatricNumber, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.TextBoxFor(m => m.MatricNumber, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(m => m.MatricNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.ScratchCard.Pin, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.PasswordFor(m => m.ScratchCard.Pin, new {@class = "form-control", required = "required"}) @Html.ValidationMessageFor(m => m.ScratchCard.Pin, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Login" class="btn btn-default" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") }<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "Submit Assignment"; Layout = "~/Areas/Student/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @using (Html.BeginForm("Submit", "Elearning", new { area = "Student" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div> <div class="panel"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>Assignment Submission Manager</h3> </div> <div class="panel-body"> @Html.HiddenFor(model => model.eAssignment.Id) <div class="row"> <div class="col-md-12"> <p>Assignment: @Model.eAssignment.Assignment</p> </div> <div class="col-md-12"> <p>Instruction: @Model.eAssignment.Instructions</p> </div> <div class="col-md-12"> <p>Course: @Model.eAssignment.Course.Name (@Model.eAssignment.Course.Code)</p> </div> <div class="col-md-12"> <div class="form-group"> @Html.LabelFor(model => model.TextSubmission, "Enter Test/Assignment Answer Directly ", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextAreaFor(model => model.TextSubmission, new { @class = "form-control", @cols = "120", @rows = "20" }) @Html.ValidationMessageFor(model => model.TextSubmission, null, new { @class = "text-danger" }) </div> </div> </div> <div class="form-group"> @Html.Label("File", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> <input type="file" accept="application/pdf" title="Upload Assignment" id="fileInput" name="file" class="form-control" /> </div> &nbsp; </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="Submit Assignmnet" /> </div> </div> </div> </div> </div> } <script> document.querySelector("#fileInput").addEventListener("change", (e) => { const fileEl = document.querySelector("#fileInput"); const file = e.target.files[0]; const fileType = file.type; const fileSize = file.size; if (fileSize > 1048576) { alert("File size is too much. Allowed size is 1MB") $("#fileInput").val(""); $("#fileInput").text(""); return false; } //If file type is Video, Return False; ask user to insert a youtube link if (fileType.split("/")[1] != "pdf") { alert("Only PDF is allowed!"); //Reset the file selector to application/pdf fileEl.setAttribute("accept", "application/pdf"); //Clear the inout type field $("#fileInput").val(""); $("#fileInput").text(""); //$('#videoUrl').show(); return false; } }) </script><file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Delete Religion"; } @Html.Partial("Setup/_Delete", @Model)<file_sep>@model Abundance_Nk.Model.Model.Receipt <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- Mirrored from wrappixel.com/ampleadmin/ampleadmin-html/email-templates/basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 31 May 2018 16:33:08 GMT --> <head> <meta name="viewport" content="width=device-width" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Admin Responsive web app kit</title> </head> <body style="margin: 0px; background: #f8f8f8;"> <div width="100%" style="background: #f8f8f8; padding: 0px 0px; font-family: arial; line-height: 28px; height: 100%; width: 100%; color: #514d6a;"> <div style="max-width: 700px; padding: 50px 0; margin: 0px auto; font-size: 14px"> <table cellspacing="0" cellpadding="0" border="0" style="color:#333;background:#fff;padding:0;margin:0;width:100%;font:15px/1.25em 'Helvetica Neue',Arial,Helvetica"> <tbody> <tr width="100%"> <td valign="top" align="left" style="background:#eef0f1;font:15px/1.25em 'Helvetica Neue',Arial,Helvetica"> <table style="border:none;padding:0 18px;margin:50px auto;width:500px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); border-radius: 10px;"> <tbody> <tr width="100%"> <td valign="top" align="left" style="background:#fff;"> <div style="border-radius:3px"> <br /> <table style="width:100%; text-align:left;"> <thead> <tr> <th scope="col"></th> </tr> </thead> <tbody style="box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important; border-radius: 10px;"> <tr width="100%" height="60"> <td valign="top" align="left" style="border-top-left-radius:4px;border-top-right-radius:4px; padding:21px 10px 18px;text-align:center; font-size:20px;"> <img src="https://portal.abiastateuniversity.edu.ng/Content/Images/school_logo1.png" height="60" /> </td> </tr> <tr style="border-bottom: 2px solid #ccc; text-align: center; padding: 10px; margin: 10px; font-size: 33px;"> <td> <br /> <b>@Model.TicketId</b> <br /><br /> </td> </tr> <tr style="border-bottom:2px solid #ccc; padding:10px;"> <td style="padding: 0 20px; font-size: 15px; font-weight: 700;"> <span>Status: </span> <span class="font-weight:500;">@Model.Status.ToUpper() </span> </td> </tr> <tr style="border-bottom:2px solid #ccc; padding:20px;"> <td colspan="2" style=" padding: 20px;"> @if (Model.Status == "OPENED") { <span> Dear @Model.Name,<br/> Your complaint with ticket number @Model.TicketId has been logged. Be rest assured that we are working to resolve your issue and would revert as soon as possible. Thank you for your patience. </span> } else { <span> Dear @Model.Name,<br /> Your complaint with ticket number @Model.TicketId has been resolved. Thank you. </span> } </td> </tr> </tbody> </table> <br /> </div> <p style="font:14px/1.25em 'Helvetica Neue',Arial,Helvetica;color:#333; background:#f2f2f2; margin-bottom: 0px; border-top:1px solid #ccc; text-align:center; padding:20px;"> @*<strong>ABSU @DateTime.Now.Year | All rights reserved</strong>*@ <br />Powered By Lloydant </p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </div> </body> </html> <file_sep>@{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; //Layout = "~/Views/Shared/_AdminLayout2.cshtml"; }<file_sep>@{ ViewBag.Title = "CarryOverReport"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*@section Scripts { @Scripts.Render("~/bundles/jqueryval")*@ <script src="~/Scripts/jquery-2.1.3.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> <div style="color: black"> <h3> Carry Over Report </h3> </div> <div class="alert alert-dismissible alert-success"> <p> <b>Carry Over Report </b> displays an exportable and printable report of the students' carry over courses </p> </div> <iframe src="@Url.Content("~/Reports/Presenter/CarryOverReport.aspx?sessionId=" + (string) ViewBag.sessionId + "&semesterId=" + (string) ViewBag.semesterId + "&levelId=" + (string) ViewBag.levelId + "&progId=" + (string) ViewBag.progId + "&deptId=" + (string) ViewBag.deptId)" style="width: 100%;" frameborder="0" scrolling="no" id="iframe" onload=' javascript:resizeIframe(this); '></iframe> <br /><file_sep>@using GridMvc.Html @model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ ViewBag.Title = "SearchAdmittedStudents"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["UpdateFailure"] != null) { <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["UpdateFailure"]</strong> </div> } @if (TempData["UpdateSuccess"] != null) { <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["UpdateSuccess"]</strong> </div> } @if (TempData["Action"] != null) { <div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["Action"]</strong> </div> } @using (Html.BeginForm("SearchAdmittedStudents", "UploadAdmission", new {area = "Admin"}, FormMethod.Post)) { <div class="col-md-12"> <div class="form-group" style="color: black"> <h4>Enter Application Number or Exam Number</h4> </div> </div> <div class="form-group"> @Html.Label("Application No / Exam No", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.SearchString, new {@class = "form-control", @placeholder = "Enter Application No / Enter Exam No"}) @Html.ValidationMessageFor(model => model.SearchString, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> } @if (Model == null || Model.AdmissionList.Count() <= 0) { return; } @if (Model != null && Model.AdmissionList.Count > 0) { <div class="panel panel-default"> <div class="panel-body"> @Html.Grid(Model.AdmissionList).Columns(columns => { columns.Add() .Encoded(false) .Sanitized(false) .RenderValueAs(d => @<div style="width: 41px">Edit <a href="@Url.Action("EditAdmittedStudentDepartment", new {id = d.Id})" title="Edit"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> </div>); columns.Add(f => f.Form.Person.FullName).Titled("Student Name"); columns.Add(f => f.Form.Number).Titled("Application Number"); columns.Add(f => f.Form.ExamNumber).Titled("Exam Number"); columns.Add(f => f.Deprtment.Name).Titled("Department"); columns.Add(f => f.Deprtment.Faculty.Name).Titled("Faculty"); columns.Add(f => f.Activated).Titled("Enabled"); }).WithPaging(15) </div> </div> }<file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Delete Relationship"; } @Html.Partial("Setup/_Delete", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.PostjambResultSupportViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div> <h4><p class="custom-text-black text-center ">PUTME Result</p></h4> </div> @using (Html.BeginForm("PostJambResult", "PostJamb", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Session.Id, new {@class = "control-label custom-text-black"}) @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.SessionId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> </div> </div> <br/> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Filtered Result"/> </div> </div> </div> </div> </div> </div> } <div class="row"> <div class="col-md-6"> @using (Html.BeginForm("PostJambResultAll", "PostJamb", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="form-group"> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="All Uploaded Results" /> </div> </div> } </div> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "EditStaff"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-upload"></i>Edit Staff</h3> </div> <div class="panel-body"> @using (Html.BeginForm("DownloadStaffUser", "Support", new {area = "Admin"}, FormMethod.Post, new {enctype = "multipart/form-data"})) { <h4 class="alert alert-success">Please select role to get staff List</h4> <br /> <div class="form-group"> @Html.LabelFor(model => model.Role.Name, "Staff Role", new {@class = "control-label col-md-12"}) <div class="col-md-12"> @Html.DropDownListFor(model => model.Role.Id, (IEnumerable<SelectListItem>) ViewBag.Role, new {@class = "form-control"}) </div> </div> <br /> <div class="form-group col-md-12"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Submit" /> </div> } <br /><br /> <br /><br /> <hr /> @using (Html.BeginForm("EditStaff", "Support", new {area = "Admin"}, FormMethod.Post, new {enctype = "multipart/form-data"})) { <h4 class="alert alert-success">Update Staff List</h4> <br /> <div class="form-group"> <div class="col-md-5"> <input type="file" title="Upload File" name="file" class="form-control" /> <br /> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Upload Here" /> </div> <div class="col-md-7"> <div class="pull-left"> <blockquote><small> NB: The Excel Format Should be in Excel 97-2003 WorkBook Format and the Columns should be arranged in such a way that the first column is the User-name and the second is the Password.</small></blockquote> </div> </div> </div> } </div> <br /> @if (Model == null || Model.Users == null) { return; } @if (Model != null && Model.Users.Count > 0) { <table class="table table-responsive table-striped"> <tr> <th> </th> <th> USERNAME </th> <th> PASSWORD </th> </tr> @for (int i = 0; i < Model.Users.Count; i++) { <tr> <td></td> <td> @Model.Users[i].Username </td> <td> @Model.Users[i].Password </td> </tr> } </table> <br /> <div class="form-group" style="text-align: center"> <div class="col-sm-10 pull-left"> @*<input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Save Upload" />*@ @Html.ActionLink("Save", "SaveEditedStaff", new {controller = "Support", area = "Admin"}, new {@class = "btn btn-success mr5"}) </div> </div> } </div> </div> <div class="col-md-1"></div> </div><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Model.Model.AdmissionLetter @{ Layout = null; ViewBag.Title = "Admission Letter"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-migrate-1.2.1.min.js"></script> <link href="~/Content/pretty-menu.css" rel="stylesheet" /> <script src="~/Scripts/prettify.js"></script> <script src="~/Scripts/custom.js"></script> <div class="container"> <div class="row"> </div> <div class="row"> <div class="col-md-12"> <div class="col-md-2"> <img class="pull-left" src="@Url.Content("~/Content/Images/school_logo.png")" width="100px" height="100px" /> </div> <div class="col-md-10"> <div class="row"> <h3>UNIVERSITY OF PORT-HARCOURT</h3> <div class="pull-left"> <p class="text-capitalize"> p.m.b 5323 <br /> Choba <br />Rivers state, Nigeria </p> </div> <div class="pull-right"> <p> website: www.uniport.edu.ng <br /> email: <br /> phone: </p> </div> </div> </div> </div> </div> <hr /> <div class="col-md-12"> <div class="row pull-left"> <b>Vice Chancellor:</b> <br /> Professor <NAME> <cite>B.Pharm, M.Pharm, PhD</cite> <br /> </div> </div> <div class="row"> <div class="col-md-12 pull-left"> <p class="text-uppercase"> </p> </div> </div> <div class="row"> <div class="col-md-12 text-justify"> <p> Name of Candidate: <strong>@Model.Person.FullName</strong> <br /><br /> Dear Sir / Madam <br /> <p class="text-center"> <h4 class="sectitle"><strong>OFFER OF PROVISIONAL ADMISSION INTO @Model.Programme.Description.ToUpper() DEGREE PROGRAMME</strong> </h4> </p> <p> We are pleased to inform you that you have been offered provisional admission into the University Of Port-Harcourt to pursue a degree programme in: <div> <p>Discipline: <strong>@Model.Department.Name.ToUpper()</strong> </p> <p>College / Faculty: <strong>@Model.Department.Faculty.Name.ToUpper()</strong></p> <p>Jamb Number : <strong>@Model.JambNumber</strong></p> <p>Academic Session : <strong>@Model.Session.Name.ToUpper()</strong> </p> </div> </p> <p> <ol> <li>You are required to generate an acceptance fee invoice online and proceed to the bank to make payment using the invoice number written on the invoice.</li> <li>Any offer not accepted within two weeks from date of this offer lapses.</li> <li>The confirmation of this offer is subject to your possession of the general as well as the specific departmental entry requirements for the course into which you have been offered admission</li> <li>Please note that this provisional admission notice is not a substitute for JAMB Admission letter..</li> </ol> Please accept our congratulations. </p> <p> Yours sincerely </p> <p class="pull-left"> @*<img src=@Url.Content("~/Content/Images/Registrar_signature.jpg") alt="" style="max-height: 50px" />*@ <br /> <strong>Mrs. <NAME></strong> <br /> <strong>Registrar (Admissions)</strong> <br /> </p> <div class="pull-right"> @Html.GenerateQrCode(Model.QRVerification) </div> </div> </div> </div><file_sep>@{ //Layout = null; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*@section Scripts { @Scripts.Render("~/bundles/jqueryval") }*@ <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/responsive-tabs.js"></script> <script type="text/javascript"> //(function ($) { // fakewaffle.responsiveTabs(['xs', 'sm']); //})(jQuery); //$('#myTab a').click(function (e) { // e.preventDefault(); // $(this).tab('show'); //}); function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> <div style="color: black"> <h3> Applicants Photo Card </h3> </div> <div class="alert alert-dismissible alert-success"> <p> <b>Applicants' Photo Card</b> can be viewed by the selecting Session and Programme, from the drop dowms below, then click the Display Report button to display an exportable and printable report. </p> </div> <iframe src="~/Reports/Presenter/ApplicantPhotoCard.aspx" style="width: 100%;" frameborder="0" scrolling="no" id="iframe" onload=' javascript:resizeIframe(this); '></iframe> <br /><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ ViewBag.Title = "Status Checking"; Layout = "~/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { if ($("#Programme").val() > 0) { $("#Name").show(); } else { $("#Name").hide(); } $("#Programme").change(function () { if ($("#Programme").val() > 0) { $("#Name").show(); } else { $("#Name").hide(); } }) }) </script> <br /> <div class="container"> <div class="col-md-12 card p-5"> <div class="row"> <div class="col-md-12"> <h3>PUTME Result Status Checking</h3> </div><hr /> </div> @using (Html.BeginForm("Index", "Screening", new { Area = "Applicant" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @*<h5>Please enter your <b>Application Form Number</b> and Etranzact <b>PIN</b> below to check your Application Status.</h5>*@ <div>Please Select <b>programme</b> and enter your <b>name</b> below to check your PUTME Result.</div> <div class="panel panel-default mt-3"> <div class="row"> <div class="form-group col-md-6 pl-0"> @Html.LabelFor(model => model.Programme.Id, "Programme", new { @class = "col-md-12 control-label" }) <div class="col-md-12"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.ProgrammeId, new { @class = "form-control", required = "required", @id = "Programme" }) @Html.ValidationMessageFor(model => model.Programme.Id) </div> </div> <div class="form-group col-md-6 pl-0"> @Html.LabelFor(model => model.ApplicationFormSetting.Id, "Exam", new { @class = "col-md-12 control-label" }) <div class="col-md-12"> @Html.DropDownListFor(model => model.ApplicationFormSetting.Id, (IEnumerable<SelectListItem>)ViewBag.ExamId, new { @class = "form-control", required = "required", @id = "Programme" }) @Html.ValidationMessageFor(model => model.ApplicationFormSetting.Id) </div> </div> <div style="display: none" id="Name" class="col-md-6 pl-0"> <div class=" form-group col-md-12 pl-0"> @Html.LabelFor(m => m.Name, "Name", new { @class = "col-md-12 control-label" }) <div class="col-md-12"> @Html.TextBoxFor(m => m.Name, new { @class = "form-control", required = "required" }) @Html.ValidationMessageFor(m => m.Name, null, new { @class = "text-danger" }) </div> </div> <div class="form-group col-md-12 pl-3"> <input type="submit" value="Continue" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> </div> } @if (Model.Results != null && Model.Results.Count > 0) { using (Html.BeginForm("CheckByName", "Screening", new { Area = "Applicant" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <hr /> @Html.HiddenFor(model => model.ApplicationFormSetting.Id) <h5>Please Select your name from the drop-down list and enter Application Form pin then click check to continue.</h5> <div class="panel panel-default"> <div class="row"> <div cclass="form-group col-md-6 pl-0"> @Html.LabelFor(model => model.Name, "Names", new { @class = "col-md-12 control-label" }) <div class="col-md-12"> @Html.DropDownListFor(model => model.Result.Id, (IEnumerable<SelectListItem>)ViewBag.ResultListId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Result.Id) </div> </div> <div class="form-group col-md-6 pl-0"> @Html.LabelFor(model => model.PinNumber, "Application Form Pin", new { @class = "col-md-12 control-label" }) <div class="col-md-12"> @Html.TextBoxFor(model => model.PinNumber, new { @class = "form-control", @placeholder = "Enter Application Form Pins", @type="password" }) </div> </div> <br /> <div class="form-group col-md-6 pl-0"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Check" class="btn btn-primary" /> </div> </div> </div> </div> } } </div> </div> @section Scripts { @Scripts.Render("~/bundles/jqueryval") } <file_sep>@using Abundance_Nk.Model.Model @using Microsoft.AspNet.Identity @using Abundance_Nk.Web.Models <!doctype html> <html lang="en" class="no-js"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <meta name="theme-color" content="#3e454c"> <title>Virtual School ABSU</title> <!-- Font awesome --> <link rel="stylesheet" href="~/Content/font-awesome/css/font-awesome.min.css"> <!-- Sandstone Bootstrap CSS --> <link rel="stylesheet" href="~/Content/bootstrap.min.css"> <!-- Admin Stye --> <link rel="stylesheet" href="~/Content/StudentAreaStyle.css"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> @{ Student student = null; if (User.Identity.Name != null && User.Identity.Name != "") { student = Utility.GetStudent(@User.Identity.Name); } else { Response.Redirect("/Security/Account/Login"); } } <body> @if (student != null) { <div class="brand clearfix"> ABSU <a href="#" class="logo"><img src="~/Content/Images/school_logo.jpg" class="img-responsive" alt=""></a> <span class="menu-btn"><i class="fa fa-bars"></i></span> <ul class="ts-profile-nav"> @using (Html.BeginForm("LogOff", "Account", new { Area = "Security" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { @Html.AntiForgeryToken() <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> <small></small> <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="javascript:document.getElementById('logoutForm').submit()">Logout</a></li> </ul> </li> } </ul> </div> <div class="ts-main-content"> <nav class="ts-sidebar"> <ul class="ts-sidebar-menu"> <div class="text-center ts-main"> @if (File.Exists("~/" + student.ImageFileUrl)) { <img src="~/Content/Images/@student.ImageFileUrl" /> } else { <img src="~/Content/Images/default_avatar.png" /> } </div> <li class="ts-label">@student.FullName</li> <li><a href="@Url.Action("ChangePassword","Home")"><i class="fa fa-dashboard"></i> Change Password</a></li> <li><a href="@Url.Action("CourseRegistration", "Home")"><i class="fa fa-paperclip"></i> Course Registration</a></li> <li>@*<a href="@Url.Action("Index", "ELearning")"><i class="fa fa-paperclip"></i> E-Learning</a>*@</li> <li><a href="@Url.Action("index", "Home")"><i class="fa fa-dashboard"></i> Dashboard</a></li> <!-- Account from above --> <li><a href="@Url.Action("Fees", "Home")"><i class="fa fa-money"></i> Invoices</a></li> <li><a href="@Url.Action("OtherFees","Home")"><i class="fa fa-money"></i>Other Fees</a></li> <li><a href="@Url.Action("PayFees","Home")"><i class="fa fa-money"></i> Pay Fees</a></li> <li><a href="@Url.Action("PaymentReceipt", "Home")"><i class="fa fa-barcode"></i> Print Other Receipt</a></li> @*<li><a href="@Url.Action("profile", "Home")"><i class="fa fa-user"></i> Profile</a></li>*@ <li><a href="@Url.Action("PaymentHistory", "Home")"><i class="fa fa-barcode"></i> Receipts</a></li> <li><a href="@Url.Action("Result", "Home")"><i class="fa fa-dashboard"></i> Results</a></li> <ul class="ts-profile-nav"> <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> Account <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="#">Logout</a></li> </ul> </li> </ul> </ul> </nav> <div class="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-12 "> @RenderBody() </div> </div> </div> </div> </div> } else { <div class="brand clearfix"> ABSU <a href="#" class="logo"><img src="~/Content/Images/school_logo.jpg" class="img-responsive" alt=""></a> <span class="menu-btn"><i class="fa fa-bars"></i></span> <ul class="ts-profile-nav"> @using (Html.BeginForm("LogOff", "Account", new { Area = "Security" }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { <li class="ts-account"> <a href="#"><img src="~/Content/Images/default_avatar.png" class="ts-avatar hidden-side" alt=""> <small></small> <i class="fa fa-angle-down hidden-side"></i></a> <ul> <li><a href="javascript:document.getElementById('logoutForm').submit()">Logout</a></li> </ul> </li> } </ul> </div> <div class="ts-main-content"> <div class="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-12 "> @RenderBody() </div> </div> </div> </div> </div> } <!-- Loading Scripts --> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/main.js"></script> @*@Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap")*@ @RenderSection("scripts", false) </body> </html><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ /**/ ViewBag.Title = "E-Learning"; Layout = "~/Areas/Student/Views/Shared/_Layout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { }); function updateDownloadCount(id,url) { var EcourseId = id; var url = url; if (EcourseId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("DownloadCount", "Elearning")', // Calling json method dataType: 'json', data: { EcourseId }, // Get Selected Country ID. success: function (result) { if (result != null) { let link = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); link.href = url; link.target = "_blank"; let event = new MouseEvent("click", { "view": window, "bubbles": false, "cancelable": true }); link.dispatchEvent(event); } }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; } }; </script> <br /> <div> <h3 class="card-header">All Registered Courses</h3> <div class="card"> <h3 class="card-title">First Semester</h3> <div class="card-body"> <div class="table-responsive"> <table class="table-bordered table-hover table-striped table"> <tr> <th> Course Code </th> <th> Course Name </th> <th> Level </th> <th> Session </th> <th> Semester </th> <th> E-Learning Resource </th> <th> Chat Room </th> </tr> @for (int i = 0; i < Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester.Count; i++) { <tr> <td> @Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].Course.Code </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].Course.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].CourseRegistration.Level.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].CourseRegistration.Session.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].Semester.Name </td> <td> @Html.ActionLink("View Content", "ECourseContent", "Elearning", new { Area = "Student", id = Utility.Encrypt(Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].Id.ToString()) }, new { @class = "btn btn-success" }) </td> <td> @Html.ActionLink("Chat", "EnterChatRoom", "Elearning", new { Area = "Student", id = Utility.Encrypt(Model.CourseRegistrationSemesters.CourseRegistrationFirstSemester[i].Id.ToString()) }, new { @class = "btn btn-success" }) </td> </tr> } </table> </div> </div> </div> <br /> <hr /> <div class="card"> <h3>Second Semester</h3> <div class="card-body"> <div class="table-responsive"> <table class="table-bordered table-hover table-striped table"> <tr> <th> Course Code </th> <th> Course Name </th> <th> Level </th> <th> Session </th> <th> Semester </th> <th> E-Learning Resource </th> <th> Chat Room </th> </tr> @for (int i = 0; i < Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester.Count; i++) { <tr> <td> @Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].Course.Code </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].Course.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].CourseRegistration.Level.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].CourseRegistration.Session.Name </td> <td> @Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].Semester.Name </td> <td> @Html.ActionLink("View Content", "ECourseContent", "Elearning", new { Area = "Student", id = Utility.Encrypt(Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].Id.ToString()) }, new { @class = "btn btn-success" }) </td> <td> @Html.ActionLink("Chat", "EnterChatRoom", "Elearning", new { Area = "Student", id = Utility.Encrypt(Model.CourseRegistrationSemesters.CourseRegistrationSecondSemester[i].Id.ToString()) }, new { @class = "btn btn-success" }) </td> </tr> } </table> </div> </div> </div> </div> <file_sep><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - The Federal Polytechnic Ilaro</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="container " style="color: #449D44"> <div> <table style="margin-bottom: 7px"> <tr> <td style="padding-right: 7px"><img src="/Content/Images/school_logo.jpg" alt="" /></td> <td><h3><strong>The Federal Polytechnic Ilaro</strong></h3></td> </tr> </table> </div> </div> <div class="container "> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - The Federal Polytechnic Ilaro</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", false) </body> </html><file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ //Layout = null; } <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">UTME Details/Mode of Reference</div> </div> <div class="panel-body"> @if (Model.ApplicationFormSetting.Id == 6 || Model.ApplicationFormSetting.Id == 8 || Model.ApplicationFormSetting.Id == 10) { if(Model.ApplicantJambDetail != null) { <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> </div> <div class="row"> @if(Model.ApplicantJambDetail.InstitutionChoice != null) { if(Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } </div> } else { <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> </div> } } else { if(Model.ApplicantJambDetail != null) { <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> @if(Model.ApplicantJambDetail.JambScore != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore,(IEnumerable<SelectListItem>)ViewBag.JambScoreId,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore,(IEnumerable<SelectListItem>)ViewBag.JambScoreId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> </div> } </div> <div class="row"> @if(Model.ApplicantJambDetail.InstitutionChoice != null) { if(Model.ApplicantJambDetail.InstitutionChoice.Id > 0) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> } @if(Model.ApplicantJambDetail.Subject1 != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1,"First Subject",new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id,(IEnumerable<SelectListItem>)ViewBag.Subject1Id,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1,"First Subject",new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id,(IEnumerable<SelectListItem>)ViewBag.Subject1Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> </div> } </div> <div class="row"> @if(Model.ApplicantJambDetail.Subject2 != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id,(IEnumerable<SelectListItem>)ViewBag.Subject2Id,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id,(IEnumerable<SelectListItem>)ViewBag.Subject2Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> </div> } @if(Model.ApplicantJambDetail.Subject3 != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id,(IEnumerable<SelectListItem>)ViewBag.Subject3Id,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id,(IEnumerable<SelectListItem>)ViewBag.Subject3Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> </div> } </div> <div class="row"> @if(Model.ApplicantJambDetail.Subject4 != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id,(IEnumerable<SelectListItem>)ViewBag.Subject4Id,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> </div> } else { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id,(IEnumerable<SelectListItem>)ViewBag.Subject4Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> </div> } <div class="col-md-6"> <div class="form-group"> </div> </div> </div> } else { <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber,new { @class = "form-control",@readonly = "readonly" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambRegistrationNumber) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.JambScore,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.JambScore,(IEnumerable<SelectListItem>)ViewBag.JambScoreId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.JambScore) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.InstitutionChoice.Id,(IEnumerable<SelectListItem>)ViewBag.InstitutionChoiceId,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.InstitutionChoice.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject1.Id,"First Subject",new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject1.Id,(IEnumerable<SelectListItem>)ViewBag.Subject1Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject1.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject2,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject2.Id,(IEnumerable<SelectListItem>)ViewBag.Subject2Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject2.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject3,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject3.Id,(IEnumerable<SelectListItem>)ViewBag.Subject3Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject3.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.ApplicantJambDetail.Subject4,new { @class = "control-label " }) @Html.DropDownListFor(model => model.ApplicantJambDetail.Subject4.Id,(IEnumerable<SelectListItem>)ViewBag.Subject4Id,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ApplicantJambDetail.Subject4.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> } } </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class StatementOfSemesterResultBulk :Page { public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public Level Level { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue),Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } public SessionSemester SelectedSession { get { return new SessionSemester { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender,EventArgs e) { try { Message = ""; //if (!IsPostBack) //{ // PopulateAllDropDown(); // ddlDepartment.Visible = false; //} } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession,Utility.GetAllSessionSemesters(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); Utility.BindDropdownItem(ddlProgramme,Utility.GetAllProgrammes(),Utility.ID,Utility.NAME); } catch(Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if(Level == null || Level.Id <= 0) { lblMessage.Text = "Please select Level"; return true; } if(Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if(Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } if(SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = " Session not set! Please contact your system administrator."; return true; } return false; } catch(Exception) { throw; } } protected void btnDisplayReport_Click(object sender,EventArgs e) { try { // StudentLevelLogic studentLevelLogic = new StudentLevelLogic(); // SessionSemesterLogic sessionSemesterLogic = new SessionSemesterLogic(); // Programme programme = Programme; // Department department = Department; // Level level = Level; // SessionSemester sessionSemester = sessionSemesterLogic.GetBy(SelectedSession.Id); // if (InvalidUserInput()) // { // return; // } // if (Directory.Exists(Server.MapPath("~/Content/temp"))) // { // Directory.Delete(Server.MapPath("~/Content/temp"), true); // } // Directory.CreateDirectory(Server.MapPath("~/Content/temp")); // List<Abundance_Nk.Model.Model.Result> StudentList = GetResultList(sessionSemester.Session, sessionSemester.Semester, department, level, programme); // foreach (Abundance_Nk.Model.Model.Result item in StudentList) // { // Student student = new Student() { Id = item.StudentId }; // StudentLevel studentLevel = studentLevelLogic.GetBy(student, sessionSemester.Session); // if (studentLevel != null) // { // ScoreGradeLogic scoreGradeLogic = new ScoreGradeLogic(); // StudentResultLogic resultLogic = new StudentResultLogic(); // AcademicStandingLogic academicStandingLogic = new AcademicStandingLogic(); // List<Model.Model.Result> results = resultLogic.GetStudentResultBy(SelectedSession, studentLevel.Level, studentLevel.Programme, studentLevel.Department, student); // List<StatementOfResultSummary> resultSummaries = resultLogic.GetStatementOfResultSummaryBy(SelectedSession, studentLevel.Level, studentLevel.Programme, studentLevel.Department, student); // Warning[] warnings; // string[] streamIds; // string mimeType = string.Empty; // string encoding = string.Empty; // string extension = string.Empty; // string bind_ds = "dsMasterSheet"; // string bind_resultSummary = "dsResultSummary"; // string reportPath = @"Reports\Result\StatementOfResult.rdlc"; // if (results != null && results.Count > 0) // { // string appRoot = ConfigurationManager.AppSettings["AppRoot"]; // foreach (Model.Model.Result result in results) // { // if (!string.IsNullOrWhiteSpace(result.PassportUrl)) // { // result.PassportUrl = appRoot + result.PassportUrl; // } // else // { // result.PassportUrl = appRoot + Utility.DEFAULT_AVATAR; // } // } // } // ReportViewer rptViewer = new ReportViewer(); // rptViewer.Visible = false; // rptViewer.Reset(); // rptViewer.LocalReport.DisplayName = "Statement Of Result"; // rptViewer.ProcessingMode = ProcessingMode.Local; // rptViewer.LocalReport.ReportPath = reportPath; // rptViewer.LocalReport.EnableExternalImages = true; // rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(), results)); // rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_resultSummary.Trim(), resultSummaries)); // byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); // string path = Server.MapPath("~/Content/temp"); // string savelocation = Path.Combine(path, item.Name + ".pdf"); // File.WriteAllBytes(savelocation, bytes); // } // else // { // lblMessage.Text = "No result to display"; // } // } // using (ZipFile zip = new ZipFile()) // { // string file = Server.MapPath("~/Content/temp/"); // zip.AddDirectory(file, ""); // string zipFileName = department.Name; // zip.Save(file + zipFileName + ".zip"); // string export = "~/Content/temp/" + zipFileName + ".zip"; // //Response.Redirect(export, false); // UrlHelper urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); // Response.Redirect(urlHelp.Action("DownloadStatementOfResultZip", new { controller = "Result", area = "Admin", downloadName = department.Name }), false); // return; // } } catch(Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender,EventArgs e) { try { if(Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if(departments != null && departments.Count > 0) { Utility.BindDropdownItem(ddlDepartment,Utility.GetDepartmentByProgramme(programme),Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private List<Model.Model.Result> GetResultList(Session session,Semester semester,Department department, Level level,Programme programme) { try { var filteredResult = new List<Model.Model.Result>(); var studentResultLogic = new StudentResultLogic(); List<string> resultList = studentResultLogic.GetProcessedResutBy(session,semester,level,department,programme) .Select(p => p.MatricNumber) .AsParallel() .Distinct() .ToList(); List<Model.Model.Result> result = studentResultLogic.GetProcessedResutBy(session,semester,level, department,programme); foreach(string item in resultList) { Model.Model.Result resultItem = result.Where(p => p.MatricNumber == item).FirstOrDefault(); filteredResult.Add(resultItem); } return filteredResult.OrderBy(p => p.Name).ToList(); } catch(Exception) { throw; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "HostelAllocationCriteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-3.1.1.js"></script> <script src="~/Scripts/jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#Programme").change(function () { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "HostelAllocation")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, success: function (departments) { $("#Department").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, departments) { $("#Department").append('<option value="' + departments.Value + '">' + departments.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); }) </script> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Hostel Allocation Criteria</h4> </div> <div class="panel-body"> @using (Html.BeginForm("ViewHostelAllocationCriteria", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.HostelAllocationCriteria.Level.Name, "Level", new { @class = "col-md-3 control-label" }) <div class="col-md-9"> @Html.DropDownListFor(m => m.HostelAllocationCriteria.Level.Id, (IEnumerable<SelectListItem>)ViewBag.LevelId, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(m => m.HostelAllocationCriteria.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-success" /> </div> </div> </div> </div> } </div> <br /> <div class="panel-body"> <div class="col-md-12"> @if (Model.HostelAllocationCriterias != null && Model.HostelAllocationCriterias.Count > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Hostel </th> <th> Series/Floor </th> <th> Room </th> <th> Bed Space </th> <th> Edit </th> <th> Delete </th> </tr> @for (int i = 0; i < Model.HostelAllocationCriterias.Count; i++) { <tr> @Html.HiddenFor(model => model.HostelAllocationCriterias[i].Id) @Html.HiddenFor(model => model.HostelAllocationCriteria.Level.Id) <td> @Model.HostelAllocationCriterias[i].Hostel.Name </td> <td> @Model.HostelAllocationCriterias[i].Series.Name </td> <td> @Model.HostelAllocationCriterias[i].Room.Number </td> <td> @Model.HostelAllocationCriterias[i].Corner.Name </td> <td> @Html.ActionLink("Edit", "EditHostelAllocationCriteria", "HostelAllocation", new { Area = "Admin", hid = Model.HostelAllocationCriterias[i].Id }, new { @class = "btn btn-success " }) </td> <td> @Html.ActionLink("Delete", "ConfirmDeleteHostelAllocationCriteria", "HostelAllocation", new { Area = "Admin", hid = Model.HostelAllocationCriterias[i].Id }, new { @class = "btn btn-success " }) </td> </tr> } </table> </div> </div> } </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Reset Invoice"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>ResetInvoice</h2> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="col-md-12"> <div class="form-group"> <h4>Enter Invoice Number or Confirmation Order Number</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.InvoiceNumber, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.InvoiceNumber, new {@class = "form-control", @placeholder = "Enter Invoice No"}) @Html.ValidationMessageFor(model => model.InvoiceNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Delete" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new {Area = ""}, null) </div> </div> </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UserViewModel @{ ViewBag.Title = "Staff Details"; //Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> @*<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@ @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-user"></i>Staff Detail</h3> </div> <div class="panel-body"> @using (Html.BeginForm("Index", "User", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-colorful"> <div class="panel-body "> <div class="form-group"> @Html.LabelFor(model => model.User.Username, "Staff Name:", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.Username, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Password, new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.Username, "XXXXXXX", new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Email, "Email", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.Email, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Role.Id, "Role", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.Role.Name, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.SecurityQuestion.Id, "Security Question", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.SecurityQuestion.Name, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.SecurityAnswer, "Security Answer", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.SecurityAnswer, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.LastLoginDate, "Last Login", new {@class = "text-bold"}) @Html.TextBoxFor(model => model.User.LastLoginDate, new {@class = "form-control", @disabled = "true"}) </div> <div class="form-group"> @Html.LabelFor(model => model.User.Activated, "Activated", new { @class = "text-bold" }) @Html.TextBoxFor(model => model.User.Activated, new { @class = "form-control", @disabled = "true" }) </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> @Html.ActionLink("Back", "Index", "User", new {Area = "Admin"}, new {@class = "btn btn-success mr5"}) </div> </div> </div> </div> } </div> </div><file_sep>@{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-12"> <h2>Instruction</h2> <div class="panel panel-custom"> <div class="panel-body text-justify"> <p><h4>Please make sure that you have changed your default password before proceeding.</h4></p> </div> </div> </div> </div> <div class="row"> <div class="col-md-4 hero-feature"> <div class="thumbnail" style="height: 245px"> <div class="caption"> <h4>Blank Score Sheets</h4> <p> To download score sheets please click the link below. You will only be able to see sheets for the courses that you have been assigned. </p> <p> @Html.ActionLink("Download Blank Sheets", "Download", "Staff", new {Area = "Admin"}, new {@class = "btn btn-success"}) </p> </div> </div> </div> <div class="col-md-4 hero-feature"> <div class="thumbnail" style="height: 245px"> <div class="caption"> <h4>Upload Score Sheets</h4> <p> To upload score sheets please click the link below. You will only be able to see sheets for the courses that you have been assigned. </p> <p> @Html.ActionLink("Upload Score Sheets", "Upload", "Staff", new {Area = "Admin"}, new {@class = "btn btn-success"}) </p> </div> </div> </div> <div class="col-md-4 hero-feature"> <div class="thumbnail" style="height: 245px"> <div class="caption"> <h4>View Raw Score Sheets</h4> <p> To view score sheets please click the link below. You will only be able to see sheets for the courses that you have been assigned. </p> <p> @Html.ActionLink("View Score Sheets", "View", "Staff", new {Area = "Admin"}, new {@class = "btn btn-success"}) </p> </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.FeeDetailViewModel @{ ViewBag.Title = "All Fee Details"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h4>Select fee type to view corresponding amount</h4> @using (Html.BeginForm("AllFeeDetails", "FeeDetail", new {Area = "Admin"}, FormMethod.Post, new {@class = "form-horizontal", role = "form"})) { <div class="panel panel-default"> <div class="panel-body"> @Html.ValidationSummary(true) <div class="form-group"> @Html.LabelFor(m => m.feeType.Name, new {@class = "col-md-3 control-label"}) <div class="col-md-9"> @Html.DropDownListFor(m => m.feeType.Id, (IEnumerable<SelectListItem>) ViewBag.FeeTypeId, new {@class = "form-control"}) @Html.ValidationMessageFor(m => m.feeType.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-md-offset-3 col-md-9"> <input type="submit" value="Submit" class="btn btn-default" /> </div> </div> </div> @if (Model == null || Model.DepartmentalSchoolFeeList == null) { return; } @if (Model != null && Model.DepartmentalSchoolFeeList.Count() > 0) { <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>Programme</th> <th>Department</th> <th>Level </th> <th>Amount</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.DepartmentalSchoolFeeList.Count(); i++) { <tr> <td>@Model.DepartmentalSchoolFeeList[i].programme.Name</td> <td>@Model.DepartmentalSchoolFeeList[i].department.Name</td> <td>@Model.DepartmentalSchoolFeeList[i].level.Name</td> <td>@Model.DepartmentalSchoolFeeList[i].Amount</td> </tr> } </tbody> </table> } </div> }<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using System.Configuration; using System.IO; using Microsoft.Reporting.WebForms; using Abundance_Nk.Web.Models; using System.Threading.Tasks; using Ionic.Zip; namespace Abundance_Nk.Web.Reports.Presenter { public partial class DebtorsReport : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { rblSortOption.SelectedIndex = 100; ddlDepartment.Visible = false; PopulateAllDropDown(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } public Session SelectedSession { get { return new Session() { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level() { Id = Convert.ToInt32(ddlLevel.SelectedValue), Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } public Programme Programme { get { return new Programme() { Id = Convert.ToInt32(ddlProgramme.SelectedValue), Name = ddlProgramme.SelectedItem.Text }; } set { ddlProgramme.SelectedValue = value.Id.ToString(); } } public Department Department { get { return new Department() { Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text }; } set { ddlDepartment.SelectedValue = value.Id.ToString(); } } private void DisplayReportBy(Session session, Level level,Programme programme, Department department, string sortOption) { try { PaymentModeLogic paymentModeLogic = new PaymentModeLogic(); PaymentMode paymentMode = new PaymentMode(){Id = Convert.ToInt32(sortOption)}; List<PaymentView> payments = paymentModeLogic.GetDebtorsList(session, level, programme, department, paymentMode, txtBoxDateFrom.Text, txtBoxDateTo.Text); if (payments.Count <= 0) { lblMessage.Text = "No records found."; return; } string bind_dsPhotoCard = "dsStudentPayment"; string reportPath = ""; reportPath = @"Reports\DebtorsReport.rdlc"; rv.Reset(); rv.LocalReport.DisplayName = "Debtors Report"; rv.LocalReport.ReportPath = reportPath; if (payments != null) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPhotoCard.Trim(), payments)); rv.LocalReport.Refresh(); } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateAllDropDown() { try { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlProgramme, Utility.GetAllProgrammes(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); } catch (Exception ex) { lblMessage.Text = ex.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0) { lblMessage.Text = "Please select Session"; return true; } if (Programme == null || Programme.Id <= 0) { lblMessage.Text = "Please select Programme"; return true; } if (Department == null || Department.Id <= 0) { lblMessage.Text = "Please select Department"; return true; } return false; } catch (Exception) { throw; } } protected void btnDisplayReport_Click(object sender, EventArgs e) { try { if (InvalidUserInput()) { return; } DisplayReportBy(SelectedSession, SelectedLevel, Programme, Department, rblSortOption.SelectedValue); } catch (Exception ex) { lblMessage.Text = ex.Message; } } protected void ddlProgramme_SelectedIndexChanged(object sender, EventArgs e) { try { if (Programme != null && Programme.Id > 0) { PopulateDepartmentDropdownByProgramme(Programme); } else { ddlDepartment.Visible = false; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } private void PopulateDepartmentDropdownByProgramme(Programme programme) { try { List<Department> departments = Utility.GetDepartmentByProgramme(programme); if (departments != null && departments.Count > 0) { departments = departments.OrderBy(d => d.Name).ToList(); Utility.BindDropdownItem(ddlDepartment, departments, Utility.ID, Utility.NAME); ddlDepartment.Visible = true; } } catch (Exception ex) { lblMessage.Text = ex.Message; } } //protected void btnFullReport_Click(object sender, EventArgs e) //{ // try // { // if (SelectedSession == null || SelectedSession.Id <= 0) // { // lblMessage.Text = "Please select Session"; // return; // } // PaymentModeLogic paymentModeLogic = new PaymentModeLogic(); // PaymentMode paymentMode = new PaymentMode() { Id = Convert.ToInt32(rblSortOption.SelectedValue) }; // List<PaymentView> payments = paymentModeLogic.GetDebtorsListFull(SelectedSession, SelectedLevel, paymentMode, txtBoxDateFrom.Text, txtBoxDateTo.Text); // string bind_dsPhotoCard = "dsStudentPayment"; // string reportPath = ""; // if (paymentMode.Id == 100) // { // reportPath = @"Reports\DebtorsReportAllWithLevel.rdlc"; // } // else if (paymentMode.Id == 101) // { // reportPath = @"Reports\DebtorsReportAll.rdlc"; // } // rv.Reset(); // rv.LocalReport.DisplayName = "Student School Fees Payment"; // rv.LocalReport.ReportPath = reportPath; // if (payments != null) // { // rv.ProcessingMode = ProcessingMode.Local; // rv.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPhotoCard.Trim(), payments)); // rv.LocalReport.Refresh(); // } // } // catch (Exception ex) // { // lblMessage.Text = ex.Message; // } //} //protected void btnBulk_Click(object sender, EventArgs e) //{ // try // { // if (SelectedSession == null || SelectedSession.Id <= 0 || Programme == null || Programme.Id <= 0) // { // lblMessage.Text = "For bulk report, you need to select the session and programme!"; // return; // } // ProgrammeLogic programmeLogic = new ProgrammeLogic(); // LevelLogic levelLogic = new LevelLogic(); // Programme = programmeLogic.GetModelBy(p => p.Programme_Id == Programme.Id); // if (Directory.Exists(Server.MapPath("~/Content/temp"))) // { // Directory.Delete(Server.MapPath("~/Content/temp"), true); // } // Directory.CreateDirectory(Server.MapPath("~/Content/temp")); // string zipName = "Debtors Report " + Programme.Name + " " + SelectedSession.Name; // List<Department> departments = Utility.GetDepartmentByProgramme(Programme); // departments.RemoveAt(0); // for (int i = 0; i < departments.Count; i++) // { // Model.Model.Department currentDepartment = departments[i]; // List<Level> levels = new List<Level>(); // if (Programme.Id == 1 || Programme.Id == 2 || Programme.Id == 5) // { // levels.Add(levelLogic.GetModelBy(l => l.Level_Id == 1)); // levels.Add(levelLogic.GetModelBy(l => l.Level_Id == 2)); // } // if (Programme.Id == 3 || Programme.Id == 4) // { // levels.Add(levelLogic.GetModelBy(l => l.Level_Id == 3)); // levels.Add(levelLogic.GetModelBy(l => l.Level_Id == 4)); // } // for (int j = 0; j < levels.Count; j++) // { // Level currentLevel = levels[j]; // PaymentModeLogic paymentModeLogic = new PaymentModeLogic(); // PaymentMode paymentMode = new PaymentMode() { Id = Convert.ToInt32(rblSortOption.SelectedValue) }; // List<PaymentView> payments = paymentModeLogic.GetDebtorsList(SelectedSession, currentLevel, Programme, currentDepartment, paymentMode, txtBoxDateFrom.Text, txtBoxDateTo.Text); // if (payments.Count > 0) // { // Warning[] warnings; // string[] streamIds; // string mimeType = string.Empty; // string encoding = string.Empty; // string extension = string.Empty; // string bind_dsPhotoCard = "dsStudentPayment"; // string reportPath = ""; // if (paymentMode.Id == 100) // { // reportPath = @"Reports\SecondInstallmentDebtorsReportBulk.rdlc"; // } // else if (paymentMode.Id == 101) // { // reportPath = @"Reports\DebtorsReportBulk.rdlc"; // } // ReportViewer rptViewer = new ReportViewer(); // rptViewer.Visible = false; // rptViewer.Reset(); // rptViewer.LocalReport.DisplayName = "Debtors Report"; // rptViewer.ProcessingMode = ProcessingMode.Local; // rptViewer.LocalReport.ReportPath = reportPath; // rptViewer.LocalReport.EnableExternalImages = true; // rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsPhotoCard.Trim(), payments)); // byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); // string path = Server.MapPath("~/Content/temp"); // string savelocation = Path.Combine(path, currentLevel.Name.Replace(" ", "").Trim() + " " + currentDepartment.Name.Replace("/", "_") + ".pdf"); // File.WriteAllBytes(savelocation, bytes); // } // } // } // using (ZipFile zip = new ZipFile()) // { // string file = Server.MapPath("~/Content/temp/"); // zip.AddDirectory(file, ""); // string zipFileName = zipName; // zip.Save(file + zipFileName + ".zip"); // string export = "~/Content/temp/" + zipFileName + ".zip"; // Response.Redirect(export, false); // return; // } // } // catch (Exception ex) // { // lblMessage.Text = ex.Message; // } //} } }<file_sep>@model Abundance_Nk.Model.Model.Setup @{ ViewBag.Title = "Create Result Grade"; } @Html.Partial("Setup/_Create", @Model)<file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.StudentCourseRegistrationViewModel @{ ViewBag.Title = "StudentDetails"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { HideEditables(); NonEditableStudentDetail(); }) function RemoveCourse(courseRegDetail) { $("#loading").show(); $.ajax({ type: 'POST', url: '@Url.Action("RemoveCourse", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: courseRegDetail }, success: function (response) { if (response != null && response.success) { alert(response.responseText); window.location.reload(true); } else { alert(response.responseText); } }, error: function (ex) { alert('Operation failed!.' + ex); } }); return false; } function DeleteStudentLevel(studentLevelId) { $("#loading").show(); $.ajax({ type: 'POST', url: '@Url.Action("DeleteStudentLevel", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: studentLevelId }, success: function (result) { if (result == "Success") { alert('Record was Removed!'); window.location.reload(true); } }, error: function (ex) { alert('Operation Failed.' + ex); } }); return false; } function NonEditableStudentDetail() { var roleName = $('#@Html.IdFor(m=>m.User.Role.Name)').val() if (roleName != "hod" && roleName != "Dean") { $('.deleteStdLevel2').show(); $('.deleteStdLevel').show(); $('.editStdLevel').show(); $('.editStdLevel2').show(); $('.addSecondSemesterCourse').show(); $('.addFirstSemesterCourse').show(); $('.editSession').show(); $('.editSession2').show(); $('.deleteStdRegDetail').show(); $('.deleteStdRegDetail2').show(); $('.editSession2').show(); } } function HideEditables() { $('.deleteStdLevel2').hide(); $('.deleteStdLevel').hide(); $('.editStdLevel').hide(); $('.editStdLevel2').hide(); $('.addSecondSemesterCourse').hide(); $('.addFirstSemesterCourse').hide(); $('.editSession').hide(); $('.editSession2').hide(); $('.deleteStdRegDetail').hide(); $('.deleteStdRegDetail2').hide(); $('.editSession2').hide(); } </script> @if(TempData["Message"] != null) { @Html.Partial("_Message",(Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size:x-large">View Student Details</div> </div> <div class="panel-body"> @using (Html.BeginForm("StudentDetails", "StudentCourseRegistration", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber, "Matric Number:", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.TextBoxFor(model => model.Student.MatricNumber, new { @class = "form-control", @placeholder = "Enter Matric Number", @required = "required" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber, "", new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Get Details" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> </div> </div> @if (Model != null) { <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: large">Student Details</div> </div> <div class="panel-body"> <div class="col-md-12"> <div> @Html.HiddenFor(model => model.User.Role.Name) <dl class="dl-horizontal"> <dt>Matric Number: </dt> <dd>@Model.Student.MatricNumber.ToUpper()</dd> <dt>Name: </dt> <dd>@Model.Student.FullName.ToUpper()</dd> @if (Model.Student.Sex != null) { <dt>Sex: </dt> <dd>@Model.Student.Sex.Name</dd> } <dt>Mobile Phone: </dt> <dd>@Model.Student.MobilePhone</dd> <dt>Email Address: </dt> <dd>@Model.Student.Email</dd> @if (Model.Student.Nationality != null) { <dt>Nationality: </dt> <dd>@Model.Student.Nationality.Name.ToUpper()</dd> } @if (Model.Student.State != null) { <dt>State: </dt> <dd>@Model.Student.State.Name.ToUpper()</dd> } @if (Model.Student.HomeTown != null) { <dt>Home Town: </dt> <dd>@Model.Student.HomeTown.ToUpper()</dd> } @if (Model.Student.HomeAddress != null) { <dt>Home Address: </dt> <dd>@Model.Student.HomeAddress.ToUpper()</dd> } @if (Model.Student.SchoolContactAddress != null) { <dt>School Contact Address: </dt> <dd>@Model.Student.SchoolContactAddress.ToUpper()</dd> } </dl> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: large">Student Level Details</div> </div> <div class="panel-body"> <table class="col-md-12 table table-bordered table-hover table-responsive"> <thead> <tr> <th>Programme</th> <th>Department</th> <th>Department Option</th> <th>Level</th> <th>Session</th> <th class="editStdLevel">Edit</th> <th class="deleteStdLevel"> Delete</th> </tr> </thead> @for (int i = 0; i < Model.StudentLevelList.Count; i++) { <tbody> <tr> <td>@Model.StudentLevelList[i].Programme.Name</td> <td>@Model.StudentLevelList[i].Department.Name</td> @if (Model.StudentLevelList[i].DepartmentOption != null) { <td>@Model.StudentLevelList[i].DepartmentOption.Name</td> } else { <td>No Option</td> } <td>@Model.StudentLevelList[i].Level.Name</td> <td>@Model.StudentLevelList[i].Session.Name</td> <td class="editStdLevel2"> @if (Model.User != null && Model.User.Role != null && Model.User.Role.Id != 22) { @Html.ActionLink("Edit", "EditStudentLevel", new { Controller = "StudentCourseRegistration", Area = "Admin", sid = Model.StudentLevelList[i].Id }, new { @class = "btn btn-success mr5" }) } </td> <td class="deleteStdLevel2"> @if (Model.User != null && Model.User.Role != null && Model.User.Role.Id != 22) { <button class="btn btn-success mr5" onclick="DeleteStudentLevel(@Model.StudentLevelList[i].Id)">Delete</button> } </td> </tr> </tbody> } </table> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: large">Student Payment Details</div> </div> <div class="panel-body"> <table class="col-md-12 table table-bordered table-hover table-responsive"> <thead> <tr> <th>Payment Date</th> <th>Amount</th> <th>Invoice Number</th> <th>Confirmation Number</th> <th>Fee Type</th> <th>Session</th> <th class="editSession">Edit</th> </tr> </thead> @for (int i = 0; i < Model.Payments.Count; i++) { <tbody> <tr> <td>@Model.Payments[i].DatePaid.ToLongDateString()</td> <td>@Model.Payments[i].Amount</td> <td>@Model.Payments[i].InvoiceNumber</td> <td>@Model.Payments[i].ConfirmationNumber</td> <td>@Model.Payments[i].FeeType.Name</td> <td>@Model.Payments[i].Session.Name</td> <td class="editSession2"> @if (Model.User != null && Model.User.Role != null && Model.User.Role.Id != 22) { @Html.ActionLink("Edit", "EditPayment", new { Controller = "Support", Area = "Admin", pmid = @Model.Payments[i].Id }, new { @class = "btn btn-success" }) } </td> </tr> </tbody> } </table> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: large">Student Course Registration Details</div> </div> <div class="panel-body"> @for (int i = 0; i < Model.CourseRegistrations.Count; i++) { <table class="col-md-12 table table-bordered table-hover table-responsive"> <thead> <tr> <th>Level</th> <th>Session</th> <th>Course Semester</th> <th>Course Code</th> <th>Course Name</th> <th>Course Unit</th> <th>Course Mode</th> <th>Test Score</th> <th>Exam Score</th> <th>Special Case</th> <th class="deleteStdRegDetail">Delete</th> </tr> </thead> @for (int j = 0; j < Model.CourseRegistrations[i].Details.Count; j++) { <tbody> <tr> <td>@Model.CourseRegistrations[i].Level.Name</td> <td>@Model.CourseRegistrations[i].Session.Name</td> <td>@Model.CourseRegistrations[i].Details[j].Semester.Name</td> <td>@Model.CourseRegistrations[i].Details[j].Course.Code</td> <td>@Model.CourseRegistrations[i].Details[j].Course.Name</td> <td>@Model.CourseRegistrations[i].Details[j].CourseUnit</td> <td>@Model.CourseRegistrations[i].Details[j].Mode.Name</td> <td>@Model.CourseRegistrations[i].Details[j].TestScore.ToString()</td> <td>@Model.CourseRegistrations[i].Details[j].ExamScore.ToString()</td> <td>@Model.CourseRegistrations[i].Details[j].SpecialCase</td> <td class="deleteStdRegDetail2"> @if (Model.User != null && Model.User.Role != null && Model.User.Role.Id != 22) { <button class="btn btn-success mr5" onclick="RemoveCourse(@Model.CourseRegistrations[i].Details[j].Id)">Remove Course</button> } </td> </tr> </tbody> } </table> <br /> if (Model.User != null && Model.User.Role != null && Model.User.Role.Id != 22) { <div class="col-md-12"> @Html.ActionLink("Add A Course First Semester", "AddExtraCourse", new { Controller = "StudentCourseRegistration", Area = "Admin", studentId = Utility.Encrypt(@Model.CourseRegistrations.FirstOrDefault().Student.Id.ToString()), semesterId = Utility.Encrypt("1"), sessionId = Utility.Encrypt(@Model.CourseRegistrations[i].Session.Id.ToString()) }, new { @class = "btn btn-success addFirstSemesterCourse" }) @Html.ActionLink("Add A Course Second Semester", "AddExtraCourse", new { Controller = "StudentCourseRegistration", Area = "Admin", studentId = Utility.Encrypt(@Model.CourseRegistrations.FirstOrDefault().Student.Id.ToString()), semesterId = Utility.Encrypt("2"), sessionId = Utility.Encrypt(@Model.CourseRegistrations[i].Session.Id.ToString()) }, new { @class = "btn btn-success addSecondSemesterCourse" }) </div> } } </div> </div> </div> </div> } <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "ResetStep"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Reset Step</h2> @using (Html.BeginForm("ResetStep", "Support", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div class="panel panel-default "> <div class="panel-body "> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> <div class="col-md-12"> <div class="form-group"> <h4>Reset Applicant Status</h4> </div> </div> <div class="form-group"> @Html.LabelFor(model => model.ApplicationForm.Number, new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.ApplicationForm.Number, new {@class = "form-control", @placeholder = "Enter Application No"}) @Html.ValidationMessageFor(model => model.ApplicationForm.Number, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-10"> </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> </div> </div> </div> </div> } @if (Model.Applicants != null) { using (Html.BeginForm("UpdateStep", "Support", FormMethod.Post)) { @Html.HiddenFor(model => model.Applicants.ApplicationForm.Id) @Html.HiddenFor(model => model.Applicants.ApplicationForm.Number) @Html.HiddenFor(model => model.Applicants.ApplicationForm.ExamNumber) @Html.HiddenFor(model => model.Applicants.ApplicationForm.SerialNumber) <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div class="form-group"> <label class="col-sm-2 control-label">Application Number</label> <div class="col-sm-10"> @Html.DisplayFor(model => model.Applicants.ApplicationForm.Number, new {@class = "form-control", @placeholder = "Enter Other Names"}) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Full name</label> <div class="col-sm-10"> @Html.DisplayFor(model => model.Applicants.ApplicationForm.Person.FullName, new {@class = "form-control", @placeholder = "Enter Mobile Number"}) </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">Status</label> <div class="col-sm-10"> @Html.DropDownListFor(model => model.Applicants.Status.Id, (IEnumerable<SelectListItem>) ViewBag.StatusId, new {@class = "form-control"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Update" /> </div> </div> </div> </div> </div> } }<file_sep>@model IEnumerable<Abundance_Nk.Model.Entity.COURSE_UNIT> @{ ViewBag.Title = "Index"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#myTable").DataTable(); }); </script> <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table" id="myTable"> <tr> <th> @Html.DisplayNameFor(model => model.Minimum_Unit) </th> <th> @Html.DisplayNameFor(model => model.Maximum_Unit) </th> <th> @Html.DisplayNameFor(model => model.DEPARTMENT.Department_Name) </th> <th> @Html.DisplayNameFor(model => model.LEVEL.Level_Name) </th> <th> @Html.DisplayNameFor(model => model.PROGRAMME.Programme_Name) </th> <th> @Html.DisplayNameFor(model => model.SEMESTER.Semester_Name) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Minimum_Unit) </td> <td> @Html.DisplayFor(modelItem => item.Maximum_Unit) </td> <td> @Html.DisplayFor(modelItem => item.DEPARTMENT.Department_Name) </td> <td> @Html.DisplayFor(modelItem => item.LEVEL.Level_Name) </td> <td> @Html.DisplayFor(modelItem => item.PROGRAMME.Programme_Name) </td> <td> @Html.DisplayFor(modelItem => item.SEMESTER.Semester_Name) </td> <td> @Html.ActionLink("Edit", "Edit", new { id=item.Course_Unit_Id }) | @Html.ActionLink("Details", "Details", new { id=item.Course_Unit_Id }) | @Html.ActionLink("Delete", "Delete", new { id=item.Course_Unit_Id }) </td> </tr> } </table> <file_sep>@{ ViewBag.Title = "Admin Home"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <br /> <div class="container-fluid"> <h2>@ViewBag.Title</h2> <h5>Welcome, Administrator. </h5><br /><br /> @if (TempData["Message"] != null) { <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["Message"]</strong> </div> } @Html.ActionLink("Click here to change your password", "ChangePassword") @*<div class="col-md-4"> <section id="socialLoginForm"> @Html.Partial("_ExternalLoginsListPartial", new { Action = "ExternalLogin", ReturnUrl = ViewBag.ReturnUrl }) </section> </div>*@ </div> @*@section Scripts { @Scripts.Render("~/bundles/jqueryval") }*@<file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.PaymentViewModel @{ ViewBag.Title = "Generate Invoice"; } <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function () { swal({ title: "Attention!", text: "Ensure that you have not made payment for the fee you are about to process ELSE you risk loosing the processed fee.", type: "warning" }); var items = $('#StudentLevel_DepartmentOption_Id option').size(); if (items > 0) { $("#divDepartmentOption").show(); } else { $("#divDepartmentOption").hide(); } var feeTypeId = $("#FeeType_Id").val(); if (feeTypeId == 17) { $("#PaymentMode_Id").val(1); $("#PaymentMode_Id option[value='2']").remove(); $("#PaymentMode_Id option[value='3']").remove(); $("#Session_Id option[value='19']").remove(); } //Only Allow Third installment School Fees Payment for JUPEB Payment if ($("#StudentLevel_Programme_Id").val() != 15) { $("#PaymentMode_Id option[value='4']").remove(); } // $("#StudentLevel_Programme_Id").change(function () { var programme = $("#StudentLevel_Programme_Id").val(); $("#StudentLevel_Department_Id").empty(); $("#StudentLevel_Level_Id").empty(); $.ajax({ type: 'GET', url: '@Url.Action("GetDepartmentAndLevelByProgrammeId", "Payment")', dataType: 'json', data: { id: programme }, success: function (data) { var levels = data.Levels; var departments = data.Departments; if (departments != "" && departments != null && departments != undefined) { $("#StudentLevel_Department_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(departments, function (i, department) { $("#StudentLevel_Department_Id").append('<option value="' + department.Id + '">' + department.Name + '</option>'); }); } if (levels != "" && levels != null && levels != undefined) { $("#StudentLevel_Level_Id").append('<option value="' + 0 + '"> -- Select -- </option>'); $.each(levels, function (i, level) { $("#StudentLevel_Level_Id").append('<option value="' + level.Id + '">' + level.Name + '</option>'); }); } }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); }); }) </script> @using (Html.BeginForm("GenerateInvoice", "Payment", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.FeeType.Id) @Html.HiddenFor(model => model.PaymentType.Id) @Html.HiddenFor(model => model.Person.Type.Id) @Html.HiddenFor(model => model.FeeType.Name) @Html.HiddenFor(model => model.PaymentType.Name) @Html.HiddenFor(model => model.Person.Type.Name) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.StudentAlreadyExist) if (Model.StudentAlreadyExist) { @Html.HiddenFor(model => model.StudentLevel.Department.Faculty.Id) } <div class="container"> <div class="card card-shadow"> <div class="row "> <div class="col-md-12"> <h3 class="font-weight-normal">Generate Invoice</h3> <p class="card-text">Provide your Programme, Choosen Course, fill other details and Click Generate.</p> </div> <div class="col-md-12 stretch-card grid-margin"> <div class="card bg-neutral"> @if (Model.StudentAlreadyExist) { @Html.Partial("_RegisteredStudent", Model) } else { @Html.Partial("_UnRegisteredStudent", Model) } <div class="col-md-12 p-0"> <button class="btn btn-primary" type="submit" id="submit">Generate Invoice</button> </div> </div> </div> </div> </div> </div> }<file_sep>using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Entity; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Ionic.Zip; using Microsoft.Reporting.WebForms; namespace Abundance_Nk.Web.Reports.Presenter { public partial class GstReportBulkAltEnt : System.Web.UI.Page { private Abundance_NkEntities db = new Abundance_NkEntities(); private readonly List<Semester> semesters = new List<Semester>(); private Course course; private string courseId; private List<Course> courses; private Department department; private List<Department> departments; private string deptId; private Level level; private string levelId; private string progId; private Programme programme; private Semester semester; private string semesterId; private Session session; private string sessionId; public Session SelectedSession { get { return new Session { Id = Convert.ToInt32(ddlSession.SelectedValue), Name = ddlSession.SelectedItem.Text }; } set { ddlSession.SelectedValue = value.Id.ToString(); } } public Semester SelectedSemester { get { return new Semester { Id = Convert.ToInt32(ddlSemester.SelectedValue), Name = ddlSemester.SelectedItem.Text }; } set { ddlSemester.SelectedValue = value.Id.ToString(); } } public Faculty SelectedFaculty { get { return new Faculty { Id = Convert.ToInt32(ddlFaculty.SelectedValue), Name = ddlFaculty.SelectedItem.Text }; } set { ddlFaculty.SelectedValue = value.Id.ToString(); } } public Level SelectedLevel { get { return new Level { Id = Convert.ToInt32(ddlLevel.SelectedValue), Name = ddlLevel.SelectedItem.Text }; } set { ddlLevel.SelectedValue = value.Id.ToString(); } } protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { Utility.BindDropdownItem(ddlSession, Utility.GetAllSessions(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlLevel, Utility.GetAllLevels(), Utility.ID, Utility.NAME); Utility.BindDropdownItem(ddlFaculty, Utility.GetAllFaculties(), Utility.ID, Utility.NAME); Display_Button.Visible = true; ddlSemester.Visible = true; } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public void BulkOperations() { try { Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string directoryName = "ent_" + DateTime.Now.ToString().Replace("/", "").Replace(":", "").Replace(" ", ""); string directoryPath = "~/Content/" + directoryName; if (Directory.Exists(Server.MapPath(directoryPath))) { Directory.Delete(Server.MapPath(directoryPath), true); } Directory.CreateDirectory(Server.MapPath(directoryPath)); List<Course> courses = new List<Course>(); var courseLogic = new CourseLogic(); var programmeLogic = new ProgrammeLogic(); var departmentLogic = new DepartmentLogic(); var levelLogic = new LevelLogic(); Semester seSemester = new Semester() { Id = SelectedSemester.Id, Name = SelectedSemester.Name }; Session seSession = new Session() { Id = SelectedSession.Id, Name = SelectedSession.Name }; var scanCourses = db.GST_SCAN_RESULT.Where(x =>x.Semester_Id== seSemester.Id && x.Session_Id== seSession.Id).Select(y=>y.COURSE_CODE).Distinct().ToList(); //var scanCourses = db.GST_SCAN_RESULT.Select(x => x.COURSE_CODE).Distinct().ToList(); //var scanCourses = new List<Course>() //{ //new Course { Id = 0, Name = "GST 101" }, //new Course { Id = 1, Name = "GST 103" }, //new Course { Id = 2, Name = "GST 105" }, //new Course { Id = 3, Name = "GST 121" } //}; if (scanCourses == null) { lblMessage.Text = "No Course Upload For the selected session and semester"; return; } for (int i = 0; i < scanCourses.Count; i++) { Course course = new Course(); course.Id = i; course.Name = scanCourses[i]; if(course.Name!=null && course.Name.Contains("ENT")) { courses.Add(course); } } var departments = departmentLogic.GetBy(new Faculty { Id = SelectedFaculty.Id }); List<Course> courseList = courses; // Semester seSemester = new Semester() { Id = SelectedSemester.Id, Name = SelectedSemester.Name }; Faculty faculty = new Faculty() { Id = SelectedFaculty.Id }; Level level = new Level() { Id = SelectedLevel.Id, Name = SelectedLevel.Name }; foreach (Department deptDepartment in departments) { foreach (Course coCourse in courseList) { var studentResultLogic = new StudentResultLogic(); List<Model.Model.Result> report = studentResultLogic.GetStudentGSTResult(seSession, seSemester, level, faculty, deptDepartment, coCourse); if (report.Count > 0) { string bind_dsStudentResultSummary = "dsExamRawScoreSheet"; string reportPath = @"Reports\Result\ExamRawScoreSheetENT.rdlc"; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "ENT Result"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentResultSummary.Trim(), report)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string name = deptDepartment.Code.Replace(" ", "") + coCourse.Name.Replace(" ", "").Replace("/", "").Replace("-", "") + level.Name.Replace(" ", ""); string path = Server.MapPath(directoryPath); string savelocation = Path.Combine(path, name + ".pdf"); File.WriteAllBytes(savelocation, bytes); } } } using (var zip = new ZipFile()) { string file = Server.MapPath(directoryPath); zip.AddDirectory(file, ""); string zipFileName = SelectedFaculty.Name + "_" + SelectedLevel.Name; zip.Save(file + zipFileName + ".zip"); string export = directoryPath + zipFileName + ".zip"; Response.Redirect(export, false); } } catch (Exception ex) { throw ex; } } protected void Display_Button_Click1(object sender, EventArgs e) { try { if (InvalidUserInput()) { lblMessage.Text = "All fields must be selected"; return; } BulkOperations(); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private bool InvalidUserInput() { try { if (SelectedSession == null || SelectedSession.Id <= 0 || SelectedSemester == null || SelectedSemester.Id <= 0 || SelectedFaculty == null || SelectedFaculty.Id <= 0 || SelectedLevel == null || SelectedLevel.Id <= 0) { return true; } return false; } catch (Exception) { throw; } } protected void ddlSession_SelectedIndexChanged1(object sender, EventArgs e) { var session = new Session { Id = Convert.ToInt32(ddlSession.SelectedValue) }; var sessionSemesterLogic = new SessionSemesterLogic(); List<SessionSemester> semesterList = sessionSemesterLogic.GetModelsBy(p => p.Session_Id == session.Id); foreach (SessionSemester sessionSemester in semesterList) { semesters.Add(sessionSemester.Semester); } semesters.Insert(0, new Semester { Name = "-- Select Semester--" }); Utility.BindDropdownItem(ddlSemester, semesters, Utility.ID, Utility.NAME); ddlSemester.Visible = true; } } } <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "ViewCarryOverCourses"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Session Drop down Selected change event $("#Session").change(function() { $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "Support")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); }); </script> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-edit"></i>Add Carry Over Course</h3> </div> <div class="panel-body"> @using (Html.BeginForm("ViewCarryOverCourses", "Support", new {area = "Admin"}, FormMethod.Post)) { <div class="form-group"> @Html.LabelFor(model => model.MatricNumber, "Matric Number", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.MatricNumber, new {@class = "form-control", @required = "required"}) @Html.ValidationMessageFor(model => model.MatricNumber, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>) ViewBag.Session, new {@class = "form-control", @id = "Session", @required = "required"}) @Html.ValidationMessageFor(model => model.Session.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name, "Semester", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>) ViewBag.Semester, new {@class = "form-control", @id = "Semester", @required = "required"}) @Html.ValidationMessageFor(model => model.Semester.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Level, new {@class = "form-control", @id = "Level", @required = "required"}) @Html.ValidationMessageFor(model => model.Level.Id, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="View Courses" /> </div> </div> } </div> </div> @if (Model == null || Model.Courses == null) { return; } @if (Model != null && Model.Courses.Count > 0) { using (Html.BeginForm("AddCarryOverCourses", "Support", new {area = "Admin"}, FormMethod.Post)) { <table class="table table-responsive table-striped"> <tr> <th> COURSE NAME </th> <th> COURSE CODE </th> <th> COURSE UNIT </th> <th> SELECT </th> </tr> @for (int i = 0; i < Model.Courses.Count; i++) { <tr> <td> @Html.HiddenFor(model => Model.Courses[i].Id) @Model.Courses[i].Name </td> <td> @Html.HiddenFor(model => Model.Courses[i].Code) @Model.Courses[i].Code </td> <td> @Html.HiddenFor(model => Model.Courses[i].Unit) @Model.Courses[i].Unit </td> <td> @Html.CheckBoxFor(model => Model.Courses[i].IsRegistered) </td> </tr> } </table> <br /> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Add Courses" /> </div> </div> } @*<div class="form-group" style="text-align:center"> <div class="col-sm-10 pull-left"> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Save Upload" /> @Html.ActionLink("Add Courses", "AddCarryOverCourses", new { controller = "Support", area = "Admin" }, new { @class = "btn btn-success mr5" }) </div> </div>*@ }<file_sep>@model int? @if (ViewBag.IsIndex != null && ViewBag.IsIndex == true) { @*<h3>@ViewBag.Title</h3>*@ @*<br />*@ <div> <div class="row"> <div class="col-md-12"> @Html.ActionLink("Create New", "Create") <div class="pull-right record-count-label"> <span class="caption">Record Count</span><span class="badge">@Model</span> </div> </div> </div> </div> } else { @*<br /> <h3>@ViewBag.Title</h3>*@ } <hr class="no-top-padding" /><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "FixDuplicateMatricNumber"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-pencil"></i>Fix Duplicate Matric Number</h3> </div> <div class="panel-body"> @using (Html.BeginForm("DeleteDuplicateMatricNumber", "Support", new { area = "Admin" }, FormMethod.Post)) { <div class="row"> <div class="col-md-2"> @Html.LabelFor(model => model.Student.MatricNumber, "Matric Number", new { @class = "control-label " }) </div> <div class="row col-md-8"> <div class="col-md-6"> <div class="form-group"> @Html.TextBoxFor(model => model.Student.MatricNumber,new { @class = "form-control",@placeholder = "Enter Matric Number",@required = "required" }) </div> </div> <div class="form-group"> <div class="col-md-12"> <input type="submit" value="Submit" class="btn btn-success mr5" /> </div> </div> </div> </div> } </div> </div> @if (Model != null) { <div class="panel panel-default"> @*<div class="panel-heading"> <div >Students with the Matric Number</div> </div>*@ <div class="panel-body"> <div class="row"> <div class="col-md-12"> <table class="table-bordered table-hover table-striped table-responsive table"> <tr> <th> Name </th> <th> Matric Number </th> <th> Edit Matric Number </th> </tr> @for (int i = 0; i < Model.StudentList.Count(); i++) { <tr> <td> @Model.StudentList[i].FullName </td> <td> @Model.StudentList[i].MatricNumber </td> <td> @Html.ActionLink("Edit", "EditMatricNumber", "Support", new { area = "Admin", sid = Model.StudentList[i].Id }, new { @class = "btn btn-success btn-md " }) </td> </tr> } </table> <blockquote><small>Check if the records belong to one student and click on the Fix Duplicate Button Or you can Edit the Matric Number if Different Students</small></blockquote> </div> <div class="form-group"> <div class="col-md-12"> <a href="/Admin/Support/FixDuplicateMatricNumber" class="btn btn-success mr5">Fix Duplicate</a> </div> </div> </div> </div> </div> } </div> <div class="col-md-1"></div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJAMBFormPaymentViewModel @{ ViewBag.Title = "Bank Payment"; Layout = "~/Views/Shared/_Layout.cshtml"; } <br/> <br/> <br/> <br/> @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function() { $("#myForm").submit(); }); </script> } @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div> <img src="~/Content/Images/loading.gif" /> </div> <form method='POST' action='https://www.etranzact.net/bankIT/' id="myForm"> <input type="hidden" name="TERMINAL_ID" value="@Model.BankItRequest.TerminalId"> <input type="hidden" name="TRANSACTION_ID" value="@Model.BankItRequest.TransactionId"> <input type="hidden" name="AMOUNT" value="@Model.BankItRequest.Amount"> <input type="hidden" name="DESCRIPTION" value="@Model.BankItRequest.Description"> <input type="hidden" name="RESPONSE_URL" value="@Model.BankItRequest.ResponseUrl"> <input type="hidden" name="NOTIFICATION_URL" value="@Model.BankItRequest.NotificationUrl"> <input type="hidden" name="CHECKSUM" value="@Model.BankItRequest.Checksum"> <input type="hidden" name="LOGO_URL" value="http://portal.abiastateuniversity.edu.ng/Content/Images/school_logo1.png"> @*<input class="btn btn-primary btn-lg mr5" type="submit" name="submit" id="submit" value="Submit" />*@ </form> <file_sep>@{ Layout = null; } <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" /> <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <br /> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-upload"></i>Download File</h3> </div> <div class="panel-body"> <div class="form-group" style="text-align: center"> <div class="col-sm-10 pull-left"> @Html.ActionLink("Donwload Zip", "DownloadUnderGraduateNominal", new { controller = "StaffCourseAllocation" }, new { @class = "btn btn-success mr5" }) <a href="~/Reports/Presenter/StudentNominalReport.aspx" class="btn btn-success mr5">Back</a> </div> </div> </div> </div> </div> <div class="col-md-1"></div> </div><file_sep>@model Abundance_Nk.Web.Areas.Student.ViewModels.RegistrationViewModel @{ ViewBag.Title = "Form"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function() { $("#StudentFinanceInformation_Mode_Id").change(function() { var modeOfFinance = $("#StudentFinanceInformation_Mode_Id").val(); if (modeOfFinance == "3") { var sponsorname = $("#Person_LastName").val() + " " + $("#Person_FirstName").val(); var sponsorPhone = $("#Person_MobilePhone").val(); var sponsorEmail = $("#Person_Email").val(); var sponsorAddress = $("#Student_SchoolContactAddress").val(); $("#StudentSponsor_Name").val(sponsorname); $("#StudentFinanceInformation_ScholarshipTitle").val("SELF"); $("#StudentSponsor_Relationship_Id").val("14"); $("#StudentSponsor_MobilePhone").val(sponsorPhone); $("#StudentSponsor_Email").val(sponsorEmail); $("#StudentSponsor_ContactAddress").val(sponsorAddress); } else { $("#StudentSponsor_Name").val(""); $("#StudentFinanceInformation_ScholarshipTitle").val(""); $("#StudentSponsor_Relationship_Id").val(""); $("#StudentSponsor_MobilePhone").val(""); } }); $("#Person_State_Id").change(function() { $("#Person_LocalGovernment_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetLocalGovernmentsByState")', //we are calling json method dataType: 'json', data: { id: $("#Person_State_Id").val() }, success: function(lgas) { $("#Person_LocalGovernment_Id").append('<option value="' + 0 + '">-- Select --</option>'); $.each(lgas, function(i, lga) { $("#Person_LocalGovernment_Id").append('<option value="' + lga.Value + '">' + lga.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve lgas.' + ex); } }); return false; }); $("#Person_MonthOfBirth_Id").change(function() { SetDay($("#Person_DayOfBirth_Id"), $("#Person_MonthOfBirth_Id"), $("#Person_YearOfBirth_Id")); }); $("#PreviousEducation_StartMonth_Id").change(function() { SetDay($("#PreviousEducation_StartDay_Id"), $("#PreviousEducation_StartMonth_Id"), $("#PreviousEducation_StartYear_Id")); }); $("#PreviousEducation_EndMonth_Id").change(function() { SetDay($("#PreviousEducation_EndDay_Id"), $("#PreviousEducation_EndMonth_Id"), $("#PreviousEducation_EndYear_Id")); }); $("#StudentNdResult_MonthAwarded_Id").change(function() { SetDay($("#StudentNdResult_DayAwarded_Id"), $("#StudentNdResult_MonthAwarded_Id"), $("#StudentNdResult_YearAwarded_Id")); }); $("#StudentEmploymentInformation_StartMonth_Id").change(function() { SetDay($("#StudentEmploymentInformation_StartDay_Id"), $("#StudentEmploymentInformation_StartMonth_Id"), $("#StudentEmploymentInformation_StartYear_Id")); }); $("#StudentEmploymentInformation_EndMonth_Id").change(function() { SetDay($("#StudentEmploymentInformation_EndDay_Id"), $("#StudentEmploymentInformation_EndMonth_Id"), $("#StudentEmploymentInformation_EndYear_Id")); }); initSimpleFileUpload(); $("#hl-start-upload").on('click', function() { if (jqXHRData) { jqXHRData.submit(); } return false; }); $("#fu-my-simple-upload").on('change', function() { $("#tbx-file-path").val(this.files[0].name); }); $(".exist").prop('disabled', true); $("#submit2").on('click', function(e) { e.preventDefault(); $.ajax({ type: "POST", url: '@Url.Action("Form", "Information")', traditional: true, datatype: 'json', data: $("#frmForm").serialize(), beforeSend: function() { $("#busy").show(); }, complete: function() { $("#busy").hide(); }, success: function(data) { }, error: function() { alert("Operation failed!"); } }); return false; }); }); function initSimpleFileUpload() { 'use strict'; $('#fu-my-simple-upload').fileupload({ url: '@Url.Content("~/Student/Registration/UploadFile")', dataType: 'json', add: function(e, data) { jqXHRData = data; }, send: function(e) { $('#fileUploadProgress').show(); }, done: function(event, data) { if (data.result.isUploaded) { //alert("success"); } else { $("#tbx-file-path").val(""); alert(data.result.message); } //alert(data.result.imageUrl); $('#passport').attr('src', data.result.imageUrl); $('#fileUploadProgress').hide(); }, fail: function(event, data) { if (data.files[0].error) { alert(data.files[0].error); } } }); } function SetDay(ddlDay, ddlMonth, ddlYear) { ddlDay.empty(); var selectedMonth = ddlMonth.val(); var selectedYear = ddlYear.val(); if (selectedYear == '') { alert('Please select Year!'); ddlMonth.val(""); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy", "Information")', // we are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, success: function(days) { ddlDay.append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function(i, day) { ddlDay.append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, error: function(ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; } function beginRequest() { $("#busy").hide(); } function endRequest(request, status) { $("#busy").show(); } </script> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-12 "> <div class="col-md-1"></div> <div class="col-md-10"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> @using (Html.BeginForm("Form", "Registration", FormMethod.Post, new {id = "frmForm", enctype = "multipart/form-data"})) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <center> <div class="alert alert-success fade in nomargin"> <h2><b>@Model.StudentLevel.Programme.Name</b></h2> <p>Kindly fill all the fields provided in this form before clicking the Submit button</p> </div> <br /> </center> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Student Personal Information</div> @if (Model.Student != null && Model.Student.Id > 0) { @Html.HiddenFor(model => model.Student.Id) } @if (Model.StudentLevel.DepartmentOption != null && Model.StudentLevel.DepartmentOption.Id > 0) { @Html.HiddenFor(model => model.StudentLevel.DepartmentOption.Id) @Html.HiddenFor(model => model.StudentLevel.DepartmentOption.Name) } @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Programme.Name) @Html.HiddenFor(model => model.Programme.ShortName) @Html.HiddenFor(model => model.StudentLevel.Programme.Id) @Html.HiddenFor(model => model.StudentLevel.Programme.Name) @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.HiddenFor(model => model.StudentLevel.Department.Name) @Html.HiddenFor(model => model.StudentLevel.Department.Faculty.Id) @Html.HiddenFor(model => model.StudentLevel.Department.Faculty.Name) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.StudentAlreadyExist) @Html.HiddenFor(model => model.Payment.Id) </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Title.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.Student.Title.Id, (IEnumerable<SelectListItem>) ViewBag.Titles, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Student.Title.Id, null, new {@class = "text-danger"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Person.LastName) @Html.LabelFor(model => model.Person.LastName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.LastName, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.Person.LastName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Person.FirstName) @Html.LabelFor(model => model.Person.FirstName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.FirstName, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.Person.FirstName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Person.OtherName) @Html.LabelFor(model => model.Person.OtherName, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.OtherName, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.Person.OtherName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Person.Sex.Id)*@ @Html.LabelFor(model => model.Person.Sex.Id, new {@class = "control-label "}) @Html.DropDownListFor(f => f.Person.Sex.Id, (IEnumerable<SelectListItem>) ViewBag.Sexes, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.Person.Sex.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Student.MaritalStatus.Id)*@ @Html.LabelFor(model => model.Student.MaritalStatus.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(f => f.Student.MaritalStatus.Id, (IEnumerable<SelectListItem>) ViewBag.MaritalStatuses, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Student.MaritalStatus.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div>Date of Birth</div> @Html.DropDownListFor(m => m.Person.YearOfBirth.Id, (IEnumerable<SelectListItem>) ViewBag.YearOfBirths, new {@class = "form-control "}) @Html.DropDownListFor(m => m.Person.MonthOfBirth.Id, (IEnumerable<SelectListItem>) ViewBag.MonthOfBirths, new {@class = "form-control "}) @Html.DropDownListFor(m => m.Person.DayOfBirth.Id, (IEnumerable<SelectListItem>) ViewBag.DayOfBirths, new {@class = "form-control "}) <div> <div class="form-group"> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Person.Religion.Id)*@ @Html.LabelFor(model => model.Person.Religion.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Person.Religion.Id, (IEnumerable<SelectListItem>) ViewBag.Religions, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Person.Religion.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Person.State.Id) @Html.LabelFor(model => model.Person.State.Id, new {@class = "control-label "}) @Html.DropDownListFor(f => f.Person.State.Id, (IEnumerable<SelectListItem>) ViewBag.States, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.Person.State.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Person.LocalGovernment.Id)*@ @Html.LabelFor(model => model.Person.LocalGovernment.Id, new {@class = "control-label "}) @Html.DropDownListFor(f => f.Person.LocalGovernment.Id, (IEnumerable<SelectListItem>) ViewBag.Lgas, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.Person.LocalGovernment.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Person.HomeTown)*@ @Html.LabelFor(model => model.Person.HomeTown, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.HomeTown, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.Person.HomeTown) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new {@class = "control-label "}) @if (Model.Person.MobilePhone == null) { @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control"}) } else { @Html.HiddenFor(model => model.Person.MobilePhone) @Html.TextBoxFor(model => model.Person.MobilePhone, new {@class = "form-control exist"}) } @Html.ValidationMessageFor(model => model.Person.MobilePhone, null, new {@class = "text-danger"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.SchoolContactAddress, new {@class = "control-label "})<label style="font-size: 11pt; font-weight: bold;" class="text-danger">*</label> @Html.TextBoxFor(model => model.Student.SchoolContactAddress, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Student.SchoolContactAddress) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.BloodGroup.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Student.BloodGroup.Id, (IEnumerable<SelectListItem>) ViewBag.BloodGroups, new {@class = "form-control"}) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Genotype.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.Student.Genotype.Id, (IEnumerable<SelectListItem>) ViewBag.Genotypes, new {@class = "form-control"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Person.Email) @Html.LabelFor(model => model.Person.Email, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Person.Email, new {@class = "form-control "}) </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Student Academic Details</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentAcademicInformation.ModeOfEntry.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentAcademicInformation.ModeOfEntry.Id, (IEnumerable<SelectListItem>) ViewBag.ModeOfEntries, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentAcademicInformation.ModeOfEntry.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentAcademicInformation.ModeOfStudy.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentAcademicInformation.ModeOfStudy.Id, (IEnumerable<SelectListItem>) ViewBag.ModeOfStudies, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentAcademicInformation.ModeOfStudy.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Programme.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.Programmes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentLevel.Programme.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentLevel.Department.Faculty.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Department.Faculty.Id, (IEnumerable<SelectListItem>) ViewBag.Faculties, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Faculty.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.StudentLevel.Department.Id) @Html.Label("Department", new {@class = "control-label "}) @Html.DropDownListFor(model => model.StudentLevel.Department.Id, (IEnumerable<SelectListItem>) ViewBag.Departments, new {@class = "form-control exist"}) @Html.ValidationMessageFor(model => model.StudentLevel.Department.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.Label("Course of Study", new { @class = "control-label " }) @Html.DropDownListFor(model => model.StudentLevel.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptions, new { @class = "form-control exist" }) @Html.ValidationMessageFor(model => model.StudentLevel.DepartmentOption.Id)*@ </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Type.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.Student.Category.Id, (IEnumerable<SelectListItem>) ViewBag.StudentCategories, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Student.Category.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Student.Status.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.Student.Type.Id, (IEnumerable<SelectListItem>) ViewBag.StudentTypes, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Student.Type.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.Student.MatricNumber) @Html.LabelFor(model => model.Student.MatricNumber, new {@class = "control-label "}) @Html.TextBoxFor(model => model.Student.MatricNumber, new {@class = "form-control exist"}) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentAcademicInformation.Level.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentAcademicInformation.Level.Id, (IEnumerable<SelectListItem>) ViewBag.Levels, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentAcademicInformation.Level.Id) </div> </div> @*<div class="col-md-6"> <div class="form-group"> @Html.HiddenFor(model => model.ApplicantJambDetail.JambRegistrationNumber) @Html.LabelFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ApplicantJambDetail.JambRegistrationNumber, new { @class = "form-control applicant" }) </div> </div>*@ </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentAcademicInformation.YearOfAdmission, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentAcademicInformation.YearOfAdmission, (IEnumerable<SelectListItem>) ViewBag.AdmissionYears, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentAcademicInformation.YearOfAdmission) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentAcademicInformation.YearOfGraduation, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentAcademicInformation.YearOfGraduation, (IEnumerable<SelectListItem>) ViewBag.GraduationYears, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentAcademicInformation.YearOfGraduation) </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Student Finance Details</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentFinanceInformation.Mode.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentFinanceInformation.Mode.Id, (IEnumerable<SelectListItem>) ViewBag.ModeOfFinances, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentFinanceInformation.Mode.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentFinanceInformation.ScholarshipTitle, new {@class = "control-label "}) @Html.TextBoxFor(model => model.StudentFinanceInformation.ScholarshipTitle, new {@class = "form-control"}) </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Next of Kin Details</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Sponsor.Name)*@ @Html.LabelFor(model => model.NextOfKin.Name, new {@class = "control-label "}) @Html.TextBoxFor(model => model.NextOfKin.Name, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.NextOfKin.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @*@Html.HiddenFor(model => model.Sponsor.ContactAddress)*@ @Html.LabelFor(model => model.NextOfKin.ContactAddress, new {@class = "control-label "}) @Html.TextBoxFor(model => model.NextOfKin.ContactAddress, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.NextOfKin.ContactAddress) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.NextOfKin.Relationship.Id, new {@class = "control-label "}) @Html.DropDownListFor(model => model.NextOfKin.Relationship.Id, (IEnumerable<SelectListItem>) ViewBag.Relationships, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.NextOfKin.Relationship.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.NextOfKin.MobilePhone, new {@class = "control-label "}) @Html.TextBoxFor(model => model.NextOfKin.MobilePhone, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.NextOfKin.MobilePhone) </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Sponsor Details</div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentSponsor.Name, new {@class = "control-label "})<label class="text-danger">*</label> @Html.TextBoxFor(model => model.StudentSponsor.Name, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentSponsor.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentSponsor.ContactAddress, new {@class = "control-label "})<label class="text-danger">*</label> @Html.TextBoxFor(model => model.StudentSponsor.ContactAddress, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentSponsor.ContactAddress) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentSponsor.Relationship.Id, new {@class = "control-label "})<label class="text-danger">*</label> @Html.DropDownListFor(model => model.StudentSponsor.Relationship.Id, (IEnumerable<SelectListItem>) ViewBag.Relationships, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentSponsor.Relationship.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.StudentSponsor.MobilePhone, new {@class = "control-label "})<label class="text-danger">*</label> @Html.TextBoxFor(model => model.StudentSponsor.MobilePhone, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.StudentSponsor.MobilePhone) </div> </div> </div> <div class="row"> <div class="col-md-6"> @Html.LabelFor(model => model.StudentSponsor.Email, new {@class = "control-label "}) @Html.TextBoxFor(model => model.StudentSponsor.Email, new {@class = "form-control"}) </div> <div class="col-md-6"> <div class="form-group"> </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">O-Level Result</div> </div> <div class="panel-body"> <div class="row" id="divOLevel"> <div class="col-md-6"> <h5>First Sitting</h5> <hr class="no-top-padding" /> <div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>) ViewBag.FirstSittingOLevelTypes, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.Type.Id) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamNumber) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @Html.DropDownListFor(model => model.FirstSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>) ViewBag.FirstSittingExamYears, new {@class = "form-control "}) @Html.ValidationMessageFor(model => model.FirstSittingOLevelResult.ExamYear) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @*@Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id)*@ @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelSubjectId" + i], new {@class = "form-control "}) </td> <td> @*@Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id)*@ @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>) ViewData["FirstSittingOLevelGradeId" + i], new {@class = "form-control "}) </td> </tr> } </table> </div> <div class="col-md-6"> <h5>Second Sitting</h5> <hr class="no-top-padding" /> <div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new {@class = "control-label col-md-3"}) <div class="col-md-9"> @*@Html.HiddenFor(model => model.SecondSittingOLevelResult.Type.Id)*@ @Html.DropDownListFor(model => model.SecondSittingOLevelResult.Type.Id, (IEnumerable<SelectListItem>) ViewBag.SecondSittingOLevelTypes, new {@class = "form-control "}) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @*@Html.HiddenFor(model => model.SecondSittingOLevelResult.ExamNumber)*@ @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new {@class = "form-control "}) </div> </div> <div class="form-group "> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new {@class = "control-label col-md-3"}) <div class="col-md-9"> @*@Html.HiddenFor(model => model.SecondSittingOLevelResult.ExamYear)*@ @Html.DropDownListFor(model => model.SecondSittingOLevelResult.ExamYear, (IEnumerable<SelectListItem>) ViewBag.SecondSittingExamYears, new {@class = "form-control "}) </div> </div> </div> <table class="table table-condensed table-responsive" style="background-color: whitesmoke"> <tr> <th> Subject </th> <th> Grade </th> <th></th> </tr> @for (int i = 0; i < 9; i++) { <tr> <td> @*@Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id)*@ @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelSubjectId" + i], new {@class = "form-control "}) </td> <td> @*@Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id)*@ @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name) @Html.DropDownListFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id, (IEnumerable<SelectListItem>) ViewData["SecondSittingOLevelGradeId" + i], new {@class = "form-control "}) </td> </tr> } </table> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Passport Photograph</div> </div> <div class="panel-body"> <div class="row "> <div class="col-md-6 "> </div> <div class="col-md-6 "> <div class="panel-body"> <div class="row"> <div class="col-md-12 padding-bottom-3"> @*<img id="passport" src="@Url.Content('~' + Model.Person.ImageFileUrl)" alt="" style="max-width:150px" />*@ <img id="passport" src="@Model.Person.ImageFileUrl" alt="" style="max-width: 150px" /> </div> </div> <div class="row padding-bottom-5"> <div class="col-md-6 "> @Html.HiddenFor(model => model.Person.ImageFileUrl, new {id = "hfPassportUrl", name = "hfPassportUrl"}) <input type="text" id="tbx-file-path" readonly="readonly" /> </div> <div class="col-md-6"> @Html.TextBoxFor(m => m.PassportFile, new {id = "fu-my-simple-upload", type = "file", style = "color:transparent;"}) </div> </div> <div class="row padding-bottom-10"> <div class="col-md-12"> <input class="btn btn-default btn-metro applicant" type="submit" name="hl-start-upload" id="hl-start-upload" value="Upload Passport" /> </div> </div> <div class="row"> <div class="col-md-12"> <div id="fileUploadProgress" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Uploading ...</span> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <blockquote> <i class="fa fa-quote-left"></i> <p> To upload your passport, scan and save the passport in the computer file system. Click on the Choose File button shown above to display the file dialog box. Select the passport file from the saved location. Then click on the Upload Passport button above to upload your passport to the system. </p> <small>Please note that the passport photo background should be plain (white or clear) and passport size should not be more than 20kb. The file format must be in either .gif, .jpeg, .jpg or .bmp file format.<cite title="Source Title"></cite></small> </blockquote> </div> </div> </div> </div> <div class="form-actions no-color"> <div class="form-inline"> <div class="form-group"> <button class="btn btn-white btn-lg" type="submit" name="submit" id="submit">Next</button> </div> <div class="form-group"> <div id="busy" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Processing ...</span> </div> </div> </div> </div> <div> @if (TempData["Message"] != null) { <br /> @Html.Partial("_Message", TempData["Message"]) } </div> } </div> <div class="col-md-1"></div> </div> </div> </div> </div> </div> </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Abundance_Nk.Web.Models.Intefaces; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter.Result { public partial class StatementOfSemesterResult :Page,IReport { public Student Student { get; set;} //public Level selectedLevel //{ // get // { // return new Level // { // Id = Convert.ToInt32(ddlLevel.SelectedValue), // Name = ddlLevel.SelectedItem.Text // }; // } // set { ddlLevel.SelectedValue = value.Id.ToString(); } //} //public Session selectedSession //{ // get // { // return new Session // { // Id = Convert.ToInt32(ddlSession.SelectedValue), // Name = ddlSession.SelectedItem.Text // }; // } // set { ddlSession.SelectedValue = value.Id.ToString(); } //} //public Semester selectedSemester //{ // get // { // return new Semester // { // Id = Convert.ToInt32(ddlSemester.SelectedValue), // Name = ddlSemester.SelectedItem.Text // }; // } // set { ddlLevel.SelectedValue = value.Id.ToString(); } //} //public Programme Programme //{ // get // { // return new Programme // { // Id = Convert.ToInt32(ddlProgramme.SelectedValue), // Name = ddlProgramme.SelectedItem.Text // }; // } // set { ddlProgramme.SelectedValue = value.Id.ToString(); } //} //public Department Department //{ // get // { // return new Department // { // Id = Convert.ToInt32(ddlDepartment.SelectedValue), // Name = ddlDepartment.SelectedItem.Text // }; // } // set { ddlDepartment.SelectedValue = value.Id.ToString(); } //} //public Student Student //{ // get // { // return new Student { Id = Convert.ToInt32(ddlStudent.SelectedValue),Name = ddlStudent.SelectedItem.Text }; // } // set { ddlStudent.SelectedValue = value.Id.ToString(); } //} //public SessionSemester SelectedSession //{ // get // { // return new SessionSemester // { // Id = Convert.ToInt32(ddlSession.SelectedValue), // Name = ddlSession.SelectedItem.Text // }; // } // set { ddlSession.SelectedValue = value.Id.ToString(); } //} public string Message { get { return lblMessage.Text; } set { lblMessage.Text = value; } } public ReportViewer Viewer { get { return rv; } set { rv = value; } } public int ReportType { get { throw new NotImplementedException(); } } protected async void Page_Load(object sender,EventArgs e) { try { Message = ""; if (!IsPostBack) { //PopulateAllDropDown(); //ddlSession.Visible = true; //ddlLevel.Visible = true; //ddlSemester.Visible = true; //btnDisplayReport.Visible = true; long sid = Convert.ToInt64(Request["sid"]); int semesterId = Convert.ToInt32(Request["semid"]); int sessionId = Convert.ToInt32(Request["sesid"]); if (sid > 0 && semesterId > 0 && sessionId > 0) { StudentLogic studentLogic = new StudentLogic(); Student = studentLogic.GetBy(sid); if (Student == null || Student.Id <= 0) { lblMessage.Text = "No student record found"; return; } var studentLevelLogic = new StudentLevelLogic(); var sessionSemesterLogic = new SessionSemesterLogic(); SessionSemester sessionSemester = sessionSemesterLogic.GetBySessionSemester(semesterId, sessionId); StudentLevel studentLevel = studentLevelLogic.GetBy(Student.Id); CourseRegistrationLogic courseRegistrationLogic = new CourseRegistrationLogic(); if (studentLevel != null) { CourseRegistration courseRegistration = courseRegistrationLogic.GetModelsBy(s => s.Session_Id == sessionId && s.Person_Id == Student.Id && s.Department_Id == studentLevel.Department.Id && s.Programme_Id == studentLevel.Programme.Id).LastOrDefault(); if (courseRegistration != null) await DisplayReportBy(sessionSemester, courseRegistration.Level, studentLevel.Programme, studentLevel.Department, Student); } else { lblMessage.Text = "No result to display"; rv.Visible = false; } } else { lblMessage.Text = "Invalid Parameter"; rv.Visible = false; } } } catch(Exception ex) { lblMessage.Text = ex.Message; } } private async Task DisplayReportBy(SessionSemester session,Level level,Programme programme,Department department,Student student) { try { var scoreGradeLogic = new ScoreGradeLogic(); var resultLogic = new StudentResultLogic(); var academicStandingLogic = new AcademicStandingLogic(); List<Model.Model.Result> results = await resultLogic.GetStudentResultByAsync(session,level,programme,department,student); List<StatementOfResultSummary> resultSummaries = new List<StatementOfResultSummary>(); //List<StatementOfResultSummary> resultSummaries = resultLogic.GetStatementOfResultSummaryBy(session, // level,programme,department,student); string bind_ds = "dsMasterSheet"; string bind_resultSummary = "dsResultSummary"; string reportPath = @"Reports\Result\StatementOfResult.rdlc"; if(results != null && results.Count > 0) { string appRoot = ConfigurationManager.AppSettings["AppRoot"]; foreach(Model.Model.Result result in results) { if(!string.IsNullOrWhiteSpace(result.PassportUrl)) { result.PassportUrl = appRoot + result.PassportUrl; } else { result.PassportUrl = appRoot + Utility.DEFAULT_AVATAR; } } } rv.Reset(); rv.LocalReport.DisplayName = "Statement of Result"; rv.LocalReport.ReportPath = reportPath; rv.LocalReport.EnableExternalImages = true; if(results != null && results.Count > 0) { rv.ProcessingMode = ProcessingMode.Local; rv.LocalReport.DataSources.Add(new ReportDataSource(bind_ds.Trim(),results)); rv.LocalReport.DataSources.Add(new ReportDataSource(bind_resultSummary.Trim(),resultSummaries)); rv.LocalReport.Refresh(); rv.Visible = true; } else { lblMessage.Text = "No course registration found!"; rv.Visible = false; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } //private void PopulateAllDropDown() //{ // try // { // Utility.BindDropdownItem(ddlSession,Utility.GetAllSessions(),Utility.ID,Utility.NAME); // Utility.BindDropdownItem(ddlLevel,Utility.GetAllLevels(),Utility.ID,Utility.NAME); // Utility.BindDropdownItem(ddlSemester,Utility.GetAllSemesters(),Utility.ID,Utility.NAME); // } // catch(Exception ex) // { // lblMessage.Text = ex.Message; // } //} //private bool InvalidUserInput() //{ // try // { // if(selectedLevel == null || selectedLevel.Id <= 0) // { // lblMessage.Text = "Please select Level"; // return true; // } // if(SelectedSession == null || SelectedSession.Id <= 0) // { // lblMessage.Text = " Session not set! Please contact your system administrator."; // return true; // } // if(selectedSemester == null || selectedSemester.Id <= 0) // { // lblMessage.Text = " Semester not set! Please contact your system administrator."; // return true; // } // return false; // } // catch(Exception) // { // throw; // } //} //protected async void btnDisplayReport_Click(object sender,EventArgs e) //{ // try // { // //if(InvalidUserInput()) // //{ // // return; // //} // long sid = Convert.ToInt64(Request["sid"]); // int semesterId = Convert.ToInt32(Request["semid"]); // int sessionId = Convert.ToInt32(Request["sesid"]); // StudentLogic studentLogic = new StudentLogic(); // Student = studentLogic.GetBy(sid); // if(Student == null || Student.Id <= 0) // { // lblMessage.Text = "No student record found"; // return; // } // var studentLevelLogic = new StudentLevelLogic(); // var sessionSemesterLogic = new SessionSemesterLogic(); // SessionSemester sessionSemester = sessionSemesterLogic.GetBySessionSemester(semesterId, sessionId); // StudentLevel studentLevel = studentLevelLogic.GetBy(Student.Id); // CourseRegistrationLogic courseRegistrationLogic = new CourseRegistrationLogic(); // if (studentLevel != null) // { // CourseRegistration courseRegistration = await courseRegistrationLogic.GetModelByAsync(s => // s.Session_Id == sessionId && s.Person_Id == Student.Id && // s.Department_Id == studentLevel.Department.Id && s.Programme_Id == studentLevel.Programme.Id); // await DisplayReportBy(sessionSemester, courseRegistration.Level, studentLevel.Programme, studentLevel.Department, Student); // } // else // { // lblMessage.Text = "No result to display"; // rv.Visible = false; // } // } // catch(Exception ex) // { // lblMessage.Text = ex.Message; // } //} } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.GstViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-1"></div> <div class="col-md-10"> <div class="row"> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> </div> @using(Html.BeginForm("Index","GstScan",FormMethod.Post,new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <div class="row"> <h3>Scan GST</h3> <hr style="margin-top: 0" /> <div class="col-md-12"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Programme.Id,"Programme",new { @class = "control-label " }) @Html.DropDownListFor(model => model.Programme.Id,(IEnumerable<SelectListItem>)ViewBag.Programmes,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Programme.Id,null,new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Department.Id,"Department",new { @class = "control-label " }) @Html.DropDownListFor(model => model.Department.Id,(IEnumerable<SelectListItem>)ViewBag.Departments,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Department.Id,null,new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.GstScanAnswer.description,"Answer",new { @class = "control-label " }) @Html.DropDownListFor(model => model.GstScanAnswer.description,(IEnumerable<SelectListItem>)ViewBag.Answers,new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.GstScanAnswer.description,null,new { @class = "text-danger" }) </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="control-label ">File</label> <input type="file" class="form-control" name="file" id="file2" /> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label ">Enter Course Code</label> <input type="text" class="form-control" name="course_code" id="course_code" /> </div> </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Upload" class="btn btn-primary" /> </div> </div> </div> </div> } @if(Model.ScannedFile != null && !String.IsNullOrEmpty(Model.ScannedFile)) { using(Html.BeginForm("Scan","GstScan",FormMethod.Post,new { enctype = "multipart/form-data" })) { <div class="row"> @Html.AntiForgeryToken() @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.GstScanAnswer.description) @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Department.Id) @Html.HiddenFor(model => model.GstScan.Id) @Html.HiddenFor(model => model.ScannedFilePath) @Html.HiddenFor(model => model.ScannedFile) <div style="width:500px;height:500px; border:solid 1px black; "> @Html.TextArea("content",@Model.ScannedFile,new { style = "height:100%;width:100%" }) </div> </div> <div class="form-group"> <div class="col-md-offset-8 col-md-10"> <input type="submit" value="Score" class="btn btn-success" /> </div> </div> } } </div> </div> </div> <file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Create O-Level Grade"; } @Html.Partial("BasicSetup/_Create", @Model)<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.TranscriptViewModel @{ ViewBag.Title = "TranscriptReport"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @*<script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/jquery-2.1.3.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <script src="~/Content/js/bootstrap.js"></script> <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script src="~/Scripts/dataTables.js"></script> <script src="~/Scripts/jquery-3.3.1.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script>*@ <script src="~/Scripts/jquery-2.1.3.js"></script> <link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/js/plugins/jquery/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#myTable").DataTable(); //Programme Drop down Selected-change event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "Report")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Get departmentOption $("#Department").change(function () { var departmentId = $("#Department").val(); var programmeId = $("#Programme").val(); $("#DepartmentOption").empty(); if (programmeId > 0 && departmentId > 0 && (departmentId == 97 || departmentId == 91 || departmentId == 101 || departmentId == 100 || departmentId == 29 || departmentId == 102)) { $.ajax({ type: 'POST', url: '@Url.Action("GetDepartmentOptions", "Report")', // Calling json method traditional: true, data: { id: programmeId, departmentId: departmentId }, success: function (departmentOptions) { $("#DepartmentOption").append('<option value="' + 0 + '">' + '-- Select Department Option --' + '</option>'); $.each(departmentOptions, function (i, option) { $("#DepartmentOption").append('<option value="' + option.Value + '">' + option.Text + '</option>'); }); $("#optionDiv").show(); }, error: function(ex) { alert('Failed to retrieve courses.' + ex); } }); } }) }) </script> <div class="container"> <div class="col-md-12 card p-5"> <div class=" text-success"> <h1><b>Students Transcript Report</b></h1> </div> <section id="loginForm"> @using (Html.BeginForm("TranscriptReport", "Report", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @*<h5>Please enter your <b>Matriculation Number</b> in the box below to generate your School Fees invoice</h5>*@ <hr class="no-top-padding" /> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Programme.Name, "Programme", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(m => m.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme" }) @Html.ValidationMessageFor(m => m.Programme.Id, null, new { @class = "text-danger" }) </div> </div> @*<div class="form-group"> @Html.LabelFor(m => m.Semester.Name, "Semester", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(m => m.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Semester.Id, null, new { @class = "text-danger" }) </div> </div>*@ <div class="form-group"> @Html.LabelFor(m => m.Department.Name, "Department", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(m => m.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", id = "Department" }) @Html.ValidationMessageFor(m => m.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group" id="optionDiv" style="display:none"> @Html.LabelFor(model => model.DepartmentOption.Name, "Department Option", new { @class = "col-md-4 control-label " }) <div class="col-md-8"> @Html.DropDownListFor(model => model.DepartmentOption.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOption, new { @class = "form-control", @id = "DepartmentOption" }) @Html.ValidationMessageFor(model => model.DepartmentOption.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Level.Name, "Level", new { @class = "col-md-4 control-label" }) <div class="col-md-8"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-4 col-md-8"> <input type="submit" value="Display" class="btn btn-primary" /> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> </div> } </section> </div> </div> <div class="col-md-12"> @if (@Model.StudentLevels != null && @Model.StudentLevels.Count > 0) { <div class="panel-body"> <div class="col-md-12"> <h3 class="text-center">List of Students</h3> <table class="table table-bordered table-hover table-striped" id="myTable"> <thead> <tr> <th>S/N</th> <th>FULL NAME</th> <th>MATRIC NO.</th> <th>ACTION</th> </tr> </thead> <tbody> @for (int i = 0; i < @Model.StudentLevels.Count; i++) { int sn = i + 1; <tr> <td>@sn</td> <td>@Model.StudentLevels[i].Student.FullName</td> <td>@Model.StudentLevels[i].Student.MatricNumber</td> <td>@Html.ActionLink("View Transcript", "ViewTranscript", new { sid = @Model.StudentLevels[i].Student.Id.ToString(), area = "admin", controller = "report" }, new { @class = "btn btn-success" })</td> </tr> } </tbody> @*<tfoot> <tr> <th>S/N</th> <th>FULL NAME</th> <th>MATRIC NO.</th> <th>ACTION</th> </tr> </tfoot>*@ </table> <br /> </div> </div> } </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Reset Student Password"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div style="font-size: x-large">Reset Student Password</div> </div> <div class="panel-body"> @using(Html.BeginForm("ResetStudentPassword","Support",new { area = "Admin" },FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.Student.MatricNumber,"Matriculation Number",htmlAttributes:new { @class = "control-label col-md-2" }) <div class="col-md-6"> @Html.TextBoxFor(model => model.Student.MatricNumber,new { @class = "form-control",@placeholder = "Enter Matric Number",@required = "required" }) @Html.ValidationMessageFor(model => model.Student.MatricNumber,"",new { @class = "text-danger" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Reset" class="btn btn-success mr5" /> </div> </div> </div> } </div> </div> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.ResultUploadViewModel @{ ViewBag.Title = "Edit Result"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h2>Edit Result</h2> <div class="panel panel-default"> <div class="panel-body"> <div class="col-md-12"> <div> <p class="text-center"><h3>CORRECT RESULT DETAILS</h3></p> </div> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> </div> @using (Html.BeginForm("EditResult", "Result", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div class="panel panel-default "> <div class="panel-body "> <div class="form-group"> @Html.LabelFor(model => model.student.MatricNumber, new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.student.MatricNumber, new { @class = "form-control", @placeholder = "Enter Matric No" }) @Html.ValidationMessageFor(model => model.student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.Label("Select Session and Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.StudentResult.SessionSemester.Id, (IEnumerable<SelectListItem>)ViewBag.SessionSemesters, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentResult.SessionSemester.Id, null, new { @class = "text-danger" }) @Html.HiddenFor(model=> model.StudentResult.SessionSemester.Session.Id) @Html.HiddenFor(model => model.StudentResult.SessionSemester.Semester.Id) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> </div> </div> </div> </div> } @if (Model == null || Model.StudentCourseRegistrationDetails == null || Model.StudentCourseRegistrationDetails.Count == 0) { return; } @using (Html.BeginForm("UpdateResult", "Result", FormMethod.Post)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div> <div class="form-group text-bold"> @Html.Label("Student Full name", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.StudentCourseRegistrationDetails[0].CourseRegistration.Student.FullName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentResultDetails[0].Student.FullName, null, new { @class = "text-danger" }) </div> </div> <div class="form-group text-bold"> @Html.Label("Student Matric No.", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DisplayFor(model => model.StudentCourseRegistrationDetails[0].CourseRegistration.Student.MatricNumber, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StudentCourseRegistrationDetails[0].CourseRegistration.Student.MatricNumber, null, new { @class = "text-danger" }) </div> </div> </div> <table class="table table table-bordered table-hover table-striped"> <thead> <tr> <th>Code</th> <th>Test Score</th> <th>Exam Score</th> <th>Special Case</th> </tr> </thead> <tbody style="color:black;"> @for (int i = 0; i < Model.StudentCourseRegistrationDetails.Count; i++) { <tr> <td>@Html.DisplayFor(model => model.StudentCourseRegistrationDetails[i].Course.Code, new {@class = "form-control"})</td> @*@if (Model.StudentCourseRegistrationDetails[i].SpecialCase != null) { <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].SpecialCase, new { @class = "form-control" })</td> <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].SpecialCase, new { @class = "form-control" })</td> } else { <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].TestScore, new { @class = "form-control" })</td> <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].ExamScore, new { @class = "form-control" })</td> }*@ <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].TestScore, new { @class = "form-control" })</td> <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].ExamScore, new {@class = "form-control"})</td> <td>@Html.TextBoxFor(model => model.StudentCourseRegistrationDetails[i].SpecialCase, new { @class = "form-control" })</td> @Html.HiddenFor(model => model.StudentCourseRegistrationDetails[i].Id) </tr> } </tbody> </table> <div class="form-group"> <div class="col-sm-2"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Save" /> </div> <div class="col-sm-10"> </div> </div> } </div> </div> </div> <file_sep> @using Abundance_Nk.Model.Model @using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostJambViewModel @{ Layout = null; ViewBag.Title = "::Acknowlegment Slip::"; } <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="~/Content/putme/css/bootstrap.min.css"> <!-- Now-ui-kit CSS --> <link rel="stylesheet" href="~/Content/putme/css/now-ui-kit.css"> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!-- Include the above in your HEAD tag --> <title>UNIPORT post utme form</title> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#aPrint").click(function () { $("#aPrint").hide(); $("#printable").show(); window.print(); $("#aPrint").show(); }); }); </script> </head> <body> <div class="container-fluid"> <div class="container"> <div class="row pt-4"> <div class="col-md-12 pl-0 pr-0"> <div class="card printable"> @{var applicationFormHeader = Model.ApplicationForm.Setting.Session.Name + " " + Model.ApplicationForm.Setting.Name;} @{var applicationFormHeaderForIceProgramme = Model.ApplicationForm.Setting.Session.Name + " " + Model.AppliedCourse.Programme.Name.ToUpper(); } <div class="container"> <div class="col-md-12 text-center pt-3"> <img src="~/Content/Images/school_logo.png" alt="schoollogo" /> <h4>UNIVERSITY OF PORT-HARCOURT</h4> @if (Model.AppliedCourse.Programme.Id == (int)Programmes.RemedialStudies || Model.AppliedCourse.Programme.Id == (int)Programmes.Sandwich || Model.AppliedCourse.Programme.Id == (int)Programmes.IDEA) { <b>@applicationFormHeaderForIceProgramme</b> } else { <b>@applicationFormHeader</b> } <b>ACKNOWLEGMENT SLIP</b> </div> <hr class="bg-warning"> <div class="row pr-4 pl-4 pb-4 pt-0"> <div class="col-md-9"> <div> <div class="col-md-12"> <div class="row"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.Person.FullName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Person.FullName, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label ", }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.Email, "Email:", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.State.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.State.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.Person.LocalGovernment.Name, "LGA of Origin", new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.LocalGovernment.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <hr> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Id, "Programme", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Id, "Department of Choice", new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12"> <hr class="bg-warning"> </div> @if (Model.SupplementaryCourse != null && Model.SupplementaryCourse.Department != null) { <hr> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Putme_Score, "PUTME Score", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Putme_Score, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.SupplementaryCourse.Department.Id, "Supplementary Department", new { @class = "control-label " }) @Html.TextBoxFor(model => model.SupplementaryCourse.Department.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12"> <hr class="bg-warning"> </div> } <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantSponsor.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantSponsor.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantSponsor.Relationship.Name, "Realtionship", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantSponsor.Relationship.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantSponsor.ContactAddress, "Contact Address", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantSponsor.ContactAddress, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-6 form-group"> @Html.LabelFor(model => model.ApplicantSponsor.MobilePhone, "Phone Number", new { @class = "control-label " }) @Html.TextBoxFor(model => model.ApplicantSponsor.MobilePhone, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12"> <hr class="bg-warning"> </div> <div class="col-md-12 p-0"> <div class="row"> <div class="col-md-6"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.Type.Id, "Type", new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.Type.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "control-label" }) @Html.TextBoxFor(model => model.FirstSittingOLevelResult.ExamYear, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @for (int i = 0; i < Model.FirstSittingOLevelResultDetails.Count; i++) { if (Model.FirstSittingOLevelResultDetails[i].Subject != null) { <div class="col-md-12"> <div class="row"> <div class="col-md-8 form-group"> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Id) @Html.TextBoxFor(model => model.FirstSittingOLevelResultDetails[i].Subject.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-4 form-group"> @Html.HiddenFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Id) @Html.TextBoxFor(model => model.FirstSittingOLevelResultDetails[i].Grade.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> </div> </div> } } </div> <!--col-md-6 end form 1--> <!-- beginning of form 2--> @if (Model.SecondSittingOLevelResultDetails != null && Model.SecondSittingOLevelResultDetails.Count > 0) { <div class="col-md-6"> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamNumber, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.Type.Id, "Type", new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.Type.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-12 form-group"> @Html.LabelFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "control-label" }) @Html.TextBoxFor(model => model.SecondSittingOLevelResult.ExamYear, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> @for (int i = 0; i < Model.SecondSittingOLevelResultDetails.Count; i++) { if (Model.SecondSittingOLevelResultDetails[i].Subject != null) { <div class="col-md-12"> <div class="row"> <div class="col-md-8 form-group"> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Id) @Html.TextBoxFor(model => model.SecondSittingOLevelResultDetails[i].Subject.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> <div class="col-md-4 form-group"> @Html.HiddenFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Id) @Html.TextBoxFor(model => model.SecondSittingOLevelResultDetails[i].Grade.Name, new { @class = "form-control", disabled = true, @style = "color: black" }) </div> </div> </div> } } </div> } <div class="clearfix"></div> <div class="col-md-12 pl-4 mt-2"> <button class="btn btn-warning" id="aPrint">PRINT</button> </div> </div> </div> </div> </div> </div> </div> <div class="col-md-3"> <div class="col-md-12 pt-1" style="height:85%"> <img src="@Url.Content(Model.Person.ImageFileUrl)" class="mt-2" alt="photo"> @if (Model.AppliedCourse.Programme.Id == 1 && (Model.ApplicationForm.Setting.Id == 19 || Model.ApplicationForm.Setting.Id == 20)) { <div class="col-md-12" style="margin-left:15px"> @Html.LabelFor(model => model.ApplicationForm.Number, new { @class = "control-label" }) <b>@Html.DisplayFor(model => model.ApplicationForm.Number)</b> </div> } else { <div class="col-md-12" style="margin-left:15px"> @Html.LabelFor(model => model.ApplicationForm.Number, new { @class = "control-label" }) <b>@Html.DisplayFor(model => model.ApplicationForm.Number)</b> </div> <div class="col-md-8" style="margin-left:15px"> @Html.LabelFor(model => model.ApplicationForm.ExamNumber, new { @class = "control-label" }) <b>@Html.DisplayFor(model => model.ApplicationForm.ExamNumber)</b> </div> if (Model.AppliedCourse.Programme.Id == 1 && Model.ApplicationForm.Setting.Id != 13 && Model.ApplicationForm.Setting.Id != 14) { <div class="col-md-8" style="margin-left:15px"> <label class="control-label">Note</label> @*<b>Your are expected to come with this slip and a 2B pencil on the day of the exam</b>*@ <hr /> <p style="color:red">Date and time of the screening <br />will be communicated to you via SMS or email</p> </div> } } </div> <div class="col-md-12"> @Html.GenerateQrCode(Model.QRVerification) @*<img src="~/Content/putme/img/qr.png" alt="qr code">*@ </div> </div> </div> </div> <div class="card-footer text-center"> <p>For further enquiries please call: 07066166857,08032003224,08068051198</p> </div> </div> </div> </div> </div> </div> </body> </html><file_sep>@using Abundance_Nk.Model.Model @model Abundance_Nk.Model.Model.Invoice @{ ViewBag.Title = "Invoice"; Layout = null; } <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link href="~/Content/style.default.css" rel="stylesheet" /> <link href="~/Content/misc.css" rel="stylesheet" /> <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script src="~/Scripts/printThis.js"></script> @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function () { $("#aPrint").on('click', function () { // $(".printable").print(); // return false; alert("You clicked print!"); }); }); </script> } <div class="row text-center" style="margin-top: 50px"> <center> <img src="@Url.Content("~/Content/Images/school_logo.png")" width="80px" height="80px" alt="" /></center> <h4 style="font-weight: 600">University Of Port-Harcourt</h4> </div> <div class="printable" id="printable" name="printable"> <div class="container"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @if (Model == null || Model.Person == null || Model.Payment == null) { return; } </div> <div class="row"> <div class="col-xs-6"> <h5 class="lg-title mb10">From</h5> @Html.HiddenFor(m => m.Payment.Id) <div> <strong>@Model.Person.FullName</strong><br> <span><b>Email</b>:</span> @Model.Person.Email <br> <span><b>Phone</b>:</span> @Model.Person.MobilePhone <br /> <span><b>Programme</b>: @Model.ProgrammeName</span><br /> <span><b>Department</b>: @Model.Department</span><br /> <span><b>Level</b>: @Model.Level</span><br /> <span><b>Session</b>: @Model.Session</span> <br /> <br /> @if (Model != null) { if (!string.IsNullOrEmpty(Model.JambRegistrationNumber)) { <span><b>Payment Type:</b>: @Model.Payment.FeeType.Name</span> } else if (Model.Payment != null && Model.Payment.FeeType != null && !string.IsNullOrEmpty(Model.JambRegistrationNumber)) { <br /> <span><b>JAMB Reg. No.</b>: @Model.JambRegistrationNumber</span> } if (!string.IsNullOrEmpty(Model.MatricNumber)) { <span><b>Matric Number:</b>: @Model.MatricNumber</span> } } </div> </div><!-- col-sm-6 --> <div class="col-xs-6 text-right"> <h5 class="subtitle mb10">Invoice No.</h5> <h4 class="text-primary">@Model.Payment.InvoiceNumber</h4> @if (Model.remitaPayment != null && Model.remitaPayment.RRR != null) { <h5 class="subtitle mb10">RRR No.</h5> <h4 class="text-primary">@Model.remitaPayment.RRR</h4> } @if (Model.paymentEtranzactType != null) { <h5 class="subtitle mb10">Etranzact Payment Type</h5> <h5 class="text-primary">@Model.paymentEtranzactType.Name</h5> } <h5 class="subtitle mb10">To</h5> <div> <strong>University Of Port-Harcourt</strong><br> East/West Road, PMB 5323 Choba, Rivers State<br> </div> <br /> <p><strong>Invoice Date:</strong> @DateTime.Now.ToLongDateString()</p> </div> </div><!-- row --> @if (Model.Payment != null && Model.Payment.FeeType != null && Model.Payment.FeeType.Id == (int)FeeTypes.HostelFee) { <div class="row"> <p style="color:darkgoldenrod"><i>NB: You have 72 hours to make this payment, after which this invoice/allocation becomes invalid.</i></p> </div> } <div class="table-responsive"> <table class="table table-bordered table-dark table-invoice"> <thead> <tr> <th>Item</th> <th>Quantity</th> <th>Unit Price (₦)</th> <th>Total Price (₦)</th> </tr> </thead> <tbody> @if (@Model.Payment.FeeDetails != null) { for (int i = 0; i < Model.Payment.FeeDetails.Count; i++) { <tr> <td> <h5><p>@Model.Payment.FeeDetails[i].Fee.Name</p></h5> </td> <td>1</td> <td>@Model.Payment.FeeDetails[i].Fee.Amount.ToString("N")</td> <td>@Model.Payment.FeeDetails[i].Fee.Amount.ToString("N")</td> </tr> } } else { <tr> <td> <h5><p>@Model.Payment.FeeType.Name</p></h5> </td> <td>1</td> <td>@Model.Amount.ToString("n")</td> <td>@Model.Amount.ToString("n")</td> </tr> } <tr> <td> <h5><p></p></h5> <p></p> </td> <td></td> <td></td> <td></td> </tr> <tr> <td> <h5><p></p></h5> <p> </p> </td> <td></td> <td></td> <td></td> </tr> <tr> <td> <h5><p></p></h5> <p></p> </td> <td></td> <td></td> <td></td> </tr> </tbody> </table> </div><!-- table-responsive --> <table class="table table-total"> <tbody> <tr> <td>Sub Total:</td> <td>@Model.Payment.FeeDetails.Sum(p => p.Fee.Amount).ToString("n")</td> @*<td>@Model.Payment.Fee.Amount</td>*@ </tr> <tr> <td>VAT:</td> <td>0.00</td> </tr> <tr> <td style="font-weight: 700">TOTAL:</td> <td style="font-weight: 700">@Model.Payment.FeeDetails.Sum(p => p.Fee.Amount).ToString("n")</td> @*<td>@Model.Payment.Fee.Amount</td>*@ </tr> </tbody> </table> @if (Model.PaymentMonnify != null && Model.PaymentMonnify.CheckoutUrl != null) { <a href="@Model.PaymentMonnify.CheckoutUrl" target="_blank" class="btn btn-primary-alt">Click here to Pay Online Using ATM/Debit CardBank Transfer</a> } else { if (@Model.Paystack != null) { <a id="paymentUrl" href="@Model.Paystack.authorization_url" target="_blank" class="btn btn-primary-alt "><b>Click here to Pay Online Using ATM/Debit Card</b></a> } } @if (Model.Payment.FeeType.Id == 1) { @* @Html.ActionLink("Pay Directly from Bank Account", "InitializeBankPayment", "Form", new { Area = "Applicant", InvoiceNumber=@Model.Payment.InvoiceNumber }, new { @class = "btn btn-primary-alt", target = "_blank" })*@ } @{ int[] paystackPayment = { 19, 33, 34, 20, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 22, 46, 55, 47, 49, 51, 32, 77, 76, 81, 82 }; if (@paystackPayment.Contains(Model.Payment.FeeType.Id) && Model.Payment.FeeDetails.Sum(f => f.Fee.Amount) != 0M && Model.Payment.FeeDetails.Sum(f => f.Fee.Amount) < 10000M) { //do nothing } else { <div class="row"> <div class="col-md-4"> <button id="aPrint" class="print btn btn-primary-alt"><i class="fa fa-print mr5"></i> Print Invoice to Pay at the bank</button> @*<button class="btn btn-primary-alt pull-right" id="rave" onclick="getPaymentDetailForRave(@Model.Payment.Id)">Pay With Rave</button>*@ </div> <div class="col-md-4"> @if (Model.PaymentInterswitch != null) { <form action="https://webpay.interswitchng.com/paydirect/pay" method="post"> <input type="hidden" value="@Model.PaymentInterswitch.ProductId" name="product_id" id="product_id" /> <input type="hidden" value="@Model.PaymentInterswitch.Amount" name="amount" id="amount" /> <input type="hidden" value="566" name="currency" id="currency" /> <input type="hidden" value="@Model.PaymentInterswitch.ReturnUrl" name="site_redirect_url" id="site_redirect_url" /> <input type="hidden" value="@Model.PaymentInterswitch.PaymentReference" name="txn_ref" id="txn_ref" /> <input type="hidden" value="@Model.PaymentInterswitch.PaymentHash" name="hash" id="hash" /> <input type="hidden" value="@Model.PaymentInterswitch.PaymentItemId" name="pay_item_id" id="pay_item_id" /> <input type="hidden" value="@Model.PaymentInterswitch.PaymentItemName" name="pay_item_name" id="pay_item_name" /> <input type="hidden" value="@Model.MatricNumber" name="cust_id" id="cust_id" /> <input type="hidden" value="Matric Number" name="cust_id_desc" id="cust_id_desc" /> <input type="hidden" value="@Model.Person.FullName" name="cust_name" id="cust_name" /> <input name="payment_params" type="hidden" value="college_split" /> <input name="xml_data" type="hidden" value='@Model.PaymentInterswitch.XmlDataForSplit' /> <button type="submit" class="btn btn-primary-alt" onclick="postPaymentDetails()">Pay With Card</button> </form> } </div> </div> } } @if (Model.Payment.FeeType.Id == 1) { <h5 style="color:red">Dear Applicant, please make sure to copy and save this invoice number as it will be used to access and complete your application form.</h5> } </div><!-- panel-body --> <div class="well nomargin" style="margin: 20px"> Thank you for choosing University Of Port-Harcourt. </div> <img src="@Url.Content("~/Content/Images/lloydant.png")" style="padding: 3px 20px;" alt="" /> </div><!-- panel --> </div> </div><file_sep>@model Abundance_Nk.Model.Model.BasicSetup @{ ViewBag.Title = "Delete Fee Type"; } @Html.Partial("BasicSetup/_Delete", @Model)<file_sep>@model Abundance_Nk.Web.Areas.PGApplicant.ViewModels.PGViewModel @{ //Layout = null; Layout = "~/Views/Shared/_Layout.cshtml"; } @section Scripts { @Scripts.Render("~/bundles/jquery") <script type="text/javascript" src="~/Scripts/file-upload/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload-ui.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.fileupload.js"></script> <script type="text/javascript" src="~/Scripts/file-upload/jquery.iframe-transport.js"></script> <script type="text/javascript" src="~/Scripts/jquery.print.js"></script> <link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" /> <script src="~/Scripts/bootstrap-datepicker.js"></script> <script type="text/javascript"> var jqXHRData; $(document).ready(function () { var src = $('#passport').attr('src'); if (src == undefined) { $('#passport').attr('src', '/Content/Images/default_avatar.png'); } $('#wasMatricStudent').on('click', function () { checkIfApplicantIsPreviousStudentOfTheInstitution(); }) $("#Person_State_Id").change(function () { $("#Person_LocalGovernment_Id").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetLocalGovernmentsByState")', //we are calling json method dataType: 'json', data: { id: $("#Person_State_Id").val() }, success: function (lgas) { $("#Person_LocalGovernment_Id").append('<option value="' + 0 + '">-- Select --</option>'); $.each(lgas, function (i, lga) { $("#Person_LocalGovernment_Id").append('<option value="' + lga.Value + '">' + lga.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve lgas.' + ex); } }); return false; }); $("#Person_MonthOfBirth_Id").change(function () { $("#Person_DayOfBirth_Id").empty(); var selectedMonth = $("#Person_MonthOfBirth_Id").val(); var selectedYear = $("#Person_YearOfBirth_Id").val(); if (selectedYear == '') { alert('Please select Year of Birth!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy")', // we are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, success: function (days) { $("#Person_DayOfBirth_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#Person_DayOfBirth_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, beforeSend: function () { $('#spDob').show(); }, complete: function () { $('#spDob').hide(); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); $("#PreviousEducation_StartMonth_Id").change(function () { $("#PreviousEducation_StartDay_Id").empty(); var selectedMonth = $("#PreviousEducation_StartMonth_Id").val(); var selectedYear = $("#PreviousEducation_StartYear_Id").val(); if (selectedYear == '') { alert('Please select Start Year!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy")', //We are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, beforeSend: function () { $('#spSDate').show(); }, complete: function () { $('#spSDate').hide(); }, success: function (days) { $("#PreviousEducation_StartDay_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#PreviousEducation_StartDay_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); $("#PreviousEducation_EndMonth_Id").change(function () { $("#PreviousEducation_EndDay_Id").empty(); var selectedMonth = $("#PreviousEducation_EndMonth_Id").val(); var selectedYear = $("#PreviousEducation_EndYear_Id").val(); if (selectedYear == '') { alert('Please select End Year!'); return; } $.ajax({ type: 'POST', url: '@Url.Action("GetDayOfBirthBy")', // we are calling json method dataType: 'json', data: { monthId: selectedMonth, yearId: selectedYear }, beforeSend: function () { $('#spEDate').show(); }, complete: function () { $('#spEDate').hide(); }, success: function (days) { $("#PreviousEducation_EndDay_Id").append('<option value="' + 0 + '">--DD--</option>'); $.each(days, function (i, day) { $("#PreviousEducation_EndDay_Id").append('<option value="' + day.Value + '">' + day.Text + '</option>'); }); }, error: function (ex) { if (selectedMonth == '') { return; } else { alert('Failed to retrieve days.' + ex); } } }); return false; }); initSimpleFileUpload(); $("#hl-start-upload").on('click', function () { if (jqXHRData) { jqXHRData.submit(); } return false; }); $("#fu-my-simple-upload").on('change', function () { $("#tbx-file-path").val(this.files[0].name); }); function initSimpleFileUpload() { 'use strict'; $('#fu-my-simple-upload').fileupload({ url: '@Url.Content("~/Applicant/Form/UploadFile")', dataType: 'json', add: function (e, data) { jqXHRData = data; }, send: function (e) { $('#fileUploadProgress').show(); }, done: function (event, data) { if (data.result.isUploaded) { //alert("success"); } else { $("#tbx-file-path").val(""); alert(data.result.message); } $('#passport').attr('src', data.result.imageUrl); $('#fileUploadProgress').hide(); }, fail: function (event, data) { if (data.files[0].error) { alert(data.files[0].error); } } }); } // initSimpleFileUploadForCredential(); $("#cr-start-upload").on('click', function () { if (jqXHRData) { jqXHRData.submit(); } return false; }); $("#cu-credential-simple-upload").on('change', function () { $("#crx-file-path").val(this.files[0].name); }); function initSimpleFileUploadForCredential() { 'use strict'; $('#cu-credential-simple-upload').fileupload({ url: '@Url.Content("~/Applicant/Form/UploadCredentialFile")', dataType: 'json', add: function (e, data) { jqXHRData = data; }, send: function (e) { $('#fileUploadProgress2').show(); }, done: function (event, data) { if (data.result.isUploaded) { //alert("success"); } else { $("#crx-file-path").val(""); alert(data.result.message); } $('#scannedCredential').attr('src', data.result.imageUrl); $('#fileUploadProgress2').hide(); }, fail: function (event, data) { if (data.files[0].error) { alert(data.files[0].error); } } }); } }); function beginRequest() { $("#busy").hide(); } function endRequest(request, status) { $("#busy").show(); } $('.datepicker').datepicker({ format: 'dd/mm/yyyy', autoclose: true, }); $(function () { $('#rdYesRadio').click(function () { if ($(this).is(':checked')) { $('.olevel').attr('disabled', 'disabled'); } }); }); $(function () { $('#rdNoRadio').click(function () { if ($(this).is(':checked')) { $('.olevel').removeAttr('disabled'); } }); }); function checkIfApplicantIsPreviousStudentOfTheInstitution() { let isPreviousAbsuStudent = $('#wasMatricStudent:checkbox:checked'); if (isPreviousAbsuStudent.length > 0) { $('#absuMatricno').show(); } else { $('#absuMatricno').hide(); } } </script> } <div class="container"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> @using (Html.BeginForm("Form", "PostGraduateForm", FormMethod.Post, new { id = "frmPostJAMB", enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <center> <div class="row"> <div class="col-md-12"> <div class="alert alert-success nomargin bg-warning"> <h2><b>@Model.AppliedCourse.Programme.Name.ToUpper()</b> <b>FORM</b></h2> @*<h2><b>@Model.ApplicationFormSetting.Name</b></h2>*@ <p class="text-black">Kindly fill all the fields provided in this form before clicking the Submit button</p> </div> </div> </div> <br /> </center> <div class="panel p-4"> <div class="panel-heading"> <div style="font-size: x-large">Bio Data</div> @if (Model.ApplicationForm != null && Model.ApplicationForm.Id > 0) { @Html.HiddenFor(model => model.ApplicationForm.Id) @Html.HiddenFor(model => model.ApplicationForm.Number) @Html.HiddenFor(model => model.ApplicationForm.ExamNumber) @Html.HiddenFor(model => model.ApplicationForm.Rejected) @Html.HiddenFor(model => model.ApplicationForm.RejectReason) } @Html.HiddenFor(model => model.Session.Id) @Html.HiddenFor(model => model.Session.Name) @Html.HiddenFor(model => model.ApplicationFormSetting.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentMode.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PaymentType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.PersonType.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.Session.Id) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamDate) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamVenue) @Html.HiddenFor(model => model.ApplicationFormSetting.ExamTime) @Html.HiddenFor(model => model.ApplicationProgrammeFee.FeeType.Id) @Html.HiddenFor(model => model.ApplicationProgrammeFee.Id) @Html.HiddenFor(model => model.Programme.Id) @Html.HiddenFor(model => model.Programme.Name) @Html.HiddenFor(model => model.Programme.ShortName) @Html.HiddenFor(model => model.AppliedCourse.Programme.Id) @Html.HiddenFor(model => model.AppliedCourse.Programme.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Id) @Html.HiddenFor(model => model.AppliedCourse.Department.Name) @Html.HiddenFor(model => model.AppliedCourse.Department.Code) @Html.HiddenFor(model => model.Person.Id) @Html.HiddenFor(model => model.Payment.Id) @Html.HiddenFor(model => model.remitaPyament.payment.Id) @Html.HiddenFor(model => model.Person.DateEntered) @Html.HiddenFor(model => model.Person.FullName) @Html.HiddenFor(model => model.ApplicationAlreadyExist) </div><hr /><br /> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.LastName) @Html.TextBoxFor(model => model.Person.LastName, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.LastName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.FirstName) @Html.TextBoxFor(model => model.Person.FirstName, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.FirstName) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.OtherName, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.OtherName, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.OtherName) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Sex.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.Sex.Id, (IEnumerable<SelectListItem>)ViewBag.SexId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Sex.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <div class="form-inline"> <div class="form-inline" style="color: black">Date of Birth <span id="spDob" style="color: green; display: none; font-weight: bold;">...Loading</span></div> @Html.DropDownListFor(m => m.Person.YearOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.YearOfBirthId, new { @class = "form-control" }) @Html.DropDownListFor(m => m.Person.MonthOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.MonthOfBirthId, new { @class = "form-control" }) @Html.DropDownListFor(m => m.Person.DayOfBirth.Id, (IEnumerable<SelectListItem>)ViewBag.DayOfBirthId, new { @class = "form-control" }) <div> <div class="form-group"> @*@Html.ValidationMessageFor(m => m.Person.YearOfBirth.Id, "The Year of Birth Field is required!", new { @class = "text-danger" }) @Html.ValidationMessageFor(m => m.Person.MonthOfBirth.Id, "The Month of Birth Field is required!", new { @class = "text-danger" }) @Html.ValidationMessageFor(m => m.Person.DayOfBirth.Id, "The Day of Birth Field is required!", new { @class = "text-danger" })*@ </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.State.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.State.Id, (IEnumerable<SelectListItem>)ViewBag.StateId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.State.Id) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.LocalGovernment.Id, new { @class = "control-label " }) @Html.DropDownListFor(f => f.Person.LocalGovernment.Id, (IEnumerable<SelectListItem>)ViewBag.LgaId, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.LocalGovernment.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.HomeTown, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeTown, new { @class = "form-control " }) @Html.ValidationMessageFor(model => model.Person.HomeTown) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.MobilePhone, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.MobilePhone, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.Person.MobilePhone) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Email, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.Email, new { @class = "form-control", @readonly = "readonly" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.Religion.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Person.Religion.Id, (IEnumerable<SelectListItem>)ViewBag.ReligionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Person.Religion.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.HomeAddress, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Person.HomeAddress, new { @class = "form-control" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Applicant.Ability.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Applicant.Ability.Id, (IEnumerable<SelectListItem>)ViewBag.AbilityId, new { @class = "form-control" }) @*@Html.ValidationMessageFor(model => model.Sponsor.Ability.Id)*@ </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Applicant.OtherAbility) @Html.TextBoxFor(model => model.Applicant.OtherAbility, new { @class = "form-control" }) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Applicant.ExtraCurricullarActivities) @Html.TextBoxFor(model => model.Applicant.ExtraCurricullarActivities, new { @class = "form-control" }) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Person.IDCardNumber,"ID Card No.") @Html.TextBoxFor(model => model.Person.IDCardNumber, new { @class = "form-control" }) </div> </div> </div> </div> </div> <div class="panel panel-default p-4"> <div class="panel-heading"> <div style="font-size: x-large">Next of Kin</div> </div><hr /><br /> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Sponsor.Name) @Html.TextBoxFor(model => model.Sponsor.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Sponsor.ContactAddress, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.ContactAddress, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.ContactAddress) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Sponsor.Relationship.Id, new { @class = "control-label " }) @Html.DropDownListFor(model => model.Sponsor.Relationship.Id, (IEnumerable<SelectListItem>)ViewBag.RelationshipId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.Relationship.Id) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.Sponsor.MobilePhone, new { @class = "control-label " }) @Html.TextBoxFor(model => model.Sponsor.MobilePhone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Sponsor.MobilePhone) </div> </div> </div> </div> </div> if (Model != null) { @Html.Partial("_PGOLevelResult", Model) } if (Model != null && Model.Programme != null) { if (Model.Programme.Id == 2 || Model.Programme.Id == 5 || Model.Programme.Id == 6 || Model.Programme.Id == 8 || Model.Programme.Id == 9 || Model.Programme.Id == 10) { @Html.Partial("_PGTertiaryEducation", Model) } } if (Model != null) { @Html.Partial("_PGReferee", Model) } <div class="panel panel-default p-4"> <div class="panel-heading"> <div style="font-size: x-large">Academic Details</div> </div><hr /><br /> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Programme.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Programme.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Programme.Name) </div> </div> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Faculty.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Faculty.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Faculty.Name) </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Department.Name, new { @class = "control-label " }) @Html.TextBoxFor(model => model.AppliedCourse.Department.Name, new { @class = "form-control", @readonly = "readonly" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Department.Name) </div> </div> @if (ViewBag.DepartmentOptionId != null) { <div class="col-md-6"> <div class="form-group"> @Html.LabelFor(model => model.AppliedCourse.Option.Name, new { @class = "control-label " }) @Html.DropDownListFor(model => model.AppliedCourse.Option.Id, (IEnumerable<SelectListItem>)ViewBag.DepartmentOptionId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.AppliedCourse.Option.Name) </div> </div> } </div> </div> </div> <div class="panel panel-default p-4"> <div class="panel-heading"> <div style="font-size: x-large">Passport Photograph</div> </div><hr /><br /> <div class="panel-body"> <div class="row "> <div class="col-md-6 "> </div> <div class="col-md-6 "> <div class="panel-body"> <div class="row"> <div class="col-md-12 padding-bottom-3"> <img id="passport" src="@Model.Person.ImageFileUrl" alt="" style="max-width: 150px" /> </div> </div> <div class="row padding-bottom-5"> <div class="col-md-6 "> @Html.HiddenFor(model => model.Person.ImageFileUrl, new { id = "hfPassportUrl", name = "hfPassportUrl" }) <input type="text" id="tbx-file-path" readonly="readonly" /> </div> <div class="col-md-6"> @Html.TextBoxFor(m => m.MyFile, new { id = "fu-my-simple-upload", type = "file", style = "color:transparent;" }) </div> </div> <div class="row padding-bottom-10"> <div class="col-md-12"> <input class="btn btn-default btn-metro" type="button" name="hl-start-upload" id="hl-start-upload" value="Upload Passport" /> </div> </div> <div class="row"> <div class="col-md-12"> <div id="fileUploadProgress" style="display: none"> <img src="@Url.Content("~/Content/Images/bx_loader.gif")" /> <span>Uploading ...</span> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <blockquote> <i class="fa fa-quote-left"></i> <p> To upload your passport, scan and save the passport in the computer file system. Click on the Choose File button shown above to display the file dialog box. Select the passport file from the saved location. Then click on the Upload Passport button above to upload your passport to the system. </p> <small>Please note that the passport photo background should be plain (white or clear) and passport size should not be more than 50kb. The file format must be in either .gif, .jpeg, .jpg or .bmp file format.<cite title="Source Title"></cite></small> </blockquote> </div> </div> </div> </div> <div class="form-actions no-color col-md-12"> <button class="btn btn-primary btn-lg" type="submit" name="submit" id="submit">Next @*<i class="fa fa-chevron-right mr5"></i><i class="fa fa-chevron-right mr5"></i>*@</button> <div id="busy" style="display: none">Processing ...</div> <div id="result"></div> </div> <div> @if (TempData["Message"] != null) { <br /> @Html.Partial("_Message", TempData["Message"]) } </div> } </div> </div> </div> </div> </div><file_sep>@using GridMvc.Html @model IEnumerable<Abundance_Nk.Model.Model.Fee> @{ ViewBag.Title = "Fees"; ViewBag.IsIndex = true; } <div class="alert alert-success fade in nomargin"> <h3>@ViewBag.Title</h3> </div> @if (Model != null) { @Html.Partial("_IndexSetupHeader", Model.Count()) } @if (TempData["Message"] != null) { <br /> @Html.Partial("_Message", TempData["Message"]) } @if (Model == null) { return; } <div class="panel panel-default"> <div class="panel-body"> @Html.Grid(Model).Columns(columns => { columns.Add() .Encoded(false) .Sanitized(false) .RenderValueAs(d => @<div style="width: 41px"> <a href="@Url.Action("Edit", new {id = d.Id})" title="Edit"> <img src="@Url.Content("~/Content/Images/edit_icon.png")" alt="Edit" /> </a> <a href="@Url.Action("Delete", new {id = d.Id})" title="Delete"> <img src="@Url.Content("~/Content/Images/delete_icon.png")" alt="Delete" /> </a> </div>); columns.Add(f => f.Name).Titled("Type"); columns.Add(f => f.Amount).Titled("Amount").Css("align-right"); }).WithPaging(15) </div> </div> @*<br /> <hr />*@ @*<h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Amount) </th> <th> @Html.DisplayNameFor(model => model.DateEntered) </th> <th> @Html.DisplayNameFor(model => model.Type.Name) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Amount) </td> <td> @Html.DisplayFor(modelItem => item.DateEntered) </td> <td> @Html.DisplayFor(modelItem => item.Type.Name) </td> <td> @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) </td> </tr> } </table> <iframe src="~/WebForm1.aspx" style="width:100%; height:100%"></iframe>*@<file_sep> $(document).ready(function() { $('.datepicker').datepicker ({ format: 'dd/mm/yyyy', autoclose: true, }); }); //if (!Modernizr.inputtypes.date) { // $(function () { // $(".datecontrol").datepicker(); // }) //};<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.RemitaPaymentViewModel @{ Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> @if (Model.remitaResponse.Status == "01" || Model.remitaResponse.Status == "00") { <h2>Transaction Successful</h2> <p><b>Remita Retrieval Reference: </b> @Model.remitaResponse.RRR</p> <p><b>Invoice / Reference: </b> @Model.remitaResponse.orderId </p> } else if (Model.remitaResponse.Status == "021") { <h2>RRR Generated Successfully</h2> <p><b>Remita Retrieval Reference: </b>@Model.remitaResponse.RRR</p> } else { <h2>Your Transaction was not Successful</h2> if (Model.remitaResponse.RRR != null) { <p>Your Remita Retrieval Reference is <span><b>@Model.remitaResponse.RRR</b></span><br /></p> <p><b>Reason: </b> @Model.remitaResponse.Message</p> } else { <p><b>Reason: </b> @Model.remitaResponse.Message</p> } } </div><file_sep>using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Microsoft.Reporting.WebForms; using System; using System.Collections.Generic; using System.Web.UI; namespace Abundance_Nk.Web.Reports.Presenter { public partial class CarryOverReport :Page { private string deptId; private string levelId; private string progId; private string semesterId; private string sessionId; protected void Page_Load(object sender,EventArgs e) { try { lblMessage.Text = ""; if(Request.QueryString["deptId"] != null && Request.QueryString["progId"] != null && Request.QueryString["sessionId"] != null && Request.QueryString["semesterId"] != null && Request.QueryString["levelId"] != null) { deptId = Request.QueryString["deptId"]; progId = Request.QueryString["progId"]; sessionId = Request.QueryString["sessionId"]; semesterId = Request.QueryString["semesterId"]; levelId = Request.QueryString["levelId"]; } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } protected void Button1_Click(object sender,EventArgs e) { int deptId1 = Convert.ToInt32(deptId); int progId1 = Convert.ToInt32(progId); int sessionId1 = Convert.ToInt32(sessionId); int semesterId1 = Convert.ToInt32(semesterId); int levelId1 = Convert.ToInt32(levelId); BuildCarryOverCourseList(deptId1,progId1,levelId1,sessionId1,semesterId1); } private void BuildCarryOverCourseList(int deptId,int progId,int levelId,int sessionId,int semesterId) { try { var department = new Department { Id = deptId }; var programme = new Programme { Id = progId }; var level = new Level { Id = levelId }; var session = new Session { Id = sessionId }; var semester = new Semester { Id = semesterId }; var courseRegistrationLogic = new CourseRegistrationLogic(); List<CarryOverReportModel> carryOverList = courseRegistrationLogic.GetCarryOverList(department, programme,session,level,semester); string bind_dsCarryOverStudentList = "dsCarryOverCourses"; string reportPath = @"Reports\CarryOverReport.rdlc"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DisplayName = "Carry Over Courses "; ReportViewer1.LocalReport.ReportPath = reportPath; if(carryOverList != null) { ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(bind_dsCarryOverStudentList.Trim(), carryOverList)); ReportViewer1.LocalReport.Refresh(); } } catch(Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "CheckMatricNumberDuplicate"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <h3>Correct Matric Number Duplicate</h3> @if (TempData["Message"] != null) { <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>@TempData["Message"]</strong> </div> } @using (Html.BeginForm()) { <div class="form-group"> @Html.Label(" Matric No", new {@class = "col-sm-2 control-label "}) <div class="col-sm-10"> @Html.TextBoxFor(model => model.Pin, new {@class = "form-control", @placeholder = "Enter Matric No"}) @Html.ValidationMessageFor(model => model.Pin, null, new {@class = "text-danger"}) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="Search" /> <div class="btn btn-default"> @Html.ActionLink("Back to Home", "Index", "Home", new {Area = ""}, null) </div> </div> </div> }<file_sep>@model Abundance_Nk.Web.Areas.Applicant.ViewModels.PostUtmeResultViewModel @{ ViewBag.Title = "PUTME RESULT"; Layout = "~/Views/Shared/_Layout.cshtml"; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>PUTME RESULT</title> </head> <body> <div class="row"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } </div> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <img src="@Url.Content("~/Content/Images/results.jpg")" alt="" width="500px" /> </div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title text-center">SEARCH FOR PUTME RESULT</h3> </div> <div class="panel-body"> @using (Html.BeginForm("MergeResult", "PostUtmeResult/MergeResult", FormMethod.Post)) { @Html.AntiForgeryToken() if (Model == null) { <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Programme</span> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>) ViewBag.ProgrammeId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Programme.Id, null, new {@class = "text-danger"}) </div> <br /> <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Name</span> @Html.TextBoxFor(model => model.Result.FullName, new {@class = "form-control", @placeholder = "Enter your Examination Number"}) @Html.ValidationMessageFor(model => model.Result.FullName, null, new {@class = "text-danger"}) </div> <br /> <div class="col-md-offset-6"> <button class="btn btn-default " type="submit">Search Result</button> </div> } } @if (Model != null && Model.ResultSelectListItem.Count > 0) { using (Html.BeginForm("UpdateResult", "PostUtmeResult", FormMethod.Post)) { <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Full name</span> @Html.DropDownListFor(model => model.Result.Id, (IEnumerable<SelectListItem>) ViewBag.ResultId, new {@class = "form-control"}) @Html.ValidationMessageFor(model => model.Result.Id, null, new {@class = "text-danger"}) </div> <br /> <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Exam No</span> @Html.TextBoxFor(model => model.Result.ExamNo, new {@class = "form-control", @placeholder = "Enter your Examination Number"}) @Html.ValidationMessageFor(model => model.Result.ExamNo, null, new {@class = "text-danger"}) </div> <br /> <div class="col-md-offset-6"> <button class="btn btn-default " type="submit">MERGE</button> </div> } } </div> <div class="panel-footer"> <p class="text-center"> If you encounter any issues kindly send an email to <cite><EMAIL></cite> or call <cite>07088391544</cite> </p> </div> </div> </div> </div> </div> </div> </div> </div> </body> </html><file_sep>@using Abundance_Nk.Web.Models @model Abundance_Nk.Web.Areas.Admin.ViewModels.ELearningViewModel @{ ViewBag.Title = "ViewETopic"; } <script src="~/Scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myTable').DataTable({ dom: 'Bfrtip', ordering: true, retrieve: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); //Session Drop down Selected change event $("#Session").change(function () { if ($("#Department").val() > 0 && $("#Level").val() > 0 && $("#Semester").val() > 0) { populateCourses(); } $("#Semester").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetSemester", "StaffCourseAllocation")', // Calling json method dataType: 'json', data: { id: $("#Session").val() }, // Get Selected Country ID. success: function(semesters) { $("#Semester").append('<option value="' + 0 + '">' + '-- Select Semester --' + '</option>'); $.each(semesters, function(i, semester) { $("#Semester").append('<option value="' + semester.Value + '">' + semester.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); return false; }); $('#btnEdit').on('click', function () { var topic = $('#topic').val(); var desc = $('#description').val(); var active = false; var cTypeId = $('#@Html.IdFor(m=>m.eCourse.EContentType.Id)').val(); if ($('#active').is(':checked', true)) { active = true; } if (topic != null && topic != '' && topic != undefined, cTypeId>0) { $.ajax({ type: 'POST', url: '@Url.Action("SaveEditEContentType", "Elearning")', // Calling json method dataType: 'json', data: { cTypeId: cTypeId, topic: topic, desc: desc, active: active }, success: function (result) { if (!result.IsError) { $('#editeModal').modal('hide'); var courseId = result.CourseId; var url = '/Admin/Elearning/GetTopics?cid=' + courseId; window.location.href = url; alert(result.Message); } else { $('#editeModal').modal('hide'); alert(result.Message); } }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); } }) }); function editECourseType(e) { var cTypeId = e; if (cTypeId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("EditEContentType", "Elearning")', // Calling json method dataType: 'json', data: { cTypeId: cTypeId }, success: function (result) { if (!result.IsError) { $('#@Html.IdFor(m=>m.eCourse.EContentType.Id)').val(result.EContentType.Id) $('#topic').val(result.EContentType.Name) $('#description').val(result.EContentType.Description) var active = result.EContentType.Active; if (active = true) { $('#active').prop('checked',true) } $('#editeModal').modal('show'); } else { $('#editeModal').modal('hide'); } }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); } } function deleteECourseType(e) { var getClicked = confirm("Are you Sure you want to Delete This Record completely?"); if (getClicked == true) { var cTypeId = e; if (cTypeId > 0) { $.ajax({ type: 'POST', url: '@Url.Action("ArchiveETopic", "Elearning")', // Calling json method dataType: 'json', data: { cTypeId: cTypeId }, success: function (result) { if (!result.IsError) { $('#editeModal').modal('hide'); var courseId = result.CourseId; var url = '/Admin/Elearning/GetTopics?cid=' + courseId; window.location.href = url; alert(result.Message); } else { $('#editeModal').modal('hide'); } }, error: function(ex) { alert('Failed to retrieve semesters.' + ex); } }); } } else { return false; } } </script> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } @using (Html.BeginForm("ViewETopic", "Elearning", new { area = "Admin" }, FormMethod.Post)) { <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-download"></i>View E-Learning Topics</h3> </div> <div class="panel-body"> <div class="form-group"> @Html.LabelFor(model => model.Session.Name, "Session", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Session.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @id = "Session" }) @Html.ValidationMessageFor(model => model.Session.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Semester.Name, "Semester", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Semester.Id, (IEnumerable<SelectListItem>)ViewBag.Semester, new { @class = "form-control", @id = "Semester" }) @Html.ValidationMessageFor(model => model.Semester.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level", requiredt = true }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input class="btn btn-primary mr5 " type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> </div> } <br /> @if (Model.CourseAllocations != null && Model.CourseAllocations.Count() > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table id="myTable" class="table-bordered table-hover table-striped table-responsive table"> <thead> <tr> <th> Course Code </th> <th> Course Name </th> <th> Programme </th> <th> Department </th> <th> Action </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.CourseAllocations.Count(); i++) { <tr> <td> @Model.CourseAllocations[i].Course.Code </td> <td> @Model.CourseAllocations[i].Course.Name </td> <td> @Model.CourseAllocations[i].Programme.Name </td> <td> @Model.CourseAllocations[i].Department.Name </td> <td> @Html.ActionLink("View Topics", "GetTopics", "Elearning", new { Area = "Admin", cid = Utility.Encrypt(Model.CourseAllocations[i].Course.Id.ToString()) }, new { @class = "btn btn-primary " }) </td> </tr> } </tbody> </table> </div> </div> } <br /> @if (Model.EContentTypes != null && Model.EContentTypes.Count() > 0) { <div class="panel panel-danger"> <div class="panel-body"> <table id="myTable" class="table-bordered table-hover table-striped table-responsive table"> <thead> <tr> <th> Course Code </th> <th> Course Name </th> <th> Topic </th> <th> Description </th> <th> Edit </th> <th> Delete </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.EContentTypes.Count(); i++) { <tr> <td> @Model.EContentTypes[i].Course.Code </td> <td> @Model.EContentTypes[i].Course.Name </td> <td> @Model.EContentTypes[i].Name </td> <td> @Model.EContentTypes[i].Description </td> <td> <button class = "btn btn-primary" onclick="editECourseType(@Model.EContentTypes[i].Id)">Edit</button> </td> <td> <button class="btn btn-primary" onclick="deleteECourseType(@Model.EContentTypes[i].Id)">Delete</button> </td> </tr> } </tbody> </table> </div> </div> } <div class="modal fade" role="dialog" id="editeModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" style="float:right">&times;</button> <h4 class="modal-title">Edit Course Topic</h4> </div> <div class="modal-body"> @Html.HiddenFor(model=>model.eCourse.EContentType.Id) <div class="form-group"> @Html.LabelFor(model => model.eContentType.Name, "Topic", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eContentType.Name, new { @class = "form-control", require = true, Id = "topic", placeholder = "Use of English" }) @Html.ValidationMessageFor(model => model.eContentType.Name) </div> <div class="form-group"> @Html.LabelFor(model => model.eContentType.Description, "Description", new { @class = "control-label" }) @Html.TextBoxFor(model => model.eContentType.Description, new { @class = "form-control", require = true, Id = "description", placeholder = "Introduction To English" }) @Html.ValidationMessageFor(model => model.eContentType.Description) </div> <div class="form-group"> @Html.LabelFor(model => model.eContentType.Active, "Activate", new { @class = "control-label" }) @Html.CheckBoxFor(model => model.eContentType.Active, new { require = true, Id = "active" }) @Html.ValidationMessageFor(model => model.eContentType.Active) </div> </div> <div class="modal-footer form-group"> <span style="display: none" class="Load"><img src="~/Content/Images/bx_loader.gif" /></span> <button type="submit" id="btnEdit" class="btn btn-success">Save</button> </div> </div> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.TranscriptBursarViewModel @{ Layout = "~/Views/Shared/_Layout.cshtml"; } @{ ViewBag.Title = "Transcript Report"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div> <div> @if(TempData["Message"] != null) { @Html.Partial("_Message",TempData["Message"]) } </div> <h2>Incoming Transcript Payment</h2> <h3>Total Payments made: @Model.remitaPayments.Count()</h3> <div class="panel"> <table class="table table-bordered table-hover table-striped table-responsive"> <tr> <th>@Html.ActionLink("Full Name", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Date Requesterd", "Index", new {sortOrder = ViewBag.FullName, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Description", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("Amount", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> <th>@Html.ActionLink("RRR", "Index", new {sortOrder = ViewBag.Number, currentFilter = ViewBag.CurrentFilter})</th> @*<th>Reject</th>*@ </tr> @for (int i = 0; i < Model.remitaPayments.Count; i++) { <tr> <td>@Html.DisplayTextFor(m => m.remitaPayments[i].payment.Person.FullName)</td> <td>@Html.DisplayTextFor(m => m.remitaPayments[i].TransactionDate)</td> <td>@Html.DisplayTextFor(m => m.remitaPayments[i].Description)</td> <td>@Html.DisplayTextFor(m => m.remitaPayments[i].TransactionAmount)</td> <td>@Html.DisplayTextFor(m => m.remitaPayments[i].RRR)</td> </tr> } </table> </div> </div><file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.UploadAdmissionViewModel @{ ViewBag.Title = "Admission List View Criteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function () { $('.datepicker').bootstrapMaterialDatePicker({ format: 'dddd DD MMMM YYYY', clearButton: true, weekStart: 1, time: false }); //Programme Drop down Selected-change event $("#Programme").change(function () { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "StudentCourseRegistration")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function (departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function (i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function (ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); $.extend($.fn.dataTable.defaults, { responsive: true }); $('#applicantTable').DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible' } }, { extend: 'csv', exportOptions: { columns: ':visible' } }, { extend: 'excel', exportOptions: { columns: ':visible' } }, { extend: 'pdf', exportOptions: { columns: ':visible' } }, { extend: 'print', exportOptions: { columns: ':visible' } }, , 'colvis' ] }); }); </script> <div class="col-md-12"> <div class="col-md-1"></div> <div class="col-md-12"> <div> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } </div> <div class="panel panel-default"> <div class="panel-heading panel-dark-head"> <h4>Admission List</h4> </div> <div class="panel-body"> <div class="col-md-12"> @using (Html.BeginForm("AdmissionList", "UploadAdmission", FormMethod.Post)) { <div class="row"> <div class="form-group"> @Html.LabelFor(model => model.CurrentSession.Name, "Session", new {@class = "control-label col-sm-2"}) <div class="col-sm-10"> @Html.DropDownListFor(model => model.CurrentSession.Id, (IEnumerable<SelectListItem>)ViewBag.Session, new { @class = "form-control", @required = "required" }) @Html.ValidationMessageFor(model => model.CurrentSession.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Programme.Name, "Programme", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme", @required = "required" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @required = "required" }) @Html.ValidationMessageFor(model => model.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Date", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.TextBoxFor(model => model.DateFrom, new { @class = "datepicker", @placeholder = "From:", @required = "required" }) @Html.TextBoxFor(model => model.DateTo, new { @class = "datepicker", @placeholder = "To:", @required = "required" }) </div> </div> </div> <div class="row"> <div class="form-group"> <div class="col-md-offset-2"> <input class="btn btn-success mr5" type="submit" name="submit" id="submit" value="View" /> </div> </div> </div> } @if (Model == null || Model.AdmissionModelList == null) { return; } @if (Model != null && Model.AdmissionModelList != null) { <div class="col-md-12 table-responsive"> <table class="table table-bordered table-hover table-striped" id="applicantTable"> <thead> <tr> <th>SN</th> <th>Name</th> <th>Exam Number</th> <th>Application Number</th> <th>Jamb Number</th> <th>Programme</th> <th>Department</th> <th>Admission Type</th> <th>Session</th> <th>Date</th> </tr> </thead> <tbody style="color: black;"> @for (int i = 0; i < Model.AdmissionModelList.Count; i++) { var SN = i + 1; <tr> <td>@SN</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].FullName)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].ExamNumber)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].ApplicationNumber)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].JambNumber)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].Programme)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].Department)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].AdmissionListType)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].SessionName)</td> <td>@Html.DisplayTextFor(m => m.AdmissionModelList[i].DateUploaded)</td> </tr> } </tbody> </table> </div> } </div> </div> </div> </div> <div class="col-md-1"> </div> </div> <file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.HostelViewModel @{ ViewBag.Title = "ConfirmDeleteHostelAllocationCriteria"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <div class="col-md-12"> @if (TempData["Message"] != null) { @Html.Partial("_Message", (Abundance_Nk.Model.Model.Message)TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title">Delete StudentResultStatus</h4> </div> @using (Html.BeginForm("DeleteHostelAllocationCriteria", "HostelAllocation", new { Area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { <div class="panel panel-default"> <div class="panel-body"> @Html.HiddenFor(m => m.HostelAllocationCriteria.Id) <div> <h3>Are you sure you want to delete this Criteria?</h3> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayName("Level:") </dt> <dd> @Html.DisplayFor(model => model.HostelAllocationCriteria.Level.Name) </dd> <br /> <dt> @Html.DisplayName("Hostel:") </dt> <dd> @Html.DisplayFor(model => model.HostelAllocationCriteria.Hostel.Name) </dd> <br/> <dt> @Html.DisplayName("Series/Floor:") </dt> <dd> @Html.DisplayFor(model => model.HostelAllocationCriteria.Series.Name) </dd> <br/> <dt> @Html.DisplayName("Room:") </dt> <dd> @Html.DisplayFor(model => model.HostelAllocationCriteria.Room.Number) </dd> <br/> <dt> @Html.DisplayName("Bed Space:") </dt> <dd> @Html.DisplayFor(model => model.HostelAllocationCriteria.Corner.Name) </dd> <br /> </dl> </div> <div class="form-group"> <div class="col-md-offset-1 col-md-11"> <input type="submit" value="Yes" class="btn btn-success" /> | @Html.ActionLink("Cancel", "ViewHostelAllocationCriteria", "HostelAllocation", new { @class = "btn btn-success" }) </div> </div> </div> </div> } </div> </div><file_sep>using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; using Abundance_Nk.Business; using Abundance_Nk.Model.Model; using Abundance_Nk.Web.Models; using Microsoft.Reporting.WebForms; using ZXing; namespace Abundance_Nk.Web.Reports.Presenter { public partial class e_Recieptaspx : System.Web.UI.Page { private int reportType; private long paymentId; protected void Page_Load(object sender, EventArgs e) { try { lblMessage.Text = ""; if (!IsPostBack) { if (Request.QueryString["paymentId"] != null ) { paymentId = Convert.ToInt64(Utility.Decrypt(Request.QueryString["paymentId"])); BuildReport(paymentId); } } } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } private void BuildReport(long paymentId) { var paymentLogic = new PaymentLogic(); try { Payment payment = paymentLogic.GetBy(paymentId); List<Receipt> receipts = paymentLogic.GetReceiptsBy(payment.Id); string bind_dsStudentReport = "dsReceipt"; string reportPath = ""; string returnAction = ""; reportPath = @"Reports\Receipt.rdlc"; string fileName = "Receipt_" + payment.Person.Id + ".pdf"; if (Directory.Exists(Server.MapPath("~/Content/studentReceiptReportFolder"))) { if (File.Exists(Server.MapPath("~/Content/studentReceiptReportFolder" + fileName))) { File.Delete(Server.MapPath("~/Content/studentReceiptReportFolder" + fileName)); } } else { Directory.CreateDirectory(Server.MapPath("~/Content/studentReceiptReportFolder")); } Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; var rptViewer = new ReportViewer(); rptViewer.Visible = false; rptViewer.Reset(); rptViewer.LocalReport.DisplayName = "Receipt"; rptViewer.ProcessingMode = ProcessingMode.Local; rptViewer.LocalReport.ReportPath = reportPath; rptViewer.LocalReport.EnableExternalImages = true; string imageFilePath = GenerateQrCode(receipts.FirstOrDefault().QRVerification, payment.Id); string imagePath = new Uri(Server.MapPath(imageFilePath)).AbsoluteUri; ReportParameter QRParameter = new ReportParameter("ImagePath", imagePath); //string reportMark = Server.MapPath("/Content/Images/absu.bmp"); string reportMark = Server.MapPath("/Content/Images/nau.bmp"); string addressPath = new Uri(reportMark).AbsoluteUri; ReportParameter waterMark = new ReportParameter("AddressPath", addressPath); ReportParameter[] reportParams = { QRParameter, waterMark }; rptViewer.LocalReport.SetParameters(reportParams); rptViewer.LocalReport.DataSources.Add(new ReportDataSource(bind_dsStudentReport.Trim(), receipts)); byte[] bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath("~/Content/studentReceiptReportFolder"); string savelocation = ""; savelocation = Path.Combine(path, fileName); File.WriteAllBytes(savelocation, bytes); var urlHelp = new UrlHelper(HttpContext.Current.Request.RequestContext); Response.Redirect( urlHelp.Action("DownloadReceipt", new { controller = "Report", area = "Student", path = "~/Content/studentReceiptReportFolder/" + fileName }), false); //return File(Server.MapPath(savelocation), "application/zip", reportData.FirstOrDefault().Fullname.Replace(" ", "") + ".zip"); //Response.Redirect(savelocation, false); } catch (Exception ex) { lblMessage.Text = ex.Message + ex.InnerException.Message; } } public string GenerateQrCode(string url, long paymentId, string alt = "QR code", int height = 100, int width = 100, int margin = 0) { try { string folderPath = "~/Content/QRCodes/"; string imagePath = "~/Content/QRCodes/" + paymentId + ".Jpeg"; string verifyUrl = url; string wildCard = paymentId + "*.*"; IEnumerable<string> files = Directory.EnumerateFiles(Server.MapPath("~/Content/QRCodes/"), wildCard, SearchOption.TopDirectoryOnly); if (files != null && files.Count() > 0) { return imagePath; } // If the directory doesn't exist then create it. if (!Directory.Exists(Server.MapPath(folderPath))) { Directory.CreateDirectory(folderPath); } var barcodeWriter = new BarcodeWriter(); barcodeWriter.Format = BarcodeFormat.QR_CODE; var result = barcodeWriter.Write(verifyUrl); string barcodePath = Server.MapPath(imagePath); var barcodeBitmap = new Bitmap(result); using (MemoryStream memory = new MemoryStream()) { using (FileStream fs = new FileStream(barcodePath, FileMode.Create)) { barcodeBitmap.Save(memory, ImageFormat.Jpeg); byte[] bytes = memory.ToArray(); fs.Write(bytes, 0, bytes.Length); } } return imagePath; } catch (Exception) { throw; } } public Receipt BuildReceipt(string name, string invoiceNumber, PaymentEtranzact paymentEtranzact, decimal amount, string purpose, string MatricNumber, string ApplicationFormNumber, string session, string level, string department, string programme, string faculty) { try { var receipt = new Receipt(); ShortFallLogic shortFallLogic = new ShortFallLogic(); ShortFall shortFall = shortFallLogic.GetModelsBy(s => s.PAYMENT.Invoice_Number == invoiceNumber).LastOrDefault(); if (shortFall != null && !string.IsNullOrEmpty(shortFall.Description)) { receipt.Description = shortFall.Description; } receipt.Number = paymentEtranzact.ReceiptNo; receipt.Name = name; receipt.ConfirmationOrderNumber = paymentEtranzact.ConfirmationNo; receipt.Amount = amount; receipt.AmountInWords = NumberToWords((int)amount); receipt.Purpose = purpose; receipt.PaymentMode = paymentEtranzact.Payment.Payment.PaymentMode.Name; receipt.Date = (DateTime)paymentEtranzact.TransactionDate; receipt.QRVerification = "http://portal.abiastateuniversity.edu.ng//Common/Credential/Receipt?pmid=" + paymentEtranzact.Payment.Payment.Id; receipt.MatricNumber = MatricNumber; receipt.Session = session; receipt.Level = level; receipt.ReceiptNumber = paymentEtranzact.Payment.Payment.SerialNumber.ToString(); receipt.Department = department; receipt.Programme = programme; receipt.Faculty = faculty; return receipt; } catch (Exception) { throw; } } public Receipt BuildReceipt(string name, string invoiceNumber, Paystack paystack, decimal amount, string purpose, string MatricNumber, string ApplicationFormNumber, string session, string level, string department, string programme, string faculty) { try { var receipt = new Receipt(); receipt.Number = paystack.reference; receipt.Name = name; receipt.ConfirmationOrderNumber = paystack.reference; receipt.Amount = amount; receipt.AmountInWords = NumberToWords((int)amount); receipt.Purpose = purpose; receipt.PaymentMode = paystack.Payment.PaymentMode.Name; receipt.Date = (DateTime)paystack.transaction_date; receipt.QRVerification = "http://portal.abiastateuniversity.edu.ng//Common/Credential/Receipt?pmid=" + paystack.Payment.Id; receipt.MatricNumber = MatricNumber; receipt.Session = session; receipt.Level = level; receipt.ReceiptNumber = paystack.Payment.SerialNumber.ToString(); receipt.Department = department; receipt.Programme = programme; receipt.Faculty = faculty; return receipt; } catch (Exception) { throw; } } public static string NumberToWords(int number) { if (number == 0) return "zero"; if (number < 0) return "minus " + NumberToWords(Math.Abs(number)); string words = ""; if ((number / 1000000) > 0) { words += NumberToWords(number / 1000000) + " million "; number %= 1000000; } if ((number / 1000) > 0) { words += NumberToWords(number / 1000) + " thousand "; number %= 1000; } if ((number / 100) > 0) { words += NumberToWords(number / 100) + " hundred "; number %= 100; } if (number > 0) { if (words != "") words += "and "; var unitsMap = new[] { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; var tensMap = new[] { "zero", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" }; if (number < 20) words += unitsMap[number]; else { words += tensMap[number / 10]; if ((number % 10) > 0) words += "-" + unitsMap[number % 10]; } } return words; } } }<file_sep>@model Abundance_Nk.Web.Areas.Admin.ViewModels.SupportViewModel @{ ViewBag.Title = "Upload Student"; Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml"; } <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.js"></script> <script src="~/Content/js/bootstrap.min.js"></script> <link href="~/Scripts/DataTables-1.10.15/media/css/jquery.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/media/js/jquery.dataTables.js"></script> <link href="~/Scripts/DataTables-1.10.15/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet" /> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/dataTables.buttons.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Buttons/js/buttons.colVis.js"></script> <script src="~/Scripts/DataTables-1.10.15/extensions/Responsive/js/dataTables.responsive.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.flash.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.html5.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/buttons.print.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/jszip.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/pdfmake.min.js"></script> <script src="~/Scripts/DataTables-1.10.15/vfs_fonts.js"></script> <script src="~/Scripts/sweetalert.min.js"></script> <link href="~/Content/sweetalert.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function() { //Programme Drop down Selected-change event $("#Programme").change(function() { $("#Department").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetDepartments", "Support")', // Calling json method dataType: 'json', data: { id: $("#Programme").val() }, // Get Selected Country ID. success: function(departments) { $("#Department").append('<option value="' + 0 + '">' + '-- Select Department --' + '</option>'); $.each(departments, function(i, department) { $("#Department").append('<option value="' + department.Value + '">' + department.Text + '</option>'); }); }, error: function(ex) { alert('Failed to retrieve departments.' + ex); } }); return false; }); //Session Drop down Selected change event $.extend($.fn.dataTable.defaults, { responsive: false }); $("#myTable").DataTable({ dom: 'Bfrtip', ordering: true, buttons: [ { extend: 'copy', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'csv', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'excel', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'pdf', exportOptions: { columns: ':visible', header: true, modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, { extend: 'print', exportOptions: { columns: ':visible', modifier: { orientation: 'landscape' } }, orientation: 'landscape' }, , 'colvis' ] }); $("#submit").click(function () { $('#submit').attr('disable', 'disable'); }); }); </script> @using (Html.BeginForm("UploadStudentUsingExcel", "Support", new { area = "Admin" }, FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="row"> <div class="col-md-1"></div> <div class="col-md-10"> @if (TempData["Message"] != null) { @Html.Partial("_Message", TempData["Message"]) } <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-fw fa-upload"></i>Upload Student</h3> </div> <div class="panel-body"> @*<div class="form-group"> @Html.LabelFor(model => model.Programme.Name, "Programme", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Programme.Id, (IEnumerable<SelectListItem>)ViewBag.Programme, new { @class = "form-control", @id = "Programme", @required = "required" }) @Html.ValidationMessageFor(model => model.Programme.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Department.Name, "Department", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Department.Id, (IEnumerable<SelectListItem>)ViewBag.Department, new { @class = "form-control", @id = "Department", @required = "required" }) @Html.ValidationMessageFor(model => model.Department.Id, null, new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Level.Name, "Level", new { @class = "col-sm-2 control-label " }) <div class="col-sm-10"> @Html.DropDownListFor(model => model.Level.Id, (IEnumerable<SelectListItem>)ViewBag.Level, new { @class = "form-control", @id = "Level", @required = "required" }) @Html.ValidationMessageFor(model => model.Level.Id, null, new { @class = "text-danger" }) </div> </div>*@ <div class="form-group"> <div class="col-sm-2"></div> <div class="col-sm-10"> <input type="file" title="Upload Result" id="file" name="file" class="form-control" /> <br /> <input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Upload Here" /> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Preview Student</h3> </div> <div class="panel-body"> <br /> @if (Model == null || Model.UploadStudentDataList == null) { return; } @if (Model != null && Model.UploadStudentDataList.Count > 0) { <table class="table table-responsive table-bordered table-striped table-hover" id="myTable"> <thead> <tr> <th> SN </th> <th> LAST NAME </th> <th> FIRST NAME </th> <th> OTHER NAME </th> <th> JAMB NO </th> <th> EMAIL ADDRESS </th> <th> Remarks </th> </tr> </thead> <tbody> @for (int i = 0; i < Model.UploadStudentDataList.Count; i++) { <tr> <td> @Model.UploadStudentDataList[i].SN </td> <td> @Model.UploadStudentDataList[i].LastName </td> <td> @Model.UploadStudentDataList[i].FirstName </td> <td> @Model.UploadStudentDataList[i].OtherName </td> <td> @Model.UploadStudentDataList[i].JambNo </td> <td> @Model.UploadStudentDataList[i].EmailAddress </td> <td> @Model.UploadStudentDataList[i].Remarks </td> </tr> } </tbody> </table> <br /> <div class="form-group" style="text-align: center"> <div class="col-sm-10 pull-left"> @*<input class="btn btn-success mr5 " type="submit" name="submit" id="submit" value="Save Upload" />*@ @Html.ActionLink("Save", "SaveStudentUpload", new { controller = "Support", area = "Admin" }, new { @class = "btn btn-success mr5" }) </div> </div> } </div> </div> <div class="col-md-1"></div> </div> </div> }
223d62e87d4c7f9787f8f43e74c18b55859c0e3c
[ "HTML+Razor", "C#", "ASP.NET", "JavaScript" ]
373
HTML+Razor
Lloydant-Business-Services/Uniport_Deploy
bf620b52361318ca6638229a146afa339282b50b
b844081263e3d2f76454a87adf76b1aab8e8a440
refs/heads/master
<repo_name>flamerecca/104-aws-training-sample-app-crud<file_sep>/.travis.yml language: java jdk: - openjdk8 branches: only: master env: global: - S3_BUCKET_NAME=104recca-chao-cd - CODEDEPLOY_APPLICATION=recca-codedeploy-app - CODEDEPLOY_GROUP=104cdGroup - REGION=ap-northeast-1 - LOCAL_DIR=deploy script: - gradle build - mkdir ${LOCAL_DIR} - mv build/libs/example.war ROOT.war - zip release ROOT.war scripts/* appspec.yml - mv release.zip ${LOCAL_DIR}/ deploy: - provider: s3 bucket: "$S3_BUCKET_NAME" access_key_id: "$AWS_ACCESS_KEY_ID" secret_access_key: "$AWS_SECRET_ACCESS_KEY" local_dir: "$LOCAL_DIR" skip_cleanup: true region: "$REGION" on: branch: master - provider: codedeploy bucket: "$S3_BUCKET_NAME" access_key_id: "$AWS_ACCESS_KEY_ID" secret_access_key: "$AWS_SECRET_ACCESS_KEY" key: release.zip application: "$CODEDEPLOY_APPLICATION" deployment_group: "$CODEDEPLOY_GROUP" region: "$REGION" on: branch: master
c86aa1299ccb1f02f67c28579cb928888b1be629
[ "YAML" ]
1
YAML
flamerecca/104-aws-training-sample-app-crud
3111d086785445aa4f12fa61ac227225261a77a4
6670f2fab18233f1e4501c0461504ab990fa9b6b
refs/heads/master
<repo_name>rradosic/similaripsum<file_sep>/ComparisonService/app/LoremIpsumStreams/CorporateLoremIpsumStream.php <?php namespace App\LoremIpsumStreams; use App\LoremIpsumStreams\Traits\HasName; class CorporateLoremIpsumStream extends BaseLoremIpsumStream { function __construct() { $this->name = "Corporate Ipsum"; } public function getText(): string { $response = file_get_contents('https://corporatelorem.kovah.de/api/5?paragraphs=true'); $jsonResponse = json_decode($response); $fullText = ""; foreach ($jsonResponse->paragraphs as $key => $paragraph) { $fullText .= $paragraph; } return $fullText; } } <file_sep>/README.md # SIMILARIPSUM The task was to implement streaming service of lorem ipsum words that will inspect similarity between texts. Comparison method used for this implementation is the number of vowels in each text. ## Installation ### Requirements - Docker ### Steps 1. `git clone https://github.com/rradosic/similaripsum.git similaripsum` 2. `cd similaripsum` 3. `docker run --rm -v $(pwd)/ComparisonService:/app composer install` 4. `docker run --rm -v $(pwd)/ReporterAPI:/app composer install` 5. `docker-compose up` The main output should now be available http://localhost:8080/streamComparisonReport. Other endpoints include health checks for reporter api and the comparison service and they are available at :8080/health and :8079/health respectively. Redis cache is exposed at it's default port 6379. ## Architecture ![Architecture](https://i.ibb.co/C04n8Nt/Untitled-Document.png) ## Horizontal scaling ReporterAPI service can be scaled horizontally to simulate a case of an overloaded API endpoint. It can be scaled with `docker-compose scale reporter_api=n` where n is the number of instances you want to create. HAProxy service will automatically load balance between all instances with the round robin method. <file_sep>/images/php-apache/Dockerfile FROM php:7.4-apache COPY 000-default.conf /etc/apache2/sites-available/000-default.conf RUN a2enmod rewrite RUN chown -R www-data:www-data /var/www RUN apt-get update && apt-get -y install cron rsyslog COPY schedule-cron /etc/cron.d/schedule-cron RUN chmod 0644 /etc/cron.d/schedule-cron RUN crontab /etc/cron.d/schedule-cron RUN pecl install redis && docker-php-ext-enable redis RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf CMD rsyslogd && cron && chown -R www-data:www-data /var/www/storage && apache2-foreground <file_sep>/ComparisonService/app/LoremIpsumStreams/HipsterLoremIpsumStream.php <?php namespace App\LoremIpsumStreams; use App\LoremIpsumStreams\Traits\HasName; class HipsterLoremIpsumStream extends BaseLoremIpsumStream { function __construct() { $this->name = "<NAME>"; } public function getText(): string { $response = file_get_contents('https://hipsum.co/api/?type=hipster-centric&paras=5'); $paragraphsArray = json_decode($response, true); $fullText = ""; foreach ($paragraphsArray as $key => $paragraph) { $fullText .= $paragraph; } return $fullText; } } <file_sep>/ComparisonService/app/LoremIpsumStreams/LoremIpsumStream.php <?php namespace App\LoremIpsumStreams; interface LoremIpsumStream { /** * Returns text of the stream * * * @return string Text of multiple sentences separated with standard characters (!, ., ?) */ public function getText(): string; /** * Returns the name of the stream * * @return string */ public function getName(): string; } <file_sep>/ComparisonService/app/VowelStreamComparer.php <?php namespace App; use App\LoremIpsumStreams\LoremIpsumStream; class VowelStreamComparer implements StreamComparer { /** * Compares streams based on how many vowels they have * * @param App\LoremIpsumStreams\LoremIpsumStream $firstStream * @param App\LoremIpsumStreams\LoremIpsumStream $secondStream * @param int $wordOffset=5 Offset to use for comparison * @return array Structure [0]=> First stream, [1]=> Second stream */ public static function compareStreams(LoremIpsumStream $firstStream, LoremIpsumStream $secondStream) { $wordOffset = 5; $firstText = explode(" ", $firstStream->getText()); $secondText = explode(" ", $secondStream->getText()); $firstTextWordCount = count($firstText); $secondTextWordCount = count($secondText); $lowestCount = min($firstTextWordCount, $secondTextWordCount); $vowelCount = []; $vowelCount[0] = 0; $vowelCount[1] = 0; for ($i = $wordOffset; $i < $lowestCount; $i += $wordOffset) { $vowelCount[0] += preg_match_all('/[aeiou]/i', $firstText[$i]); $vowelCount[1] += preg_match_all('/[aeiou]/i', $secondText[$i]); } return $vowelCount; } } <file_sep>/ComparisonService/app/Jobs/CompareStreams.php <?php namespace App\Jobs; use App\LoremIpsumStreams\CorporateLoremIpsumStream; use App\LoremIpsumStreams\HipsterLoremIpsumStream; use App\LoremIpsumStreams\MetaphoreLoremIpsumStream; use App\LoremIpsumStreams\SkateLoremIpsumStream; use App\StreamComparer; use App\VowelStreamComparer; use Illuminate\Support\Facades\Cache; class CompareStreams extends Job { private StreamComparer $streamComparer; /** * Create a new job instance. * * @return void */ public function __construct() { } /** * Execute the job. * * @return void */ public function handle(StreamComparer $streamComparer) { $skateStream = new SkateLoremIpsumStream(); $corporateStream = new CorporateLoremIpsumStream(); $hipsterStream = new HipsterLoremIpsumStream(); $metaphoreStream = new MetaphoreLoremIpsumStream(); //Should probably have a StreamSet class but this is good enough for just two sets, data could also be a class $firstSetData = Cache::get("firstSetData"); $secondSetData = Cache::get("secondSetData"); if (empty($firstSetData)) $firstSetData = $this->initializeSetDataArray($skateStream->getName(), $corporateStream->getName()); if (empty($secondSetData)) $secondSetData = $this->initializeSetDataArray($metaphoreStream->getName(), $hipsterStream->getName()); $firstSetResult = $streamComparer::compareStreams($skateStream, $corporateStream); $secondSetResult = $streamComparer::compareStreams($metaphoreStream, $hipsterStream); $firstSetData["values"][0] += $firstSetResult[0]; $firstSetData["values"][1] += $firstSetResult[1]; $secondSetData["values"][0] += $secondSetResult[0]; $secondSetData["values"][1] += $secondSetResult[1]; Cache::put("firstSetData", $firstSetData); Cache::put("secondSetData", $secondSetData); Cache::increment("comparisonsDone"); } private function initializeSetDataArray($firstName, $secondName) { return [ "names" => [$firstName, $secondName], "values" => [0, 0] ]; } } <file_sep>/ComparisonService/app/LoremIpsumStreams/BaseLoremIpsumStream.php <?php namespace App\LoremIpsumStreams; abstract class BaseLoremIpsumStream implements LoremIpsumStream { protected string $name = 'Base Lorem Stream'; public function getName(): string { return $this->name; } public abstract function getText(): string; } <file_sep>/ComparisonService/app/StreamComparer.php <?php namespace App; use App\LoremIpsumStreams\LoremIpsumStream; interface StreamComparer { public static function compareStreams(LoremIpsumStream $firstStream, LoremIpsumStream $secondStream); } <file_sep>/ComparisonService/app/LoremIpsumStreams/SkateLoremIpsumStream.php <?php namespace App\LoremIpsumStreams; use App\LoremIpsumStreams\Traits\HasName; class SkateLoremIpsumStream extends BaseLoremIpsumStream { function __construct() { $this->name = "<NAME>"; } public function getText(): string { $response = file_get_contents('http://skateipsum.com/get/5/0/JSON'); $paragraphsArray = json_decode($response, true); $fullText = ""; foreach ($paragraphsArray as $key => $paragraph) { $fullText .= $paragraph; } return $fullText; } } <file_sep>/ReporterAPI/routes/web.php <?php /** @var \Laravel\Lumen\Routing\Router $router */ use App\Jobs\CompareStreams; use App\LoremIpsumStreams\CorporateLoremIpsumStream; use App\LoremIpsumStreams\HipsterLoremIpsumStream; use App\LoremIpsumStreams\MetaphoreLoremIpsumStream; use App\LoremIpsumStreams\SkateLoremIpsumStream; use App\StreamComparisonStrategy; use Illuminate\Support\Facades\Cache; /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It is a breeze. Simply tell Lumen the URIs it should respond to | and give it the Closure to call when that URI is requested. | */ $router->get('/streamComparisonReport', 'ReportController@show'); $router->get('/health', function () use ($router) { return response()->json(["status"=>"Still Alive"]); }); <file_sep>/ReporterAPI/app/Http/Controllers/ReportController.php <?php namespace App\Http\Controllers; use App\User; use Illuminate\Support\Facades\Cache; class ReportController extends Controller { /** * Retrieve the stream comparison report * * @return Response */ public function show() { $firstSetData = Cache::get("firstSetData"); $secondSetData = Cache::get("secondSetData"); if (!empty($firstSetData) && !empty($secondSetData)) { $firstSetProccessedData = $this->processSetData($firstSetData); $secondSetProccessedData = $this->processSetData($secondSetData); return response()->json([ "success" => true, "sets" => [ "firstSet" => $firstSetProccessedData, "secondSet" => $secondSetProccessedData, ] ]); } else { return response('The data is not ready yet. Try again in a minute.', 404, [ "Retry-After" => 60 ]); } } /** * Processes set data and calculates similarity percentage * * @param array $setData * @return array */ private function processSetData($setData):array { //Index of the larger value $firstSetMostVowels = array_keys($setData["values"], max($setData["values"]))[0]; $setData["mostVowels"] = $setData["names"][$firstSetMostVowels]; $setData["similarityPercentage"] = number_format((min($setData["values"])/max($setData["values"]))*100,2); return $setData; } } <file_sep>/ComparisonService/app/LoremIpsumStreams/MetaphoreLoremIpsumStream.php <?php namespace App\LoremIpsumStreams; use App\LoremIpsumStreams\Traits\HasName; class MetaphoreLoremIpsumStream extends BaseLoremIpsumStream { function __construct() { $this->name = "Metaphore Ipsum"; } public function getText(): string { $response = file_get_contents('http://metaphorpsum.com/paragraphs/5'); return strval($response); } }
440ce9eb4e81df645977f5f63c3542e34014f870
[ "Markdown", "Dockerfile", "PHP" ]
13
Markdown
rradosic/similaripsum
b194e611883297617cf9f3938332f3de62e73c5e
64cd41eb8e280cb4c6369350ac672ad36a31fa55
refs/heads/master
<file_sep>""" This sets up an example site """ import os from paste.urlparser import StaticURLParser from paste.httpserver import serve from weberror.evalexception import EvalException from deliverance.middleware import DeliveranceMiddleware, RulesetGetter from deliverance.security import SecurityContext base_path = os.path.join(os.path.dirname(__file__), 'example-files') app = StaticURLParser(base_path) deliv_app = DeliveranceMiddleware(app, RulesetGetter('/rules.xml')) full_app = SecurityContext.middleware(deliv_app, execute_pyref=True, display_logging=True, display_local_files=True, force_dev_auth=True) if __name__ == '__main__': print 'See http://127.0.0.1:8080/?deliv_log for the page with log messages' serve(EvalException(full_app)) <file_sep>#!/bin/sh if [ "$1" = "publish" ] ; then PUBLISH=1 OPS="-D live_site=1" shift; fi mkdir -p docs/_static docs/_build sphinx-build $OPS "$@" -E -b html docs/ docs/_build || exit 1 if [ "$PUBLISH" = "1" ] ; then cd docs/_build echo "Uploading files..." tar czvf - . | ssh flow.openplans.org 'ssh acura.openplans.org "cd /www/deliverance.openplans.org/; tar xzvf -"' fi
cad46916e5f84871dc9a1ee6219cb79486498fa7
[ "Shell", "Python" ]
2
Shell
pombredanne/Deliverance
90de7a90d26fca5f40d4c67ceb9a4805cdd81251
2e8f61781fb3f2b9977282992dc43e0270e662ed
refs/heads/master
<file_sep># recognize-digits A solution using Tensorflow for "Digit Recognizer" in Kaggle.
770d722a192a00ea10cbf0883cdcf0d4a811094e
[ "Markdown" ]
1
Markdown
felix-ge/recognize-digits
0f20ceac45230106257d26dc5ad8845a2241f79a
5a96921ee59ca2399f85b21efd3b09cc47d660b2