Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#MaterilaMe
#Moo Me
Personal Site(Resume+Blog)
##Description
You can use this CMS for personal site or resume.

Personal site
##This App Use
1. PHP Framework - **Codeigniter 2.2**
2. HTML+CSS Framework - **MeterialDesign** by Google
3. JavaScript Framework - **JQuery 1.11.0**
4. Database Management System - **MySQL 5.5.40**

###Add on:
1. **prism** - highlight content
2. **APlayer** - music player

###Requirement System
You can follow recommended system from Codeigniter 2.2.

![mme-icon](https://github.com/ismo1106/mate-me/blob/master/_assets/material/img/mme-icon.png?raw=true)
Binary file added _assets/uploaded/image/dist1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion application/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

$autoload['libraries'] = array('session','front','uri','database');
$autoload['libraries'] = array('session','front','back','uri','database');


/*
Expand Down
2 changes: 0 additions & 2 deletions application/controllers/back/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class Admin extends CI_Controller{

public function __construct() {
parent::__construct();

$this->load->library('back');
}

function index(){
Expand Down
74 changes: 74 additions & 0 deletions application/controllers/back/utility.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

/* *
* Author : Ismo Broto
* Description :
*/

class Utility extends CI_Controller{

public function __construct() {
parent::__construct();

$this->load->helper('mdi');
$this->load->model(array('Mdl_Utility'));
}

// #################### ==== Start Ulitity/Side Bar ==== #################### //
function MenuBack(){
$data = array(
'_mdiList' => mdi_list(),
'_getMenu' => $this->Mdl_Utility->selectSidebar()->result(),
'_getMenu1' => $this->Mdl_Utility->getSidebarByLevel(1)->result(),
'_getMenu2' => $this->Mdl_Utility->getSidebarByLevel(2)->result()
);
$this->back->display('_back/utility/sidebar/index',$data);
}
function insertMenuBack(){
if($this->input->post('txtLink') == NULL || $this->input->post('txtLink') == '' || $this->input->post('selHeader') == 0){
$link = '#';
}else{
$link = $this->input->post('txtLink');
}
$data = array(
'label_menu' => $this->input->post('txtLabel'),
'serial_number' => $this->input->post('txtSerialNum'),
'icon_menu' => $this->input->post('selIcon'),
'link_menu' => $link,
'level_menu' => $this->getLevel($this->input->post('selHeader')),
'header_menu' => $this->input->post('selHeader'),
'created_by' => 'ismo_',
'created_date' => date('Y-m-d H:i:s')
);
$this->Mdl_Utility->insertSidebar($data);
redirect('back/Utility/MenuBack');
}
// #################### ==== End Ulitity/Side Bar ==== #################### //
function getLevel($header){
if($header == 0){
return 1;
}else{
$this->db->where('id_menu', $header);
$get = $this->db->get('tbl_utl_sidebar');
$row = $get->row();

return (int)$row->level_menu + 1;
}
}

function viewerPDF(){
$this->back->display('_back/utility/test');
}

function test(){
$this->load->helper('mdi');

$asa = mdi_list();

foreach ($asa as $list):
echo $list.'<br/>';
endforeach;

echo 'Testttttttttttttt';
}
}
44 changes: 44 additions & 0 deletions application/controllers/emailControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
* Author by ITD15
*/

class EmailControl extends CI_Controller{
public function __construct() {
parent::__construct();

$this->load->library('email');
}

function index(){
echo 'sasasa';
}

function send(){
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "mx1.idhostinger.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "[email protected]";
$config['smtp_pass'] = "11eleven";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";


$ci->email->initialize($config);

$ci->email->from('[email protected]', 'Ismo');
$list = array('[email protected]');
$ci->email->to($list);
$ci->email->subject('judul email');
$ci->email->message('isi email');
if ($this->email->send()) {
echo 'Email sent.';
} else {
show_error($this->email->print_debugger());
}
}
}
20 changes: 20 additions & 0 deletions application/controllers/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ function test($position=1){
echo '<p>'.$row->name.' ('.$row->message.')</p>';
endforeach;
}

function grabCURL($url){
$data = curl_init();
// setting CURL
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
// menjalankan CURL untuk membaca isi file
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
function explodeX( $delimiters, $string ){
return explode( chr( 1 ), str_replace( $delimiters, chr( 1 ), $string ) );
}

function viewGrab(){
$hasil = $this->grabCURL('http://www.kaskus.co.id/');
$pecah = $this->explodeX(array('<section class="hot-thread">', '</section>'), $hasil);
print_r ($pecah[1]);
}

}

Expand Down
10 changes: 10 additions & 0 deletions application/helpers/mdi_helper.php

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions application/libraries/Back.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function __construct() {
}

function display($view, $data = NULL){
$this->_CI->load->model('Mdl_Utility');
$data['_getMenu1'] = $this->_CI->Mdl_Utility->getSidebarByLevel(1)->result();
$data['_getMenu2'] = $this->_CI->Mdl_Utility->getSidebarByLevel(2)->result();

$data['_style'] = $this->_CI->load->view('_theme/back/style',$data,true);
$data['_header'] = $this->_CI->load->view('_theme/back/header',$data,true);
$data['_left'] = $this->_CI->load->view('_theme/back/leftside',$data,true);
Expand Down
36 changes: 36 additions & 0 deletions application/models/mdl_utility.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/* *
* Author : Ismo Broto
* Description :
*/

class Mdl_Utility extends CI_Controller{
public function __construct() {
parent::__construct();
}
private $By = array(
'PrimarySidebar' => 'id_menu',
'LevelSidebar' => 'level_menu',
'SerialNumber' => 'serial_number'
);
private $Table = array(
'Sidebar' => 'tbl_utl_sidebar'
);

function insertSidebar($data){
$this->db->insert($this->Table['Sidebar'], $data);
}
function selectSidebar(){
$this->db->order_by($this->By['SerialNumber'], 'ASC');
$this->db->where($this->By['LevelSidebar'], 1);
$select = $this->db->get($this->Table['Sidebar']);
return $select;
}
function getSidebarByLevel($level){
$this->db->order_by($this->By['SerialNumber'], 'ASC');
$this->db->where($this->By['LevelSidebar'], $level);
$select = $this->db->get($this->Table['Sidebar']);
return $select;
}
}
116 changes: 116 additions & 0 deletions application/views/_back/utility/sidebar/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<div class="section">
<p class="caption">Includes predefined classes for easy layout options.</p>

<div class="divider"></div>
<!--Basic Form-->
<div id="basic-form" class="section">
<div class="row">
<div class="col s12 m12 l6">
<div class="card-panel">
<h4 class="header2">Setting Side Bar</h4>
<div class="row">
<form class="col s12" method="POST" action="<?php echo site_url('back/utility/insertMenuBack');?>">
<div class="row">
<div class="input-field col s8">
<input id="label" type="text" name="txtLabel" length="45"/>
<label for="label">Label</label>
</div>

<div class="input-field col s4">
<input id="serial" type="text" name="txtSerialNum" />
<label for="serial">Serial</label>
</div>
</div>
<div class="row">
<div class="input-field col s11">
<select id="icon" name="selIcon" onchange="iconChange(this.value)">
<option value="0" disabled selected>Choose icon</option>
<?php foreach ($_mdiList as $li): $mdiLi = ucwords(strtolower(str_replace('-', ' ', str_replace('mdi-', '', $li))));?>
<option value="<?php echo $li;?>"><?php echo $mdiLi;?></option>
<?php endforeach; ?>
</select>
<label for="icon">Icon</label>
</div>
<div class="input-field col s1">
<i id="reviewIcon" class="mdi-hardware-keyboard-alt"></i>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="link" type="text" name="txtLink"/>
<label for="link">Link/URL</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<select id="header_id" name="selHeader">
<option value="0" disabled selected>Choose header</option>
<option value="0">Top Level</option>
<?php foreach($_getMenu as $row): ?>
<option value="<?php echo $row->id_menu;?>"><?php echo $row->label_menu;?></option>
<?php endforeach;?>
</select>
<label for="header_id">Header</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<button class="btn cyan waves-effect waves-light right" type="submit" name="action">Submit
<i class="mdi-content-send right"></i>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Form with placeholder -->
<div class="col s12 m12 l6">
<div class="card-panel">
<h4 class="header2">Form with placeholder</h4>
<div class="row">
<div class="col s12">
<table class="hoverable striped" style="height: 10px; overflow-y: scroll;">
<thead>
<tr>
<th style="width: 15px;">Icon</th>
<th style="width: 50%;">Label</th>
<th class="center-align">Serial Number</th>
<th class="center-align">Level</th>
</tr>
</thead>
<tbody>
<?php foreach ($_getMenu1 as $row1): ?>
<tr>
<td><i class="<?php echo $row1->icon_menu;?>"></i></td>
<td><?php echo $row1->label_menu;?></td>
<td class="center-align"><?php echo $row1->serial_number;?></td>
<td class="center-align"><?php echo $row1->level_menu;?></td>
</tr>
<?php foreach ($_getMenu2 as $row2): ?>
<?php if($row2->header_menu == $row1->id_menu): ?>
<tr style="font-size: smaller;">
<td><i class="<?php echo $row2->icon_menu;?>"></i></td>
<td><?php echo $row2->label_menu;?></td>
<td class="center-align"><?php echo $row2->serial_number;?></td>
<td class="center-align"><?php echo $row2->level_menu;?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>

</div>
</div>
</div>

<script>
function iconChange(val){
document.getElementById('reviewIcon').className = val;
}
</script>
10 changes: 10 additions & 0 deletions application/views/_back/utility/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="section">
<p class="caption">Includes predefined classes for easy layout options.</p>

<div class="divider"></div>
<div class="row">
<div class="col s12 m12 l12">
<iframe src="http://localhost:88/PDF-Viewer/" style="width: 100%; min-height: 550px;" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
</div>
</div>
</div>
Loading