<script src="<?php echo App::param("siteurl"); ?> js/config.js"></script> <script src="<?php echo App::param("siteurl"); ?> js/select2.min.js"></script> <script src="<?php echo App::param("siteurl"); ?> js/jquery.mCustomScrollbar.concat.min.js"></script> <script> var MyArray = []; MyArray['siteUrl'] = "<?php echo App::param('siteurl'); ?> "; MyArray['siteText'] = "siteText"; MyArray['ckEditorTypeValue'] = '<?php echo App::param('lib'); ?> kcfinder/uploader/upload.php?type=blog'; config.init(MyArray); </script>
public function actionChangePassword() { // $this->heading = "Change Password"; $model = new UserMaster(); if (isset($_POST['UserMaster'])) { $currPwd = $_POST['UserMaster']['CurrentPassword']; $encodedPswd = base64_encode($currPwd); $uId = App::getSession('uid'); $criteria = new CDbCriteria(); $criteria->addCondition("u_id = {$uId} AND user_pass = '******'"); $countUser = $model->findAll($criteria); if (!empty($countUser)) { $model1 = new UserMaster(); $countUser[0]->user_pass = base64_encode($_POST['UserMaster']['NewPassword']); // $model1->modified_on=date('Y-m-d h:i'); $countUser[0]->update(); App::setSession('upassword', md5($countUser[0]->user_pass)); Yii::app()->user->setFlash('success', 'Password has been updated successfully..'); $this->redirect(App::param("siteurl") . "site/index"); } else { Yii::app()->user->setFlash('error', 'Current Password is incorrect..'); $this->redirect(App::param("siteurl") . "userMaster/ChangePassword/"); } } $this->render('changepassword', array('model' => $model)); }
echo App::param('siteurl') . "adminUsersMaster/UserProfile/"; ?> "><i class="fa fa-user"></i> My Profile</a></li>--> <!--<li><a href="<?php //echo App::param('siteurl')."AdminUsersMaster/".App::getSession('uid'); ?> "><i class="fa fa-user"></i> My Profile</a></li>--> <!-- <li><a href="#"><i class="glyphicon glyphicon-cog"></i> Account Settings</a></li> <li><a href="#"><i class="glyphicon glyphicon-question-sign"></i> Help</a></li>--> <li><a href="<?php echo App::param('siteurl'); ?> userMaster/ChangePassword/"><i class="glyphicon glyphicon-question-sign"></i> Change Password</a></li> <li><a href="<?php echo App::param('siteurl'); ?> site/logout/"><i class="fa fa-sign-out"></i> Log Out</a></li> </ul> </div> <!--<h5 class="sidebartitle">Navigation</h5>--> <?php //echo 'hello';die; $menuArr = menu::getMenu(); // App::pr($menuArr); ?> <ul class="nav nav-pills nav-stacked nav-bracket"> <?php foreach ($menuArr as $k => $v) {
<!DOCTYPE html> <html lang="en"> <head> <?php require_once 'head.php'; ?> <script type="text/javascript">var siteurl = "<?php echo App::param("siteurl"); ?> ";</script> <meta http-equiv="refresh" content="<?php echo 1000; ?> "/> </head> <body class="stickyheader"> <div id="loading-image"> <!-- <img src="http://localhost/phoenix_old/bracket-theme/template/images/loaders/loader7.gif" alt="Loading..." />--> </div> <!-- Preloader --> <!-- <div id="preloader"> <div id="status"><i class="fa fa-spinner fa-spin"></i></div> </div>--> <section> <?php // $this->renderPartial('//layouts/sidebar'); require_once 'sidebar.php'; ?>
public static function cancelButton($obj) { $lastUrl = str_replace("index.php/", "", Yii::app()->request->urlReferrer); $currentUrl = str_replace("index.php/", "", "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); if (strtolower($lastUrl) == strtolower($currentUrl)) { $url = App::param("siteurl") . $obj->id . "/admin"; } else { $url = $lastUrl; } $return = '<a class="btn btn-danger btn-sm" id="btncancel" href="' . $url . '">Cancel</a>'; return $return; }
public function importSqlFile($db = '') { if (!empty($db)) { if (isset($db['connectionString'])) { $connectionString = $db['connectionString']; $username = $db['username']; $password = $db['password']; $info = explode(':', $connectionString); $dbInfo = explode(';', $info[1]); $hostnameInfo = explode("=", $dbInfo[0]); $dbnameInfo = explode("=", $dbInfo[1]); $hostname = $hostnameInfo[1]; $dbname = $dbnameInfo[1]; // db connect $pdo = new PDO($connectionString, $username, $password); // file header stuff $output = "-- PHP MySQL Dump\n--\n"; $output .= "-- Host: {$hostname}\n"; $output .= "-- Generated: " . date("r", time()) . "\n"; $output .= "-- PHP Version: " . phpversion() . "\n\n"; $output .= "SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";\n\n"; $output .= "--\n-- Database: `{$dbname}`\n--\n"; // get all table names in db and stuff them into an array $tables = array(); $stmt = $pdo->query("SHOW TABLES"); // App::pr($stmt,2); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $tables[] = $row[0]; } // process each table in the db foreach ($tables as $table) { $fields = ""; $sep2 = ""; $output .= "\n-- " . str_repeat("-", 60) . "\n\n"; $output .= "--\n-- Table structure for table `{$table}`\n--\n\n"; // get table create info $stmt = $pdo->query("SHOW CREATE TABLE {$table}"); $row = $stmt->fetch(PDO::FETCH_NUM); $output .= $row[1] . ";\n\n"; // get table data $output .= "--\n-- Dumping data for table `{$table}`\n--\n\n"; $stmt = $pdo->query("SELECT * FROM {$table}"); while ($row = $stmt->fetch(PDO::FETCH_OBJ)) { // runs once per table - create the INSERT INTO clause if ($fields == "") { $fields = "INSERT INTO `{$table}` ("; $sep = ""; // grab each field name foreach ($row as $col => $val) { $fields .= $sep . "`{$col}`"; $sep = ", "; } $fields .= ") VALUES"; $output .= $fields . "\n"; } // grab table data $sep = ""; $output .= $sep2 . "("; foreach ($row as $col => $val) { // add slashes to field content $val = addslashes($val); // replace stuff that needs replacing $search = array("\\'", "\n", "\r"); $replace = array("''", "\\n", "\\r"); $val = str_replace($search, $replace, $val); $output .= $sep . "'{$val}'"; $sep = ", "; } // terminate row data $output .= ")"; $sep2 = ",\n"; } // terminate insert data $output .= ";\n"; } // App::pr($output,1); $time = date('Y-m-d'); $file_name = $dbname . "_" . $time . ".txt"; $path = App::param('upload_path_local') . 'import_sql/' . $file_name; $f = fopen($path, "wb"); fwrite($f, $output); fclose($f); // chmod($path, 0777); $from = "*****@*****.**"; $subject = "Test Database Dump - " . date('Y-m-d'); $content = "Please Find Attachment of Test Database DB Dump"; // $to = "*****@*****.**"; $to = "*****@*****.**"; $file_to_attach = $path; $sendMail = App::sendmail($content, $subject, $to, $from, '', $file_to_attach); if ($sendMail) { unlink($file_to_attach); } } return true; } return false; }
/** * @covers \Phix\App::currentFormat */ public function testCurrentFormat() { $app = new App(); $this->assertEquals('html', $app->currentFormat()); $app->param('format', 'json'); $this->assertSame('json', $app->currentFormat()); $app->param('format', 'invalid'); $this->assertSame('html', $app->currentFormat()); }
<?php $this->breadcrumbs = array('Face Image Masters' => array('admin'), 'Manage'); ?> <div class="flash-success" id="msg" style="margin-top: 30px; display: none;"></div> <div class="panel panel-default"> <div class="panel-heading"> <div class="row"> <div class="col-md-6"> <h4 class="panel-title">Manage Images</h4> </div> <div class="col-md-6"> <div class="panel-btns"> <!--<a class="btn btn-primary btn-xs" href="<?php echo App::param('siteurl') . $this->id; ?> /Create">Add Magazine</a>--> </div> </div> </div> </div> <div class="panel-body"> <input type="hidden" id="statusId" name="statusId" /> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'face-image-master-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => "{items}\n{summary}{pager}", 'summaryText' => "Showing {start} - {end} of {count} entries", 'pager' => array('header' => ''), 'itemsCssClass' => 'table dataTable no-footer vertical-middle', 'afterAjaxUpdate' => 'js:function(){loadSwitch()}', 'columns' => array(array('header' => '#', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'), array('header' => 'User Name', 'name' => 'UseName', 'type' => 'raw', 'value' => '$data->FaceMaster->user_name'), 'tracer_id', 'image', 'created_on', array('header' => 'Status', 'type' => 'raw', 'value' => function ($data) { $html = '<div class="toggle-inner" style="width: 80px; margin-left: 0px;">'; $html .= '<div class="switch switch-square" data-on-label="Active" data-off-label="Inactive">'; $html .= CHtml::checkBox('is_active', $data->is_active, array('class' => 'switchCls', 'fim_id' => $data->fim_id)); $html .= '</div>';
Yii::app()->clientScript->registerScriptFile(App::param('siteurl') . "js/btvalidationEngine.js", CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile(App::param('siteurl') . "js/btvalidationEngine-en.js", CClientScript::POS_END); ?> <link rel="stylesheet" type="text/css" href="<?php echo App::param('siteurl'); ?> css/validationEngine.css"/> <link rel="stylesheet" type="text/css" href="<?php echo App::param('siteurl'); ?> css/jasny-bootstrap.css"/> <?php Yii::app()->clientScript->registerScript('search', "\n\$(document).ready(function(e){\n\n });\n", CClientScript::POS_END); ?> <script src="<?php echo App::param('lib') . 'ckeditor/ckeditor.js'; ?> "></script> <script> var flag; $(document).ready(function(e) { config.ckEditorFormGet('CmsManagement[cms_page_content]', 'CmsManagement_cms_page_content'); var flag = false; CKEDITOR.instances['CmsManagement_cms_page_content'].on('blur', function() { flag = config.ckEditorValueOnBlur('CmsManagement_cms_page_content'); }); config.eventHandler('#btnSubmit', 'click', function(e) { e.preventDefault(); config.submitForm('#cms-management-form', flag); }); $('select').select2({
public static function getMenu() { $menuArr = array(array('label' => 'Test Management', 'maincontroller' => array('faceImageMasterController'), 'class' => 'fa fa-user', 'url' => '#', 'submenu' => array(array('label' => 'Manage Test Group', 'url' => App::param('siteurl') . 'faceImageMaster/admin', 'controller' => 'faceImageMasterController'), array('label' => 'Create Test Group', 'url' => App::param('siteurl') . 'faceImageMaster/create', 'controller' => 'faceImageMasterController'))), array('label' => 'Contact Us Management', 'maincontroller' => array('contactUsController'), 'class' => 'fa fa-user', 'url' => '#', 'submenu' => array(array('label' => 'Manage Contact Us', 'url' => App::param('siteurl') . 'contactUs/admin', 'controller' => 'contactUsController'))), array('label' => 'CMS Management', 'maincontroller' => array('cmsManagementController'), 'class' => 'fa fa-user', 'url' => '#', 'submenu' => array(array('label' => 'Manage CMS', 'url' => App::param('siteurl') . 'cmsManagement/admin', 'controller' => 'cmsManagementController'), array('label' => 'Create CMS', 'url' => App::param('siteurl') . 'cmsManagement/create', 'controller' => 'cmsManagementController')))); return $menuArr; }
public function testParam() { $this->app->param(array('test' => 'abc')); $this->assertEquals('abc', $this->app->param('test')); $this->assertEquals(array('test' => 'abc'), $this->app->param()); }
public function init() { $this->imagePathTest = App::param('siteurl', 'images/test'); }