Esempio n. 1
0
 /**
  *@package AppForm
  *@since v0.1
  *@method PrintList()
  *@desc  Returns the records as a table
  * */
 private function PrintList()
 {
     $html = '';
     $db = new db();
     $appListFormId = 'apFrmLst' . $this->IdObject;
     $divPannel = 'pannel-1-' . $this->IdObject;
     $L = new AppList($this->sql_list);
     $L->formId = $appListFormId;
     $L->printFormTag = false;
     $L->reg_x_pag = $this->reg_x_page;
     $L->enable_buttons = true;
     $L->butons_IdObject = $this->IdObject;
     $L->divPannel = $divPannel;
     $L->id_field_name = $this->DbRecord->id_field_name;
     $data['formId'] = $appListFormId;
     $data['divPannel'] = $divPannel;
     $data['url'] = $this->CurrentPage;
     if ($this->templateList != '') {
         $L->useTemplateView($this->templateList, $data);
     }
     // Toolbar
     $toolbar = $this->PrintToolBar();
     $html .= $toolbar;
     $html .= '<div class="clear"></div>';
     $html .= '<form name="' . $appListFormId . '" id="' . $appListFormId . '">';
     $html .= '<input type="hidden" name="op" value="' . encode('view-2') . '">';
     $ajaxSubmit = new ajax_submit();
     //$html .='<textarea style="width:97%;height:400px">';
     $html .= $ajaxSubmit->Render($L->formId, $divPannel, $this->CurrentPage);
     $html .= utf8_encode($L->Render($this->CurrentPage));
     //$html .='</textarea>';
     $html .= '</form>';
     // Returns result
     ob_start();
     eval('?>' . $html . '<?php ');
     echo $ViewResult = ob_get_contents();
     ob_end_clean();
     return $ViewResult;
 }
Esempio n. 2
0
    </div>

    <div id="cont2" class="cont" style="display:none;">
Cargando...
</div>
<div id="cont3" class="cont" style="display:none;">
Cargando...
</div>

</div>
        
        
</section>

<?php 
$xSubmit = new ajax_submit();
echo $xSubmit->Render('frm1', 'cont2', 'admin/import-2/');
?>


<script>
$(function(){
	
	
	

	

	$("#frm1").validate({
	 submitHandler: function(form) {
	 	alert(123);
Esempio n. 3
0
 /**
  *@package AppList
  *@since v0.2
  *@method PrintCommonList()
  * */
 private function PrintCommonList()
 {
     if ($this->enable_buttons == true) {
         if ($this->butons_IdObject == '') {
             echo 'Error:(AppList Object) $this->butons_IdObject no definido<br>';
             echo 'Cuando se habilita $this->enable_buttons==true debe enviarse el parametro $this->butons_IdObject = "El AppFormID del formulario" ';
             return '';
         }
     }
     $divContentId = 'dvApLstCont' . $this->formId;
     $html = '';
     // Run the process to execute query, pagger variables
     $this->runQueryProcess();
     $this->createFilter();
     $this->createPagger();
     $ajaxSubmitStr = '';
     if ($this->printFormTag == true) {
         $ajaxSubmit = new ajax_submit();
         $ajaxSubmitStr = $ajaxSubmit->Render($this->formId, $divContentId, $this->currentUrl);
     }
     $html .= '<div id="' . $divContentId . '">';
     if ($this->printFormTag == true) {
         $html .= '<form name="' . $this->formId . '" id="' . $this->formId . '">';
     }
     $html .= $this->filter . $ajaxSubmitStr;
     if ($this->printFormTag == true) {
         $html .= '</form>';
     }
     $html .= '<table class="tbl-1" style="width:100%">';
     $line = 0;
     while ($row = $this->db_queryapplist->next()) {
         $tot_cols = count($row) / 2;
         // Print header
         if ($line == 0) {
             $html .= '<thead><tr>';
             if ($this->enable_buttons) {
                 $html .= '<th style="width:100px;">&nbsp;</th>';
             }
             $col_cnt = 0;
             foreach ($row as $cols => $val) {
                 if ($cols != $this->id_field_name) {
                     $col_cnt++;
                     $html .= '<th>' . self::sort_column($col_cnt, $cols, $this->formId) . '</th>';
                 }
             }
             $html .= '</tr></thead>';
         }
         //Print rows
         $html .= '<tr>';
         if ($this->enable_buttons) {
             $url = $this->currentUrl;
             $divPannel = $this->divPannel;
             $xEdit = new ajax('url', $divPannel, 'url:' . $url . ';args:op=' . encode('edit') . '&' . $this->butons_IdObject . '-i=' . $row[$this->id_field_name]);
             $xView = new ajax('url', $divPannel, 'url:' . $url . ';args:op=' . encode('selec-record') . '&rec-srch=' . $row[$this->id_field_name]);
             $xDelete = new ajax('url', $divPannel, 'url:' . $url . ';args:op=' . encode('del') . '&' . $this->butons_IdObject . '-i=' . $row[$this->id_field_name] . '&viewas=list');
             $html .= '<td>';
             $html .= '<a href="javascript:void(0);" onclick="' . $xView->render() . '"><img title="' . __('Ver') . '" src="' . HTTP . '_HTML/img/ico_view.png" width="20"></a>';
             $html .= '&nbsp; <a href="javascript:void(0);" onclick="' . $xEdit->render() . '"><img title="' . __('Editar') . '" src="' . HTTP . '_HTML/img/ico_edit.png" width="20"></a>';
             $html .= '&nbsp; <a href="javascript:void(0);" onclick="if(confirm(\'Eliminar Registro?\')){' . $xDelete->render() . '}"><img title="' . __('Eliminar') . '" src="' . HTTP . '_HTML/img/ico_delete.png" width="20"></a>';
             $html .= '</td>';
         }
         foreach ($row as $cols => $val) {
             if ($cols != $this->id_field_name) {
                 $html .= '<td>' . $val . '</td>';
             }
         }
         $html .= '</tr>';
         $line++;
     }
     // end while
     $html .= '</table>';
     $html .= $this->pagger;
     $html .= '</div>';
     // Contenedor
     return $html;
 }
Esempio n. 4
0
 /**
  *@package AppList
  *@since v0.2
  *@method PrintCommonList()
  * */
 private function PrintCommonList()
 {
     if ($this->enable_buttons == true) {
         if ($this->butons_IdObject == '') {
             echo 'Error:(AppList Object) $this->butons_IdObject no definido<br>';
             echo 'Cuando se habilita $this->enable_buttons==true debe enviarse el parametro $this->butons_IdObject = "El AppFormID del formulario" ';
             return '';
         }
     }
     $divContentId = 'dvApLstCont' . $this->formId;
     $html = '';
     // Run the process to execute query, pagger variables
     $this->runQueryProcess();
     $this->createFilter();
     $this->createPagger();
     $ajaxSubmitStr = '';
     if ($this->printFormTag == true) {
         $ajaxSubmit = new ajax_submit();
         $ajaxSubmitStr = $ajaxSubmit->Render($this->formId, $divContentId, $this->currentUrl);
     }
     $html .= '<div id="' . $divContentId . '">';
     if ($this->printFormTag == true) {
         $html .= '<form name="' . $this->formId . '" id="' . $this->formId . '">';
     }
     $html .= $this->filter . $ajaxSubmitStr;
     if ($this->printFormTag == true) {
         $html .= '</form>';
     }
     $html .= '<table id="table_' . $this->formId . '" class="tbl-1 table table-striped table-condensed cf" style="width:100%">';
     $line = 0;
     while ($row = $this->db_queryapplist->next()) {
         $tot_cols = count($row) / 2;
         $head_cols = array();
         // Print header
         if ($line == 0) {
             $html .= '<thead class="cf"><tr>';
             if ($this->enable_buttons) {
                 $html .= '<th style="width:100px;">Accion</th>';
             }
             $col_cnt = 0;
             foreach ($row as $cols => $val) {
                 if ($cols != $this->id_field_name) {
                     $col_cnt++;
                     $html .= '<th>' . self::sort_column($col_cnt, $cols, $this->formId) . '</th>';
                     $head_cols = $cols;
                 }
             }
             $html .= '</tr></thead>';
         }
         //Print rows
         $html .= '<tr>';
         // buttons
         $btns = $this->get_buttons($row);
         if ($btns != '') {
             $html .= '<td>';
             $html .= $btns;
             $html .= '</td>';
         }
         foreach ($row as $cols => $val) {
             if ($cols != $this->id_field_name) {
                 $html .= '<td data-title="' . ucwords($cols) . '">' . $val . '</td>';
             }
         }
         $html .= '</tr>';
         $line++;
     }
     // end while
     $html .= '</table>';
     $html .= $this->pagger;
     $html .= '</div>';
     // Contenedor
     $html .= "<script>\$(function(){ \r\n\t\t\t\$('#table_" . $this->formId . "').setecTable({callback:function(row,objId,rowId){\r\n\t\t\t\t\thref = row.find('td a.btnedit').click();\r\n\t\t\t\t}});\r\n\t\t});</script>";
     return $html;
 }