| @@ -1,147 +1,155 @@ | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @package GeniXCMS | ||
| * @since 0.0.1 build date 20140928 | ||
| * @version 0.0.8 | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * @author Puguh Wijayanto (www.metalgenix.com) | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| * | ||
| */ | ||
|
|
||
| define('GX_PATH', realpath(__DIR__ . '/')); | ||
| define('GX_LIB', GX_PATH.'/inc/lib/'); | ||
| define('GX_MOD', GX_PATH.'/inc/mod/'); | ||
| define('GX_THEME', GX_PATH.'/inc/themes/'); | ||
| define('GX_ASSET', GX_PATH.'/assets/'); | ||
|
|
||
| require("autoload.php"); | ||
|
|
||
|
|
||
| try { | ||
| new System(); | ||
| } catch (Exception $e) { | ||
| echo $e->getMessage(); | ||
| } | ||
|
|
||
|
|
||
| if(isset($_POST['forgotpass'])) | ||
| { | ||
|
|
||
| // Check token first | ||
| if(isset($_POST['token']) && Token::isExist($_POST['token'])){ | ||
| /*check if username is exist or not */ | ||
| $username = Typo::cleanX(Typo::strip($_POST['username'])); | ||
| $sql = sprintf("SELECT `userid`,`email`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username); | ||
| $usr = Db::result($sql); | ||
| $c = Db::$num_rows; | ||
| //echo $c; | ||
| //print_r($usr); | ||
| if($c == "1"){ | ||
| //$alertSuccess = ""; | ||
| // check if user is active | ||
| if($usr[0]->status == '1') { | ||
| /* get user password */ | ||
| $newpass = User::generatePass(); | ||
| $id = User::id($username); | ||
| $pass = User::randpass($newpass); | ||
| $vars = array( | ||
| 'id' => $id, | ||
| 'user' => array( | ||
| 'pass' => $pass | ||
| ) | ||
| ); | ||
| User::update($vars); | ||
| $date = Date::format(date("Y-m-d H:i:s")); | ||
| $msg = " | ||
| Hello {$usr[0]->userid}, | ||
| You are requesting Password Reset at ".Site::$name." on {$date}. | ||
| Below are your new Password : | ||
| {$newpass} | ||
| Now you can login with your new Password at ".Site::$url." | ||
| Best Regards, | ||
| ".Site::$name." | ||
| ".Site::$email." | ||
| "; | ||
| $vars = array( | ||
| 'to' => $usr[0]->email, | ||
| 'to_name' => $usr[0]->userid, | ||
| 'message' => $msg, | ||
| 'subject' => 'Password Reset at '.Site::$name, | ||
| 'msgtype' => 'text' | ||
| ); | ||
| //echo "<pre>".$msg."</pre>"; | ||
| if(Mail::send($vars)){ | ||
| $alertSuccess = PASSWORD_SENT_NOTIF; | ||
| } | ||
| }else{ | ||
| if($usr[0]->activation != ''){ | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE; | ||
| }else{ | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE_BLOCK; | ||
| } | ||
| } | ||
| }elseif($c == "0"){ | ||
| $alertDanger[] = NO_USER; | ||
| } | ||
|
|
||
| Token::remove($_POST['token']); | ||
| }else{ | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| } | ||
| Theme::theme('header'); | ||
| if(isset($alertDanger)) { | ||
| echo " | ||
| <div class=\"alert alert-danger\"> | ||
| "; | ||
| foreach($alertDanger as $alert) | ||
| { | ||
| echo $alert; | ||
| } | ||
| echo" | ||
| </div>"; | ||
| } | ||
| if(isset($alertSuccess)) { | ||
| echo " | ||
| <div class=\"alert alert-success\"> | ||
| {$alertSuccess} | ||
| </div>"; | ||
| } | ||
| if(!User::is_loggedin()){ | ||
|
|
||
| ?> | ||
| <div class="container"> | ||
| <div style="max-width: 300px; margin-left: auto; margin-right: auto; margin-top: 30px; margin-bottom: 60px "> | ||
| <form action="" class="form-signin" role="form" method="post"> | ||
| <h2 class="form-signin-heading"><?=FORGOT_PASS;?></h2> | ||
| <div class="form-group"> | ||
| <label><?=FILLIN_USERNAME;?></label> | ||
| <input type="text" name="username" class="form-control" placeholder="<?=USERNAME;?>" required autofocus> | ||
| </div> | ||
| <input type="hidden" name="token" value="<?=TOKEN;?>"> | ||
| <button class="btn btn-lg btn-success btn-block" name="forgotpass" type="submit"><?=REQUEST_PASS;?></button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| <?php | ||
| }else { | ||
| echo"<div class=\"alert alert-info\">You're already Logged In. <br /><a href=\"logout.php\">Logout</a></div>"; | ||
| } | ||
|
|
||
| Theme::theme('footer'); | ||
| System::Zipped(); | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System. | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @since 0.0.1 build date 20140928 | ||
| * | ||
| * @version 1.0.0 | ||
| * | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * | ||
| * @author Puguh Wijayanto <psw@metalgenix.com> | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| */ | ||
| define('GX_PATH', realpath(__DIR__.'/')); | ||
| define('GX_LIB', GX_PATH.'/inc/lib/'); | ||
| define('GX_MOD', GX_PATH.'/inc/mod/'); | ||
| define('GX_THEME', GX_PATH.'/inc/themes/'); | ||
| define('GX_ASSET', GX_PATH.'/assets/'); | ||
|
|
||
| require 'autoload.php'; | ||
|
|
||
| try { | ||
| new System(); | ||
| } catch (Exception $e) { | ||
| echo $e->getMessage(); | ||
| } | ||
|
|
||
| if (isset($_POST['forgotpass'])) { | ||
| if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) { | ||
| // VALIDATE ALL | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| if (Xaptcha::isEnable()) { | ||
| if (!isset($_POST['g-recaptcha-response']) || $_POST['g-recaptcha-response'] == '') { | ||
| $alertDanger[] = 'Please insert the Captcha'; | ||
| } | ||
| if (!Xaptcha::verify($_POST['g-recaptcha-response'])) { | ||
| $alertDanger[] = 'Your Captcha is not correct.'; | ||
| } | ||
| } | ||
|
|
||
| // Check token first | ||
| if (!isset($alertDanger)) { | ||
| /*check if username is exist or not */ | ||
| $username = Typo::cleanX(Typo::strip($_POST['username'])); | ||
| $sql = sprintf("SELECT `userid`,`email`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username); | ||
| $usr = Db::result($sql); | ||
| $c = Db::$num_rows; | ||
| //echo $c; | ||
| //print_r($usr); | ||
| if ($c == '1') { | ||
| //$alertSuccess = ""; | ||
| // check if user is active | ||
| if ($usr[0]->status == '1') { | ||
| /* get user password */ | ||
| $newpass = User::generatePass(); | ||
| $id = User::id($username); | ||
| $pass = User::randpass($newpass); | ||
| $vars = array( | ||
| 'id' => $id, | ||
| 'user' => array( | ||
| 'pass' => $pass, | ||
| ), | ||
| ); | ||
| User::update($vars); | ||
| $date = Date::format(date('Y-m-d H:i:s')); | ||
| $msg = " | ||
| Hello {$usr[0]->userid}, | ||
| You are requesting Password Reset at ".Site::$name." on {$date}. | ||
| Below are your new Password : | ||
| {$newpass} | ||
| Now you can login with your new Password at ".Site::$url.' | ||
| Best Regards, | ||
| '.Site::$name.' | ||
| '.Site::$email.' | ||
| '; | ||
| $vars = array( | ||
| 'to' => $usr[0]->email, | ||
| 'to_name' => $usr[0]->userid, | ||
| 'message' => $msg, | ||
| 'subject' => 'Password Reset at '.Site::$name, | ||
| 'msgtype' => 'text', | ||
| ); | ||
| //echo "<pre>".$msg."</pre>"; | ||
| if (Mail::send($vars)) { | ||
| $alertSuccess = PASSWORD_SENT_NOTIF; | ||
| } | ||
| } else { | ||
| if ($usr[0]->activation != '') { | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE; | ||
| } else { | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE_BLOCK; | ||
| } | ||
| } | ||
| } elseif ($c == '0') { | ||
| $alertDanger[] = NO_USER; | ||
| } | ||
|
|
||
| Token::remove($_POST['token']); | ||
| } else { | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| } | ||
| Theme::theme('header'); | ||
| if (isset($alertDanger)) { | ||
| echo ' | ||
| <div class="alert alert-danger"> | ||
| '; | ||
| foreach ($alertDanger as $alert) { | ||
| echo $alert; | ||
| } | ||
| echo' | ||
| </div>'; | ||
| } | ||
| if (isset($alertSuccess)) { | ||
| echo " | ||
| <div class=\"alert alert-success\"> | ||
| {$alertSuccess} | ||
| </div>"; | ||
| } | ||
| if (!User::is_loggedin()) { | ||
| ?> | ||
| <div class="container"> | ||
| <div style="max-width: 300px; margin-left: auto; margin-right: auto; margin-top: 30px; margin-bottom: 60px "> | ||
| <form action="" class="form-signin" role="form" method="post"> | ||
| <h2 class="form-signin-heading"><?=FORGOT_PASS; ?></h2> | ||
| <div class="form-group"> | ||
| <label><?=FILLIN_USERNAME; ?></label> | ||
| <input type="text" name="username" class="form-control" placeholder="<?=USERNAME; ?>" required autofocus> | ||
| </div> | ||
| <?=Xaptcha::html(); ?> | ||
| <input type="hidden" name="token" value="<?=TOKEN; ?>"> | ||
| <button class="btn btn-lg btn-success btn-block" name="forgotpass" type="submit"><?=REQUEST_PASS; ?></button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| <?php | ||
| } else { | ||
| echo"<div class=\"alert alert-info\">You're already Logged In. <br /><a href=\"logout.php\">Logout</a></div>"; | ||
| } | ||
|
|
||
| Theme::theme('footer'); | ||
| System::Zipped(); | ||
| ?> |
| @@ -1,153 +1,160 @@ | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @package GeniXCMS | ||
| * @since 0.0.1 build date 20140928 | ||
| * @version 0.0.8 | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * @author Puguh Wijayanto (www.metalgenix.com) | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| * | ||
| */ | ||
|
|
||
| define('GX_PATH', realpath(__DIR__ . '/../')); | ||
| define('GX_LIB', GX_PATH.'/inc/lib/'); | ||
| define('GX_MOD', GX_PATH.'/inc/mod/'); | ||
| define('GX_THEME', GX_PATH.'/inc/themes/'); | ||
| define('GX_ASSET', GX_PATH.'/assets/'); | ||
|
|
||
| require("../autoload.php"); | ||
|
|
||
|
|
||
| try { | ||
| new System(); | ||
|
|
||
| } catch (Exception $e) { | ||
| echo $e->getMessage(); | ||
| } | ||
|
|
||
|
|
||
| if(isset($_POST['forgotpass'])) | ||
| { | ||
|
|
||
| // Check token first | ||
| if(isset($_POST['token']) && Token::isExist($_POST['token'])){ | ||
| /*check if username is exist or not */ | ||
| $username = Typo::cleanX(Typo::strip($_POST['username'])); | ||
| $sql = sprintf("SELECT `userid`,`email`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username); | ||
| $usr = Db::result($sql); | ||
| $c = Db::$num_rows; | ||
| //echo $c; | ||
| //print_r($usr); | ||
| if($c == "1"){ | ||
| //$alertSuccess = ""; | ||
| // check if user is active | ||
| if($usr[0]->status == '1') { | ||
| /* get user password */ | ||
| $newpass = User::generatePass(); | ||
| $id = User::id($username); | ||
| $pass = User::randpass($newpass); | ||
| $vars = array( | ||
| 'id' => $id, | ||
| 'user' => array( | ||
| 'pass' => $pass | ||
| ) | ||
| ); | ||
| User::update($vars); | ||
| $date = Date::format(date("Y-m-d H:i:s")); | ||
| $msg = " | ||
| Hello {$usr[0]->userid}, | ||
| You are requesting Password Reset at ".Site::$name." on {$date}. | ||
| Below are your new Password : | ||
| {$newpass} | ||
| Now you can login with your new Password at ".Site::$url." | ||
| Best Regards, | ||
| ".Site::$name." | ||
| ".Site::$email." | ||
| "; | ||
| $vars = array( | ||
| 'to' => $usr[0]->email, | ||
| 'to_name' => $usr[0]->userid, | ||
| 'message' => $msg, | ||
| 'subject' => 'Password Reset at '.Site::$name, | ||
| 'msgtype' => 'text' | ||
| ); | ||
| //echo "<pre>".$msg."</pre>"; | ||
| if(Mail::send($vars)){ | ||
| $alertSuccess = PASSWORD_SENT_NOTIF; | ||
| } | ||
| }else{ | ||
| if($usr[0]->activation != ''){ | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE; | ||
| }else{ | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE_BLOCK; | ||
| } | ||
| } | ||
| }elseif($c == "0"){ | ||
| $alertDanger[] = NO_USER; | ||
| } | ||
|
|
||
| Token::remove($_POST['token']); | ||
| }else{ | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| } | ||
| Theme::admin('header'); | ||
| if(isset($alertDanger)) { | ||
| echo " | ||
| <div class=\"alert alert-danger\"> | ||
| "; | ||
| foreach($alertDanger as $alert) | ||
| { | ||
| echo $alert; | ||
| } | ||
| echo" | ||
| </div>"; | ||
| } | ||
| if(isset($alertSuccess)) { | ||
| echo " | ||
| <div class=\"alert alert-success\"> | ||
| {$alertSuccess} | ||
| </div>"; | ||
| } | ||
| if(!User::is_loggedin()){ | ||
|
|
||
| ?> | ||
| <div class="row"> | ||
| <div style="max-width: 300px; margin-left: auto; margin-right: auto; margin-top: 30px; margin-bottom: 60px "> | ||
| <form action="" class="form-signin" role="form" method="post"> | ||
| <h2 class="form-signin-heading"><?=FORGOT_PASS;?></h2> | ||
| <div class="form-group"> | ||
| <label><?=FILLIN_USERNAME;?></label> | ||
| <input type="text" name="username" class="form-control" placeholder="<?=USERNAME;?>" required autofocus> | ||
| </div> | ||
| <input type="hidden" name="token" value="<?=TOKEN;?>"> | ||
| <button class="btn btn-lg btn-success btn-block" name="forgotpass" type="submit"><?=REQUEST_PASS;?></button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| <style> | ||
| #page-wrapper { | ||
| margin-left: 0px!important; | ||
| } | ||
| </style> | ||
| <?php | ||
| }else { | ||
| echo"<div class=\"alert alert-info\">You're already Logged In. <br /><a href=\"logout.php\">Logout</a></div>"; | ||
| } | ||
|
|
||
| Theme::admin('footer'); | ||
| System::Zipped(); | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System. | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @since 0.0.1 build date 20140928 | ||
| * | ||
| * @version 1.0.0 | ||
| * | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * | ||
| * @author Puguh Wijayanto <psw@metalgenix.com> | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| */ | ||
| define('GX_PATH', realpath(__DIR__.'/../')); | ||
| define('GX_LIB', GX_PATH.'/inc/lib/'); | ||
| define('GX_MOD', GX_PATH.'/inc/mod/'); | ||
| define('GX_THEME', GX_PATH.'/inc/themes/'); | ||
| define('GX_ASSET', GX_PATH.'/assets/'); | ||
|
|
||
| require '../autoload.php'; | ||
|
|
||
| try { | ||
| new System(); | ||
| } catch (Exception $e) { | ||
| echo $e->getMessage(); | ||
| } | ||
|
|
||
| if (isset($_POST['forgotpass'])) { | ||
| if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) { | ||
| // VALIDATE ALL | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| if (Xaptcha::isEnable()) { | ||
| if (!isset($_POST['g-recaptcha-response']) || $_POST['g-recaptcha-response'] == '') { | ||
| $alertDanger[] = 'Please insert the Captcha'; | ||
| } | ||
| if (!Xaptcha::verify($_POST['g-recaptcha-response'])) { | ||
| $alertDanger[] = 'Your Captcha is not correct.'; | ||
| } | ||
| } | ||
|
|
||
| // Check token first | ||
| if (!isset($alertDanger)) { | ||
| /*check if username is exist or not */ | ||
| $username = Typo::cleanX(Typo::strip($_POST['username'])); | ||
| $sql = sprintf("SELECT `userid`,`email`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username); | ||
| $usr = Db::result($sql); | ||
| $c = Db::$num_rows; | ||
| //echo $c; | ||
| //print_r($usr); | ||
| if ($c == '1') { | ||
| //$alertSuccess = ""; | ||
| // check if user is active | ||
| if ($usr[0]->status == '1') { | ||
| /* get user password */ | ||
| $newpass = User::generatePass(); | ||
| $id = User::id($username); | ||
| $pass = User::randpass($newpass); | ||
| $vars = array( | ||
| 'id' => $id, | ||
| 'user' => array( | ||
| 'pass' => $pass, | ||
| ), | ||
| ); | ||
| User::update($vars); | ||
| $date = Date::format(date('Y-m-d H:i:s')); | ||
| $msg = " | ||
| Hello {$usr[0]->userid}, | ||
| You are requesting Password Reset at ".Site::$name." on {$date}. | ||
| Below are your new Password : | ||
| {$newpass} | ||
| Now you can login with your new Password at ".Site::$url.' | ||
| Best Regards, | ||
| '.Site::$name.' | ||
| '.Site::$email.' | ||
| '; | ||
| $vars = array( | ||
| 'to' => $usr[0]->email, | ||
| 'to_name' => $usr[0]->userid, | ||
| 'message' => $msg, | ||
| 'subject' => 'Password Reset at '.Site::$name, | ||
| 'msgtype' => 'text', | ||
| ); | ||
| //echo "<pre>".$msg."</pre>"; | ||
| if (Mail::send($vars)) { | ||
| $alertSuccess = PASSWORD_SENT_NOTIF; | ||
| } | ||
| } else { | ||
| if ($usr[0]->activation != '') { | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE; | ||
| } else { | ||
| $alertDanger[] = ACOUNT_NOT_ACTIVE_BLOCK; | ||
| } | ||
| } | ||
| } elseif ($c == '0') { | ||
| $alertDanger[] = NO_USER; | ||
| } | ||
|
|
||
| Token::remove($_POST['token']); | ||
| } else { | ||
| $alertDanger[] = TOKEN_NOT_EXIST; | ||
| } | ||
| } | ||
| Theme::admin('header'); | ||
| if (isset($alertDanger)) { | ||
| echo ' | ||
| <div class="alert alert-danger"> | ||
| '; | ||
| foreach ($alertDanger as $alert) { | ||
| echo $alert; | ||
| } | ||
| echo' | ||
| </div>'; | ||
| } | ||
| if (isset($alertSuccess)) { | ||
| echo " | ||
| <div class=\"alert alert-success\"> | ||
| {$alertSuccess} | ||
| </div>"; | ||
| } | ||
| if (!User::is_loggedin()) { | ||
| ?> | ||
| <div class="row"> | ||
| <div style="max-width: 300px; margin-left: auto; margin-right: auto; margin-top: 30px; margin-bottom: 60px "> | ||
| <form action="" class="form-signin" role="form" method="post"> | ||
| <h2 class="form-signin-heading"><?=FORGOT_PASS; ?></h2> | ||
| <div class="form-group"> | ||
| <label><?=FILLIN_USERNAME; ?></label> | ||
| <input type="text" name="username" class="form-control" placeholder="<?=USERNAME; ?>" required autofocus> | ||
| </div> | ||
| <?=Xaptcha::html(); ?> | ||
| <input type="hidden" name="token" value="<?=TOKEN; ?>"> | ||
| <button class="btn btn-lg btn-success btn-block" name="forgotpass" type="submit"><?=REQUEST_PASS; ?></button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| <style> | ||
| #page-wrapper { | ||
| margin-left: 0px!important; | ||
| } | ||
| </style> | ||
| <?php | ||
| } else { | ||
| echo"<div class=\"alert alert-info\">You're already Logged In. <br /><a href=\"logout.php\">Logout</a></div>"; | ||
| } | ||
|
|
||
| Theme::admin('footer'); | ||
| System::Zipped(); | ||
| ?> |
| @@ -1,135 +1,137 @@ | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @package GeniXCMS | ||
| * @since 0.0.1 build date 20150202 | ||
| * @version 0.0.8 | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * @author Puguh Wijayanto (www.metalgenix.com) | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| * | ||
| */ | ||
|
|
||
| ?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h1><i class="fa fa-cubes"></i> <?=CATEGORIES;?> | ||
| <button class="btn btn-success pull-right" data-toggle="modal" data-target="#myModal"> | ||
| <span class="glyphicon glyphicon-plus"></span> <?=ADD_CATEGORY;?> | ||
| </button> | ||
| </h1> | ||
| <hr /> | ||
| </div> | ||
|
|
||
| <div class="col-sm-12"> | ||
| <div class="row"> | ||
| <?php | ||
| if($data['num'] > 0) { | ||
| foreach ($data['cat'] as $c) { | ||
| # code... | ||
| // echo "<td>".$c->id."</td>"; | ||
| // echo "<td>".$c->name."</td>"; | ||
| // echo "<td>".$c->parent."</td>"; | ||
| // echo "<td></td>"; | ||
|
|
||
| if($c->parent == "" || $c->parent == 0){ | ||
| echo "<div class=\"col-md-4 item\" > | ||
| <div class=\"panel panel-default\"> | ||
| <div class=\"panel-heading\"> | ||
| <form action=\"index.php?page=categories\" method=\"POST\" name=\"updatecat\"> | ||
| <div class=\"input-group\"> | ||
| <a href=\"?page=categories&act=del&id={$c->id}&token=".TOKEN."\" class=\"input-group-addon\" | ||
| onclick=\"return confirm('Are you sure you want to delete this item?');\" | ||
| ><span class=\"glyphicon glyphicon-remove\"></span></a> | ||
| <input type=\"text\" name=\"cat\" class=\"form-control\" value=\"{$c->name}\"> | ||
| <input type=\"hidden\" name=\"id\" value=\"{$c->id}\"> | ||
| <input type=\"hidden\" name=\"token\" value=\"".TOKEN."\"> | ||
| <span class=\"input-group-btn\"> | ||
| <button class=\"btn btn-default\" type=\"submit\" name=\"updatecat\">Go!</button> | ||
| </span> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| <div class=\"panel-body\"> | ||
| <ul class=\"list-group\">"; | ||
| foreach ($data['cat'] as $c2) { | ||
| if($c2->parent == $c->id){ | ||
| echo "<li class=\"list-group-item\"> | ||
| <form action=\"index.php?page=categories\" method=\"POST\" name=\"updatecat\"> | ||
| <div class=\"input-group\"> | ||
| <a href=\"?page=categories&act=del&id={$c2->id}&token=".TOKEN."\" class=\"input-group-addon\" | ||
| onclick=\"return confirm('Are you sure you want to delete this item?');\" | ||
| ><span class=\"glyphicon glyphicon-remove\"></span></a> | ||
| <input type=\"text\" name=\"cat\" class=\"form-control\" value=\"{$c2->name}\"> | ||
| <input type=\"hidden\" name=\"id\" value=\"{$c2->id}\"> | ||
| <input type=\"hidden\" name=\"token\" value=\"".TOKEN."\"> | ||
| <span class=\"input-group-btn\"> | ||
| <button class=\"btn btn-default\" type=\"submit\" name=\"updatecat\">Go!</button> | ||
| </span> | ||
| </div> | ||
| </form> | ||
| </li>"; | ||
| } | ||
| } | ||
| echo "</ul></div>"; | ||
| echo "</div></div>"; | ||
| } | ||
| } | ||
| }else{ | ||
| echo "<div class=\"col-md-12\">No Categories Found</div>"; | ||
| } | ||
| ?> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| </div> | ||
| </div> | ||
| <!-- Modal --> | ||
| <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <form action="index.php?page=categories" method="post"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| <h4 class="modal-title" id="myModalLabel"><?=ADD_CATEGORY;?></h4> | ||
| </div> | ||
| <div class="modal-body"> | ||
|
|
||
| <div class="form-group"> | ||
| <label><?=PARENTS;?></label> | ||
| <?php | ||
| $vars = array( | ||
| 'parent' => '0', | ||
| 'name' => 'parent', | ||
| 'sort' => 'ASC', | ||
| 'order_by' => 'name', | ||
| 'type' => 'post' | ||
| ); | ||
| echo Categories::dropdown($vars); | ||
| ?> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label><?=CATEGORY_NAME;?></label> | ||
| <input type="text" name="cat" class="form-control"> | ||
| </div> | ||
|
|
||
| </div> | ||
| <div class="modal-footer"> | ||
| <input type="hidden" name="token" value="<?=TOKEN;?>"> | ||
| <button type="button" class="btn btn-default" data-dismiss="modal"><?=CLOSE;?></button> | ||
| <button type="submit" class="btn btn-success" name="addcat"><?=SUBMIT;?></button> | ||
| </div> | ||
| </form> | ||
| </div><!-- /.modal-content --> | ||
| </div><!-- /.modal-dialog --> | ||
| </div><!-- /.modal --> | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System. | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @since 0.0.1 build date 20150202 | ||
| * | ||
| * @version 1.0.0 | ||
| * | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * | ||
| * @author Puguh Wijayanto <psw@metalgenix.com> | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| */ | ||
| ?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h2><i class="fa fa-cubes"></i> <?=CATEGORIES;?> | ||
| <button class="btn btn-success pull-right" data-toggle="modal" data-target="#myModal"> | ||
| <span class="glyphicon glyphicon-plus"></span> | ||
| <span class="hidden-xs hidden-sm"><?=ADD_CATEGORY;?></span> | ||
| </button> | ||
| </h2> | ||
| <hr /> | ||
| </div> | ||
|
|
||
| <div class="col-sm-12"> | ||
| <div class="row"> | ||
| <?php | ||
| if ($data['num'] > 0) { | ||
| foreach ($data['cat'] as $c) { | ||
| # code... | ||
| // echo "<td>".$c->id."</td>"; | ||
| // echo "<td>".$c->name."</td>"; | ||
| // echo "<td>".$c->parent."</td>"; | ||
| // echo "<td></td>"; | ||
|
|
||
| if ($c->parent == '' || $c->parent == 0) { | ||
| echo "<div class=\"col-md-4 item\" > | ||
| <div class=\"panel panel-default\"> | ||
| <div class=\"panel-heading\"> | ||
| <form action=\"index.php?page=categories\" method=\"POST\" name=\"updatecat\"> | ||
| <div class=\"input-group\"> | ||
| <a href=\"?page=categories&act=del&id={$c->id}&token=".TOKEN."\" class=\"input-group-addon\" | ||
| onclick=\"return confirm('Are you sure you want to delete this item?');\" | ||
| ><span class=\"glyphicon glyphicon-remove\"></span></a> | ||
| <input type=\"text\" name=\"cat\" class=\"form-control\" value=\"{$c->name}\"> | ||
| <input type=\"hidden\" name=\"id\" value=\"{$c->id}\"> | ||
| <input type=\"hidden\" name=\"token\" value=\"".TOKEN.'"> | ||
| <span class="input-group-btn"> | ||
| <button class="btn btn-default" type="submit" name="updatecat">Go!</button> | ||
| </span> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <ul class="list-group">'; | ||
| foreach ($data['cat'] as $c2) { | ||
| if ($c2->parent == $c->id) { | ||
| echo "<li class=\"list-group-item\"> | ||
| <form action=\"index.php?page=categories\" method=\"POST\" name=\"updatecat\"> | ||
| <div class=\"input-group\"> | ||
| <a href=\"?page=categories&act=del&id={$c2->id}&token=".TOKEN."\" class=\"input-group-addon\" | ||
| onclick=\"return confirm('Are you sure you want to delete this item?');\" | ||
| ><span class=\"glyphicon glyphicon-remove\"></span></a> | ||
| <input type=\"text\" name=\"cat\" class=\"form-control\" value=\"{$c2->name}\"> | ||
| <input type=\"hidden\" name=\"id\" value=\"{$c2->id}\"> | ||
| <input type=\"hidden\" name=\"token\" value=\"".TOKEN.'"> | ||
| <span class="input-group-btn"> | ||
| <button class="btn btn-default" type="submit" name="updatecat">Go!</button> | ||
| </span> | ||
| </div> | ||
| </form> | ||
| </li>'; | ||
| } | ||
| } | ||
| echo '</ul></div>'; | ||
| echo '</div></div>'; | ||
| } | ||
| } | ||
| } else { | ||
| echo '<div class="col-md-12">No Categories Found</div>'; | ||
| } | ||
| ?> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| </div> | ||
| </div> | ||
| <!-- Modal --> | ||
| <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <form action="index.php?page=categories" method="post"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| <h4 class="modal-title" id="myModalLabel"><?=ADD_CATEGORY;?></h4> | ||
| </div> | ||
| <div class="modal-body"> | ||
|
|
||
| <div class="form-group"> | ||
| <label><?=PARENTS;?></label> | ||
| <?php | ||
| $vars = array( | ||
| 'parent' => '0', | ||
| 'name' => 'parent', | ||
| 'sort' => 'ASC', | ||
| 'order_by' => 'name', | ||
| 'type' => 'post', | ||
| ); | ||
| echo Categories::dropdown($vars); | ||
| ?> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label><?=CATEGORY_NAME;?></label> | ||
| <input type="text" name="cat" class="form-control"> | ||
| </div> | ||
|
|
||
| </div> | ||
| <div class="modal-footer"> | ||
| <input type="hidden" name="token" value="<?=TOKEN;?>"> | ||
| <button type="button" class="btn btn-default" data-dismiss="modal"><?=CLOSE;?></button> | ||
| <button type="submit" class="btn btn-success" name="addcat"><?=SUBMIT;?></button> | ||
| </div> | ||
| </form> | ||
| </div><!-- /.modal-content --> | ||
| </div><!-- /.modal-dialog --> | ||
| </div><!-- /.modal --> | ||
|
|
| @@ -1,83 +1,85 @@ | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @package GeniXCMS | ||
| * @since 0.0.1 build date 20150202 | ||
| * @version 0.0.8 | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * @author Puguh Wijayanto (www.metalgenix.com) | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| * | ||
| */?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| <?=Hooks::run('admin_page_top_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h1><i class="fa fa-dashboard"></i> <?=DASHBOARD;?></h1> | ||
| <hr> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <div class="row"> | ||
| <?=Hooks::run('admin_page_dashboard_action', $data);?> | ||
| <div class="col-md-6"> | ||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h3 class="panel-title"><i class="fa fa-file-text-o"></i> <?=LATEST_POST;?></h3> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <ul class="list-group"> | ||
| <?php | ||
| $post = Posts::recent(5, 'post'); | ||
|
|
||
| //print_r($post); | ||
| if(isset($post['error'])){ | ||
| echo "<li class=\"list-group-item\">{$post['error']}</li>"; | ||
| }else{ | ||
| foreach ($post as $p) { | ||
| # code... | ||
| echo " | ||
| <li class=\"list-group-item\"> | ||
| <a href=\"".Url::post($p->id)."\" target=\"_blank\"> | ||
| $p->title | ||
| </a> | ||
| <small class=\"badge\">$p->author</small> | ||
| </li>"; | ||
| } | ||
| } | ||
|
|
||
| ?> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="col-md-6"> | ||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h3 class="panel-title"><i class="fa fa-bar-chart"></i> <?=STATISTIC;?></h3> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <ul class="list-group"> | ||
| <?php | ||
| echo "<li class=\"list-group-item\">".TOTAL_POST.": ".Stats::totalPost('post')."</li>" | ||
| ."<li class=\"list-group-item\">".TOTAL_PAGE.": ".Stats::totalPost('page')."</li>" | ||
| ."<li class=\"list-group-item\">".TOTAL_CAT.": ".Stats::totalCat('post')."</li>" | ||
| ."<li class=\"list-group-item\">".TOTAL_USER.": ".Stats::totalUser()."</li>"; | ||
| echo Hooks::run('admin_page_dashboard_statslist_action', $data); | ||
| ?> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| </div> | ||
|
|
||
| </div> | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System. | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @since 0.0.1 build date 20150202 | ||
| * | ||
| * @version 1.0.0 | ||
| * | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * | ||
| * @author Puguh Wijayanto <psw@metalgenix.com> | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| */ | ||
| ?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| <?=Hooks::run('admin_page_top_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h2><i class="fa fa-dashboard"></i> <?=DASHBOARD;?></h2> | ||
| <hr> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <div class="row"> | ||
| <?=Hooks::run('admin_page_dashboard_action', $data);?> | ||
| <div class="col-md-6"> | ||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h3 class="panel-title"><i class="fa fa-file-text-o"></i> <?=LATEST_POST;?></h3> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <ul class="list-group"> | ||
| <?php | ||
| $vars = array('num' => 5, 'type' => 'post'); | ||
| $post = Posts::recent($vars); | ||
|
|
||
| if (isset($post['error'])) { | ||
| echo "<li class=\"list-group-item\">{$post['error']}</li>"; | ||
| } else { | ||
| foreach ($post as $p) { | ||
| # code... | ||
| echo ' | ||
| <li class="list-group-item"> | ||
| <a href="'.Url::post($p->id)."\" target=\"_blank\"> | ||
| $p->title | ||
| </a> | ||
| <small class=\"badge\">$p->author</small> | ||
| </li>"; | ||
| } | ||
| } | ||
|
|
||
| ?> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="col-md-6"> | ||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h3 class="panel-title"><i class="fa fa-bar-chart"></i> <?=STATISTIC;?></h3> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <ul class="list-group"> | ||
| <?php | ||
| echo '<li class="list-group-item">'.TOTAL_POST.': '.Stats::totalPost('post').'</li>' | ||
| .'<li class="list-group-item">'.TOTAL_PAGE.': '.Stats::totalPost('page').'</li>' | ||
| .'<li class="list-group-item">'.TOTAL_CAT.': '.Stats::totalCat('post').'</li>' | ||
| .'<li class="list-group-item">'.TOTAL_USER.': '.Stats::totalUser().'</li>'; | ||
| echo Hooks::run('admin_page_dashboard_statslist_action', $data); | ||
| ?> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| </div> | ||
|
|
||
| </div> |
| @@ -1,64 +1,64 @@ | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @package GeniXCMS | ||
| * @since 0.0.1 build date 20150202 | ||
| * @version 0.0.8 | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * @author Puguh Wijayanto (www.metalgenix.com) | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| * | ||
| */ | ||
|
|
||
| if (isset($data['alertSuccess'])) { | ||
| # code... | ||
| echo "<div class=\"alert alert-success\" > | ||
| <button type=\"button\" class=\"close\" data-dismiss=\"alert\"> | ||
| <span aria-hidden=\"true\">×</span> | ||
| <span class=\"sr-only\">".CLOSE."</span> | ||
| </button>"; | ||
| foreach ($data['alertSuccess'] as $alert) { | ||
| # code... | ||
| echo "$alert\n"; | ||
| } | ||
| echo "</div>"; | ||
| } | ||
| if (isset($data['alertDanger'])) { | ||
| # code... | ||
| echo "<div class=\"alert alert-danger\" > | ||
| <button type=\"button\" class=\"close\" data-dismiss=\"alert\"> | ||
| <span aria-hidden=\"true\">×</span> | ||
| <span class=\"sr-only\">".CLOSE."</span> | ||
| </button>"; | ||
| foreach ($data['alertDanger'] as $alert) { | ||
| # code... | ||
| echo "$alert\n"; | ||
| } | ||
| echo "</div>"; | ||
| } | ||
| ?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h1><i class="fa fa-list-alt"></i> Media | ||
|
|
||
| </h1> | ||
| <hr /> | ||
| </div> | ||
|
|
||
| <div class="col-sm-12"> | ||
| <div class="row"> | ||
| <div id="elfinder"></div> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| </div> | ||
| </div> | ||
| <?php | ||
| /** | ||
| * GeniXCMS - Content Management System. | ||
| * | ||
| * PHP Based Content Management System and Framework | ||
| * | ||
| * @since 0.0.1 build date 20150202 | ||
| * | ||
| * @version 1.0.0 | ||
| * | ||
| * @link https://github.com/semplon/GeniXCMS | ||
| * @link http://genixcms.org | ||
| * | ||
| * @author Puguh Wijayanto <psw@metalgenix.com> | ||
| * @copyright 2014-2016 Puguh Wijayanto | ||
| * @license http://www.opensource.org/licenses/mit-license.php MIT | ||
| */ | ||
| if (isset($data['alertSuccess'])) { | ||
| # code... | ||
| echo '<div class="alert alert-success" > | ||
| <button type="button" class="close" data-dismiss="alert"> | ||
| <span aria-hidden="true">×</span> | ||
| <span class="sr-only">'.CLOSE.'</span> | ||
| </button>'; | ||
| foreach ($data['alertSuccess'] as $alert) { | ||
| # code... | ||
| echo "$alert\n"; | ||
| } | ||
| echo '</div>'; | ||
| } | ||
| if (isset($data['alertDanger'])) { | ||
| # code... | ||
| echo '<div class="alert alert-danger" > | ||
| <button type="button" class="close" data-dismiss="alert"> | ||
| <span aria-hidden="true">×</span> | ||
| <span class="sr-only">'.CLOSE.'</span> | ||
| </button>'; | ||
| foreach ($data['alertDanger'] as $alert) { | ||
| # code... | ||
| echo "$alert\n"; | ||
| } | ||
| echo '</div>'; | ||
| } | ||
| ?> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <?=Hooks::run('admin_page_notif_action', $data);?> | ||
| </div> | ||
| <div class="col-md-12"> | ||
| <h1><i class="fa fa-list-alt"></i> Media | ||
|
|
||
| </h1> | ||
| <hr /> | ||
| </div> | ||
|
|
||
| <div class="col-sm-12"> | ||
| <div class="row"> | ||
| <div id="elfinder"></div> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| </div> | ||
| </div> |