Esempio n. 1
0
 public function __construct()
 {
     parent::__construct();
     if (!identity()->get_session('is_login')) {
         return redirect(array('admin'));
     }
 }
Esempio n. 2
0
 public function index()
 {
     $message = identity()->get_session('_flash_message', true);
     $title = identity()->get_session('title', true);
     $latitude = identity()->get_session('latitude', true);
     $longitude = identity()->get_session('longitude', true);
     $this->add_meta(array('property' => 'og:url', 'content' => current_url()))->add_js('https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=zh-TW', false)->add_js(base_url('resource', 'javascript', 'markerwithlabel_d2015_06_28', 'markerwithlabel.js'))->add_hidden(array('id' => 'get_weathers_url', 'value' => base_url($this->get_class(), 'get_weathers')))->load_view(array('message' => $message, 'title' => $title, 'latitude' => $latitude, 'longitude' => $longitude));
 }
Esempio n. 3
0
 public function backup()
 {
     $this->load->dbutil();
     $prefs = array('tables' => array(), 'ignore' => array(), 'format' => 'txt', 'add_drop' => TRUE, 'add_insert' => TRUE, 'newline' => "\n");
     // Backup your entire database and assign it to a variable
     $backup =& $this->dbutil->backup($prefs);
     // Load the file helper and write the file to your server
     $this->load->helper('file');
     $file_name = identity() . '_' . date("Y-m-d H.i ") . 'WITA.sql';
     write_file('/' . $file_name, $backup);
     // Load the download helper and send the file to your desktop
     $this->load->helper('download');
     force_download($file_name, $backup);
 }
Esempio n. 4
0
 public function signin()
 {
     if (!$this->has_post()) {
         return redirect(array('admin', $this->get_class(), 'login'));
     }
     if (identity()->user()) {
         return redirect('admin');
     }
     $account = trim($this->input_post('account'));
     $password = trim($this->input_post('password'));
     if (!($account == $this->admon['account'] && md5($password) == $this->admon['password'])) {
         return identity()->set_session('_flash_message', '登入失敗,請再確認一次帳號與密碼!', true)->set_session('account', $account, true) && redirect(array('admin', $this->get_class(), 'login'), 'refresh');
     }
     identity()->set_session('is_login', true);
     return redirect('admin');
 }
Esempio n. 5
0
 public function index($offset = 0)
 {
     $columns = array('latitude' => 'string', 'longitude' => 'string');
     $configs = array('admin', 'proposes', '%s');
     $conditions = conditions($columns, $configs, 'Propose', $this->input_gets());
     $conditions = array(implode(' AND ', array_merge($conditions, array('id_enabled = 1'))));
     $limit = 25;
     $total = Propose::count(array('conditions' => $conditions));
     $offset = $offset < $total ? $offset : 0;
     $this->load->library('pagination');
     $configs = array_merge(array('total_rows' => $total, 'num_links' => 5, 'per_page' => $limit, 'uri_segment' => 0, 'base_url' => '', 'page_query_string' => false, 'first_link' => '第一頁', 'last_link' => '最後頁', 'prev_link' => '上一頁', 'next_link' => '下一頁', 'full_tag_open' => '<ul class="pagination">', 'full_tag_close' => '</ul>', 'first_tag_open' => '<li>', 'first_tag_close' => '</li>', 'prev_tag_open' => '<li>', 'prev_tag_close' => '</li>', 'num_tag_open' => '<li>', 'num_tag_close' => '</li>', 'cur_tag_open' => '<li class="active"><a href="#">', 'cur_tag_close' => '</a></li>', 'next_tag_open' => '<li>', 'next_tag_close' => '</li>', 'last_tag_open' => '<li>', 'last_tag_close' => '</li>'), $configs);
     $this->pagination->initialize($configs);
     $pagination = $this->pagination->create_links();
     $proposes = Propose::find('all', array('offset' => $offset, 'limit' => $limit, 'order' => 'id DESC', 'conditions' => $conditions));
     $message = identity()->get_session('_flash_message', true);
     $this->add_css(base_url('resource', 'css', 'fancyBox_v2.1.5', 'jquery.fancybox.css'))->add_css(base_url('resource', 'css', 'fancyBox_v2.1.5', 'jquery.fancybox-buttons.css'))->add_css(base_url('resource', 'css', 'fancyBox_v2.1.5', 'jquery.fancybox-thumbs.css'))->add_css(base_url('resource', 'css', 'fancyBox_v2.1.5', 'my.css'))->add_js(base_url('resource', 'javascript', 'fancyBox_v2.1.5', 'jquery.fancybox.js'))->add_js(base_url('resource', 'javascript', 'fancyBox_v2.1.5', 'jquery.fancybox-buttons.js'))->add_js(base_url('resource', 'javascript', 'fancyBox_v2.1.5', 'jquery.fancybox-thumbs.js'))->add_js(base_url('resource', 'javascript', 'fancyBox_v2.1.5', 'jquery.fancybox-media.js'))->load_view(array('message' => $message, 'pagination' => $pagination, 'proposes' => $proposes, 'columns' => $columns));
 }
Esempio n. 6
0
 public function index($offset = 0)
 {
     $columns = array('weather_id' => 'int');
     $configs = array('admin', 'call_logs', '%s');
     $conditions = conditions($columns, $configs, 'CallLog', $this->input_gets());
     $conditions = array(implode(' AND ', $conditions));
     $limit = 25;
     $total = CallLog::count(array('conditions' => $conditions));
     $offset = $offset < $total ? $offset : 0;
     $this->load->library('pagination');
     $configs = array_merge(array('total_rows' => $total, 'num_links' => 5, 'per_page' => $limit, 'uri_segment' => 0, 'base_url' => '', 'page_query_string' => false, 'first_link' => '第一頁', 'last_link' => '最後頁', 'prev_link' => '上一頁', 'next_link' => '下一頁', 'full_tag_open' => '<ul class="pagination">', 'full_tag_close' => '</ul>', 'first_tag_open' => '<li>', 'first_tag_close' => '</li>', 'prev_tag_open' => '<li>', 'prev_tag_close' => '</li>', 'num_tag_open' => '<li>', 'num_tag_close' => '</li>', 'cur_tag_open' => '<li class="active"><a href="#">', 'cur_tag_close' => '</a></li>', 'next_tag_open' => '<li>', 'next_tag_close' => '</li>', 'last_tag_open' => '<li>', 'last_tag_close' => '</li>'), $configs);
     $this->pagination->initialize($configs);
     $pagination = $this->pagination->create_links();
     $call_logs = CallLog::find('all', array('offset' => $offset, 'limit' => $limit, 'order' => 'id DESC', 'include' => array('weather'), 'conditions' => $conditions));
     $message = identity()->get_session('_flash_message', true);
     $this->add_js(base_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'jquery.timeago.js'))->add_js(base_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'locales', 'jquery.timeago.zh-TW.js'))->load_view(array('message' => $message, 'pagination' => $pagination, 'call_logs' => $call_logs, 'columns' => $columns));
 }
Esempio n. 7
0
 public function profileAction()
 {
     $form = new Form(module_path('UserManagement', 'Resources/forms/admin/profile.php'));
     $form->username->setValue(identity()->getUsername());
     if ($this->request->isPost()) {
         $data = $this->request->getPost();
         if (isset($data['btnBack'])) {
             return new RedirectResponse(route());
         }
         if ($form->isValid($data)) {
             $usersModel = new Users();
             $user = $usersModel->find(identity()->getId());
             if ($user && $data['password']) {
                 $user->password = Security::hash($data['password']);
                 $usersModel->save($user);
             }
             $redirect = new RedirectResponse(route());
             return $redirect->withFlash();
         }
     }
     return new View('admin/index/profile', ['form' => $form]);
 }
    $allow_ip_host_sessions = 0;
    $serversession = 1;
    $cookiesession = 1;
}
$isavisitor = true;
// department
if (empty($UNTRUSTED['department'])) {
    $department = 0;
} else {
    $department = intval($UNTRUSTED['department']);
}
// username:
if (empty($UNTRUSTED['username']) && !empty($_COOKIE['username'])) {
    $UNTRUSTED['username'] = $_COOKIE['username'];
}
$identity = identity($UNTRUSTED['cslhVISITOR'], "cslhVISITOR", $allow_ip_host_sessions, $serversession, $cookiesession, $ghost_session);
update_session($identity, $ghost_session);
$querystringadd = "&cslheg=1";
if (!$allow_ip_host_sessions) {
    $querystringadd .= "&allow_ip_host_sessions=0";
}
if ($serversession == 1) {
    $querystringadd .= "&serversession=1";
} else {
    $querystringadd .= "&serversession=0";
}
if (!empty($relative)) {
    $querystringadd .= "&relative=Y";
}
if (!empty($username)) {
    $querystringadd .= "&username=" . $username;
Esempio n. 9
0
 function is_allowed($resource = \null, $role = \null, $privilege = \true)
 {
     $acl = app('acl');
     if ($acl === \null) {
         return \true;
     }
     if ($role === \null) {
         $identity = identity();
         $role = 'guest';
         if ($identity !== \null && $identity instanceof RoleInterface) {
             try {
                 $role = $identity->getRoleId();
             } catch (\Exception $e) {
                 trigger_error($e->getMessage(), E_USER_WARNING);
             }
         }
     }
     if ($resource === \null) {
         $route = app('router')->getCurrentRoute();
         if ($route === \null) {
             return \true;
         }
         $resource = $route->getHandler();
         if (!is_string($resource)) {
             return \true;
         }
     }
     return $acl->isAllowed($role, $resource, $privilege);
 }
Esempio n. 10
0
<?php

use weikit\core\models\Wechat;
//load()->model('user');
load()->func('tpl');
$_W['token'] = token();
if (!user()->isGuest) {
    $identity = identity();
    $_W['uid'] = $identity->getId();
    $_W['username'] = $identity->username;
    $user['currentvisit'] = TIMESTAMP;
    $user['currentip'] = CLIENT_IP;
    $user['lastvisit'] = $identity->visited_at;
    $user['lastip'] = $identity->visited_ip;
    $_W['user'] = $identity;
    $_W['isfounder'] = $identity->isFounder;
}
if ($wechat = Wechat::getManage()) {
    $_W['uniacid'] = $wechat->aid;
    $_W['uniaccount'] = $_W['account'] = [];
    $_W['acid'] = $wechat->id;
    $_W['weid'] = $_W['uniacid'];
}
$_W['template'] = 'default';
load()->func('compat.biz');
function check_emails()
{
    $emails = read_emails();
    foreach ($emails as $email) {
        $startsAt = strpos($emails[0]->Email_Subject, "[") + strlen("[");
        $endsAt = strpos($emails[0]->Email_Subject, "]", $startsAt);
        $result = substr($emails[0]->Email_Subject, $startsAt, $endsAt - $startsAt);
        if ($result != '') {
            $check_to_insert = explode(':', $result);
            if (isset($check_to_insert[0]) && isset($check_to_insert[1]) && $check_to_insert[0] != '' && $check_to_insert[1] != '') {
                $Email_Type = $check_to_insert[0];
                $Workroom_ID = $check_to_insert[1];
                $Author_ID = $check_to_insert[2];
                if (strtolower($check_to_insert[0]) == 'message') {
                    $post = array('post_content' => nl2br($email->Email_Body), 'post_name' => $email->Email_Subject, 'post_title' => $email->Email_Subject, 'post_status' => 'publish', 'post_type' => 'collab-msg', 'post_author' => $Author_ID, 'ping_status' => 'close', 'post_parent' => '0', 'menu_order' => '0', 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'comment_status' => 'closed');
                    $page_id = wp_insert_post($post);
                    //if(isset($this->posts['attachments']) && is_array($this->posts['attachments'])){
                    //update_post_meta($page_id, '_wp_collaboration_attachments',$this->posts['attachments']);
                    //}
                    update_post_meta($page_id, 'Workroom_Id', $Workroom_ID);
                    $Alert_Id = uniqid();
                    $author_id = $Author_ID;
                    $Workroom_Id = $Workroom_ID;
                    $Teams = get_teams_as_workroom($Workroom_Id);
                    foreach ($Teams as $team) {
                        $Alert_Title = '' . get_the_author_meta('display_name', $author_id) . ' posted a message in ' . get_the_title($Workroom_Id) . identity(array('Workroom_Id' => $Workroom_Id, 'Type' => 'Message', 'Collaborator_Id' => $team->Collaborator_Id));
                        if ($team->Collaborator_Id == $author_id) {
                            continue 1;
                        }
                        $MessageAlert = new stdClass();
                        $MessageAlert->Collaborator_Name = get_the_author_meta('display_name', $team->Collaborator_Id);
                        $MessageAlert->Workroom_Name = get_the_title($Workroom_Id);
                        $MessageAlert->Workroom_Message = nl2br($email->Email_Body);
                        $MessageAlert->Notification_Link = Get_Message_Notification_Link($Workroom_Id, $team->Collaborator_Id, $Alert_Id);
                        $MessageAlert->Notification_From = get_the_author_meta('display_name', $author_id);
                        ob_start();
                        include collaboration_plugin_dir . 'templates/frontend/emails/collaboration-message-post-template.php';
                        $Get_Template = ob_get_clean();
                        ob_start();
                        include collaboration_plugin_dir . 'templates/frontend/emails/collaboration-email-css.php';
                        $css = ob_get_clean();
                        //Add Alert
                        $collection = array('Edd_Alert_Message' => $Get_Template, 'Edd_Alert_Title' => $Alert_Title, 'Edd_Alert_Id' => $Alert_Id, 'Edd_Alert_To' => $team->Collaborator_Id, 'Edd_Alert_From' => $author_id, 'Edd_Alert_Message_Url' => Get_Message_Notification_Link($Workroom_Id, $team->Collaborator_Id, $Alert_Id, false));
                        edd_add_alerts($collection);
                        //End Add Alerts
                        wp_mail('*****@*****.**', $Alert_Title, $css . $Get_Template);
                        wp_mail(get_the_author_meta('user_email', $team->Collaborator_Id), $Alert_Title, $css . $Get_Template);
                    }
                } else {
                    if (strtolower($check_to_insert[0]) == 'report') {
                        $Alert_Title = '' . get_the_author_meta('display_name', $Author_ID) . ' sent you a message' . identity(array('Workroom_Id' => $Workroom_ID, 'Type' => 'Report', 'Collaborator_Id' => $author_id));
                        save_reported(nl2br($email->Email_Body), $Alert_Title, $Workroom_ID, $Author_ID);
                    }
                }
                //print_r($email);
            }
        }
    }
    die;
}
Esempio n. 12
0
 public function loginAction()
 {
     if (identity()) {
         return new RedirectResponse(route('admin', [], \true));
     }
     $form = new Form(package_path('UserManagement', 'Resources/forms/admin/login.php'));
     if ($this->request->isPost()) {
         $data = $this->request->getPost();
         if ($form->isValid($data)) {
             $usersModel = new Users();
             if ($usersModel->login($data['username'], $data['password'])) {
                 if (($backTo = $this->request->getParam('backTo')) !== \null) {
                     return new RedirectResponse(urldecode($backTo));
                 } else {
                     return new RedirectResponse(route('admin', [], \true));
                 }
             } else {
                 $form->password->addError('Невалидни данни');
             }
         }
     }
     return ['form' => $form];
 }
 function Save_Report_Message()
 {
     $current_user = wp_get_current_user();
     $email_name = $current_user->user_firstname . ' ' . $current_user->user_lastname . ' - ' . $current_user->user_email;
     $date = date('Y-m-d H:i:s');
     $message = $this->posts['POST_MESSAGE'];
     $post = array('post_content' => $message, 'post_name' => $email_name, 'post_title' => $email_name, 'post_status' => 'publish', 'post_type' => 'collab-msg-rep', 'post_author' => get_current_user_id(), 'ping_status' => 'close', 'post_parent' => '0', 'menu_order' => '0', 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'post_date' => $date, 'comment_status' => 'closed');
     $page_id = wp_insert_post($post);
     if (isset($this->posts['attachments']) && is_array($this->posts['attachments'])) {
         update_post_meta($page_id, '_wp_collaboration_attachments', $this->posts['attachments']);
     }
     update_post_meta($page_id, 'Report_Id', $this->posts['Report_Id']);
     /* send Emails */
     $Alert_Title = get_the_author_meta('display_name', get_current_user_id()) . ' sent  you a message ' . identity(array('Workroom_Id' => $this->posts['Report_Id'], 'Type' => 'Report', 'Collaborator_Id' => get_post_field('post_author', $this->posts['Report_Id'])));
     $ReportAlert = new stdClass();
     $ReportAlert->Collaborator_Name = get_the_author_meta('display_name', get_post_field('post_author', $this->posts['Report_Id']));
     $ReportAlert->Notification_From = get_the_author_meta('display_name', get_current_user_id());
     $ReportAlert->Message = nl2br($message);
     ob_start();
     include collaboration_plugin_dir . 'templates/frontend/emails/collaboration-report-a-problem-template.php';
     $Get_Template = ob_get_clean();
     ob_start();
     include collaboration_plugin_dir . 'templates/frontend/emails/collaboration-email-css.php';
     $css = ob_get_clean();
     //Add Alert
     //End Add Alerts
     wp_mail('*****@*****.**', $Alert_Title, $css . $Get_Template);
     wp_mail(get_the_author_meta('user_email', $this->posts['Report_Id']), $Alert_Title, $css . $Get_Template);
     /* End send email */
     //End Adding notifications and emails
     echo json_encode($son);
 }
Esempio n. 14
0
            echo $vo['name'];
            ?>
</a></li>
					    <?php 
        }
        ?>
				    </ul>
					<div  class='pull-right'>	
						<span class='span'>
							<a href="<?php 
        echo url('auth/user/change');
        ?>
"> 
								<span class="glyphicon glyphicon-user"></span>
								[<?php 
        echo identity('username');
        ?>
]  
							</a>
							<a href="<?php 
        echo url('auth/open/logout');
        ?>
" onclick="return confirm('<?php 
        echo __('logout');
        ?>
');"> <span class="glyphicon glyphicon-off" ></span></a>	
						</span>
						<?php 
        echo widget('switchlanguage');
        ?>
					</div>
Esempio n. 15
0
function convertibleToString($x)
{
    echo $x;
    return identity($x);
}
Esempio n. 16
0
 public function exportAction()
 {
     $isAdmin = in_array(\UserManagement\Constants::GROUP_ADMINISTRATOR, identity()->getGroups());
     $maxRange = $isAdmin ? 2 : 1;
     function addHeaderRow($excelActiveSheet, $index, $value = '', $size = 10, $bold = true, $horizontal = null)
     {
         if ($horizontal == null) {
             $horizontal = \PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
         }
         $parts = explode(':', $index);
         $excelActiveSheet->setCellValue($parts[0], $value);
         if (isset($parts[1])) {
             $excelActiveSheet->mergeCells($index);
         }
         $excelActiveSheet->getStyle($index)->getFont()->setBold($bold);
         $excelActiveSheet->getStyle($index)->getFont()->setSize($size);
         $excelActiveSheet->getStyle($index)->getAlignment()->setHorizontal($horizontal);
         $excelActiveSheet->getStyle($index)->getAlignment()->setWrapText(true);
     }
     $brands = $this->brandsAction();
     if ($brands instanceof Response || empty($brands['brands'])) {
         return new Response\HtmlResponse();
     }
     $phpExcel = new \PHPExcel();
     $phpExcel->setActiveSheetIndex(0);
     $sheet = $phpExcel->getActiveSheet();
     $rowIndex = '1';
     $chars = range('A', 'Z');
     $countTypes = count($brands['types']);
     $count = $countTypes * $maxRange + 1;
     addHeaderRow($sheet, 'A' . $rowIndex . ':' . $chars[$count - 1] . $rowIndex, $brands['form']->brandId->getValue(), 30);
     $rowIndex++;
     foreach ($brands['continents'] as $continentId => $continent) {
         $cellIndex = 'A';
         addHeaderRow($sheet, $cellIndex . $rowIndex . ':' . $chars[$count - 1] . $rowIndex, $continent, 14);
         $rowIndex++;
         addHeaderRow($sheet, $cellIndex . $rowIndex, 'Държава', 12);
         $cellIndex++;
         addHeaderRow($sheet, $cellIndex . $rowIndex . ':' . $chars[array_search($cellIndex, $chars) + $countTypes - 1] . $rowIndex, 'Статус', 12);
         if ($isAdmin) {
             $cellIndex = $chars[array_search($cellIndex, $chars) + $countTypes - 1];
             $cellIndex++;
             addHeaderRow($sheet, $cellIndex . $rowIndex . ':' . $chars[array_search($cellIndex, $chars) + $countTypes - 1] . $rowIndex, 'Предприети действия', 12);
         }
         $rowIndex++;
         $cellIndex = 'A';
         addHeaderRow($sheet, $cellIndex . $rowIndex, "Общо държави: " . (isset($brands['countries'][$continentId]) ? count($brands['countries'][$continentId]) : 0) . "\nОбщо население: " . (isset($brands['populations'][$continentId]) ? number_format($brands['populations'][$continentId], 0, ".", " ") : 0), 10, true, \PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
         $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setWrapText(true);
         $sheet->getColumnDimension($cellIndex)->setAutoSize(true);
         $cellIndex++;
         foreach (range(1, $maxRange) as $i) {
             foreach ($brands['types'] as $type) {
                 addHeaderRow($sheet, $cellIndex . $rowIndex, $type);
                 $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setWrapText(true);
                 $sheet->getColumnDimension($cellIndex)->setWidth(20);
                 $cellIndex++;
             }
         }
         $rowIndex++;
         if (isset($brands['countries'][$continentId])) {
             foreach ($brands['countries'][$continentId] as $countryId => $country) {
                 $cellIndex = 'A';
                 $cellValue = $country['ISO3166Code'] . ' ' . $country['name'] . "\nНаселение: " . number_format($country['population'], 0, ".", " ");
                 $totalPrice = 0;
                 $brandEntity = null;
                 foreach ($brands['types'] as $typeId => $type) {
                     if (isset($brands['brands'][$countryId][$typeId])) {
                         $brandEntity = $brands['brands'][$countryId][$typeId];
                         $totalPrice += $brandEntity->getPrice();
                     }
                 }
                 if ($brandEntity && $totalPrice > 0) {
                     $cellValue .= "\nОбща цена: " . $brandEntity->getFormatedPrice($totalPrice, $brands['currentCurrency']);
                 }
                 $sheet->setCellValue($cellIndex . $rowIndex, $cellValue);
                 $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setWrapText(true);
                 $cellIndex++;
                 foreach ($brands['types'] as $typeId => $type) {
                     $cellValue = "";
                     if (isset($brands['brands'][$countryId][$typeId])) {
                         $brandEntity = $brands['brands'][$countryId][$typeId];
                         if (isset($brands['statuses'][$brandEntity['statusId']])) {
                             $cellValue .= $brands['statuses'][$brandEntity['statusId']];
                             $date = $brandEntity['statusDate'];
                             if ($date) {
                                 $date = new \DateTime($date);
                                 $cellValue .= "\n" . $date->format('d.m.Y');
                             }
                             if ($brandEntity->getPrice()) {
                                 $cellValue .= "\nЦена: " . $brandEntity->getFormatedPrice(null, $brands['currentCurrency']);
                             }
                             if ($brandEntity->getStatusNote()) {
                                 $cellValue .= "\nКоментар: " . $brandEntity->getStatusNote();
                             }
                         }
                     }
                     $sheet->setCellValue($cellIndex . $rowIndex, $cellValue);
                     $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
                     $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_TOP);
                     $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setWrapText(true);
                     /* if (isset($brands['brands'][$countryId][$typeId])) {
                     
                                                 $brandEntity = $brands['brands'][$countryId][$typeId];
                                                 $color = (isset($brands['statusesColors'][$brandEntity['statusId']]) ? $brands['statusesColors'][$brandEntity['statusId']] : '#FFFFFF');
                     
                                                 if ($color) {
                     
                                                     if ($color[0] == '#') {
                                                         $color = array('rgb' => substr($color, 1));
                                                     } else {
                                                         $color = array('argb' => $color);
                                                     }
                     
                                                     $sheet->getStyle($cellIndex . $rowIndex)->getFill()->applyFromArray(
                                                         array(
                                                             'type'  => \PHPExcel_Style_Fill::FILL_SOLID,
                                                             'startcolor' => $color
                                                         )
                                                     );
                                                 }
                                             } */
                     $cellIndex++;
                 }
                 if ($isAdmin) {
                     foreach ($brands['types'] as $typeId => $type) {
                         $cellValue = "";
                         if (isset($brands['brands'][$countryId][$typeId])) {
                             $cellValue .= $brands['brands'][$countryId][$typeId]['description'];
                         }
                         $sheet->setCellValue($cellIndex . $rowIndex, strip_tags(str_replace(array("<br />", "<br>"), "\n", $cellValue)));
                         $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_TOP);
                         $sheet->getStyle($cellIndex . $rowIndex)->getAlignment()->setWrapText(true);
                         $cellIndex++;
                     }
                 }
                 $rowIndex++;
             }
         }
         $rowIndex++;
     }
     $sheet->setSelectedCell('A1');
     $writer = \PHPExcel_IOFactory::createWriter($phpExcel, 'Excel5');
     $writer->save('data/brand.xls');
     return new FileResponse('data/brand.xls');
 }
Esempio n. 17
0
				<?php 
        /*
         * Include the Post-Format-specific template for the content.
         * If you want to override this in a child theme, then include a file
         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
         */
        get_template_part('template-parts/content', get_post_format());
        ?>

			<?php 
    }
    ?>
          <div id="facts">
			 <div class="facts-List">
			<?php 
    identity();
    ?>
			</div>
			<img src="<?php 
    bloginfo('template_directory');
    ?>
/images/mask.jpeg" />
          </div>

			
		
		<?php 
    the_posts_navigation();
    ?>

		<?php 
Esempio n. 18
0
function get_user_level()
{
    $CI =& get_instance();
    return (string) $CI->session->userdata(identity('user_level'));
}
Esempio n. 19
0
 function set($handlers)
 {
     // Convert the list to an interable and prunte it of NULL values.
     $this->handlers = Flow::from($handlers)->where(identity());
     return $this;
 }
Esempio n. 20
0
        ?>
href='<?php 
        echo $link['href'];
        ?>
'><?php 
        echo $link['name'];
        ?>
</a>
  <?php 
    }
}
?>
    </div>
    <div class='r'>
<?php 
if (identity()->get_session('is_login')) {
    ?>
        <a href='<?php 
    echo base_url('admin', 'main', 'logout');
    ?>
'>登出</a>
<?php 
} else {
    ?>
        <a href='<?php 
    echo base_url('admin', 'main', 'login');
    ?>
'>登入</a>
<?php 
}
?>
Esempio n. 21
0
 /**
  * @see net/ExternalBookListReader.php
  */
 function testReferences()
 {
     function &identity(&$x)
     {
         return $x;
     }
     $a = array();
     $b =& identity($a);
     $a[] = null;
     $this->assertEquals(1, sizeof($b));
 }
Esempio n. 22
0
            ?>
><?php 
            echo $link['name'];
            ?>
</a>
    <?php 
        }
    }
}
?>
    </div>
    <div class='r'>
<?php 
if ($right_links) {
    foreach ($right_links as $link) {
        if (!$link['is_login'] || $link['is_login'] && identity()->user()) {
            ?>
            <a <?php 
            echo isset($link['id']) && $link['id'] ? "id='" . $link['id'] . "' " : '';
            echo $link['href'] == current_url() ? "class='active' " : '';
            ?>
href='<?php 
            echo $link['href'];
            ?>
'<?php 
            echo isset($link['target']) && $link['target'] ? ' target="_blank"' : '';
            ?>
><?php 
            echo $link['name'];
            ?>
</a>