コード例 #1
0
    public static function showDialog($params = array())
    {
        $width = isset($params['width']) ? $params['width'] : '500';
        $dialogID = isset($params['dialogID']) ? $params['dialogID'] : "id_" . rand(0, 100);
        $icon = isset($params['icon']) ? $params['icon'] : '';
        $title = isset($params['title']) ? $params['title'] : 'NO_TITLE';
        $maxBodyHeight = isset($params['maxBody']) ? $params['maxBody'] : 0;
        $msg = isset($params['message']) ? $params['message'] : 'NO_MSG';
        $buttons = isset($params['buttons']) && is_array($params['buttons']) ? $params['buttons'] : array();
        $auto_open = isset($params['auto_open']) ? $params['auto_open'] : false;
        echo ' <!-- Renderização Modal Dialog -->
		              <div class="ls-modal" id="' . $dialogID . '">
		              <div class="ls-modal-box" ' . (!empty($width) ? "style='width:" . $width . "'" : "") . '>
		                <div class="ls-modal-header">
		                  <button data-dismiss="modal">&times;</button>
		                  <h4 class="ls-modal-title ' . (!empty($icon) ? $icon : '') . '">' . $title . '</h4>
		                </div>
		                <div class="ls-modal-body" ' . ($maxBodyHeight > 0 ? "style='max-height:" . $maxBodyHeight . ";overflow-y:scroll;'" : "") . ' id="alert-modal-Body">';
        echo $msg;
        echo '  </div>
		                <div class="ls-modal-footer">
		       			<div class="popupFormButtons">';
        if (count($buttons)) {
            foreach ($buttons as $index => $button) {
                echo "<button type='" . (isset($button["type"]) ? $button['type'] : 'button') . "' class='ls-btn-primary " . (isset($button["icon"]) && !empty($button["icon"]) ? $button["icon"] : "") . "' " . (isset($button['can_close']) && $button['can_close'] ? " data-dismiss='modal' data-target='#" . $dialogID . "'" : '') . '>' . $button['label'] . "</button>";
            }
        }
        echo '  </div>
		       		   </div>
		              </div>
		            </div><!-- Modal Alert  -->';
        if ($auto_open) {
            SystemHelper::executeJavascript("locastyle.modal.open('#" . $dialogID . "');");
        }
    }
コード例 #2
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => ''));
     echo "<div class='ls-tab-content ls-active' id='infos'>";
     echo '<table class="easy-form-table">';
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('label' => 'Nome', 'name' => 'nome_relatorio', 'value' => $this->fields['nome_relatorio']));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('label' => 'Ícone', 'name' => 'icone', 'value' => $this->fields['icone']));
     echo '</td>';
     echo '</tr>';
     echo '</table>';
     SystemHelper::addSQLTextBox(array('label' => 'Sentença SQL', 'name' => 'sentenca_sql', 'value' => $this->fields['sentenca_sql']));
     echo "</div>";
     echo "<div class='ls-tab-content' id='parameters'>";
     include "ParamTableComponent.php";
     $this->params_table = new ParamTableComponent();
     $this->params_table->show();
     echo "</div>";
     echo "<div class='ls-tab-content' id='headers'>";
     include "HeaderTableComponent.php";
     $this->headers_table = new HeaderTableComponent();
     $this->headers_table->show();
     echo "</div>";
     $this->addButtons();
 }
コード例 #3
0
 public function execute($params = array())
 {
     $id_chart = "chart_container_";
     if (count($params)) {
         $title = isset($params['title']) ? $params['title'] : 'NO_TITLE';
         $id_chart = isset($params['id']) ? $params['id'] : rand(0, 100);
         $type_chart = isset($params['type']) ? $params['type'] : '';
         $data_json = isset($params['data']) ? $params['data'] : '';
         $only_chart = isset($params['onlyChart']) ? $params['onlyChart'] : false;
     } else {
         $title = $this->fields['nome'];
         $id_chart .= rand(0, 100);
         $type_chart = $this->fields['tipo_grafico'];
     }
     if ($this->type == "chart") {
         echo '<div class="chart-box ' . ($only_chart ? 'chart-box-onlychart' : '') . '">';
         if (empty($data_json)) {
             echo "<div class='chart-box-emptydata-message'>";
             echo "<i class='fa fa-frown-o'></i>";
             echo "<strong>Nenhum dado à exibir</strong>";
             echo "</div>";
         } else {
             echo '<canvas id="' . $id_chart . '"></canvas>';
         }
         echo '</div>';
         if (!empty($data_json)) {
             SystemHelper::executeJavascript("\n\t\t\t\t\t var context = document.getElementById('" . $id_chart . "').getContext('2d');\n\t\t\t\t\t var chart_render = new Chart(context);\n\t\t\t\t\t var chart_type = '" . $type_chart . "';\n\t\t\t\t\t \t\t\n\t\t\t\t\t switch(chart_type){\n\t\t\t\t\t \tcase 'bar':\n\t\t\t\t\t \t\tbreak;\n\t\t\t\t\t \tcase 'line':\n\t\t\t\t\t \t\tchart_render.Line(" . $data_json . ");\n\t\t\t\t\t \t\tbreak;\n\t\t\t\t\t \tcase 'donught':\n\t\t\t\t\t \t\tbreak;\n\t\t\t\t\t \tcase 'pie':\n\t\t\t\t\t \t\tchart_render.Pie(" . $data_json . ");\n\t\t\t\t\t \t\tbreak;\n\t\t\t\t\t }");
         }
     }
 }
コード例 #4
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'cliente/atualizar/' . $id : 'cliente/adicionar'));
     echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>";
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Razão Social', 'name' => 'razao_social', 'required' => true, 'value' => $this->fields['razao_social']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Nome Fantasia', 'name' => 'nome_fantasia', 'required' => true, 'value' => $this->fields['nome_fantasia']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'CNPJ', 'name' => 'cnpj', 'required' => true, 'mask' => 'ls-mask-cnpj', 'value' => $this->fields['cnpj']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Inscrição Estadual', 'name' => 'ins_estadual', 'required' => true, 'width' => '130px', 'align' => 'center', 'value' => $this->fields['ins_estadual']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Inscrição Municipal', 'name' => 'ins_municipal', 'required' => true, 'width' => '130px', 'align' => 'center', 'value' => $this->fields['ins_municipal']));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 8, 'value' => $this->fields['observacoes']));
     echo "</div>";
     $type_object = $this->getType();
     echo "<div id='enderecos' class='ls-tab-content' role='tabpanel'>";
     include "Address.php";
     $this->address = new Address();
     $this->load->model("address_model");
     $this->address_model = new Address_Model();
     $addresses = array();
     foreach ($this->address_model->getObjects(array("where" => "cadastro_tipo = '" . $type_object . "' AND conexao_id = '" . $this->objectID . "'")) as $index => $addInfo) {
         $this->address->setID($addInfo['id']);
         $addresses[] = array($addInfo['nome_endereco'], $addInfo['endereco_cep'], $addInfo['endereco'] . " " . $addInfo['endereco_numero'] . ", " . $addInfo['endereco_complemento'], array("edit_button" => $this->address->getActionOptions()["actions"][0], "remove_button" => $this->address->getActionOptions()["actions"][1]));
     }
     $this->address->redefineActionsURL($type_object, $this->objectID);
     $this->address->showListPanel(array('title' => 'Endereços', 'id' => 'endereco', 'add_button' => $this->address->getActionOptions()["add"], 'headers' => array('Nome', 'CEP', 'Endereço', ''), 'list' => $addresses));
     echo "<br>";
     include "Contact.php";
     $this->contact = new Contact();
     $this->load->model("contact_model");
     $this->contact_model = new Contact_Model();
     $contacts = array();
     foreach ($this->contact_model->getObjects(array("where" => "cadastro_tipo = '" . $type_object . "' AND conexao_id = '" . $this->objectID . "'")) as $index => $contactInfo) {
         $this->contact->setID($contactInfo['id']);
         $contacts[] = array($contactInfo['nome_contato'], $contactInfo['tel_casa'], $contactInfo['tel_cel'], $contactInfo['tel_outro'], $contactInfo['contato_email'], array("edit_button" => $this->contact->getActionOptions()["actions"][0], "remove_button" => $this->contact->getActionOptions()["actions"][1]));
     }
     $this->contact->redefineActionsURL($type_object, $this->objectID);
     $this->contact->showListPanel(array('title' => 'Contatos', 'id' => 'contatos', 'headers' => array('Nome', 'Tel Casa', 'Cel 1', 'Cel 2', 'Email', ''), 'add_button' => $this->contact->getActionOptions()["add"], 'list' => $contacts));
     echo "</div>";
     $this->addButtons();
 }
コード例 #5
0
ファイル: Helper.php プロジェクト: stanislavdev1993/task
 /**
  * @param $field
  * @param null|string $lang
  * @return string
  */
 public static function lang($field, $lang = 'ru')
 {
     if (isset($_GET['lang'])) {
         $lang = $_GET['lang'];
     }
     if (self::$langObj === null) {
         self::$langObj = new Lang($lang);
     }
     return self::$langObj->getField($field);
 }
コード例 #6
0
 public function showForm($id = -1)
 {
     $this->load->model("product_model", "product_manager");
     $products = array();
     foreach ($this->product_manager->getObjects() as $index => $productInfo) {
         $products[] = array("label" => $productInfo['nome'], "value" => $productInfo['id']);
     }
     SystemHelper::addCombobox(array('label' => 'Produto/Serviço', 'name' => 'task_select_product', 'options' => $products));
     SystemHelper::addTextfield(array('label' => 'Quantidade', 'name' => 'task_select_quantity', 'width' => '80px', 'align' => 'center'));
     SystemHelper::addButton(array('label' => 'Adicionar', 'onClick' => '$futuri.addProductTask();', 'data' => array('popupcloser' => true)));
     SystemHelper::addButton(array('label' => 'Cancelar', 'data' => array('popupcloser' => true)));
 }
コード例 #7
0
ファイル: Helper.php プロジェクト: PashaShunkow/Timetable-2
 /**
  * Return base app dir
  *
  * @return string
  */
 public static function getBaseDir()
 {
     if (self::$_appRoot) {
         return self::$_appRoot;
     }
     $appRoot = realpath(dirname(''));
     if (is_dir($appRoot) and is_readable($appRoot)) {
         self::$_appRoot = $appRoot;
         return self::$_appRoot;
     } else {
         die($appRoot . ' is not a directory or not readable by this user');
     }
 }
コード例 #8
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => "post", "action" => $this->getType() . "/adicionar"));
     echo "<div class='ls-tab-content ls-active' role='tabpanel' id='infos'>";
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Nome da nacionalidade', 'name' => 'nome'));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     echo "</div>";
     $this->addButtons();
 }
コード例 #9
0
ファイル: ManageController.php プロジェクト: vman747/virex
 public function actionIndex($ajax = null)
 {
     $load = SystemHelper::getLoad();
     $totalspace = disk_total_space(VIREX_STORAGE_PATH);
     $freespace = disk_free_space(VIREX_STORAGE_PATH);
     $slov = new ProgressBar(100, $load, 150);
     $slov->suff = '';
     $slov->doneBg = '#9BB947';
     $duov = new ProgressBar($totalspace, $totalspace - $freespace, 150);
     $duov->suff = '';
     $duov->doneBg = '#9BB947';
     $sysHealth = array(array('id' => 2, 'Property' => 'Operating System', 'Value' => PHP_OS, 'Overview' => ''), array('id' => 3, 'Property' => 'Web server', 'Value' => $_SERVER["SERVER_SOFTWARE"], 'Overview' => ''), array('id' => 4, 'Property' => 'PHP version', 'Value' => PHP_VERSION, 'Overview' => ''), array('id' => 5, 'Property' => 'MySQL version', 'Value' => Yii::app()->db->serverVersion, 'Overview' => ''), array('id' => 1, 'Property' => 'Storage space', 'Value' => FileHelper::formatSize($totalspace - $freespace) . ' / ' . FileHelper::formatSize($totalspace), 'Overview' => $duov->display()), array('id' => 6, 'Property' => 'System load / CPU usage', 'Value' => '', 'Overview' => $slov->display()));
     $this->render('index', array('systemHealth' => new CArrayDataProvider($sysHealth)));
 }
コード例 #10
0
 public function getFields()
 {
     include "application/helpers/system_helper.php";
     include "ParamTableComponent.php";
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'header_name[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'header_type', 'options' => ParamTableComponent::$types));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'header_align', 'options' => $this->aligns));
     echo '</td>';
     echo '<td>';
     SystemHelper::addIconButton(['icon' => 'fa fa-times', 'onClick' => '$paramTable.removeFields(this);', 'tooltip' => 'Remover', 'tooltip-align' => 'right']);
     echo '</td>';
     echo '</tr>';
 }
コード例 #11
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'produto/atualizar/' . $id : 'produto/adicionar'));
     echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>";
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Produto / Serviço', 'name' => 'nome', 'value' => $this->fields['nome']));
     echo "</td>";
     echo "<td>";
     $fornecedor_options = array();
     $this->load->model("supplier_model");
     foreach ($this->supplier_model->getObjects() as $index => $supInfo) {
         $fornecedor_options[] = array("value" => $supInfo['id'], "label" => $supInfo['nome_fantasia']);
     }
     SystemHelper::addCombobox(array('label' => 'Fornecedor', 'name' => 'fornecedor_id', 'options' => $fornecedor_options, 'value' => $this->fields['fornecedor_id']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Quantidade', 'name' => 'quantidade', 'align' => 'right', 'value' => $this->fields['quantidade']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Valor Unitário (R$)', 'name' => 'valor_unitario', 'align' => 'right', 'mask' => 'ls-mask-money', 'value' => $this->fields['valor_unitario']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Valor Total (R$)', 'name' => 'valor', 'align' => 'right', 'mask' => 'ls-mask-money', 'value' => $this->fields['valor']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addDatefield(array('label' => 'Data da compra', 'name' => 'dt_compra', 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_compra']), 'useIcon' => true));
     echo "</td>";
     echo "<td>";
     SystemHelper::addDatefield(array('label' => 'Data do recebimento', 'name' => 'dt_entrega', 'width' => '140px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_entrega']), 'useIcon' => true));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 8, 'value' => $this->fields['observacoes']));
     echo "</div>";
     $this->addButtons();
 }
コード例 #12
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? "grafico/atualizar/" . $id : "grafico/adicionar"));
     echo "<div class='ls-tab-content ls-active' id='infos'>";
     echo '<table class="easy-form-table">';
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('label' => 'Nome', 'name' => 'nome_grafico', 'value' => $this->fields['nome_grafico']));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('label' => 'Ícone', 'name' => 'icone', 'value' => $this->fields['icone']));
     echo '</td>';
     echo '</tr>';
     echo '</table>';
     SystemHelper::addSQLTextBox(array('label' => 'Sentença SQL', 'name' => 'sentenca_sql', 'value' => $this->fields['sentenca_sql']));
     echo "</div>";
     echo "<div class='ls-tab-content' id='parameters'>";
     include "ParamTableComponent.php";
     $this->params_table = new ParamTableComponent();
     $this->params_table->show(array("cadastro_tipo" => $this->getType(), "conexao_id" => $this->objectID));
     echo "</div>";
     $this->addButtons();
 }
コード例 #13
0
 public function getFields()
 {
     include "application/helpers/system_helper.php";
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_displayname[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_name[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'param_type[]', 'options' => self::$types));
     echo '</td>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_default[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addYesNoToggle(array('name' => 'param_userinput[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addIconButton(['icon' => 'fa fa-times', 'onClick' => '$paramTable.removeFields(this);', 'tooltip' => 'Remover', 'tooltip-align' => 'right']);
     echo '</td>';
     echo '</tr>';
 }
コード例 #14
0
 public function getAsyncSearch($field_name = '', $value = '')
 {
     $data_type = $this->loadedModel->getDataTypeForField($field_name);
     switch ($data_type) {
         case SystemHelper::DATATYPE_DATE:
             SystemHelper::addDatefield(array('name' => 'search_value[]', 'useIcon' => true, 'value' => $value, 'width' => '140px'));
             break;
         case SystemHelper::DATATYPE_MONETARY:
             SystemHelper::addTextfield(array('name' => 'search_value[]', 'value' => $value, 'mask' => 'ls-mask-money'));
             break;
         case SystemHelper::DATATYPE_CNPJ:
             SystemHelper::addTextfield(array('name' => 'search_value[]', 'value' => $value, 'mask' => 'ls-mask-cnpj'));
             break;
         default:
             SystemHelper::addTextfield(array('value' => $value, 'name' => 'search_value[]'));
             break;
     }
 }
コード例 #15
0
 public function getAsyncSearch($fieldname = '', $fieldvalue = '')
 {
     switch ($fieldname) {
         case "sexo":
             $this->load->model("sexo_model");
             $opt = array();
             foreach ($this->sexo_model->getObjects() as $index => $sexInfo) {
                 $opt[] = array("label" => $sexInfo['nome'], "value" => $sexInfo['id']);
             }
             SystemHelper::addCombobox(array('name' => 'search_value[]', 'value' => $fieldvalue, 'options' => $opt));
             break;
         case "perfil":
             $this->load->model("profiletype_model");
             $opt = array();
             foreach ($this->profiletype_model->getObjects() as $index => $profileInfo) {
                 $opt[] = array("label" => $profileInfo['nome'], "value" => $profileInfo['id']);
             }
             SystemHelper::addCombobox(array('name' => 'search_value[]', 'value' => $fieldvalue, 'options' => $opt));
             break;
         case "status":
             $this->load->model("castingstatus_model");
             $opt = array();
             foreach ($this->castingstatus_model->getObjects() as $index => $statusInfo) {
                 $opt[] = array("label" => $statusInfo['nome'], "value" => $statusInfo['id']);
             }
             SystemHelper::addCombobox(array('name' => 'search_value[]', 'value' => $fieldvalue, 'options' => $opt));
             break;
         case "cor_cabelo":
             $this->load->model("haircolor_model");
             $opt = array();
             foreach ($this->haircolor_model->getObjects() as $index => $hairInfo) {
                 $opt[] = array("label" => $hairInfo['nome'], "value" => $hairInfo['id']);
             }
             SystemHelper::addCombobox(array('name' => 'search_value[]', 'value' => $fieldvalue, 'options' => $opt));
             break;
         case "cor_pele":
             $this->load->model("skincolor_model");
             $opt = array();
             foreach ($this->skincolor_model->getObjects() as $index => $skinInfo) {
                 $opt[] = array("label" => $skinInfo['nome'], "value" => $skinInfo['id']);
             }
             SystemHelper::addCombobox(array('name' => 'search_value[]', 'value' => $fieldvalue, 'options' => $opt));
             break;
         default:
             parent::getAsyncSearch($fieldname, $fieldvalue);
             break;
     }
 }
コード例 #16
0
 public function createBackupFile($params = array())
 {
     $zip = new ZipArchive();
     $file_name_zip = "easycasting_backup_" . date('Y_m_d_H_i') . ".zip";
     $this->generated_filename = $file_name_zip;
     $zip->open($this->backup_folder . $file_name_zip, ZipArchive::CREATE);
     if (isset($params['database']) && $params['database']) {
         $zip->addEmptyDir("banco_dados");
         try {
             $this->load->dbutil();
             $file_name_sql = "easycasting_backup_" . date('Y_m_d_H_i') . ".sql";
             $backup_content = $this->dbutil->backup(array('format' => 'txt'));
             $zip->addFromString("banco_dados/" . $file_name_sql, $backup_content);
         } catch (Exception $e) {
             echo $e->getMessage();
             SystemHelper::continuePopupWindow();
         }
     }
     $files_casting = isset($params['casting_files']) && $params['casting_files'] ? true : false;
     $files_doc = isset($params['document_files']) && $params['document_files'] ? true : false;
     if ($files_casting || $files_doc) {
         $zip->addEmptyDir("arquivos");
     }
     if ($files_casting) {
         $zip->addEmptyDir("arquivos/fotos_casting");
         $scan_dir = array_diff(scandir("assets/pictures"), array("..", "."));
         foreach ($scan_dir as $index => $file_casting) {
             try {
                 $f_name = "assets/pictures/" . $file_casting;
                 $file_opened = fopen($f_name, "rb");
                 ini_set('memory_limit', '-1');
                 $content_file = fread($file_opened, filesize($f_name));
                 fclose($file_opened);
                 $zip->addFromString("arquivos/fotos_casting/" . $file_casting, $content_file);
                 unset($content_file);
             } catch (Exception $ex) {
                 echo $ex->getMessage();
                 SystemHelper::continuePopupWindow();
             }
         }
     }
     if ($files_doc) {
         $zip->addEmptyDir("arquivos/documentos");
         $scan_dir = array_diff(scandir("assets/files"), array("..", "."));
         foreach ($scan_dir as $index => $file_doc) {
             try {
                 $zip->addFromString("arquivos/documentos/" . $file_doc, file_get_contents("assets/files/" . $file_doc));
             } catch (Exception $ex) {
                 echo $ex->getMessage();
                 SystemHelper::continuePopupWindow();
             }
         }
     }
     $zip->close();
     return true;
 }
コード例 #17
0
ファイル: index.php プロジェクト: lucasmattos/crm
$ignore = array('desc', 'dbName', 'hostName', 'dbUserName', 'dbUserPass', 'dbDriver');
if (!empty($_REQUEST)) {
    foreach ($_REQUEST as $key => $val) {
        if (!in_array($val, $ignore)) {
            $_SESSION['install'][$key] = trim($val);
        }
    }
}
// get user selected language
$userLang = !empty($_SESSION['install']['user-lang']) ? $_SESSION['install']['user-lang'] : 'en_US';
require_once 'core/Language.php';
$language = new Language();
$langs = $language->get($userLang);
//END: get user selected language
require_once 'core/SystemHelper.php';
$systemHelper = new SystemHelper();
if (!$systemHelper->initWritable()) {
    $dir = $systemHelper->getWritableDir();
    $message = $langs['messages']['Bad init Permission'];
    $message = str_replace('{*}', $dir, $message);
    $message = str_replace('{C}', $systemHelper->getPermissionCommands(array($dir, ''), '775'), $message);
    $message = str_replace('{CSU}', $systemHelper->getPermissionCommands(array($dir, ''), '775', true), $message);
    die($message);
}
require_once 'install/vendor/smarty/libs/Smarty.class.php';
require_once 'core/Installer.php';
$smarty = new Smarty();
$installer = new Installer();
// check if app was installed
if ($installer->isInstalled() && !isset($_SESSION['install']['installProcess'])) {
    $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
コード例 #18
0
        if ($p >= $pager_interval) {
            break;
        }
    }
    if ($controller->selectedPage < $pager_interval) {
        echo '<li>';
        echo "<form method='post'>";
        echo "<a href='#' onClick='this.parentNode.submit();'>";
        if ($input->post("search_field")) {
            foreach ($input->post("search_field") as $ind => $search_field) {
                SystemHelper::addHiddenfield('', 'search_field[]', $search_field);
                SystemHelper::addHiddenfield('', 'search_value[]', $input->post("search_value")[$ind]);
            }
        }
        SystemHelper::addHiddenfield('', 'pager_limit', $controller->selectedPagerLimit);
        SystemHelper::addHiddenfield('', 'pager_page', $controller->selectedPage + 1);
        echo "Próxima &raquo;</a>";
        echo "</form>";
        echo '</li>';
    } else {
        echo '<li class="ls-disabled"><a href="#">Próxima &raquo;</a></li>';
    }
    ?>
					  </ul>
				</div>
		   </div>
		</div>
		<?php 
}
?>
	</div>
コード例 #19
0
 public function showForm($user_id = -1)
 {
     include_once "Casting.php";
     include_once "Client.php";
     include_once "Supplier.php";
     include_once "Product.php";
     include_once "Task.php";
     include_once "User.php";
     include_once "Eyecolor.php";
     include_once "Job.php";
     include_once "Haircolor.php";
     include_once "Profiletype.php";
     include_once "Skincolor.php";
     include_once "Relationship.php";
     include_once "Languages.php";
     include_once "Nationality.php";
     $this->prepareForm(-1, array('method' => 'post', 'includeTabs' => false, 'action' => base_url() . 'permissoes/aplicar/' . $user_id));
     $user = new User($user_id);
     if ($user->fields['administrador']) {
         AlertMessage::display(array("type" => AlertMessage::INFO, "msg" => "O usuário <b>" . $user->fields['usuario'] . "</b> é administrador, possui sempre permissão em tudo", "icon" => "ls-ico-info"));
     }
     echo "<ul id='tree_view_permissions' class='navmenu dree treeview treeviewPermissions'>";
     echo '<a name="topMenuTerrace" id="topMenuTerrace"></a>';
     echo '<li>Casting';
     echo "<ul>";
     $casting = new Casting();
     $casting->defineActionOptions();
     $actions = $casting->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     $perm_name = $actions["edit"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "<li>Perfil";
     echo "<ul>";
     $profile_type = new Profiletype();
     $profile_type->defineActionOptions();
     $actions = $profile_type->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Cores de cabelo";
     echo "<ul>";
     $casting_hair = new Haircolor();
     $casting_hair->defineActionOptions();
     $actions = $casting_hair->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Cores de olhos";
     echo "<ul>";
     $casting_eye = new Eyecolor();
     $casting_eye->defineActionOptions();
     $actions = $casting_eye->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Etnias";
     echo "<ul>";
     $etnias = new Skincolor();
     $etnias->defineActionOptions();
     $actions = $etnias->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Nacionalidades";
     echo "<ul>";
     $nationality = new Nationality();
     $nationality->defineActionOptions();
     $actions = $nationality->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Estado cívil";
     echo "<ul>";
     $relationship = new Relationship();
     $relationship->defineActionOptions();
     $actions = $relationship->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Idiomas";
     echo "<ul>";
     $languages = new Languages();
     $languages->defineActionOptions();
     $actions = $languages->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "<li>Função";
     echo "<ul>";
     $job = new Job();
     $job->defineActionOptions();
     $actions = $job->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo "</li>";
     echo "</ul>";
     echo '</li>';
     echo '<li>Clientes';
     echo "<ul>";
     $client = new Client();
     $client->defineActionOptions();
     $actions = $client->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     $perm_name = $actions["edit"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action['permName'];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo '</li>';
     echo '<li>Fornecedores';
     echo "<ul>";
     $supplier = new Supplier();
     $supplier->defineActionOptions();
     $actions = $supplier->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     $perm_name = $actions["edit"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action["permName"];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo '</li>';
     echo '<li>Produtos/Serviços';
     echo "<ul>";
     $product = new Product();
     $product->defineActionOptions();
     $actions = $product->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     $perm_name = $actions["edit"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action["permName"];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo '</li>';
     echo '<li>Trabalhos';
     echo "<ul>";
     $task = new Task();
     $task->defineActionOptions();
     $actions = $task->getActionOptions();
     $perm_name = $actions["add"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>";
     $perm_name = $actions["edit"]["permName"];
     echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>";
     foreach ($actions["actions"] as $index => $action) {
         $perm_name = $action["permName"];
         echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>";
     }
     echo "</ul>";
     echo '</li>';
     /*echo '<li>Gráficos/Relatórios';
     			echo "<ul>";
     				echo '<li>Executar</li>';
     			echo "</ul>";
     		echo '</li>';*/
     echo "</ul>";
     SystemHelper::addSubmitButton(array('label' => 'Aplicar', 'icon' => 'ls-ico-checkmark'));
     SystemHelper::addButton(array('label' => 'Cancelar', 'data' => array('popupcloser' => true), 'icon' => 'ls-ico-close'));
 }
コード例 #20
0
ファイル: AFileArchive.php プロジェクト: vman747/virex
 public function extract_file($fname, $detection, $type, $nobogus = false, $bogus_id = null)
 {
     SystemHelper::emptyDir($this->unpacker->outputDir);
     $this->unpacker->reInit();
     $this->unpacker->archivePath = $fname;
     $this->unpacker->unpack();
     if (!$this->unpacker->hadError()) {
         $qstat = "INSERT INTO permanent_statistics_ftp_psf (date_psf, hour_psf, archives_number_psf)\r\n                VALUES (CURDATE(), HOUR(NOW()), 1) ON DUPLICATE KEY UPDATE archives_number_psf = archives_number_psf + 1";
         Yii::app()->db->createCommand($qstat)->execute();
         foreach ($this->unpacker->getFiles() as $f) {
             $fName = $f['path'];
             if (!file_exists($fName)) {
                 continue;
             }
             $md5 = md5_file($fName);
             $file = $this->ascii2hex($md5);
             $dir = $this->makedir($file, VIREX_STORAGE_PATH . DIRECTORY_SEPARATOR . $detection . DIRECTORY_SEPARATOR);
             if (rename($fName, $dir . $file)) {
                 // if error occurs is capture by main method ( scan_archives )
                 $this->save_to_db($detection, $type, $md5, filesize($dir . $file));
             }
         }
     } else {
         $this->error_count++;
         // increase error count
         $e = $this->unpacker->getError();
         ALogger::error('Unpacker:' . $e[0] . ':' . $e[1]);
         // logging error
         if (!$nobogus) {
             // if I have to move file to bogus
             $this->move_file_to_bogus($detection, $type, $fname, $e[0] . ':' . $e[1]);
         } else {
             $this->move_file_to_bogus($detection, $type, $fname, $e[0] . ':' . $e[1], $bogus_id);
         }
         SystemHelper::emptyDir($this->unpacker->outputDir);
         return false;
     }
     SystemHelper::emptyDir($this->unpacker->outputDir);
     return true;
 }
コード例 #21
0
<?php

echo SystemHelper::getTopo("..::Cadastro usuário::..");
echo PaginaHelper::getLayout();
?>
 
<div class="row">
	  <div class="col-md-offset-1 col-md-10">
		<h1>Usuário <small>/ Cadastro</small></h1>
		<ol class="breadcrumb">
		  <li><a href="home"><i class="icon-dashboard"></i> home</a></li>
		  <li class="active"><i class="icon-file-alt"></i>Usuário / Formulário usuário</li>
		</ol>
			<?php 
echo UsuarioHelper::getFormularioUsuario();
?>
 
	 </div>
</div><!-- /.row -->

<?php 
echo PaginaHelper::getWrapper();
コード例 #22
0
ファイル: AUnpacker.php プロジェクト: vman747/virex
 public function unpack($justReturnList = false)
 {
     if ($this->debug) {
         if (!$justReturnList) {
             echo "\n\nWill unpack archive {$this->archivePath}!\n";
         } else {
             echo "\n\nWill return listing for archive {$this->archivePath}!\n";
         }
     }
     if (!$justReturnList) {
         if (!$this->init()) {
             return false;
         }
         if (!$this->r_levels) {
             return true;
         }
     }
     if ($this->debug) {
         echo 'Getting file type for: ' . $this->archivePath . "\n";
     }
     if (false == ($fileType = $this->getArchiveType($this->archivePath))) {
         return false;
     }
     $fullOutputPath = '';
     if (!$justReturnList) {
         $md5 = md5(uniqid());
         $this->subfolder = $md5;
         $fullOutputPath = $this->outputDir . '/' . $md5;
         if (!mkdir($fullOutputPath)) {
             $this->errorCode = '103';
             $this->errorOutput = "Can't mkdir " . $fullOutputPath . '!';
             return false;
         }
     }
     switch ($fileType) {
         case "7z":
         case "zip":
         case "gzip":
         case "tar":
             $statFunction = 'get7zStat';
             if (!empty($this->archive_password)) {
                 $password_command = '-p' . $this->archive_password . ' ';
             } else {
                 $password_command = '-p';
             }
             $unpackCommand = "7z e -o" . escapeshellarg($fullOutputPath) . " {$password_command} -aou " . self::escapeFilePath($this->archivePath);
             //self::escapeFilePath();
             break;
         case "rar":
             $statFunction = 'getRarStat';
             if (!empty($this->archive_password)) {
                 $password_command = '-p' . $this->archive_password . ' ';
             } else {
                 $password_command = '-p-';
             }
             $unpackCommand = "unrar e -or {$password_command} " . escapeshellarg($this->archivePath) . " " . self::escapeFilePath($fullOutputPath);
             break;
         default:
             $this->errorCode = '203';
             if (isset($gpg_command)) {
                 $this->errorOutput = "Can not determine archive type correctly! Possible GPG fault! GPG output has size:" . filesize($this->archivePath);
             } else {
                 $this->errorOutput = "Can not determine archive type correctly!";
             }
             return false;
     }
     //end::switch($fileType)
     if ($justReturnList) {
         return call_user_func(array($this, $statFunction), $this->archivePath, $this->archive_password, true);
     }
     if (false !== ($stat = call_user_func(array($this, $statFunction), $this->archivePath, $this->archive_password))) {
         list($nr_files, $unpacked_size) = $stat;
     } else {
         return false;
     }
     if ($nr_files > $this->max_files) {
         $this->errorCode = '301';
         $this->errorOutput = "Too many files! ({$nr_files} vs {$this->max_files})";
         return false;
     }
     $unpacked_size = $unpacked_size / (1024 * 1024);
     if ($unpacked_size > $this->max_size) {
         $this->errorCode = '302';
         $this->errorOutput = "Size exceeded! ({$unpacked_size} vs {$this->max_size})";
         return false;
     }
     if ($this->debug) {
         echo "Found {$unpacked_size} smaller then {$this->max_size}\n";
     }
     if ($this->debug) {
         echo $unpackCommand . "\n";
     }
     exec($unpackCommand . ' 2>&1', $output, $errorCode);
     if ($errorCode) {
         $this->errorCode = "{$fileType}:{$errorCode}";
         $this->errorOutput = substr(implode(" ", $output), -200);
         if ($this->debug) {
             echo "Emptying " . $fullOutputPath . "\n";
         }
         SystemHelper::emptyDir($fullOutputPath);
         return false;
     }
     //        $command = "find {$fullOutputPath} -print -exec chmod -R 0755 '{}' \;";
     //        if ($this->debug)
     //            echo($command . "\n");
     //        exec($command, $output, $errorCode);
     $recurse = $nr_files < self::MAX_RECURSE_FILES && $this->r_levels > 1;
     $d = dir($fullOutputPath);
     while (false !== ($entry = $d->read())) {
         if ($entry != "." && $entry != "..") {
             $curFile = $fullOutputPath . '/' . $entry;
             if ($this->debug) {
                 echo '--->' . $curFile . "\n";
             }
             //			fwrite(STDOUT, "Press any key to continue...");
             //			$junk = trim(fgets(STDIN));
             if (is_dir($curFile)) {
                 @rmdir($curFile);
                 continue;
             }
             //this is because 7z also creates the folders....
             $add_file = true;
             $is_archive = false;
             if ($this->getArchiveType($curFile, $this->handle_recursive_gpg, false)) {
                 $is_archive = true;
                 if ($recurse) {
                     $up = new AUnpacker($this, $unpacked_size - filesize($curFile) / (1024 * 1024), $nr_files - 1);
                     $up->build_files_array = $this->build_files_array;
                     $up->archivePath = $curFile;
                     $up->unpack();
                     if ($up->hadError()) {
                         list($errorCode, $errorOutput) = $up->getError();
                         if ($this->debug) {
                             echo "\nUnpacker for {$curFile} finished with error code {$errorCode} : {$errorOutput}\n";
                         }
                         $up_full_path = $up->outputDir . '/' . $up->getSubfolder();
                         unset($output);
                         if ($this->debug) {
                             echo "Emptying " . $up_full_path . "\n";
                         }
                         SystemHelper::emptyDir($up_full_path);
                     } else {
                         $this->files = array_merge($this->files, $up->getFiles());
                         $add_file = false;
                     }
                 }
                 //if recurse
             }
             if ($add_file && $this->build_files_array) {
                 $nr_files = count($this->files);
                 $this->files[$nr_files]['path'] = $curFile;
                 $this->files[$nr_files]['mime'] = FileHelper::fileMime($curFile);
                 $this->files[$nr_files]['is_archive'] = $is_archive;
             }
         }
     }
     $d->close();
     if (!$this->hadError() && $this->delete_archive) {
         if ($this->debug) {
             echo "Deleting {$this->archivePath}...\n";
         }
         if (!@unlink($this->archivePath)) {
             trigger_error("Unable to delete file {$this->archivePath} !");
         }
     }
     return true;
 }
コード例 #23
0
 public function getObjectsList($whereList = array(), $limit = 10, $offset = 0)
 {
     $this->load->database();
     $fields_query = $this->createFieldsListString();
     $this->db->select($fields_query["fields_list"]);
     if (count($fields_query["join_list"])) {
         foreach ($fields_query["join_list"] as $index => $join_field) {
             $condition = $join_field['table'] . "." . $join_field['field'] . " = " . $join_field['join_table'] . "." . $join_field['join_field'];
             $this->db->join($join_field['join_table'], $condition, $join_field['type']);
         }
     }
     if (count($whereList)) {
         foreach ($whereList as $where_field => $where_opt) {
             switch ($where_opt['data_type']) {
                 case SystemHelper::DATATYPE_DATE:
                     $where_opt['value'] = SystemHelper::convertDateFromBR($where_opt['value']);
                     if (isset($where_opt['or_where']) && $where_opt['or_where']) {
                         $this->db->or_where(array($where_field => $where_opt['value']));
                     } else {
                         $this->db->where(array($where_field => $where_opt['value']));
                     }
                     break;
                 case SystemHelper::DATATYPE_TEXT:
                     if (isset($where_opt['or_where']) && $where_opt['or_where']) {
                         $this->db->or_like($where_field, $where_opt['value']);
                     } else {
                         $this->db->like($where_field, $where_opt['value']);
                     }
                     break;
             }
         }
     }
     if ($this->debugMode) {
         AlertMessage::display(array('type' => AlertMessage::INFO, 'icon' => 'fa fa-bug', 'message' => '<b>SQL Debug:</b> <br><br>' . $this->db->get_compiled_select($this->getTable())));
     }
     // $limit = -1 is infinite
     if ($limit > -1) {
         if ($offset > 0) {
             $result = $this->db->get($this->getTable(), $limit, $offset);
         } else {
             $result = $this->db->get($this->getTable(), $limit);
         }
     } else {
         $result = $this->db->get($this->getTable());
     }
     $this->db->close();
     return $result->result_array();
 }
コード例 #24
0
                }
                echo SystemHelper::addPopupActionLink(array('label' => $val_col, 'url' => $edit_opt['url'], 'data' => $data_popup));
            } else {
                echo $val_col;
            }
            echo "</td>";
        }
        echo "<td class='actionColumn'>";
        if (isset($obj->getActionOptions()["actions"])) {
            foreach ($obj->getActionOptions()["actions"] as $index => $action) {
                $perm_name = isset($action['permName']) && !empty($action['permName']) ? $action['permName'] : $obj->getType() . '_action_' . $index;
                if (!Permission::havePermission($perm_name)) {
                    unset($obj->getActionOptions["actions"][$index]);
                }
            }
            SystemHelper::addDropdown(array('icon' => 'ls-ico-cog', 'options' => $obj->getActionOptions()["actions"]));
        }
        echo "</td>";
        echo "</tr>";
    }
    echo "</tbody>";
    echo "</table>";
} else {
    $controller->load->view("nodata_error");
}
?>
			</table>
		</div>
		<script type="text/javascript">
			$("#dataview-table").DataTable({
				'lengthMenu':[10, 25, 50, 100, 300, 500],
コード例 #25
0
<?php

echo SystemHelper::getTopo("..::Restrito | ADM::..");
echo PaginaHelper::getLayout();
?>

<?php 
$id = $_GET['id'];
?>

<div class="row">
	    <div class="col-md-offset-1 col-md-10">
			<h1>usuário <small>/ Excluir</small></h1>
			<ol class="breadcrumb">
			  <li><a href="home"><i class="icon-dashboard"></i> Home</a></li>
			  <li class="active"><i class="icon-file-alt"></i>Usuário / <a href="listarExcluirProduto">Excluir</a> / status de exclusão</li>
			</ol>
			<div class="alert alert-dismissable alert-success">
				<?php 
echo UsuarioHelper::ExcluirUsuario();
?>
			   <br/><br/>
			   <a href="formularioUsuario" class="btn btn-success"> Cadastrar usuário</a>
			   <a href="listarAlterarUsuario" class="btn btn-primary"> Alterar / Excluir  usuários</a>
		   </div>
	    </div>
</div><!-- /.row -->

<?php 
echo PaginaHelper::getWrapper();
?>
コード例 #26
0
 public function getBanks($id_casting = -1)
 {
     include_once "Casting.php";
     $this->load->model("bankaccount_model", "bankaccount_model");
     $options = array();
     $each_bank_option = array();
     foreach ($this->bankaccount_model->getObjects(array("where" => "cadastro_tipo = 'Casting' AND conexao_id = " . $id_casting)) as $index => $bankInfo) {
         $options[] = SystemHelper::createComboboxOption($bankInfo['id'], $bankInfo['nome_titular']);
         $each_bank_option[$bankInfo['id']] = ["banco" => $bankInfo['banco_nome'], "agencia" => $bankInfo['banco_agencia'], "conta" => $bankInfo["banco_conta"]];
     }
     $data = array();
     $data["combox"] = SystemHelper::addCombobox(array('label' => 'Conta Bancária', 'name' => 'trabalho_select_bank', 'onChange' => '$futuri.displayAccountInfo(this);', 'returnHTML' => true, 'options' => $options));
     $data["banco_infos"] = $each_bank_option;
     $casting = new Casting($id_casting);
     $data["profile_image"] = "assets/pictures/" . $casting->fields['foto'];
     echo json_encode($data);
 }
コード例 #27
0
 public function logout()
 {
     FUTURI_Session::finalize();
     SystemHelper::executeJavascript("window.location = '" . base_url() . "login" . "'");
 }
コード例 #28
0
 public function processRemove($id = -1)
 {
     parent::processRemove($id);
     SystemHelper::preventPopupRefreshPage();
 }
コード例 #29
0
 public function beforeAdd($FORMDATA)
 {
     if (!isset($FORMDATA['administrador'])) {
         $FORMDATA['administrador'] = false;
     }
     if (!empty($FORMDATA['senha'])) {
         $FORMDATA['senha'] = md5($FORMDATA['senha']);
         unset($FORMDATA['senha_confirmacao']);
     } else {
         unset($FORMDATA['senha']);
         unset($FORMDATA['senha_confirmacao']);
     }
     if (!empty($FORMDATA['dt_nasc'])) {
         $FORMDATA['dt_nasc'] = SystemHelper::convertDateFromBR($FORMDATA['dt_nasc']);
     }
     return $FORMDATA;
 }
コード例 #30
0
ファイル: AUrlArchive.php プロジェクト: vman747/virex
 /**
  *
  * @param <string> $file
  */
 public function read_archive($file)
 {
     $this->unpacker->archivePath = $file;
     $error = false;
     $this->unpacker->unpack();
     if ($this->unpacker->hadError()) {
         $e = $this->unpacker->getError();
         ALogger::error('Unpacker: ' . $e[0] . ':' . $e[1]);
         $this->last_error = 'Unpacker: ' . $e[0] . ':' . $e[1];
         SystemHelper::emptyDir($this->unpacker->outputDir);
         if ($errorCode) {
             ALogger::error('Error cleaning extract folder ' . implode('|', $output), true);
         }
         return false;
     }
     $ok = true;
     foreach ($this->unpacker->getFiles() as $f) {
         if (!$this->check_file($f['path'], $f['mime'])) {
             $ok = false;
             break;
         }
     }
     if (!$ok) {
         foreach ($this->unpacker->getFiles() as $f) {
             unlink($f['path']);
         }
         // clean folder
         SystemHelper::emptyDir($this->unpacker->outputDir);
         if ($errorCode) {
             ALogger::error('Error cleaning extract folder ' . implode('|', $output), true);
         }
     } else {
         foreach ($this->unpacker->getFiles() as $f) {
             $this->read_file($f['path'], $f['mime']);
         }
         SystemHelper::emptyDir($this->unpacker->outputDir);
         if ($errorCode) {
             ALogger::error('Error cleaning extract folder ' . implode('|', $output), true);
         }
     }
     //perform cleanup:
     SystemHelper::emptyDir($this->unpacker->outputDir);
     if (count(scandir($this->unpacker->outputDir)) > 2) {
         ALogger::error('Error cleaning extract folder' . implode('|', $output), true);
     }
     return $ok;
 }