Add line lost

Discuss MySQL Ajax Table Editor

Add line lost

Postby hernandov » Thu Oct 16, 2014 9:04 pm

Hi, when i try to include a new tablecolumn joining to an other table, the Add Line at the bottom is lost, do you know why? . I have the pro version Thanks

<?php
/*
* Mysql Ajax Table Editor
*
* Copyright (c) 2013 Chris Kitchen <info@mysqlajaxtableeditor.com>
* All rights reserved.
*
* See COPYING file for license information.
*
* Download the latest version from
* http://www.mysqlajaxtableeditor.com
*/
require_once('Common.php');
require_once('php/lang/LangVars-es.php');
require_once('php/AjaxTableEditor.php');
class Activos extends Common
{
var $Editor;
protected $mateInstances = array('mate1_');

function displayHtml()
{
$html = '

<br />

<div class="mateAjaxLoaderDiv"><div id="ajaxLoader1"><img src="images/ajax_loader.gif" alt="Loading..." /></div></div>

<br /><br />

<div id="'.$this->mateInstances[0].'information">
</div>

<div id="'.$this->mateInstances[0].'titleLayer" class="mateTitleDiv">
</div>

<div id="'.$this->mateInstances[0].'tableLayer" class="mateTableDiv">
</div>

<div id="'.$this->mateInstances[0].'updateInPlaceLayer" class="mateUpdateInPlaceDiv">
</div>

<div id="'.$this->mateInstances[0].'recordLayer" class="mateRecordLayerDiv">
</div>

<div id="'.$this->mateInstances[0].'searchButtonsLayer" class="mateSearchBtnsDiv">
</div>';

echo $html;

// Set default session configuration variables here
$defaultSessionData['orderByColumn'] = 'Codigo';

$defaultSessionData = base64_encode($this->Editor->jsonEncode($defaultSessionData));

$javascript = '
<script type="text/javascript">
var mateHashes = {};
var mateForward = false;
var '.$this->mateInstances[0].' = new mate("'.$this->mateInstances[0].'");
'.$this->mateInstances[0].'.setAjaxInfo({url: "'.$this->getAjaxUrl().'", history: true});
if('.$this->mateInstances[0].'.ajaxInfo.history == false) {
'.$this->mateInstances[0].'.toAjaxTableEditor("update_html","");
} else if(window.location.hash.length == 0) {
mateHashes.'.$this->mateInstances[0].' = {info: "", action: "update_html", sessionData: "'.$defaultSessionData.'"};
mateForward = true;
}
if(mateForward) {
var sessionCookieName = '.$this->mateInstances[0].'.getSessionCookieName();
if($.cookie(sessionCookieName) != undefined) {
window.location.href = window.location.href+"#"+$.cookie(sessionCookieName);
} else {
window.location.href = window.location.href+"#"+Base64.encode($.toJSON(mateHashes));
}
}


</script>';
echo $javascript;
}

function initiateEditor()
{
$tableColumns['Codigo'] = array('display_text' => 'Codigo', 'perms' => 'EACVDXQSHOIMUTF',
'col_header_info' => 'style="width:80px";',
'input_info' => 'style="width:80px";',
'req' => true);
$tableColumns['CentrodeCostos'] = array('display_text' => 'Centro', 'perms' => 'EACVDXQSHOIMUTF',
'join' => array('table' => 'centrosdecostos', 'column' => 'Codigo',
'display_mask' => "CONCAT(centrosdecostos.Codigo,' ',centrosdecostos.Nombre)", 'type' => 'left'),
'col_header_info' => 'style="width:300px";',
'input_info' => 'style="width:300px";',
'req' => true,
'hidden'=>false);

$tableName = 'activos';
$primaryCol = 'Codigo';
$errorFun = array(&$this,'logError');
$permissions = 'EAVDXHOUFIQS';

$this->Editor = new AjaxTableEditor($tableName,$primaryCol,$errorFun,$permissions,$tableColumns);
$this->Editor->setConfig('tableInfo','cellpadding="1" width="800" class="mateTable"');
$this->Editor->setConfig('tableTitle','PROPIEDAD PLANTA Y EQUIPO');
$this->Editor->setConfig('addRowTitle','Adicionar Propiedad');
$this->Editor->setConfig('editRowTitle','Editar Propiedad');
$this->Editor->setConfig('paginationLinks',true);
$this->Editor->setConfig('instanceName',$this->mateInstances[0]);
$this->Editor->setConfig('editInPlace',true);
$this->Editor->setConfig('addInPlace',true);


//$this->Editor->setConfig('persistentAddForm',false);
//$userColumns[] = array('title' => 'testing', 'col_header_info' => 'style="color: blue;"');
//$this->Editor->setConfig('userColumns',$userColumns);
}


function Activos()
{
session_start();
ob_start();
$this->mysqlConnect();
$this->initiateEditor();
if(isset($_POST['json']))
{
if(get_magic_quotes_gpc())
{
$_POST['json'] = stripslashes($_POST['json']);
}
$this->Editor->data = $this->Editor->jsonDecode($_POST['json'],true);
$this->Editor->setDefaults();
$this->Editor->main();
echo $this->Editor->jsonEncode($this->Editor->retArr);
}
else if(isset($_GET['mate_export']))
{
$this->Editor->data['sessionData'] = $_GET['session_data'];
$this->Editor->setDefaults();
ob_end_clean();
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-type: application/x-msexcel');
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="'.$this->Editor->tableName.'.xls"');
// Add utf-8 signature for windows/excel
echo chr(0xEF).chr(0xBB).chr(0xBF);
echo $this->Editor->exportInfo();
exit();
}
else if(isset($_POST) && count($_POST) > 0)
{
$this->Editor->setDefaults();
$this->Editor->handleFileUpload();
}
else
{
$this->displayHeaderHtml();
$this->displayHtml();

// $this->displayFooterHtml();
}
}
}
$lte = new Activos();
?>
hernandov
 
Posts: 8
Joined: Mon Mar 21, 2011 9:56 pm

Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron