本文整理汇总了PHP中Helper_Config类的典型用法代码示例。如果您正苦于以下问题:PHP Helper_Config类的具体用法?PHP Helper_Config怎么用?PHP Helper_Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Helper_Config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$request = $this->getRequest();
$goodies = Model_Pages::getPage(Helper_Config::get('page_goodies'));
$pin_text = $this->translate('Pyng images from any website as you browse the web with the %s"Pyng It" button.%s');
if ($goodies) {
$this->view->pin_text = sprintf($pin_text, '<a href="' . WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=pages&action=read&page_id=' . Helper_Config::get('page_goodies')) . '">', '</a>');
}
$methods = glob(dirname(__FILE__) . '/Addpin/*.php');
$this->view->methods = array();
if ($methods) {
$front = $this->getFrontController();
foreach ($methods as $row => $method) {
$controller = basename($method, 'Controller.php');
if ($controller) {
$name = $front->formatControllerName('addpin_' . strtolower($controller));
if (!class_exists($name, true)) {
JO_Loader::loadClass($name);
}
$instance = new $name();
$this->view->methods[isset($instance->SORT) ? $instance->SORT : 0] = $this->view->callChildren('addpin_' . strtolower($controller));
}
}
}
ksort($this->view->methods);
$this->view->popup_main_box = $this->view->render('popup_main', 'addpin');
if ($request->isXmlHttpRequest()) {
$this->noViewRenderer(true);
echo $this->view->popup_main_box;
} else {
$this->forward('error', 'error404');
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:AddpinController.php
示例2: indexAction
public function indexAction()
{
$request = $this->getRequest();
/*//get pins data
if($request->isXmlHttpRequest()) {
$this->forward('videos', 'getPins');
}*/
///// get pins
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$this->view->result_data = '';
if (!Helper_Config::get('config_disable_js')) {
//get pins data
if ($request->isXmlHttpRequest()) {
$this->forward('videos', 'getPins');
}
} else {
if ($page > 1 && $request->isXmlHttpRequest()) {
$this->forward('videos', 'getPins');
}
$pins = (array) $this->getPinsAction(true);
foreach ($pins as $pin) {
$template = new Helper_Tmpl($pin['template'], $pin);
$this->view->result_data .= $template->render($pin['template']);
}
}
//call header and footer childrens
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:31,代码来源:VideosController.php
示例3: __construct
public function __construct($data = array())
{
$db = JO_Db::getDefaultAdapter();
//select default pin data
$query = self::getListPinsQueryLite();
if (isset($data['cover']) && $data['cover']) {
$query->where('pins.pin_id = ?', (string) $data['cover']);
} else {
$query->where('pins.pin_id = 0');
}
if (isset($data['pins']) && count($data['pins'])) {
$query->orWhere('pins.pin_id IN (?)', new JO_Db_Expr(implode(',', $data['pins'])));
} else {
$query->orWhere('pins.pin_id = 0');
}
//v2.2
if (Helper_Config::get('config_enable_follow_private_profile')) {
$query = self::filterFriend($query);
}
//sort and limit add to query from Model_Pins_Abstract
if (isset($data['cover']) && $data['cover']) {
if (isset($data['pins']) && count($data['pins'])) {
$query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . (string) $data['cover'] . ',' . implode(',', $data['pins']) . '), pins.pin_id DESC'));
} else {
$query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . (string) $data['cover'] . '), pins.pin_id DESC'));
}
} else {
$query->order('pins.pin_id DESC');
}
$this->data = $db->fetchAll($query);
// parent::__construct($db->fetchAll($query));
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:32,代码来源:PinsThumbsForBoard.php
示例4: getRandum
private function getRandum($query, $data = array())
{
$db = JO_Db::getDefaultAdapter();
//// load from cache
$check = $db->select()->from('cache_index')->where('start_limit = ?', 'home')->limit(1);
$cache = $db->fetchRow($check);
if (!isset($cache['data']) || !$cache['data']) {
$query->where('pins.pin_id = 0');
return $query;
}
if ($cache && $cache['data']) {
$query->where('pins.pin_id IN (' . $cache['data'] . ')');
} else {
$query->where('pins.pin_id = 0');
}
//v2.2
if (Helper_Config::get('config_enable_follow_private_profile')) {
$query = self::filterFriend($query);
}
//sort and limit add to query from Model_Pins_Abstract
$query = self::sortOrderLimit($query, $data);
$query->reset(JO_Db_Select::ORDER);
$query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . $cache['data'] . ')'));
return $query;
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:25,代码来源:HomePage.php
示例5: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
if ($this->session->get('error_permision')) {
$this->view->error_permision = $this->session->get('error_permision');
$this->session->clear('error_permision');
}
$reques = $this->getRequest();
$page = $reques->getRequest('page', 1);
$data = array('start' => $page * Helper_Config::get('config_admin_limit') - Helper_Config::get('config_admin_limit'), 'limit' => Helper_Config::get('config_admin_limit'));
$this->view->words = array();
$words = Model_Banners::getBanners($data);
if ($words) {
foreach ($words as $word) {
$word['text_controller'] = $this->positions($word['controller']);
$this->view->words[] = $word;
}
}
$total_records = Model_Banners::getTotalBanners($data);
$this->view->total_pages = ceil($total_records / Helper_Config::get('config_admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(Helper_Config::get('config_admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/banners/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:31,代码来源:BannersController.php
示例6: indexAction
public function indexAction()
{
$settings = Model_Extensions::getSettingsPairs('facebook');
$this->noLayout(true);
if (isset($settings['facebook_module_status_enable']) && $settings['facebook_module_status_enable']) {
if (isset($settings['facebook_login_with_facebook']) && $settings['facebook_login_with_facebook']) {
$request = $this->getRequest();
$facebook = new Helper_Modules_Facebook();
if ($facebook->checkValidAppId()) {
$connectObject = new Model_Facebook_Login();
$user_info = $connectObject->getDataByUserId(JO_Session::get('user[user_id]'));
$this->view->facebook_connect = false;
$this->view->facebook_timeline = false;
if ($user_info) {
$this->view->facebook_connect = true;
$this->view->facebook_timeline = $user_info['timeline'];
}
$this->view->site_name = Helper_Config::get('site_name');
$this->view->facebook_connect_url = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_connect&action=connect');
$this->view->facebook_timeline_connect_url = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_connect&action=timeline');
$this->view->facebook_invites_fb = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_invates');
$this->view->add_pin_to_facebook_timeline = isset($settings['facebook_add_pin_to_facebook_timeline']) && $settings['facebook_add_pin_to_facebook_timeline'];
/////////
} else {
$this->noViewRenderer(true);
}
} else {
$this->noViewRenderer(true);
}
} else {
$this->noViewRenderer(true);
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:ConnectController.php
示例7: sendEmail
public static function sendEmail($data)
{
$MY =& MY_Controller::get_instance();
$config_email = Helper_Config::getEmail();
$MY->load->library('email', $config_email);
$oBus = new Response_Business();
$smtp_user = $config_email['smtp_user'];
$messege = "De: " . $data['name'] . " <br>";
$messege .= "Email:" . $data['email'] . " <br>";
$messege .= "Detalle:" . $data['message'] . " <br>";
try {
$MY->email->from($smtp_user, $data['name']);
$MY->email->to('[email protected]');
$MY->email->subject($data['subject']);
$MY->email->message($messege);
if (!$MY->email->send()) {
throw new Exception($MY->email->print_debugger());
}
$oBus->isSuccess(TRUE);
$oBus->message('Email enviado!');
} catch (Exception $ex) {
$oBus->isSuccess(FALSE);
$oBus->message($ex->getMessage());
}
return $oBus;
}
开发者ID:crodriguezn,项目名称:luis-rodriguez-ec,代码行数:26,代码来源:mail_helper.php
示例8: send
public static function send($to, $from, $title, $body = '', $attachmendImagesBody = false)
{
$mail = new JO_Mailer_Base();
// $mail->attachmendImagesBody = $attachmendImagesBody;
$mail->attachmendImagesBody = false;
if (Helper_Config::get('mail_smtp')) {
$mail->SMTPAuth = true;
$mail->IsSMTP();
$mail->Host = Helper_Config::get('mail_smtp_host');
$mail->Port = Helper_Config::get('mail_smtp_port');
$mail->Username = Helper_Config::get('mail_smtp_user');
$mail->Password = Helper_Config::get('mail_smtp_password');
}
$mail->SetFrom($from, '');
$mail->AddReplyTo($from, "");
$mail->Subject = $title;
$mail->AltBody = self::translate("To view the message, please use an HTML compatible email viewer!");
// optional, comment out and test
$mail->MsgHTML($body, BASE_PATH);
$mail->AddAddress($to, "");
$result = $mail->Send();
if ($result) {
return true;
} else {
self::$error = $mail->ErrorInfo;
return false;
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:28,代码来源:Email.php
示例9: translateApiAction
public function translateApiAction()
{
$word = $this->getRequest()->getPost('word');
$from = $this->getRequest()->getPost('from');
$to = $this->getRequest()->getPost('to');
if (!Helper_Config::get('google_translate_key')) {
$this->view->error = 'No Google Translate API key';
} else {
$url = 'https://www.googleapis.com/language/translate/v2?key=' . Helper_Config::get('google_translate_key') . '&q=' . urlencode($word) . '&source=' . $from . '&target=' . $to;
// if (ini_get('allow_url_fopen')) {
// $response = json_decode(@file_get_contents($url), true);
// } else {
// $response = json_decode($this->file_get_contents_curl($url), true);
// }
$response = json_decode($this->file_get_contents_curl($url), true);
if (isset($response['data']['translations'][0]['translatedText'])) {
$this->view->text = $response['data']['translations'][0]['translatedText'];
} elseif ($response['error']['message']) {
$this->view->error = $response['error']['message'];
} else {
$this->view->error = 'Error translate';
}
}
echo $this->renderScript('json');
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:25,代码来源:TranslateController.php
示例10: callRewriteAction
public function callRewriteAction($methodName)
{
$this->setViewChange('index');
$request = $this->getRequest();
$this->view->menuSearch = $this->searchMenu();
$this->view->query = $request->getRequest('q');
/*//get pins data
if($request->isXmlHttpRequest()) {
$this->forward('search_' . $methodName, 'getSearchResult');
}*/
//get pins data
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$this->view->result_data = '';
if (!Helper_Config::get('config_disable_js')) {
if ($request->isXmlHttpRequest()) {
$this->forward('search_' . $methodName, 'getSearchResult');
}
} else {
$class_name = 'search_' . $methodName;
if ($page > 1 && $request->isXmlHttpRequest()) {
$this->forward($class_name, 'getSearchResult');
}
$controller_name = $this->getFrontController()->formatControllerName($class_name);
$instance = new $controller_name();
$pins = (array) $instance->getSearchResultAction(true);
foreach ($pins as $pin) {
$template = new Helper_Tmpl($pin['template'], $pin);
$this->view->result_data .= $template->render($pin['template']);
}
}
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:35,代码来源:SearchController.php
示例11: check
private function check()
{
$this->load->file('application/modules/app/login/login_data.php');
$resAjax = new Response_Ajax();
$dataLogin = new Data_App_Login(TRUE);
$dataLoginError = NULL;
//Helper_Log::write($_SESSION);
try {
$id_company = Helper_Config::getCompanyId();
if (!$dataLogin->isValid($dataLoginError, FALSE)) {
throw new Exception('Complete correctamente todos los campos 001');
}
$oBus = Business_App_User::login($dataLogin->username, $dataLogin->password);
if (!$oBus->isSuccess()) {
throw new Exception($oBus->message());
}
$data = $oBus->data();
/* @var $eUser eUser */
$eUser = $data['eUser'];
Helper_App_Session::init($id_company, $eUser->id);
$resAjax->isSuccess(TRUE);
} catch (Exception $ex) {
$resAjax->isSuccess(FALSE);
$resAjax->message($ex->getMessage());
$resAjax->data('login_error', $dataLoginError->toArray());
}
echo $resAjax->toJsonEncode();
}
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:28,代码来源:login_advancedx.php
示例12: __construct
public function __construct($pin_id)
{
$db = JO_Db::getDefaultAdapter();
$query = self::getListPinsQuery();
//$query->columns(array('pin_next'=>new JO_Db_Expr('('.$db->select()->from(array('next'=>'pins'),'pin_id')->where('pin_id > ?', (string)$pin_id)->order('pin_id ASC')->limit(1).')')));
//$query->columns(array('pin_prev'=>new JO_Db_Expr('('.$db->select()->from(array('prev'=>'pins'),'pin_id')->where('pin_id < ?', (string)$pin_id)->order('pin_id DESC')->limit(1).')')));
if (JO_Session::get('user[user_id]')) {
$query->columns(array('following_board' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . ')-(' . $db->select()->from('users_following_ignore', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . '))')));
$query->columns(array('following_user' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . '))')));
$query->columns(array('following_via' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.via')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.via')->where('board_id = pins.board_id')->limit(1) . '))')));
} else {
$query->columns(array('following_board' => new JO_Db_Expr("0")));
$query->columns(array('following_user' => new JO_Db_Expr("0")));
$query->columns(array('following_via' => new JO_Db_Expr("0")));
}
$rows_source = self::describeTable('pins_sources', 'source_');
$query->joinLeft('pins_sources', 'pins.source_id = pins_sources.source_id', $rows_source);
$query->where('pins.pin_id = ?', (string) $pin_id);
//v2.2
if (Helper_Config::get('config_enable_follow_private_profile')) {
$query = self::filterFriend($query);
}
$response = $db->fetchRow($query);
$response = is_array($response) ? $response : array();
$this->data = $response;
// parent::__construct($response);
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:27,代码来源:Pin.php
示例13: updateAll
public static function updateAll($data)
{
$db = JO_Db::getDefaultAdapter();
if (is_array($data)) {
$delete_pin_no_image = $delete_user_no_image = false;
if (isset($data['images']['no_image']) && basename($data['images']['no_image']) != Helper_Config::get('no_image')) {
$delete_pin_no_image = true;
}
if (isset($data['images']['no_avatar']) && basename($data['images']['no_avatar']) != Helper_Config::get('no_avatar')) {
$delete_user_no_image = true;
}
foreach ($data as $group => $value) {
$db->delete('system', array('`group` = ?' => $group));
if (is_array($value)) {
foreach ($value as $key => $val) {
$serialize = false;
if (is_array($val)) {
$serialize = true;
$val = serialize($val);
}
$db->insert('system', array('group' => $group, 'key' => $key, 'value' => $val, 'system' => (int) ($group == 'config'), 'serialize' => $serialize));
}
}
}
if ($delete_pin_no_image) {
Helper_Db::query("TRUNCATE TABLE `pins_images`");
}
if ($delete_user_no_image) {
Helper_Db::query("TRUNCATE TABLE `users_avatars`");
}
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:32,代码来源:Settings.php
示例14: indexAction
public function indexAction()
{
$request = $this->getRequest();
$places_model = new Model_Source();
$this->view->page_num = $page = $request->getRequest('page', 1);
$this->view->filter_source = $request->getQuery('filter_source');
$url = '';
if ($this->view->filter_source) {
$url .= '&filter_source=' . $this->view->filter_source;
}
$data = array('start' => $page * Helper_Config::get('config_admin_limit') - Helper_Config::get('config_admin_limit'), 'limit' => Helper_Config::get('config_admin_limit'), 'filter_source' => trim($this->view->filter_source));
$this->view->new_record_url = $request->getBaseUrl() . $request->getModule() . '/sources/create/';
$this->view->sources = array();
$sources = $places_model->getSources($data);
if ($sources) {
$imgObject = new Helper_Images();
foreach ($sources as $source) {
$source['edit'] = $request->getModule() . '/sources/edit/?id=' . $source['source_id'];
$this->view->sources[] = $source;
}
}
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$total = $places_model->getTotalSources($data);
$pagination = new Model_Pagination();
$pagination->setLimit(Helper_Config::get('config_admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total);
$pagination->setUrl($this->getRequest()->getModule() . '/sources/?page={page}' . $url);
$this->view->pagination = $pagination->render();
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:SourcesController.php
示例15: __construct
public function __construct($data = array())
{
$db = JO_Db::getDefaultAdapter();
try {
$db->beginTransaction();
$data['user_id'] = isset($data['user_id']) ? $data['user_id'] : JO_Session::get('user[user_id]');
$data['public'] = isset($data['public']) ? (int) $data['public'] : 1;
$data['date_added'] = date('Y-m-d H:i:s');
$board_id = Helper_Db::create('boards', $data);
if (!$board_id) {
return $this;
}
Helper_Db::insert('users_boards', array('user_id' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]'), 'board_id' => $board_id, 'is_author' => 1));
if (isset($data['friends'])) {
foreach ($data['friends'] as $fr) {
Helper_Db::insert('users_boards', array('user_id' => $fr, 'board_id' => $board_id));
}
}
$config_private_boards = Helper_Config::get('config_private_boards');
Helper_Db::update('users', array('boards' => new JO_Db_Expr("(SELECT COUNT(board_id) FROM boards WHERE user_id = '" . (isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')) . "' " . ($config_private_boards ? ' AND public = 1' : '') . ")")), array('user_id = ?' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')));
////autoseo
new Model_Boards_Autoseo($board_id);
$this->board_id = $board_id;
$db->commit();
} catch (JO_Exception $e) {
$db->rollBack();
$this->error = $e->getMessage();
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:29,代码来源:Create.php
示例16: __construct
public function __construct($board_id)
{
$db = JO_Db::getDefaultAdapter();
$board_info = new Model_Boards_Board($board_id);
if ($board_info->count()) {
$config_private_boards = Helper_Config::get('config_private_boards');
$db->update('boards', array('pins' => new JO_Db_Expr('(SELECT COUNT(DISTINCT pin_id) FROM pins WHERE board_id = boards.board_id ' . ($config_private_boards ? ' AND (public = 1 OR board_id = boards.board_id)' : '') . ')'), 'followers' => new JO_Db_Expr('( (SELECT COUNT(DISTINCT user_id) FROM users_following_user WHERE following_id = boards.user_id AND user_id != boards.user_id LIMIT 1) + (SELECT COUNT(DISTINCT user_id) FROM users_following WHERE following_id = boards.user_id AND user_id != boards.user_id LIMIT 1) - (SELECT COUNT(DISTINCT user_id) FROM users_following_ignore WHERE following_id = boards.user_id AND board_id = boards.board_id AND user_id != boards.user_id LIMIT 1) )'), 'latest_pins' => new JO_Db_Expr('( SUBSTRING_INDEX( (SELECT GROUP_CONCAT(pin_id ORDER BY `pin_id` DESC) FROM `pins` WHERE board_id = boards.board_id), \',\', 15 ) )')), array('board_id = ?' => (string) $board_id));
}
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:9,代码来源:UpdateLatestPins.php
示例17: __construct
public function __construct($key = null, $secret = null, $redirect_uri = null)
{
$this->key = $key ? $key : Helper_Config::get('instagram_oauth_key');
$this->secret = $secret ? $secret : Helper_Config::get('instagram_oauth_secret');
if (!$redirect_uri) {
$redirect_uri = WM_Router::create(JO_Request::getInstance()->getBaseUrl() . '?controller=modules_instagram_login');
}
parent::__construct(array('client_id' => $this->key, 'client_secret' => $this->secret, 'grant_type' => 'authorization_code', 'redirect_uri' => $redirect_uri));
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:9,代码来源:Instagram.php
示例18: downloadReports
private function downloadReports()
{
$resAjax = new Response_Ajax();
$this->load->library('library_jasperstarter');
$java_bin = Helper_Config::getBinaryJava();
$this->library_jasperstarter->setPathFolderOutput(BASEPATH . '../application/temp');
$this->library_jasperstarter->setPathJavaBin($java_bin);
$this->library_jasperstarter->dbGeneric('org.firebirdsql.jdbc.FBDriver', 'jdbc:firebirdsql://localhost:3050/C:\\FireBird\\FTT\\DIGIFORTDB.FDB', 'SYSDBA', 'masterkey');
//$MY =& MY_Controller::get_instance();
$date_begin = $this->input->post('date_begin');
$date_end = $this->input->post('date_end');
$rpte_tipo = $this->input->post('rpte_tipo');
$rpte_grupo = $this->input->post('rpte_grupo');
try {
$condicion = ' AND 1=1 ';
if ($rpte_tipo == 'RPTE_CAMARAS_GENERAL') {
$path_file_jasper = BASEPATH . "../application/reports/camaras_general/report.jasper";
$file_name_download = "CAMARA_EN_GENERAL";
$file_name_output = 'camaras_general_' . uniqid();
} else {
if ($rpte_tipo == 'RPTE_GRUPOS_CAMARAS') {
$path_file_jasper = BASEPATH . "../application/reports/grupos_general/rpte_grupos_general.jasper";
$file_name_download = "CAMARA_EN_GENERAL";
$file_name_output = 'camaras_general_' . uniqid();
//$condicion.=' AND 1=1';
foreach ($rpte_grupo as $key => $value) {
$condicion .= "AND ( GRUPO_CAMARA = '" . $value . "' )";
}
} else {
throw new Exception('ERROR DE EJECCIÓN<br/> COMANDO: Tipo de reporte no encontrado');
}
}
$arrParameter = array('fecha_inicio' => $date_begin, 'fecha_fin' => $date_end, 'condicion' => $condicion);
/* @var $oReport oReport */
$oReport = $this->library_jasperstarter->buildReport($path_file_jasper, $file_name_output, $arrParameter, 'xls');
if (!$oReport->isSuccess()) {
throw new Exception('ERROR DE EJECCIÓN<br/> COMANDO: ' . $oReport->cmd());
}
//$data = file_get_contents( $oReport->filePath() ); // Read the file's contents
//force_download($file_name_output, $data);
$mime = get_mime_by_extension($oReport->fileExtension());
//$mime = "application/pdf";
ob_clean();
header("Content-Type: application/force-download");
//header("Content-Disposition: attachment; filename=$file_name_download.xls");
header("Content-Transfer-Encoding: binary");
//header("Content-Length: " . $size);
header("Content-disposition: attachment; filename={$file_name_download}.xls");
header("Content-type: {$mime}");
readfile($oReport->filePath());
} catch (Exception $err) {
echo $err->getMessage();
}
//echo $resAjax->toJsonEncode();
}
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:55,代码来源:reportex.php
示例19: getSearchResultAction
public function getSearchResultAction($return_data = false)
{
$request = $this->getRequest();
$response = $this->getResponse();
$query = $request->getRequest('q');
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$pp = (int) Helper_Config::get('config_front_limit');
if (!(int) $pp) {
$pp = 50;
}
if ((int) $request->getRequest('per_page') > 0 && (int) $request->getRequest('per_page') < 300) {
$pp = (int) $request->getRequest('per_page');
}
$data = array('start' => $pp * $page - $pp, 'limit' => $pp, 'filter_description' => $query);
$return = array();
/* set board count */
$has_pins = true;
if (!trim($query)) {
$has_pins = false;
}
// pins data
$pins = $has_pins ? new Model_Pins_Search($data) : new ArrayObject();
//format response data
$formatObject = new Helper_Format();
if ($has_pins && $pins->count()) {
$banners = Model_Banners::getBanners(new JO_Db_Expr("`controller` = '" . $request->getController() . "' AND position >= '" . (int) $data['start'] . "' AND position <= '" . (int) ($data['start'] + $pp) . "'"));
foreach ($pins->data as $row => $pin) {
///banners
$key = $row + ($pp * $page - $pp);
if (isset($banners[$key]) && $banners[$key]) {
if (($banners_result = $formatObject->fromatListBanners($banners[$key])) !== false) {
$return[] = $banners_result;
}
}
//pins
$return[] = $formatObject->fromatList($pin);
}
} else {
if ($page == 1) {
$message = $this->translate('No pyngs!');
} else {
$message = $this->translate('No more pyngs!');
}
$return[] = $formatObject->fromatListNoResults($message);
}
if ($return_data) {
return $return;
}
$formatObject->responseJsonCallback($return);
$this->noViewRenderer(true);
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:54,代码来源:PinsController.php
示例20: resetAction
public function resetAction()
{
$request = $this->getRequest();
if (!JO_Session::get('user[user_id]')) {
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=login'));
}
$done = $request->issetQuery('done');
$this->view->success = false;
if ($done) {
$this->view->success = true;
}
if ($request->isPost()) {
$validate = new Helper_Validate();
$validate->_set_rules($request->getPost('email'), $this->translate('E-mail'), 'not_empty;min_length[5];max_length[100];email');
if ($validate->_valid_form()) {
$result = Model_Users::forgotPassword($request->getPost('email'));
if ($result) {
if ($result['status']) {
$new_password = Model_Users::generatePassword(8);
$key_forgot = md5($result['user_id'] . md5($new_password));
$add_new_pass = Model_Users::edit($result['user_id'], array('new_password' => $new_password, 'new_password_key' => $key_forgot));
if ($add_new_pass) {
$is_mail_smtp = JO_Registry::forceGet('config_mail_smtp');
$mail = new JO_Mail();
if ($is_mail_smtp) {
$mail->setSMTPParams(JO_Registry::forceGet('config_mail_smtp_host'), JO_Registry::forceGet('config_mail_smtp_port'), JO_Registry::forceGet('config_mail_smtp_user'), JO_Registry::forceGet('config_mail_smtp_password'));
}
$this->view->new_password = $new_password;
$this->view->user_info = $result;
$this->view->forgot_password_href = WM_Router::create($request->getBaseUrl() . '?controller=users&action=login&user_id=' . $result['user_id'] . '&key=' . $key_forgot);
$this->view->header_title = JO_Registry::get('site_name');
$this->view->base_href = WM_Router::create($request->getBaseUrl());
$result_send = Model_Email::send($result['email'], Helper_Config::get('noreply_mail'), $this->translate('Request for forgotten password') . ' ' . JO_Registry::get('site_name'), $this->view->render('send_forgot_password_request', 'mail'));
if ($result_send) {
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=password&action=reset&done='));
} else {
$this->view->error = $this->translate('There was an error. Please try again later!');
}
} else {
$this->view->error = $this->translate('There was a problem with the record. Please try again!');
}
} else {
$this->view->error = $this->translate('This profile is not active.');
}
} else {
$this->view->error = $this->translate('E-mail address was not found!');
}
} else {
$this->view->error = $validate->_get_error_messages();
}
}
$this->view->form_action = WM_Router::create($request->getBaseUrl() . '?controller=password&action=reset');
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:54,代码来源:PasswordController.php
注:本文中的Helper_Config类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论