├── img
├── msg.gif
├── edit.png
├── delete.png
├── detail.png
├── big_bottom.gif
├── big_middle.gif
├── misc
│ └── logo.jpg
├── smilies
│ ├── cool.png
│ ├── hmm.png
│ ├── lol.png
│ ├── mad.png
│ ├── roll.png
│ ├── sad.png
│ ├── smile.png
│ ├── wink.png
│ ├── yikes.png
│ ├── neutral.png
│ ├── tongue.png
│ └── big_smile.png
└── users
│ └── nobody.jpg
├── msg.css
├── login.php
├── inc
├── func.js
├── NotFound.php
├── Profile.php
├── Settings.php
├── Message.php
├── Page.php
├── Dashboard.php
├── Matakuliah.php
├── Dosen.php
└── Mahasiswa.php
├── lib
├── AddSlashes.php
├── Session.php
├── Thumbnail.php
├── Auth.php
└── MySQL.php
├── connect.php
├── index.php
└── style.css
/img/msg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/msg.gif
--------------------------------------------------------------------------------
/img/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/edit.png
--------------------------------------------------------------------------------
/img/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/delete.png
--------------------------------------------------------------------------------
/img/detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/detail.png
--------------------------------------------------------------------------------
/msg.css:
--------------------------------------------------------------------------------
1 | textarea{
2 | width:100%;
3 | background-color:#F6E5A4;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/img/big_bottom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/big_bottom.gif
--------------------------------------------------------------------------------
/img/big_middle.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/big_middle.gif
--------------------------------------------------------------------------------
/img/misc/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/misc/logo.jpg
--------------------------------------------------------------------------------
/img/smilies/cool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/cool.png
--------------------------------------------------------------------------------
/img/smilies/hmm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/hmm.png
--------------------------------------------------------------------------------
/img/smilies/lol.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/lol.png
--------------------------------------------------------------------------------
/img/smilies/mad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/mad.png
--------------------------------------------------------------------------------
/img/smilies/roll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/roll.png
--------------------------------------------------------------------------------
/img/smilies/sad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/sad.png
--------------------------------------------------------------------------------
/img/smilies/smile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/smile.png
--------------------------------------------------------------------------------
/img/smilies/wink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/wink.png
--------------------------------------------------------------------------------
/img/smilies/yikes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/yikes.png
--------------------------------------------------------------------------------
/img/users/nobody.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/users/nobody.jpg
--------------------------------------------------------------------------------
/img/smilies/neutral.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/neutral.png
--------------------------------------------------------------------------------
/img/smilies/tongue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/tongue.png
--------------------------------------------------------------------------------
/img/smilies/big_smile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ATA/dynebolic/master/img/smilies/big_smile.png
--------------------------------------------------------------------------------
/login.php:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/inc/func.js:
--------------------------------------------------------------------------------
1 | function makeMsg(uid){
2 | var win = window.open('index.php?page=message&uid='+uid,'',
3 | 'width=350,height=480,scrollbars=no,resizable=no,status=yes,toolbar=no,location=no'
4 | );
5 | return win;
6 | }
7 |
--------------------------------------------------------------------------------
/lib/AddSlashes.php:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/inc/NotFound.php:
--------------------------------------------------------------------------------
1 | page .= <<
6 |
7 |
Error.. Page Not Found... !!!
8 |
9 |
10 |
11 | EOD;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/connect.php:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/lib/Session.php:
--------------------------------------------------------------------------------
1 |
27 |
--------------------------------------------------------------------------------
/inc/Profile.php:
--------------------------------------------------------------------------------
1 | auth->session->get(POST_LOGIN_VAR);
7 | $result = $this->db->query("SELECT usr_id FROM tbl_users WHERE usr_login ='$usr_login'");
8 | $row = $result->fetch();
9 | if($this->privilege == MHS) {
10 | $content .= 'lihat nilai';
11 | $content .= $this->displayDetailMhs($row['usr_id']);
12 | if(isset($_GET['view']) && $_GET['view']=='nilai'){
13 | $content = $this->viewNilai($this->usr_id);
14 | }
15 | if(isset($_GET['view']) && $_GET['view']=='history_nilai'){
16 | $mk_id = $_GET['mk_id'];
17 | $content = $this->historyNilai($this->usr_id,$mk_id);
18 | }
19 | }
20 | else{
21 | $content = $this->displayDetailDosen($row['usr_id']);
22 | }
23 | $this->page .= <<
25 |
26 | $content
27 |
28 |
29 | EOD;
30 | }
31 | }
32 |
33 | ?>
34 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | logout();
17 | }
18 | if(!isset($_GET['page'])){
19 | $page = new Dashboard('dashboard','Dashboard Page',$db,$auth);
20 | }
21 | else{
22 | switch($_GET['page']){
23 | case 'dashboard': $page = new Dashboard('dashboard','Dashboard Page',$db,$auth);break;
24 | case 'matakuliah': $page = new Matakuliah('matakuliah','Data matakuliah',$db,$auth);break;
25 | case 'mahasiswa': $page = new Mahasiswa('mahasiswa','Data Mahasiswa',$db,$auth);break;
26 | case 'dosen': $page = new Dosen('dosen','Data Dosen',$db,$auth);break;
27 | case 'profile': $page = new Profile('profile','halaman Profile',$db,$auth);break;
28 | case 'settings': $page = new Settings('settings','halaman Setting',$db,$auth);break;
29 | case 'message': $pgae = new Message('message','Pesan',$db,$auth);break;
30 | case 'notfound':$page = new NotFound('notfound','Not Found',$db,$auth);break;
31 | default:$page = new NotFound('notfound','Not Found',$db,$auth);break;
32 | }
33 | }
34 | ?>
35 |
--------------------------------------------------------------------------------
/inc/Settings.php:
--------------------------------------------------------------------------------
1 | privilege != ADM){
6 | header('Location:'.$_SERVER['PHP_SELF'].'?page=notfound');
7 | }
8 | if(isset($_POST['save'])){
9 | $this->storeSettings();
10 | header('Location:'.$_SERVER['REQUEST_URI']);
11 | $status='Setting Tersimpan!
';
12 | }
13 | else{
14 | $_POST = $this->getValueSettings();
15 | }
16 | $uri = $_SERVER['REQUEST_URI'];
17 | $this->page .= '';
18 | $this->page .= '
Setting Website
'.$status;
19 | $this->page .= '
';
32 | }
33 | function getValueSettings(){
34 |
35 | $res = $this->db->query("SELECT * FROM tbl_settings");
36 | while($row = $res->fetch()){
37 | $val[] = $row['set_value'];
38 | }
39 | $set['prodi'] = $val[0];
40 | $set['universitas'] = $val[1];
41 | $set['url_logo'] = $val[2];
42 | $set['sambutan'] = $val[3];
43 | return $set;
44 | }
45 | function storeSettings(){
46 | $input = array_map('mysql_real_escape_string',$_POST);
47 |
48 | $this->db->query("UPDATE tbl_settings SET set_value='".$input['prodi']."' WHERE set_option='prodi'");
49 | $this->db->query("UPDATE tbl_settings SET set_value='".$input['universitas']."' WHERE set_option='universitas'");
50 | $this->db->query("UPDATE tbl_settings SET set_value='".$input['sambutan']."' WHERE set_option='sambutan'");
51 | if($_FILES['url_logo']['type']== 'image/jpeg'){
52 | move_uploaded_file($_FILES['url_logo']['tmp_name'],'img/misc/logo.jpg');
53 | }
54 | }
55 |
56 | }
57 |
58 | ?>
59 |
--------------------------------------------------------------------------------
/lib/Thumbnail.php:
--------------------------------------------------------------------------------
1 | initialfilesize = filesize($file);
11 | $this->imageproperties = getimagesize($file) or die('tipe file salah');
12 | $this->mimetype = image_type_to_mime_type($this->imageproperties[2]);
13 | switch($this->imageproperties[2]){
14 | case IMAGETYPE_JPEG:
15 | $this->image = imagecreatefromjpeg($file);
16 | break;
17 | case IMAGETYPE_GIF:
18 | $this->image = imagecreatefromgif($file);
19 | break;
20 | case IMAGETYPE_PNG:
21 | $this->image = imagecreatefrompng($file);
22 | break;
23 | default:
24 | die('tidak bisa membuat image');
25 | }
26 | $this->createThumb($thumbsize);
27 | }
28 | function createThumb($thumbsize){
29 | $srcW = $this->imageproperties[0];
30 | $srcH = $this->imageproperties[1];
31 | if($srcW > $thumbsize || $srcH > $thumbsize){
32 | $reduction = $this->calculateReduction($thumbsize);
33 | $desW = $srcW / $reduction;
34 | $desH = $srcH / $reduction;
35 | $copy = imagecreatetruecolor($desW,$desH);
36 | imagecopyresampled($copy,$this->image,0,0,0,0,$desW,$desH,$srcW,$srcH) or die('gagal copy image');
37 | imagedestroy($this->image);
38 | $this->image = $copy;
39 | }
40 | }
41 | function calculateReduction($thumbsize){
42 | $srcW = $this->imageproperties[0];
43 | $srcH = $this->imageproperties[1];
44 | if($srcW < $srcH){
45 | $reduction = round($srcH/$thumbsize);
46 | }
47 | else{
48 | $reduction = round($srcW/$thumbsize);
49 | }
50 | return $reduction;
51 | }
52 | function getImage($output = ''){
53 | header('Content-type:'.$this->mimetype);
54 | switch($this->imageproperties[2]){
55 | case IMAGETYPE_JPEG:
56 | imagejpeg($this->image,$output,$this->quality);
57 | break;
58 | case IMAGETYPE_GIF:
59 | imagegif($this->image,$output);
60 | break;
61 | case IMAGETYPE_PNG:
62 | imagepng($this->image,$output,$this->quality);
63 | break;
64 | default:
65 | die('tidak bisa membuat image');
66 | }
67 | }
68 | function setQuality($quality){
69 | if($quality > 100 || $quality < 1){
70 | $quality = 75;
71 | }
72 | if($this->imageproperties == IMAGETYPE_JPEG || $this->imageproperties == IMAGETYPE_PNG){
73 | $this->quality = $quality;
74 | }
75 | }
76 | function getQuality(){
77 | $quality = null;
78 | if($this->imageproperties == IMAGETYPE_JPEG || $this->imageproperties == IMAGETYPE_PNG){
79 | $quality = $this->quality;
80 | }
81 | return $quality;
82 | }
83 | function getMimeType(){
84 | return $this->mimetype;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/lib/Auth.php:
--------------------------------------------------------------------------------
1 | db = &$db;
17 | $this->login_page = $login_page;
18 | $this->session = &new Session();
19 | $this->login();
20 | }
21 |
22 | function login() {
23 | if($this->session->get('login_hash')){
24 | $this->confirmAuth();
25 | return;
26 | }
27 | if(isset($_POST[POST_LOGIN_VAR]) && isset($_POST[POST_LOGIN_PASS])){
28 | $login = mysql_escape_string(strtolower($_POST[POST_LOGIN_VAR]));
29 | $password = mysql_escape_string(md5($_POST[POST_LOGIN_PASS]));
30 | $sql = "SELECT COUNT(*) AS num_users,".USER_PRIV." FROM " . TABLE_USERS ."
31 | WHERE
32 | " . USER_LOGIN . " = '$login' AND
33 | " . USER_PASS . " = '$password'
34 | GROUP BY usr_id";
35 | //echo $sql;
36 | $result = $this->db->query($sql);
37 | $row = $result->fetch();
38 | $privilege = $row[USER_PRIV];
39 | if($row['num_users'] != 1){
40 | $this->redirect();
41 | }
42 | else{
43 | $this->storeAuth($login,$password,$privilege);
44 | }
45 | }
46 | else{
47 | $this->redirect();
48 | }
49 | }
50 |
51 | function storeAuth($login, $password, $privilege){
52 | $sql = "UPDATE ". TABLE_USERS . " SET " . USER_LAST_LOGIN . "=NOW()
53 | WHERE ".USER_LOGIN." = '$login' AND " .USER_PASS ."='$password'";
54 | $this->db->query($sql);
55 | $this->session->set(POST_LOGIN_VAR, $login);
56 | $this->session->set(POST_LOGIN_PASS, $password);
57 | $this->session->set(USER_PRIV, $privilege);
58 | $hash_key = md5($this->hash_key . $login . $password . $privilege);
59 | $this->session->set('login_hash',$hash_key);
60 | }
61 |
62 | function confirmAuth(){
63 | $login = $this->session->get(POST_LOGIN_VAR);
64 | $password = $this->session->get(POST_LOGIN_PASS);
65 | $privilege = $this->session->get(USER_PRIV);
66 | $hash_key = $this->session->get('login_hash');
67 | if(md5($this->hash_key . $login . $password . $privilege) != $hash_key) {
68 | $this->logout(true);
69 | }
70 | }
71 |
72 | function getPrivilege(){
73 | return $this->session->get(USER_PRIV);
74 | }
75 |
76 | function logout($from = false) {
77 | $this->session->del(POST_LOGIN_VAR);
78 | $this->session->del(USER_PASSW_VAR);
79 | $this->session->del('login_hash');
80 | $this->session->del(USER_PRIV);
81 | $this->session->destroy();
82 | $this->redirect($from);
83 | }
84 |
85 | function redirect($from = true){
86 | if ($from){
87 | header('Location:'.$this->login_page.'?from='.$_SERVER['REQUEST_URI']);
88 | }
89 | else{
90 | header('Location:'.$this->login_page);
91 | }
92 | exit();
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/lib/MySQL.php:
--------------------------------------------------------------------------------
1 | host = $host;
14 | $this->dbUser = $dbUser;
15 | $this->dbPass = $dbPass;
16 | $this->dbName = $dbName;
17 | $this->displayError = $displayError;
18 | $this->connectToDb();
19 | }
20 | function connectToDb(){
21 | if(!$this->dbConn = @mysql_connect($this->host,$this->dbUser,$this->dbPass)){
22 | if($this->displayError){
23 | trigger_error('tidak bisa connect ke Database');
24 | }
25 | $this->connectError = true;
26 | }
27 | else if(!@mysql_select_db($this->dbName,$this->dbConn)){
28 | if($this->displayError){
29 | trigger_error('data Base salah');
30 | }
31 | $this->dbFalse = true;
32 | $this->connectError = true;
33 | }
34 | }
35 | function &query($sql){
36 | if(!$result = mysql_query($sql,$this->dbConn)){
37 | trigger_error('Kesalahan Query: '.mysql_error($this->dbConn).' SQL: '.$sql);
38 | echo 'Query input:' . $sql;
39 | }
40 | return new MySQLResult($this, $result);
41 | }
42 | function isError(){
43 | if($this->connectError){
44 | return true;
45 | }
46 | $error = mysql_error($this->dbConn);
47 | if(empty($error)){
48 | return false;
49 | }
50 | else{
51 | return true;
52 | }
53 | }
54 | }
55 | class MySQLResult{
56 | var $mysql;
57 | var $query;
58 | var $result;
59 | function MySQLResult(&$mysql,$query){
60 | $this->mysql = &$mysql;
61 | $this->query = $query;
62 | $this->result = '';
63 | }
64 | function fetch(){
65 | if($row = mysql_fetch_assoc($this->query)){
66 | return $row;
67 | }
68 | else if($this->size() > 0){
69 | return false;
70 | }
71 | else{
72 | return false;
73 | }
74 | }
75 | function fetch_row(){
76 | if($row = mysql_fetch_row($this->query)){
77 | return $row;
78 | }
79 | else if($this->size() > 0){
80 | return false;
81 | }
82 | else{
83 | return false;
84 | }
85 | }
86 | function lenght_field(){
87 | return mysql_num_fields($this->query);;
88 | }
89 | function field_name($no){
90 | return mysql_field_name($this->query,$no);
91 | }
92 | function size(){
93 | return mysql_num_rows($this->query);
94 | }
95 | function tableResult(){
96 | $this->result = '';
97 | for ($i = 0; $i < $this->lenght_field(); $i++){
98 | $this->result .= '| '.$this->field_name($i).' | ';
99 | }
100 | $this->result .= '';
101 | while ($row = $this->fetch_row()){
102 | $this->result .= '';
103 | for($i = 0; $i < $this->lenght_field();$i++){
104 | $this->result .= '| '.$row[$i].' | ';
105 | }
106 | $this->result .= '
';
107 | }
108 | $this->result .= '
';
109 | return $this->result;
110 | }
111 | function isError(){
112 | return $this->mysql->isError();
113 | }
114 | }
115 | ?>
116 |
--------------------------------------------------------------------------------
/inc/Message.php:
--------------------------------------------------------------------------------
1 | getImage();
10 | }
11 | $this->page .= <<
13 |
14 |
15 | Sistem Informasi Wali - $this->title
16 |
17 |
18 |
19 |
20 |
21 | EOD;
22 | $page->page .= 'Halaman Pesan';
23 | }
24 | function Message($id,$title,&$db,&$auth){
25 | $this->page = '';
26 | $this->id = $id;
27 | $this->title = $title;
28 | $this->db = &$db;
29 | $this->auth =&$auth;
30 | $this->privilege = $this->auth->getPrivilege();
31 | $this->login = $this->auth->session->get(POST_LOGIN_VAR);
32 | $res = $this->db->query("SELECT usr_id FROM tbl_users WHERE usr_login='$this->login'");
33 | $row = $res->fetch();
34 | $this->usr_id = $row['usr_id'];
35 | $this->addHeader();
36 | $this->addContent();
37 | $this->addFooter();
38 | $this->display();
39 | }
40 | function addContent(){
41 | $smile = array(
42 | ':D' => '
',
43 | '8,' => '
',
44 | ':/' => '
',
45 | ':))' => '
',
46 | ':C' => '
',
47 | ':|' => '
',
48 | '8/' => '
',
49 | ':(' => '
',
50 | ':)' => '
',
51 | ':b' => '
',
52 | ';)' => '
',
53 | ':()' => '
',
54 | );
55 | $uri = $_SERVER['REQUEST_URI'];
56 | $self = $_SERVER['PHP_SELF'];
57 | if(isset($_POST['send'])){
58 | $uid = $_GET['uid'];
59 | $pesan = mysql_real_escape_string($_POST['pesan']);
60 | $pesan = strip_tags($pesan,'');
61 | $pesan = str_replace(array_keys($smile),array_values($smile),$pesan);
62 | $pesan = trim($pesan);
63 | $this->db->query("INSERT INTO tbl_pesan(usr_id_asal,usr_id_tujuan,pesan_isi)
64 | VALUE($this->usr_id,$uid,'$pesan')");
65 |
66 | }
67 | if(!isset($_GET['view'])){
68 | $uid = $_GET['uid'];
69 | $res = $this->db->query("SELECT usr_nama, usr_url_pic FROM tbl_users WHERE usr_id=$uid");
70 | $row = $res->fetch();
71 | $nama = $row['usr_nama'];
72 | $pic = $row['usr_url_pic'];
73 | $this->page .= <<
75 |
76 |
77 |  |
78 | $nama |
79 |
80 |
81 | |
82 | Pesan |
83 | History
84 | |
85 |
86 |
87 |
88 |
95 |
102 | EOD;
103 | foreach($smile as $key => $img){
104 | $this->page .= ''.$img.' ';
105 | }
106 | $this->page .= <<
108 |
112 | copyright © kelompok Dyne:Bolic
113 | EOD;
114 | }
115 | else if($_GET['view'] == 'read'){
116 | $this->chatBoard();
117 | }
118 | else if($_GET['view'] == 'history'){
119 | $this->chatBoard(10000);
120 | }
121 | }
122 |
123 | function chatBoard($limit = 20){
124 | $uid = $_GET['uid'];
125 | $sql = <<usr_id AND tbl_pesan.usr_id_tujuan = $uid )
130 | OR (tbl_pesan.usr_id_asal = $uid AND tbl_pesan.usr_id_tujuan = $this->usr_id ))
131 | AND tbl_users.usr_id = tbl_pesan.usr_id_asal
132 | ORDER by pesan_id DESC LIMIT 0,$limit
133 | EOD;
134 | $res = $this->db->query($sql);
135 | $message = array();
136 | while($row = $res->fetch()){
137 | $message[] = ''.$row['usr_nama'].' :
'.$row['pesan_isi'].'
';
138 | }
139 | for($i = count($message) - 1; $i >= 0; $i-- ){
140 | $this->page .= $message[$i];
141 | }
142 | $this->db->query("UPDATE tbl_pesan SET pesan_status = 1 WHERE usr_id_tujuan = $this->usr_id AND usr_id_asal = $uid");
143 | $this->page .= '';
144 | }
145 |
146 | function addFooter(){
147 | $this->page .= <<
149 |
150 | EOD;
151 | }
152 | }
153 |
154 | ?>
155 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | font-family:Verdana, Arial, Helvetica, sans-serif;
3 | font-size:0.8em;
4 | padding:0;
5 | margin:0;
6 | background: #F0F0F0;
7 | color:#333333;
8 | text-align:center;
9 | }
10 | .wraper{
11 | width:768px;
12 | background:url(img/big_middle.gif) repeat-y;
13 | text-align:center;
14 | margin:0 auto;
15 | }
16 | .main{
17 | margin:0;
18 | padding:0 10px 10px 10px;
19 | background:url(img/big_bottom.gif) no-repeat bottom left;
20 | }
21 | .header{
22 | position:relative;
23 | height:150px;
24 | padding:0;
25 | margin:0 auto;
26 | border-bottom:1px solid #999999;
27 | }
28 | #logo{
29 | text-transform:capitalize;
30 | position:absolute;
31 | top:0;
32 | left:20px;
33 | width:150px;
34 | height:150px;
35 | text-align:center;
36 | }
37 | #logo h3{
38 | position:absolute;
39 | font-size:12px;
40 | padding:0;
41 | margin:0;
42 | bottom:0;
43 | right:0;
44 | left:0;
45 | }
46 | #logo h2{
47 | text-transform:uppercase;
48 | position:absolute;
49 | color:#FF0006;
50 | font-size:14px;
51 | padding:0;
52 | margin:0;
53 | right:0;
54 | left:0;
55 | bottom:30px;;
56 | }
57 | #logo img{
58 | /*height:120px;
59 | width:120px;*/
60 | margin:0 auto;
61 | }
62 | #status{
63 | position:absolute;
64 | right:0;
65 | top:5px;
66 | }
67 | #status p{
68 | margin:0;
69 | padding:0;
70 | }
71 | #name{
72 | text-align:right;
73 | position:absolute;
74 | bottom:10px;
75 | right:0;
76 | }
77 | #name h2{
78 | font-size:30px;
79 | text-transform:capitalize;
80 | padding:0;
81 | margin:0;
82 | }
83 | #name h3{
84 | text-transform:uppercase;
85 | padding:0;
86 | margin:0;
87 | }
88 | .menu{
89 | text-align:left;
90 | background:#F5F5F5;
91 | font-size:90%;
92 | }
93 | .menu ul{
94 | list-style:none;
95 | margin:0;
96 | margin-left:220px;
97 | padding:0;
98 | padding-top:1em;
99 | }
100 | .menu li{
101 | display:inline;
102 | }
103 | .menu a:link,.menu a:visited{
104 | padding:0.4em 1em 0 1em;
105 | color:#404040;
106 | background:#FFFFFF;
107 | text-decoration:none;
108 | font-weight:bold;
109 | border:1px solid #999999;
110 | border-bottom:none;
111 | }
112 | .menu a:hover{
113 | padding:0.6em 1em 0 1em;
114 | }
115 | .content{
116 | background:#F5F5F5;
117 | text-align:left;
118 | border-top:1px solid #999999;
119 | }
120 | #content{
121 | margin:10px;
122 | text-align:left;
123 | }
124 | #content #result{
125 | text-align:center;
126 | }
127 | #content #paging{
128 | text-align:center;
129 | }
130 | #content #paging a{
131 | margin:5px;
132 | }
133 | #result h2{
134 | margin:10px 0;
135 | padding:0;
136 | }
137 | #content table{
138 | margin:0 auto;
139 | text-align:left;
140 | }
141 | #content th{
142 | color:#FFFFFF;
143 | background:#333333;
144 | padding:5px 5px;
145 | }
146 | #content td{
147 | padding:5px;
148 | vertical-align:top;
149 | }
150 | #content a:link, #content a:visited{
151 | text-decoration:none;
152 | color:#0011FF;
153 | border:none;
154 | }
155 | #content a:hover{
156 | text-decoration:underline;
157 | }
158 | #content img{
159 | border:none;
160 | }
161 | .maincontent{
162 | background-color:#FFFFFF;
163 | float:left;
164 | width:auto;
165 | margin:0 ;
166 | width:547px;
167 | border-left:1px solid #999999;
168 | border-bottom:1px solid #999999;
169 | }
170 | .sidebar{
171 | text-align:center;
172 | width:200px;
173 | margin:0;
174 | margin-top:-2px;
175 | float:left;
176 | background:#F5F5F5;
177 | padding:0;
178 | }
179 | .boxside{
180 | font-size:10px;
181 | text-align:left;
182 | margin:10px;
183 | margin-top:0;
184 | margin-left:0;
185 | background:#FFFFFF;
186 | padding:0;
187 | border:1px solid #999999;
188 | }
189 | .boxside h4{
190 | font-size:12px;
191 | color:#FFFFFF;
192 | background-color:#333333;
193 | padding:3px;
194 | margin:-1px;
195 | margin-bottom:5px;
196 | }
197 | .boxside a:link,.boxside a:visited{
198 | margin-left:5px;
199 | text-decoration:none;
200 | color:#333333;
201 | }
202 | .boxside table{
203 | }
204 | .boxside td{
205 | background-color:#F5F5F5;
206 | vertical-align:top;
207 | }
208 | .boxside p{
209 | margin:5px;
210 | text-align:center;
211 | }
212 | .boxside img{
213 | border:none;
214 | }
215 | .footer{
216 | background-color:#FFFFFF;
217 | border-top:1px solid #CCCCCC;
218 | clear:both;
219 | margin:0 auto;
220 | height:30px;
221 | text-align:right;
222 | }
223 | .footer p{
224 | margin-top:5px;
225 | }
226 | #formlogin{
227 | font-weight:bold;
228 | width:160px;
229 | text-align:left;
230 | margin:20px auto;
231 | }
232 | #form input,#form select,#form textarea{
233 | width:200px;
234 | background-color:#FFF4E8;
235 | }
236 | #form input:focus,#form select:focus,#form textarea:focus{
237 | background-color:#FFDA89;
238 | }
239 | #form textarea{
240 | height:100px;
241 | }
242 | #form #submit{
243 | margin-top:20px;
244 | }
245 | .t{
246 | width:520px;
247 | }
248 | .t td{
249 | background-color:#F8F8F8;
250 | }
251 | #dash table{
252 | width:520px;
253 | }
254 | #dash td{
255 | background-color:#F5F5F5;
256 | vertical-align:top;
257 | }
258 | #dash textarea{
259 | width:300px;
260 | }
261 | #msgerror{
262 | background-color:#FFDDDD;
263 | border:2px solid #FF0000;
264 | font-size:small;
265 | color:#FF0000;
266 | }
267 | #saveedit{
268 | background-color:#C4FBC8;
269 | padding:5px;
270 | text-align:center;
271 | border:2px solid #00FF13;
272 | color:#00A30C;
273 | margin:0 100px;
274 | }
275 | textarea#lebar{
276 | width:400px;
277 | height:300px;
278 | }
279 |
--------------------------------------------------------------------------------
/inc/Page.php:
--------------------------------------------------------------------------------
1 | page = '';
16 | $this->db = &$db;
17 | $this->id = $id;
18 | $this->title = $title;
19 | $this->addHeader();
20 | $this->addSidebar();
21 | $this->addContent();
22 | $this->addFooter();
23 | $this->display();
24 | }
25 |
26 | function addHeader(){
27 | if(isset($_GET['img']) && isset($_GET['size'])){
28 | $img = $_GET['img'];
29 | $size = $_GET['size'];
30 | $thumb = new Thumbnail($img,$size);
31 | $thumb->getImage();
32 | }
33 | $q_prodi = "SELECT set_value FROM tbl_settings WHERE set_option='prodi'";
34 | $q_univ = "SELECT set_value FROM tbl_settings WHERE set_option='universitas'";
35 | $q_url_logo = "SELECT set_value FROM tbl_settings WHERE set_option='url_logo'";
36 |
37 | $rs_prodi = $this->db->query($q_prodi);
38 | $rs_univ = $this->db->query($q_univ);
39 | $rs_url_logo = $this->db->query($q_url_logo);
40 |
41 | $r_prodi = $rs_prodi->fetch();
42 | $r_univ = $rs_univ->fetch();
43 | $r_url_logo = $rs_url_logo->fetch();
44 | // set variabel
45 | $prodi = $r_prodi['set_value'];
46 | $univ = $r_univ['set_value'];
47 | $url_logo = $r_url_logo['set_value'];
48 | session_start();
49 | if(isset($_SESSION['login_hash'])){
50 | $usr_login = $_SESSION[POST_LOGIN_VAR];
51 | $sql = "SELECT usr_nama FROM tbl_users WHERE usr_login ='$usr_login'";
52 | $res = $this->db->query($sql);
53 | $row = $res->fetch();
54 | $status = 'Anda login sebagai '.$row['usr_nama'].' | Log Out';
55 | $sql = "UPDATE ". TABLE_USERS . " SET " . USER_LAST_LOGIN . "=NOW()
56 | WHERE ".USER_LOGIN." = '$usr_login'";
57 | $this->db->query($sql);
58 | }
59 | else{
60 | $status = '';
61 | }
62 | $self = $_SERVER['PHP_SELF'];
63 | $icon = $self.'?size=20&img='.$url_logo;
64 | $logo = $self.'?size=130&img='.$url_logo;
65 | $this->page .= <<
67 |
68 |
69 | Sistem Informasi Wali - $this->title
70 |
71 |
72 |
73 |
74 |
75 |
82 |
83 |
84 |
85 |
86 |
100 |
101 | EOD;
102 | }
103 |
104 | function addSidebar(){
105 | if(!isset($_GET['from'])){
106 | $target = 'index.php';
107 | }
108 | else{
109 | $target = $_GET['from'];
110 | }
111 | $this->page .=<<
113 |
122 | EOD;
123 |
124 | }
125 |
126 | function addContent(){
127 | $q_content = "SELECT set_value FROM tbl_settings WHERE set_option='sambutan'";
128 | $rs_content = $this->db->query($q_content);
129 | $r_content = $rs_content->fetch();
130 | $content = $r_content['set_value'];
131 | $this->page .= <<
133 |
134 |
135 | $content
136 |
137 |
138 |
139 |
140 | EOD;
141 | }
142 | function addFooter(){
143 | $this->page .= <<
147 |
148 |
149 |
150 |
151 |
152 | EOD;
153 | }
154 | function setPaging($sql_nolimit, $page_entry){
155 | $current_page = isset($_GET['current_page']) ? $_GET['current_page'] : 0;
156 | $self = $_SERVER['PHP_SELF'];
157 | $req_uri = $_SERVER['REQUEST_URI'];
158 | $res = $this->db->query($sql_nolimit);
159 | $size_res = $res->size();
160 | $total_page = ceil($size_res / $page_entry);
161 |
162 | $page_str = '';
163 | // jika berada pada halaman ketiga atau lebih
164 | if ($current_page > 1) {
165 | $page_str .= ' <<pertama ';
166 | }
167 | // jika berada pada halaman kedua atau lebih
168 | if ($current_page > 0) {
169 | $previous = $current_page - 1;
170 | $page_str .= ' <sebelumnya ';
171 | }
172 | // ambil semua no halamn dan jadikan link (kecuali berada pada halaman tsb )
173 | for ($i = 0; $i < $total_page ; $i++) {
174 | $current = $i + 1;
175 | if($i == $current_page){
176 | $page_str .= ''. $current.'';
177 | }
178 | else{
179 | $page_str .= ' '.$current .' ';
180 | }
181 | }
182 | if ($current_page < ($total_page - 1)) {
183 | $next = $current_page + 1;
184 | $page_str .= ' selanjutnya> ';
185 | }
186 | if ($current_page < ($total_page - 2)) {
187 | $last = $total_page - 1;
188 | $page_str .= ' terakhir>> ';
189 | }
190 | return $page_str;
191 | }
192 | function display(){
193 | echo $this->page;
194 | }
195 | }
196 |
197 | ?>
198 |
--------------------------------------------------------------------------------
/inc/Dashboard.php:
--------------------------------------------------------------------------------
1 | page = '';
10 | $this->id = $id;
11 | $this->title = $title;
12 | $this->db = &$db;
13 | $this->auth =&$auth;
14 | $this->privilege = $this->auth->getPrivilege();
15 | $this->login = $this->auth->session->get(POST_LOGIN_VAR);
16 | $this->usr_login = $this->login;
17 | $res = $this->db->query("SELECT usr_id FROM tbl_users WHERE usr_login='$this->login'");
18 | $row = $res->fetch();
19 | $this->usr_id = $row['usr_id'];
20 | $this->addHeader();
21 | $this->addMenu();
22 | $this->addSidebar();
23 | $this->addContent();
24 | $this->addFooter();
25 | $this->display();
26 | }
27 | function addmenu(){
28 | $self = $_SERVER['PHP_SELF'];
29 | $this->page .= <<