Permalink
Browse files

.

  • Loading branch information...
steven-copley
steven-copley committed Aug 23, 2018
1 parent 81db74a commit 317fa4bb8019fd9dd78e8d0aedb4da1d6b72dc85
Showing with 141 additions and 68 deletions.
  1. +6 −5 index.php
  2. +1 −1 nuajax.js
  3. +1 −1 nuapi.php
  4. +7 −5 nubuilder4.css
  5. +3 −5 nubuilders.php
  6. +54 −15 nucommon.js
  7. +28 −15 nucommon.php
  8. +26 −15 nuconfig.php
  9. +15 −6 nuform.js
@@ -12,11 +12,12 @@
function nuImportNewDB($nuDB){
$r = $nuDB->query("SHOW TABLES");
$t = $r->fetch(PDO::FETCH_NUM)[0];
if($t != ''){return;}
$t = $nuDB->query("SHOW TABLES");
while($r = $t->fetch(PDO::FETCH_NUM)){
if($r[0] == 'zzzzsys_object'){return;}
}
$file = realpath(dirname(__FILE__))."/nubuilder4.sql";
@$handle = fopen($file, "r");
$temp = "";
@@ -512,7 +512,7 @@ function nuGetLookupId(pk, id){
nuPopulateLookup(data, id);
$('#' + id).addClass('nuEdited');
nuHasBeenEdited();
var o = $('#' + id);
if(o.attr('data-nu-prefix') == ''){return;}
@@ -60,7 +60,7 @@
$f->forms[0]->database = $nuConfigDBName;
$f->forms[0]->dimensions = $formAndSessionData->dimensions;
$f->forms[0]->translation = $formAndSessionData->translation;
$f->forms[0]->tableSchema = nuUpdateTableSchema();
$f->forms[0]->tableSchema = nuUpdateTableSchema($CT);
$f->forms[0]->formSchema = nuUpdateFormSchema();
$f->forms[0]->session_id = $_SESSION['SESSION_ID'];
$f->forms[0]->callback = $_POST['nuCallback'];
@@ -331,11 +331,13 @@ input[type=range]::-webkit-slider-runnable-track {
}
.nuLogin {
background-color: lightgrey;
border-style: none;
top: 100px;
width: 300px;
position: absolute;
background-color: #d8e4ff;
border-style: solid;
border-width: 1px;
border-color: rgba(0, 0, 0, 0.08);
height: 300px;
width: 330px;
margin: 50px auto 0px auto;
}
.nuDragBox:hover {
@@ -218,11 +218,8 @@ function nuBuildFastForm($table, $form_type){
$y = $r->sob_all_type;
$i = $r->sob_input_type;
$id = $r->sob_all_id;
// $l = count($a);
$date = ($i == 'date' || $i == 'nuDate');
$norm = ($y == 'input' && $i != 'date' && $i != 'nuDate' && $i != 'nuNumber' && $i != 'number');
$norm = ($y == 'input' && $i != 'date' && $i != 'nuDate' && $i != 'nuNumber' && $i != 'number' && $i != 'file');
if($y == 'lookup'){ $a[] = Array('name'=>$id, 'type'=>'id');}
if($y == 'select'){ $a[] = Array('name'=>$id, 'type'=>'varchar');}
@@ -232,6 +229,7 @@ function nuBuildFastForm($table, $form_type){
if($y == 'input' && $date){ $a[] = Array('name'=>$id, 'type'=>'date');}
if($y == 'input' && $i == 'number'){ $a[] = Array('name'=>$id, 'type'=>'int');}
if($y == 'input' && $i == 'nuNumber'){ $a[] = Array('name'=>$id, 'type'=>'decimal');}
if($y == 'input' && $i == 'file'){ $a[] = Array('name'=>$id, 'type'=>'longtext');}
}
@@ -365,7 +363,7 @@ function nuBuildFastForm($table, $form_type){
nuRunQuery("DROP TABLE $TT");
nuSetJSONData('clientFormSchema', nuBuildFormSchema());
nuSetJSONData('clientTableSchema', nuBuildTableSchema());
}
@@ -97,6 +97,12 @@ function nuGetBreadcrumb(bc){
var b = bc;
}
if(window.nuTimesSaved > 0){
window.nuTimesSaved = -1;
}
if(e && nuFORM.getCurrent().form_type != 'launch'){
if(!confirm(nuTranslate('Leave this form without saving?'))){
@@ -181,22 +187,34 @@ function nuLogin(nuconfigNuWelcomeBodyInnerHTML){
$('body').html('');
var h = `
<div id='login' class='nuLogin' style='background-color:#d8e4ff; width:330;position:absolute;top:50px;height:300px;left:50px;border-style:solid;border-width:1px;border-color: rgba(0, 0, 0, 0.08);'>
<div id='nulogo' style='background-size:100% 100%;background-image:url(\"graphics/logo.png\");position:absolute;width:200px;height:80px;top:45px;left:65px;'></div>
<br>
<div style='position:absolute;top:170px;left:20px;text-align:right;width:70px;display:inline-block;'>Username</div>
<input id='nuusername' style='position:absolute;top:170px;left:100px;'/>
<br>
<br>
<div style='position:absolute;top:200px;left:20px;text-align:right;width:70px;display:inline-block;'>Password</div>
<input id='nupassword' style='position:absolute;top:200px;left:100px;' type='password' onkeypress='nuSubmit(event)'//>
<br>
<br>
<input id='submit' type='button' class='nuButton' style='position:absolute;width:90px;height:30px;top:240px;left:130px;' onclick='nuLoginRequest()' value='Log in'/>
<br>
<br>
<div id='outer' style='width:100%'>
<div id='login' class='nuLogin'>
<table>
<tr>
<td align='center' style='text-align:center;height:50px' colspan='2'>
<div id='nulogo' style='margin:50px 0px 20px 65px;background-size:100% 100%;background-image:url(\"graphics/logo.png\");width:200px;height:80px;'></div>
</td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Username</span></td>
<td style='text-align:left'><input id='nuusername'/></td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Password</span></td>
<td style='text-align:left'><input id='nupassword' type='password' onkeypress='nuSubmit(event)'/></td>
</tr>
<tr>
<td style='text-align:center' colspan='2'>
<input id='submit' type='button' class='nuButton' style='margin:20px 0px 0px 50px;width:90px;height:30px;' onclick='nuLoginRequest()' value='Log in'/>
</td>
</tr>
</table>
</div>
</div>
`;
@@ -1857,4 +1875,25 @@ function nuDecendingSortNumberColumn(b, a) {
function nuEmbedObject(f, t){
if(f == ''){return;}
var ob = JSON.parse(f);
var ty = ob.type;
var ur = atob(ob.file);
var x = document.createElement("EMBED");
x.setAttribute("type", ty);
x.setAttribute("src", ur);
x.setAttribute("width", "300px");
x.setAttribute("height", "300px");
$('#' + t).html('');
document.getElementById(t).appendChild(x);
}
@@ -418,7 +418,6 @@ function nuRunPHP($procedure_code){
$aa = nuAllowedActivities();
$p = nuProcedureAccessList($aa);
$id = nuID();
$s = "SELECT * FROM zzzzsys_php WHERE sph_code = '$procedure_code'";
$t = nuRunQuery($s);
@@ -805,7 +804,6 @@ function nuGetUserAccess(){
nuRunQuery("UPDATE zzzzsys_session SET sss_time = $s WHERE zzzzsys_session_id = ? ", array($_SESSION['SESSION_ID']));
nuRunQuery("DELETE FROM zzzzsys_session WHERE sss_time < $s - 18000"); //-- 5 hours
//nudebug("DELETE FROM zzzzsys_session WHERE sss_time < $s - 18000");
}
return $A;
@@ -1053,10 +1051,11 @@ function nuBuildTempTable($name_id, $tt, $rd = 0){
}
$p = nuReplaceHashVariables($c);
$p = addslashes($p);
//$p = addslashes($p);
$tt = addslashes($tt);
$P = " nuRunQuery('CREATE TABLE $tt $p');";
$P = '$sql = "CREATE TABLE '.$tt.' '.$p.'";';
$P .= 'nuRunQuery($sql);';
eval($P);
@@ -1187,21 +1186,35 @@ function nuUpdateFormSchema(){
}
function nuUpdateTableSchema(){
$s = nuGetJSONData('clientTableSchema');
function nuUpdateTableSchema($call_type){
if(is_null($s)){
if($call_type == 'runhiddenphp' and nuHash()['form_code'] == 'nufflaunch'){
nuSetJSONData('clientTableSchema', []); //-- force updating Table Schema
return;
$s = nuBuildTableSchema();
}
nuSetJSONData('clientTableSchema', $s);
$was = nuGetJSONData('clientTableSchema');
$is = nuBuildTableSchema();
if(is_null($was)){
return $s;
nuSetJSONData('clientTableSchema', $is);
return $is;
}else{
return [];
if(json_encode($was) == json_encode($is)){
return [];
}else{
nuSetJSONData('clientTableSchema', $is);
return $is;
}
}
}
@@ -1614,4 +1627,4 @@ function nuUser(){
?>
?>
@@ -10,23 +10,34 @@
$nuConfigIsDemo = false;
/* $nuWelcomeBodyInnerHTML = "
<div id='outer' style='width:100%'>
<div id='login' class='nuLogin' style='background-color:#d8e4ff; width:330;position:absolute;top:50px;height:300px;left:50px;border-style:solid;border-width:1px;border-color: rgba(0, 0, 0, 0.08);'>
<div id='nulogo' style='background-size:100% 100%;background-image:url(\"graphics/logo.png\");position:absolute;width:200px;height:80px;top:45px;left:65px;'></div>
<br>
<div style='position:absolute;top:170px;left:20px;text-align:right;width:70px;display:inline-block;'>Username</div>
<input id='nuusername' style='position:absolute;top:170px;left:100px;'/>
<br>
<br>
<div style='position:absolute;top:200px;left:20px;text-align:right;width:70px;display:inline-block;'>Password</div>
<input id='nupassword' style='position:absolute;top:200px;left:100px;' type='password'/>
<br>
<br>
<input id='submit' type='submit' class='nuButton' style='position:absolute;width:90px;height:30px;top:240px;left:130px;' onclick='nuLoginRequest()' value='Log in'/>
<br>
<br>
<div id='login' class='nuLogin'>
<table>
<tr>
<td align='center' style='text-align:center;height:50px' colspan='2'>
<div id='nulogo' style='margin:50px 0px 20px 65px;background-size:100% 100%;background-image:url(\"graphics/logo.png\");width:200px;height:80px;'></div>
</td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Username</span></td>
<td style='text-align:left'><input id='nuusername'/></td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Password</span></td>
<td style='text-align:left'><input id='nupassword' type='password' onkeypress='nuSubmit(event)'/></td>
</tr>
<tr>
<td style='text-align:center' colspan='2'>
<input id='submit' type='button' class='nuButton' style='margin:20px 0px 0px 50px;width:90px;height:30px;' onclick='nuLoginRequest()' value='Log in'/>
</td>
</tr>
</table>
</div>
</div>
";
*/
@@ -537,7 +537,8 @@ function nuINPUT(w, i, l, p, prop){
.attr('data-nu-field', id)
.attr('data-nu-prefix', p)
.attr('data-nu-data', '')
.attr('onchange', 'this.className = "nuEdited"');
.attr('onchange', 'this.className = "nuEdited"')
.val(prop.objects[i].value);
id = id + '_file';
@@ -2622,16 +2623,22 @@ function nuPopulateLookup(fm, target){
}
}else{
$('#' + id).val(f[i][1]);
// if(id != target + 'code'){
// $('#' + id).change();
// }
$('#' + id).val(f[i][1]);
if($('#' + id).attr('data-nu-format') !== undefined){
nuReformat($('#' + id)[0]);
$('#' + id).addClass('nuEdited')
$('#' + p + 'nuDelete').prop('checked', false);
}
}
}
nuCalculateForm();
eval(fm.lookup_javascript);
@@ -2952,6 +2959,8 @@ function nuDeleteAllAction(){
function nuCloneAction(){
window.nuTimesSaved = 0;
$('[data-nu-primary-key]').each(function(index){
$(this).attr('data-nu-primary-key','-1');

0 comments on commit 317fa4b

Please sign in to comment.