From 0eea33e5e407f5ad34236ede403560e0e29c73d9 Mon Sep 17 00:00:00 2001 From: Olivier Berten Date: Thu, 20 Jul 2017 21:07:52 +0100 Subject: [PATCH] Add Cantus ID field --- chant.php | 2 ++ chant_edit.php | 5 +++-- gregobase_structure.sql | 28 ++++++++++++++++------------ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/chant.php b/chant.php index d92e573..90340eb 100644 --- a/chant.php +++ b/chant.php @@ -100,6 +100,8 @@ if($c['version'] > '') echo '

Version

if($c['office-part'] > '') echo '

Usage

\n"; +if($c['cantusid'] > '') echo '

Cantus ID

\n"; + $tags = array(); $sql = 'SELECT * FROM '.db('chant_tags').' WHERE chant_id = '.$id; $req = $mysqli->query($sql) or die('Erreur SQL !
'.$sql.'
'.$mysqli->error); diff --git a/chant_edit.php b/chant_edit.php index 076fb25..a0a4815 100644 --- a/chant_edit.php +++ b/chant_edit.php @@ -93,7 +93,7 @@ if(!$logged_in) { $mysqli->query($sql) or die('Erreur SQL !
'.$sql.'
'.$mysqli->error); $id = $mysqli->insert_id; $mypost['id'] = $id; - foreach(array('version','office-part','mode','mode_var','commentary','initial','transcriber','gabc','gabc_verses','tex_verses','remarks') as $k) { + foreach(array('cantusid','version','office-part','mode','mode_var','commentary','initial','transcriber','gabc','gabc_verses','tex_verses','remarks') as $k) { if($mypost[$k] > '' && $mypost[$k] != "(c4)") { $sql = 'UPDATE '.db('chants').' SET `'.$k.'` = "'.$mysqli->real_escape_string($mypost[$k]).'" WHERE `id` = '.$id; $mysqli->query($sql) or die('Erreur SQL !
'.$sql.'
'.$mysqli->error); @@ -168,7 +168,7 @@ if(!$logged_in) { natcasesort($new_tags); unset($mypost['tags']); - $fields = array('id','incipit','version','office-part','mode','mode_var','commentary','initial','transcriber','gabc','gabc_verses','tex_verses','remarks'); + $fields = array('id','incipit','cantusid','version','office-part','mode','mode_var','commentary','initial','transcriber','gabc','gabc_verses','tex_verses','remarks'); $old = array(); $new = array(); foreach($fields as $f) { @@ -275,6 +275,7 @@ if(!$logged_in) { echo '
'; echo '

Incipit

'."\n"; + echo '

Cantus ID

'."\n"; echo '

Version

'."\n"; echo '

Usage