finished saimod_project
This commit is contained in:
parent
0b5cf67803
commit
7674904eb3
@ -126,15 +126,63 @@ function init_saimod_project() {
|
||||
|
||||
}
|
||||
|
||||
function init_saimod_project_new(){
|
||||
// Image Preview
|
||||
$('#input-project-image').change(function(){
|
||||
$('#output-project-image').attr('src','./files/projects/'+$(this).val())
|
||||
});
|
||||
|
||||
// Update Button
|
||||
$('#btn-project-save').click(function(e){
|
||||
e.preventDefault();
|
||||
img = $('#input-project-image').val();
|
||||
name = $('#input-project-name').val();
|
||||
info = $('#input-project-info').val();
|
||||
website = $('#input-project-website').val();
|
||||
visibility = $('#input-project-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'project_save',
|
||||
data: {
|
||||
img: img,
|
||||
name: name,
|
||||
info: info,
|
||||
website: website,
|
||||
visibility: visibility,
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.back();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-project-image').trigger('change');
|
||||
}
|
||||
|
||||
function init_saimod_project_details(){
|
||||
// Image Preview
|
||||
$('#input-project-image').change(function(){
|
||||
$('#output-project-image').attr('src','./files/projects/'+$(this).val())
|
||||
});
|
||||
|
||||
//.input-badge-color
|
||||
// Badge Preview Text
|
||||
$('.input-badge-badge, #input-focus-badge, #input-type-badge').on('input',function(){
|
||||
$(this).parent().parent().find('.badge').html($(this).val());
|
||||
});
|
||||
// Badge Preview Color
|
||||
$('.input-badge-color, #input-focus-color, #input-type-color').change(function(){
|
||||
$(this).parent().parent().find('.badge').removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)badge-\S+/g) || []).join(' ');
|
||||
@ -142,10 +190,247 @@ function init_saimod_project_details(){
|
||||
$(this).parent().parent().find('.badge').addClass($(this).val());
|
||||
});
|
||||
|
||||
$('#btn-project-back').click(function(){
|
||||
// Focus New Button
|
||||
$('#btn-project-focus-new').click(function(){
|
||||
project = $(this).attr('project');
|
||||
badge = $('#input-focus-badge').val();
|
||||
color = $('#input-focus-color').val();
|
||||
visibility = $('#input-focus-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'project_focus_new',
|
||||
data: {
|
||||
project: project,
|
||||
badge: badge,
|
||||
color: color,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Type New Button
|
||||
$('#btn-project-type-new').click(function(){
|
||||
project = $(this).attr('project');
|
||||
badge = $('#input-type-badge').val();
|
||||
color = $('#input-type-color').val();
|
||||
visibility = $('#input-type-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'project_type_new',
|
||||
data: {
|
||||
project: project,
|
||||
badge: badge,
|
||||
color: color,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badges Visibility
|
||||
$('.badge-visibility').click(function(){
|
||||
badge = $(this).attr('badge');
|
||||
visibility = $(this).val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'badge_visibility',
|
||||
data: {
|
||||
badge: badge,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badge Order
|
||||
$('.badge-order-up').click(function(e){
|
||||
e.preventDefault();
|
||||
badge = $(this).attr('badge');
|
||||
type = $(this).attr('type');
|
||||
ref_id = $(this).attr('ref_id');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'badge_order',
|
||||
data: {
|
||||
action: 'up',
|
||||
badge: badge,
|
||||
type: type,
|
||||
ref_id: ref_id,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.badge-order-down').click(function(e){
|
||||
e.preventDefault();
|
||||
badge = $(this).attr('badge');
|
||||
type = $(this).attr('type');
|
||||
ref_id = $(this).attr('ref_id');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'badge_order',
|
||||
data: {
|
||||
action: 'down',
|
||||
badge: badge,
|
||||
type: type,
|
||||
ref_id: ref_id,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badges Delete
|
||||
$('#btn-focus-del, #btn-type-del').click(function(){
|
||||
var badges = [];
|
||||
$(this).parent().parent().parent().parent().find('.badge-check:checked').each(function() {
|
||||
badges.push($(this).attr('badge'));
|
||||
});
|
||||
if (confirm('Are you sure you want to delete '+badges.length+' Badges PERMANENTLY?')) {
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'badge_delete',
|
||||
data: badges
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Back Button
|
||||
$('.btn-project-back').click(function(){
|
||||
system.back();
|
||||
});
|
||||
$('#btn-project-update').click(function(){
|
||||
|
||||
// Update Button
|
||||
$('#btn-project-update').click(function(e){
|
||||
e.preventDefault();
|
||||
project = $(this).attr('project');
|
||||
img = $('#input-project-image').val();
|
||||
name = $('#input-project-name').val();
|
||||
info = $('#input-project-info').val();
|
||||
website = $('#input-project-website').val();
|
||||
visibility = $('#input-project-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_project',
|
||||
action: 'project_update',
|
||||
data: {
|
||||
project: project,
|
||||
img: img,
|
||||
name: name,
|
||||
info: info,
|
||||
website: website,
|
||||
visibility: visibility,
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -53,8 +53,8 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
public static function sai_mod__SAI_saimod_project_action_project_delete($data){
|
||||
foreach($data as $id){
|
||||
\SQL\DELETE_PROJECT::QI(array($id));
|
||||
\SQL\DELETE_BADGE::QI(array(self::BADGE_TYPE_PROJECT_FOCUS,$id));
|
||||
\SQL\DELETE_BADGE::QI(array(self::BADGE_TYPE_PROJECT_TYPE,$id));
|
||||
\SQL\DELETE_BADGES::QI(array(self::BADGE_TYPE_PROJECT_FOCUS,$id));
|
||||
\SQL\DELETE_BADGES::QI(array(self::BADGE_TYPE_PROJECT_TYPE,$id));
|
||||
}
|
||||
return \JsonResult::ok();
|
||||
}
|
||||
@ -64,13 +64,13 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
case 'up':
|
||||
$new_order = $data['order'] -1;
|
||||
$new_order = $new_order > 0 ? $new_order : 1;
|
||||
\SQL\UPDATE_PROJECTS_ORDER_DOWN_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PROJECTS_ORDER_DOWN_ID::QI(array($project));
|
||||
\SQL\UPDATE_PROJECT_ORDER_DOWN_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PROJECT_ORDER_DOWN_ID::QI(array($project));
|
||||
break;
|
||||
case 'down':
|
||||
$new_order = $data['order'] +1;
|
||||
\SQL\UPDATE_PROJECTS_ORDER_UP_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PROJECTS_ORDER_UP_ID::QI(array($project));
|
||||
\SQL\UPDATE_PROJECT_ORDER_UP_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PROJECT_ORDER_UP_ID::QI(array($project));
|
||||
break;
|
||||
default:
|
||||
throw new \SYSTEM\LOG\ERROR('Operration not supported');
|
||||
@ -78,10 +78,34 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_project_action_project_visibility($data){
|
||||
\SQL\UPDATE_PROJECTS_VISIBILITY::QI(array($data['visibility'],$data['project']));
|
||||
\SQL\UPDATE_PROJECT_VISIBILITY::QI(array($data['visibility'],$data['project']));
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_project_new(){
|
||||
$vars = array();
|
||||
|
||||
//images
|
||||
$images = \SYSTEM\FILES\files::get('projects');
|
||||
$vars['images'] = '';
|
||||
foreach($images as $image){
|
||||
$img = ['name' => $image, 'selected' => ''];
|
||||
$vars['images'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_project_image_file.tpl'))->SERVERPATH(),$img);
|
||||
}
|
||||
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_project_new.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_project_save($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\INSERT_PROJECT::QI(array( $data['img'],
|
||||
$data['name'],
|
||||
$data['info'],
|
||||
$data['website'],
|
||||
$data['visibility']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_project_details($project){
|
||||
// $vars = array();
|
||||
$vars = \SQL\SELECT_PROJECT::Q1(array($project));
|
||||
@ -117,7 +141,7 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
$row['badge_colors'] = self::badge_color_options($row['color']);
|
||||
|
||||
|
||||
$vars['type'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_project_badge_tr.tpl'))->SERVERPATH(),$row);
|
||||
}
|
||||
|
||||
@ -126,6 +150,72 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_project_details.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_project_update($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\UPDATE_PROJECT::QI(array( $data['img'],
|
||||
$data['name'],
|
||||
$data['info'],
|
||||
$data['website'],
|
||||
$data['visibility'],
|
||||
$data['project']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_project_focus_new($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\INSERT_BADGE::QI(array(self::BADGE_TYPE_PROJECT_FOCUS,
|
||||
$data['project'],
|
||||
$data['badge'],
|
||||
$data['color'],
|
||||
self::BADGE_TYPE_PROJECT_FOCUS,
|
||||
$data['project'],
|
||||
$data['visibility']))
|
||||
);
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_project_action_project_type_new($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\INSERT_BADGE::QI(array(self::BADGE_TYPE_PROJECT_TYPE,
|
||||
$data['project'],
|
||||
$data['badge'],
|
||||
$data['color'],
|
||||
self::BADGE_TYPE_PROJECT_TYPE,
|
||||
$data['project'],
|
||||
$data['visibility']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_project_action_badge_visibility($data){
|
||||
\SQL\UPDATE_BADGE_VISIBILITY::QI(array($data['visibility'],$data['badge']));
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_project_action_badge_order($data){
|
||||
$badge = $data['badge'];
|
||||
$type = $data['type'];
|
||||
$ref_id = $data['ref_id'];
|
||||
switch($data['action']){
|
||||
case 'up':
|
||||
$new_order = $data['order'] -1;
|
||||
$new_order = $new_order > 0 ? $new_order : 1;
|
||||
\SQL\UPDATE_BADGE_ORDER_DOWN_ORDER::QI(array($type,$ref_id,$new_order));
|
||||
\SQL\UPDATE_BADGE_ORDER_DOWN_ID::QI(array($badge));
|
||||
break;
|
||||
case 'down':
|
||||
$new_order = $data['order'] +1;
|
||||
\SQL\UPDATE_BADGE_ORDER_UP_ORDER::QI(array($type,$ref_id,$new_order));
|
||||
\SQL\UPDATE_BADGE_ORDER_UP_ID::QI(array($badge));
|
||||
break;
|
||||
default:
|
||||
throw new \SYSTEM\LOG\ERROR('Operration not supported');
|
||||
}
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_project_action_badge_delete($data){
|
||||
foreach($data as $id){
|
||||
\SQL\DELETE_BADGE::QI(array($id));
|
||||
}
|
||||
return \JsonResult::ok();
|
||||
}
|
||||
|
||||
private static function badge_color_options($selected = null){
|
||||
$colors = array(
|
||||
'badge-primary',
|
||||
|
||||
@ -28,6 +28,6 @@ class DELETE_BADGE extends \SYSTEM\DB\QP {
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'DELETE FROM `badges` WHERE `type` = ? AND `ref_id` = ?;';
|
||||
'DELETE FROM `badges` WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
33
wecker_manufaktur/sai/saimod_project/sql/DELETE_BADGES.php
Normal file
33
wecker_manufaktur/sai/saimod_project/sql/DELETE_BADGES.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class DELETE_BADGES extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'DELETE FROM `badges` WHERE `type` = ? AND `ref_id` = ?;';
|
||||
}
|
||||
}
|
||||
36
wecker_manufaktur/sai/saimod_project/sql/INSERT_BADGE.php
Normal file
36
wecker_manufaktur/sai/saimod_project/sql/INSERT_BADGE.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class INSERT_BADGE extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'INSERT INTO `badges`'.
|
||||
' (`type`, `ref_id`, `badge`, `color`, `order`, `visible`)'.
|
||||
' VALUES ( ?, ?, ? ,?, (IFNULL((SELECT MAX(`order`)+1 FROM `badges` as `b` WHERE `type` = ? AND `ref_id` = ?),1)), ?);';
|
||||
|
||||
}
|
||||
}
|
||||
35
wecker_manufaktur/sai/saimod_project/sql/INSERT_PROJECT.php
Normal file
35
wecker_manufaktur/sai/saimod_project/sql/INSERT_PROJECT.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class INSERT_PROJECT extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'INSERT INTO `projects` (`img`, `name`, `info`, `website`, `order`, `visible`)'.
|
||||
' VALUES(?, ?, ?, ?, (IFNULL((SELECT MAX(`order`)+1 FROM `projects` as `p`),1)), ?);';
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_BADGE_ORDER_DOWN_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `badges` SET `order`=`order` - 1 WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_BADGE_ORDER_DOWN_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `badges` SET `order`=`order` + 1 WHERE `type` = ? AND `ref_id` = ? AND `order` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_BADGE_ORDER_UP_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `badges` SET `order`=`order` + 1 WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_BADGE_ORDER_UP_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `badges` SET `order`=`order` - 1 WHERE `type`= ? AND `ref_id` = ? AND `order` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_BADGE_VISIBILITY extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `badges` SET `visible` = ? WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
36
wecker_manufaktur/sai/saimod_project/sql/UPDATE_PROJECT.php
Normal file
36
wecker_manufaktur/sai/saimod_project/sql/UPDATE_PROJECT.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class UPDATE_PROJECT extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects`'.
|
||||
' SET `img` = ?, `name` = ?, `info` = ?, `website` = ?, visible = ?'.
|
||||
' WHERE `id` = ?;';
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PROJECTS_ORDER_DOWN_ID extends \SYSTEM\DB\QP {
|
||||
class UPDATE_PROJECT_ORDER_DOWN_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects` SET `order`=`order` - 1 WHERE `id` = ?;';
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PROJECTS_ORDER_DOWN_ORDER extends \SYSTEM\DB\QP {
|
||||
class UPDATE_PROJECT_ORDER_DOWN_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects` SET `order`=`order` + 1 WHERE `order` = ?;';
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PROJECTS_ORDER_UP_ID extends \SYSTEM\DB\QP {
|
||||
class UPDATE_PROJECT_ORDER_UP_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects` SET `order`=`order` + 1 WHERE `id` = ?;';
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PROJECTS_ORDER_UP_ORDER extends \SYSTEM\DB\QP {
|
||||
class UPDATE_PROJECT_ORDER_UP_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects` SET `order`=`order` - 1 WHERE `order` = ?;';
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PROJECTS_VISIBILITY extends \SYSTEM\DB\QP {
|
||||
class UPDATE_PROJECT_VISIBILITY extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `projects` SET `visible` = ? WHERE `id` = ?;';
|
||||
@ -1,14 +1,17 @@
|
||||
CREATE TABLE `badges` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`type` INT(10) UNSIGNED NOT NULL,
|
||||
`ref_id` INT(10) UNSIGNED NOT NULL,
|
||||
`badge` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`color` VARCHAR(50) NOT NULL DEFAULT 'badge-primary' COLLATE 'utf8mb4_unicode_ci',
|
||||
`order` INT(10) UNSIGNED NOT NULL,
|
||||
`visible` INT(10) UNSIGNED NULL DEFAULT 1,
|
||||
PRIMARY KEY (`type`, `ref_id`, `badge`),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `type_ref_id_badge` (`type`, `ref_id`, `badge`),
|
||||
INDEX `type` (`type`),
|
||||
INDEX `ref_id` (`ref_id`)
|
||||
)
|
||||
COLLATE='utf8mb4_unicode_ci'
|
||||
ENGINE=InnoDB
|
||||
AUTO_INCREMENT=1
|
||||
;
|
||||
@ -4,9 +4,18 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9002, 42, 3, 0, '_SAI_saimod_project', 'page', 'UINT0');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9010, 42, 2, 9000, 'project_delete', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9011, 42, 2, 9000, 'project_update', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9020, 42, 2, 9000, 'project_order', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9030, 42, 2, 9000, 'project_visibility', 'data', 'JSON');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9040, 42, 2, 9000, 'project_details', 'project', 'UINT0');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9041, 42, 2, 9000, 'project_focus_new', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9042, 42, 2, 9000, 'project_type_new', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9043, 42, 2, 9000, 'badge_visibility', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9044, 42, 2, 9000, 'badge_order', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9045, 42, 2, 9000, 'badge_delete', 'data', 'JSON');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9050, 42, 2, 9000, 'project_save', 'data', 'JSON');
|
||||
|
||||
-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9030, 42, 2, 9000, 'contact', 'email', 'STRING');
|
||||
-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (9035, 42, 2, 9000, 'update_contact', 'data', 'JSON');
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (900, 42, 'project', 'project', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_project&search=${search}&page=${page}', 'init_saimod_project', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (910, 42, 'new', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_new', 'init_saimod_project_new', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (920, 42, 'details', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_details&project=${project}', 'init_saimod_project_details', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (930, 42, 'new', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_new', 'init_saimod_project_new', '\\SAI\\saimod_project');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (901, 42, 'overview', 'mail', 900, 0, 0, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=overview', 'init_saimod_mail_overview', '\\SAI\\saimod_mail');
|
||||
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (910, 42, 'contacts', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=contacts&search=${search}&page=${page}&list=${list}', 'init_saimod_mail_contacts', '\\SAI\\saimod_mail');
|
||||
|
||||
@ -1,22 +1,19 @@
|
||||
<tr>
|
||||
<td><span class="badge ${color}">${badge}</span></td>
|
||||
<td><input class="input-badge-badge form-control" type="text" value="${badge}" style="width: 100%"/></td>
|
||||
<td>
|
||||
<select class="input-badge-color form-control">
|
||||
${badge_colors}
|
||||
</select>
|
||||
</td>
|
||||
<td>${badge}</td>
|
||||
<td>${color}</td>
|
||||
<td style="font-size: 30px">
|
||||
<a href="#" class="project-order-up" project="${id}" order="${order}"><i class="fa fa-caret-up"></i></a>
|
||||
<a href="#" class="project-order-down" project="${id}" order="${order}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="#" class="badge-order-up" badge="${id}" type="${type}" ref_id="${ref_id}" order="${order}"><i class="fa fa-caret-up"></i></a>
|
||||
<a href="#" class="badge-order-down" badge="${id}" type="${type}" ref_id="${ref_id}" order="${order}" order="${order}"><i class="fa fa-caret-down"></i></a>
|
||||
${order}
|
||||
</td>
|
||||
<td>
|
||||
<select class="project-visibility form-control" project="${id}">
|
||||
<select class="badge-visibility form-control" badge="${id}">
|
||||
<option value="0" ${selected_invisible}>Invisible</option>
|
||||
<option value="1" ${selected_visible}>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" class="pull-right project-check" project="${id}"/>
|
||||
<input type="checkbox" class="pull-right badge-check" badge="${id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
@ -33,6 +33,12 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-project-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
<button id="btn-project-update" class="btn btn-sm btn-success pull-right" project="${id}"><i class="fa fa-edit"></i> Update</button>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
@ -66,13 +72,13 @@
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<select class="focus-visibility form-control" project="${id}">
|
||||
<select id="input-focus-visibility" class="form-control">
|
||||
<option value="0" >Invisible</option>
|
||||
<option value="1" selected>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" id="btn-project-focus-new" class="btn btn-sm btn-success pull-right"><i class="fa fa-plus"></i></button>
|
||||
<button type="button" id="btn-project-focus-new" class="btn btn-sm btn-success pull-right" project="${id}"><i class="fa fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -109,22 +115,25 @@
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<select class="type-visibility form-control" project="${id}">
|
||||
<select id="input-type-visibility" class="form-control">
|
||||
<option value="0" >Invisible</option>
|
||||
<option value="1" selected>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" id="btn-project-type-new" class="btn btn-sm btn-success pull-right"><i class="fa fa-plus"></i></button>
|
||||
<button type="button" id="btn-project-type-new" class="btn btn-sm btn-success pull-right" project="${id}"><i class="fa fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-project-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button id="btn-project-back" class="btn btn-sm btn-default" style="margin: 12px;"><i class="fa fa-angle-left"></i> Back</button>
|
||||
<button id="btn-project-update" class="btn btn-sm btn-success pull-right" style="margin: 12px;"><i class="fa fa-edit"></i> Update</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,45 @@
|
||||
<div class="row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed tablesorter sai_margin_off" id="table-project-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<img id="output-project-image" src="./files/projects/" alt="Image Not Found" style="width: 150px; height: 150px;"/>
|
||||
</th>
|
||||
<td>
|
||||
<select id="input-project-image" class="form-control">
|
||||
${images}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td><input id="input-project-name" class="form-control" type="text" style="width: 100%"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Info</th>
|
||||
<td><textarea id="input-project-info" class="form-control" style="width: 100%; min-height: 100px;"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Website</th>
|
||||
<td><input id="input-project-website" class="form-control" type="text" style="width: 100%"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Visibility</th>
|
||||
<td>
|
||||
<select id="input-project-visibility" class="form-control">
|
||||
<option value="0">Invisible</option>
|
||||
<option value="1">Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-project-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
<button id="btn-project-save" class="btn btn-sm btn-success pull-right""><i class="fa fa-save"></i> Save</button>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@ -8,6 +8,7 @@
|
||||
<td style="font-size: 30px">
|
||||
<a href="#" class="project-order-up" project="${id}" order="${order}"><i class="fa fa-caret-up"></i></a>
|
||||
<a href="#" class="project-order-down" project="${id}" order="${order}"><i class="fa fa-caret-down"></i></a>
|
||||
${order}
|
||||
</td>
|
||||
<td>
|
||||
<select class="project-visibility form-control" project="${id}">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user