private function _readQuaTrinh() { $quatrinh_id = JRequest::getInt('id', 0); // $model = JModelLegacy::getInstance('Tochuc','TochucModel'); $model = Core::model('Tochuc/Tochuc'); $mapperFile = Core::model('Core/Attachment'); $row = $model->getOneQuaTrinhById($quatrinh_id); $dept = Core::read('ins_dept', array('id = ' => $row['dept_id'])); $row['vanban'] = TochucHelper::getVanBanById($row['vanban_id']); $row['file'] = $mapperFile->getRowByObjectIdAndTypeId($row['vanban_id'], 1); $row['hieuluc_ngay'] = TochucHelper::strDateMySqltoVN($row['hieuluc_ngay']); $row['dept_name'] = $dept['name']; $this->_printJson($row); }
} ?> " class="input-small date-picker input-mask-date" name="end_date_kl" id="end_date_kl"> <span class="add-on"> <i class="icon-calendar"></i> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="control-group span6"> <label class="control-label" for="rew_code_kl">Hình thức <span class="required">*</span></label> <div class="controls"> <?php echo TochucHelper::selectBox($item->rew_code_kl, array('name' => 'rew_code_kl', 'hasEmpty' => true), 'ins_dmkhenthuongkyluat', array('id', 'name'), array('status = 1', 'type="KL"')); ?> </div> </div> <div class="control-group span6"> <label class="control-label" for="reason_kl">Lý do <span class="required">*</span></label> <div class="controls"> <input type="text" id="reason_kl" name="reason_kl" value="<?php echo $item->reason_kl; ?> " class="required"> </div> </div> </div> <div class="row-fluid"> <div class="control-group span6">
</div> </div> </fieldset> <div style="height: 250px"></div> </div> <div id="COM_TOCHUC_THANHLAP_TAB2" class="tab-pane"> <fieldset class="input-tochuc"> <legend>Thông tin thêm</legend> <div class="row-fluid"> <div class="span4"> <div class="row-fluid"> <label>Lĩnh vực</label> <?php $inArray = Core::loadAssocList('cb_type_linhvuc', array('id AS value', 'name AS text', 'level'), array('type=' => 1), 'lft'); //var_dump($inArray); echo TochucHelper::createChk('ins_linhvuc[]', $inArray, $this->linhvuc); ?> </div> </div> </div> </fieldset> </div> <div id="COM_TOCHUC_THANHLAP_TAB3" class="tab-pane"> <fieldset> <legend>Bổ sung đơn vị vừa tạo vào cấu hình cây báo cáo</legend> <?php $caybaocao = $this->caybaocao; for ($i = 0; $i < count($caybaocao); $i++) { ?> <div class="row-fluid">
" readonly="readonly"> <a class="btn collapse-data-btn" data-toggle="collapse" href="#ins_linhvuc_detail">...</a> </div> <div id="ins_linhvuc_detail" class="collapse"> <div id="thanhlap-tochuc-ins_linhvuc" class="tree"></div> </div> </div> </div> <div class="span8"> <div class="row-fluid"> <div class="control-group"> <label class="control-label" for="goibienche">Gói biên chế <span class="required">*</span></label> <div class="controls"> <?php //var_dump($this->row->goibienche); echo TochucHelper::selectBox($this->row->goibienche, array('name' => 'goibienche', 'hasEmpty' => true), 'bc_goibienche', array('id', 'name'), array('active = 1')); ?> </div> </div> </div> <div class="row-fluid"> <div class="control-group"> <label class="control-label" for="goichucvu">Gói chức vụ <span class="required">*</span></label> <div class="controls"> <input type="hidden" name="goichucvu" id="goichucvu" value="<?php $this->row->goichucvu; ?> "> <div class="input-append"> <input type="text" id="goichucvu_name" name="goichucvu_name" value="<?php echo Core::loadResult('pos_system', array('name'), array('id = ' => (int) $this->row->goichucvu));
private function _initEditPage() { $document = JFactory::getDocument(); $document->addCustomTag('<link href="' . JURI::base(true) . '/media/cbcc/css/jquery.fileupload.css" rel="stylesheet" />'); $document->addCustomTag('<link href="' . JURI::base(true) . '/media/cbcc/js/jstree/themes/default/style.css" rel="stylesheet" />'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/jquery.validate.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/jquery.validate.default.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jstree/jquery.jstree.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/fuelux/fuelux.tree.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/chosen.jquery.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery.maskedinput.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/upload/jquery.iframe-transport.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/upload/jquery.fileupload.js'); $deptRoot = TochucHelper::getRoot(); $deps = TochucHelper::collect('ins_dept', array('id AS value', 'name AS text'), array('type = 1', 'active = 1'), array('lft ASC')); $option[] = array("value" => '', "text" => ''); $option[] = array("value" => $deptRoot['id'], "text" => $deptRoot['name']); $deps = array_merge($option, $deps); // $inArray = TochucHelper::collect('ins_dept', array('id','parent_id','name',"IF((type = 1),'item','folder') AS type")); // $outArray = array(); //TochucHelper::makeDataForTree(&$inArray, &$outArray); //unset($inArray); $inArray = TochucHelper::collect('ins_cap', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type"), array('status = 1')); //var_dump($inArray); $tree_data_ins_cap = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_cap, TochucHelper::getRootCapTochuc()); unset($inArray); $inArray = TochucHelper::collect('ins_level', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type"), array('status = 1')); $tree_data_ins_level = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_level, 1); unset($inArray); $inArray = TochucHelper::collect('pos_system', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type"), array('status = 1')); $tree_data_ins_goichucvu = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_goichucvu, TochucHelper::getRootGoichucvu()); unset($inArray); $inArray = TochucHelper::collect('cb_goiluong', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type"), array('status = 1')); $tree_data_ins_goiluong = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_goiluong, TochucHelper::getRootGoiLuong()); unset($inArray); $inArray = TochucHelper::collect('cb_type_linhvuc', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type")); $tree_data_ins_linhvuc = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_linhvuc, TochucHelper::getRootLinhvucTochuc()); unset($inArray); $inArray = TochucHelper::collect('ins_dept_loaihinh', array('id', 'parent_id', 'name', "IF((rgt-lft) = 1,'item','folder') AS type")); $tree_data_ins_loaihinh = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_loaihinh, TochucHelper::getRootLoaihinh()); unset($inArray); $inArray = TochucHelper::collect('ins_dept', array('id', 'parent_id', 'name', "IF((type = 1),'item','folder') AS type"), array('type IN (1,2,3)'), 'lft ASC'); $tree_data_ins_dept = array(); TochucHelper::makeDataForTree($inArray, $tree_data_ins_dept, $deptRoot['id']); unset($inArray); // $inArray = TochucHelper::getAllVoboc(); // $tree_data_ins_parent = array(); // TochucHelper::makeDataForTree($inArray, &$tree_data_ins_parent,$deps['id']); //unset($inArray); $this->assignRef('Itemid', JFactory::getApplication()->input->get('Itemid')); $this->assignRef('deps', $deps); $this->assignRef('tree_data_ins_cap', json_encode($tree_data_ins_cap)); $this->assignRef('tree_data_ins_level', json_encode($tree_data_ins_level)); $this->assignRef('tree_data_ins_goichucvu', json_encode($tree_data_ins_goichucvu)); $this->assignRef('tree_data_ins_goiluong', json_encode($tree_data_ins_goiluong)); $this->assignRef('tree_data_ins_linhvuc', json_encode($tree_data_ins_linhvuc)); $this->assignRef('tree_data_ins_loaihinh', json_encode($tree_data_ins_loaihinh)); $this->assignRef('tree_data_ins_dept', json_encode($tree_data_ins_dept)); // $model = JModelLegacy::getInstance('Tochuc','TochucModel'); $model = Core::model('Tochuc/Tochuc'); $dept_id = JRequest::getInt('id', 0); $row = $model->read($dept_id); $vanban_created = $model->getVanbanById($row->vanban_created); $trangthai = $model->getVanbanById($row->vanban_active); $file_created = $model->getFilebyIdVanban($row->vanban_created); $file_trangthai = $model->getFilebyIdVanban($row->vanban_active); $this->assignRef('row', $row); $this->assignRef('vanban_created', $vanban_created); $this->assignRef('trangthai', $trangthai); $this->assignRef('file_created', $file_created); $this->assignRef('file_trangthai', $file_trangthai); unset($tree_data_ins_loaihinh); unset($tree_data_ins_cap); unset($tree_data_ins_level); unset($tree_data_ins_goichucvu); unset($tree_data_ins_goiluong); unset($tree_data_ins_linhvuc); unset($tree_data_ins_parent); unset($tree_data_ins_dept); unset($row); unset($vanban_created); unset($file_created); unset($trangthai); unset($file_trangthai); }
</div> <div class="row-fluid"> <div class="control-group span6"> <label class="control-label" for="quyetdinh_ngay">Ngày quyết định </label> <span class="required">*</span> <div class="controls"> <input type="text" id="quyetdinh_ngay" name="quyetdinh_ngay" class="input-small input-mask-date" value="<?php echo $this->item->quyetdinh_ngay; ?> "> </div> </div> <div class="control-group span6"> <label class="control-label" for="hieuluc_ngay">Hiệu lực ngày </label> <div class="controls"> <input type="text" id="hieuluc_ngay" name="hieuluc_ngay" class="input-small input-mask-date validNgayHL" value="<?php echo TochucHelper::strDateMySqltoVN($this->item->hieuluc_ngay); ?> "> </div> </div> </div> <div class="row-fluid"> <div class="control-group"> <label class="control-label" for="ghichu">Ghi chú</label> <div class="controls"> <textarea name="ghichu" id="ghichu" cols="30" rows="5" class="mce_editable"><?php echo $this->item->ghichu; ?> </textarea> </div>
</div> </div> </div> </fieldset> </div> <div id="COM_TOCHUC_THANHLAP_TAB2" class="tab-pane"> <fieldset class="input-tochuc"> <legend>Thông tin thêm</legend> <div class="row-fluid"> <div class="control-group span6"> <label class="control-label" for="active">Lĩnh vực phòng</label> <div class="controls"> <?php $linhvuc = array(); TochucHelper::treeLinhvucPhong(0, 0, &$linhvuc); //var_dump($linhvuc); for ($i = 0; $i < count($linhvuc); $i++) { ?> <label class="checkbox" style="padding-left:<?php echo $linhvuc[$i]['level'] * 20; ?> px"> <input type="checkbox" name="INS_LV[]" value="<?php echo $linhvuc[$i]['id']; ?> "><span class="lbl"> <?php echo $linhvuc[$i]['name']; ?> </span> </label>
public function savekyluat() { $model = Core::model('Tochuc/Tochuc'); $post = JRequest::get('post'); $formData = array(); parse_str($post['frmkyluat'], $formData); $quatrinh_kl = $model->savekyluat(array('id_kl' => $formData['id_kl'], 'iddonvi_kl' => $formData['dept_id'], 'start_date_kl' => TochucHelper::strDateVntoMySql($formData['start_date_kl']), 'end_date_kl' => TochucHelper::strDateVntoMySql($formData['end_date_kl']), 'rew_code_kl' => $formData['rew_code_kl'], 'reason_kl' => $formData['reason_kl'], 'approv_date_kl' => TochucHelper::strDateVntoMySql($formData['approv_date_kl']), 'approv_number_kl' => $formData['approv_number_kl'], 'approv_unit_kl' => $formData['approv_unit_kl'], 'approv_per_kl' => $formData['approv_per_kl'])); echo Core::PrintJson($quatrinh_kl); die; }
<td nowrap="nowrap"><?php echo $row['nam']; ?> </td> <td nowrap="nowrap"><?php echo TochucHelper::getNameById($row['nghiepvu_id'], 'ins_nghiepvu_bienche', 'nghiepvubienche', 'id'); ?> </td> <td nowrap="nowrap"><?php echo $vanban['mahieu']; ?> </td> <td nowrap="nowrap"> <ol> <?php $bienche = TochucHelper::getQuatrinhBiencheChiTietByQuatrinhId($row['id']); for ($j = 0; $j < count($bienche); $j++) { ?> <li><?php echo $bienche[$j]['name']; ?> :<?php echo $bienche[$j]['bienche']; ?> </li> <?php } ?> </ol> </td> <td><?php
else if("type" in options && options.type == "folder") { if("additionalParameters" in options && "children" in options.additionalParameters) $data = options.additionalParameters.children; else $data = {}//no data } if($data != null)//this setTimeout is only for mimicking some random delay setTimeout(function(){callback({ data: $data });} , parseInt(Math.random() * 500) + 200); //if($data != null) callback({ data: $data }); }; jQuery(document).ready(function($){ $('#tochuc-parent-tree').jstree({ "plugins": ["themes", "json_data","checkbox", "ui","types"], "json_data":{ "data":<?php echo TochucHelper::getOneNodeJsTree((int) Core::getManageUnit($user->id)); ?> , "ajax" : { // the URL to fetch the data "url" : "<?php echo JUri::root(true); ?> /api.php?&task=tree&act=TOCHUC", "data" : function(n) { return { "id" : n.attr ? n.attr("id").replace("node_", "") : <?php echo (int) Core::getManageUnit($user->id); ?> }; }
', data:{"id":id}, beforeSend: function(){ $.blockUI(); $('#com_tochuc_viewdetail').empty(); }, success: function (data,textStatus,jqXHR){ $.unblockUI(); $('#com_tochuc_viewdetail').html(data); } }); }; var com_jstree = $('#main-content-tree').jstree({ "json_data":{ "data":<?php echo TochucHelper::getOneNodeJsTree((int) Core::getManageUnit($user->id, 'com_tochuc', 'tochuc', 'default')); ?> , "ajax" : { // the URL to fetch the data "url" : "api.php?task=tree&act=tochuc", "data" : function(n) { return { "id" : n.attr ? n.attr("id").replace("node_", "") : <?php echo (int) Core::getManageUnit($user->id, 'com_tochuc', 'tochuc', 'default'); ?> }; } } }, // Configuring the search plugin
public static function buildTreeHtmlDeQui($parent_id, $table, $colums, $where = null, $order = null) { $rows = array(); TochucHelper::recursive($table, $colums, $where, $parent_id, 1, $rows); $current_depth = 1; $counter = 0; $result = '<ul>'; foreach ($rows as $node) { $node_depth = $node['level']; $node_name = $node['text']; $node_id = $node['id']; if ($node_depth == $current_depth) { if ($counter > 0) { $result .= '</li>'; } } elseif ($node_depth > $current_depth) { $result .= '<ul>'; $current_depth = $current_depth + ($node_depth - $current_depth); } elseif ($node_depth < $current_depth) { $result .= str_repeat('</li></ul>', $current_depth - $node_depth) . '</li>'; $current_depth = $current_depth - ($current_depth - $node_depth); } $result .= '<li id="c' . $node_id . '"'; $result .= $node_depth < 2 ? ' class="open"' : ''; $result .= '><a href="#"><ins> </ins>' . $node_name . '</a>'; ++$counter; } $result .= str_repeat('</li></ul>', $node_depth) . '</li>'; $result .= '</ul>'; return $result; }
echo TochucHelper::selectBoxComparing('LE', array('style' => 'width:50px', 'name' => 'quyetdinh_ngay_end_condition')); ?> <input class="input-mask-date" name="quyetdinh_ngay_end" id="quyetdinh_ngay_end" style="width:70px" type="text"> </div> </div> </div> <div class="row-fluid"> <div class="control-group"> <label for="cachthuc_id" class="control-label">Hiệu lực ngày</label> <div class="controls"> <?php echo TochucHelper::selectBoxComparing('GE', array('style' => 'width:50px', 'name' => 'hieuluc_ngay_start_condition')); ?> <input class="input-mask-date" name="hieuluc_ngay_start" id="hieuluc_ngay_start" style="width:70px" type="text"> <?php echo TochucHelper::selectBoxComparing('LE', array('style' => 'width:50px', 'name' => 'hieuluc_ngay_end_condition')); ?> <input class="input-mask-date" name="hieuluc_ngay_end" id="hieuluc_ngay_end" style="width:70px" type="text"> </div> </div> </div> </div> </div> </fieldset> </div> <div id="tochuc-search-ketqua" class="tab-pane"><div id="ketqua-search"></div></div> </div> </div> </form> <div id="thongtin"></div> <script type="text/javascript">
} } else { $vanban = array(); } ?> <tr> <td><?php echo $row['quyetdinh_ngay']; ?> </td> <td><?php echo $nhl = $row['hieuluc_ngay'] == '0000-00-00' ? "" : date('d/m/Y', strtotime($row['hieuluc_ngay'])); ?> </td> <td><?php echo TochucHelper::getNameById($row['cachthuc_id'], 'ins_dept_cachthuc'); ?> </td> <td><?php echo $vanban['mahieu']; ?> </td> <td><?php echo $row['chitiet']; ?> </td> <td><?php echo $row['ghichu']; ?> </td> <td nowrap="nowrap">