query
stringlengths
11
3.13k
ru_query
stringlengths
9
3.91k
document
stringlengths
18
71k
metadata
dict
negatives
listlengths
0
100
negative_scores
listlengths
0
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Prints watch videos page.
Печатает страницу видео с часами.
function wpc_2018_print_watch_videos_content( $content ) { if ( function_exists( 'wpcampus_print_watch_videos' ) ) { wpcampus_print_watch_videos( 'wpc-videos', array( 'playlist' => 'wpcampus-2018', 'show_event' => false, 'show_filters' => false, )); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpc_2016_print_watch_videos_content( $content ) {\n\tif ( function_exists( 'wpcampus_print_watch_videos' ) ) {\n\t\twpcampus_print_watch_videos( 'wpc-videos', array(\n\t\t\t'playlist' => 'wpcampus-2016',\n\t\t\t'show_event' => false,\n\t\t\t'show_filters' => false,\n\t\t));\n\t}\n}", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "public function watch () {\n\n\t\t$data_view = 'grid';\n\n\t\t// Grab an unknown number of arguments\n\t\t$args = func_get_args();\n\n\t\t// Grab the video ID from the arguments\n\t\t$video_id = array_pop($args);\n\n\t\t// Trash the slug and the \"watch\" segment\n\t\tarray_pop($args);\n\n\t\t// Tell the controller to skip the views within the index method\n\t\t$this->skip = true;\n\n\t\t// Call the index method because we don't want to duplicate code\n\t\tcall_user_func_array(array($this, 'index'), $args);\n\n\t\t// Get the specific video's details\n\t\t$this->data['video'] = $this->videos->get_by_id($video_id);\n\n\t\t$this->data['active_video_id'] = $video_id;\n\t\t$this->data['rating'] = null;\n\t\t$this->data['related-videos'] = null;\n\t\tif($this->data['video'] != null)\n\t\t{\n\t\t\t$this->data['active_video_id'] = $this->data['video']->id;\n\t\t\t// Get comments for video\n\t\t\t$this->data['comments'] = $this->comments->get($this->data['video']->id, 0, $this->config->item('comment-size'));\n\t\t\tif($this->data['comments'] != null) $this->data['comments_cnt'] = sizeof($this->data['comments']);\n\t\t\t// Get rating value\n\t\t\t$this->data['rating'] = $this->ratings->get($this->data['video']->id);\n\t\t\t// Get related videos\n\t\t\t$collection = $this->videos->get_related_videos($this->data['video']->id);\n\t\t\t$this->data['related_videos'] = $collection->videos;\n\t\t\t// set scroll pagination for related videos\n\t\t\t$this->data['scroll_links_related'] = $this->nav->get_scroll_bullets(sizeof($this->data['related_videos']), 'related videos');\n\t\t}\n\n\t\t// Append to the page title\n\t\t$this->data['title'] .= lang('title-separator') . $this->data['video']->name;\n\n\t\t// Create a search crumb\n\t\t$this->nav->make_breadcrumbs((object) array('uri' => 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'], 'name' => $this->data['video']->name));\n\n\t\t// Get the breadcrumbs created during the index lookup\n\t\t$this->data['breadcrumbs'] = $this->nav->make_breadcrumbs();\n\n\t\t// Set breadcrumb display\n\t\t$this->data['breadcrumb_display'] = $this->nav->breadcrumbs_display_text($this->data['breadcrumbs']);\n\n\t\t// If lineup id specificied, override data and grid with lineup view\n\t\tif(isset($this->data['lineup_data']))\n\t\t{\n\t\t\t$this->data['videos'] = $this->data['lineup_data'][0]->videos; \n\t\t\t$data_view = 'grid-lineups';\n\t\t\t// in case popular videos is empty, use videos from lineup playlist\n\t\t\tif($this->data['popular_videos'] == null || sizeof($this->data['popular_videos'])) {\n\t\t\t\t$this->data['popular_videos'] = $this->data['videos'];\n\t\t\t}\n\t\t}\n\n\t\t//$this->loadViews(array('player', 'grid','lineup','featuredproviders'), $this->data);\n\t\t$this->loadViews(array('video-details','sidebar-left',$data_view,'sidebar-right'), $this->data);\n\n\t}", "public function indexAction() {\n\t if($this->settings['channel']) {\n\t $videos = $this->videoRepository->getUserUploads($this->settings['channel']); \n } else {\n $this->videoRepository->setQuery($this->settings);\n $queryUrl = $this->videoRepository->getQueryUrl(); \n\t\t $videos = $this->videoRepository->getVideos($query); \n\t\t $this->view->assign('query', $queryUrl);\n } \n\t\t$this->view->assign('videos', $videos);\n\t\tif($this->settings['singlePageOnListPage']) {\n\t\t $comments = $this->videoRepository->getComments($videos[0][vid]);\n\t\t $this->view->assign('comments', $comments);\n $this->response->addAdditionalHeaderData('\n <style>\n .tx-youtubeapi-video-list {\n \t\t\tfloat:left;\t\n \t\t\twidth:50%;\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-youtubeapi-video-single {\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-pagebrowse-pi1 {\n clear: both;\n }\n </style>');\n }\n \n\t\t$this->view->assign('settings', $this->settings);\n\t}", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "public function view_videos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Videos\";\n $videoListArray = $this->registry->model->run(\"getAllVideoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->VideoListArray = $videoListArray;\n $this->registry->template->show(\"view_videos\");\n }", "public function index()\n {\n $videos = $this->video->orderBy('id', 'desc')->paginate(10);\n\n $data = ['videos' => $videos, 'title' => $this->title];\n\n return view('admin.videos.index')->with($data);\n }", "function wpc_2016_enable_watch_videos() {\n\tif ( function_exists( 'wpcampus_network_enable' ) ) {\n\t\twpcampus_network_enable( 'videos' );\n\t}\n}", "public function index()\n {\n //\n session()->put('activeMenu', 'manageVideo');\n\n $videos = DB::table('videos')\n ->join('categories', 'videos.categoryID', '=', 'categories.categoryID')\n ->select('videos.videoID', 'videos.videoName', 'videos.videoDescription', 'videos.categoryID', 'categories.categoryName', 'videos.created_at', 'videos.updated_at')\n ->paginate(10);\n\n return view('video.videos', compact('videos'));\n }", "public function index()\n {\n return view('mediamanagement::Frontend.Video.index')\n ->withVideos($this->video->getActive())\n ->withSeo($this->seo->findByField('page', 'video'));\n }", "function wpc_2018_enable_watch_videos() {\n\tif ( function_exists( 'wpcampus_network_enable' ) ) {\n\t\twpcampus_network_enable( 'videos' );\n\t}\n}", "function video() {\n echo json_encode(array('element' => '<video controls autoplay> <source src=\"skysignagelight.1564484463.mp4\" type=\"video/mp4\"></video>'));\n exit;\n }", "public function index()\n {\n $videos = Video::paginate(15);\n\n return view('admin.videos.index', compact('videos'));\n }", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function index()\n {\n $videos = Video::latest()->paginate(20);\n return view('videos.index', compact('videos'))->with('1', (request()->input('page', 1) - 1) * 20);\n }", "public function index()\n {\n $videos = Videos::paginate();\n\n return view('admin.videos.index', compact('videos'));\n }", "public function index()\n {\n $cat = Video::all();\n return view('admin.video.index', compact('cat'));\n }", "public function index()\n {\n $title = 'Video Management';\n\n $video = Video::all();\n\n return view('video::index', ['videos' => $video])->withTitle($title);\n }", "public function getIndex()\n {\n // Title\n $title = Lang::get('admin/videos/title.video_management');\n\n // Grab all the videos\n $videos = $this->video;\n\n // Show the page\n return View::make('admin/videos/index', compact('videos', 'title'));\n }", "public function index()\n {\n \treturn view('panel.video.index');\n }", "public function index()\n {\n $video = Video::all();\n return view('admin.videos.index', compact('video'));\n }", "protected function getVideo()\n {\n $names = $this->generateVideoName();\n $command = implode(' ', [\n $this->getVideoServiceConfig('video_app'),\n '-i ' . $this->getVideoServiceConfig('video_source'),\n '-c copy',\n '-f mp4',\n '-t ' . $this->getVideoServiceConfig('video_length'),\n $names['file'],\n '1> ' . $names['log'],\n '2>&1',\n ]);\n\n if (0 === stripos(PHP_OS, 'WIN')) {\n pclose(popen('start /B ' . $command, 'r'));\n } else {\n pclose(popen($command . ' &', 'r'));\n }\n\n $this->createNewRecording($names['file']);\n if ($this->checkLog($names['log'])) {\n $this->getVideo();\n }\n }", "public function index()\n {\n $videos=auth()->user()->videos->sortByDesc('created_at');\n $title='last uploaded videos';\n\n return view('videos.my-videos',compact('videos','title'));\n }", "function pavi_the_display_video($args = array()){\n echo pavi_get_display_video($args);\n}", "public function index()\n\t{\n\t\techo \"Call the combine method to concatenate your videos.\";\n\t}", "public function index()\n {\n $videos = Video::all();\n\n return view('admin.videos.index', compact('videos'));\n }", "public function index()\n {\n $videos = Video::all();\n return view('admin.videos.index', compact('videos'));\n }", "public function index()\n {\n $videos = Video::orderBy('id','DESC')->get();\n \n return view('admin.video.index',compact('videos'));\n }", "public function render()\n {\n return view('components.video');\n }", "public function getVideos()\n {\n echo \"11\";\n }", "function grve_print_portfolio_video( $video_mode = '' ) {\n\n\t$video_webm = grve_post_meta( 'grve_portfolio_video_webm' );\n\t$video_mp4 = grve_post_meta( 'grve_portfolio_video_mp4' );\n\t$video_ogv = grve_post_meta( 'grve_portfolio_video_ogv' );\n\t$video_embed = grve_post_meta( 'grve_portfolio_video_embed' );\n\n\tgrve_print_media_video( $video_mode, $video_webm, $video_mp4, $video_ogv, $video_embed );\n}", "public function mostrarVideoVistaController()\n {\n //llamando al modelo\n $respuesta = @GestorVideosModel::mostrarVideoVistaModel(\"videos\");\n\n foreach ($respuesta as $dato) {\n echo '<li id=\"' . $dato['id'] . '\" ruta=\"' . $dato['ruta'] . '\" class=\"bloqueVideo\">\n <span class=\"fa fa-times eliminarVideo\"></span>\n <video controls class=\"handleVideo\">\n <source src=\"' . substr($dato['ruta'], 6) . '\" type=\"video/mp4\">\n </video>\n </li>';\n }\n\n }", "function printVideo($photo_id, $secret){\n\n\t\t$video = $this->getPhotoSizes($photo_id);\n\t\t$output = '<object style=\"max-width: 100% important;\" type=\"application/x-shockwave-flash\" width=\"'.$video->sizes->size[9]->width.'\" height=\"'.$video->sizes->size[9]->height.'\" data=\"'.$video->sizes->size[9]->source.'\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">';\n\t\t$output .= '<param name=\"flashvars\" value=\"intl_lang=en-us&amp;photo_secret='.$secret.'&amp;photo_id='.$photo_id.'&amp;flickr_show_info_box=false\"></param>';\n\t\t$output .= '<param name=\"movie\" value=\"'.$video->sizes->size[9]->source.'\"></param>';\n\t\t$output .= '<param name=\"bgcolor\" value=\"#000000\"></param>';\n\t\t$output .= '<param name=\"allowFullScreen\" value=\"true\"></param>';\n\t\t$output .= '<embed type=\"application/x-shockwave-flash\" src=\"'.$video->sizes->size[9]->source.'\" bgcolor=\"#000000\" allowfullscreen=\"true\" flashvars=\"intl_lang=en-use&amp;photo_secret='.$secret.'&amp;photo_id='.$photo_id.'&amp;flickr_show_info_box=false\" height=\"'.$video->sizes->size[9]->height.'\" width=\"'.$video->sizes->size[9]->width.'\"></embed>';\n\t\t$output .= '</object>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function actionVideo()\n {\n\n $arrParams = Yii::$app->request->queryParams;\n $arrParams['ArticleSearch']['category_id'] = Article::CAT_VIDEO;\n $searchModel = new ArticleSearch();\n $dataProvider = $searchModel->search($arrParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['published_at'=>SORT_DESC]\n ];\n\n return $this->render('index_video', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function index()\n {\n //\n $videos = Video::all();\n return view('video.list', ['videos' => $videos]);\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function index()\n {\n $videos = Video::orderBy('id','desc')->get();\n return view('admin.videos.index', compact('videos'));\n }", "public function actionIndex()\n {\n $searchModel = new VideoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function grve_print_media_video( $video_mode, $video_webm, $video_mp4, $video_ogv, $video_embed ) {\n\tglobal $wp_embed;\n\t$video_output = '';\n\n\tif( empty( $video_mode ) && !empty( $video_embed ) ) {\n\t\t$video_output .= '<div class=\"grve-media\">';\n\t\t$video_output .= $wp_embed->run_shortcode( '[embed]' . $video_embed . '[/embed]' );\n\t\t$video_output .= '</div>';\n\t} else {\n\n\t\tif ( !empty( $video_webm ) || !empty( $video_mp4 ) || !empty( $video_ogv ) ) {\n\t\t\t$video_output .= '<div class=\"grve-media\">';\n\t\t\t$video_output .= ' <video controls>';\n\n\t\t\tif ( !empty( $video_webm ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_webm . '\" type=\"video/webm\">';\n\t\t\t}\n\t\t\tif ( !empty( $video_mp4 ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_mp4 . '\" type=\"video/mp4\">';\n\t\t\t}\n\t\t\tif ( !empty( $video_ogv ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_ogv . '\" type=\"video/ogg\">';\n\t\t\t}\n\t\t\t$video_output .=' </video>';\n\t\t\t$video_output .= '</div>';\n\n\t\t}\n\t}\n\n\techo $video_output;\n\n}", "public function index()\n \t{\n \t\t$videos=Video::orderBy('listing_order','desc')\n ->orderBy('updated_at','desc')->get();\n\n \t\treturn view('admin.video.manage',compact('videos'));\n \t}", "public function index()\n {\n $videos = Video::OrderBy('id','desc')->get();\n return view('Admin.Videos.index')\n ->with('videos',$videos);\n }", "public function PaginacionVideos()\n\t{\n\t\t$items_per_page = Input::get('can');\n\t\t$ordenar_items = Input::get('orde');\n\t\t$forma_orden = Input::get('por');\n\t\t$campos = array('id', 'title', 'videourl','rate','times_viewed','thumburl');\n $config = ConfigApp::First()->get();\n \n $items = Video::where('published', '=', 1)->where('memberid', '=', $config[0][\"UserJoomla\"])->where('filepath', '!=', 'File')->orderBy($ordenar_items, $forma_orden)->select($campos)->paginate($items_per_page);\n if ($items->isEmpty()) {\n\t\t echo '<div class=\"box-content\"><legend id=\"uniq\" class=\"alert alert-info\">No hay videos para visualizar</legend></div>';\n\t\t exit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$view = View::make('pages.video.items')->with('items', $items);\n\t\t echo $view;\n\t\t exit;\n\t\t}\n\t}", "public function index(){\n $data['videos'] = $this->repository->getModel()->all();\n return view('admin_content.videos.index',$data);\n }", "public function allVideos()\n {\n return view('orientation-route::all-videos')\n ->withVideos($this->video->orderBy('order_number', 'asc')->get());\n }", "public function viewVideoAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$pageSession = new Container('fo_page');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t$request\t= $this->getRequest();\n\t\t$id\t\t\t= $this->params()->fromRoute('id', 0);\n\t\t$originalID\t= base64_decode($id);\n\t\t$videoArray\t= $this->getVideoDetails($originalID);\n\t\t\n\t\t//\tTrack Video Views\n\t\tif(!isset($pageSession->pageSession['last_video']) || (isset($pageSession->pageSession['last_video']) && $pageSession->pageSession['last_video'] != $originalID)) {\n\t\t\t$this->trackVideoViews($originalID);\n\t\t\t$pageSession->pageSession\t= array('last_video' => $originalID);\n\t\t\t\n\t\t\t//\tAssign the recently viewed video in session\n\t\t\t$mediaArray\t\t\t\t\t\t= $userSession->mediaSession;\n\t\t\t$videosArray\t\t\t\t\t= $mediaArray['videos'];\n\t\t\t$videosArray[strtotime('now')]\t= $originalID;\n\t\t\t$mediaArray['videos']\t\t\t= $videosArray;\n\t\t\t$userSession->mediaSession\t\t= $mediaArray;\n\t\t}\n\t\t//\tMedia Tags\n\t\t$mediaIdArray[]\t= (string)$videoArray['_id'];\n\t\t$mediaTags\t\t= $this->getMediaTags($mediaIdArray, 1);\n\t\t\n\t\t//echo '<pre>===>'; print_r($mediaTags); echo '</pre>';\n\t\t//\tRecommended Videos\n\t\t$videoSession \t\t= new Container('fo_videos_recommended');\n\t\t$recommendedArray\t= array('title'\t\t=> $videoArray['media_title'],\n\t\t\t\t\t\t\t\t\t'category'\t=> $videoArray['media_category'],\n\t\t\t\t\t\t\t\t\t'tags'\t\t=> $mediaTags,\n\t\t\t\t\t\t\t\t\t'id'\t\t=> new \\MongoId($videoArray['_id']));\n\t\t$videoSession->videoSession\t= $recommendedArray;\n\t\t\n\t\t$tempUserSession= $userSession->mediaSession;\n\t\t$extFriendsArray= array();\n\t\t\n\t\tif(isset($tempUserSession['friends']) && is_array($tempUserSession['friends']) && count($tempUserSession['friends']) > 0 && count($mediaIdArray) > 0) {\n\t\t\t$extFriendsArray\t= $this->getExtendedFriends($tempUserSession['friends'], $mediaIdArray);\n\t\t}\n\t\t\n\t\t$likes\t\t= $this->getVideoLikes((string)$videoArray['_id']);\n\t\t$like\t= 0;\n\t\t$dislike= 0;\n\t\tif(is_array($likes) && count($likes) > 0) {\n\t\t\tforeach($likes as $lkey => $lvalue) {\n\t\t\t\tif($lvalue['rating'] == 'like') {\n\t\t\t\t\t$like++;\n\t\t\t\t} else if($lvalue['rating'] == 'dislike') {\n\t\t\t\t\t$dislike++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'extended'\t\t=> $extFriendsArray,\n\t\t\t'videoArray'\t=> $videoArray,\n\t\t\t'like'\t\t\t=> $like,\n\t\t\t'dislike'\t\t=> $dislike,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }", "public function index(VideoStorage $vs)\n {\n $currentDate = Carbon::now();\n\n $videos = Video::whereDate(\"published_date\", \">\", $currentDate->subDays(config('gb.index_show_days_video')))\n ->orWhere(\"status\", \"=\", \"DOWNLOADED\")->orderBy('published_date', 'desc')\n ->paginate();\n\n $videoSizing = new VideoSizing();\n $videoSizing->getDirectorySize(\"gb_videos\");\n\n return view('main', ['videos' => $videos,\n 'humanSize' => $videoSizing->returnAsHuman(),\n 'dirPercentage' => $videoSizing->returnAsPercentage(config('gb.storage_limit')),\n 'rawSize' => $videoSizing->returnAsBytes()]);\n }", "function aidtransparency_print_vimeo_videos($post = null, $number = 2)\r\n{\r\n global $post;\r\n $vidoesStr = false; //types_render_field(\"home_page_vimeo\", array( 'post_id' => $post->ID, 'raw' => true ) );\r\n $videoIds = array_map( 'trim', explode(',', $vidoesStr) );//Make into array and trim members\r\n if(count($videoIds) > 0) :\r\n $count = 1;\r\n ?>\r\n <div class=\"videos\">\r\n <?php foreach ($videoIds as $videoId) : if( $count > $number ) continue; ?>\r\n <div class=\"video <?php print sweetapple_get_row_class($count, 2);?>\" >\r\n <a href=\"http://vimeo.com/<?php echo $videoId;?>\" class=\"vimeo-video\" data-vimeoid=\"<?php echo $videoId;?>\">View this Vimeo video</a>\r\n </div>\r\n <?php $count++; endforeach;?>\r\n </div><!--.videos -->\r\n <?php endif;\r\n}", "public function render(Video $video): string;", "public function lecteurVideoAction($ListeDesVideos){\n\t\n\t\t$html ='<script>\n\t\t\t\t var tab = [];\n\t\t </script>';\n\t\t$i = 0;\n\t\tforeach ($ListeDesVideos as $Liste) {\n\t\t\t\t\n\t\t\tif($Liste['format'] == \"video/mp4\" || $Liste['format'] == \"video/m4v\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .' <span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"m4v\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t\telse\n\t\t\tif($Liste['format'] == \"video/webm\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .'<span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"webmv\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\t \n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t}\n\t\n\t\t$html .='<script>\n\t\t\t\t $(document).ready(function(){\n\t\n\t new jPlayerPlaylist({\n\t\t jPlayer: \"#jquery_jplayer_1\",\n\t\t cssSelectorAncestor: \"#jp_container_1\"\n\t },\n\t\t\t\t tab\n\t\t\t\t ,{\n\t\t swfPath: \"../../dist/jplayer\",\n\t\t supplied: \"webmv, ogv, m4v\",\n\t\t useStateClassSkin: true,\n\t\t autoBlur: false,\n\t\t smoothPlayBar: true,\n\t\t keyEnabled: true\n\t });\n\t\n });\n\t\n\t\t\t\tscriptAjoutVideo();\n\t\t </script>';\n\t\t\t\n\t\t$html .='\n\t\n\t\t<form id=\"my_form_video\" method=\"post\" action=\"/simens/public/consultation/ajouter-video\" enctype=\"multipart/form-data\">\n\t\t<div id=\"jp_container_1\" class=\"jp-video jp-video-270p\" role=\"application\" aria-label=\"media player\" style=\"margin: auto;\">\n\t <div class=\"jp-type-playlist\">\n\t\t<div id=\"jquery_jplayer_1\" class=\"jp-jplayer\"></div>\n\t\t<div class=\"jp-gui\">\n\t\t\t<div class=\"jp-video-play\">\n\t\t\t\t<button class=\"jp-video-play-icon\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t</div>\n\t\t\t<div class=\"jp-interface\">\n\t\t\t\t<div class=\"jp-progress\">\n\t\t\t\t\t<div class=\"jp-seek-bar\">\n\t\t\t\t\t\t<div class=\"jp-play-bar\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-current-time\" role=\"timer\" aria-label=\"time\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-duration\" role=\"timer\" aria-label=\"duration\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-controls-holder\">\n\t\t\t\t\t<div class=\"jp-controls\">\n\t\t\t\t\t\t<button class=\"jp-previous\" role=\"button\" tabindex=\"0\">previous</button>\n\t\t\t\t\t\t<button class=\"jp-play\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t\t\t\t<button class=\"jp-next\" role=\"button\" tabindex=\"0\">next</button>\n\t\t\t\t\t\t<button class=\"jp-stop\" role=\"button\" tabindex=\"0\">stop</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-volume-controls\">\n\t\t\t\t\t\t<button class=\"jp-mute\" role=\"button\" tabindex=\"0\">mute</button>\n\t\t\t\t\t\t<button class=\"jp-volume-max\" role=\"button\" tabindex=\"0\">max volume</button>\n\t\t\t\t\t\t<div class=\"jp-volume-bar\">\n\t\t\t\t\t\t\t<div class=\"jp-volume-bar-value\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-toggles\">\n\t\t\t\t\t\t<button class=\"jp-full-screen\" role=\"button\" tabindex=\"0\">full screen</button>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t <div class=\"jp-toggles2\" id=\"jp-toggles-video\" >\n\t\t\t\t <div class=\"jp-ajouter-video\">\n\t\t\t\t <input type=\"file\" name=\"fichier-video\" id=\"fichier-video\">\n\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-details\">\n\t\t\t\t\t<div class=\"jp-title\" aria-label=\"title\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jp-playlist\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;</li>\n\t\t\t</ul>\n\t\t</div>\n\t </div>\n </div>\n\t\t</form>';\n\t\treturn $html;\n\t}", "public function index()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n\n $videos = Video::all();\n\n\n \n\n return view('admin.videos.index', compact('videos', 'usuario'));\n }", "function plgContentplug_hwd_vs_videoplayer()\r\n\t{\r\n\t}", "public function actionVideo_tutorials()\t\n\t\t\n\t {\t\n\t \n $this->pageTitle='Video Tutorials - Business Supermarket';\n\t\t\t \n $this->render('video_tutorials',array('model' =>$model));\n\t\t\t \n\t }", "public function index()\n {\n $videos = Video::published()->orderBy('id', 'desc');\n if(request()->has('search') && request()->get('search') != ''){\n $videos = $videos->where('name', 'like', '%'.request()->get('search').'%');\n }\n $videos = $videos->paginate(30);\n return view('home', compact('videos'));\n }", "public function index()\n {\n $videos = Video::inRandomOrder()->paginate(12);\n return view('welcome', compact('videos', 'movielist'));\n }", "public function index()\n {\n $data = Iklanvideo::paginate(6);\n return view('admin.datavideo.index')->with('data', $data);\n }", "function tpl_show($video)\n{\n global $smarty, $config;\n\n // imageurl\n $video['imgurl'] = getThumbnail($video['imgurl'], $video['title']);\n\n // make soft linebreaks:\n $video['filename'] = preg_replace('/(_|\\.|-)/', '$1<wbr />', $video['filename']);\n\n // split comma-separated countries, prevent empty array\n $video['country'] = preg_split('/,\\s*/', $video['country'], -1, PREG_SPLIT_NO_EMPTY);\n\n // split comma-separated multiple languages, prevent empty array\n $video['language'] = preg_split('/,\\s*/', $video['language'], -1, PREG_SPLIT_NO_EMPTY);\n\n // humanreadable filesize:\n $video['filesize'] = round($video['filesize']/(1024*1024), 2);\n\n // break plot and comment\n $video['plot'] = nl2br($video['plot']);\n $video['comment'] = nl2br($video['comment']);\n\n\t// cast\n $smarty->assign('cast_toggle', $config['showcasttoggle']);\n $show_cast = true;\n if ($config['showcasttoggle'])\n {\n $show_cast = (isset($_GET['show_cast']) && $_GET['show_cast'] == '1');\n }\n $smarty->assign('show_cast', $show_cast);\n $video['cast'] = [];\n if ($show_cast)\n {\n \t$video['cast'] = prepare_cast($video['actors']);\n }\n\n // prepare the custom fields\n customfields($video, 'out');\n\n // hide owner if not using multi-user\n if (!$config['multiuser']) unset($video['owner']);\n\n // get drilldown url for image\n if ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], engineGetEngine($video['imdbID'])));\n }\n\n // add episodes information\n if (array_key_exists('episodes', $video) && is_array($video['episodes']))\n {\n // allow multiple columns\n $smarty->assign('listcolumns', session_get('listcolumns'));\n }\n\n $smarty->assign('castcolumns', $config['castcolumns']);\n $smarty->assign('video', $video);\n\n // get genre ids and names\n $smarty->assign('genres', getItemGenres($video['id'], true));\n\n // make engines available\n $smarty->assign('engines', $config['engine']);\n\n // allow XML export\n foreach (array('xls','pdf','xml') as $export)\n {\n if ($config[$export]) $smarty->assign($export, 'show.php?id='.$video['id'].'&amp;');\n }\n // new-style way of exporting\n // $smarty->assign('exports', listExports('show.php?id='.$video['id'].'&amp;'));\n}", "function bp_videossubnav_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->control_panel_store_video();\n\t}", "public function show(VideoType $video_type)\n {\n //\n }", "public function index()\n {\n $user = Auth::user();\n $videos_ativos = Videos::where('excluido', 0)->get();\n $videos_excluidos = Videos::where('excluido', 1)->get();\n\n return view('pages.painel.listar.video.index', compact('user', 'videos_ativos', 'videos_excluidos'));\n }", "public function showScheduledMovies()\n {\n try {\n $movieRepository = $this->getRepository('movie');\n $totalMovies = $movieRepository->getRowsCount();\n\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $this->getQueryParam('movies_per_page');\n\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n\n $movieList = $movieRepository->loadPage($paginator->getCurrentPage(), $paginator->getResultsPerPage());\n\n $context = [\n 'paginator' => $paginator,\n 'movieList' => $movieList,\n ];\n\n return $this->render('showscheduledmovies', $context);\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong!');\n\n return $this->render('showscheduledmovies', $context);\n }\n }", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "public function index()\n {\n $auth = Auth::user();\n if(! $auth->access()->admin) {\n $videos = $this->video->whereIn('access_name', $auth->accessList())\n ->orderBy('order_number', 'asc')->get();\n }else {\n $videos = $this->video->orderBy('order_number', 'asc')->get();\n }\n return view('orientation-route::all')\n ->withVideos($videos);\n }", "function getVideos($url, $width, $height, $config) {\r\n \t$video = '';\r\n\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\r\n // youtube\r\n if (strpos($url,'outube.com')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.youtube.com/v/'.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // Dailymotion\r\n } elseif (strpos($url,'ailymotion.co')) {\r\n $found = 1;\r\n $video = 'new SWFObject(\"http://'.$url.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // video.google.com/.de\r\n } elseif (strpos($url,'ideo.google.')) {\r\n $found = 1; \r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://video.google.com/googleplayer.swf?docId='.$split[1].'&hl='.$GLOBALS['TSFE']->lang.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // Metacafe\r\n } elseif (strpos($url,'metacafe.')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.metacafe.com/fplayer/'.$split[2].'/.swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // MyVideo.de\r\n } elseif (strpos($url,'yvideo.de')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.myvideo.de/movie/'.$split[2].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // clipfish.de\r\n\t\t} elseif (strpos($url,'lipfish.de')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.clipfish.de/videoplayer.swf?as=0&videoid='.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n\t\t// sevenload\r\n\t\t} elseif (strpos($url,'sevenload.com')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://de.sevenload.com/pl/'.$split[2].'/'.$width.'x'.$height.'/swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n } \r\n\r\n\t\treturn $video;\r\n\t}", "public function getWatchedVideos($page = 0, $limit = 0) {\n\t\t$conn\t\t\t= $this->connect();\n\t\t$userSession\t= new Container('fo_user');\n\t\t//\tWatched Videos\n\t\t$videoWatchedSession\t= new Container('fo_videos_watched');\n\t\t$skip\t\t\t= ($page - 1) * $limit;\n\t\t$collection\t\t= $conn->snapstate->media_views;\n\t\t$sort\t\t\t= array('date_viewed' => 1);\n\t\t$document\t\t= array('user_id' => (string)$userSession->userSession['_id']);\n\t\t\n\t\t/*\tif($limit > 0)\n\t\t\t$results\t= $collection->find($document)->skip($skip)->limit($limit)->sort($sort);\n\t\telse\n\t\t\t$results\t= $collection->find($document)->sort($sort);\n\t\treturn $results;\t*/\n\t\t\n\t\t/*\t// use all fields\n\t\t$keys = array(\"media_id\" => 1);;\n\t\t// set intial values\n\t\t$initial = array(\"items\" => array());\n\t\t// JavaScript function to perform\n\t\t$reduce = \"function (obj, prev) { prev.items.push(obj.date_viewed); }\";\n\t\t$condition = array('condition' => $document);\n\t\t$results\t= $collection->group($keys, $initial, $reduce, $condition);\n\t\treturn $results;\t\n\t\t\t*/\n\t\t\n\t\t$results\t= $collection->aggregate(array(\n\t\t\t\t\t\t array('$match' => $document),\n\t\t\t\t\t\t array('$group' => array('_id' => '$media_id', 'views' => array('$sum' => 1))),\n\t\t\t\t\t\t));\n\t\t$resultArray['total']\t= (isset($results['result'])) ? count($results['result']) : 0;\n\t\t$sort\t\t= array('views' => -1);\n\t\t$results\t= $collection->aggregate(array(\n\t\t\t\t\t\t\tarray('$match' => $document),\n\t\t\t\t\t\t array('$group' => array('_id' => '$media_id', 'date' => array('$max' => '$date_viewed'), 'views' => array('$sum' => 1))),\n\t\t\t\t\t\t array('$sort' => $sort),\n\t\t\t\t\t\t\tarray('$skip' => $skip),\n\t\t\t\t\t\t\tarray('$limit' => $limit),\n\t\t\t\t\t\t));\n\t\t$resultArray['records']\t= (isset($results['result'])) ? $results['result'] : array();\n\t\treturn $resultArray;\n\t\t\n\t}", "public function show(UploadVideo $uploadVideo)\n {\n //\n }", "public function index()\n {\n $format = Carbon::now()->subMonth();\n $videos = $this->video->where('user_id', Auth::user()->id);\n $username = Auth::user()->username;\n $categories = Category::all();\n $latest = $this->video->whereDateFormat('created_at', '>=', $format);\n\n return view('pages.library', compact('videos', 'latest', 'username'))->with('categories', $categories);\n }", "public function index()\n {\n $videos = DB::select('SELECT * from video order by created_at DESC');\n $likes = Like::all();\n return view('videos.index', compact(['videos', 'likes']));\n }", "public function print_downloads_page() {\n\n\t\t$admin_url = add_query_arg(\n\t\t\t[\n\t\t\t\t'post_type' => 'schedule',\n\t\t\t\t'page' => 'conf-schedule-downloads',\n\t\t\t], admin_url( 'edit.php' )\n\t\t);\n\n\t\t$hootsuite_tmpl_url = add_query_arg(\n\t\t\t[\n\t\t\t\t'dwnld_hootsuite_template_csv' => 1,\n\t\t\t], $admin_url\n\t\t);\n\n\t\t$schedule_info_url = add_query_arg(\n\t\t\t[\n\t\t\t\t'dwnld_session_info_csv' => 1,\n\t\t\t], $admin_url\n\t\t);\n\n\t\t$hootsuite_tmpl_csv = wp_nonce_url( $hootsuite_tmpl_url, 'dwnld_hootsuite_template_csv', 'dwnld_hootsuite_template_csv_nonce' );\n\t\t$schedule_info_csv = wp_nonce_url( $schedule_info_url, 'dwnld_session_info_csv', 'dwnld_session_info_csv_nonce' );\n\n\t\t?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n <ul>\n <li><a href=\"<?php echo $hootsuite_tmpl_csv; ?>\">Hootsuite template for day-of tweets</a></li>\n <li><a href=\"<?php echo $schedule_info_csv; ?>\">Session information, including feedback URLs</a></li>\n </ul>\n </div>\n\t\t<?php\n\n\t}", "public function show($id)\n {\n return view('video::show');\n }", "public function print_preview_page() {\n\n\t\t?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<?php\n\n\t\t\techo conference_schedule()->get_conference_schedule();\n\n\t\t\t?>\n </div>\n\t\t<?php\n\n\t}", "public function listPlaylistVideosAction()\n {\n\t\t$result = new ViewModel();\n\t $result->setTerminal(true);\n\t\t\n\t\t$matches\t= $this->getEvent()->getRouteMatch();\n\t\t$page\t\t= $matches->getParam('id', 1);\n\t\t$perPage\t= $matches->getParam('perPage', '');\n\t\t\n\t\t//\tSession for listing\n\t\t$listingSession = new Container('fo_listing');\n\t\tif($page == '0') {\n\t\t\t$listingSession->page\t= 1;\n\t\t\t$page\t= 1;\n\t\t} else if($listingSession->offsetExists('page')) {\n\t\t\t$page\t= $listingSession->page+1;\n\t\t\t$listingSession->page\t= $page;\n\t\t} else {\n\t\t\t$listingSession->page\t= 1;\n\t\t\t$page\t= 1;\n\t\t}\n\t\t$perPage\t\t= PERPAGE;\n\t\t$message\t\t= '';\n\t\t$recordsArray\t= $this->listPlaylistVideos($listingSession->playlist, $page, $perPage);\n\t\t\n\t\t$result->setVariables(array('records'\t\t=> $recordsArray['records'],\n\t\t\t\t\t\t\t\t\t'message'\t\t=> $message,\n\t\t\t\t\t\t\t\t\t'page'\t\t\t=> $page,\n\t\t\t\t\t\t\t\t\t'perPage'\t\t=> $perPage,\n\t\t\t\t\t\t\t\t\t'extended'\t\t=> $recordsArray['extended'],\n\t\t\t\t\t\t\t\t\t'totalRecords'\t=> $recordsArray['total'],\n\t\t\t\t\t\t\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t\t\t\t\t\t\t'controller'\t=> $this->params('controller')));\n\t\treturn $result;\n }", "public function watch($id)\n {\n LearnVideo::findOrFail($id)->watchedBy(Auth::id());\n }", "public function vodVideosListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t$user\t\t\t\t\t\t=\tnew userManagement();\n\t\t\t\t$tutor\t\t\t=\t $user->getInstructors();\n\t\t\t\t$instmnt\t\t=\t new instrument();\n\t\t\t\t$instrument_list=\t $instmnt->getAllInstruments();\n\t\t\t\t$courses\t\t=\t new userCourse();\n\t\t\t\t$course_list\t=\t$courses->getAllTaughtCourses();\n\t\t\t\t\n\t\t\t\tunset($_SESSION[\"txtCourse\"]);\n\t\t\t\tunset($_SESSION[\"txtInst\"]);\n\t\t\t\tunset($_SESSION['instrument_id']);\n\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($_POST[\"txtInst\"])){\n\t\t\t\t\t$_SESSION[\"txtInst\"]\t=\ttrim($_POST[\"txtInst\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST[\"txtCourse\"])){\n\t\t\t\t\t$_SESSION[\"txtCourse\"]\t=\ttrim($_POST[\"txtCourse\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST['instrument_id'])){\n\t\t\t\t$_SESSION[\"instrument_id\"]\t\t=\t$_POST[\"instrument_id\"];\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\t$txtInst\t\t=\t$_POST[\"txtInst\"];\n\t\t\t\t$txtCourse\t\t=\t$_POST[\"txtCourse\"];\n\t\t\t\t$instrument_id\t=\t$_POST[\"instrument_id\"];\n\t\t\t\n\t\t\t\treturn array(\"tutor\"=>$tutor,\"instrument\"=>$instrument_list,\"course\"=>$course_list,\"txtInst\"=>$txtInst,\"txtCourse\"=>$txtCourse,\"instrument_id\"=>$instrument_id);\n\t\t\t}", "public function printlist(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t$this->title = 'Media list';\t\t\r\n\t\treturn $this->renderWith(array('Media_printresults','Print'));\r\n\t}", "public function index() {\n\t\tif ($this->session->userdata('logged_in') == TRUE && $this->session->userdata('rid') == 1 ) {\n\t\t\t// Set Page Title\n\t\t\t$header['page_title'] = \"Video List\";\n\t\t\t$page = 1;\t\t\n\t\t\t$id = 1;\n\t\t\t$videos = $this->Signature_model->getAllVideo($id);\n\n\t\t\t// Create the data array to pass to view\n\t\t\t$menu_details['session'] = $this->session->userdata;\n\n\t\t\t$data['videos'] = $videos;\n\n\t\t\t$data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('admin/common/header', $header);\n\t\t\t$this->load->view('admin/common/left_menu', $menu_details);\n\t\t\t$this->load->view('admin/signature_video/list', $data);\n\t\t\t$this->load->view('admin/common/footer');\n\t\t} else {\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function indexAction() {\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if (!Engine_Api::_()->core()->hasSubject()) {\r\n return $this->setNoRender();\r\n }\r\n\t\t$setting = Engine_Api::_()->getApi('settings', 'core');\r\n\t\tif (!$setting->getSetting('video_enable_chanel', 1)) {\r\n return $this->setNoRender();\r\n }\r\n\t\t$this->view->tab =\t$this->_getParam('tab','inside');\r\n\t\t$this->view->photo =\t$this->_getParam('photo','pPhoto');\r\n\t\t$this->view->option =\t$this->_getParam('option',array('report','follow','like','share','delete','edit','favourite','stats','rating','verified'));\r\n\t\t\r\n // Get subject and check auth\r\n $this->view->subject = $subject = Engine_Api::_()->core()->getSubject('sesvideo_chanel');\r\n\t\t$this->view->video_count = $subject->countVideos();\r\n\t\t$this->view->photo_count = $subject->count();\r\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->can_edit = 0;\r\n\t\t$this->view->can_delete = 0;\r\n\t\tif($viewer->getIdentity() != 0){\r\n\t\t\t$this->view->can_edit = $canEdit = $subject->authorization()->isAllowed($viewer, 'edit');\r\n\t\t\t$this->view->can_delete = $canDelete = $subject->authorization()->isAllowed($viewer, 'delete');\r\n\t\t}\r\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->viewer_id = $viewer->getIdentity();\r\n\t\t // rating code\r\n $this->view->allowShowRating = $allowShowRating = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.show', 1);\r\n $this->view->allowRating = $allowRating = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.chanel.rating', 1);\r\n $this->view->getAllowRating = $allowRating;\r\n if ($allowRating == 0) {\r\n if ($allowShowRating == 0)\r\n $showRating = false;\r\n else\r\n $showRating = true;\r\n } else\r\n $showRating = true;\r\n $this->view->showRating = $showRating;\r\n\t\t\r\n if ($showRating) {\r\n $this->view->canRate = $canRate = Engine_Api::_()->authorization()->isAllowed('sesvideo_chanel', $viewer, 'rating_chanel');\r\n $this->view->allowRateAgain = $allowRateAgain = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.again', 1);\r\n $this->view->allowRateOwn = $allowRateOwn = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.own', 1);\r\n if ($canRate == 0 || $allowRating == 0)\r\n $allowRating = false;\r\n else\r\n $allowRating = true;\r\n if ($allowRateOwn == 0 && $mine)\r\n $allowMine = false;\r\n else\r\n $allowMine = true;\r\n $this->view->allowMine = $allowMine;\r\n $this->view->allowRating = $allowRating;\r\n $this->view->rating_type = $rating_type = 'sesvideo_chanel';\r\n $this->view->rating_count = $rating_count = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->ratingCount($subject->getIdentity(), $rating_type);\r\n $this->view->rated = $rated = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->checkRated($subject->getIdentity(), $viewer->getIdentity(), $rating_type);\r\n $rating_sum = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->getSumRating($subject->getIdentity(), $rating_type);\r\n if ($rating_count != 0) {\r\n $this->view->total_rating_average = $rating_sum / $rating_count;\r\n } else {\r\n $this->view->total_rating_average = 0;\r\n }\r\n if (!$allowRateAgain && $rated) {\r\n $rated = false;\r\n } else {\r\n $rated = true;\r\n }\r\n $this->view->ratedAgain = $rated;\r\n }\r\n }", "public function videoListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Video List is displayed on the Edit Episode page. - C15640');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Video List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('VIDEOS');\n $I->see('series_view_filled_data_automation_1_episode_1_media_id', ContentPage::$videoTable);\n }", "public function Youtube(){\n\n\t\t$departamentos=DB::table('deptos')\n\t\t\t->paginate(6);\n\t\treturn View::make('Administrador.Youtube.show', array('departamentos'=>$departamentos));\n\t}", "public function viewsVideo($video)\n {\n return $this->performRequest('GET',\"/videos1/{$video}\");\n }", "public function index()\n {\n $videos = KidVid::all();\n\n return response()->json($videos);\n }", "function display($group_id = NULL) {\n\t\tglobal $bp;\n\t\t$root_url = get_bloginfo( \"url\" ) . \"/\";\n\n\t\techo do_shortcode('[videowhisper_watch channel=\"' .$bp->groups->current_group->slug. '\"]');\n\t}", "public function viewVideo_action() {\r\n Auth::checkAuthentication();\r\n $userID = Session::get('user_id');\r\n $userRole = Session::get('user_role');\r\n $lessonID = Request::post('lessonID');\r\n \r\n if(isset($userID) && isset($userRole) && isset($lessonID)) {\r\n if (LessonModel::canViewLesson($userID, $userRole, $lessonID)) {\r\n LessonModel::recordViewedVideo($userID, $lessonID);\r\n \r\n $response_array['canViewAssessment'] = LessonModel::hasViewedVideoAndGame($userID, $lessonID);\r\n echo json_encode($response_array);\r\n } else {\r\n Redirect::to('lesson/index');\r\n }\r\n } else {\r\n Redirect::to('error/index');\r\n }\r\n }", "public function obtainVideos()\n {\n return $this->performRequest('GET','/videos');\n }", "public function index()\n {\n $vids = Vid::all();\n return view('all.vid', ['vid' => $vids]);\n }", "public function getEditlist()\n {\n // Title\n $title = Lang::get('admin/videos/title.video_edit');\n\n // Grab all the videos\n $videos = $this->video;\n\n // Show the page\n return View::make('admin/videos/editlist', compact('videos', 'title'));\n }", "public function indexAction()\n {\n $module = $this->params('module');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'index');\n }\n\n // Check homepage type\n switch ($config['homepage_type']) {\n default:\n case 'list':\n $this->view()->setTemplate('video-angular');\n $this->view()->assign('config', $config);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'all');\n break;\n\n case 'category':\n case 'custom':\n // Set title\n $title = (!empty($config['homepage_title'])) ? $config['homepage_title'] : __('List of videos');\n\n // Set info\n $categories = [];\n $where = ['status' => 1];\n $order = ['display_order DESC', 'title ASC', 'id DESC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n\n // Make list\n foreach ($rowSet as $row) {\n $categories[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n\n // Set category tree\n $categoryTree = [];\n if (!empty($categories)) {\n $categoryTree = Pi::api('category', 'video')->makeTreeOrder($categories);\n }\n\n // Set view\n $this->view()->setTemplate('video-category-index');\n $this->view()->assign('config', $config);\n $this->view()->assign('categories', $categories);\n $this->view()->assign('categoryTree', $categoryTree);\n $this->view()->assign('productTitleH1', $title);\n $this->view()->assign('showIndexDesc', 1);\n $this->view()->assign('isHomepage', 1);\n break;\n }\n }", "public function index() {\n\n /*\n Check Authentication of User\n */\n\n if( !Auth::guard('admin')->check()) {\n return redirect()->intended(route('admin.login'));\n }\n\n /*\n define a variable\n */\n $videoListings = array();\n\n /*\n Get Video details\n */\n $videos = Video::all();\n\n if( isset( $videos ) && !empty( $videos ) ) {\n foreach( $videos as $video ) {\n\n /*\n Get Video seo id\n */\n $VideoSeo = VideoSeo::where( 'video_id', $video->id )->get();\n\n $videoListings[] = array(\n 'id' => $video->id,\n 'seoID' => isset( $VideoSeo[0]->id ) ? $VideoSeo[0]->id : '',\n 'name' => $video->name,\n );\n }\n }\n\n return view( 'backend.video', [ 'videos' => $videoListings] );\n }", "function ShowVideoRight()\n{\n\techo(\"<tr><td height='2'></td></tr>\");\n\t$str0=\"select value1 from options where name='video'\";\n\t$result0=mysql_query($str0) or die(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{ \n\t\techo(\"<tr><td valign='middle' background='images/menuphai.png' class='topbartitle' height='30'\"); \n\t\techo(\"width='216'>\");\n\t\n\t\techo(\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\".getPara('video','value2'));\n\t\t/*echo(\"<tr><td bgcolor='\");\n\t\techo(background());\n\t\techo(\"' class='leftmenumainitem'\"); \n\t\techo(\"width='216' valign='top'><img src='image/point.jpg' />&nbsp;&nbsp;\");\n\t\techo(getPara('video','value2'));*/\n\t\techo(\"</td>\");\n\t\t\t\n\t\t//echo(\"</tr><tr><td height='200' background='pic/bodybar.jpg'><div class='topnews'>\");\n\t\techo(\"</tr><tr><td height='176'>\");\n\t\t$str00=\"select * from video where trang_thai='1' and hot='1' order by id desc limit 0,1\";\n\t\t$result00=mysql_query($str00) or\tdie(mysql_error());\n\t\twhile ($row00=mysql_fetch_array($result00))\n\t\t{\n\t\t\techo(\"<div id=\\\"MediaPlayer333\\\">\n\t\t\t<object id=\\\"player\\\" classid=\\\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\\\" name=\\\"player\\\" width=\\\"214\\\" height=\\\"175\\\">\n\t\t\t<param name=\\\"movie\\\" value=\\\"jwplayer/player.swf\\\"/>\n\t\t\t<param name=\\\"allowfullscreen\\\" value=\\\"true\\\" />\n\t\t\t<param name=\\\"allowscriptaccess\\\" value=\\\"always\\\" />\n\t\t\t<param name=\\\"flashvars\\\" value=\".$row00['link'].\" />\n\t\t\t<embed\n\t\t\ttype=\\\"application/x-shockwave-flash\\\"\n\t\t\tid=\\\"player2\\\"\n\t\t\tname=\\\"player2\\\"\n\t\t\tsrc=\\\"jwplayer/player.swf\\\"\n\t\t\twidth=\\\"214\\\"\n\t\t\theight=\\\"175\\\"\n\t\t\tallowscriptaccess=\\\"always\\\"\n\t\t\tallowfullscreen=\\\"true\\\"\n\t\t\tflashvars=\\\"file=\".$row00['link'].\"\\\">\n\t\t\t</embed>\n\t\t\t</object>\n\t\t\t</div>\");\n\t\t}\n\t\tmysql_free_result($result00);\n\t\t\n\t\t$str1=\"select * from video where trang_thai='1' and hot='1' order by id desc limit 0,5\";\n\t\t$result=mysql_query($str1) or\n\t\t\tdie(mysql_error());\n\t\t\t\n\t\t\techo(\"<ul class='box2video'>\");\n\t\t\t$stt=1;\n\t\twhile ($row=mysql_fetch_array($result))\n\t\t{\n\t\t\t\n\t\t\techo(\"<li>\");\n\t\t\techo(\"<a href=\\\"#\\\" id=\\\"abcd\\\" onclick=\\\"JavaScript:showVideo3('LOAD\".$row[\"id\"].\"');\\\" >\n \".$row['ghi_chu'].\"</a>\");\n\t\t\techo(\"</li>\");\n\t\t\t$stt++;\n\t \t}\n\t\t\t\n\t\t\techo(\"</ul>\");\n\t\t\n\t\t//echo($row['value3']);\n\t\t\n\t\tmysql_free_result($result);\n\t\techo(\"</td></tr>\");\n\t\t//echo(\"<tr><td background='pic/bottombar.jpg'\"); \n\t\t//echo(\" height='12'></tr>\");\n\t\techo(\"<script language=\\\"JavaScript\\\">\n\nvar HttPRequest = false;\n\nfunction showVideo3(str)\n\t\t {\n\t\t\n\t\tHttPRequest = false;\n\t\t\n\t\tif (window.XMLHttpRequest) { // Mozilla, Safari,...\n\t\t\n\t\tHttPRequest = new XMLHttpRequest();\n\t\t\n\t\tif (HttPRequest.overrideMimeType) {\n\t\t\n\t\tHttPRequest.overrideMimeType('text/html');\n\t\t\n\t\t}\n\t\t\n\t\t} else if (window.ActiveXObject) { // IE\n\t\t\n\t\ttry {\n\t\t\n\t\tHttPRequest = new ActiveXObject(\\\"Msxml2.XMLHTTP\\\");\n\t\t\n\t\t} catch (e) {\n\t\t\n\t\ttry {\n\t\t\n\t\tHttPRequest = new ActiveXObject(\\\"Microsoft.XMLHTTP\\\");\n\t\t\n\t\t} catch (e) {}\n\t\t\n\t\t}\n\t\t\n\t\t}\n\t\tif (!HttPRequest) {\n\t\t\n\t\talert('Cannot create XMLHTTP instance');\n\t\t\n\t\treturn false;\n\t\t\n\t\t}\n\t\tvar url = 'aj3.php';\n\t\t\n\t\tvar pmeters =\n\n\t\t\\\"str=\\\" + str;\n\t\tHttPRequest.open('POST',url,true);\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Content-type\\\", \\\"application/x-www-form-urlencoded\\\");\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Content-length\\\", pmeters.length);\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Connection\\\", \\\"close\\\");\n\t\t\n\t\tHttPRequest.send(pmeters);\n\t\t\n\t\tHttPRequest.onreadystatechange = function()\n\t\t\n\t\t{\n\t\t\n\t\tif(HttPRequest.readyState == 3) // Loading Request\n\t\t\n\t\t{\n\t\tdocument.getElementById(\\\"MediaPlayer333\\\").innerHTML = \\\"Now is Loading...\\\";\n\t\t}\n\t\tif(HttPRequest.readyState == 4) // Return Request\n\t\t\n\t\t{\n\t\tdocument.getElementById(\\\"MediaPlayer333\\\").innerHTML = HttPRequest.responseText;\n\t\t}\n\t\t\t \t\t\n\t\t}\n\t\t\n\t\t}\n\t\t</script>\");\t\n\t}\n\tmysql_free_result($result0);\n}", "public function index()\n {\n //Using Eloquent instead of DB\n $videos = Videos::orderBy('votes', 'DESC')->get();\n return view('videos.index', [\n 'videos' => $videos\n ]); // resources/views/books/index.blade.php\n }", "function show_one_video($video_id,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_id'=>$video_id);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&amp;playlist.position=none\";\n\t\t\t$string_flashvars.= \"&amp;playlist.size=0\";\n\t\t\t$string_flashvars.= \"&amp;skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&amp;config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&amp;title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&amp;file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&amp;image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}", "public function actionThird()\n {\n $id = $_GET['id'];\n\n $title = VideoLibrary::model()->findByPK($id)->title;\n $description = VideoLibrary::model()->findByPK($id)->description;\n $url = VideoLibrary::model()->findByPK($id)->url;\n $this->render('watchVideo', array('url'=>$url,'title'=>$title,'description'=>$description) );\n }", "function videos() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n if ($id > 0) {\n $query = \"select * from videos where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n\n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function show($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.show', compact('video'));\n }", "public function add_video_glance() {\n\t\t/* How many videos are published. */\n\t\t$video_count = wp_count_posts( 'video' )->publish;\n\t\t\n\t\t/* Get the correct label (video, videos) depending on the count. */\n\t\t$video_type = get_post_type_object( 'video' );\n\t\t$video_text = _n( $video_type->labels->singular_name, $video_type->labels->name, intval( $video_count ), 'makigas-videoman' );\n\t\t\n\t\t/* Render HTML code. */\n\t\techo '<li class=\"page-count video-count\">';\n\t\techo '<a href=\"edit.php?post_type=video\">' . $video_count . ' ' . strtolower( $video_text ) . '</a>';\n\t\techo '</li>';\n\t\t\n\t\t/* TODO: content: \"\\f236\"; in CSS: */\n\t}", "function pavi_shortcode_video($atts = array()){\n \n return pavi_get_display_video($atts);\n}", "public static function getAllVideo()\n {\n \treturn VedioGallary::all();\n }", "public function show($id)\n {\n $video = Video::find($id);\n return view('Admin.Videos.view')\n ->with('video',$video);\n }" ]
[ "0.72184587", "0.6371902", "0.63163924", "0.63097936", "0.62435746", "0.622321", "0.6176564", "0.6164794", "0.6153655", "0.6133823", "0.6124422", "0.6115143", "0.60959274", "0.60726327", "0.6063696", "0.6013747", "0.6006231", "0.5990126", "0.59749126", "0.59701407", "0.59503686", "0.59349424", "0.59314173", "0.5930345", "0.5924427", "0.59123397", "0.5904795", "0.5899546", "0.58842206", "0.58805263", "0.58732885", "0.58714795", "0.5867279", "0.5828705", "0.582454", "0.5797648", "0.5797648", "0.5797648", "0.5797648", "0.57971156", "0.57966065", "0.57943654", "0.5790603", "0.578583", "0.5750624", "0.5750226", "0.5746987", "0.57412905", "0.57380205", "0.57330734", "0.5725273", "0.5690417", "0.5683701", "0.5674137", "0.56641066", "0.5648198", "0.56256306", "0.5625009", "0.56105363", "0.56042606", "0.55959034", "0.55917025", "0.5578024", "0.55766386", "0.5555005", "0.5548687", "0.55423796", "0.55357754", "0.5528382", "0.55192786", "0.5511682", "0.5508185", "0.5506265", "0.5501141", "0.5482655", "0.5471943", "0.54688126", "0.5468109", "0.54385597", "0.5434625", "0.54334146", "0.5419952", "0.5408437", "0.54035074", "0.54034615", "0.54026246", "0.54020405", "0.5400995", "0.5395226", "0.5393148", "0.5388618", "0.5385211", "0.5374705", "0.53738475", "0.5369352", "0.53641605", "0.53424144", "0.53387195", "0.53316313", "0.53315586" ]
0.71291244
1
encode id to hash string
закодировать id в хеш-строку
public static function hashEncodeInt($id) { $salt = \Yii::$app->params['hashid.salt']; $minLength = \Yii::$app->params['hashid.minLength']; $encodeString = ''; $ha = new Hashids($salt, $minLength); $encodeString = $ha->encode($id); return $encodeString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdHash() {\n return encrypt( [ 'id' => $this->id ] );\n }", "private function encode_id( $id ) {\n\t\treturn base64_encode( $id );\n\t}", "function hashid_encode($data, $name = null)\n {\n return hashid($name)->encode($data);\n }", "public static function encodeIdAction($id) {\n return base64_encode($id . '#' . Carbon::now());\n }", "function encode_id (int $id) {\n return base64_encode(config('secure.tokenNumber') * $id);\n }", "function encodeID($var) {\n\treturn chevereto_id($var, \"encode\");\n}", "function getHashCode($id) {\n\t\treturn \"x\" . base_convert($id, 10, 36);\n\t}", "public function hashID()\n {\n return $this->getCleanString(self::$_hash_id_clean);\n }", "public function getHashAttribute()\n {\n return Hashids::encode($this->attributes['id']);\n }", "public function encode($id)\n {\n $suff = 0;\n if ($this->PADDING > 0 && !empty($this->SALT)) {\n $suff = $this->getSeed($id, $this->SALT, $this->PADDING);\n\n $id = (int)($suff . $id);\n }\n return $this->numToAlpha($id, $this->CHARSET);\n\n }", "public static function api_encode_id($id)\n\t{\n\t\t$sid = ($id & 0x0000ff00)<< 16;\n\t\t$sid += (($id & 0xff000000)>> 8)& 0x00ff0000;\n\t\t$sid += ($id & 0x000000ff)<< 8;\n\t\t$sid += ($id & 0x00ff0000)>> 16;\n\t\t$sid ^= 282335;\t//该值定了就不能再改了,否则就出问题了\n\t\treturn $sid;\n\t}", "public function getHashId()\n {\n $prefixColumn = static::getHashIdPrefixColumn();\n $prefix = $prefixColumn ? $this->model->attributes[$prefixColumn] : null;\n $hashId = app(HashidGenerator::class)->encode($this->model->getKey());\n\n return ($prefix ? $prefix.'-' : '').$hashId;\n }", "public function getHashIdAttribute($value)\n {\n return Hashids::encode($this->id);\n }", "function getId($hash) {\n\t\treturn base_convert($hash, 36, 10);\n\t}", "public function getHashIdentifier() : string;", "public function encode(string $type, int|string $id): string;", "public function hashString(){ return $this->ulA->db->ID . \"_\" . $this->ulA->ID . \"_\" . $this->ulB->db->ID . \"_\" . $this->ulB->ID; }", "public function hash(): string;", "public function encodeById($id, $settings)\n\t{\n\t\t\n\t\tif ( $settings['length'] ) \n\t\t{\n\t\t\t$length = $settings['length'];\n\t\t\t$this->encoder = new \\Hashids\\Hashids($this->salt, $length, $this->alphabet);\n\t\t}\n\t\t$encodedId = $this->encoder->encode($id);\n\t\treturn $encodedId;\n\t}", "function chevereto_id($var, $action='encode') {\n\t$base_chars = \"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; // DON'T REPEAT A SINGLE CHAR!\n\t\n\tfor ($n = 0; $n<strlen($base_chars); $n++) {\n\t\t$i[] = substr( $base_chars,$n ,1);\n }\n \n $passhash = hash('sha256',__CHV_CRYPT_SALT__);\n $passhash = (strlen($passhash) < strlen($base_chars)) ? hash('sha512',__CHV_CRYPT_SALT__) : $passhash;\n \n for ($n=0; $n < strlen($base_chars); $n++) {\n\t\t$p[] = substr($passhash, $n ,1);\n }\n \n array_multisort($p, SORT_DESC, $i);\n $base_chars = implode($i);\n\t\n\tswitch($action) {\n\t\tcase 'encode':\n\t\t\t$string = '';\n\t\t\t$len = strlen($base_chars);\n\t\t\twhile($var >= $len) {\n\t\t\t\t$mod = bcmod($var, $len);\n\t\t\t\t$var = bcdiv($var, $len);\n\t\t\t\t$string = $base_chars[$mod].$string;\n\t\t\t}\n\t\t\treturn $base_chars[$var] . $string;\n\t\tbreak;\n\t\tcase 'decode':\n\t\t\t$integer = 0;\n\t\t\t$var = strrev($var );\n\t\t\t$baselen = strlen( $base_chars );\n\t\t\t$inputlen = strlen( $var );\n\t\t\tfor ($i = 0; $i < $inputlen; $i++) {\n\t\t\t\t$index = strpos($base_chars, $var[$i] );\n\t\t\t\t$integer = bcadd($integer, bcmul($index, bcpow($baselen, $i)));\n\t\t\t}\n\t\t\treturn $integer;\n\t\tbreak;\n\t}\n}", "function id_gen($str=''){\n\t$pats = array('/','+');\n\t$subs = array('_','-');\n\treturn str_replace($pats,$subs,substr(base64_encode(md5($str,true)),0,22));\n}", "public function encode($r_id){\n return $this->cryptomute->encrypt((string) $r_id, 10, true, $this->getPass(), $this->getIV());\n }", "public function getHashSignedById(): string;", "private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }", "public function getHashedId()\n {\n return md5($this->part->id);\n }", "public function encode($id, $padAfter = 4) {\n $hash = \"\";\n $id = intval(str_pad($id, strlen($id) + $padAfter, '0', STR_PAD_RIGHT));\n\n while($id > 0) {\n $hash = $this->codeSet[$id % $this->base] . $hash;\n $id = floor($id / $this->base);\n }\n\n return $hash;\n }", "function getHashedId($newId){\r\n return $newId;\r\n}", "public function hashCode() : string;", "private static function _build_hash($urtak_id, $question_id) {\r\n\t\t\t$urtak_id = is_null($urtak_id) || !is_numeric($urtak_id) ? 0 : intval($urtak_id);\r\n\t\t\t$question_id = is_null($question_id) || !is_numeric($question_id) ? 0 : intval($question_id);\r\n\r\n\t\t\treturn empty($urtak_id) ? '' : sprintf('#%d-%d', $urtak_id, $question_id);\r\n\t\t}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "function newTokenEncode($userName,$id)\n\t{\n\t\t$newTokenNum =base64_encode($userName.\"/\".$id);\n\t\treturn $newTokenNum;\n\t}", "public function hashCode(): string;", "public function hash();", "public static function hashObject($obj) : string\n {\n return sodium_bin2hex(sodium_crypto_generichash($obj));\n }", "public function generarCustomID(){\n return md5(\"$this->id $this->updated_at\");\n }", "private function computeId(): void\n {\n /** @noinspection JsonEncodingApiUsageInspection */\n $this->id = md5(\n json_encode(\n [\n $this->simulation->id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n collect($this->findByTags)->map(fn($t) => strtolower($t))->sort()->toArray(),\n $this->searchMode\n ]\n )\n );\n }", "function get_short_id()\n {\n // E.g. 04622F2089E037A5 => 89E037A5\n return enigma_key::format_id($this->id);\n }", "public function getId(): string\n {\n $message = (string) $this->getRawMessage();\n return substr(md5($message), 0, 10);\n }", "public function getStrId();", "abstract public function encode();", "public static function codeFromId($id)\n\t{\n\n\t\treturn base64_encode(openssl_encrypt($id, \"AES-128-CBC\", User::SECRET, 0, User::SECRET_IV));\n\n\t}", "public function id()\n {\n if (!$this->_id)\n {\n $id = NULL;\n foreach ($this->assets AS $asset)\n {\n $id .= $asset->get('hash');\n }\n $this->_id = md5($id);\n }\n\n return $this->_id;\n }", "public function getEncryptedIdAttribute()\n {\n return encrypt_id($this->id);\n }", "public static function encodIdBit($id, $str = '')\n\t{\n\t\t$strChars = '0123456789abcdef';\n\t\t$arrValue = self::reinterpret_cast($id);\n\t\t\n\t\t$strCode = $strChars[$arrValue[0] >> 4] . $strChars[$arrValue[0] & 15];\n\t\t$strCode .= $strChars[$arrValue[1] >> 4] . $strChars[$arrValue[1] & 15];\n\t\t\n\t\t$intLen = strlen($str);\n\t\tfor ($i = 0; $i < $intLen; ++$i) {\n\t\t\t$intValue = ord($str[$i]);\n\t\t\t$strCode .= $strChars[($intValue >> 4)] . $strChars[($intValue & 15)];\n\t\t}\n\t\t\n\t\t$strCode .= $strChars[$arrValue[2] >> 4] . $strChars[$arrValue[2] & 15];\n\t\t$strCode .= $strChars[$arrValue[3] >> 4] . $strChars[$arrValue[3] & 15];\n\t\t\n\t\treturn $strCode;\n\t}", "private function keyToId($key) {\n return (int) hexdec(substr(md5($key), 0, 7)) + strlen($key);\n }", "function make_id($base) {\n\treturn substr(hash('md5', $base . microtime()), 0, 6);\n}", "function hash_decode($id) {\n $decode = Hashids::decode($id);\n return $decode ? $decode[0] : false;\n}", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "protected function _getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\n\t\treturn md5($id);\n\t}", "public function getPrefixedHashIdAttribute()\n {\n return 'product-' . $this->getHashIdAttribute();\n }", "public function encode(UuidInterface $uuid): string;", "protected function fetchIdHash()\n {\n return md5($this->request->server('HTTP_USER_AGENT') . $this->fetchIp());\n }", "function helperJsKey($table, $id) {\n\t\t$key = substr(hexdec(substr (md5($table) , 0 , 7)), 0, 3).$id;\n\t\treturn $key;\n\t}", "public function getId()\n {\n return md5(serialize([\n $this->no,\n $this->price,\n $this->weight\n ]));\n }", "public static function hashCode($_str) {\n\t\treturn str_pad(\n\t\t\tbase_convert(sprintf('%u',crc32($_str)),10,36),7,'0',\n\t\t\t\tSTR_PAD_LEFT\n\t\t);\n\t}", "public static function generateJournalId() {\n $value = random_bytes(24);\n\n $data = substr(base64_encode($value), 0, 32);\n $data = str_replace(array('+','/','='), array('-','_',''), $data);\n return $data;\n }", "final public function getHash(): string\n {\n return serialize([\n \\get_class($this),\n $this->acceptedExtension(),\n $this->getJsModule(),\n ]);\n }", "public function rpIdHash(): string\n {\n return $this->rpIdHash;\n }", "public function shortHashID($id, $salt = self::SHORT_HASH_SALT)\n {\n require_once(dirname(__FILE__) . '/../vendor/hashids/hashids/lib/Hashids/HashGenerator.php');\n require_once(dirname(__FILE__) . '/../vendor/hashids/hashids/lib/Hashids/Hashids.php');\n\n $hashid = new \\Hashids\\Hashids($salt);\n return $hashid->encode($id);\n }", "function recordNumberToHashID($newRecordNum) {\n\t// http://www.hashids.org/ \n\t$hashids = new Hashids\\Hashids(theSalt());\n\treturn $hashids->encrypt($newRecordNum);\n}", "public function encodeBinary(UuidInterface $uuid): string;", "public static function _awesomeHash($a) {\n $b = 16909125; for ($c=0; $c<strlen($a); $c++) {\n $b ^= (GTB_Helper::charCodeAt(self::HASH_SEED, ($c%87))) ^ (GTB_Helper::charCodeAt($a, $c));\n $b = GTB_Helper::unsignedRightShift($b, 23) | $b << 9;\n }\n return '8'. GTB_Helper::hexEncodeU32($b);\n }", "public function getHash();", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "public function keyIdentifier64(): string\n {\n $id = substr($this->keyIdentifier(), -8);\n $c = (ord($id[0]) & 0x0f) | 0x40;\n $id[0] = chr($c);\n return $id;\n }", "public function __toString(): string\n {\n return $this->getHash();\n }", "function idfy($name=false){\n if(!$name) $name = uniqid(false, true);\n return 'id'.substr(md5($name),20);\n}", "protected function getHashKey()\n {\n if (!isset($this->options['prefix'])) {\n return $this->getId();\n }\n\n return $this->options['prefix'] . ':' . $this->getId();\n }", "function pl_hashify( $color ){\n\t\n\t$clean_hex = str_replace('#', '', $color);\n\t\n\treturn sprintf('#%s', $clean_hex);\n}", "function decode_id ($id_encoded) {\n return base64_decode($id_encoded) / config('secure.tokenNumber');\n }", "public function id($hash = true)\r\n {\r\n if (null === $this->id) {\r\n $this->id = uniqid();\r\n\r\n if ($hash) {\r\n $this->id = sha1($this->id);\r\n }\r\n }\r\n\r\n return $this->id;\r\n }", "public function __toString(): string\n {\n return (string) $this->getHash();\n }", "public function serialize(){\n return serialize($this->id);\n }", "protected function calculateKey($id)\n {\n return $this->keyPrefix . md5($id);\n }", "private function id($length = 10) {\n $key = '';\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($i = 0; $i < $length; $i++)\n $key .= $chars[rand(0, strlen($chars) - 1)];\n return $key;\n }", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "function createMongoDbLikeId($timestamp, $hostname, $processId, $id)\n{\n// Building binary data.\n$bin = sprintf(\n \"%s%s%s%s\",\n pack('N', $timestamp),\n substr(md5($hostname), 0, 3),\n pack('n', $processId),\n substr(pack('N', $id), 1, 3)\n);\n\n// Convert binary to hex.\n$result = '';\nfor ($i = 0; $i < 12; $i++) {\n $result .= sprintf(\"%02x\", ord($bin[$i]));\n}\nreturn $result;\n}", "public function getId() {\n if ($this->id) {\n return $this->id;\n }\n\n $id = serialize($this->callback->__toString());\n $id .= serialize($this->second);\n $id .= serialize($this->minute);\n $id .= serialize($this->hour);\n $id .= serialize($this->day);\n $id .= serialize($this->month);\n $id .= serialize($this->dayOfWeek);\n $this->id = md5($id);\n\n return $this->id;\n }", "private function hash($key)\n {\n $const_hash = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';\n\n return base64_encode(pack('H*', sha1($key . $const_hash)));\n }", "public function keyIdentifier(): string\n {\n return sha1($this->_publicKey->string(), true);\n }", "function keymaker($id = ''){\n\t\t//look up of info unique to the user or id. It could include date/time to timeout keys.\n\t\t$secretkey='1RuL1HutysK98UuuhDasdfafdCrackThisBeeeeaaaatchkHgjsheIHFH44fheo1FhHEfo2oe6fifhkhs';\n\t\t$key=md5($id.$secretkey);\n\t\treturn $key;\n\t}", "function generate_unique_id() {\n\t/*\n\tGenerates random binary ID. \n\tReturns the ID.\n\t*/\n\t$onetwo = [\"&zwj;\", \"&zwnj;\"];\n\t$uniqueid = '';\n\tfor ($i = 0; $i < 8; $i++) {\n\t\t$uniqueid .= $onetwo[rand(0, 1)];\n\t}\n\n\treturn $uniqueid;\n}", "public function encode($int)\n {\n if (0 === $int) {\n return $this->alphabet[0];\n }\n\n $str = '';\n while (0 < $int) {\n $remainder = $int % $this->base;\n $str = $str . $this->alphabet[$remainder];\n $int = ($int - $remainder) / $this->base;\n }\n\n return strrev($str);\n }", "function rockIdString($id) \n { //{{{\n if (is_object($id) && $id instanceof MongoId) {\n return \"rid_object:\" . $id->__toString();\n }\n if (is_object($id)) {\n return \"rid_\" . get_class($id) . \":\" . $id->__toString();\n }\n if (is_scalar($id)) {\n return \"rid_\" . gettype($id) . \":\" . $id;\n }\n return \"rid_mixed:\" . base64_encode(var_export($id, true));\n }", "public function serialize(){\n return serialize($this->id);\n }", "public function getUniqueObjectIdentifier();", "function encode_int($int)\r\n {\r\n return 'i' . $int . 'e';\r\n }", "public function getHash() {}", "private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}", "public static function EncodeSHA1($string, $key) {\n $key = sha1($key);\n $strLen = strlen($string);\n $keyLen = strlen($key);\n for ($i = 0; $i < $strLen; $i++) {\n $ordStr = ord(substr($string,$i,1));\n if ($j == $keyLen) { $j = 0; }\n $ordKey = ord(substr($key,$j,1));\n $j++;\n $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36));\n }\n return $hash;\n }", "public function getUniquePublicId() {\r\n\r\n\t\t\t//Seed the random generator\r\n\t\t\tmt_srand($this->makeSeed());\r\n\r\n\t\t\t//Alphanumeric upper/lower array\r\n\t\t\t$alfa = \"1234567890qwrtypsdfghjklzxcvbnm\";\r\n\t\t\t$id = \"\";\r\n\r\n\t\t\t//Loop through and generate the random public id\r\n\t\t\tfor($i = 0; $i < 32; $i ++) {\r\n\t\t\t $id .= $alfa[mt_rand(0, strlen($alfa)-1)];\r\n\t\t\t}\r\n\r\n\t\t\t//If there is a duplicate, run this function recursively\r\n\t\t\tif(!$this->isPublicIdUnique($id)) {\r\n\t\t\t\t$id = $this->getUniquePublicId();\r\n\t\t\t}\r\n\r\n\t\t\t//Return the hash\r\n\t\t\treturn $id;\r\n\t\t}", "public function encode(array $data): array\n {\n $fields = ['id'];\n foreach($fields as $key) {\n if(isset($data[$key])) {\n $data[$key] = $this->hashids->encode($data[$key]);\n }\n }\n return $data;\n }", "public static function anchorify(string $id): string {\n\t\treturn SwissKnife::stringToID($id);\n\t}", "private static function hash($object)\n\t{\n\t\treturn '#' . substr(md5(spl_object_hash($object)), 0, 4);\n\t}", "public function encode($id, $maxdigits = 8, $grows = false){\n if(!$grows && $id>$max = $this->maxId($maxdigits))\n throw new \\Exception(\"Limit id($id) for $maxdigits digits($max) in JaitecAliasBundle->encode, possible lost of information\");\n $ret = '';\n $aux = $id;\n $bit = 0;\n while(($grows && $aux) || $maxdigits>$bit){\n $a = $aux % $this->n;\n $ret .= substr($this->base[$bit % $this->l],$a,1);\n $aux = ($aux-$a)/$this->n;\n $bit++;\n }\n return $ret;\n }", "public function generateTicketCode()\n {\n return uniqid($this->ID);\n }", "public function getUnregisterHash($id) {\n\t\t$salt = Configure::write('unregistration_hash_salt');\n\n \treturn md5($id . $salt);\n }" ]
[ "0.7730453", "0.772805", "0.7471882", "0.7462594", "0.7402388", "0.7264607", "0.7242917", "0.7193168", "0.7179232", "0.7132763", "0.7087553", "0.69910973", "0.69087344", "0.6888903", "0.6871193", "0.67771757", "0.67180806", "0.6675878", "0.6599424", "0.65475595", "0.65045196", "0.64665264", "0.64514846", "0.6443208", "0.64411944", "0.64274925", "0.6392448", "0.6373918", "0.6360641", "0.63486415", "0.63486415", "0.63486415", "0.63486415", "0.6329965", "0.6325443", "0.6279652", "0.6242073", "0.62293607", "0.61782867", "0.61568516", "0.6122829", "0.6114926", "0.61046153", "0.60838914", "0.60811526", "0.6074884", "0.60689974", "0.60526145", "0.6042907", "0.6031805", "0.6022225", "0.601701", "0.6005461", "0.5990276", "0.5985762", "0.59788126", "0.5963207", "0.59627485", "0.59594715", "0.5951399", "0.5934219", "0.59329283", "0.59294206", "0.5923355", "0.5914676", "0.59041375", "0.58956355", "0.58911693", "0.58832085", "0.5880634", "0.5856406", "0.5852313", "0.5847905", "0.5837202", "0.581973", "0.5818934", "0.58146966", "0.5813891", "0.58095664", "0.58068806", "0.5805519", "0.5799234", "0.5797969", "0.57882106", "0.5782684", "0.578073", "0.57791877", "0.57707685", "0.5770654", "0.5767058", "0.5757976", "0.57459843", "0.5715395", "0.57079875", "0.5707768", "0.5706619", "0.5702618", "0.56915057", "0.56893027", "0.5678435" ]
0.7815603
0
split http header response into array
разделить http заголовок ответа на массив
function http_response_header_lines($hdr_str) { $lines = explode("\n", $hdr_str); $hdr_arr['status_line'] = trim(array_shift($lines)); foreach ($lines as $line) { list($key, $val) = explode(':', $line, 2); $hdr_arr[trim($key)] = trim($val); } return $hdr_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function http_response_headers($ret_str) {\n\t$hdrs = array();\n $arr = explode(\"\\r\\n\\r\\n\", $ret_str);\n foreach ($arr as $each)\n\t\tif (substr($each, 0, 4) == 'HTTP')\n\t\t\t$hdrs[] = $each;\n return $hdrs;\n}", "function getHeaders($respHeaders)\n{\n $headers = array();\n\n $headerText = substr($respHeaders, 0, strpos($respHeaders, \"\\r\\n\\r\\n\"));\n\n foreach (explode(\"\\r\\n\", $headerText) as $i => $line) {\n if ($i === 0) {\n $headers['http_code'] = $line;\n } else {\n list($key, $value) = explode(': ', $line);\n\n $headers[$key] = $value;\n }\n }\n\n return $headers;\n}", "public function headers()\r\n\t\t\t {\r\n return self::headersToArray(explode( \"\\r\\n\", $this->headers ));\r\n\t\t\t }", "private function headersToArray( $headers )\r\n\t\t\t {\r\n\t\t\t $return = array();\r\n\t\t\t foreach ( $headers as $item ) {\r\n\t\t\t if ( preg_match( '#HTTP/1\\.\\d (?P<code>\\d{3}) (?P<text>.*)#', $item, $matches ) ) {\r\n\t\t\t $return['Http'][$matches[1]] = $matches[0];\r\n\t\t\t } else {\r\n\t\t\t $split = strpos( $item, ':' );\r\n\t\t\t $key = substr( $item, 0, $split );\r\n\t\t\t $value = trim( substr( $item, $split + 1 ) );\r\n\t\t\t $return[$key] = $value;\r\n \r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t return $return;\r\n\t\t\t }", "public function getHeaders(): array;", "public function getHeaders(): array;", "public function getHeaders(): array;", "public function getHeaders(): array;", "public function getHeaders(): array;", "public function getHeaders(): array;", "public function getHeaders(): array;", "private static function http_parse_headers($header)\n {\n $headers = array();\n $key = '';\n\n foreach(explode(\"\\n\", $header) as $i => $h) {\n $h = explode(':', $h, 2);\n\n if (isset($h[1]))\n {\n if (!isset($headers[$h[0]])) {\n $headers[$h[0]] = trim($h[1]);\n }\n elseif (is_array($headers[$h[0]])) {\n $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));\n }\n else {\n $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));\n }\n\n $key = $h[0];\n }\n else {\n if (substr($h[0], 0, 1) == \"\\t\") {\n $headers[$key] .= \"\\r\\n\\t\".trim($h[0]);\n }\n elseif (!$key) {\n $headers[0] = trim($h[0]);trim($h[0]);\n }\n }\n }\n\n return $headers;\n }", "public abstract function getHeaders();", "abstract public function getHeaders();", "function get_headers_from_curl_response($response) {\n $headers = array();\n\n $header_text = substr($response, 0, strpos($response, \"\\r\\n\\r\\n\"));\n\n foreach (explode(\"\\r\\n\", $header_text) as $i => $line)\n if ($i === 0)\n $headers['http_code'] = $line;\n else {\n list ($key, $value) = explode(': ', $line);\n $headers[$key] = $value;\n }\n return $headers;\n}", "public function getHeadersRaw(): array;", "private static function getHeaderAndBody($response) {\n\n $header = self::http_parse_headers(substr($response, 0, strrpos($response,\"\\r\\n\\r\\n\")));\n $body = substr($response, strrpos($response,\"\\r\\n\\r\\n\")+4);\n\n return array($header,$body);\n }", "public function getHeaders ();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "private function header2Array($str)\n {\n if (is_array($str)) return $str;\n \n $result = [];\n $array = explode(\"\\n\", trim(str_replace(\"\\r\\n\", \"\\n\", $str), \"\\n\"));\n foreach($array as $i => $line) {\n if ($i === 0) {\n $result['Http-Status'] = $line; // \"HTTP/1.1 200 OK\"\n } else {\n $header = explode(':', $line, 2);\n if (!$header[0]) continue;\n \n if (isset($header[1])) {\n $result[trim($header[0])] = trim($header[1]);\n } else {\n $result[] = trim($header[0]);\n }\n }\n }\n return $result;\n }", "public function getHeaderLines()\n {\n $headers = [];\n foreach ($this->headers as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $v) {\n $headers[] = $key . ': ' . $v;\n }\n } else {\n $headers[] = $key . ': ' . $value;\n }\n }\n\n return $headers;\n }", "public function headerHandle()\n\t{\t\n\t\t$headers = array();\n\t\tif(is_array($this->server->all()))\n\t\t{\n\t\t\tforeach($this->server->all() as $key=>$val)\n\t\t\t{\n\t\t\t\tif('http_' == strtolower(substr($key,0,5)))\n\t\t\t\t{\n\t\t\t\t\t$headers[substr($key,5)] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $headers;\n\t}", "protected function headerToArray($header)\n\t{\n\t\t$headers = [];\n\t\t$parts = explode(\"\\r\\n\", $header);\n\t\tforeach ($parts as $singleHeader) {\n\t\t\t$delimiter = strpos($singleHeader, ': ');\n\t\t\tif ($delimiter !== false) {\n\t\t\t\t$key = substr($singleHeader, 0, $delimiter);\n\t\t\t\t$val = substr($singleHeader, $delimiter + 2);\n\t\t\t\t$headers[$key] = $val;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$delimiter = strpos($singleHeader, ' ');\n\t\t\t\tif ($delimiter !== false) {\n\t\t\t\t\t$key = substr($singleHeader, 0, $delimiter);\n\t\t\t\t\t$val = substr($singleHeader, $delimiter + 1);\n\t\t\t\t\t$headers[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $headers;\n\t}", "private function readHeaders() {\n $headers = $this->status->getHeaders();\n\n foreach ($headers as $key => $value) {\n switch ($key) {\n case \"Location\":\n $this->response['location'] = $value[0];\n break;\n\n case \"Content-Type\":\n $this->response['content_type'] = $value[0];\n break;\n\n case \"Content-Length\":\n $this->response['content_length'] = $value[0];\n break;\n\n default:\n break;\n }\n }\n }", "public function getResponseHeaders();", "public static function extractHeaders($arr): array\n {\n $result = [];\n\n foreach ($arr as $key => $value) {\n $key = strtoupper($key);\n if (strpos($key, 'X_') === 0 || strpos($key, 'HTTP_') === 0 || in_array($key, static::$specialHeaders)) {\n if ($key === 'HTTP_CONTENT_TYPE' || $key === 'HTTP_CONTENT_LENGTH') {\n continue;\n }\n $result[$key] = $value;\n }\n }\n\n return $result;\n }", "public function getHeaders() {}", "protected static function getHeaderToken()\n {\n return [];\n }", "protected static function getHeaderToken()\n {\n return [];\n }", "function getHeaders($headers)\r\n\t{\r\n\t\t$array = explode(\"\\n\",$headers);\r\n\t\tfor($i=0;$i<count($array);$i++)\r\n\t\t{\r\n\t\t\tif( ereg(\"([A-Za-z]+)/([0-9]\\.[0-9]) +([0-9]+) +([A-Za-z]+)\",$array[$i],$r) )\r\n\t\t\t{\r\n\t\t\t\t$hdrs['version'] = trim($r[2]);\r\n\t\t\t\t$hdrs['status_code'] = (int)trim($r[3]);\r\n\t\t\t\t$hdrs['status_text'] = trim($r[4]);\r\n\t \t}\r\n\t \telseif(ereg(\"([^:]*): +(.*)\",$array[$i],$r))\r\n\t \t{\r\n\t\t\t\t$hdr = eregi_replace(\"-\",\"_\",trim(strtolower($r[1])));\r\n\t\t\t\t$hdrs[$hdr] = trim($r[2]);\r\n\t\t }\r\n\t\t}\r\n\t \treturn $hdrs;\r\n\t}", "public function getHeaders(): array\n {\n }", "public static function parseHeader($header): array;", "protected function _parseHeader() {}", "private function http_parse_headers($headers) {\n\t\t$retVal = array();\n\t\t$fields = explode(\"\\r\\n\", preg_replace('/\\x0D\\x0A[\\x09\\x20]+/', ' ', $headers));\n \tforeach($fields as $field) {\n\t\t if(preg_match('/([^:]+): (.+)/m', $field, $match)) {\n\t\t\t $match[1] = preg_replace('/(?<=^|[\\x09\\x20\\x2D])./e', 'strtoupper(\"\\0\")', strtolower(trim($match[1])));\n\t\t\t if(isset($retVal[$match[1]])) {\n\t\t\t\t $retVal[$match[1]] = array($retVal[$match[1]], $match[2]);\n \t\t\t} else {\n\t\t\t\t $retVal[$match[1]] = trim($match[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $retVal;\n\t}", "public function getHeaders(): array\n {\n $result = [];\n\n foreach ($this->env as $key => $value) {\n if (stripos($key, 'HTTP_') === 0 && !Text::strEnds($key, '_RAW')) {\n $headerKey = static::normalizeHeaderName(substr($key, 5));\n $result[$headerKey][] = $value;\n }\n }\n\n return $result;\n }", "private static function getHeaders() {\n\t\t$_hdr=array();\n\t\tforeach ($_SERVER as $_key=>$_val)\n\t\t\tif (substr($_key,0,5)=='HTTP_') {\n\t\t\t\t$_hdr[preg_replace_callback(\n\t\t\t\t\t'/\\w+\\b/',\n\t\t\t\t\tfunction($_word) {\n\t\t\t\t\t\treturn ucfirst(strtolower($_word[0]));\n\t\t\t\t\t},\n\t\t\t\t\tstr_replace('_','-',substr($_key,5))\n\t\t\t\t)]=$_val;\n\t\t\t}\n\t\treturn $_hdr;\n\t}", "public function GetHeaders()\n {\n return HttpResponse::extractHeaders($this->_rawHttpBatchResponse);\n }", "function http_parse_headers($headers) {\n\t\t$replace = ($this->http_linebreak == \"\\n\" ? \"\\r\\n\" : \"\\n\");\n\t\t$headers = str_replace($replace, $this->http_linebreak, trim($headers));\n\t\t$headers = explode($this->http_linebreak, $headers);\n\t\t$this->http_response_headers = array();\n\t\tif (preg_match('/^HTTP\\/\\d\\.\\d (\\d{3})/', $headers[0], $matches)) {\n\t\t $this->http_response_code = intval($matches[1]);\n\t\t array_shift($headers);\n\t\t}\n\t\tif($headers):\n\t\t\tforeach ($headers as $string) {\n\t\t\t list($header, $value) = explode(': ', $string, 2);\n\t\t\t $this->http_response_headers[$header] = trim($value);\n\t\t\t}\n\t\tendif;\n\t}", "private function parseHeaders($raw)\n {\n $statusLine = null;\n $headers = array();\n foreach (preg_split('|(\\\\r?\\\\n)|', $raw) as $header) {\n if (!$statusLine) {\n $statusLine = $header;\n continue;\n }\n list($name, $value) = preg_split('|: |', $header);\n $headers[$name][] = $value;\n }\n\n return [$statusLine, $headers];\n }", "function getResponseHeaders();", "private static function split_header($header)\n {\n $pattern = '/(([-_a-z]*)=(\"([^\"]*)\"|([^,]*)),?)/';\n $offset = 0;\n $params = array();\n while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0)\n {\n $match = $matches[0];\n $header_name = $matches[2][0];\n $header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];\n $params[$header_name] = OAuthUtil::urldecode_rfc3986( $header_content );\n $offset = $match[1] + strlen($match[0]);\n }\n\n if (isset($params['realm']))\n unset($params['realm']);\n\n return $params;\n }", "protected function fetchHeader($response)\r\n {\r\n $headers = [];\r\n $headerSize = 0;\r\n $headerParts = explode(PHP_EOL, $response);\r\n\r\n foreach ($headerParts as $headerString) {\r\n\r\n $headerSize += strlen($headerString);\r\n\r\n $headerString = trim($headerString);\r\n if (empty($headerString)) {\r\n break;\r\n }\r\n\r\n if (strpos($headerString, ':') !== false) {\r\n $headerSize += strlen(PHP_EOL);\r\n $headerString = str_replace('\"', '', $headerString);\r\n $headerStringParts = explode(':', $headerString);\r\n $headerStringParts = array_map('trim', $headerStringParts);\r\n\r\n $headers[ $headerStringParts[ 0 ] ] = $headerStringParts[ 1 ];\r\n } elseif (preg_match(\"/(HTTP\\/[0-9].[0-9])\\s([0-9]+)\\s([a-zA-Z]+)/\", $headerString, $matches)) {\r\n $headerSize += strlen(PHP_EOL);\r\n\r\n $this->info->httpVersion = $matches[ 1 ];\r\n $this->info->httpCode = $matches[ 2 ];\r\n $this->info->httpCodeDescription = $matches[ 3 ];\r\n }\r\n }\r\n\r\n $this->headers = new Headers($headers);\r\n\r\n // Update info\r\n if ($this->headers->offsetExists('contentType')) {\r\n $this->info->contentType = $this->headers->offsetGet('contentType');\r\n }\r\n\r\n $this->info->headerSize = $headerSize;\r\n }", "static public function getHeadersFromCurlResponse($response) {\n $headers = array();\n $response = str_replace(\"HTTP/1.1 100 Continue\\r\\n\\r\\n\", '', $response);\n\n $header_text = substr($response, 0, strpos($response, \"\\r\\n\\r\\n\"));\n\n foreach (explode(\"\\r\\n\", $header_text) as $i => $line) {\n if ($i === 0) {\n $headers['http_code'] = $line;\n } else {\n list ($key, $value) = explode(': ', $line);\n\n $headers[$key] = $value;\n }\n }\n\n return $headers;\n }", "private function parseHeader($raw_headers){\n $headers = [];\n\n foreach( explode(\"\\n\", $raw_headers) as $i => $h ){\n $h = explode(':', $h, 2);\n\n if (isset($h[1])) {\n $headers[$h[0]] = trim($h[1]);\n }\n }\n\n return $headers;\n }", "public function toHeaders(): array;", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "function parse_response($response){ \r\n \r\n list($response_headers,$response_body) = explode(\"\\r\\n\\r\\n\",$response,2); \r\n $response_header_lines = explode(\"\\r\\n\",$response_headers); \r\n \r\n // first line of headers is the HTTP response code \r\n $http_response_line = array_shift($response_header_lines); \r\n if (preg_match('/^HTTP\\/[0-9]\\.[0-9a-z] ([0-9]{3})/i',$http_response_line,$matches)) { \r\n $response_code = $matches[1]; \r\n }\r\n // put the rest of the headers in an array \r\n $response_header_array = array(); \r\n foreach ($response_header_lines as $header_line) { \r\n list($header,$value) = explode(': ',$header_line,2); \r\n $response_header_array[$header] = $value; \r\n } \r\n \r\n return array($response_code,$response_header_array,$response_body); \r\n}", "public function getHeaders() {\n if (!isset($this->rawHeaders) && isset($this->query['opts'][CURLOPT_WRITEHEADER])) {\n rewind($this->query['opts'][CURLOPT_WRITEHEADER]);\n $headersRaw = stream_get_contents($this->query['opts'][CURLOPT_WRITEHEADER]);\n $headers = explode(\"\\n\", rtrim($headersRaw));\n $this->rawHeaders['result'] = trim(array_shift($headers));\n\n foreach ($headers AS $header) {\n \t\t$parts = array_map('trim', explode(':', $header, 2));\n $name = $parts[0];\n $value = '';\n if (!empty($parts[1])) {\n $value = $parts[1];\n }\n $name = strtolower($name);\n $this->rawHeaders[$name] = $value;\n }\n }\n return $this->rawHeaders;\n }", "public function getHeadersArray() { return $this->headers; }", "protected function parseHeaders( $headers )\n {\n $head = array();\n foreach ($headers as $k => $v) {\n $t = explode(':', $v, 2);\n if (isset($t[1]))\n $head[trim($t[0])] = trim($t[1]);\n else {\n $head[] = $v;\n if (preg_match(\"#HTTP/[0-9\\.]+\\s+([0-9]+)#\", $v, $out))\n $head['reponse_code'] = intval($out[1]);\n }\n }\n return $head;\n }", "private function setHeaders($result)\n {\n $headers = [];\n $resultsRaw = explode(PHP_EOL, $result);\n $mainInformation = explode(' ', array_shift($resultsRaw), 3);\n $version = explode('/', $mainInformation[0])[1];\n $code = $mainInformation[1];\n foreach ($resultsRaw as $row) {\n $parts = explode(':', $row);\n if (count($parts) === 2)\n {\n $headers[trim($parts[0])] = trim($parts[1]);\n }\n }\n return [$headers, $code, $version];\n }", "public function getHeaders(): array {\n $result = [];\n\n foreach ($this->headers as $key => $lines) {\n $name = $this->headerNames[$key];\n $result[$name] = $lines;\n }\n\n return $result;\n }", "private function getHttpHeaders()\n {\n $ret = [];\n foreach ($this->httpConfig->getHeaders() as $k => $v) {\n $ret[] = \"$k: $v\";\n }\n return $ret;\n }", "protected static function parseHeaders(ResponseInterface $response)\n {\n $headers = [];\n\n foreach ($response->getHeaders() as $name => $values) {\n $headers[static::normalizeHeaderName($name)] = $values;\n }\n\n if (! isset($headers['Content-Type']) || empty($headers['Content-Type'])) {\n $headers['Content-Type'] = ['text/html'];\n }\n\n return $headers;\n }", "function ws_getheaders($data) {\n //if(!preg_match('/\\AGET (\\S+) HTTP\\/1.1\\z/', $lines[0], $matches))\n\n\t$lines = preg_split(\"/\\r\\n/\",rtrim($data));\n\t$lines[0] = \"info: \".$lines[0];\n\t\n\t$headers = array();\n\tforeach($lines as $line)\n\t\tif(preg_match('/\\A(\\S+): (.*)\\z/', rtrim($line), $matches)) $headers[$matches[1]] = $matches[2];\n\n\treturn $headers;\n}", "#[Pure]\nfunction http_parse_headers($header) {}", "private function parseHeaders($headers): array {\n if (is_string($headers)) {\n $headers = explode(\"\\r\\n\", $headers);\n }\n\n if (empty($headers)) {\n return [];\n }\n\n $result = [];\n foreach ($headers as $key => $line) {\n if (is_numeric($key)) {\n if (strpos($line, 'HTTP/') === 0) {\n // Strip the status line and restart.\n $result = [];\n continue;\n } elseif (strstr($line, ': ')) {\n list($key, $line) = explode(': ', $line);\n } else {\n continue;\n }\n }\n if (is_array($line)) {\n $result[$key] = array_merge($result[$key] ?? [], $line);\n } else {\n $result[$key][] = $line;\n }\n }\n\n return $result;\n }", "public static function prepareHeaders(ResponseInterface $response): array\n {\n $preparedHeaders = [];\n $statusHeader = rtrim(self::generateStatusLine($response), \"\\r\\n\");\n\n $preparedHeaders[] = $statusHeader;\n $headers = $response->getHeaders();\n if ($headers instanceof Headers) {\n $preparedHeaders = array_merge($preparedHeaders, $headers->getPreparedValues());\n } else {\n foreach (array_keys($headers) as $name) {\n $preparedHeaders[] = $response->getHeaderLine($name);\n }\n }\n\n return $preparedHeaders;\n }", "public static function formatHeadersToArray(array $rawHeaders)\r\r\n {\r\r\n $headers = array();\r\r\n\r\r\n foreach ($rawHeaders as $line) {\r\r\n if (strpos($line, ':') === false) {\r\r\n $headers['http_code'] = $line;\r\r\n } else {\r\r\n list ($key, $value) = explode(': ', $line);\r\r\n $headers[$key] = $value;\r\r\n }\r\r\n }\r\r\n\r\r\n return $headers;\r\r\n }", "private function make_response_array($response) {\n $myarray = array();\n $data = explode(\"\\n\", $response);\n if (strpos($data[0], 'HTTP') === 0) {\n // the first line is a status code\n $myarray['status'] = $data[0];\n array_shift($data);\n }\n foreach ($data as $part) {\n if (json_decode($part)) {\n $myarray[] = json_decode($part);\n continue;\n }\n $middle = explode(\": \", $part, 2);\n $myarray[trim($middle[0])] = trim($middle[1]);\n }\n return $myarray;\n }", "private function get_headers() {\r\n\t\treturn array( 'User-Agent' => $this->user_agent );\r\n\t}", "private function returnImapHeadersArr(){\n\t\treturn imap_headers($this->stream);\n\t}", "public function getHeaders()\n {\n }", "public function getHeaders()\n {\n }", "public function ParseHeader($header = '')\n\t{\n\t\t$resArr = array();\n\t\t$headerArr = explode(\"\\n\", $header);\n\t\tforeach ($headerArr as $key => $value)\n\t\t{\n\t\t\t$tmpArr = explode(\": \", $value);\n\t\t\tif (count($tmpArr) < 1) continue;\n\t\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t\t}\n\t\treturn $resArr;\n\t}", "public static function processHeaders($xRawHeader)\n {\n $aRawHeader = is_array($xRawHeader) ? $xRawHeader : explode(\"\\n\", $xRawHeader);\n $hHeaders = [];\n $sPrevMatch = '';\n\n foreach ($aRawHeader as $sLine)\n {\n if (preg_match('/^([a-z][a-z0-9-_]+):/is', $sLine, $aMatch))\n {\n $sHeaderName = strtolower($aMatch[1]);\n $sPrevMatch = $sHeaderName;\n $hHeaders[$sHeaderName] = trim(substr($sLine, strlen($sHeaderName) + 1));\n }\n else\n {\n if (!empty($sPrevMatch))\n {\n $hHeaders[$sPrevMatch] .= ' ' . $sLine;\n }\n }\n }\n\n return $hHeaders;\n }", "private function parseResponse() {\n $headers = Strings::split(substr($this->response, 0, $this->info['header_size']), \"~[\\n\\r]+~\", PREG_SPLIT_NO_EMPTY);\n $this->headers = static::parseHeaders($headers);\n $this->body = substr($this->response, $this->info['header_size']);\n $this->response = NULL;\n }", "protected function readHeaders()\n {\n $ret = [];\n foreach ($this->environment as $key => $value) {\n # Note: the content-type and content-length headers always come\n # after the `CONTENT_TYPE` and `CONTENT_LENGTH` values in the\n # $_SERVER superglobal; if you use the values for the non `HTTP_...`\n # version, they will just be overwritten by the `HTTP_` version.\n if (strpos($key, \"HTTP_\") === 0) {\n $key = substr($key, 5);\n $key = strtolower($key);\n $key = str_replace(\"_\", \"-\", $key);\n $ret[$key] = $value;\n }\n }\n return $ret;\n }", "public function headers(): Collection;", "function getHeaders($string)\n{\n if (strpos($string, ':') == false) {\n return null;\n }\n\n $string = stristr($string, \"\\n\", false);\n $string = stristr($string, \"\\n\\r\", true);\n $string = removeFirstChar($string);\n\n $result = array();\n\n while (strpos($string, ':') != false) {\n if (strpos($string, \"\\n\") != false) {\n $substring = stristr($string, \"\\n\", true);\n $substring = removeUnnecessaryCharas($substring);\n $string = stristr($string, \"\\n\", false);\n $string = removeFirstChar($string);\n } else {\n $substring = $string;\n }\n\n $key = stristr($substring, ':', true);\n $value = stristr($substring, ' ', false);\n $value = removeUnnecessaryCharas($value);\n $result[$key] = $value;\n if ($string == $substring) {\n break;\n }\n }\n return $result;\n}", "public function getHeaders()\n {\n $headers = array();\n foreach ($this->headers as $name => $content) {\n if (is_numeric($name) === false) {\n $content = ucwords($name) . ': ' . $content;\n }\n $headers[] = $content;\n }\n\n return $headers;\n }", "private function getHeaders(string $content): array\n {\n return [\n 'Accept: application/json',\n 'Content-Type: application/json',\n 'Connection: close',\n 'Content-Length: ' . strlen($content),\n ];\n }", "protected function parseHeaders($content)\n {\n $headers = [];\n $rawHeaders = preg_split('/\\\\r\\\\n/', $content);\n\n foreach ($rawHeaders as $rawHeader) {\n if (strpos($rawHeader, ':') === false) {\n continue;\n }\n\n list($name, $value) = explode(':', $rawHeader, 2);\n $headers[trim($name)] = trim($value);\n }\n\n return $headers;\n }", "private function parseRequestHeaders(array $array)\n {\n $headers = [];\n\n foreach ($array as $header) {\n preg_match('#(.*?)\\:\\s(.*)#', $header, $matches);\n\n if (count($matches) > 2) {\n $headers[$matches[1]] = $matches[2];\n } else {\n preg_match('#(.*?)\\s\\/\\sHTTP\\/(.*)#', $header, $matches);\n\n if(count($matches) > 2) {\n $headers['Http-Version'] = $matches[2];\n $headers['Request_Method'] = $matches[1];\n }\n }\n }\n\n return $headers;\n }", "public function getResponseHeaders() {\n $requestHeaders = [];\n\n if ($this->headers instanceof \\ArrayAccess) {\n while ($this->headers->valid()) {\n $requestHeaders[$this->headers->key()] = $this->headers->current();\n $this->headers->next();\n }\n }\n\n return $requestHeaders;\n }", "private function composeFirstHeader(string $header): array\n {\n preg_match('/http\\/(.+) (\\d+) (.*)/i', $header, $matches);\n return $matches;\n }", "private function __splitEmailHeaders($headers) {\n\t\t$arrayHeaders = array();\n\t\tforeach (explode(\"\\r\\n\", $headers) as $header) {\n\t\t\t$headerParts = explode(':', $header);\n\t\t\t$arrayHeaders[$headerParts[0]] = trim($headerParts[1]);\n\t\t}\n\n\t\treturn $arrayHeaders;\n\t}", "public static function http__get_headers(){\n\n $headers = array();\n foreach($_SERVER as $key => $val){\n if( 0 === stripos( $key, 'http_' ) ){\n $server_key = preg_replace('/^http_/i', '', $key);\n $key_parts = explode('_', $server_key);\n if(count($key_parts) > 0 and strlen($server_key) > 2){\n foreach($key_parts as $part_index => $part){\n $key_parts[$part_index] = function_exists('mb_strtolower') ? mb_strtolower($part) : strtolower($part);\n if(!empty($key_parts[$part_index][0])) {\n\t\t\t\t\t\t\t$key_parts[$part_index][0] = strtoupper($key_parts[$part_index][0]);\n\t\t\t\t\t\t}\n }\n $server_key = implode('-', $key_parts);\n }\n $headers[$server_key] = $val;\n }\n }\n return $headers;\n }", "function getHTTPHeaders(Server $server) {\n\n return [];\n\n }", "protected function _getHeaders()\n {\n $out = [];\n foreach ($this->headers as $key => $values) {\n $out[$key] = implode(',', $values);\n }\n\n return $out;\n }", "private function parseHeaders(array $server)\n {\n $headers = [];\n\n foreach ($server as $header => $val) {\n if (strpos($header, 'HTTP_') === 0) {\n $key = ucwords(str_replace('_', '-', strtolower(substr($header, 5))), '-');\n $headers[$key] = $val;\n }\n }\n\n return $headers;\n }", "private function parseResponseHeaders($headers)\n {\n $result = array();\n // create an array containing headers.\n if (is_string($headers)) {\n // store each line as a header.\n $headers = explode(\"\\r\\n\", $headers);\n } else if($headers instanceof \\Traversable) {\n // copy the iterator into an array.\n if ($headers instanceof \\Traversable) {\n if (version_compare(PHP_VERSION, '5.1.0', '>=')) {\n $headers = iterator_to_array($headers);\n } else {\n $headers = Arrays::iteratorToArray($headers);\n }\n }\n }\n\n // parse each header line.\n $lines = (array) $headers;\n foreach ($lines as $line) {\n if ($line && strpos($line, ':') !== false) {\n // separate line into key and value.\n list($key, $value) = explode(': ', $line, 2);\n if (isset($result[$key])) {\n // allow the existence of duplicate keys.\n if (!is_array($result[$key])) {\n $result[$key] = array($result[$key]);\n }\n // add value to existing array.\n $result[$key][] = $value;\n } else {\n // add value.\n $result[$key] = $value;\n }\n }\n } \n return $result;\n }", "public function getHeaders(): array\n {\n if ($this->headers === null) {\n foreach ($_SERVER as $name => $value) {\n if (strncmp($name, 'HTTP_', 5) === 0) {\n $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));\n $this->headers[$name] = $value;\n }\n }\n\n return $this->headers;\n }\n\n return $this->headers;\n }", "private function getheaders($req) {\n $res = preg_match(\"/GET (.*) HTTP/i\" , $req, $match) ? $match[1] : \"???\";\n $host = preg_match(\"/Host: (.*)\\r\\n/i\" , $req, $match) ? $match[1] : \"???\";\n $ori = preg_match(\"/Origin: (.*)\\r\\n/i\" , $req, $match) ? $match[1] : \"???\";\n $key = preg_match(\"/Sec-WebSocket-Key: (.*)\\r\\n/i\", $req, $match) ? $match[1] : \"???\";\n\n return array($res, $host, $ori, $key);\n }", "private function get_response_headers(array $response)\n {\n if (!isset($response['headers']) || !is_array($response['headers'])) {\n return array();\n }\n\n return $response['headers'];\n }", "function processHeaders($headers) {\n\t\tif ( is_string($headers) )\n\t\t\t$headers = explode(\"\\n\", str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $headers) );\n\n\t\t$response = array('code' => 0, 'message' => '');\n\n\t\t$cookies = array();\n\t\t$newheaders = array();\n\n // first, process the HTTP status line\n if ( false === strpos($headers[0], ':') ) {\n $tempheader = array_shift($headers);\n list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3);\n $response['code'] = $iResponseCode;\n $response['message'] = $strResponseMsg;\n } \n\n // combine any headers split over multiple lines\n for ( $i=(sizeof($headers)-1); $i>=0; $i-- ) {\n $c = substr($headers[$i], 0, 1);\n if ($c == ' ' || $c == \"\\t\") {\n $headers[$i-1] = rtrim($headers[$i-1]) . ' ' . ltrim($headers[$i]);\n unset($headers[$i]);\n } \n } \n\n\t\tforeach ( $headers as $tempheader ) {\n\t\t\tif ( empty($tempheader) )\n\t\t\t\tcontinue;\n\n\t\t\tlist($key, $value) = explode(':', $tempheader, 2);\n\n\t\t\tif ( !empty( $value ) ) {\n\t\t\t\t$key = strtolower( $key );\n\t\t\t\tif ( isset( $newheaders[$key] ) ) {\n\t\t\t\t\t$newheaders[$key] = array( $newheaders[$key], trim( $value ) );\n\t\t\t\t} else {\n\t\t\t\t\t$newheaders[$key] = trim( $value );\n\t\t\t\t}\n\t\t\t\tif ( 'set-cookie' == strtolower( $key ) )\n\t\t\t\t\t$cookies[] = new WP_Http_Cookie( $value );\n\t\t\t}\n\t\t}\n\n\t\treturn array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies);\n\t}", "function getallheaders()\n {\n $headers = [];\n if (isset($_SERVER)) {\n\n foreach ($_SERVER as $name => $value) {\n if (substr($name, 0, 5) == 'HTTP_') {\n $headers[str_replace(\n ' ',\n '-',\n ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))\n )] = $value;\n }\n }\n\n }\n\n return $headers;\n }", "public static function getHeaders()\n {\n if (!isset(self::$_data[self::KEY_HEADERS]))\n {\n $_listHeaders = array();\n foreach ($_SERVER as $_key => $_value)\n {\n if (substr($_key, 0, 5) == \"HTTP_\")\n {\n $_key = str_replace('_', ' ', substr($_key, 5));\n $_key = str_replace(' ', '-', ucwords(strtolower($_key)));\n $_listHeaders[$_key] = $_value;\n }\n }\n self::$_data[self::KEY_HEADERS] = $_listHeaders;\n }\n return self::$_data[self::KEY_HEADERS];\n }", "public function readHeaders(): ?array;", "function _parseHeader($header) {\n\n\t\tif (is_array($header)) {\n\t\t\tforeach ($header as $field => $value) {\n\t\t\t\tunset($header[$field]);\n\t\t\t\t$field = strtolower($field);\n\t\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\n\t\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t\t}\n\t\t\t\t$header[$field] = $value;\n\t\t\t}\n\t\t\treturn $header;\n\t\t} elseif (!is_string($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpreg_match_all(\"/(.+):(.+)(?:(?<![\\t ])\" . $this->line_break . \"|\\$)/Uis\", $header, $matches, PREG_SET_ORDER);\n\n\t\t$header = array();\n\t\tforeach ($matches as $match) {\n\t\t\tlist(, $field, $value) = $match;\n\n\t\t\t$value = trim($value);\n\t\t\t$value = preg_replace(\"/[\\t ]\\r\\n/\", \"\\r\\n\", $value);\n\n\t\t\t$field = $this->_unescapeToken($field);\n\n\t\t\t$field = strtolower($field);\n\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t}\n\n\t\t\tif (!isset($header[$field])) {\n\t\t\t\t$header[$field] = $value;\n\t\t\t} else {\n\t\t\t\t$header[$field] = array_merge((array) $header[$field], (array) $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $header;\n\t}", "private static function parse(string $headers): array\n {\n $header = [];\n $matches = [];\n preg_match_all(\n '=^(.[^: ]+): ([^\\r\\n]*)=m',\n $headers,\n $matches,\n PREG_SET_ORDER\n );\n foreach ($matches as $line) {\n $header[(string) $line[1]] = $line[2];\n }\n\n return $header;\n }" ]
[ "0.73479515", "0.72186905", "0.7212431", "0.71825874", "0.7142414", "0.7142414", "0.7142414", "0.7142414", "0.7142414", "0.7142414", "0.7142414", "0.70838654", "0.704647", "0.7034281", "0.7026964", "0.6987525", "0.69862616", "0.6935225", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.69257486", "0.6873041", "0.68668", "0.68450564", "0.68441075", "0.68276936", "0.6817539", "0.68094283", "0.67985076", "0.67879736", "0.67879736", "0.67830485", "0.67603505", "0.6756485", "0.67561126", "0.67478824", "0.6741327", "0.6740227", "0.67400956", "0.6734035", "0.6730494", "0.67145437", "0.6691488", "0.6687936", "0.6687004", "0.6659106", "0.66507214", "0.6642266", "0.6637612", "0.65752214", "0.6573946", "0.6546712", "0.6519127", "0.65152717", "0.6506421", "0.64818466", "0.64775", "0.6460747", "0.6446101", "0.64414704", "0.6439218", "0.643907", "0.6427671", "0.64258707", "0.6420539", "0.6420539", "0.6418448", "0.64118654", "0.6398944", "0.63960624", "0.6389483", "0.6384287", "0.63808405", "0.63796717", "0.636912", "0.63512087", "0.63388336", "0.63190615", "0.63179326", "0.6305243", "0.62943935", "0.62883097", "0.62860066", "0.6274299", "0.6263096", "0.62621844", "0.6261413", "0.6259702", "0.62574714", "0.625694", "0.62567186", "0.62514", "0.62499756" ]
0.7586716
0
Get current class loader
Получить текущий загрузчик классов
public function getClassLoader() { return $this->classLoader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function getClassLoader() {}", "public function get_loader()\n {\n return $this->loader;\n }", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function get_loader() {\n\t\treturn $this->loader;\n\t}", "public function getLoader()\n {\n return $this->loader;\n }", "public static function getClassLoader()\n {\n if (static::$loader === null) {\n\n spl_autoload_register(array('NamespaceClassLoader', 'loadClassLoader'), true, true);\n static::$loader = $loader = new \\Composer\\Autoload\\ClassLoader();\n spl_autoload_unregister(array('NamespaceClassLoader', 'loadClassLoader'));\n static::$loader->register();\n }\n\n return static::$loader;\n }", "public static function getAppLoader() {\n return self::$appLoader;\n }", "public static function get_loader() {\n if (self::$loader == null) {\n self::$loader = new Autoloader();\n }\n /**\n * Unlike our previous singleton, in order to have this class automatically load our classes it is necessary to use the spl_autoload_register function before returning the instance.\n * \n * This function takes an array as the first parameter which holds the class name of an autoloading method we want to call, followed by the method name.\n */\n spl_autoload_register(array('Autoloader', 'class_loader'), true, false);\n /**\n * The second and third parameters are boolean values. The first specifies whether the function should throw exceptions (errors) if the class_loader() method can not be registered and should be set to true.\n * \n * The second specifies that this autoloader method should be moved to the top of the queue if there are multiple autoloaders and should beset to false as we will want this autoloader to come after another autoloader we will be importing.\n */\n return self::$loader;\n }", "public static function loader()\n\t{\n\t\treturn static::$_parser_loader;\n\t}", "static private function _getLoader() {\n\t\tif(self::isNull(self::$_loader)) {\n\t\t\tself::$_loader = Loader::getImageLoader(self::webiny()->getConfig()->get('components.image'));\n\t\t}\n\n\t\treturn self::$_loader;\n\t}", "protected function getClassLoaderService()\n {\n $this->services['class_loader'] = $instance = new \\phpbb\\class_loader('phpbb\\\\', './../includes/', 'php');\n\n $instance->register();\n $instance->set_cache(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'});\n\n return $instance;\n }", "final public static function getClass(){\n return get_called_class();\n }", "protected function getRegistryLoader()\n {\n return $this->registryLoader;\n }", "public static function init(){\n if( self::$loader == null ){\n self::$loader = new self();\n }\n return self::$loader;\n }", "private function getLoader(): FilesystemLoader\n {\n if (null == $this->loader) {\n $this->loader = new FilesystemLoader(\n $this->locations\n );\n }\n return $this->loader;\n }", "protected function getLoader()\n {\n }", "public abstract function get_loader_name();", "public static function getAutoloader()\n {\n if (self::$autoloader !== null) {\n return self::$autoloader;\n } else {\n throw new \\Exception('Autoloader is not registered, cannot be retrieved.');\n }\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "public function get_loader_name()\n {\n }", "protected function getClass()\n {\n return __CLASS__;\n }", "public static function loader()\r\n {\r\n if(is_null(self::$instance))\r\n self::$instance = new self();\r\n return self::$instance;\r\n }", "public static function __getClass()\n {\n return __CLASS__;\n }", "protected function getClassLoader_ExtService()\n {\n $this->services['class_loader.ext'] = $instance = new \\phpbb\\class_loader('\\\\', './../ext/', 'php');\n\n $instance->register();\n $instance->set_cache(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'});\n\n return $instance;\n }", "protected static function getSingletonClass()\n {\n return get_called_class();\n }", "public function getLoader()\n {\n if (null === $this->loader) {\n throw new LogicException('You must set a loader first.');\n }\n\n return $this->loader;\n }", "public function getPageLoader() {\n return $this->pageLoader;\n }", "public function getClassLoaders();", "public static function __getClass()\r\n\t{\r\n\t\treturn __CLASS__;\r\n\t}", "public function getLoader()\n {\n if (null === $this->loader) {\n throw new LogicException('You must set a loader first.');\n }\n return $this->loader;\n }", "public static function getPluginLoader()\n {\n if (!isset(self::$_pluginLoader)) {\n require_once 'Zend/Loader/PluginLoader.php';\n self::$_pluginLoader = new Zend_Loader_PluginLoader([\n 'Zend_Feed_Reader_Extension_' => 'Zend/Feed/Reader/Extension/',\n ]);\n }\n return self::$_pluginLoader;\n }", "public static function getClass() {\n return Singleton::$_class;\n }", "protected function getLanguage_LoaderService()\n {\n $this->services['language.loader'] = $instance = new \\phpbb\\language\\language_file_loader('./../', 'php');\n\n $instance->set_extension_manager(${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n\n return $instance;\n }", "public static function getInstance() : Loader{\n return self::$instance;\n }", "public static function className() : string {\n return get_called_class();\n }", "protected function getStepsLoaderService()\n {\n if (isset($this->shared['steps_loader'])) return $this->shared['steps_loader'];\n\n $class = $this->getParameter('steps_loader.class');\n $instance = new $class($this->getParameter('steps.path'), $this);\n $this->shared['steps_loader'] = $instance;\n\n return $instance;\n }", "public function config() : LoaderInterface {\n return $this -> loader;\n }", "public function getLoader(): TestSuiteLoader\n {\n if ($this->loader === null) {\n $this->loader = new StandardTestSuiteLoader;\n }\n\n return $this->loader;\n }", "public function getLoader(): TestSuiteLoader\n {\n if ($this->loader === null) {\n $this->loader = new StandardTestSuiteLoader;\n }\n\n return $this->loader;\n }", "function autoloader()\n {\n spl_autoload_register(function ($className) {\n\n # DIRECTORY SEPARATORS varies in various platforms\n $ds = DIRECTORY_SEPARATOR;\n\n # Current Working Directory\n $dir = __DIR__;\n\n # replace namespace separator with directory separator (prolly not required)\n $className = str_replace('\\\\', $ds, $className);\n\n # get full name of file containing the required class\n $file = \"{$dir}{$ds}{$className}.php\";\n\n # get file if it is readable\n if (is_readable($file)) {\n require_once $file;\n }\n });\n }", "public function getLoader()\n {\n if ('file' === $this->source) {\n return new DefinitionManagerFileLoader($this->container, $this->definitionFile);\n } else {\n return new DefinitionManagerDoctrineLoader($this->container, $this->emName);\n }\n }", "protected function getApplicationLoaderPath()\n {\n return './autoload.php';\n }", "public static function getClassLoader($className)\n {\n foreach (spl_autoload_functions() as $loader) {\n if (! is_array($loader)) {\n continue;\n }\n\n $classLoader = reset($loader);\n\n if ($classLoader instanceof ClassLoader && $classLoader->canLoadClass($className)) {\n return $classLoader;\n }\n }\n\n return null;\n }", "public function getFramework() {\r\n\t\treturn $this->context->getState('framework');\r\n\t}", "public static function registerClassLoadingInformation() {}", "public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "public static function get_instance() {\n\n\t\tif ( ! isset( self::$instance ) || ! ( self::$instance instanceof self ) ) {\n\t\t\tself::$instance = new Loader();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public function get_called_class() {\n\n\t\tif ( false !== static::$class_path ) {\n\t\t\treturn static::$class_path;\n\t\t}\n\n\t\t$class_path = get_called_class();\n\t\tstatic::$class_path = $class_path;\n\t\treturn $class_path;\n\n\t}", "protected function getFilesystemLoader() : PregMatchFilteredLoaderInterface\n {\n return $this->filesystemLoader;\n }", "static function getAutoload() {\n\t\treturn systemAutoload::getInstance();\n\t}", "protected function getLoader() : FilteredLoaderInterface\n {\n return $this->loader;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public static function getClass()\n {\n return get_class(new static);\n }", "public function getLoaders()\n {\n return $this->loaders;\n }", "public function getLoaders()\n {\n return $this->loaders;\n }", "public function getRuntimeManager () {\n\t\tif (!isset(self::$runtimeManager)) {\n\t\t\tself::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager($this->getConfigPath());\n\t\t}\n\t\t\n\t\treturn self::$runtimeManager;\n\t}", "protected function getTemplating_LoaderService()\n {\n return $this->services['templating.loader'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader(${($_ = isset($this->services['templating.locator']) ? $this->services['templating.locator'] : $this->getTemplating_LocatorService()) && false ?: '_'});\n }", "public function getSnippetLoader()\n {\n if (! $this->snippetLoader) {\n $this->loadSnippetLoader();\n }\n\n return $this->snippetLoader;\n }", "public static function getClassPath();", "public static function getClassName() {\n return get_called_class();\n }", "public function getConfigLoader(): ?ConfigLoader;", "public static function getClassName()\n {\n return get_called_class();\n }", "public static function isClassLoadingInformationAvailable() {}", "public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}", "public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}", "public function getDefaultConfigLoader(): ?ConfigLoader;", "protected function getFeaturesLoaderService()\n {\n $class = $this->getParameter('features_loader.class');\n $instance = new $class($this->getParameter('features.path'), $this);\n\n return $instance;\n }", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "public function getPlugin(): Plugin {\n\t\treturn $this->loader;\n\t}", "public function getMonitor()\n {\n return $this->_loadClass('Monitor', true);\n }", "public static function __classLoaded()\n {\n\t\tif (empty(static::$layers) && class_exists('Git')) {\n\t\t\tstatic::$layers = \\Git::$repositories;\n\t\t}\n }", "public function getMonitor()\r\n {\r\n return $this->_loadClass('Monitor', true);\r\n }", "protected function initLoader()\n {\n $config = $this->di->getShared('config');\n $loader = new Loader;\n $loader->registerNamespaces(\n [\n 'Phosphorum\\Models' => $config->get('application')->modelsDir,\n 'Phosphorum\\Controllers' => $config->get('application')->controllersDir,\n 'Phosphorum\\Forms' => $config->get('application')->formsDir,\n 'Phosphorum' => $config->get('application')->libraryDir\n ]\n );\n\n $loader->register();\n $this->di->setShared('loader', $loader);\n\n return $loader;\n }", "static public function getClass();", "function classLoader($class)\r\n{\r\n $parts = explode('_', $class);\r\n $namespace = $parts[0];\r\n $classname = $parts[1];\r\n \r\n switch($namespace)\r\n {\r\n case 'Base':\r\n $filename = B_PATH . $classname . '.php';\r\n break;\r\n case 'Controller':\r\n $filename = C_PATH . $classname . '.php';\r\n break;\r\n case 'Model':\r\n $filename = M_PATH . $classname . '.php';\r\n break;\r\n }\r\n\r\n if (!file_exists($filename)) {\r\n return false;\r\n }\r\n require_once $filename;\r\n}", "public static function getLoader($whichLoader)\n {\n $loaderArray = array(\n Loader::XML_LOADER => __NAMESPACE__ . \"\\\\Loaders\\\\XmlLoader\"\n );\n return new $loaderArray[$whichLoader]();\n }", "public static function getInternalClass();", "function get_theme_framework() {\n\treturn \\Classy\\Classy::get_instance();\n}", "public function newLoader()\n {\n $loader = substr(get_class($this), 0, -9) . 'Loader';\n\n return app()->make($loader, ['extension' => $this]);\n }", "public static function get_class(){\n return self::class;}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getTwigLoader(): FilesystemLoader\n {\n return $this->twigLoader;\n }", "private function getKernelClass()\n {\n $env = getenv('KERNEL_CLASS');\n if (strlen($env)) {\n return $env;\n }\n\n $iterator = (new Finder())\n ->name('*Kernel.php')\n ->depth(0)\n ->in(__DIR__.'/'.$this->args['kernel_options']['kernel.root_dir'])\n ->getIterator();\n $iterator->rewind(); //Seems weird that I have rewind a new iterator, but I do\n /** @var SplFileInfo $file */\n $file = $iterator->current();\n $class = $file->getBasename('.php');\n\n require_once $file;\n\n return $class;\n }", "public function isLoaderRegistered()\n {\n return $this->_loaderRegistered;\n }", "public function getProcessorsLoader()\n {\n if ($this->processorsLoader === null)\n {\n $processorsToFilter = $this->parameters['processors'];\n $this->processorsLoader = new PluginLoader(\n 'PieCrust\\\\Baker\\\\Processors\\\\IProcessor',\n PieCrustDefaults::APP_DIR . '/Baker/Processors',\n function ($p1, $p2) { return $p1->getPriority() < $p2->getPriority(); },\n $processorsToFilter == '*' ?\n null :\n function ($p) use ($processorsToFilter) { return in_array($p->getName(), $processorsToFilter); },\n 'SimpleFileProcessor.php'\n );\n foreach ($this->processorsLoader->getPlugins() as $proc)\n {\n $proc->initialize($this->pieCrust);\n }\n }\n return $this->processorsLoader;\n }", "function classLoader($class){\n $filename = $class . '.class.php';\n $file ='classes'. DIRECTORY_SEPARATOR . $filename;\n\n // Smarty ligger i libs-mappa.\n if ($class == 'Smarty') {\n $file = 'libs' . DIRECTORY_SEPARATOR . $filename;\n }\n if (!file_exists($file))\n {\n return false;\n }\n\n include $file;\n}", "abstract protected function batchLoaderClass(): string;" ]
[ "0.75710714", "0.7341214", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.7317648", "0.710501", "0.7070505", "0.6943578", "0.6754278", "0.66970307", "0.6660568", "0.66097414", "0.6464757", "0.6407922", "0.639319", "0.6390693", "0.6272582", "0.6262229", "0.62443995", "0.6214733", "0.6214733", "0.6214733", "0.6214733", "0.6214733", "0.6214733", "0.6214733", "0.6200434", "0.61791384", "0.61496264", "0.61025906", "0.61017627", "0.60305977", "0.6027961", "0.6025893", "0.6005828", "0.60021436", "0.5969743", "0.5969359", "0.59619886", "0.5895711", "0.58730775", "0.5845147", "0.58345956", "0.58276284", "0.58276284", "0.5822198", "0.5813812", "0.5807244", "0.5795001", "0.57830733", "0.57672524", "0.57633185", "0.57525986", "0.5749771", "0.5748627", "0.57476175", "0.5745332", "0.574028", "0.57348484", "0.57135004", "0.56935537", "0.56935537", "0.5685026", "0.5672553", "0.5667972", "0.5666457", "0.5588785", "0.55882984", "0.55825543", "0.5580017", "0.5571673", "0.5571673", "0.55715024", "0.554609", "0.5545499", "0.5540828", "0.5539264", "0.5531759", "0.552336", "0.5521993", "0.5516538", "0.5511942", "0.5510477", "0.55062777", "0.5493096", "0.54804754", "0.54725575", "0.5469229", "0.54639006", "0.54599947", "0.5444874", "0.54182464", "0.54043275", "0.53990734" ]
0.8027073
0
Adds a key to the array if not allready exists like: $array = array('foo' => 'bar'); $array = array_add($array, 'key', 'value');.
Добавляет ключ в массив, если он еще не существует, например: $array = array('foo' => 'bar'); $array = array_add($array, 'key', 'value');.
function array_add($array, $key, $value) { if (!isset($array[$key])) { $array[$key] = $value; } return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_add($array, $key, $value)\n\t{\n\t\tif ( ! isset($array[$key])) $array[$key] = $value;\n\n\t\treturn $array;\n\t}", "function array_add(array $array, string $key, $value):array\n\t{\n\t\tif (is_null(get($array, $key)))\n\t\t{\n\t\t\tset($array, $key, $value);\n\t\t}\n\n\t\treturn $array;\n\t}", "static function add(array $array, $key, $value) {\n if (!array_key_exists($key, $array)) {\n $array[$key] = $value;\n }\n\n return $array;\n }", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function array_add(array &$array, $key, $value) {\n $target = array_get($array, $key, array());\n\n if ( ! is_array($target)) {\n $target = array($target);\n }\n\n $target[] = $value;\n array_set($array, $key, $target);\n\n return $array;\n }", "function array_push_assoc($array, $key, $value){\n $array[$key] = $value;\n return $array;\n }", "public static function addIfNotEmpty($key, $value, array &$array = null)\n {\n if (!is_null($array)) {\n Validate::isArray($array, 'array');\n }\n\n if (!empty($value)) {\n $array[$key] = $value;\n }\n }", "public function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "private function addKey($key)\n {\n $keys = $this->getKeys();\n\n // Don't add duplicate keys into our store\n if (!in_array($key, $keys)) {\n $keys[] = $key;\n }\n\n $this->saveKeys($keys);\n }", "public function add_key ( $key = '' )\n {\n if ( ! empty( $key ) )\n {\n array_push( $this->key, $key );\n }\n\n return $this->get_key();\n }", "public static function array_insert_before($key, array &$array, $new_key, $new_value) {\n if (array_key_exists($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n $new[$k] = $value;\n }\n return $new;\n }\n return FALSE;\n }", "function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "public static function add( $array, $key, $value )\n {\n if ( is_null( static::get( $array, $key ) ) ) {\n static::set( $array, $key, $value );\n }\n\n return $array;\n }", "public function push($key, $value = '~NULL')\n {\n // Yes, this is stupid, but whatever.\n if ($value === '~NULL') {\n $this->array[] = $key;\n } else {\n $this->array[$key] = $value;\n }\n }", "public function array_push_assoc($array, $key, $value)\n {\n $array[$key] = $value;\n return $array;\n }", "public static function add($array, $key, $value)\n {\n if (is_null(static::get($array, $key)))\n {\n static::set($array, $key, $value);\n }\n\n return $array;\n }", "public static function add($array, $key, $value)\n {\n if (is_null(static::get($array, $key))) {\n static::set($array, $key, $value);\n }\n\n return $array;\n }", "function acadp_array_insert_after( $key, $array, $new_array ) {\n\n\tif( array_key_exists( $key, $array ) ) {\n \t$new = array();\n \tforeach( $array as $k => $value ) {\n \t\t$new[ $k ] = $value;\n \t\tif( $k === $key ) {\n\t\t\t\tforeach( $new_array as $new_key => $new_value ) {\n \t\t\t$new[ $new_key ] = $new_value;\n\t\t\t\t}\n \t\t}\n \t}\n \treturn $new;\n \t}\n\n \treturn $array;\n\n}", "function add($key,$value = false) {\n\t\tif(is_array($key))\n\t\t\t$this->_output = array_merge($key, $this->_output);\n\t\telseif(array_key_exists($key,$this->_output)) {\n\t\t\tif(!is_array($this->_output[$key]))\n\t\t\t\t$this->_output[$key] = array($this->_output[$key]);\n\t\t\t\n\t\t\tif(is_array($value))\n\t\t\t\t$this->_output[$key] = array_merge($this->_output[$key],$value);\n\t\t\telse\n\t\t\t\t$this->_output[$key][] = $value;\n\t\t}\n\t\telse\n\t\t\t$this->_output[$key] = $value;\n\t}", "public function add($key, $value)\n\t{\n\t\tif ($key === null) {\n\t\t\t$this->_d[] = $value;\n\t\t} else {\n\t\t\t$this->_d[$key] = $value;\n\t\t}\n\t}", "public function add($item, $key = null)\n {\n if(is_null($key))\n {\n $this->list[] = $item;\n }\n else\n {\n if(isset($this->list[$key]))\n {\n throw new CollectionKeyAlreadyExist(\"The key provided has already been used in this collection\");\n }\n else\n {\n $this->list[$key] = $item;\n }\n }\n\n }", "function array_insert(array $array, $before_key, array $array2) {\n if (!\\array_key_exists($before_key, $array))\n \\trigger_error(\"The key '$before_key' does not exist in \\$array.\", \\E_USER_ERROR);\n $new_array = array();\n foreach ($array as $key => $value) {\n if ($key === $before_key) {\n foreach ($array2 as $key2 => $value2) {\n if (!\\array_key_exists($key2, $new_array))\n $new_array[$key2] = $value2;\n }\n $before_key = null;\n }\n if (!\\array_key_exists($key, $new_array))\n $new_array[$key] = $value;\n }\n return $new_array;\n}", "function _add_array($array = array(), $keys, $value)\n{\n\t// while fn needs to go deeper into array\n\tif(count($keys) > 1)\n\t{\n\t\t// get current key\n\t\treset($keys);\n\t\t$key = $keys[key($keys)];\n\t\t// remove current key from keys\n\t\tunset($keys[key($keys)]);\n\t\t// if key exists merge\n\t\tif( isset($array[$key]) )\n\t\t{\n\t\t\t$array[$key] = _add_array($array[$key], $keys, $value);\n\t\t}\n\t\t// if key does not exists add\n\t\telse\n\t\t{\n\t\t\t$array[$key] = false;\n\t\t\t$array[$key] = _add_array($array[$key], $keys, $value);\t\n\t\t}\n\t}\n\t// if right depth in array is reached\n\telse\n\t{\n\t\t// get current key\n\t\t$key = $keys[key($keys)];\n\t\t// if key exists merge\n\t\tif( isset($array[$key]) && is_array($array[$key]) )\n\t\t{\n\t\t\t$array[$key] = array_merge($array[$key], (array) $value);\t\t\n\t\t}\n\t\t// if key does not exists add\n\t\telse\n\t\t{\n\t\t\t$array[$key] = $value;\t\t\t\n\t\t}\n\t}\n\t// return new array\n\treturn $array;\n}", "function array_add_by_key( $array1, $array2 ) {\n foreach ( $array2 as $k => $a ) {\n if ( array_key_exists( $k, $array1 ) ) {\n $array1[$k] += $a;\n } else {\n $array1[$k] = $a;\n }\n }\n return $array1;\n}", "static function ensure(&$array, $value){\n\t\tif(array_search($value, $array) === false){\n\t\t\t$array[] = $value;\n\t\t}\n\t\treturn $array;\n\t}", "public function addKey(string $key): void\n {\n if (!in_array($key, $this->keys, true)) {\n $this->keys[] = strtolower($key);\n }\n }", "public static function array_push(&$array, $key, $var=null) {\n if(func_num_args() === 3) {\n if(is_array($key)) {\n while(count($key) >= 2) {\n $k = array_shift($key);\n if(!array_key_exists($k, $array)) {\n $array[$k] = [];\n }\n $array = &$array[$k];\n }\n $key = reset($key);\n }\n if(array_key_exists($key, $array)) {\n $array[$key][] = $var;\n } else {\n $array[$key] = [$var];\n }\n } else {\n $array[] = $key;\n }\n }", "public function addAt($key, $value);", "public function maybe_add_cache_key( $key = '' ) {\n\t\t\tif ( ! empty( $key ) ) {\n\t\t\t\t$all_cache_key = get_option( 'wc_sc_all_cache_key' );\n\t\t\t\tif ( false !== $all_cache_key ) {\n\t\t\t\t\tif ( empty( $all_cache_key ) || ! is_array( $all_cache_key ) ) {\n\t\t\t\t\t\t$all_cache_key = array();\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! in_array( $key, $all_cache_key, true ) ) {\n\t\t\t\t\t\t$all_cache_key[] = $key;\n\t\t\t\t\t\tupdate_option( 'wc_sc_all_cache_key', $all_cache_key, 'no' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function arrayMove(&$array, $key) {\n\t\tif(!array_key_exists($key, $array)) {\n\t\t\tthrow new Exception('Key '.$key.' not found from '.\n\t\t\t\t$this->className.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$append = $array[$key];\n\t\t\t\tarray_splice($array, $key, 1);\n\t\t\t\tarray_unshift($array, $append);\n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}", "public function addKey($key)\n {\n $this->keys[] = sha1($key);\n return $this->keys;\n }", "public static function addOrRemoveValueFromArray(string $arrayKey, $value, $add = null): ?bool {\n\t\t$array = self::getArray ( $arrayKey );\n\t\t$_SESSION [$arrayKey] = $array;\n\t\t$search = \\array_search ( $value, $array );\n\t\tif ($search === false && $add) {\n\t\t\t$array [] = $value;\n\t\t\tself::$sessionInstance->set ( $arrayKey, $array );\n\t\t\treturn true;\n\t\t} else if ($add !== true) {\n\t\t\tunset ( $array [$search] );\n\t\t\tself::$sessionInstance->set ( $arrayKey, $array );\n\t\t\treturn false;\n\t\t}\n\t\treturn null;\n\t}", "public static function addValueToArray(string $arrayKey, $value): ?bool {\n\t\treturn self::addOrRemoveValueFromArray ( $arrayKey, $value, true );\n\t}", "function array_key_or_exit($key, $arr, $msg) {\n exit_if(!array_key_exists($key, $arr), $msg);\n return $arr[$key];\n}", "public function append($key, $value) {}", "public function append($key, $value = null);", "public function add(string $key, $element): void;", "function set_array_value(&$array, $ignore_if_blank, $key, $value)\n{\n if ($value || (!$ignore_if_blank && isset($array[$key])))\n {\n if ($value)\n $array[$key] = $value;\n else\n unset($array[$key]);\n }\n}", "public function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "function array_set(&$array, $key, $value)\n {\n return Arr::set($array, $key, $value);\n }", "function array_set(&$array, $key, $value)\n {\n return Arr::set($array, $key, $value);\n }", "function array_set(&$array, $key, $value)\n {\n return Arr::set($array, $key, $value);\n }", "public function addItem($key, $value);", "function array_get($arr, $key, $notfound = ''){\r\n\tif (!isset($arr[$key])){\r\n\t\treturn $notfound;\r\n\t}\r\n\treturn $arr[$key];\r\n}", "function array_unshift_assoc(&$arr, $key, $val) {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n $arr = array_reverse($arr, true);\n return count($arr);\n}", "public static function prepend($array, $value, $key = null)\n {\n if (is_null($key)) {\n array_unshift($array, $value);\n } else {\n $array = [$key => $value] + $array;\n }\n\n return $array;\n }", "function acf_add_array_key_prefix($array, $prefix)\n{\n}", "public function add($obj, $key = NULL) {\n try{\n if ($key == NULL) {\n $this->Items[] = $obj;\n } else {\n $this->Items[$key] = $obj;\n }\n }catch(Exception $e){\n throw $e;\n }\n }", "public static function array_insert_after($key, array &$array, $new_key, $new_value) {\n if (array_key_exists ($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n $new[$k] = $value;\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n }\n return $new;\n }\n return $array;\n }", "function array_push_ex(array &$arr1,$arr2) {\n foreach ($arr2 as $key => $value) {\n $arr2[$key] = ($value);\n }\n array_push($arr1,$arr2);\n}", "function array_get($key, $arr, $default = null) {\n return array_key_exists($key, $arr) ? $arr[$key] : $default;\n}", "function arrayPrepend($array, $value) {\n array_unshift($array, $value);\n return $array;\n}", "function array_set(&$array, $key, $value)\n {\n return ArrayHelper::set($array, $key, $value);\n }", "public function prepend( $key, $value )\n\t{\n\t\t$array = $this->get( $key );\n\t\tarray_unshift( $array, $value );\n\t\t$this->set( $key, $array );\n\t}", "function util_array_fill_keys($keys, $value)\n{\n\tif (!is_array($keys))\n\t\treturn FALSE ;\n\t$filledArray = array();\n\tforeach ($keys as $key)\n\t{\n\t\t$filledArray[$key] = $value ;\n\t}\n\t\n\treturn $filledArray ;\n}", "public function add($key, $value)\n\t{\n\t\tif ($this->hasKey($key))\n\t\t{\n\t\t\tthrow new \\Exception('Element '.$key.' already exists in Map');\n\t\t}\n\n\t\t$this->set($key, $value);\n\t}", "public function append($value, $key = null) \n {\n $key ? $this->pushKey($key, $value) : $this->push($value);\n }", "public static function prepend($key, $value)\n {\n $array = self::get($key);\n\n array_unshift($array, $value);\n\n self::set($key, $array);\n }", "public function add($key, $value) \r\n {\r\n if(is_null($key)) \r\n {\r\n throw new ArgumentNullException(\"key is null.\");\r\n }\r\n \r\n if($this->containsKey($key)) \r\n {\r\n throw new ArgumentException(\"An element with the same key already exists in the System.Collections.Hashtable.\");\r\n }\r\n\r\n $this->elements[$key] = $value;\r\n }", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n }", "function arrayExists($array, $key)\n {\n return array_key_exists($key, $array);\n }", "function safe_array_get($key, $array, $default=NULL) {\n if(!is_array($array)){\n return $default;\n }\n if (array_key_exists($key, $array)) {\n return $array[$key];\n }\n return $default;\n}", "abstract public function append($keyOrArray, $value = null): self;", "function arrayGet($array, $key, $default = NULL)\n{\n return isset($array[$key]) ? $array[$key] : $default;\n}", "function addRet($key, $value){\n\n\t\t$this->arrRet [$key] = $value;\n\t\n\t}", "function array_get(array $arr, $key, $default = null) {\n\treturn array_key_exists($key, $arr) ? $arr[$key] : $default;\n}", "function db_add_unique_key(&$ret, $table, $name, $fields) {\n $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD UNIQUE KEY '.\n $name .' ('. _db_create_key_sql($fields) .')');\n}", "function util_array_values_prepend(&$item, $key, $prefix)\n{\n $item = $prefix.$item;\n}", "function GetEntry($arr, $key, $default = NULL)\n{\n return array_key_exists($key, $arr) ? $arr[$key] : $default;\n}", "public function add_data($key, $value = false) {\n\n\t\t// is assoc array -> add key->value \n\t\tif (is_array($key)) {\n\t\t\t$this->data = $key;\n\t\t}\n\n\t\telseif ($key !== false && $value !== false) {\n\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}", "public static function push($key, $value)\n {\n $array = self::get($key);\n\n $array[] = $value;\n\n self::set($key, $array);\n }", "function array_set($key, $value, &$array)\n {\n return arr::set($key, $value, $array);\n }", "public function push( $key, $value )\n\t{\n\t\t$array = $this->get( $key );\n\t\t$array[] = $value;\n\t\t$this->set( $key, $array );\n\t}", "function add(array &$array, $value, $index = 0)\n{\n global $size;\n\n $inputSize = count($array);\n\n if ($inputSize >= $size) {\n resize($array);\n }\n\n $array[$index] = $value;\n\n return ++$index;\n}", "function array_get(array $a, $key, $default = null) {\n return isset($a[$key]) ? $a[$key] : $default;\n}", "function array_key_or_default($key, $arr, $default) {\n if(array_key_exists($key, $arr))\n return $arr[$key];\n return $default;\n}", "function array_access($array, $key, $default) {\n if (array_key_exists($key, $array)) {\n return $array[$key];\n }\n return $default;\n }", "public function add($key, $value)\n {\n $this->storage[$key] = $value;\n }", "public static function add($key = string, $value = string)\n {\n // self::delete($key);\n // \\DB::insert('systemsettings')\n // ->set(array(\n // $key => $value,\n // 'updated_at' => date('Y-m-d H:i:s'),\n // ))\n // ->execute();\n\n }", "public function offsetExists( $key );", "function set_key($keys,$key_name='')\r\n {\r\n if( isset($keys[$key_name]) and !empty($keys[$key_name]))\r\n {\r\n return $keys[$key_name];\r\n }\r\n else\r\n {\r\n return '';\r\n }\r\n }", "protected function pushKey($key, $value)\n {\n $this->items[$key] = $this->set($value);\n }", "function array_get($array, $key, $default = null)\n {\n return isset($array[$key]) ? $array[$key] : $default;\n }", "function array_element(string $key, array $array) {\n\t\t// We want to take the performance advantage of isset() while keeping\n\t\t// the NULL element correctly detected\n\t\t// See: http://php.net/manual/es/function.array-key-exists.php#107786\n\t\tif (isset($array[$key]) || array_key_exists($key, $array)) {\n\t\t\treturn $array[$key];\n\t\t}\n\n\t\treturn null;\n\t}", "public function add($key, $message)\n {\n $this->messages[$key][] = $message;\n }", "public function get_appended_key ( $key = '' )\n {\n $_key = $this->get_key();\n\n // If a key was given, ensure it's appended\n if ( ! empty( $key ) )\n {\n $_key .= ':' . sanitise_key( $key );\n }\n\n return $_key;\n }", "function insertArray( &$arr, $offset = 0, $value = '', $replace = false ){\n\n consoleLog( 'insertArray() is deprecated. Switching to arr_insert().' );\n consoleLog( debug_backtrace() );\n\n $arr = arr_insert( $arr, $offset, $value, $replace );\n}", "private function replaceKeyIfExists(array $array, $oldKey, $newKey)\n {\n if (!isset($array[$oldKey])) {\n return $array;\n }\n\n $array[$newKey] = $array[$oldKey];\n unset($array[$oldKey]);\n\n return $array;\n }", "function addMember($arr, $key, $name, $birthday, $email){\n\t\t$arr[$key]['name'] = $name;\n\t\t$arr[$key]['birthday'] = $birthday;\n\t\t$arr[$key]['email'] = $email;\n\t\treturn $arr;\n\t}", "function array_val($array,$key,$default=null)\n{\n\tif( array_key_exists($key, $array) )\n\t\treturn $array[$key];\n\treturn $default;\n}", "public static function addKey(array $input, $keyField = 'key', $valueField = 'value')\n {\n $output = array();\n\n foreach ($input as $key => $value) {\n if (is_array($value)) {\n $output[$key] = $value;\n $output[$key][$keyField] = $key;\n } else {\n $output[$key][$keyField] = $key;\n $output[$key][$valueField] = $value;\n }\n }\n\n return $output;\n }", "private function set_if_not_null( $key, $value, &$array )\n {\n if ( $value !== null ) {\n $array[ $key ] = $value;\n }\n }", "public static function insertAfterKey(&$array, $key, $newKey, $newValue) {\n $newArray = [];\n $has_found = FALSE;\n\n foreach ($array as $_key => $_item) {\n $newArray[$_key] = $_item;\n\n if ($_key === $key) {\n $has_found = TRUE;\n $newArray[$newKey] = $newValue;\n }\n }\n\n if (!$has_found) {\n $newArray[$newKey] = $newValue;\n }\n\n $array = $newArray;\n }", "public function appended(mixed $key, mixed $value): NonEmptyMap;", "function add_artist(&$artists, $new_artists) {\n foreach($new_artists as $new_artist_name => $new_artist_data) {\n if (!array_key_exists($new_artist_name, $artists)) {\n $artists[$new_artist_name] = $new_artist_data;\n }\n }\n}", "private function array_unshift_assoc(&$arr, $key, $val)\n {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n return array_reverse($arr, true);\n }", "function alist($args){\n return array_fill_keys(array_keys($args), array());\n}", "public function offsetSet($key, $value)\n {\n if (is_null($key)) {\n $this->items[] = $value;\n } else {\n $this->items[$key] = $value;\n }\n }", "public function offsetSet($key, $value)\n {\n if (is_null($key)) {\n $this->items[] = $value;\n } else {\n $this->items[$key] = $value;\n }\n }" ]
[ "0.81507206", "0.76679283", "0.7539807", "0.7490153", "0.7490153", "0.7129647", "0.7006724", "0.6836951", "0.6780913", "0.64957905", "0.64640117", "0.6351146", "0.6292318", "0.6284772", "0.62483805", "0.6234855", "0.62160766", "0.62023747", "0.61330223", "0.6118586", "0.6086336", "0.60766065", "0.60651326", "0.60507566", "0.60169154", "0.6014463", "0.6003519", "0.5979438", "0.59359515", "0.5914321", "0.59109575", "0.5895305", "0.58540404", "0.58397067", "0.5838241", "0.58313376", "0.5827138", "0.58100927", "0.5783966", "0.5783558", "0.5771145", "0.5771145", "0.5771145", "0.5767947", "0.5746709", "0.5740024", "0.567978", "0.56654745", "0.56323004", "0.5628529", "0.5610456", "0.5601621", "0.5592173", "0.5584393", "0.5573951", "0.55627054", "0.5558223", "0.5507262", "0.5496162", "0.54778004", "0.5454786", "0.54510295", "0.54491496", "0.5446104", "0.5404378", "0.53967893", "0.5396047", "0.53955764", "0.538951", "0.5373588", "0.5357968", "0.5356672", "0.53534245", "0.5320074", "0.5309429", "0.5297092", "0.5289586", "0.5277625", "0.5276384", "0.527571", "0.5272873", "0.5270924", "0.5269714", "0.5256801", "0.5254793", "0.5242535", "0.52337724", "0.52259785", "0.5225158", "0.5223795", "0.5223547", "0.52101374", "0.5207593", "0.520356", "0.5199786", "0.5199543", "0.5193847", "0.5187317", "0.5186714", "0.5186714" ]
0.8506814
0
Returns a list of page numbers separated by $separator
Возвращает список номеров страниц, разделенных $separator
function pageNumbers($separator=null) { if (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; } $t = array(); $text = ''; $pc = 1; do { if($pc == $this->_pageDetails['page']) { $text = '<span>'.$pc.'</span>'; } else { if($this->style == 'ajax') { $text = $this->Ajax->link($pc, array("fallback"=>$this->action."#","url" =>$this->link.$pc,"update" => "ajax_update","method"=>"get")); } else { $text = $this->Html->link($pc,$this->link.$pc); } } $t[] = $text; $pc++; } while ($pc<=$this->_pageDetails['pageCount']); $t = implode($separator, $t); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myPageNumbers($separator=null)\n\t{\n\t\tif (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; }\n\t\t$t = array();\n\t\t$text = '';\n\t\t$pc = 1;\n\t\t do \n\t\t {\n\t\t\t if($pc == $this->_pageDetails['page'])\n\t\t\t {\n\t\t\t\t$text = '<span class=numberlinkon> '.$pc.'</span>';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tif($this->style == 'ajax')\n\t\t\t\t{\n\t\t\t\t\t$text = \" \".$this->Ajax->link($pc, $this->link.$pc, array(\"update\" => \"ajax_update\",\"method\"=>\"get\",\"class\"=>\"numberlink\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$text = \" \".$this->Html->link($pc,$this->link.$pc,array(\"class\"=>\"numberlink\"));\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t $t[] = $text;\n\t\t\t $pc++;\n\t\t } \n\t\t while ($pc<=$this->_pageDetails['pageCount']);\n\t\t \n\t\t $t = implode($separator, $t);\n \n\t\treturn $t;\n\t}", "public function getPageNumbers();", "public function genPageNums()\n\t{\n\t\t$pageLinks = array();\t\n\t\n\t\tfor($i=1; $i<=$this->numofpages; $i++)\n\t\t{\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\t\n\t\n\t\tif(($this->totalrows % $this->limit) != 0)\n\t\t{\n\t\t\t$this->numofpages++;\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\n\t\tksort($pageLinks);\n\t\t$this->pagination['nums'] = $pageLinks;\n\t}", "public function page_list() {\n\n\t\t\t$output = \"\";\n\t\t\t$cur_page = $this->current_page;\n\t\t\t$tot_page = $this->total_pages();\n\n\t\t\tif( $cur_page <= $tot_page ) {\n\t\t\t\t$output .= \"<h3 class=\\\"pagelist\\\">Page {$cur_page} of \" ;\n\t\t\t\t$output .= \"{$tot_page}</h3>\";\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\n\t\t}", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "public function getPages($framework, $currentPage = 1, $numPages = 1, $limit = 7, $separator = '...', $breakpoint = 4) {\n\t\t$this->currentPage = $currentPage;\n\t\t$this->numPages = $numPages;\n\t\t$this->limit = $limit;\n\t\t$this->separator = $separator;\n\t\t$this->breakpoint = $breakpoint;\n\n\n\t\t$items = array();\n\n\t\t/**\n\t\t * Less than or 7 pages. We know all the keys, and we put them in the array\n\t\t * that we will use to generate the actual pagination.\n\t\t */\n\t\tif($this->numPages <= $this->limit) {\n\t\t\tfor($i = 1-(bool)$this->logicNumbers; $i <= $this->numPages-(bool)$this->logicNumbers; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t}\n\n\t\t// more than 7 pages\n\t\telse {\n\t\t\t// first page\n\t\t\tif($this->currentPage == 1-(bool)$this->logicNumbers) {\n\t\t\t\t// [1] 2 3 4 5 6 7 8 9 10 11 12 13\n\t\t\t\tfor($i = 1; $i <= $this->limit; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t\t$items[$this->limit + 1] = $this->separator;\n\t\t\t}\n\n\n\t\t\t// last page\n\t\t\telse\n\t\t\tif($this->currentPage == $this->numPages) {\n\t\t\t\t// 1 2 3 4 5 6 7 8 9 10 11 12 [13]\n\t\t\t\t$items[$this->numPages - $this->limit - 1] = $this->separator;\n\t\t\t\tfor($i = ($this->numPages - $this->limit); $i <= $this->numPages; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t}\n\n\t\t\t// other page\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1 2 3 [4] 5 6 7 8 9 10 11 12 13\n\n\t\t\t\t// define min & max\n\t\t\t\t$min = $this->currentPage - $this->breakpoint + 1;\n\t\t\t\t$max = $this->currentPage + $this->breakpoint - 1;\n\n\t\t\t\t// minimum doesnt exist\n\t\t\t\twhile($min <= 0)\n\t\t\t\t{\n\t\t\t\t\t$min++;\n\t\t\t\t\t$max++;\n\t\t\t\t}\n\n\t\t\t\t// maximum doesnt exist\n\t\t\t\twhile($max > $this->numPages)\n\t\t\t\t{\n\t\t\t\t\t$min--;\n\t\t\t\t\t$max--;\n\t\t\t\t}\n\n\t\t\t\t// create the list\n\t\t\t\tif($min != 1) $items[$min - 1] = $this->separator;\n\t\t\t\tfor($i = $min; $i <= $max; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t\tif($max != $numPages) $items[$max + 1] = $this->separator;\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}", "protected function getPageIds()\n {\n return (array)explode(',', $this->getData('pages'));\n }", "public function getStyledPageNumbers($dbQuery = NULL)\n {\n $pageNumsArray = $this->getPageNumbers($dbQuery);\n \n if($pageNumsArray === 0)\n {\n return 0;\n }\n \n $currentPageNum = $this->currentPageNumber();\n \n $finalString = \"\\n<ul id=\\\"pagenumbersid\\\">\\n\";\n \n if($currentPageNum !== 1)\n {\n $finalString .= \"<li id=\\\"firstpageid\\\"><a href=\\\"{$this->getNewPageAddress(1)}\\\">{$this->firstPageName}</a></li>\\n\";\n $finalString .= \"<li id=\\\"previouspageid\\\"><a href=\\\"{$this->getNewPageAddress($currentPageNum - 1)}\\\">{$this->previousPageName}</a></li>\\n\";\n }\n \n $decreaseTwoPoint = $currentPageNum-2;\n /**\n * Because it can not be lower that 1 and the 1 is the lowest number then we will check whether it's lower that 1 or not.\n * If its lower than then we can set it to 1 manually.\n */\n if($decreaseTwoPoint < 1)\n {\n $decreaseTwoPoint = 1;\n }\n \n $increaseTwoPoint = $currentPageNum+2;\n /**\n * Because it can not be more bigger than our total page numbers then we will check it to see whether it's bigger that our total page numbers or not.\n * If it's bigger then we will set it to the total page numbers manually.\n */\n if($increaseTwoPoint > $this->totalPages)\n {\n $increaseTwoPoint = $this->totalPages;\n }\n \n for($i = $decreaseTwoPoint; $i <= $increaseTwoPoint; $i++)\n {\n if($i == $currentPageNum)\n {\n $finalString .= \"<li>{$i}</li>\\n\";\n }\n else\n {\n $finalString .= \"<li><a href=\\\"{$this->getNewPageAddress($i)}\\\">{$i}</a></li>\\n\";\n }\n }\n \n if($currentPageNum !== $this->totalPages)\n {\n $finalString .= \"<li id=\\\"nextpageid\\\"><a href=\\\"{$this->getNewPageAddress($currentPageNum + 1)}\\\">{$this->nextPageName}</a></li>\\n\";\n $finalString .= \"<li id=\\\"lastpageid\\\"><a href=\\\"{$this->getNewPageAddress($this->totalPages)}\\\">{$this->lastPageName}</a></li>\\n\";\n }\n \n $finalString .= '</ul>';\n \n return $finalString;\n }", "function _getAllPageNumbers($current_page, $last_page)\n{\n $page_ix = 1;\n $pages = array();\n while($page_ix <= $last_page){\n if($page_ix == $current_page){\n $pages[$page_ix] = 'current';\n } else {\n $pages[$page_ix] = $page_ix;\n } \n $page_ix++;\n }\n return $pages;\n}", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "function _getSelectedPageNumbers($current_page, $last_page)\n{\n //-----------//\n // constants //\n //-----------//\n\n //defines the offset pattern to repeat for each level of $base\n //array(1, 2, 5) will make offsets into 1, 2, 5, 10, 20, 50, etc.\n //array(1, 5) will make offsets into 1, 5, 10, 50, 100, 500, etc.\n $multipliers = array(1, 2, 5);\n\n $base = 10; //10 looks best\n\n //----------------//\n // initialization //\n //----------------//\n $exponent = 0;\n $pages = array($current_page => 0);\n $offsets = array();\n $offset = 1;\n $multiplier = reset($multipliers);\n $max_offset = $last_page - $current_page;\n if($current_page > $max_offset){\n $max_offset = $current_page;\n }\n\n //calculate offsets that increase (semi-)logarithmically\n while($offset <= $max_offset){\n $offset = $multiplier * pow($base, $exponent);\n $offsets[] = $offset;\n if(!($multiplier = next($multipliers))){\n $multiplier = reset($multipliers);\n $exponent++;\n }\n }\n\n foreach($offsets as $offset){\n if(0 == $offset){\n $pages[$pagenum] = 'current';\n } else {\n $exact_pagenum = $current_page - $offset;\n $adj_pagenum = round($exact_pagenum / $offset) * $offset;\n if($adj_pagenum > 0){\n $pages[$adj_pagenum] = $offset;\n }\n\n $exact_pagenum = $current_page + $offset;\n $adj_pagenum = round($exact_pagenum / $offset) * $offset;\n if($adj_pagenum <= $last_page){\n $pages[$adj_pagenum] = $offset;\n }\n }\n }\n\n if(!isset($pages[1])){\n $pages[1] = 'first';\n }\n if(!isset($pages[$last_page])){\n $pages[$last_page] = 'last';\n }\n $pages[$current_page] = 'current';\n\n ksort($pages);\n return $pages;\n\n}", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function getPages();", "public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\">&lt;</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">&gt;</a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function generate($strSeparator = '')\n {\n $this->determineValues();\n\n // Return if there is only one page\n if ($this->intTotalPages < 2 || $this->intRows < 1) {\n return '';\n }\n\n if ($this->intPage == -1) {\n return '';\n }\n\n $template = new TwigFrontendTemplate('pagination');\n\n $template->hasFirst = $this->hasFirst();\n $template->hasPrevious = $this->hasPrevious();\n $template->hasNext = $this->hasNext();\n $template->hasLast = $this->hasLast();\n\n $template->items = $this->getItems();\n $template->page = $this->intPage;\n $template->total = $this->intTotalPages;\n\n $template->first = array\n (\n 'page' => 1,\n 'link' => $this->lblFirst,\n 'href' => $this->arrLinks[0],\n );\n\n $template->previous = array\n (\n 'page' => $this->intPage - 1,\n 'link' => $this->lblPrevious,\n 'href' => $this->arrLinks[($this->intPage - 2)],\n );\n\n $template->next = array\n (\n 'page' => $this->intPage + 1,\n 'link' => $this->lblNext,\n 'href' => $this->arrLinks[$this->intPage],\n );\n\n $template->last = array\n (\n 'page' => $this->intTotalPages,\n 'link' => $this->lblLast,\n 'href' => $this->arrLinks[(count($this->arrLinks) - 1)],\n );\n\n $this->setHeadTags();\n\n return $template->parse();\n }", "public function getItemsAsString($strSeparator=' ')\n\t{\n\t\t$arrLinks = array();\n\n\t\t$intNumberOfLinks = floor($this->intNumberOfLinks / 2);\n\t\t$intFirstOffset = $this->intItem - $intNumberOfLinks - 1;\n\n\t\tif ($intFirstOffset > 0)\n\t\t{\n\t\t\t$intFirstOffset = 0;\n\t\t}\n\n\t\t$intLastOffset = $this->intItem + $intNumberOfLinks - $this->intTotalItems;\n\n\t\tif ($intLastOffset < 0)\n\t\t{\n\t\t\t$intLastOffset = 0;\n\t\t}\n\n\t\t$intFirstLink = $this->intItem - $intNumberOfLinks - $intLastOffset;\n\n\t\tif ($intFirstLink < 1)\n\t\t{\n\t\t\t$intFirstLink = 1;\n\t\t}\n\n\t\t$intLastLink = $this->intItem + $intNumberOfLinks - $intFirstOffset;\n\n\t\tif ($intLastLink > $this->intTotalItems)\n\t\t{\n\t\t\t$intLastLink = $this->intTotalItems;\n\t\t}\n\n\t\tfor ($i=$intFirstLink; $i<=$intLastLink; $i++)\n\t\t{\t\n\t\t\tif ($i == $this->intItem)\n\t\t\t{\n\t\t\t\t$arrLinks[] = sprintf('<li class=\"active\"><span class=\"current active\">%s</span></li>',\n\t\t\t\t\t\t\t\t\t '<span class=\"index\">' . $i . '</span>' . '<span class=\"title\">' . $this->getItemTitle($i) . '</span>');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t$arrLinks[] = sprintf('<li><a href=\"%s\" class=\"link\" title=\"%s\">%s</a></li>',\n\t\t\t\t\t\t\t\t$this->linkToItem($i),\n\t\t\t\t\t\t\t\tsprintf(specialchars($GLOBALS['TL_LANG']['MSC']['readerpaginations']['goTo']), $this->getItemTitle($i)),\n\t\t\t\t\t\t\t \t '<span class=\"index\">' . $i . '</span>' . '<span class=\"title\">' . $this->getItemTitle($i) . '</span>'\n\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn implode($strSeparator, $arrLinks);\n\t}", "public function pageNumbers($rowCount, $perPage, $pageRange, $rangeLimit, $page, $return=false, $additionalString='')\n\t{\n\t\tif($page == null OR $page == 0) $page = 1;\n\t\tif(!$perPage) $perPage = 100;\n\t\tif($page == 1) $pageRange = $pageRange + 2;\n\t\t$totalPages = ceil($rowCount/$perPage);\n\t\t$rangeLimit = ceil($pageRange/2);\n\t\t$output = '';\n\n\t\t$output .= '\n\t\t<div class=\"Pages\">\n\t\t\t<div class=\"Paginator\"> <b>Pages</b>\n\t\t\t';\n\n\t\tif($page > $rangeLimit)\n\t\t\t$output .= \"<a href='$PHP_SELF?page=1\".$additionalString.\"' class='Prev'>&lt; First</a>\n\t\t\t<span class='break'>...</span>\n\t\t\t\"; \n\t\t\t\n\t\t\t\n\n\t\tfor($pageCounter=1; $pageCounter <= $totalPages; $pageCounter++)\n\t\t{\n\t\t\tif($pageCounter > $page - $rangeLimit AND $pageCounter < $page + $rangeLimit)\n\t\t\t{\n\t\t\t\tif($page == $pageCounter)\n\t\t\t\t\t$output .= \"<span class='this-page'>$pageCounter</span>\n\t\t\t\t\t\t\";\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($totalPages != 1)\n\t\t\t\t\t\t$output .= \"<a href='$PHP_SELF?page=$pageCounter\".$additionalString.\"'>$pageCounter</a>\n\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($totalPages > $page + $pageRange)\n\t\t\t$output .= \"<span class='break'>...</span>\n\t\t\t\"; \n\n\t\tif($page < $totalPages - $rangeLimit AND $totalPages > $rangeLimit)\n\t\t\t$output .= \"<a href='$PHP_SELF?page=$totalPages\".$additionalString.\"' class='Next'>Last &gt;</a>\n\t\t\t\"; \n\t\t//status=$status&amp; <- removed 2007-03-26\n\n\t\t$output .= \"\n\t\t\t</div>\n\t\t</div>\n\t\t\";\n\t\tif($rowCount>1)\n\t\t{\n\t\t\tif($return) return $output;\n\t\t\telse echo $output;\n\t\t}\n\t}", "function numbered_in_page_links( $args = array () )\n{\n $defaults = array(\n 'before' => '<div class=\"page-links\"><i class=\"icon-menu-3 pageLinksToggle\"></i><ul class=\"subpage-list\">' \n , 'after' => '</ul></div>'\n , 'link_before' => '<li>'\n , 'link_after' => '</li>'\n , 'pagelink' => '%'\n , 'echo' => 1\n // element for the current page\n , 'highlight' => 'b'\n );\n\n $r = wp_parse_args( $args, $defaults );\n $r = apply_filters( 'wp_link_pages_args', $r );\n extract( $r, EXTR_SKIP );\n\n global $page, $numpages, $multipage, $more, $pagenow;\n\n if ( ! $multipage )\n {\n return;\n }\n\n $output = $before;\n\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\n {\n $j = str_replace( '%', $i, $pagelink );\n $output .= ' ';\n\n if ( $i != $page || ( ! $more && 1 == $page ) )\n {\n $output .= \"{$link_before}\". _wp_link_page( $i ) . \"{$j}</a>{$link_after}\";\n }\n else\n { // highlight the current page\n // not sure if we need $link_before and $link_after\n $output .= \"{$link_before}<$highlight>{$j}</$highlight>{$link_after}\";\n }\n }\n\n print $output . $after;\n}", "public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}", "function get_all_page_ids()\n {\n }", "public function getNombrePages() \r\n\t{\r\n\t\tvar_dump($this->_db);\r\n\t\treturn ceil(count($this->_db)/self::NOMBRE_PAR_PAGE);\r\n\t\t\r\n\t\t//return $aBiere[$nPage-1];\r\n\t}", "function link_pages($before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page', $pagelink = '%', $more_file = '')\n {\n }", "public function rangeToPaginate()\n {\n $pages = array();\n\n if ( $this->lastPage <= $this->maxPagesToList) {\n for ($i = 1; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else if ($this->currentPage <= floor($this->maxPagesToList/2)+1) {\n for ($i = 1; $i <= $this->maxPagesToList; $i++) {\n $pages[] = $i;\n }\n } else if ($this->lastPage <= floor($this->maxPagesToList/2)+$this->currentPage) {\n $begin = $this->lastPage - $this->maxPagesToList + 1;\n for ($i = $begin; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else {\n $begin = $this->currentPage - floor($this->maxPagesToList/2);\n $end = $this->currentPage + floor($this->maxPagesToList/2);\n for ($i = $begin; $i <= $end; $i++) {\n $pages[] = $i;\n }\n }\n return $pages;\n\n }", "function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}", "public function getPageNumber();", "public function getPageNumber();", "public function pagination_numbers_set(){\n\t\t\t$this->pages_show_array = array();\n\t\t\t$this->pages_show_array['middle'] = array();\n\t\t\t$this->pages_show_array['prev'] = null;\n\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t$this->pages_show_array['first'] = null;\n\t\t\t$this->pages_show_array['last'] = null;\n\n\t\t\t\n\t\t\tfor ($i=0; $i < sizeof($this->pages_array) ;$i++){\n\n\t\t\t\t//first iteration\n\t\t\t\tif ($i == 0){\n\t\t\t\t\t//prev\n\t\t\t\t\tif ($this->current_page <= 1){\n\t\t\t\t\t\t$this->pages_show_array['prev'] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($this->current_page >= $this->total_pages){\n\t\t\t\t\t\t$this->pages_show_array['prev'] = $this->total_pages - 1;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->pages_show_array['prev'] = $this->current_page - 1;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->current_page > $this->pages_to_show){\n\t\t\t\t\t\t$this->pages_show_array['first'] = \"1 ...\";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tarray_push($this->pages_show_array['middle'], $this->pages_array[$i]);\n\n\n\t\t\t\t}\n\n\t\t\t\t//last iteration\n\t\t\t\telse if ($i == sizeof($this->pages_array)-1){\n\n\t\t\t\t\tif ($this->current_page < $this->total_pages - $this->pages_to_show){\n\t\t\t\t\t\t$this->pages_show_array['last'] = \"...\" . $this->total_pages;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//next\n\t\t\t\t\tif ($this->current_page >= $this->total_pages){\n\t\t\t\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->pages_show_array['next'] = $this->current_page + 1;\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//middle iterations\n\t\t\t\telse {\n\t\t\t\t\tarray_push($this->pages_show_array['middle'], $this->pages_array[$i]);\n\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif (empty($this->pages_show_array['next'])){\n\t\t\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t\t}\n\t\t\t\n\n\t\t}", "protected function num() {\n $this->siblings = $this->siblings->not($this->page)->sortBy('num', 'asc');\n\n // special keywords and sanitization\n if($this->to == 'last') {\n $this->to = $this->siblings->count() + 1;\n } else if($this->to == 'first') {\n $this->to = 1;\n } else if($this->to === false) {\n $this->to = false;\n } else if($this->to < 1) {\n $this->to = 1; \n }\n\n // start the index\n $n = 0;\n\n if($this->to === false) {\n foreach($this->siblings as $sibling) {\n $n++; $sibling->_sort($n);\n }\n } else {\n\n // go through all items before the selected page\n foreach($this->siblings->slice(0, $this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n // add the selected page\n $n++; $this->page->_sort($n);\n\n // go through all the items after the selected page\n foreach($this->siblings->slice($this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n }\n\n }", "public function page_links()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$pagination = '';\n\t\t\n\t\t// Let's get the starting page number, this is determined using num_links\n\t\t$start = (($this->current_page - $this->num_links) > 0) ? $this->current_page - ($this->num_links - 1) : 1;\n\n\t\t// Let's get the ending page number\n\t\t$end = (($this->current_page + $this->num_links) < $this->total_pages) ? $this->current_page + $this->num_links : $this->total_pages;\n\n\t\tfor ($i = $start; $i <= $end; $i++)\n\t\t{\n\t\t\t$text = $i;\n\t\t\t$url = '#';\n\t\t\t$state = $this->template['state']['current_page'];\n\n\t\t\tif ($this->current_page != $i)\n\t\t\t{\n\t\t\t\t// detect if anchor attribute is presented in the template \n\t\t\t\tif (stripos('<a ', $this->template['page_start']) < 0)\n\t\t\t\t{\n\t\t\t\t\t$text = '<a href=\":url\">'.$i.'</a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$url = $this->build_url($i);\n\t\t\t\t$state = '';\n\t\t\t}\n\n\t\t\t$pagination .= Str::tr($this->template['page_start'].$text.$this->template['page_end'], array(\n\t\t\t\t'state' => $state,\n\t\t\t\t'url' => $url,\n\t\t\t));\n\t\t}\n\n\t\treturn $pagination;\n\t}", "public function view()\n {\n $pages = explode(' ', $this->list);\n\n if ($this->current_page < 1 || $this->current_page > $this->total_pages) {\n $this->current_page = 1;\n }\n $output = null;\n\n $output .= '<ul class=\"pagination\">';\n $output .= $this->beginning();\n $output .= $this->middle($pages);\n $output .= $this->ending();\n $output .= '</ul>';\n \n return $output;\n }", "public function getPages() {}", "function getPageSegment($separator = null, $offset = 0) {\n $page = $this->getCurrentPage();\n if (!$separator) {\n if (file_exists($this->getPagePath($page))) {\n require_once $this->getPagePath($page);\n }\n return;\n }\n $path = $this->getPagePath($page);\n $string = file_get_contents($path);\n $segments = explode($separator, $string);\n if(array_key_exists($offset, $segments)){\n $segment = $segments[$offset];\n if (substr($segment, 0, 5) !== \"<?php\") {\n $segment = \"?>\" . $segment;\n }\n eval($segment);\n }\n }", "public function getPerPage();", "public function get_pages($total,$current,$nb_per_page,$rub,$array_submitted=array())\n {\n $str_return = '';\n $arr_return = '';\n \n $get = '';\n \n foreach($array_submitted as $keysubmitted => $valuesubmitted)\n {\n if(!empty($valuesubmitted))\n {\n $get .= strtolower('&'.$keysubmitted.'='.$valuesubmitted);\n }\n }\n \n if($total>$nb_per_page)\n {\n $nbpage = ceil($total/$nb_per_page);\n\n if($current>1)\n {\n $prec = $current-1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$prec.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-left', 'active' => 0, 'bnumber' => 0);\n }\n\n if($nbpage <10)\n {\n $linkstart = 1;\n $linkstop = $nbpage;\n }\n else if($current<=5)\n { \n $linkstart = 1;\n $linkstop = 10;\n }\n else if( $current>5 && $current<($nbpage-5) )\n { \n $linkstart = $current-4;\n $linkstop = $current+5;\n }\n else if( $current>=($nbpage-5) )\n { \n $linkstart = $nbpage-9;\n $linkstop = $nbpage;\n }\n \n\n for($ipage=$linkstart;$ipage<=$linkstop;$ipage++)\n {\n $href = \"index.php?rub=\".$rub.\"&p=\".$ipage.$get; \n if($current==$ipage)\n {\n $arr_return[] = array('link' => '#', 'number' => $ipage, 'active' => 1, 'bnumber' => 1);\n }\n else\n {\n $arr_return[] = array('link' => $href, 'number' => $ipage, 'active' => 0, 'bnumber' => 1);\n }\n }\n\n if($current<$nbpage)\n {\n $suiv = $current+1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$suiv.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-right', 'active' => 0, 'bnumber' => 0);\n }\n \n \n } \n return $arr_return;\n }", "private function retrieve_pagenumber() {\n\t\t$replacement = null;\n\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\tif ( isset( $nr ) && $nr > 0 ) {\n\t\t\t$replacement = (string) $nr;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getPaginated();", "protected function buildPagination() {}", "protected function buildPagination() {}", "function numbered_in_page_links( $args = array () )\r\n{\r\n $defaults = array(\r\n 'before' => '<p>' . __('Pages:', 'framework')\r\n , 'after' => '</p>'\r\n , 'link_before' => ''\r\n , 'link_after' => ''\r\n , 'pagelink' => '%'\r\n , 'echo' => 1\r\n // element for the current page\r\n , 'highlight' => 'span'\r\n );\r\n\r\n $r = wp_parse_args( $args, $defaults );\r\n $r = apply_filters( 'wp_link_pages_args', $r );\r\n extract( $r, EXTR_SKIP );\r\n\r\n global $page, $numpages, $multipage, $more, $pagenow;\r\n\r\n if ( ! $multipage )\r\n {\r\n return;\r\n }\r\n\r\n $output = $before;\r\n\r\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\r\n {\r\n $j = str_replace( '%', $i, $pagelink );\r\n $output .= ' ';\r\n\r\n if ( $i != $page || ( ! $more && 1 == $page ) )\r\n {\r\n $output .= _wp_link_page( $i ) . \"{$link_before}{$j}{$link_after}</a>\";\r\n }\r\n else\r\n { // highlight the current page\r\n // not sure if we need $link_before and $link_after\r\n $output .= \"<$highlight>{$link_before}{$j}{$link_after}</$highlight>\";\r\n }\r\n }\r\n\r\n print $output . $after;\r\n}", "function render_block_core_query_pagination_numbers($attributes, $content, $block)\n {\n }", "public function getPaginationHtml();", "public function numbers(array $options = []): string\n {\n $paging = $this->params();\n\n $first = $last = $current = 1;\n\n if ($paging) {\n $first = $paging['current'] > 5 ? ($paging['current'] - 4) : 1;\n $last = $first + 7;\n if ($last > $paging['pages']) {\n $last = $paging['pages'];\n }\n $current = $paging['current'];\n }\n\n $output = '';\n $query = $this->request()->query();\n for ($i = $first; $i < $last + 1; ++$i) {\n $template = 'number';\n if ($current == $i) {\n $template = 'numberActive';\n }\n $query['page'] = $i;\n\n $options['url'] = $this->request()->path() . '?' . http_build_query($query);\n $options['text'] = $i;\n $output .= $this->templater()->format($template, $options);\n }\n\n return $output;\n }", "function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'hbd-theme') . get_query_var('paged');\n\t }\n\t}", "function show_page_links($base_url, $num_items, $per_page, $page)\n{\n //$base_url contains the address of the page and the order it is called with\n //e.g., 'asc' or 'desc' - the page handles this so we have to worry about it.\n\n $total_pages = ceil($num_items/$per_page);\n\n if ($total_pages == 1)\n {\n return '';\n }\n\n //initialize our $page_string variable wich will hold the links\n $page_string = '<p><span class=\"page_numbers\">';\n\n //SHOW UP TO 4 LINKS ON EITHER SIDE OF THE CURRENT PAGE\n\n //get the number of page links are available after the current page\n $num_succeeding_links = $total_pages - $page;\n\n //get the number of preceding links available before the current page\n $num_preceding_links = $page -1;\n\n //calculate our start and end values\n $start = $page - 4;\n if ( $start < 1)\n {\n $start = 1;\n }\n //if we have less than 10 total_page, use the number we have ($total_pages)\n $end = $total_pages;\n //but if end is more than 9 higher than $start, make $end 9 higher than $start\n //we only want to show 10 records per page (e.g., 1..10)\n if ( ($end - $start) > 9 )\n {\n $end= $start + 9;\n }\n\n //if the total number of succeeding links exceeds 4 show 4 and a >> at the end\n //the >> at the end is just the 5th succeeding link\n //do the same for preceding links if they are more than 4\n if ($total_pages > 10 && $page > 1) //don't show first page link except when we're not the first page\n {\n //create a << which points to the first page\n $page_string .= '<a title=\"first page\" href=\"'.$base_url.'&page=1\">&lt;&lt;</a>&nbsp;&nbsp;';\n //create a < which points to the current page -1 (shifts us left one)\n $val = $page-1;\n $page_string .= '<a title=\"previous page\" href=\"'.$base_url.'&page='.$val.'\">&lt;</a>&nbsp;&nbsp;';\n }\n for ($i=$start; $i<=$end; $i++)\n {\n if ($i == $page)\n {\n $page_string .= \" <b>[$i]</b> \";\n }\n else\n {\n $page_string .= ' <a title=\"page ' . $i . '\" href=\"'.$base_url.'&page='.$i.'\">'.$i.'</a> ';\n }\n }\n if ($total_pages > 10 && $page < $total_pages) //don't show last page link except when we're not on the last page\n {\n //create a > which points to the current page +1 (shifts us right one)\n $val = $page + 1;\n $page_string .= '&nbsp;&nbsp;<a title=\"next page\" href=\"'.$base_url.'&page='.$val.'\">&gt</a>';\n\n //create a >> which point to the last page\n $page_string .= '&nbsp;&nbsp;<a title=\"last page\" href=\"'.$base_url.'&page='.$total_pages.'\">&gt;&gt</a> ';\n }\n\n $page_string .= '</span></p>';\n\n return $page_string;\n\n}", "public function get_pagenum()\n {\n }", "public function getNombrePages() \r\n\t{\r\n\t\treturn ceil(count($this->_bieres)/self::NOMBRE_PAR_PAGE);\r\n\t}", "private function compilePager() {\n \t\n \t\n \t$this->_tmp_page = '<p '.$this->_config['css_page'].'>';\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].'1\">'.$this->_config['first'].'</a>';\n \t}\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] - 1).'\">'.$this->_config['previous'].'</a>';\n \t}\n \t\n \tif ($this->_all_page <= $this->_config['scr_page']) {\n \tif($this->_config['all_recs'] <= $this->_config['per_page']) {\n \t$this->_start = 1;\n $this->_stop = $this->_all_page;\n } else {\n \t\t$this->_start = 1;\n $this->_stop = $this->_all_page;\n }\n } else {\n \tif($this->_config['cur_page'] < intval($this->_config['scr_page'] / 2) + 1) {\n\t $this->_start = 1; \n\t \t$this->_stop = $this->_config['scr_page'];\n } else {\n \t$this->_start = $this->_config['cur_page'] - intval($this->_config['scr_page'] / 2);\n $this->_stop = $this->_config['cur_page'] + intval($this->_config['scr_page'] / 2);\n if($this->_stop > $this->_all_page) $this->_stop = $this->_all_page;\n }\n }\n if ($this->_all_page > 1) {\n\t for ($i = $this->_start; $i <= $this->_stop; $i++) {\n\t \tif ($i == $this->_config['cur_page']) {\n\t \t$this->_tmp_page .= '<span '.$this->_config['act_page'].'>'.$i.'</span>';\n\t } else {\n\t $this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$i.'\">'.$i.'</a>';\n\t }\n\t }\n }\n \n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] + 1).'\">'.$this->_config['next'].'</a>';\n \t}\n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$this->_all_page.'\">'.$this->_config['last'].'</a>';\n \t}\n \treturn $this->_tmp_page.'</p>';\n }", "public function numbers(array $options = [])\n {\n $class = 'pagination';\n\n $options += [\n 'class' => $class,\n 'after' => '</ul>',\n 'size' => null,\n ];\n\n $options['class'] = implode(' ', (array)$options['class']);\n\n if (!empty($options['size'])) {\n $options['class'] .= \" {$class}-{$options['size']}\";\n }\n\n $options += [\n 'before' => '<ul class=\"' . $options['class'] . '\">',\n ];\n\n unset($options['class'], $options['size']);\n\n if (isset($options['prev'])) {\n if ($options['prev'] === true) {\n $options['prev'] = $this->config('labels.prev');\n }\n $options['before'] .= $this->prev($options['prev'], ['escape' => false]);\n }\n\n if (isset($options['next'])) {\n if ($options['next'] === true) {\n $options['next'] = $this->config('labels.next');\n }\n $options['after'] = $this->next($options['next'], ['escape' => false]) . $options['after'];\n }\n\n return parent::numbers($options);\n }", "public function getGridPerPageValues()\n {\n return explode(\",\", $this->_klevuConfig->getCatalogGridPerPageValues());\n }", "public static function paginationList(array $params, View $view): string\n {\n $pagination = $view['pagination'];\n if (!($pagination instanceof Pagination)) {\n trigger_error(__FUNCTION__ . '(): No Pagination object set', E_USER_ERROR);\n }\n\n if (!isset($params['url'])) {\n return '';\n }\n\n $str = '';\n $delimiter = $params['delimiter'] ?? ' ';\n $urlParams = $pagination->generateUrlParamsString($params);\n $pageList = $pagination->getPageList();\n $current = $pagination->getCurrentPage();\n foreach ($pageList as $page) {\n $str .= ($page == $current)\n ? $page\n : '<a href=\"' . $params['url'] . '?page=' . $page . $urlParams . '\">' . $page . '</a>';\n $str .= $delimiter;\n }\n $str = substr($str, 0, -strlen($delimiter));\n\n return $str;\n }", "function get_pageNavHtml($page, $totalPages, $urlPrefix, $showPagesNums = 11)\n{\n if ($totalPages <= 0 || $page <= 0)\n return \"\";\n if ($showPagesNums <3 || $showPagesNums%2 === 0)\n return \"\";\n $pageNavHtml = \"\";\n\n $sideShowPages = floor($showPagesNums/2);\n $start = ($page - $sideShowPages) > 1? $page-$sideShowPages : 1;\n $end = ($page + $sideShowPages) < $totalPages? $page+$sideShowPages : $totalPages;\n\n for ($i = $start; $i<=$end; $i++)\n {\n $eachPageUrl = $urlPrefix.\"page=\".$i;\n $pageNavHtml .= \"<a href='$eachPageUrl' id='page_num_$i'>$i</a>&nbsp\";\n }\n return $pageNavHtml;\n}", "private function retrieve_page() {\n\t\t$replacement = null;\n\n\t\t$max = $this->determine_pagenumbering( 'max' );\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\t$sep = $this->retrieve_sep();\n\n\t\tif ( $max > 1 && $nr > 1 ) {\n\t\t\t/* translators: 1: current page number, 2: total number of pages. */\n\t\t\t$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function pager($margin=10)\n {\n $path = $_GET;\n $newpath = $PHP_SELF.\"?\";\n foreach($path as $key => $value)\n {\n if($key!=$this->getvar)\n {\n $newpath .= $key.\"=\".$value;\n $newpath .=\"&amp;\";\n }\n }\n $newpath .= $this->getvar;\n\n $linkpaths = array();\n $current = $this->start / $this->length + 1;\n $pages = ceil(($this->rows/$this->length));\n $pagerstart = $current-$margin;\n $pagerstart = ($pagerstart<1)?1:$pagerstart;\n $pagerend = $current+$margin;\n \n $pagerend = ( $pagerend > $pages ) ? ( ceil( ( $this->rows / $this->length ) ) ): $pagerend;\n\n for($i=$pagerstart;$i < ($pagerend+1);$i++)\n {\n $linkpaths[$i] = $newpath.\"=\".($i);\n }\n if($linkpaths[($current+1)]!=null)\n {\n $linkpaths['next']=$linkpaths[($current+1)];\n }\n if($linkpaths[($current-1)]!=null)\n {\n $linkpaths['last']=$linkpaths[($current-1)];\n }\n return $linkpaths;\n }", "function register_block_core_query_pagination_numbers()\n {\n }", "public function getPages()\n\t{\n\t\treturn $this->getOptionData('tl_page');\n\t}", "public function paginate_numbers($count_of_entries, $items_per_page, $current_page, $pages_to_show){\n\t\t\t$this->pages_array = array();\n\t\t\t\n\t\t\t$this->pages_to_show = $pages_to_show;\n\t\t\t$this->current_page = $current_page;\n\t\t\t\n\t\t\t//ceiling to round fraction up to nearest whole number - total number of pages also = last page number\n\t\t\t$this->total_pages = ceil($count_of_entries / $items_per_page);\n\t\t\t\n\t\t\t//if the total number of pages is fewer than the limit, return only those pages\n\t\t\tif ($this->total_pages < $pages_to_show){\n\t\t\t\tfor ($i=0; $i < $this->total_pages;$i++){\n\t\t\t\t\tarray_push($this->pages_array, ($i + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t//if the current page is less than the number of pages to show, then only show the first amount of pages to show\n\t\t\t\tif ($this->current_page < $pages_to_show){\n\t\t\t\t\tfor ($i=0; $i < $pages_to_show;$i++){\n\t\t\t\t\t\tarray_push($this->pages_array, ($i + 1));\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\n\t\t\t\t//if the current page is not in the first batch of pages:\n\t\t\t\telse {\n\n\t\t\t\t\tif ($this->total_pages - $this->current_page < $pages_to_show){\n\n\t\t\t\t\t\t//with x pages of the last page\n\t\t\t\t\t\t$setpage = $this->total_pages - $pages_to_show+1;\n\t\t\t\t\t\t$counter = $pages_to_show;\n\n\t\t\t\t\t\tfor ($i=0; $i < $counter; $i++){\n\t\t\t\t\t\t\tarray_push($this->pages_array, $setpage);\n\t\t\t\t\t\t\t$setpage++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//nowhere near the last page\n\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$setpage = $this->current_page - ($pages_to_show / 2);\n\t\t\t\t\t\tfor ($i=0; $i < $pages_to_show;$i++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tarray_push($this->pages_array, $setpage);\n\t\t\t\t\t\t\t$setpage++;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\n\t\t}", "static function explodeUrl($path, $separator)\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'return url parameters',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $pages = array();\n $params = array();\n\n foreach ($path as $value) {\n if (preg_match('#[' . $separator . ']{1}#', $value)) {\n $params[] = $value;\n } elseif ($value) {\n $pages[] = $value;\n }\n }\n\n return array('pages' => $pages, 'params' => $params);\n }", "function getPaging() {\n\t\t//if the total number of rows great than page size\n\t\tif($this->totalRows > $this->pageSize) {\n\t\t\tprint '<div class=\"paging\">';\n\t\t\tprint '<ul>';\n\t\t\tprint $this->first() . $this->prev() . $this->pageList() . $this->next() . $this->end();\n\t\t\tprint '</ul>';\n\t\t\tprint '</div>';\n\t\t}\n }", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')\n{\n\tglobal $template, $user;\n\n\t// Make sure $per_page is a valid value\n\t$per_page = ($per_page <= 0) ? 1 : $per_page;\n\n\t$seperator = '<span class=\"page-sep\">' . $user->lang['COMMA_SEPARATOR'] . '</span>';\n\t$total_pages = ceil($num_items / $per_page);\n\n\tif ($total_pages == 1 || !$num_items)\n\t{\n\t\treturn false;\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\t$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');\n\n\t$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href=\"' . $base_url . '\">1</a>';\n\n\tif ($total_pages > 5)\n\t{\n\t\t$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);\n\t\t$end_cnt = max(min($total_pages, $on_page + 4), 6);\n\n\t\t$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;\n\n\t\tfor ($i = $start_cnt + 1; $i < $end_cnt; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $end_cnt - 1)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\n\t\t$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;\n\t}\n\telse\n\t{\n\t\t$page_string .= $seperator;\n\n\t\tfor ($i = 2; $i < $total_pages; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $total_pages)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\t}\n\n\t$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($total_pages - 1) * $per_page) . '\">' . $total_pages . '</a>';\n\n\tif ($add_prevnext_text)\n\t{\n\t\tif ($on_page != 1)\n\t\t{\n\t\t\t$page_string = '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page) . '\">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;\n\t\t}\n\n\t\tif ($on_page != $total_pages)\n\t\t{\n\t\t\t$page_string .= '&nbsp;&nbsp;<a href=\"' . $base_url . \"{$url_delim}start=\" . ($on_page * $per_page) . '\">' . $user->lang['NEXT'] . '</a>';\n\t\t}\n\t}\n\n\t$template->assign_vars(array(\n\t\t$tpl_prefix . 'BASE_URL'\t\t=> $base_url,\n\t\t'A_' . $tpl_prefix . 'BASE_URL'\t=> addslashes($base_url),\n\t\t$tpl_prefix . 'PER_PAGE'\t\t=> $per_page,\n\n\t\t$tpl_prefix . 'PREVIOUS_PAGE'\t=> ($on_page == 1) ? '' : $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page),\n\t\t$tpl_prefix . 'NEXT_PAGE'\t\t=> ($on_page == $total_pages) ? '' : $base_url . \"{$url_delim}start=\" . ($on_page * $per_page),\n\t\t$tpl_prefix . 'TOTAL_PAGES'\t\t=> $total_pages,\n\t));\n\n\treturn $page_string;\n}", "public function list_pages() {\n\t\t$this->print_prev();\n\n\t\tif ($this->current_page+2 >= $this->total_pages-1) {\n\t\t\t$this->pages_right();\n\t\t} else {\n\t\t\t$this->pages_left();\n\t\t}\n\n\t\t$this->print_next();\n\t}", "function paginationNames($page = 1, $page_count)\n{\n if($page < 3){\n return [\n 'first' => 1,\n 'second' => 2,\n 'third' => 3\n ];\n }elseif($page == $page_count){\n return [\n 'first' => ($page_count - 2),\n 'second' => ($page_count - 1),\n 'third' => $page_count\n ];\n }else{\n return [\n 'first' => ($page - 1),\n 'second' => $page,\n 'third' => ($page + 1)\n ];\n }\n}", "function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}", "public function getSeparator();", "public function returnPaginationSerial(){\n\n return self::$oPaginator->return_pagination_serial();\n\n }", "function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'deinegeestblog-theme') . get_query_var('paged');\n\t }\n\t}", "function get_pager()\n\t{\n\t\tinclude_once('Pager/Pager.php');\n\t\t$pager_options = array();\n\t\t$pager_options['mode'] = 'Sliding';\n\t\t$pager_options['urlVar'] = 'page';\n\t\t$pager_options['delta'] = 2;\n\t\t$pager_options['perPage'] = (int) $this->rows_per_page;\n\t\t$pager_options['separator'] = '|';\n\t\t$pager_options['prev'] = '&laquo;';\n\t\t$pager_options['next'] = '&raquo;';\n\t\t$pager_options['append'] = false;\n\t\t$pager_options['fileName'] = $this->pager_file_name;\n\t\t\n\t\t$pager_options['totalItems'] = $this->totalItems;\n\t\t\n\t\t$currentPage = common::arg($this->pager_arg_no);\n\t\t//$this->content->debug .= ' currentPage: '.$currentPage .' argno: '.$this->pager_arg_no .' a:'.(int)common::arg(3);\n\t\tif (! isset($currentPage) || ! $currentPage) { $currentPage = 1; }\n\t\tif ($currentPage > ceil($this->totalItems/$this->rows_per_page)) { $currentPage = 1; }\n\t\t\n\t\t$pager_options['currentPage'] = $currentPage;\n\t\t\n\t\t$pager =& Pager::factory($pager_options);\n\t\treturn $pager->links;\n\t}", "public function pagination() {\n\t\tglobal $post, $page, $numpages, $multipage;\n\t\t$post = $this;\n\t\t$ret = array();\n\t\tif ( $multipage ) {\n\t\t\tfor ( $i = 1; $i <= $numpages; $i++ ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$data = array('name' => $i, 'title' => $i, 'text' => $i, 'link' => $link);\n\t\t\t\tif ( $i == $page ) {\n\t\t\t\t\t$data['current'] = true;\n\t\t\t\t}\n\t\t\t\t$ret['pages'][] = $data;\n\t\t\t}\n\t\t\t$i = $page - 1;\n\t\t\tif ( $i ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['prev'] = array('link' => $link);\n\t\t\t}\n\t\t\t$i = $page + 1;\n\t\t\tif ( $i <= $numpages ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['next'] = array('link' => $link);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function wp_get_list_item_separator()\n {\n }", "public static function links()\n\t{\n\t\t$all_pages = ceil(self::$total / self::$limit);\n\t\t$current_page = ceil(self::$offset / self::$limit);\n\n\t\t$string = '<nav class=\"paginator\"><ul>';\n\n\t\tif($current_page > 1)\n\t\t{\n\t\t\t$string .= '<li>' . self::link(\"Pr&eacute;c&eacute;dente\", ($current_page - 1) * self::$limit) . '</li>';\n\t\t}\n\n\t\t$from_page = max($current_page - 3, 0);\n\t\t$to_page = min($current_page + 3, $all_pages-1);\n\n\t\tfor($i = $from_page; $i < $to_page; $i++)\n\t\t{\n\t\t\t$string .= '<li ' . ($current_page == $i ? 'class=\"current\"' : '') . '>' . self::link($i + 1, $i * self::$limit) . '</li>';\n\t\t}\n\t\t\n\n\t\tif(($current_page + 1) !== $all_pages)\n\t\t{\n\t\t\t$string .=\"<li>...</li>\";\n\t\t\t$string .= '<li>' . self::link(round(self::$total/self::$limit)+1, round(self::$total/self::$limit)*self::$limit ) . '</li>';\n\t\t\t$string .= '<li>' . self::link(\"Suivante\", ($current_page + 1) * self::$limit) . '</li>';\n\t\t}\t\t\n\n\t\t//self::$url=preg_replace(\"/\\&offset=[0-9]*/\",\"\",self::$url);\n\t\t//$string .='<li><a href=\"' . self::$url . '?offset=' . round(self::$total/self::$limit)*self::$limit . '\"> Derni&egrave;re </a>';\n\t\t$string .= '</ul></nav>';\n\t\t//$string .= self::$total . \" \" .self::$offset . \" \" . self::$url . \" \" . self::$limit;\n\n\t\treturn $string;\n\t}", "public function get(): array\n\t{\n\t\t$roundedNumber = $this->count();\n\t\t$page = 1;\n\t\t\n\t\t$arrayPage = array();\n\t\t\n\t\tfor ($i = 0; $i < $roundedNumber; $i++) {\n\t\t\t$arrayPage[] = $page;\n\t\t\t$page++;\n\t\t}\n\t\treturn $arrayPage;\n\t}", "function getListaPags() {\n\t\t\t\n\t\t$arrPaginas = array();\n\t\t\t\n\t\t$inf = NULL;\n\t\t$sup = NULL;\n\t\t\t\n\t\t$tmp01 = floor($this->listap/2);\n\t\t\t\n\t\t// se o highlight estiver no meio da seleção\n\t\tif ($this->pagina - $tmp01 >= 1 && $this->pagina + $tmp01 <= $this->totalp){\n\t\t\t$inf = $this->pagina-$tmp01;\n\t\t\t$sup = $this->pagina+$tmp01;\n\t\t}\n\t\telse {\n\t\t\t// se estiver no lado esquerdo\n\t\t\tif ($this->pagina - $tmp01 < 1) {\n\t\t\t\t$inf = 1;\n\t\t\t\t$sup = ($this->totalp < $this->listap) ? $this->totalp : $this->listap ;\n\t\t\t}\n\t\t\t// se estiver no lado direito\n\t\t\telse if ($this->pagina + $tmp01 > $this->totalp) {\n\t\t\t\t$inf = ($this->totalp < $this->listap) ? 1 : $this->totalp-($this->listap-1) ;\n\t\t\t\t$sup = $this->totalp;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t\t\n\t\tfor ($x=$inf,$y=0;$x<=$sup;$x++,$y++) {\n\t\t\t$arrPaginas[$y] = $x;\n\t\t}\n\t\t\n\t\treturn $arrPaginas;\n\t\t\t\t\n\t\t// ALGORITMO LISTA DE PAGINAS - FIM\n\t}", "function getlist($pagecount,$page)\n{\n\t$echo = \"<select size=1 class='page_select' name=page onchange=javascript:location.href='\".getparam(\"page\",\"\").\"'+this.options[this.selectedIndex].value>\";\n\tfor($i=1;$i<=$pagecount;$i++)\n\t{\n\t\t$result = $pagecount/15;\n\t\tif($i>=$page-20 && $i<=$page+15){// ||\n\t\t\t$echo .= \"<option value=$i\".($page==$i ? ' selected' : '').\">\".$i.\"</option>\";\n\t\t}elseif($i%$result ==0 || $i==1 || $i==$pagecount){\n\t\t\t$echo .= \"<option value=$i>\".$i.\"</option>\";\n\t\t}\n\t}\n\t$echo.= \"</select>\";\n\treturn $echo;\n}", "function ubc_collab_loop_pagination( $pagination ) {\n\treturn str_replace( \"<li><span class='page-numbers current'\", \"<li class='active'><span class='page-numbers current'\", $pagination );\n\n}", "public function getBar()\n\t{\n\t\t$neighbours = 2;\n\n\t\t$page = $this->getPageNo();\n\n\t\t$next = $page + 1;\n\t\t$lastPage = $this->getPagesTotal();\n\t\t$lpm1 = $lastPage - 1;\n\n\t\t$bar = array();\n\t\t$counter = 0;\n\n\t\tif ($lastPage < 2)\n\t\t{\n\t\t\treturn $bar;\n\t\t}\n\n\t\t$bar[] = '<ul class=\"trackerPagination\">';\n\n\t\tif ($lastPage < 7 + ($neighbours * 2))\n\t\t{\n\t\t\tfor ($counter = 1; $counter <= $lastPage; $counter++)\n\t\t\t{\n\t\t\t\tif ($counter == $page)\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($lastPage > 5 + ($neighbours * 2))\n\t\t{\n\t\t\tif ($page < 1 + ($neighbours * 2))\n\t\t\t{\n\t\t\t\tfor ($counter = 1; $counter < 4 + ($neighbours * 2); $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telseif ($lastPage - ($neighbours * 2) > $page && $page > ($neighbours * 2))\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\n\t\t\t\tfor ($counter = $page - $neighbours; $counter <= $page + $neighbours; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\n\t\t\t\tfor ($counter = $lastPage - (2 + ($neighbours * 2)); $counter <= $lastPage; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($page < $counter - 1)\n\t\t{\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($next) . '\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\n\t\t$bar[] = '</ul>';\n\n\t\treturn implode(\"\\n\", $bar);\n\t}", "protected static function handle_pagination($content) { \n\n\t\tpreg_match('/{- BEGIN PAGINATION -}.*?{- END PAGINATION -}/s', $content, $pnation);\n\n\t\t$autolink = BlogPad::has_setting('auto_link');\n\n\t\t$p_processed = '';\n\n\t\tif( !empty($pnation[0]) ) {\n\n\t\t\t$txt = $pnation[0];\n\n\t\t\tif(preg_match('/{- BEGIN COUNTDOWN -}.*?{- END COUNTDOWN -}/s', $pnation[0], $cdown) ) {\n\t\t\t\t$_cdown = str_replace('{- BEGIN COUNTDOWN -}', '<div class=\"bp-countdown\"><?php $i = 1; while($i <= $paginate[\"last_page\"]): ?>', $txt);\n\n\t\t\t\t$_cdown = preg_replace('/(.*?){- number -}(.*)/', ($autolink ? '$1<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $i, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo $i;?></a>$2': '$1<?php echo $i;?>$2'), $_cdown);\n\n\t\t\t\t$_cdown = str_replace('{- END COUNTDOWN -}', '<?php $i++; endwhile; ?></div>', $_cdown);\n\n\t\t\t\t$txt = str_replace($pnation[0], $_cdown, $txt);\n\t\t\t}\n\n\t\t\t// Support the placement of custom text that will be used as a label, else display the relevant page numbers.\n\t\t\t$rplace = preg_replace('/(.*?){- previous:?([A-z0-9\\s]+)? -}(.*)/', '<?php if( !($pagenum - 1 <= 0) ): ?>$1'.($autolink ? '<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $pagenum - 1, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum - 1;?></a>': '<?php echo (trim(\"$2\" !== \"\")) ? \"$2\": $pagenum - 1;?>').'$3<?php endif;?>', $txt);\n\n\n\t\t\t$rplace = preg_replace('/(.*?){- next:?([A-z0-9\\s]+)? -}(.*)/', '<?php if($pagenum + 1 > 1 && $pagenum < $paginate[\"last_page\"]): ?>$1'.($autolink ? '<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $pagenum + 1, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum + 1;?></a>': '<?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum + 1;?>').'$3<?php endif;?>', $rplace);\n\n\t\t\t$p_processed .= $rplace;\n\n\t\t\t$p_processed = str_replace('{- BEGIN PAGINATION -}', '<div class=\"bp-pagination\">', $p_processed);\n\t\t\t$p_processed = str_replace('{- END PAGINATION -}', '</div>', $p_processed);\n\n\t\t\t$content = str_replace($pnation[0], $p_processed, $content);\n\t\t}\n\n\t\treturn $content;\n\t}", "static function page_list($startpage, $config, $first2last=true)\n {\n global $bodyreader;\n if ($first2last) $continue = \"next\"; \n else $continue = \"previous\";\n $items = $bodyreader->parse_advance($startpage, $config, array($continue));\n $pages[] = $startpage; \n while (!empty($items[0][$continue]))\n {\n $link = static::match_url($startpage, $items[0][$continue]);\n $pages[] = $link;\n $items = $bodyreader->parse_advance($link, $config, array($continue));\n }\n \n return $pages;\n }", "abstract public function preparePagination();", "function get_pagenum_link($pagenum = 1, $escape = \\true)\n {\n }", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function paginate($perpage=50)\n\t{\n\t\tif($perpage == 0) return ''; // zero means unlimited\n\n\t\t$page = $this->page->param('p_p', 1);\n\t\t$perpage = $this->page->param('p_pp', $perpage);\n\t\t$offset = max(0,($page-1) * $perpage);\n \n\t\treturn \"$perpage OFFSET $offset\";\n\t}", "function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a>&nbsp;<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;\";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n echo \"<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;<a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a>&nbsp;\";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-$total]&nbsp;</nobr></em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a>&nbsp;\";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n }\n //echo \"<br><br>\";\n }", "public function getPageAndRootline() {}", "protected function createPageLinks()\n {\n $pageLinks = array();\n\n if ($this->totalPages > 10) {\n $startRange = $this->page - floor($this->range/2);\n $endRange = $this->page + floor($this->range/2);\n\n //Start range\n if ($startRange <= 0) {\n $startRange = 1;\n $endRange += abs($startRange) + 1;\n }\n\n // End range\n if ($endRange > $this->totalPages) {\n $startRange -= $endRange - $this->totalPages;\n $endRange = $this->totalPages;\n }\n\n // Range\n $range = range($startRange, $endRange);\n\n // Add first page\n $this->pageLinks[] = array(\n 'page' => 1,\n 'uri' => $this->createUri(1)\n );\n\n foreach ($range as $page) {\n // Skip for first and last page\n if ($page == 1 or $page == $this->totalPages) {\n continue;\n }\n\n $this->pageLinks[] = array(\n 'page' => $page,\n 'uri' => $this->createUri($page)\n );\n }\n\n // Add last page\n $this->pageLinks[] = array(\n 'page' => $this->totalPages,\n 'uri' => $this->createUri($this->totalPages)\n );\n } else {\n for ($i = 1; $i <= $this->totalPages; $i++) {\n $this->pageLinks[] = array(\n 'page' => $i,\n 'uri' => $this->createUri($i)\n );\n }\n }\n }", "function cpl_print_button_pages($numArticle, $buttonSelected){\r\n if($numArticle != 0) {\r\n echo '<section>',\r\n '<p>Pages : </p>';\r\n for ($i=0; $i < $numArticle/4; $i++) {\r\n if($i+1 == $buttonSelected) {\r\n echo '<a id=\"linkDown\">',$i+1,'</a>';\r\n } else {\r\n echo '<a href=\"actus.php?buttonPage=',cp_encrypt_url([$i+1]),'\">',$i+1,'</a>';\r\n }\r\n }\r\n echo '</section>';\r\n }\r\n }", "public function get()\n {\n $total_pages = ceil($this->total / $this->per_page);\n $begin = $this->page - $this->side_pages_n;\n $end = $this->page + $this->side_pages_n;\n $pagination = [];\n\n if ($begin <= 0) {\n $begin = 1;\n }\n\n for ($i = $begin; $i <= $end && $i <= $total_pages; $i++) {\n $pagination[] = $this->getNewPage($i);\n }\n\n if ($this->show_ends) {\n $this->addEnds($pagination);\n }\n\n return $pagination;\n }", "function page_func(){\n\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t<div class=\"tablenav\">\n\t\t\t\t\t\t<div class=\"tablenav-pages\">\n\t\t\t\t\t\t\t<span class=\"displaying-num\">\n\t\t\t\t\t\t\t\tDisplaying 1-20 of 69\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"page-number-current\">1</span>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">2</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">3</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">4</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">5</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">6</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t<?php \n\t\t\t}", "#[Pure] public function generatePagination(): string\n {\n return $this->dbc->generatePagination($this->pageSize, $this->pageNumber);\n }", "function smarty_function_pager($params, &$smarty) {\n $result = '';\n \n if (!isset($params['delta'])) {\n $params['delta'] = 3;\n }\n \n if ($params && $params['pages'] > 1) {\n $result = '<div class=\"dg_pager_container\">';\n \n if ($params['current'] > 1) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"1\">First</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] - 1).'\">Prev</a> ';\n }\n \n $pager_start = $params['current'] <= $params['delta'] ? 1 : $params['current'] - $params['delta'];\n $pager_stop = $params['current'] > $params['pages'] - $params['delta'] ? $params['pages'] : $params['current'] + $params['delta'];\n \n if ($params['current'] > $params['delta'] + 1) {\n /*for ($i = 1; $i <= $params['delta'] + 1; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n $result .= ' ... ';\n }\n \n for ($i = $pager_start; $i <= $pager_stop; ++$i) {\n if ($i == $params['current']) {\n $result .= ' <span>['.$i.']</span> ';\n } else {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }\n }\n \n if ($params['current'] < $params['pages'] - $params['delta']) {\n $result .= ' ... ';\n /*for ($i = $params['pages'] - $params['delta']; $i <= $params['pages']; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n }\n\n if ($params['current'] < $params['pages']) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] + 1).'\">Next</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$params['pages'].'\">Last</a> ';\n }\n \n $result .= '</div>';\n }\n \n return $result;\n}", "function pager_find_page($element = 0) {\n $page = isset($_GET['page']) ? $_GET['page'] : '';\n $page_array = explode(',', $page);\n if (!isset($page_array[$element])) {\n $page_array[$element] = 0;\n }\n return (int) $page_array[$element];\n}", "public function getItemsPerPage();", "public function getItemsPerPage();" ]
[ "0.8161145", "0.67474955", "0.62342", "0.6144174", "0.60108674", "0.5964183", "0.595724", "0.594568", "0.5809402", "0.5756099", "0.56740075", "0.55723804", "0.5505724", "0.5476217", "0.5471395", "0.54218286", "0.54218286", "0.54006463", "0.5388477", "0.53874815", "0.5366174", "0.5362139", "0.53613955", "0.5359467", "0.5347186", "0.5339466", "0.5325821", "0.53222054", "0.53222054", "0.53133273", "0.52908766", "0.527849", "0.52779865", "0.5274288", "0.5269072", "0.5230903", "0.52183384", "0.5215541", "0.52143097", "0.521247", "0.521247", "0.5210634", "0.5201294", "0.5196857", "0.51761687", "0.5167338", "0.5160169", "0.51599514", "0.51490206", "0.5141377", "0.5139605", "0.51350564", "0.51175004", "0.51117545", "0.5109232", "0.50976014", "0.5095671", "0.5086802", "0.5085483", "0.50840324", "0.50828123", "0.5081435", "0.5081333", "0.50791055", "0.5078949", "0.5073384", "0.50695795", "0.50608313", "0.5037552", "0.50367427", "0.50351065", "0.50278914", "0.5014595", "0.50133693", "0.5013299", "0.5004408", "0.49872845", "0.49794447", "0.49773782", "0.497382", "0.49688023", "0.49635178", "0.49627545", "0.49618435", "0.4960292", "0.49441144", "0.49390015", "0.49390015", "0.49363345", "0.49360573", "0.49356964", "0.4932125", "0.4926724", "0.49251243", "0.49216685", "0.4916407", "0.49097243", "0.49063376", "0.49030012", "0.49030012" ]
0.82875407
0
Returns a list of page numbers separated by $separator
Возвращает список номеров страниц, разделенных $separator
function myPageNumbers($separator=null) { if (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; } $t = array(); $text = ''; $pc = 1; do { if($pc == $this->_pageDetails['page']) { $text = '<span class=numberlinkon> '.$pc.'</span>'; } else { if($this->style == 'ajax') { $text = " ".$this->Ajax->link($pc, $this->link.$pc, array("update" => "ajax_update","method"=>"get","class"=>"numberlink")); } else { $text = " ".$this->Html->link($pc,$this->link.$pc,array("class"=>"numberlink")); } } $t[] = $text; $pc++; } while ($pc<=$this->_pageDetails['pageCount']); $t = implode($separator, $t); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageNumbers($separator=null)\n\t{\n\t\tif (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; }\n\t\t$t = array();\n\t\t$text = '';\n\t\t$pc = 1;\n\t\t do \n\t\t {\n\t\t\t if($pc == $this->_pageDetails['page'])\n\t\t\t {\n\t\t\t\t$text = '<span>'.$pc.'</span>';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tif($this->style == 'ajax')\n\t\t\t\t{\n\t\t\t\t\t$text = $this->Ajax->link($pc, array(\"fallback\"=>$this->action.\"#\",\"url\" =>$this->link.$pc,\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$text = $this->Html->link($pc,$this->link.$pc);\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t $t[] = $text;\n\t\t\t $pc++;\n\t\t } \n\t\t while ($pc<=$this->_pageDetails['pageCount']);\n\t\t \n\t\t $t = implode($separator, $t);\n \n\t\treturn $t;\n\t}", "public function getPageNumbers();", "public function genPageNums()\n\t{\n\t\t$pageLinks = array();\t\n\t\n\t\tfor($i=1; $i<=$this->numofpages; $i++)\n\t\t{\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\t\n\t\n\t\tif(($this->totalrows % $this->limit) != 0)\n\t\t{\n\t\t\t$this->numofpages++;\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\n\t\tksort($pageLinks);\n\t\t$this->pagination['nums'] = $pageLinks;\n\t}", "public function page_list() {\n\n\t\t\t$output = \"\";\n\t\t\t$cur_page = $this->current_page;\n\t\t\t$tot_page = $this->total_pages();\n\n\t\t\tif( $cur_page <= $tot_page ) {\n\t\t\t\t$output .= \"<h3 class=\\\"pagelist\\\">Page {$cur_page} of \" ;\n\t\t\t\t$output .= \"{$tot_page}</h3>\";\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\n\t\t}", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "public function getPages($framework, $currentPage = 1, $numPages = 1, $limit = 7, $separator = '...', $breakpoint = 4) {\n\t\t$this->currentPage = $currentPage;\n\t\t$this->numPages = $numPages;\n\t\t$this->limit = $limit;\n\t\t$this->separator = $separator;\n\t\t$this->breakpoint = $breakpoint;\n\n\n\t\t$items = array();\n\n\t\t/**\n\t\t * Less than or 7 pages. We know all the keys, and we put them in the array\n\t\t * that we will use to generate the actual pagination.\n\t\t */\n\t\tif($this->numPages <= $this->limit) {\n\t\t\tfor($i = 1-(bool)$this->logicNumbers; $i <= $this->numPages-(bool)$this->logicNumbers; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t}\n\n\t\t// more than 7 pages\n\t\telse {\n\t\t\t// first page\n\t\t\tif($this->currentPage == 1-(bool)$this->logicNumbers) {\n\t\t\t\t// [1] 2 3 4 5 6 7 8 9 10 11 12 13\n\t\t\t\tfor($i = 1; $i <= $this->limit; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t\t$items[$this->limit + 1] = $this->separator;\n\t\t\t}\n\n\n\t\t\t// last page\n\t\t\telse\n\t\t\tif($this->currentPage == $this->numPages) {\n\t\t\t\t// 1 2 3 4 5 6 7 8 9 10 11 12 [13]\n\t\t\t\t$items[$this->numPages - $this->limit - 1] = $this->separator;\n\t\t\t\tfor($i = ($this->numPages - $this->limit); $i <= $this->numPages; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t}\n\n\t\t\t// other page\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1 2 3 [4] 5 6 7 8 9 10 11 12 13\n\n\t\t\t\t// define min & max\n\t\t\t\t$min = $this->currentPage - $this->breakpoint + 1;\n\t\t\t\t$max = $this->currentPage + $this->breakpoint - 1;\n\n\t\t\t\t// minimum doesnt exist\n\t\t\t\twhile($min <= 0)\n\t\t\t\t{\n\t\t\t\t\t$min++;\n\t\t\t\t\t$max++;\n\t\t\t\t}\n\n\t\t\t\t// maximum doesnt exist\n\t\t\t\twhile($max > $this->numPages)\n\t\t\t\t{\n\t\t\t\t\t$min--;\n\t\t\t\t\t$max--;\n\t\t\t\t}\n\n\t\t\t\t// create the list\n\t\t\t\tif($min != 1) $items[$min - 1] = $this->separator;\n\t\t\t\tfor($i = $min; $i <= $max; $i++) $items[$i] = $i+(bool)$this->logicNumbers;\n\t\t\t\tif($max != $numPages) $items[$max + 1] = $this->separator;\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}", "protected function getPageIds()\n {\n return (array)explode(',', $this->getData('pages'));\n }", "public function getStyledPageNumbers($dbQuery = NULL)\n {\n $pageNumsArray = $this->getPageNumbers($dbQuery);\n \n if($pageNumsArray === 0)\n {\n return 0;\n }\n \n $currentPageNum = $this->currentPageNumber();\n \n $finalString = \"\\n<ul id=\\\"pagenumbersid\\\">\\n\";\n \n if($currentPageNum !== 1)\n {\n $finalString .= \"<li id=\\\"firstpageid\\\"><a href=\\\"{$this->getNewPageAddress(1)}\\\">{$this->firstPageName}</a></li>\\n\";\n $finalString .= \"<li id=\\\"previouspageid\\\"><a href=\\\"{$this->getNewPageAddress($currentPageNum - 1)}\\\">{$this->previousPageName}</a></li>\\n\";\n }\n \n $decreaseTwoPoint = $currentPageNum-2;\n /**\n * Because it can not be lower that 1 and the 1 is the lowest number then we will check whether it's lower that 1 or not.\n * If its lower than then we can set it to 1 manually.\n */\n if($decreaseTwoPoint < 1)\n {\n $decreaseTwoPoint = 1;\n }\n \n $increaseTwoPoint = $currentPageNum+2;\n /**\n * Because it can not be more bigger than our total page numbers then we will check it to see whether it's bigger that our total page numbers or not.\n * If it's bigger then we will set it to the total page numbers manually.\n */\n if($increaseTwoPoint > $this->totalPages)\n {\n $increaseTwoPoint = $this->totalPages;\n }\n \n for($i = $decreaseTwoPoint; $i <= $increaseTwoPoint; $i++)\n {\n if($i == $currentPageNum)\n {\n $finalString .= \"<li>{$i}</li>\\n\";\n }\n else\n {\n $finalString .= \"<li><a href=\\\"{$this->getNewPageAddress($i)}\\\">{$i}</a></li>\\n\";\n }\n }\n \n if($currentPageNum !== $this->totalPages)\n {\n $finalString .= \"<li id=\\\"nextpageid\\\"><a href=\\\"{$this->getNewPageAddress($currentPageNum + 1)}\\\">{$this->nextPageName}</a></li>\\n\";\n $finalString .= \"<li id=\\\"lastpageid\\\"><a href=\\\"{$this->getNewPageAddress($this->totalPages)}\\\">{$this->lastPageName}</a></li>\\n\";\n }\n \n $finalString .= '</ul>';\n \n return $finalString;\n }", "function _getAllPageNumbers($current_page, $last_page)\n{\n $page_ix = 1;\n $pages = array();\n while($page_ix <= $last_page){\n if($page_ix == $current_page){\n $pages[$page_ix] = 'current';\n } else {\n $pages[$page_ix] = $page_ix;\n } \n $page_ix++;\n }\n return $pages;\n}", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "function _getSelectedPageNumbers($current_page, $last_page)\n{\n //-----------//\n // constants //\n //-----------//\n\n //defines the offset pattern to repeat for each level of $base\n //array(1, 2, 5) will make offsets into 1, 2, 5, 10, 20, 50, etc.\n //array(1, 5) will make offsets into 1, 5, 10, 50, 100, 500, etc.\n $multipliers = array(1, 2, 5);\n\n $base = 10; //10 looks best\n\n //----------------//\n // initialization //\n //----------------//\n $exponent = 0;\n $pages = array($current_page => 0);\n $offsets = array();\n $offset = 1;\n $multiplier = reset($multipliers);\n $max_offset = $last_page - $current_page;\n if($current_page > $max_offset){\n $max_offset = $current_page;\n }\n\n //calculate offsets that increase (semi-)logarithmically\n while($offset <= $max_offset){\n $offset = $multiplier * pow($base, $exponent);\n $offsets[] = $offset;\n if(!($multiplier = next($multipliers))){\n $multiplier = reset($multipliers);\n $exponent++;\n }\n }\n\n foreach($offsets as $offset){\n if(0 == $offset){\n $pages[$pagenum] = 'current';\n } else {\n $exact_pagenum = $current_page - $offset;\n $adj_pagenum = round($exact_pagenum / $offset) * $offset;\n if($adj_pagenum > 0){\n $pages[$adj_pagenum] = $offset;\n }\n\n $exact_pagenum = $current_page + $offset;\n $adj_pagenum = round($exact_pagenum / $offset) * $offset;\n if($adj_pagenum <= $last_page){\n $pages[$adj_pagenum] = $offset;\n }\n }\n }\n\n if(!isset($pages[1])){\n $pages[1] = 'first';\n }\n if(!isset($pages[$last_page])){\n $pages[$last_page] = 'last';\n }\n $pages[$current_page] = 'current';\n\n ksort($pages);\n return $pages;\n\n}", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function getPages();", "public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\">&lt;</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">&gt;</a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function generate($strSeparator = '')\n {\n $this->determineValues();\n\n // Return if there is only one page\n if ($this->intTotalPages < 2 || $this->intRows < 1) {\n return '';\n }\n\n if ($this->intPage == -1) {\n return '';\n }\n\n $template = new TwigFrontendTemplate('pagination');\n\n $template->hasFirst = $this->hasFirst();\n $template->hasPrevious = $this->hasPrevious();\n $template->hasNext = $this->hasNext();\n $template->hasLast = $this->hasLast();\n\n $template->items = $this->getItems();\n $template->page = $this->intPage;\n $template->total = $this->intTotalPages;\n\n $template->first = array\n (\n 'page' => 1,\n 'link' => $this->lblFirst,\n 'href' => $this->arrLinks[0],\n );\n\n $template->previous = array\n (\n 'page' => $this->intPage - 1,\n 'link' => $this->lblPrevious,\n 'href' => $this->arrLinks[($this->intPage - 2)],\n );\n\n $template->next = array\n (\n 'page' => $this->intPage + 1,\n 'link' => $this->lblNext,\n 'href' => $this->arrLinks[$this->intPage],\n );\n\n $template->last = array\n (\n 'page' => $this->intTotalPages,\n 'link' => $this->lblLast,\n 'href' => $this->arrLinks[(count($this->arrLinks) - 1)],\n );\n\n $this->setHeadTags();\n\n return $template->parse();\n }", "public function getItemsAsString($strSeparator=' ')\n\t{\n\t\t$arrLinks = array();\n\n\t\t$intNumberOfLinks = floor($this->intNumberOfLinks / 2);\n\t\t$intFirstOffset = $this->intItem - $intNumberOfLinks - 1;\n\n\t\tif ($intFirstOffset > 0)\n\t\t{\n\t\t\t$intFirstOffset = 0;\n\t\t}\n\n\t\t$intLastOffset = $this->intItem + $intNumberOfLinks - $this->intTotalItems;\n\n\t\tif ($intLastOffset < 0)\n\t\t{\n\t\t\t$intLastOffset = 0;\n\t\t}\n\n\t\t$intFirstLink = $this->intItem - $intNumberOfLinks - $intLastOffset;\n\n\t\tif ($intFirstLink < 1)\n\t\t{\n\t\t\t$intFirstLink = 1;\n\t\t}\n\n\t\t$intLastLink = $this->intItem + $intNumberOfLinks - $intFirstOffset;\n\n\t\tif ($intLastLink > $this->intTotalItems)\n\t\t{\n\t\t\t$intLastLink = $this->intTotalItems;\n\t\t}\n\n\t\tfor ($i=$intFirstLink; $i<=$intLastLink; $i++)\n\t\t{\t\n\t\t\tif ($i == $this->intItem)\n\t\t\t{\n\t\t\t\t$arrLinks[] = sprintf('<li class=\"active\"><span class=\"current active\">%s</span></li>',\n\t\t\t\t\t\t\t\t\t '<span class=\"index\">' . $i . '</span>' . '<span class=\"title\">' . $this->getItemTitle($i) . '</span>');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t$arrLinks[] = sprintf('<li><a href=\"%s\" class=\"link\" title=\"%s\">%s</a></li>',\n\t\t\t\t\t\t\t\t$this->linkToItem($i),\n\t\t\t\t\t\t\t\tsprintf(specialchars($GLOBALS['TL_LANG']['MSC']['readerpaginations']['goTo']), $this->getItemTitle($i)),\n\t\t\t\t\t\t\t \t '<span class=\"index\">' . $i . '</span>' . '<span class=\"title\">' . $this->getItemTitle($i) . '</span>'\n\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn implode($strSeparator, $arrLinks);\n\t}", "public function pageNumbers($rowCount, $perPage, $pageRange, $rangeLimit, $page, $return=false, $additionalString='')\n\t{\n\t\tif($page == null OR $page == 0) $page = 1;\n\t\tif(!$perPage) $perPage = 100;\n\t\tif($page == 1) $pageRange = $pageRange + 2;\n\t\t$totalPages = ceil($rowCount/$perPage);\n\t\t$rangeLimit = ceil($pageRange/2);\n\t\t$output = '';\n\n\t\t$output .= '\n\t\t<div class=\"Pages\">\n\t\t\t<div class=\"Paginator\"> <b>Pages</b>\n\t\t\t';\n\n\t\tif($page > $rangeLimit)\n\t\t\t$output .= \"<a href='$PHP_SELF?page=1\".$additionalString.\"' class='Prev'>&lt; First</a>\n\t\t\t<span class='break'>...</span>\n\t\t\t\"; \n\t\t\t\n\t\t\t\n\n\t\tfor($pageCounter=1; $pageCounter <= $totalPages; $pageCounter++)\n\t\t{\n\t\t\tif($pageCounter > $page - $rangeLimit AND $pageCounter < $page + $rangeLimit)\n\t\t\t{\n\t\t\t\tif($page == $pageCounter)\n\t\t\t\t\t$output .= \"<span class='this-page'>$pageCounter</span>\n\t\t\t\t\t\t\";\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($totalPages != 1)\n\t\t\t\t\t\t$output .= \"<a href='$PHP_SELF?page=$pageCounter\".$additionalString.\"'>$pageCounter</a>\n\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($totalPages > $page + $pageRange)\n\t\t\t$output .= \"<span class='break'>...</span>\n\t\t\t\"; \n\n\t\tif($page < $totalPages - $rangeLimit AND $totalPages > $rangeLimit)\n\t\t\t$output .= \"<a href='$PHP_SELF?page=$totalPages\".$additionalString.\"' class='Next'>Last &gt;</a>\n\t\t\t\"; \n\t\t//status=$status&amp; <- removed 2007-03-26\n\n\t\t$output .= \"\n\t\t\t</div>\n\t\t</div>\n\t\t\";\n\t\tif($rowCount>1)\n\t\t{\n\t\t\tif($return) return $output;\n\t\t\telse echo $output;\n\t\t}\n\t}", "function numbered_in_page_links( $args = array () )\n{\n $defaults = array(\n 'before' => '<div class=\"page-links\"><i class=\"icon-menu-3 pageLinksToggle\"></i><ul class=\"subpage-list\">' \n , 'after' => '</ul></div>'\n , 'link_before' => '<li>'\n , 'link_after' => '</li>'\n , 'pagelink' => '%'\n , 'echo' => 1\n // element for the current page\n , 'highlight' => 'b'\n );\n\n $r = wp_parse_args( $args, $defaults );\n $r = apply_filters( 'wp_link_pages_args', $r );\n extract( $r, EXTR_SKIP );\n\n global $page, $numpages, $multipage, $more, $pagenow;\n\n if ( ! $multipage )\n {\n return;\n }\n\n $output = $before;\n\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\n {\n $j = str_replace( '%', $i, $pagelink );\n $output .= ' ';\n\n if ( $i != $page || ( ! $more && 1 == $page ) )\n {\n $output .= \"{$link_before}\". _wp_link_page( $i ) . \"{$j}</a>{$link_after}\";\n }\n else\n { // highlight the current page\n // not sure if we need $link_before and $link_after\n $output .= \"{$link_before}<$highlight>{$j}</$highlight>{$link_after}\";\n }\n }\n\n print $output . $after;\n}", "public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}", "function get_all_page_ids()\n {\n }", "public function getNombrePages() \r\n\t{\r\n\t\tvar_dump($this->_db);\r\n\t\treturn ceil(count($this->_db)/self::NOMBRE_PAR_PAGE);\r\n\t\t\r\n\t\t//return $aBiere[$nPage-1];\r\n\t}", "function link_pages($before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page', $pagelink = '%', $more_file = '')\n {\n }", "public function rangeToPaginate()\n {\n $pages = array();\n\n if ( $this->lastPage <= $this->maxPagesToList) {\n for ($i = 1; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else if ($this->currentPage <= floor($this->maxPagesToList/2)+1) {\n for ($i = 1; $i <= $this->maxPagesToList; $i++) {\n $pages[] = $i;\n }\n } else if ($this->lastPage <= floor($this->maxPagesToList/2)+$this->currentPage) {\n $begin = $this->lastPage - $this->maxPagesToList + 1;\n for ($i = $begin; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else {\n $begin = $this->currentPage - floor($this->maxPagesToList/2);\n $end = $this->currentPage + floor($this->maxPagesToList/2);\n for ($i = $begin; $i <= $end; $i++) {\n $pages[] = $i;\n }\n }\n return $pages;\n\n }", "function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}", "public function getPageNumber();", "public function getPageNumber();", "public function pagination_numbers_set(){\n\t\t\t$this->pages_show_array = array();\n\t\t\t$this->pages_show_array['middle'] = array();\n\t\t\t$this->pages_show_array['prev'] = null;\n\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t$this->pages_show_array['first'] = null;\n\t\t\t$this->pages_show_array['last'] = null;\n\n\t\t\t\n\t\t\tfor ($i=0; $i < sizeof($this->pages_array) ;$i++){\n\n\t\t\t\t//first iteration\n\t\t\t\tif ($i == 0){\n\t\t\t\t\t//prev\n\t\t\t\t\tif ($this->current_page <= 1){\n\t\t\t\t\t\t$this->pages_show_array['prev'] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($this->current_page >= $this->total_pages){\n\t\t\t\t\t\t$this->pages_show_array['prev'] = $this->total_pages - 1;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->pages_show_array['prev'] = $this->current_page - 1;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->current_page > $this->pages_to_show){\n\t\t\t\t\t\t$this->pages_show_array['first'] = \"1 ...\";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tarray_push($this->pages_show_array['middle'], $this->pages_array[$i]);\n\n\n\t\t\t\t}\n\n\t\t\t\t//last iteration\n\t\t\t\telse if ($i == sizeof($this->pages_array)-1){\n\n\t\t\t\t\tif ($this->current_page < $this->total_pages - $this->pages_to_show){\n\t\t\t\t\t\t$this->pages_show_array['last'] = \"...\" . $this->total_pages;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//next\n\t\t\t\t\tif ($this->current_page >= $this->total_pages){\n\t\t\t\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->pages_show_array['next'] = $this->current_page + 1;\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//middle iterations\n\t\t\t\telse {\n\t\t\t\t\tarray_push($this->pages_show_array['middle'], $this->pages_array[$i]);\n\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif (empty($this->pages_show_array['next'])){\n\t\t\t\t\t$this->pages_show_array['next'] = null;\n\t\t\t\t}\n\t\t\t\n\n\t\t}", "protected function num() {\n $this->siblings = $this->siblings->not($this->page)->sortBy('num', 'asc');\n\n // special keywords and sanitization\n if($this->to == 'last') {\n $this->to = $this->siblings->count() + 1;\n } else if($this->to == 'first') {\n $this->to = 1;\n } else if($this->to === false) {\n $this->to = false;\n } else if($this->to < 1) {\n $this->to = 1; \n }\n\n // start the index\n $n = 0;\n\n if($this->to === false) {\n foreach($this->siblings as $sibling) {\n $n++; $sibling->_sort($n);\n }\n } else {\n\n // go through all items before the selected page\n foreach($this->siblings->slice(0, $this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n // add the selected page\n $n++; $this->page->_sort($n);\n\n // go through all the items after the selected page\n foreach($this->siblings->slice($this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n }\n\n }", "public function page_links()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$pagination = '';\n\t\t\n\t\t// Let's get the starting page number, this is determined using num_links\n\t\t$start = (($this->current_page - $this->num_links) > 0) ? $this->current_page - ($this->num_links - 1) : 1;\n\n\t\t// Let's get the ending page number\n\t\t$end = (($this->current_page + $this->num_links) < $this->total_pages) ? $this->current_page + $this->num_links : $this->total_pages;\n\n\t\tfor ($i = $start; $i <= $end; $i++)\n\t\t{\n\t\t\t$text = $i;\n\t\t\t$url = '#';\n\t\t\t$state = $this->template['state']['current_page'];\n\n\t\t\tif ($this->current_page != $i)\n\t\t\t{\n\t\t\t\t// detect if anchor attribute is presented in the template \n\t\t\t\tif (stripos('<a ', $this->template['page_start']) < 0)\n\t\t\t\t{\n\t\t\t\t\t$text = '<a href=\":url\">'.$i.'</a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$url = $this->build_url($i);\n\t\t\t\t$state = '';\n\t\t\t}\n\n\t\t\t$pagination .= Str::tr($this->template['page_start'].$text.$this->template['page_end'], array(\n\t\t\t\t'state' => $state,\n\t\t\t\t'url' => $url,\n\t\t\t));\n\t\t}\n\n\t\treturn $pagination;\n\t}", "public function view()\n {\n $pages = explode(' ', $this->list);\n\n if ($this->current_page < 1 || $this->current_page > $this->total_pages) {\n $this->current_page = 1;\n }\n $output = null;\n\n $output .= '<ul class=\"pagination\">';\n $output .= $this->beginning();\n $output .= $this->middle($pages);\n $output .= $this->ending();\n $output .= '</ul>';\n \n return $output;\n }", "public function getPages() {}", "function getPageSegment($separator = null, $offset = 0) {\n $page = $this->getCurrentPage();\n if (!$separator) {\n if (file_exists($this->getPagePath($page))) {\n require_once $this->getPagePath($page);\n }\n return;\n }\n $path = $this->getPagePath($page);\n $string = file_get_contents($path);\n $segments = explode($separator, $string);\n if(array_key_exists($offset, $segments)){\n $segment = $segments[$offset];\n if (substr($segment, 0, 5) !== \"<?php\") {\n $segment = \"?>\" . $segment;\n }\n eval($segment);\n }\n }", "public function getPerPage();", "public function get_pages($total,$current,$nb_per_page,$rub,$array_submitted=array())\n {\n $str_return = '';\n $arr_return = '';\n \n $get = '';\n \n foreach($array_submitted as $keysubmitted => $valuesubmitted)\n {\n if(!empty($valuesubmitted))\n {\n $get .= strtolower('&'.$keysubmitted.'='.$valuesubmitted);\n }\n }\n \n if($total>$nb_per_page)\n {\n $nbpage = ceil($total/$nb_per_page);\n\n if($current>1)\n {\n $prec = $current-1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$prec.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-left', 'active' => 0, 'bnumber' => 0);\n }\n\n if($nbpage <10)\n {\n $linkstart = 1;\n $linkstop = $nbpage;\n }\n else if($current<=5)\n { \n $linkstart = 1;\n $linkstop = 10;\n }\n else if( $current>5 && $current<($nbpage-5) )\n { \n $linkstart = $current-4;\n $linkstop = $current+5;\n }\n else if( $current>=($nbpage-5) )\n { \n $linkstart = $nbpage-9;\n $linkstop = $nbpage;\n }\n \n\n for($ipage=$linkstart;$ipage<=$linkstop;$ipage++)\n {\n $href = \"index.php?rub=\".$rub.\"&p=\".$ipage.$get; \n if($current==$ipage)\n {\n $arr_return[] = array('link' => '#', 'number' => $ipage, 'active' => 1, 'bnumber' => 1);\n }\n else\n {\n $arr_return[] = array('link' => $href, 'number' => $ipage, 'active' => 0, 'bnumber' => 1);\n }\n }\n\n if($current<$nbpage)\n {\n $suiv = $current+1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$suiv.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-right', 'active' => 0, 'bnumber' => 0);\n }\n \n \n } \n return $arr_return;\n }", "private function retrieve_pagenumber() {\n\t\t$replacement = null;\n\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\tif ( isset( $nr ) && $nr > 0 ) {\n\t\t\t$replacement = (string) $nr;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getPaginated();", "protected function buildPagination() {}", "protected function buildPagination() {}", "function numbered_in_page_links( $args = array () )\r\n{\r\n $defaults = array(\r\n 'before' => '<p>' . __('Pages:', 'framework')\r\n , 'after' => '</p>'\r\n , 'link_before' => ''\r\n , 'link_after' => ''\r\n , 'pagelink' => '%'\r\n , 'echo' => 1\r\n // element for the current page\r\n , 'highlight' => 'span'\r\n );\r\n\r\n $r = wp_parse_args( $args, $defaults );\r\n $r = apply_filters( 'wp_link_pages_args', $r );\r\n extract( $r, EXTR_SKIP );\r\n\r\n global $page, $numpages, $multipage, $more, $pagenow;\r\n\r\n if ( ! $multipage )\r\n {\r\n return;\r\n }\r\n\r\n $output = $before;\r\n\r\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\r\n {\r\n $j = str_replace( '%', $i, $pagelink );\r\n $output .= ' ';\r\n\r\n if ( $i != $page || ( ! $more && 1 == $page ) )\r\n {\r\n $output .= _wp_link_page( $i ) . \"{$link_before}{$j}{$link_after}</a>\";\r\n }\r\n else\r\n { // highlight the current page\r\n // not sure if we need $link_before and $link_after\r\n $output .= \"<$highlight>{$link_before}{$j}{$link_after}</$highlight>\";\r\n }\r\n }\r\n\r\n print $output . $after;\r\n}", "function render_block_core_query_pagination_numbers($attributes, $content, $block)\n {\n }", "public function getPaginationHtml();", "public function numbers(array $options = []): string\n {\n $paging = $this->params();\n\n $first = $last = $current = 1;\n\n if ($paging) {\n $first = $paging['current'] > 5 ? ($paging['current'] - 4) : 1;\n $last = $first + 7;\n if ($last > $paging['pages']) {\n $last = $paging['pages'];\n }\n $current = $paging['current'];\n }\n\n $output = '';\n $query = $this->request()->query();\n for ($i = $first; $i < $last + 1; ++$i) {\n $template = 'number';\n if ($current == $i) {\n $template = 'numberActive';\n }\n $query['page'] = $i;\n\n $options['url'] = $this->request()->path() . '?' . http_build_query($query);\n $options['text'] = $i;\n $output .= $this->templater()->format($template, $options);\n }\n\n return $output;\n }", "function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'hbd-theme') . get_query_var('paged');\n\t }\n\t}", "function show_page_links($base_url, $num_items, $per_page, $page)\n{\n //$base_url contains the address of the page and the order it is called with\n //e.g., 'asc' or 'desc' - the page handles this so we have to worry about it.\n\n $total_pages = ceil($num_items/$per_page);\n\n if ($total_pages == 1)\n {\n return '';\n }\n\n //initialize our $page_string variable wich will hold the links\n $page_string = '<p><span class=\"page_numbers\">';\n\n //SHOW UP TO 4 LINKS ON EITHER SIDE OF THE CURRENT PAGE\n\n //get the number of page links are available after the current page\n $num_succeeding_links = $total_pages - $page;\n\n //get the number of preceding links available before the current page\n $num_preceding_links = $page -1;\n\n //calculate our start and end values\n $start = $page - 4;\n if ( $start < 1)\n {\n $start = 1;\n }\n //if we have less than 10 total_page, use the number we have ($total_pages)\n $end = $total_pages;\n //but if end is more than 9 higher than $start, make $end 9 higher than $start\n //we only want to show 10 records per page (e.g., 1..10)\n if ( ($end - $start) > 9 )\n {\n $end= $start + 9;\n }\n\n //if the total number of succeeding links exceeds 4 show 4 and a >> at the end\n //the >> at the end is just the 5th succeeding link\n //do the same for preceding links if they are more than 4\n if ($total_pages > 10 && $page > 1) //don't show first page link except when we're not the first page\n {\n //create a << which points to the first page\n $page_string .= '<a title=\"first page\" href=\"'.$base_url.'&page=1\">&lt;&lt;</a>&nbsp;&nbsp;';\n //create a < which points to the current page -1 (shifts us left one)\n $val = $page-1;\n $page_string .= '<a title=\"previous page\" href=\"'.$base_url.'&page='.$val.'\">&lt;</a>&nbsp;&nbsp;';\n }\n for ($i=$start; $i<=$end; $i++)\n {\n if ($i == $page)\n {\n $page_string .= \" <b>[$i]</b> \";\n }\n else\n {\n $page_string .= ' <a title=\"page ' . $i . '\" href=\"'.$base_url.'&page='.$i.'\">'.$i.'</a> ';\n }\n }\n if ($total_pages > 10 && $page < $total_pages) //don't show last page link except when we're not on the last page\n {\n //create a > which points to the current page +1 (shifts us right one)\n $val = $page + 1;\n $page_string .= '&nbsp;&nbsp;<a title=\"next page\" href=\"'.$base_url.'&page='.$val.'\">&gt</a>';\n\n //create a >> which point to the last page\n $page_string .= '&nbsp;&nbsp;<a title=\"last page\" href=\"'.$base_url.'&page='.$total_pages.'\">&gt;&gt</a> ';\n }\n\n $page_string .= '</span></p>';\n\n return $page_string;\n\n}", "public function get_pagenum()\n {\n }", "public function getNombrePages() \r\n\t{\r\n\t\treturn ceil(count($this->_bieres)/self::NOMBRE_PAR_PAGE);\r\n\t}", "private function compilePager() {\n \t\n \t\n \t$this->_tmp_page = '<p '.$this->_config['css_page'].'>';\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].'1\">'.$this->_config['first'].'</a>';\n \t}\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] - 1).'\">'.$this->_config['previous'].'</a>';\n \t}\n \t\n \tif ($this->_all_page <= $this->_config['scr_page']) {\n \tif($this->_config['all_recs'] <= $this->_config['per_page']) {\n \t$this->_start = 1;\n $this->_stop = $this->_all_page;\n } else {\n \t\t$this->_start = 1;\n $this->_stop = $this->_all_page;\n }\n } else {\n \tif($this->_config['cur_page'] < intval($this->_config['scr_page'] / 2) + 1) {\n\t $this->_start = 1; \n\t \t$this->_stop = $this->_config['scr_page'];\n } else {\n \t$this->_start = $this->_config['cur_page'] - intval($this->_config['scr_page'] / 2);\n $this->_stop = $this->_config['cur_page'] + intval($this->_config['scr_page'] / 2);\n if($this->_stop > $this->_all_page) $this->_stop = $this->_all_page;\n }\n }\n if ($this->_all_page > 1) {\n\t for ($i = $this->_start; $i <= $this->_stop; $i++) {\n\t \tif ($i == $this->_config['cur_page']) {\n\t \t$this->_tmp_page .= '<span '.$this->_config['act_page'].'>'.$i.'</span>';\n\t } else {\n\t $this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$i.'\">'.$i.'</a>';\n\t }\n\t }\n }\n \n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] + 1).'\">'.$this->_config['next'].'</a>';\n \t}\n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$this->_all_page.'\">'.$this->_config['last'].'</a>';\n \t}\n \treturn $this->_tmp_page.'</p>';\n }", "public function numbers(array $options = [])\n {\n $class = 'pagination';\n\n $options += [\n 'class' => $class,\n 'after' => '</ul>',\n 'size' => null,\n ];\n\n $options['class'] = implode(' ', (array)$options['class']);\n\n if (!empty($options['size'])) {\n $options['class'] .= \" {$class}-{$options['size']}\";\n }\n\n $options += [\n 'before' => '<ul class=\"' . $options['class'] . '\">',\n ];\n\n unset($options['class'], $options['size']);\n\n if (isset($options['prev'])) {\n if ($options['prev'] === true) {\n $options['prev'] = $this->config('labels.prev');\n }\n $options['before'] .= $this->prev($options['prev'], ['escape' => false]);\n }\n\n if (isset($options['next'])) {\n if ($options['next'] === true) {\n $options['next'] = $this->config('labels.next');\n }\n $options['after'] = $this->next($options['next'], ['escape' => false]) . $options['after'];\n }\n\n return parent::numbers($options);\n }", "public function getGridPerPageValues()\n {\n return explode(\",\", $this->_klevuConfig->getCatalogGridPerPageValues());\n }", "public static function paginationList(array $params, View $view): string\n {\n $pagination = $view['pagination'];\n if (!($pagination instanceof Pagination)) {\n trigger_error(__FUNCTION__ . '(): No Pagination object set', E_USER_ERROR);\n }\n\n if (!isset($params['url'])) {\n return '';\n }\n\n $str = '';\n $delimiter = $params['delimiter'] ?? ' ';\n $urlParams = $pagination->generateUrlParamsString($params);\n $pageList = $pagination->getPageList();\n $current = $pagination->getCurrentPage();\n foreach ($pageList as $page) {\n $str .= ($page == $current)\n ? $page\n : '<a href=\"' . $params['url'] . '?page=' . $page . $urlParams . '\">' . $page . '</a>';\n $str .= $delimiter;\n }\n $str = substr($str, 0, -strlen($delimiter));\n\n return $str;\n }", "function get_pageNavHtml($page, $totalPages, $urlPrefix, $showPagesNums = 11)\n{\n if ($totalPages <= 0 || $page <= 0)\n return \"\";\n if ($showPagesNums <3 || $showPagesNums%2 === 0)\n return \"\";\n $pageNavHtml = \"\";\n\n $sideShowPages = floor($showPagesNums/2);\n $start = ($page - $sideShowPages) > 1? $page-$sideShowPages : 1;\n $end = ($page + $sideShowPages) < $totalPages? $page+$sideShowPages : $totalPages;\n\n for ($i = $start; $i<=$end; $i++)\n {\n $eachPageUrl = $urlPrefix.\"page=\".$i;\n $pageNavHtml .= \"<a href='$eachPageUrl' id='page_num_$i'>$i</a>&nbsp\";\n }\n return $pageNavHtml;\n}", "private function retrieve_page() {\n\t\t$replacement = null;\n\n\t\t$max = $this->determine_pagenumbering( 'max' );\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\t$sep = $this->retrieve_sep();\n\n\t\tif ( $max > 1 && $nr > 1 ) {\n\t\t\t/* translators: 1: current page number, 2: total number of pages. */\n\t\t\t$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function pager($margin=10)\n {\n $path = $_GET;\n $newpath = $PHP_SELF.\"?\";\n foreach($path as $key => $value)\n {\n if($key!=$this->getvar)\n {\n $newpath .= $key.\"=\".$value;\n $newpath .=\"&amp;\";\n }\n }\n $newpath .= $this->getvar;\n\n $linkpaths = array();\n $current = $this->start / $this->length + 1;\n $pages = ceil(($this->rows/$this->length));\n $pagerstart = $current-$margin;\n $pagerstart = ($pagerstart<1)?1:$pagerstart;\n $pagerend = $current+$margin;\n \n $pagerend = ( $pagerend > $pages ) ? ( ceil( ( $this->rows / $this->length ) ) ): $pagerend;\n\n for($i=$pagerstart;$i < ($pagerend+1);$i++)\n {\n $linkpaths[$i] = $newpath.\"=\".($i);\n }\n if($linkpaths[($current+1)]!=null)\n {\n $linkpaths['next']=$linkpaths[($current+1)];\n }\n if($linkpaths[($current-1)]!=null)\n {\n $linkpaths['last']=$linkpaths[($current-1)];\n }\n return $linkpaths;\n }", "function register_block_core_query_pagination_numbers()\n {\n }", "public function getPages()\n\t{\n\t\treturn $this->getOptionData('tl_page');\n\t}", "public function paginate_numbers($count_of_entries, $items_per_page, $current_page, $pages_to_show){\n\t\t\t$this->pages_array = array();\n\t\t\t\n\t\t\t$this->pages_to_show = $pages_to_show;\n\t\t\t$this->current_page = $current_page;\n\t\t\t\n\t\t\t//ceiling to round fraction up to nearest whole number - total number of pages also = last page number\n\t\t\t$this->total_pages = ceil($count_of_entries / $items_per_page);\n\t\t\t\n\t\t\t//if the total number of pages is fewer than the limit, return only those pages\n\t\t\tif ($this->total_pages < $pages_to_show){\n\t\t\t\tfor ($i=0; $i < $this->total_pages;$i++){\n\t\t\t\t\tarray_push($this->pages_array, ($i + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t//if the current page is less than the number of pages to show, then only show the first amount of pages to show\n\t\t\t\tif ($this->current_page < $pages_to_show){\n\t\t\t\t\tfor ($i=0; $i < $pages_to_show;$i++){\n\t\t\t\t\t\tarray_push($this->pages_array, ($i + 1));\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\n\t\t\t\t//if the current page is not in the first batch of pages:\n\t\t\t\telse {\n\n\t\t\t\t\tif ($this->total_pages - $this->current_page < $pages_to_show){\n\n\t\t\t\t\t\t//with x pages of the last page\n\t\t\t\t\t\t$setpage = $this->total_pages - $pages_to_show+1;\n\t\t\t\t\t\t$counter = $pages_to_show;\n\n\t\t\t\t\t\tfor ($i=0; $i < $counter; $i++){\n\t\t\t\t\t\t\tarray_push($this->pages_array, $setpage);\n\t\t\t\t\t\t\t$setpage++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//nowhere near the last page\n\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$setpage = $this->current_page - ($pages_to_show / 2);\n\t\t\t\t\t\tfor ($i=0; $i < $pages_to_show;$i++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tarray_push($this->pages_array, $setpage);\n\t\t\t\t\t\t\t$setpage++;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\n\t\t}", "static function explodeUrl($path, $separator)\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'return url parameters',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $pages = array();\n $params = array();\n\n foreach ($path as $value) {\n if (preg_match('#[' . $separator . ']{1}#', $value)) {\n $params[] = $value;\n } elseif ($value) {\n $pages[] = $value;\n }\n }\n\n return array('pages' => $pages, 'params' => $params);\n }", "function getPaging() {\n\t\t//if the total number of rows great than page size\n\t\tif($this->totalRows > $this->pageSize) {\n\t\t\tprint '<div class=\"paging\">';\n\t\t\tprint '<ul>';\n\t\t\tprint $this->first() . $this->prev() . $this->pageList() . $this->next() . $this->end();\n\t\t\tprint '</ul>';\n\t\t\tprint '</div>';\n\t\t}\n }", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')\n{\n\tglobal $template, $user;\n\n\t// Make sure $per_page is a valid value\n\t$per_page = ($per_page <= 0) ? 1 : $per_page;\n\n\t$seperator = '<span class=\"page-sep\">' . $user->lang['COMMA_SEPARATOR'] . '</span>';\n\t$total_pages = ceil($num_items / $per_page);\n\n\tif ($total_pages == 1 || !$num_items)\n\t{\n\t\treturn false;\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\t$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');\n\n\t$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href=\"' . $base_url . '\">1</a>';\n\n\tif ($total_pages > 5)\n\t{\n\t\t$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);\n\t\t$end_cnt = max(min($total_pages, $on_page + 4), 6);\n\n\t\t$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;\n\n\t\tfor ($i = $start_cnt + 1; $i < $end_cnt; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $end_cnt - 1)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\n\t\t$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;\n\t}\n\telse\n\t{\n\t\t$page_string .= $seperator;\n\n\t\tfor ($i = 2; $i < $total_pages; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $total_pages)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\t}\n\n\t$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($total_pages - 1) * $per_page) . '\">' . $total_pages . '</a>';\n\n\tif ($add_prevnext_text)\n\t{\n\t\tif ($on_page != 1)\n\t\t{\n\t\t\t$page_string = '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page) . '\">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;\n\t\t}\n\n\t\tif ($on_page != $total_pages)\n\t\t{\n\t\t\t$page_string .= '&nbsp;&nbsp;<a href=\"' . $base_url . \"{$url_delim}start=\" . ($on_page * $per_page) . '\">' . $user->lang['NEXT'] . '</a>';\n\t\t}\n\t}\n\n\t$template->assign_vars(array(\n\t\t$tpl_prefix . 'BASE_URL'\t\t=> $base_url,\n\t\t'A_' . $tpl_prefix . 'BASE_URL'\t=> addslashes($base_url),\n\t\t$tpl_prefix . 'PER_PAGE'\t\t=> $per_page,\n\n\t\t$tpl_prefix . 'PREVIOUS_PAGE'\t=> ($on_page == 1) ? '' : $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page),\n\t\t$tpl_prefix . 'NEXT_PAGE'\t\t=> ($on_page == $total_pages) ? '' : $base_url . \"{$url_delim}start=\" . ($on_page * $per_page),\n\t\t$tpl_prefix . 'TOTAL_PAGES'\t\t=> $total_pages,\n\t));\n\n\treturn $page_string;\n}", "public function list_pages() {\n\t\t$this->print_prev();\n\n\t\tif ($this->current_page+2 >= $this->total_pages-1) {\n\t\t\t$this->pages_right();\n\t\t} else {\n\t\t\t$this->pages_left();\n\t\t}\n\n\t\t$this->print_next();\n\t}", "function paginationNames($page = 1, $page_count)\n{\n if($page < 3){\n return [\n 'first' => 1,\n 'second' => 2,\n 'third' => 3\n ];\n }elseif($page == $page_count){\n return [\n 'first' => ($page_count - 2),\n 'second' => ($page_count - 1),\n 'third' => $page_count\n ];\n }else{\n return [\n 'first' => ($page - 1),\n 'second' => $page,\n 'third' => ($page + 1)\n ];\n }\n}", "function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}", "public function getSeparator();", "public function returnPaginationSerial(){\n\n return self::$oPaginator->return_pagination_serial();\n\n }", "function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'deinegeestblog-theme') . get_query_var('paged');\n\t }\n\t}", "function get_pager()\n\t{\n\t\tinclude_once('Pager/Pager.php');\n\t\t$pager_options = array();\n\t\t$pager_options['mode'] = 'Sliding';\n\t\t$pager_options['urlVar'] = 'page';\n\t\t$pager_options['delta'] = 2;\n\t\t$pager_options['perPage'] = (int) $this->rows_per_page;\n\t\t$pager_options['separator'] = '|';\n\t\t$pager_options['prev'] = '&laquo;';\n\t\t$pager_options['next'] = '&raquo;';\n\t\t$pager_options['append'] = false;\n\t\t$pager_options['fileName'] = $this->pager_file_name;\n\t\t\n\t\t$pager_options['totalItems'] = $this->totalItems;\n\t\t\n\t\t$currentPage = common::arg($this->pager_arg_no);\n\t\t//$this->content->debug .= ' currentPage: '.$currentPage .' argno: '.$this->pager_arg_no .' a:'.(int)common::arg(3);\n\t\tif (! isset($currentPage) || ! $currentPage) { $currentPage = 1; }\n\t\tif ($currentPage > ceil($this->totalItems/$this->rows_per_page)) { $currentPage = 1; }\n\t\t\n\t\t$pager_options['currentPage'] = $currentPage;\n\t\t\n\t\t$pager =& Pager::factory($pager_options);\n\t\treturn $pager->links;\n\t}", "public function pagination() {\n\t\tglobal $post, $page, $numpages, $multipage;\n\t\t$post = $this;\n\t\t$ret = array();\n\t\tif ( $multipage ) {\n\t\t\tfor ( $i = 1; $i <= $numpages; $i++ ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$data = array('name' => $i, 'title' => $i, 'text' => $i, 'link' => $link);\n\t\t\t\tif ( $i == $page ) {\n\t\t\t\t\t$data['current'] = true;\n\t\t\t\t}\n\t\t\t\t$ret['pages'][] = $data;\n\t\t\t}\n\t\t\t$i = $page - 1;\n\t\t\tif ( $i ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['prev'] = array('link' => $link);\n\t\t\t}\n\t\t\t$i = $page + 1;\n\t\t\tif ( $i <= $numpages ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['next'] = array('link' => $link);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function wp_get_list_item_separator()\n {\n }", "public static function links()\n\t{\n\t\t$all_pages = ceil(self::$total / self::$limit);\n\t\t$current_page = ceil(self::$offset / self::$limit);\n\n\t\t$string = '<nav class=\"paginator\"><ul>';\n\n\t\tif($current_page > 1)\n\t\t{\n\t\t\t$string .= '<li>' . self::link(\"Pr&eacute;c&eacute;dente\", ($current_page - 1) * self::$limit) . '</li>';\n\t\t}\n\n\t\t$from_page = max($current_page - 3, 0);\n\t\t$to_page = min($current_page + 3, $all_pages-1);\n\n\t\tfor($i = $from_page; $i < $to_page; $i++)\n\t\t{\n\t\t\t$string .= '<li ' . ($current_page == $i ? 'class=\"current\"' : '') . '>' . self::link($i + 1, $i * self::$limit) . '</li>';\n\t\t}\n\t\t\n\n\t\tif(($current_page + 1) !== $all_pages)\n\t\t{\n\t\t\t$string .=\"<li>...</li>\";\n\t\t\t$string .= '<li>' . self::link(round(self::$total/self::$limit)+1, round(self::$total/self::$limit)*self::$limit ) . '</li>';\n\t\t\t$string .= '<li>' . self::link(\"Suivante\", ($current_page + 1) * self::$limit) . '</li>';\n\t\t}\t\t\n\n\t\t//self::$url=preg_replace(\"/\\&offset=[0-9]*/\",\"\",self::$url);\n\t\t//$string .='<li><a href=\"' . self::$url . '?offset=' . round(self::$total/self::$limit)*self::$limit . '\"> Derni&egrave;re </a>';\n\t\t$string .= '</ul></nav>';\n\t\t//$string .= self::$total . \" \" .self::$offset . \" \" . self::$url . \" \" . self::$limit;\n\n\t\treturn $string;\n\t}", "public function get(): array\n\t{\n\t\t$roundedNumber = $this->count();\n\t\t$page = 1;\n\t\t\n\t\t$arrayPage = array();\n\t\t\n\t\tfor ($i = 0; $i < $roundedNumber; $i++) {\n\t\t\t$arrayPage[] = $page;\n\t\t\t$page++;\n\t\t}\n\t\treturn $arrayPage;\n\t}", "function getListaPags() {\n\t\t\t\n\t\t$arrPaginas = array();\n\t\t\t\n\t\t$inf = NULL;\n\t\t$sup = NULL;\n\t\t\t\n\t\t$tmp01 = floor($this->listap/2);\n\t\t\t\n\t\t// se o highlight estiver no meio da seleção\n\t\tif ($this->pagina - $tmp01 >= 1 && $this->pagina + $tmp01 <= $this->totalp){\n\t\t\t$inf = $this->pagina-$tmp01;\n\t\t\t$sup = $this->pagina+$tmp01;\n\t\t}\n\t\telse {\n\t\t\t// se estiver no lado esquerdo\n\t\t\tif ($this->pagina - $tmp01 < 1) {\n\t\t\t\t$inf = 1;\n\t\t\t\t$sup = ($this->totalp < $this->listap) ? $this->totalp : $this->listap ;\n\t\t\t}\n\t\t\t// se estiver no lado direito\n\t\t\telse if ($this->pagina + $tmp01 > $this->totalp) {\n\t\t\t\t$inf = ($this->totalp < $this->listap) ? 1 : $this->totalp-($this->listap-1) ;\n\t\t\t\t$sup = $this->totalp;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t\t\n\t\tfor ($x=$inf,$y=0;$x<=$sup;$x++,$y++) {\n\t\t\t$arrPaginas[$y] = $x;\n\t\t}\n\t\t\n\t\treturn $arrPaginas;\n\t\t\t\t\n\t\t// ALGORITMO LISTA DE PAGINAS - FIM\n\t}", "function getlist($pagecount,$page)\n{\n\t$echo = \"<select size=1 class='page_select' name=page onchange=javascript:location.href='\".getparam(\"page\",\"\").\"'+this.options[this.selectedIndex].value>\";\n\tfor($i=1;$i<=$pagecount;$i++)\n\t{\n\t\t$result = $pagecount/15;\n\t\tif($i>=$page-20 && $i<=$page+15){// ||\n\t\t\t$echo .= \"<option value=$i\".($page==$i ? ' selected' : '').\">\".$i.\"</option>\";\n\t\t}elseif($i%$result ==0 || $i==1 || $i==$pagecount){\n\t\t\t$echo .= \"<option value=$i>\".$i.\"</option>\";\n\t\t}\n\t}\n\t$echo.= \"</select>\";\n\treturn $echo;\n}", "function ubc_collab_loop_pagination( $pagination ) {\n\treturn str_replace( \"<li><span class='page-numbers current'\", \"<li class='active'><span class='page-numbers current'\", $pagination );\n\n}", "public function getBar()\n\t{\n\t\t$neighbours = 2;\n\n\t\t$page = $this->getPageNo();\n\n\t\t$next = $page + 1;\n\t\t$lastPage = $this->getPagesTotal();\n\t\t$lpm1 = $lastPage - 1;\n\n\t\t$bar = array();\n\t\t$counter = 0;\n\n\t\tif ($lastPage < 2)\n\t\t{\n\t\t\treturn $bar;\n\t\t}\n\n\t\t$bar[] = '<ul class=\"trackerPagination\">';\n\n\t\tif ($lastPage < 7 + ($neighbours * 2))\n\t\t{\n\t\t\tfor ($counter = 1; $counter <= $lastPage; $counter++)\n\t\t\t{\n\t\t\t\tif ($counter == $page)\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($lastPage > 5 + ($neighbours * 2))\n\t\t{\n\t\t\tif ($page < 1 + ($neighbours * 2))\n\t\t\t{\n\t\t\t\tfor ($counter = 1; $counter < 4 + ($neighbours * 2); $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telseif ($lastPage - ($neighbours * 2) > $page && $page > ($neighbours * 2))\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\n\t\t\t\tfor ($counter = $page - $neighbours; $counter <= $page + $neighbours; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\n\t\t\t\tfor ($counter = $lastPage - (2 + ($neighbours * 2)); $counter <= $lastPage; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($page < $counter - 1)\n\t\t{\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($next) . '\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\n\t\t$bar[] = '</ul>';\n\n\t\treturn implode(\"\\n\", $bar);\n\t}", "protected static function handle_pagination($content) { \n\n\t\tpreg_match('/{- BEGIN PAGINATION -}.*?{- END PAGINATION -}/s', $content, $pnation);\n\n\t\t$autolink = BlogPad::has_setting('auto_link');\n\n\t\t$p_processed = '';\n\n\t\tif( !empty($pnation[0]) ) {\n\n\t\t\t$txt = $pnation[0];\n\n\t\t\tif(preg_match('/{- BEGIN COUNTDOWN -}.*?{- END COUNTDOWN -}/s', $pnation[0], $cdown) ) {\n\t\t\t\t$_cdown = str_replace('{- BEGIN COUNTDOWN -}', '<div class=\"bp-countdown\"><?php $i = 1; while($i <= $paginate[\"last_page\"]): ?>', $txt);\n\n\t\t\t\t$_cdown = preg_replace('/(.*?){- number -}(.*)/', ($autolink ? '$1<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $i, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo $i;?></a>$2': '$1<?php echo $i;?>$2'), $_cdown);\n\n\t\t\t\t$_cdown = str_replace('{- END COUNTDOWN -}', '<?php $i++; endwhile; ?></div>', $_cdown);\n\n\t\t\t\t$txt = str_replace($pnation[0], $_cdown, $txt);\n\t\t\t}\n\n\t\t\t// Support the placement of custom text that will be used as a label, else display the relevant page numbers.\n\t\t\t$rplace = preg_replace('/(.*?){- previous:?([A-z0-9\\s]+)? -}(.*)/', '<?php if( !($pagenum - 1 <= 0) ): ?>$1'.($autolink ? '<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $pagenum - 1, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum - 1;?></a>': '<?php echo (trim(\"$2\" !== \"\")) ? \"$2\": $pagenum - 1;?>').'$3<?php endif;?>', $txt);\n\n\n\t\t\t$rplace = preg_replace('/(.*?){- next:?([A-z0-9\\s]+)? -}(.*)/', '<?php if($pagenum + 1 > 1 && $pagenum < $paginate[\"last_page\"]): ?>$1'.($autolink ? '<a href=\"<?php echo Link_Parser::generate_link(BlogPad::$template, array(\"num\" => $pagenum + 1, \"word\" => (isset($word)) ? $word: \"\"));?>\"><?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum + 1;?></a>': '<?php echo (trim(\"$2\") !== \"\") ? \"$2\": $pagenum + 1;?>').'$3<?php endif;?>', $rplace);\n\n\t\t\t$p_processed .= $rplace;\n\n\t\t\t$p_processed = str_replace('{- BEGIN PAGINATION -}', '<div class=\"bp-pagination\">', $p_processed);\n\t\t\t$p_processed = str_replace('{- END PAGINATION -}', '</div>', $p_processed);\n\n\t\t\t$content = str_replace($pnation[0], $p_processed, $content);\n\t\t}\n\n\t\treturn $content;\n\t}", "static function page_list($startpage, $config, $first2last=true)\n {\n global $bodyreader;\n if ($first2last) $continue = \"next\"; \n else $continue = \"previous\";\n $items = $bodyreader->parse_advance($startpage, $config, array($continue));\n $pages[] = $startpage; \n while (!empty($items[0][$continue]))\n {\n $link = static::match_url($startpage, $items[0][$continue]);\n $pages[] = $link;\n $items = $bodyreader->parse_advance($link, $config, array($continue));\n }\n \n return $pages;\n }", "abstract public function preparePagination();", "function get_pagenum_link($pagenum = 1, $escape = \\true)\n {\n }", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function paginate($perpage=50)\n\t{\n\t\tif($perpage == 0) return ''; // zero means unlimited\n\n\t\t$page = $this->page->param('p_p', 1);\n\t\t$perpage = $this->page->param('p_pp', $perpage);\n\t\t$offset = max(0,($page-1) * $perpage);\n \n\t\treturn \"$perpage OFFSET $offset\";\n\t}", "function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a>&nbsp;<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;\";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n echo \"<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;<a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a>&nbsp;\";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-$total]&nbsp;</nobr></em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a>&nbsp;\";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n }\n //echo \"<br><br>\";\n }", "public function getPageAndRootline() {}", "protected function createPageLinks()\n {\n $pageLinks = array();\n\n if ($this->totalPages > 10) {\n $startRange = $this->page - floor($this->range/2);\n $endRange = $this->page + floor($this->range/2);\n\n //Start range\n if ($startRange <= 0) {\n $startRange = 1;\n $endRange += abs($startRange) + 1;\n }\n\n // End range\n if ($endRange > $this->totalPages) {\n $startRange -= $endRange - $this->totalPages;\n $endRange = $this->totalPages;\n }\n\n // Range\n $range = range($startRange, $endRange);\n\n // Add first page\n $this->pageLinks[] = array(\n 'page' => 1,\n 'uri' => $this->createUri(1)\n );\n\n foreach ($range as $page) {\n // Skip for first and last page\n if ($page == 1 or $page == $this->totalPages) {\n continue;\n }\n\n $this->pageLinks[] = array(\n 'page' => $page,\n 'uri' => $this->createUri($page)\n );\n }\n\n // Add last page\n $this->pageLinks[] = array(\n 'page' => $this->totalPages,\n 'uri' => $this->createUri($this->totalPages)\n );\n } else {\n for ($i = 1; $i <= $this->totalPages; $i++) {\n $this->pageLinks[] = array(\n 'page' => $i,\n 'uri' => $this->createUri($i)\n );\n }\n }\n }", "function cpl_print_button_pages($numArticle, $buttonSelected){\r\n if($numArticle != 0) {\r\n echo '<section>',\r\n '<p>Pages : </p>';\r\n for ($i=0; $i < $numArticle/4; $i++) {\r\n if($i+1 == $buttonSelected) {\r\n echo '<a id=\"linkDown\">',$i+1,'</a>';\r\n } else {\r\n echo '<a href=\"actus.php?buttonPage=',cp_encrypt_url([$i+1]),'\">',$i+1,'</a>';\r\n }\r\n }\r\n echo '</section>';\r\n }\r\n }", "public function get()\n {\n $total_pages = ceil($this->total / $this->per_page);\n $begin = $this->page - $this->side_pages_n;\n $end = $this->page + $this->side_pages_n;\n $pagination = [];\n\n if ($begin <= 0) {\n $begin = 1;\n }\n\n for ($i = $begin; $i <= $end && $i <= $total_pages; $i++) {\n $pagination[] = $this->getNewPage($i);\n }\n\n if ($this->show_ends) {\n $this->addEnds($pagination);\n }\n\n return $pagination;\n }", "function page_func(){\n\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t<div class=\"tablenav\">\n\t\t\t\t\t\t<div class=\"tablenav-pages\">\n\t\t\t\t\t\t\t<span class=\"displaying-num\">\n\t\t\t\t\t\t\t\tDisplaying 1-20 of 69\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"page-number-current\">1</span>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">2</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">3</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">4</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">5</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">6</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t<?php \n\t\t\t}", "#[Pure] public function generatePagination(): string\n {\n return $this->dbc->generatePagination($this->pageSize, $this->pageNumber);\n }", "function smarty_function_pager($params, &$smarty) {\n $result = '';\n \n if (!isset($params['delta'])) {\n $params['delta'] = 3;\n }\n \n if ($params && $params['pages'] > 1) {\n $result = '<div class=\"dg_pager_container\">';\n \n if ($params['current'] > 1) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"1\">First</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] - 1).'\">Prev</a> ';\n }\n \n $pager_start = $params['current'] <= $params['delta'] ? 1 : $params['current'] - $params['delta'];\n $pager_stop = $params['current'] > $params['pages'] - $params['delta'] ? $params['pages'] : $params['current'] + $params['delta'];\n \n if ($params['current'] > $params['delta'] + 1) {\n /*for ($i = 1; $i <= $params['delta'] + 1; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n $result .= ' ... ';\n }\n \n for ($i = $pager_start; $i <= $pager_stop; ++$i) {\n if ($i == $params['current']) {\n $result .= ' <span>['.$i.']</span> ';\n } else {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }\n }\n \n if ($params['current'] < $params['pages'] - $params['delta']) {\n $result .= ' ... ';\n /*for ($i = $params['pages'] - $params['delta']; $i <= $params['pages']; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n }\n\n if ($params['current'] < $params['pages']) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] + 1).'\">Next</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$params['pages'].'\">Last</a> ';\n }\n \n $result .= '</div>';\n }\n \n return $result;\n}", "function pager_find_page($element = 0) {\n $page = isset($_GET['page']) ? $_GET['page'] : '';\n $page_array = explode(',', $page);\n if (!isset($page_array[$element])) {\n $page_array[$element] = 0;\n }\n return (int) $page_array[$element];\n}", "public function getItemsPerPage();", "public function getItemsPerPage();" ]
[ "0.82875407", "0.67474955", "0.62342", "0.6144174", "0.60108674", "0.5964183", "0.595724", "0.594568", "0.5809402", "0.5756099", "0.56740075", "0.55723804", "0.5505724", "0.5476217", "0.5471395", "0.54218286", "0.54218286", "0.54006463", "0.5388477", "0.53874815", "0.5366174", "0.5362139", "0.53613955", "0.5359467", "0.5347186", "0.5339466", "0.5325821", "0.53222054", "0.53222054", "0.53133273", "0.52908766", "0.527849", "0.52779865", "0.5274288", "0.5269072", "0.5230903", "0.52183384", "0.5215541", "0.52143097", "0.521247", "0.521247", "0.5210634", "0.5201294", "0.5196857", "0.51761687", "0.5167338", "0.5160169", "0.51599514", "0.51490206", "0.5141377", "0.5139605", "0.51350564", "0.51175004", "0.51117545", "0.5109232", "0.50976014", "0.5095671", "0.5086802", "0.5085483", "0.50840324", "0.50828123", "0.5081435", "0.5081333", "0.50791055", "0.5078949", "0.5073384", "0.50695795", "0.50608313", "0.5037552", "0.50367427", "0.50351065", "0.50278914", "0.5014595", "0.50133693", "0.5013299", "0.5004408", "0.49872845", "0.49794447", "0.49773782", "0.497382", "0.49688023", "0.49635178", "0.49627545", "0.49618435", "0.4960292", "0.49441144", "0.49390015", "0.49390015", "0.49363345", "0.49360573", "0.49356964", "0.4932125", "0.4926724", "0.49251243", "0.49216685", "0.4916407", "0.49097243", "0.49063376", "0.49030012", "0.49030012" ]
0.8161145
1
Displays a link to the previous page, where the page doesn't exist then display the $text
Показывает ссылку на предыдущую страницу, если страница не существует, отображает $text
function prevPage($text='prev') { if (empty($this->_pageDetails)) { return false; } if ( !empty($this->_pageDetails['previousPage']) ) { if($this->style == 'ajax') { //$t = $this->Ajax->linkToRemote($text, array("fallback"=>$this->action."#","url" => $this->link.$this->_pageDetails['previousPage'],"update" => "ajax_update","method"=>"get")); $t = $this->Ajax->link($text, $this->link.$this->_pageDetails['previousPage'],array("update" => "ajax_update","method"=>"get")); } else { $t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['previousPage'], false, false, false); } return $t; } //return '<span><strong>' . $text . '</strong></span>'; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function previous($text)\n\t{\n\t\treturn $this->backwards(__FUNCTION__, $text, $this->page - 1);\n\t}", "function PreviousUrl($id, $text)\n\t{\n\t\t$path = ARTICLE;\n\t\t$new_id = $id - 1;\n\t\t// if id=0 this is the first article, so don't show text\n\t\tif ($new_id == 0){\n\t\t\treturn \"\";\n\t\t// jump an article because this is deleted\n\t\t}else if (file_exists($path . $new_id) == false){\n\t\t\treturn PreviousUrl($new_id, $text);\n\t\t}else{\n\t\t\t$string = '<a href=\"' . ARTICLE_HOME . '?id=' . $new_id . '\">' . $text . '</a>';\n\t\t\treturn $string;\n\t\t}\n \t}", "public function prev(string $text = 'Previous', array $options = []): string\n {\n return $this->generateLink($text, 'prevPage', $options);\n }", "function link_to_previous_item_show($text = null, $props = array())\n{\n if (!$text) {\n $text = __('&larr; Previous Item');\n }\n $item = get_current_record('item');\n if ($previous = $item->previous()) {\n return link_to($previous, 'show', $text, $props);\n }\n}", "private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\">&lt;</a></li>';\n }\n }", "private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'&lsaquo;'\n\t\t);\n\t}", "function prevPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n\t\n\t$root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the prev button should be inactive\n\tif( $currentView == 'home' ) {\n\t\treturn false;\n\t}\n\t// If we're on the credits page, the prev button should point to the last article\n\telse if( $currentView == 'credits' ) {\n\t\treturn $root . getArrayLastIndex( $activePages );\n\t}\n\n\tif( empty(nextPrevArticleName('prev')) && $currentArticlePage == '1' ){\n\t\treturn $root;\n\t} elseif( $currentArticlePage == '1' ) {\n\t\treturn $root . nextPrevArticleName('prev') . '/' . $activePages[nextPrevArticleName('prev')]['numberOfPages'];\n\t} elseif($activePages[$currentArticle]['numberOfPages'] >= $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage-1);\n\t} else {\n\t\treturn $root . $currentArticle;\t\t\n\t}\n}", "public function getPrevious($text = null)\n {\n $text = \\Config::get('pagination::slider.prev_link_text', $text);\n $class = \\Config::get('pagination::align_simple') ? 'previous' : '';\n // If the current page is less than or equal to one, it means we can't go any\n // further back in the pages, so we will render a disabled previous button\n // when that is the case. Otherwise, we will give it an active \"status\".\n if ($this->currentPage <= 1) {\n $class = ltrim($class . ' ') . 'disabled';\n return '<li class=\"'.$class.'\"><span>'.$text.'</span></li>';\n } else {\n $url = $this->paginator->getUrl($this->currentPage - 1);\n return '<li class=\"'.$class.'\"><a href=\"'.$url.'\">'.$text.'</a></li>';\n }\n }", "public function getPreviousButton($text = '<i class=\"left arrow icon\"></i>')\n {\n // If the current page is less than or equal to one, it means we can't go any\n // further back in the pages, so we will render a disabled previous button\n // when that is the case. Otherwise, we will give it an active \"status\".\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledTextWrapper($text);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPageLinkWrapper($url, $text, 'prev');\n }", "public function genPrevLink()\n\t{\n\t\t$this->pagination['prevLink'] = \"\";\t\n\t\tif($this->page > 1)\n\t\t{\n\t\t\t$page = $this->page-1;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_prev',$this->prepend.$page.$this->append, '&lt;'),\n\t\t\t\t\t\t\t\t$item);\n\t\t\t$this->pagination['prevLink'] = $item;\n\t\t}\n\t}", "public function prev_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() - 1);\n\t}", "public function previousAction()\n {\n $this->pageAction('goToPreviousPage');\n }", "public static function previous()\n {\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n exit;\n }", "public function getPreviousPage();", "function adr_previous( $lang_key , $direct , $nav='' )\n{\n\tglobal $lang , $phpEx ;\n\n\t$lang_key = $lang[$lang_key];\n\t$temp = ( !$nav ) ? $direct.'.'.$phpEx : $direct.'.'.$phpEx.'?'.$nav;\n\t$direction = append_sid(\"$temp\");\n\n\t$message = $lang_key .'<br /><br />'.sprintf($lang['Adr_return'],\"<a href=\\\"\" . $direction . \"\\\">\", \"</a>\") ;\n\tmessage_die( GENERAL_MESSAGE,$message);\n}", "function previousPage()\n\t\t{\n\t\t\tif(!$this->hasPrevious())\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\t\n\t\t\t$this->currentPage--;\n\t\t}", "public function getPrevText()\n {\n return _t(__CLASS__ . '.PREVIOUS', 'Previous');\n }", "abstract protected function setPreviousPage();", "public function PrevPage()\n {\n if ($this->m_CurrentPage <= 1)\n $this->m_CurrentPage = 1;\n else \n $this->m_CurrentPage--;\n return $this->ReRender();\n }", "public function previousPage()\n {\n return$this->currentPage - 1;\n }", "public function getPreviousPageUrl();", "public function getPreviousPageUrl();", "function prevPage() {\n\t\treturn $this->hasPrevPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "public function hasPreviousPage();", "public function loadPreviousPage()\n {\n $prevPage = $this->results->getPreviousPage();\n $this->search($prevPage);\n }", "public function previousPage()\n\t{\n\t\treturn $this->getIsPreviousPageAvailable() ? parent::previousPage() : false;\n\t}", "public function previousPageUrl()\n {\n $this->resetQuery();\n\n if ($this->currentPage() > 2) {\n $this->appends('end', session()->get('accountant.api.end'));\n }\n\n return parent::previousPageUrl();\n }", "function goback(){\n if(is_null($_SESSION[\"LAST\"])){\n return null;\n } else{\n $ret = '<p><a href=\"../'.$_SESSION[\"LAST\"].'\">Return to whence you came</a></p>';\n }\n return $ret;\n}", "public function previous_page(){\n if($this->current_page > 1){\n return $this->current_page - 1;\n }\n else{\n return NULL;\n }\n }", "static function page_previous($startpage, $config)\n {\n return static::page_link($startpage, $config, \"previous\");\n }", "public function previous($linkFormat = '<p class=\"previous\"><a href=\"%s\">previous</a></li>', $if_null = '') {\n\t\t$page = $this->_rowset->getPreviousPage();\n\t\tif (is_null($page)) {\n\t\t\treturn $if_null;\n\t\t} else {\n\t\t\t$url = $this->_view->url(array('page' => $page));\n\t\t\t$html = sprintf($linkFormat, $url, $page);\n\t\t\treturn $html;\n\t\t}\n\t}", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }", "function previous_post_link($format = '&laquo; %link', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }", "public function previousPageUrl()\n {\n $previousPage = $this->structure->getPreviousPage($this->currentPage);\n if ($previousPage) {\n return $this->structure->getUrl($this->currentPage, $previousPage);\n }\n\n return;\n }", "protected function previousStep()\r\n {\r\n $index = array_search($this->_currentStep, array_values($this->_steps)) - 1;\r\n $this->redirect(array_values($this->_steps)[($index > 0 ? $index : 0)]);\r\n }", "public static function prevpage(){\n\t\t// Make sure that user is not redirected back to Login, Register, ForgotPassword, etc.\n\t\t// List of Pages that user should never get redirected to when logged in\n\t\t$no_redir_pages = array(\"login\", \"register\", \"logout\", \"forgot-password\", \"resend-activation-email\", \"reset-password\", \"activate\",\n\t\t\t\t\t\t\t\t\"Login\", \"Register\", \"Logout\", \"Forgot-Password\", \"Resend-Activation-Email\", \"Reset-Password\", \"Activate\",\n\t\t\t\t\t\t\t\t\"Templates\", \"assets\");\n\t\t// Get Current Page so we have something to compair to\n\t\t$cur_page = $_SERVER['REQUEST_URI'];\n\t\t//Remove the extra forward slash from link\n\t\t$cur_page_a = ltrim($cur_page, DIR);\n\t\t// Get first part of the url (page name)\n\t\t$cur_page_b = explode('/', $cur_page_a);\n\t\t//Add current page to lang change session for redirect\n\t\t$_SESSION['lang_prev_page'] = $cur_page_a;\n\t\t// Check to see if we should log as a previous page\n\t\tif(strpos ($cur_page,\".\" ) === FALSE){\n\t\t\tif(!in_array($cur_page_b[0], $no_redir_pages)){\n\t\t\t\t$_SESSION['login_prev_page'] = $cur_page_a;\n\t\t\t}\n\t\t}\n\t}", "public function PrevLink()\n {\n if ($this->NotFirstPage()) {\n return HTTP::setGetVar(\n $this->getPaginationGetVar(),\n $this->getPageStart() - $this->getPageLength(),\n ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null\n );\n }\n }", "function get_previous_posts_page_link()\n {\n }", "public function has_previous_page()\n {\n }", "protected function _processPrevious()\n\t{\n\t\t$step = (int) $this->Session->read('Wizard.step');\n\t\t\n\t\tif( ! empty($step)){\n\t\t\t$step--;\n\t\t\t$this->_write($step);\n\t\t\t\n\t\t\t$this->redirect();\n\t\t}\t\t\n\t}", "function renderPrev($tag = '&lt;&lt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}", "public static function previous_post_link () : void\n {\n add_filter(\"previous_post_link\", function ($output) {\n $previousPost = get_adjacent_post();\n \n if ($previousPost !== '') {\n $previousPostTitle = strlen(get_the_title($previousPost)) > 30 ? substr(get_the_title($previousPost), 0, 30) . \"...\" : get_the_title($previousPost);\n\n $output = '<div class=\"thumb\">';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\">' . get_the_post_thumbnail($previousPost, \"pagination_between_post\", [\"class\" => \"img-fluid\"]) . '</a>';\n $output .= '</div>';\n \n $output .= '<div class=\"arrow\">';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\"><span class=\"lnr text-white ti-arrow-left\"></span></a>';\n $output .= '</div>';\n \n $output .= '<div class=\"detials\">';\n $output .= '<p>' . __(\"Prev Post\", \"dingo\") . '</p>';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\"><h4>' . $previousPostTitle . '</h4></a>';\n $output .= '</div>';\n } else {\n $output = '';\n }\n \n return $output;\n });\n }", "public function prevpage() {\n return $this->current_page - 1;\n }", "function fc_pagination_prevpage($paged, $max_page, $prevpage) {\n if( $max_page > 1 && $paged > 1 )\n $pagingString = '<li class=\"prev\"><a href=\"'.get_pagenum_link($paged-1). '\">'.$prevpage.'</a></li>';\n return $pagingString;\n}", "function previous_post($format = '%', $previous = 'previous post: ', $title = 'yes', $in_same_cat = 'no', $limitprev = 1, $excluded_categories = '')\n {\n }", "private function prevLink()\n {\n $y = $this->year;\n $d = intval($this->day);\n $d = $d < 10 ? '0' . $d : $d;\n $m = intval($this->month);\n $m = $m < 10 ? '0' . $m : $m;\n\n $time = $y . '-' . $m . '-' . $d;\n\n if ($this->view == \"week\") {\n $time = strtotime('last sunday', strtotime($time . ' +1 day'));\n $time = date('Y-m-d', $time);\n $time = date('Y-m-d', strtotime($time . ' -1 week'));\n } elseif ($this->view == \"day\") {\n $time = date('Y-m-d', strtotime($time . '-1day'));\n } else {\n $time = date('Y-m', strtotime($y . '-' . $m . '-01 -1month'));\n }\n $url = $this->basePath . '?cdate=' . $time;\n return $url . $this->getOldGET();\n }", "public function previousPage() {\r\n\t\t$intReturn = ($this->getCurrentPage() - 1 > 0) ? ($this->getCurrentPage() - 1) : 1;\r\n\r\n\t\treturn $intReturn;\r\n\t}", "public function testGetPreviousPage()\n {\n $this->assertContains(\n 'subfolder/subsubfolder/subsubpage',\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '/tests/docs/en/test.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )->Link\n );\n\n // does not leak between entities\n $this->assertNull(\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '/tests/docs/en/index.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )\n );\n\n // does not leak between entities\n $this->assertNull(\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '\t/tests/docs/en/index.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )\n );\n }", "function thb_single_prev_custom_pagination() {\n\t\t$post = get_previous_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-previous-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Previous post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "function previous_posts_link($label = \\null)\n {\n }", "public function previousPageTitle()\n {\n $page = $this->structure->getPreviousPage($this->currentPage);\n\n return $page ? $this->pageGuide->getTitle($page) : null;\n }", "function smarty_function_page_back($params, &$smarty)\n{\n\t$message_2196 = $smarty->get_template_vars(message_2196);\n\treturn '<a id=\"linkbacktop_back\" href=\"javascript:history.go(-1)\" title=\"' . $message_2196 . '\">' . $message_2196 . '</a>';\n}", "function go_back_button()\n{\n\techo'<p style=\"float: left; width:300px; font-size: 10px; line-height: 25px;\"><a class=\"button\" style=\"font-size: 10px; margin-bottom: 10px;\" href=\"http://drnonprofit.com/coaching/\">Continue Shopping</a>\n\t<br />\n\tOnly one subscription needs to be purchased at a time, additional purchases may be made after this one is completed</p>';\n}", "function return_to_previous_url()\n{\n\tif(empty($_SERVER[\"HTTP_REFERER\"]) || basename($_SERVER[\"HTTP_REFERER\"])==\"user.php\")\n\t\t// go back to main page\n\t\t$redirect_uri = current_page_folder_url();\n\telse\n\t\t$redirect_uri = $_SERVER[\"HTTP_REFERER\"];\n\n\theader(\"Location: \" . $redirect_uri);\n}", "protected function getPreviousUrl()\n {\n $slug = array_last($this->memory->getPageHistory());\n\n if (null === $slug || false === $slug) {\n return null;\n }\n\n if ($slug === WikiMemory::INDEX_SLUG) {\n return cms_route('wiki.page.index');\n }\n\n return cms_route('wiki.page', [ $slug ]);\n }", "static private function historyback()\n {\n echo '<script>window.history.back();</script>';\n }", "public function getUrlPrevious($option){\n\t\tif (strpos(URL::previous(),'search_value=')!==false){\n\t\t\t$UrlPrevious= $option .'/search?' . strstr(URL::previous(), 'search_value=');\n\t\t}else{\n\t\t\tif (strpos(Session::get('UrlPrevious'),'page=')!==false){\n\t\t\t\t$UrlPrevious= $option .'?' . strstr(Session::get('UrlPrevious'), 'page=');\n\t\t\t}else{\n\t\t\t\tif (strpos(URL::previous(),'page=')!==false){\n\t\t\t\t\t$UrlPrevious= $option .'?' . strstr(URL::previous(), 'page=');\n\t\t\t\t}else{\n\t\t\t\t\t$UrlPrevious= $option .'/';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//store in the session object the previous URL\n\t\tSession::put('UrlPrevious',$UrlPrevious);\n\t\t\n\t}", "public function gridSetPagesUrlPrev($url = ''){\n if(!empty($url)){\n $this->setVar('PAGES_URL_PREV', $url);\n $this->setVar('PREV_PAGE_TAG', __('Previuos page'));\n }\n }", "public function previousEnabled(int $page): string;", "function link_with_disabled_back_button($url, $linktext){\n print \"<a href=\\\"$url\\\"\";\n print \"ONCLICK=\\\"location.replace(this.href);return false;\\\">\";\n print $linktext . \"</a>\";\n}", "public function getPreviousUrl() {\r\n\t\treturn $this->Session->read('history.current');\r\n\t}", "private function createPrevPageLink($activePage)\n {\n # initialise variables\n $prevPage=1;\n $linkText=null;\n $startRecord=0;\n\n $prevPage=--$activePage;\n\n # There is no page 0 so need to disable in that case\n if(0==$prevPage)\n {\n $linkText=' <li class=\"disabled\"><a href=\"#\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li>';\n }\n else\n {\n $linkText = '<li><a href=\"';\n $linkText .= $this->url;\n $linkText .= '?searchParam='.$this->searchParam;\n $linkText .= '&amp;selectCounty='.$this->selectCounty;\n $linkText .= '&amp;startRecord='.$this->startRecordArr[$prevPage];\n $linkText .= '&amp;recordsPerPage='.$this->recordsPerPage;\n $linkText .= '&amp;pageNum='.$prevPage.'\"';\n $linkText .= 'aria-label=\"Previous\">';\n $linkText .= '<span aria-hidden=\"true\">&laquo;</span>';\n $linkText .= '<span class=\"sr-only\">'.$prevPage.'</span>';\n $linkText .= '</a></li> ';\n }\n return $linkText;\n }", "function hasPrevPage() {\n\t\treturn $this->hasPage($this->p - 1);\n\t}", "function get_previous_image_link($size = 'thumbnail', $text = \\false)\n {\n }", "public function previous(): static\n {\n $link = Arr::get($this->links, 'prev');\n\n throw_unless($link, NoPreviousPageException::class);\n\n return $this->getResults($link);\n }", "public function previousLink($label = '&lt;', $itemClass = 'page-item', $linkClass = 'page-link')\n {\n $html = '<li class=\"' . $itemClass . '\">';\n $html.= '<a class=\"' . $linkClass . '\" href=\"';\n $html.= $this->url . $this->previousPage . '\"';\n $html.= ($this->currentPage == 1) ? ' style=\"cursor:default;\"' : '';\n $html.= '>';\n $html.= $label;\n $html.= '</a>'; \n $html.= '</li>';\n \n return $html;\n }", "function previous_comic_link($format, $link) {\n\tglobal $non_comic_categories;\n\tprevious_post_link($format, $link, false, $non_comic_categories);\n}", "public function hasPreviousPage() {\n return 1 < $this->page_;\n }", "protected function getPreviousButton()\n {\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledLink($this->previousButtonText);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');\n }", "public function back();", "function previous_image_link($size = 'thumbnail', $text = \\false)\n {\n }", "public function getPreviousPageNumber(): int;", "function back() {\n if (!empty($_SERVER['HTTP_REFERER'])) {\n header('location: ' . $_SERVER['HTTP_REFERER']);\n exit;\n }\n}", "public function getPreviousPageUrl()\n {\n return $this->previousPageUrl;\n }", "public function hasPrevious()\n {\n return $this->curPage > 1;\n }", "function get_previous_post_link($format = '&laquo; %link', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }", "public function previousPage($meta)\n {\n $response = $this->http_client->request('GET', $this->addAuthToUri($meta->previous_page_link), [\n 'headers' => [\n 'Accept' => 'application/json',\n ],\n ]);\n\n return $this->handleResponse($response);\n }", "function hasPrevious()\n\t\t{\n\t\t\tif($this->currentPage > 1)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "static public function getPrevPage() {\n\t\treturn self::$prev_page;\n\t}", "public function getPreviousPage() {\n\t\tif (($this->currentPage - 1) <= 0) {\n\t\t\t$this->currentPage = $this->countPages();\n\t\t\treturn $this->currentPage;\n\t\t} else {\n\t\t\treturn --$this->currentPage;\n\t\t}\n\t}", "public function getBackUrl()\n {\n $url = $this->helperWizard()->getPreviousPageUrlAsString();\n return $this->getUrl($url, array('_current' => true));\n }", "function nextPage($text='next')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif (!empty($this->_pageDetails['nextPage']))\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['nextPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['nextPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['nextPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}", "function get_previous_posts_link($label = \\null)\n {\n }", "function pb_single_next_prev() {\n\t// Only show on single post pages (not plants)\n\tif( !is_singular('post') ) {\n\t\treturn;\n\t}\n\n\t$previouspost_text = __( 'Older Posts', 'lean-kickstart' );\n\t$nextpost_text = __( 'Newer Posts', 'lean-kickstart' );\n\n\techo '<div class=\"archive-pagination pagination\">';\n\t\tprevious_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n\t\tnext_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n\techo '</div>';\n}", "function themes_button_back($url) {\n\tglobal $apps_path;\n\tif (function_exists('bindtextdomain')) {\n\t\tbindtextdomain('messages', $apps_path['plug'].'/language/');\n\t\tbind_textdomain_codeset('messages', 'UTF-8');\n\t\ttextdomain('messages');\n\t}\n\n\t$content = themes_button($url, _('Back'), 'button_back');\n\treturn $content;\n}", "public static function previousCommentsLink($post, $label = 'load previous comments')\n {\n // check param type\n // we do this here to support manual template data overrides, such as providing an array of values\n if (!is_object($post) || 'Timber\\Post' !== get_class($post)) {\n return false;\n }\n\n $nextPageNumber = (get_query_var('cpage', 1) - 1);\n if (0 >= $nextPageNumber) {\n return false;\n }\n return '<a href=\"' .\n $post->link() . (strpos($post->link(), '?') === false ? '?' : '&') . 'cpage=' . $nextPageNumber\n . '\">' . $label . '</a>';\n }", "public function getPreviousPage()\n\t{\n\t\treturn $this->previousPage;\n\t}", "function previous_comments_link($label = '')\n {\n }", "public function getPrevPage(){\r\n\t\t$page=$this->_vars['current_page'];\r\n\t\tif($page>$this->_vars['total_pages']+1) return false;\r\n\t\treturn $page>1?$page-1:false;\r\n\t}", "function back_link($width)\n\t{\n\t\tif(empty($_POST))\n\t\t\t$_SESSION['back_page'] = $_SERVER['HTTP_REFERER'];\n\t\t\t\n\t\t\techo '<table width=\"'.$width.'\" border=\"0\" align=\"center\"><tr><td align=\"right\" valign=\"middle\"><a href=\"'.$_SESSION['back_page'].'\" title=\"'.BACK_ICON_ALT.'\"><img border=\"0\" align=\"absmiddle\" src=\"'.BACK_ICON.'\" title=\"'.BACK_ICON_ALT.'\" alt=\"'.BACK_ICON_ALT.'\">Back</a></td></tr></table>';\n\t}", "function tyler_previous_post_link_plus( $args = '' ) {\n\t\n\treturn tyler_adjacent_post_link_plus( $args, '&laquo; %link', true );\n}", "private function previous()\n {\n $this->m--;\n $this->init();\n }", "function be_make_prev_next( $output, $id, $size, $permalink, $icon, $text ) {\n\tif( '&laquo; Previous Photo' == $text )\n\t\t$output = '<span class=\"prev\">' . $output . '</span>';\n\t\n\tif( 'Next Photo &raquo;' == $text )\n\t\t$output = '<span class=\"next\">' . $output . '</span>';\n\t\t\n\treturn $output;\n}", "protected function renderBackButton() {}", "public function has_previous_page() {\n\t\t\treturn $this->page > 1;\n\t\t}", "public function hasPrevPage() {\n return $this->getCurPage() > self::FIRST_PAGE;\n }", "public function has_prev()\n\t{\n\t\treturn $this->get_cur_page() > 1;\n\t}", "public function redirectBack()\n {\n $httpReferer = $this->referer();\n $previousRoute = \\explode(\"?\", $httpReferer)[0];\n\n $this->redirect($previousRoute);\n }", "function get_previous_page(){\n\t\t$query = \"SELECT * FROM \" . Database::$table . \" ORDER BY timestamp DESC LIMIT 1\";\n\t\treturn Database::get_all_results($query);\n\t}", "private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }" ]
[ "0.7728658", "0.761609", "0.7378077", "0.7298928", "0.72882986", "0.7176808", "0.7164734", "0.71109456", "0.70618325", "0.70093465", "0.700824", "0.691703", "0.6864042", "0.6854228", "0.67319095", "0.67174816", "0.67074054", "0.6676611", "0.6676403", "0.66725117", "0.6671372", "0.6671372", "0.6643687", "0.6608987", "0.6607062", "0.6590164", "0.65679824", "0.6565796", "0.6549766", "0.6535808", "0.64992064", "0.64739895", "0.6466939", "0.6465464", "0.6456715", "0.64538115", "0.6433335", "0.64175326", "0.64173394", "0.6381613", "0.6374825", "0.6365704", "0.63629097", "0.62843394", "0.6237695", "0.62341243", "0.6220055", "0.621582", "0.6211892", "0.618964", "0.6183932", "0.6151289", "0.6146805", "0.61433333", "0.61411935", "0.6135094", "0.6132824", "0.611393", "0.61030793", "0.61028844", "0.6028113", "0.601148", "0.60068667", "0.5998365", "0.59958535", "0.5989333", "0.59893227", "0.5978265", "0.5950073", "0.5941547", "0.593869", "0.59148836", "0.5908948", "0.5902174", "0.58939904", "0.58562136", "0.5837236", "0.58367276", "0.58335096", "0.5831667", "0.5831226", "0.58284754", "0.58197314", "0.581569", "0.5811627", "0.58055556", "0.5783026", "0.57826084", "0.57756287", "0.57706404", "0.57550997", "0.5754745", "0.5750849", "0.57473314", "0.5740694", "0.57267886", "0.57188386", "0.5711599", "0.5711043", "0.5701185" ]
0.8316928
0
Displays a link to the next page, where the page doesn't exist then display the $text
Показывает ссылку на следующую страницу, если страница не существует, то отображает $text
function nextPage($text='next') { if (empty($this->_pageDetails)) { return false; } if (!empty($this->_pageDetails['nextPage'])) { if($this->style == 'ajax') { //$t = $this->Ajax->linkToRemote($text, array("fallback"=>$this->action."#","url" => $this->link.$this->_pageDetails['nextPage'],"update" => "ajax_update","method"=>"get")); $t = $this->Ajax->link($text, $this->link.$this->_pageDetails['nextPage'],array("update" => "ajax_update","method"=>"get")); } else { $t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['nextPage'], false, false, false); } return $t; } //return '<span><strong>' . $text . '</strong></span>'; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">&gt;</a></li>';\n }\n }", "public function next(string $text = 'Next', array $options = []): string\n {\n return $this->generateLink($text, 'nextPage', $options);\n }", "protected function next($text)\n\t{\n\t\treturn $this->forwards(__FUNCTION__, $text, $this->page + 1);\n\t}", "function NextUrl($id, $text)\n\t{\n\t\t$path = ARTICLE;\n\t\t$new_id = $id + 1;\n\t\t$last = LastArticle('parameters/last_article_id');\n\t\tif ($new_id > (int)$last)\n\t\t{\n\t\t\treturn \"\";\t\n\t\t// jump an article because this is deleted\n\t\t}else if (file_exists($path . $new_id) == false){\n\t\t\treturn NextUrl($new_id, $text);\t\n\t\t}else{\n\t\t\t$string = '<a href=\"' . ARTICLE_HOME . '?id=' . $new_id . '\">' . $text . '</a>';\n\t\t\treturn $string;\n\t\t}\n \t}", "function link_to_next_item_show($text = null, $props = array())\n{\n if (!$text) {\n $text = __(\"Next Item &rarr;\");\n }\n $item = get_current_record('item');\n if ($next = $item->next()) {\n return link_to($next, 'show', $text, $props);\n }\n}", "private function print_next_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( min( $this->total_pages, $this->current_page + 1 ) ),\n\t\t\t__( 'Go to the next page', 'multilingual-press' ),\n\t\t\t'next-page' . $this->disable_last,\n\t\t\t'&rsaquo;'\n\t\t);\n\t}", "function nextPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n $root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the next button should point to the first article\n\tif( $currentView == 'home' ) {\n\t\treturn $root . getArrayFirstIndex( $activePages );\n\t}\n\t// If we're on the credits page, the next button should be inactive\n\telse if( $currentView == 'credits' ) {\n\t\treturn false;\n\t}\n\t// If we're on the last page, send to credits\n\telse if( $currentArticle == 'theend' ) {\n\t\treturn $root . 'credits';\n\t}\n\t// If we're on a regular article page get the next one\n\tif($activePages[$currentArticle]['numberOfPages'] == $currentArticlePage) {\n\t\tif( !$activePages[nextPrevArticleName('next')]['active'] ) return $root . 'theend';\n\t\treturn $root . nextPrevArticleName('next');\n\t} elseif($activePages[$currentArticle]['numberOfPages'] > $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage+1);\n\t}\n}", "public function genNextLink()\n\t{\n\t\t$this->pagination['nextLink'] = \"\";\t\n\t\tif($this->page < $this->numofpages)\n\t\t{\n\t\t\t$page = $this->page+1;\t\t\t\t\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_next',$this->prepend.$page.$this->append, '&gt;'),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\t\t\n\t\t\t$this->pagination['nextLink'] = $item;\n\t\t}\n\t}", "public function getNextPage();", "function nextPage() {\n\t\treturn $this->hasNextPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "function prevPage($text='prev')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif ( !empty($this->_pageDetails['previousPage']) )\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['previousPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['previousPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['previousPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}", "public function getNextText()\n {\n return _t(__CLASS__ . '.NEXT', 'Next');\n }", "public function advanceLabelPage ()\r\n {\r\n $return = '';\r\n $this->label_column = 1;\r\n $this->label_row =1;\r\n ++$this->label_page;\r\n $return .= '\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n return $return;\r\n }", "public function getNextButton($text = '<i class=\"right arrow icon\"></i>')\n {\n // If the current page is greater than or equal to the last page, it means we\n // can't go any further into the pages, as we're already on this last page\n // that is available, so we will make it the \"next\" link style disabled.\n if (! $this->paginator->hasMorePages()) {\n return $this->getDisabledTextWrapper($text);\n }\n\n $url = $this->paginator->url($this->paginator->currentPage() + 1);\n\n return $this->getPageLinkWrapper($url, $text, 'next');\n }", "public function next_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() + 1);\n\t}", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "public function pageWithText($page, $text)\n {\n return '';\n }", "function renderNext($tag = '&gt;&gt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}", "public function nextAction()\n {\n $this->pageAction('goToNextPage');\n }", "public function getNext($text = null)\n {\n $text = \\Config::get('pagination::slider.next_link_text', $text);\n $class = \\Config::get('pagination::align_simple') ? 'next' : '';\n // If the current page is greater than or equal to the last page, it means we\n // can't go any further into the pages, as we're already on this last page\n // that is available, so we will make it the \"next\" link style disabled.\n if ($this->currentPage >= $this->lastPage) {\n $class = ltrim($class . ' ') . 'disabled';\n return '<li class=\"'.$class.'\"><span>'.$text.'</span></li>';\n } else {\n $url = $this->paginator->getUrl($this->currentPage + 1);\n return '<li class=\"'.$class.'\"><a href=\"'.$url.'\">'.$text.'</a></li>';\n }\n }", "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "function PreviousUrl($id, $text)\n\t{\n\t\t$path = ARTICLE;\n\t\t$new_id = $id - 1;\n\t\t// if id=0 this is the first article, so don't show text\n\t\tif ($new_id == 0){\n\t\t\treturn \"\";\n\t\t// jump an article because this is deleted\n\t\t}else if (file_exists($path . $new_id) == false){\n\t\t\treturn PreviousUrl($new_id, $text);\n\t\t}else{\n\t\t\t$string = '<a href=\"' . ARTICLE_HOME . '?id=' . $new_id . '\">' . $text . '</a>';\n\t\t\treturn $string;\n\t\t}\n \t}", "public function nextPage($width,$lang,$nextcell,$headertext,$headeralign) {\n\n\t// include text translations\n\tinclude('fixed.php');\n\tinclude('data.php'); // Load Testing Data\n\n\t// Check Amount of Space Left on Page\n\tif ($this->GetY() + $nextcell > 276)\n\t\t{\n\n\t\t// Write Continued on Next Page\n \t$this->SetX(12);\n\t\t$this->MultiCell(array_sum($width), 0, $formatting[$lang]['next_page'], 'T', 'L', 0, 0, '', '', true);\n\n\t\t// Create New Page\n\t\t$this->AddPage('P','A4');\n\t\t$this->Ln(1.2);\n\t\n\t\t// Add Header if Necessary\n\t\tif (isset($headertext)) {\n\t\n\t\t\t$this->TableHeader($headertext, $headeralign, $width, 12);\n\n\t\t}\n\t}\n\n\treturn;\n\n}", "function _next($type,$title,$id,$more=''){\r\n // title : cot ten\r\n // id : id hien tai cua bai viet\r\n // more : dieu kien mo rong\r\n global $mysql,$table_prefix,$lang;\r\n $total = $mysql->num_rows($mysql->query('select * from '.$table_prefix.$type.' where id>'.$id.' '.$more.''));\r\n if(!$total){\r\n $code = '...';\r\n }else{\r\n $q = $mysql->query('select * from '.$table_prefix.$type.' where id>'.$id.' '.$more.' order by id ASC limit 0,1');\r\n while($r=$mysql->fetch_array($q)){\r\n $code = \"<a href='javascript: void(0);' onclick=\\\"viewpages('main','\".$type.\"=view&id=\".$r['id'].\"');web_title('\".$type.\" - \".$r['title'].\"');\\\" title='\".$r[$title].\"'>\".cut_str($r[$title],25).\"</a>\";\r\n }\r\n }\r\nreturn $code;\r\n}", "public function loadNextPage()\n {\n $nextPage = $this->results->getNextPage();\n $this->search($nextPage);\n }", "public function getNextPageUrl();", "public function getNextPageUrl();", "public function pageWithText(int $page, string $text, ?string $rel = null): string;", "function page_advance( $link, $total, $range, $current, $html = array() ) {\r\n $range = max(1, ceil($range));\r\n $total_page = ceil($total / $range);\r\n $current = max(0, ceil($current));\r\n $bar = \"\";\r\n\r\n $title = str_replace(array(\"{link}\", \"{from}\", \"{to}\", \"{total}\"), array($link, min(($current - 1) * $range + 1, $total), min($current * $range, $total), $total), $html['title']);\r\n\r\n if ( $current >= 3 ) {\r\n $bar .= str_replace(\"{link}\", $html['first']);\r\n }\r\n\r\n if ( $current >= 2 ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current - 1), $html['pre']);\r\n }\r\n\r\n $bar .= $title;\r\n\r\n if ( $current <= $total_page - 2 ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current + 1), $html['last']);\r\n }\r\n\r\n if ( $current < $total_page ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current + 1), $html['next']);\r\n }\r\n\r\n return $bar;\r\n\r\n}", "function next_posts_link($label = \\null, $max_page = 0)\n {\n }", "public function NextLink()\n {\n if ($this->NotLastPage()) {\n return HTTP::setGetVar(\n $this->getPaginationGetVar(),\n $this->getPageStart() + $this->getPageLength(),\n ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null\n );\n }\n }", "public function nextPageUrl()\n {\n $this->resetQuery();\n\n if ($this->items->count() == $this->perPage()) {\n $this->appends('start', session()->get('accountant.api.start'));\n\n return $this->url($this->currentPage() + 1);\n }\n }", "public function nextPage()\n\t{\n\t\treturn $this->getIsNextPageAvailable() ? parent::nextPage() : false;\n\t}", "public function nextpage() {\n return $this->current_page + 1;\n }", "public function nextAction()\n {\n // check if request is ajax\n if (Helper::isAjaxRequest()) {\n // get request\n $code = Helper::requestGet('code', null);\n $userName = Helper::requestGet('userName', null);\n\n // get next url string\n $url = $this->getMediaNextUrlByCode($code);\n\n if ($url) {\n // do request for content\n $media = file_get_contents($url);\n\n // decode json\n $media = json_decode($media);\n\n // check for error\n $this->hasError($media);\n\n // check if json valid and response success\n if (!json_last_error() && $media->meta->code == self::SUCCESS_RESPONSE && !empty($media->data)) {\n $hasNextUrl = false;\n\n if (isset($media->pagination->next_url)) {\n $hasNextUrl = true;\n\n // set next pagination url\n $this->setMediaNextUrlByCode($code, $media->pagination->next_url);\n }\n\n // options for view rendering\n $options = [\n 'c' => Config::get('defaultController'),\n 'a_next' => 'next',\n 'code' => $code,\n 'userName' => $userName,\n 'hasNextUrl' => $hasNextUrl,\n ];\n\n // rendering view without layout\n Helper::renderStatic('main/_viewMediaMore', compact('media', 'options'), false);\n exit;\n }\n }\n }\n }", "public function testGetNextPage()\n {\n // most directory\n $this->assertStringEndsWith(\n '2.3/test/',\n $this->manifest->getNextPage(\n DOCSVIEWER_PATH . '/tests/docs/en/subfolder/subsubfolder/subsubpage.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )->Link\n );\n\n // after sorting, 2 is shown.\n $this->assertContains(\n '/intermediate/',\n $this->manifest->getNextPage(\n DOCSVIEWER_PATH . '/tests/docs/en/sort/01-basic.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )->Link\n );\n\n\n // next gets the following URL\n $this->assertContains(\n '/test/',\n $this->manifest->getNextPage(\n DOCSVIEWER_PATH . '/tests/docs-v2.4/en/index.md',\n DOCSVIEWER_PATH . '/tests/docs-v2.4/en/'\n )->Link\n );\n\n\n // last folder in a entity does not leak\n $this->assertNull(\n $this->manifest->getNextPage(\n DOCSVIEWER_PATH . '/tests/docs/en/test.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )\n );\n }", "public function skip_link() {\n\t\techo '<a class=\"skip-link screen-reader-text\" href=\"#site-content\">' . __( 'Skip to the content', 'wilbur' ) . '</a>';\n\t}", "function link_pages($before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page', $pagelink = '%', $more_file = '')\n {\n }", "public function nextPageUrl()\n {\n $nextPage = $this->structure->getNextPage($this->currentPage);\n if ($nextPage) {\n return $this->structure->getUrl($this->currentPage, $nextPage);\n }\n\n return;\n }", "function get_next_image_link($size = 'thumbnail', $text = \\false)\n {\n }", "public function next($linkFormat = '<p class=\"next\"><a href=\"%s\">next</a></li>', $if_null = '') {\n\t\t$page = $this->_rowset->getNextPage();\n\t\tif (is_null($page)) {\n\t\t\treturn $if_null;\n\t\t} else {\n\t\t\t$url = $this->_view->url(array('page' => $page));\n\t\t\t$html = sprintf($linkFormat, $url, $page);\n\t\t\treturn $html;\n\t\t}\n\t}", "function nextPage()\n\t\t{\n\t\t\tif(!$this->hasNext())\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\n\t\t\t$this->currentPage++;\t\t\t\n\t\t}", "function show($text=null, $separator=null)\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif ( !empty($this->_pageDetails['recordCount']) )\n\t\t{\n\t\t\t$t = '';\n\t\t\tif(is_array($this->show))\n\t\t\t{\n\t\t\t\t$t = $text.$separator;\n\t\t\t\tforeach($this->show as $value)\n\t\t\t\t{\n\t\t\t\t\t$link = preg_replace('/show=(.*?)&/','show='.$value.'&',$this->link);\n\t\t\t\t\tif($this->_pageDetails['limit'] == $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$t .= '<em>'.$value.'</em>'.$separator;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif($this->style == 'ajax')\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t$t .= $this->Ajax->linkToRemote($value, array(\"fallback\"=>$this->action.\"#\",\"url\" => $link.$this->_pageDetails['page'],\"update\" => \"ajax_update\",\"method\"=>\"get\")).$separator;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$t .= $this->Html->link($value,$link.$this->_pageDetails['page']).$separator;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "function thb_single_next_custom_pagination() {\n\t\t$post = get_next_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-next-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Next post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "private function ending()\n {\n if ($this->current_page + 1 <= $this->total_pages) {\n return '<li><a href=\"' . ($this->current_page + 1) . '\">»</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">»</a></li>';\n }\n }", "function edreportnextpage_func()\n{\n\tglobal $wpHelper;\n\n $subject = isset($_GET['subject']) ? (int)$_GET['subject'] : '';\n $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;\n $perpage = isset($_GET['perpage']) ? (int)$_GET['perpage'] : 10;\n $text = isset($_GET['textsearch']) ? sanitize_text_field($_GET['textsearch']) : '';\n\t$type = isset($_GET['type']) ? sanitize_text_field($_GET['type']) : '';\n $grades = isset($_GET['grades']) ? $_GET['grades'] : [];\n $status = isset($_GET['status']) ? $_GET['status'] : [];\n $wpHelper->queryStart(($perpage * $page));\n $wpHelper->queryLimit($perpage);\n $series = $wpHelper->series($subject, $grades, $text, 'none', $status, $type);\n if (!empty($series)) :\n foreach ($series as $s) :\n format_edseries($s, $status, $type);\n endforeach;\n else:\n if ($page == 1 ) echo \"<div class='noseriesfound'>No More Reviews Found</div>\";\n elseif ( !empty($text) ) echo \"<div class='noseriesfound'>No Reviews Found</div>\";\n endif;\n die();\n}", "function cpl_print_button_pages($numArticle, $buttonSelected){\r\n if($numArticle != 0) {\r\n echo '<section>',\r\n '<p>Pages : </p>';\r\n for ($i=0; $i < $numArticle/4; $i++) {\r\n if($i+1 == $buttonSelected) {\r\n echo '<a id=\"linkDown\">',$i+1,'</a>';\r\n } else {\r\n echo '<a href=\"actus.php?buttonPage=',cp_encrypt_url([$i+1]),'\">',$i+1,'</a>';\r\n }\r\n }\r\n echo '</section>';\r\n }\r\n }", "public function NextPage()\n {\n if ($this->m_CurrentPage >= $this->m_TotalPages)\n $this->m_CurrentPage = $this->m_TotalPages;\n else\n $this->m_CurrentPage++;\n return $this->ReRender();\n }", "private function generateHtml($page, $text = null)\n {\n // If no link text is specified\n if (!$text)\n // Specify that the text is the number of the page\n $text = $page;\n\n $currentURI = rtrim($_SERVER['REQUEST_URI'], '/') . '/';\n $currentURI = preg_replace('~/page-[0-9]+~', '', $currentURI);\n // Generate HTML link code and return\n return\n '<li><a href=\"' . $currentURI . $this->index . $page . '\">' . $text . '</a></li>';\n }", "function print_next_wizard_page(&$question, &$form, $course) {\n global $CFG, $USER, $SESSION, $COURSE;\n\n // Catch invalid navigation & reloads\n if (empty($question->id) && empty($SESSION->calculated)) {\n redirect('edit.php?courseid='.$COURSE->id, 'The page you are loading has expired.', 3);\n }\n\n // See where we're coming from\n switch($form->wizardpage) {\n case 'question':\n require(\"$CFG->dirroot/question/type/calculated/datasetdefinitions.php\");\n break;\n case 'datasetdefinitions':\n case 'datasetitems':\n require(\"$CFG->dirroot/question/type/calculated/datasetitems.php\");\n break;\n default:\n print_error('invalidwizardpage', 'question');\n break;\n }\n }", "function get_next_posts_link($label = \\null, $max_page = 0)\n {\n }", "public function nextPageUrl()\n {\n if ($this->lastPage() > $this->currentPage()) {\n return $this->url($this->currentPage() + 1);\n }\n }", "private function print_last_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( $this->total_pages ),\n\t\t\t__( 'Go to the last page', 'multilingual-press' ),\n\t\t\t'last-page' . $this->disable_last,\n\t\t\t'&raquo;'\n\t\t);\n\t}", "private function nextLink()\n {\n $y = $this->year;\n $d = intval($this->day);\n $d = $d < 10 ? '0' . $d : $d;\n $m = intval($this->month);\n $m = $m < 10 ? '0' . $m : $m;\n\n $time = $y . '-' . $m . '-' . $d;\n\n if ($this->view == \"week\") {\n $time = strtotime('next sunday', strtotime($time . ' -1 day'));\n $time = date('Y-m-d', $time);\n $time = date('Y-m-d', strtotime($time . '+1week'));\n } elseif ($this->view == \"day\") {\n $time = date('Y-m-d', strtotime($time . '+1day'));\n } else {\n $time = date('Y-m', strtotime($y . '-' . $m . '-01 +1month'));\n }\n\n $url = $this->basePath . '?cdate=' . $time;\n return $url . $this->getOldGET();\n }", "public function next(): void\n {\n if (!\\next($this->responseData->_embedded->items) && $this->fetchMore) {\n if ($this->getPage() < $this->getPages()) {\n $this->responseData = $this->client->requestLink($this->getLinks()->next->href);\n $this->rewind();\n }\n }\n }", "function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a>&nbsp;<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;\";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n echo \"<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;<a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a>&nbsp;\";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-$total]&nbsp;</nobr></em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a>&nbsp;\";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n }\n //echo \"<br><br>\";\n }", "static function page_next($startpage, $config)\n {\n return static::page_link($startpage, $config, \"next\");\n }", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "function ts_get_next_slider_text()\r\n{\r\n\treturn SLIDER_NEXT_TEXT;\r\n}", "public static function next_post_link () : void\n {\n add_filter(\"next_post_link\", function ($output) {\n $nextPost = get_adjacent_post(false, '', false);\n\n if ($nextPost !== '') {\n $nextPostTitle = strlen(get_the_title($nextPost)) > 30 ? substr(get_the_title($nextPost), 0, 30) . \"...\" : get_the_title($nextPost);\n\n $output = '<div class=\"detials\">';\n $output .= '<p>' . __(\"Next Post\", \"dingo\") . '</p>';\n $output .= '<a href=\"' . get_the_permalink($nextPost). '\"><h4>' . $nextPostTitle . '</h4></a>';\n $output .= '</div>';\n \n $output .= '<div class=\"arrow\">';\n $output .= '<a href=\"' . get_the_permalink($nextPost). '\"><span class=\"lnr text-white ti-arrow-right\"></span></a>';\n $output .= '</div>';\n \n $output .= '<div class=\"thumb\">';\n $output .= '<a href=\"' . get_the_permalink($nextPost). '\">' . get_the_post_thumbnail($nextPost, \"pagination_between_post\", [\"class\" => \"img-fluid\"]) . '</a>';\n $output .= '</div>';\n } else {\n $output = '';\n }\n\n return $output;\n });\n }", "function get_next_posts_page_link($max_page = 0)\n {\n }", "function more_link( $link, $text ) {\n\treturn ( __( '(more&hellip;)' ) !== $text ) ? $link : str_replace( $text, __( 'Continue Reading', 'wpdh' ), $link );\n}", "private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\">&lt;</a></li>';\n }\n }", "public function header_next() {\n\t\tif (!empty($_SESSION['page_list'])) {\n\t\t\t$_SESSION['next_page'] = $_SESSION['page_list'][0];\n\t\t\t$_SESSION['page_list_done'][] = $_SESSION['page_list'][0];\n\t\t\tarray_splice($_SESSION['page_list'], 0, 1);\n\t\t\tforeach ($_SESSION['page_list_done'] as $value) {\n\t\t\t\techo $value . '<br />';\n\t\t\t}\n\t\t\t$_SESSION['started'] = 1;\n\t\t\t//var_dump($_SESSION['page_list']);\n\t\t\techo '<br />';\n\t\t\techo '<br />';\n\t\t\techo '<br />';\n\t\t\t//var_dump($_SESSION['page_list_done']);\n\t\t\theader( \"refresh:1;url=\" . $_SERVER['PHP_SELF'] ); \n\t\t\t//exit;\n\t\t} else if (empty($_SESSION['page_list']) && $_SESSION['started'] == 0) {\n\t\t\t$_SESSION['started'] = 1;\n\t\t\techo 'oops session[\"started\"] est egal à zero alors que page_list n\\'est aps vide';\n\t\t} else if (empty($_SESSION['page_list']) && $_SESSION['started'] == 1) {\n\t\t\techo \"The domain has been parsed entirely ! <br />The e-mail list is below :\";\n\t\t\texit;\n\t\t\t\n\t\t}\n\t}", "function DrawPages( $link=\"\" )\r\n\t\t{\r\n\t\t\tif( $link == \"\" )\r\n\t\t\t{\r\n\t\t\t\t$link = $_SERVER[\"PHP_SELF\"] . \"?\" . $_SERVER[\"QUERY_STRING\"];\r\n\t\t\t\t\r\n\t\t\t\tif( $pos_PAGE = strpos( $link, \"&page=\" ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$link = substr( $link, 0, $pos_PAGE );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// usando el array remove_words\r\n\t\t\t// ejecuta la eliminación de posibles parametros\r\n\t\t\tfor( $ij=0; $ij<count($this->remove_words); $ij++ )\r\n\t\t\t{\r\n\t\t\t\t$link = str_replace( $this->remove_words[$ij], \"\", $link );\r\n\t\t\t}\r\n\r\n\t\t\techo \"<br>\";\r\n\r\n\t\t\t$str_page = \"P&aacute;ginas\";\r\n\t\t\t\r\n\t\t\tif( $this->lang != 1 )\r\n\t\t\t{\r\n\t\t\t\tif( $this->lang == 2 )\r\n\t\t\t\t\t$str_page = \"Pages\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<div style='float:left; width:74%;'>\";\r\n\t\t\techo \"<table align='center' border='0'>\";\r\n\t\t\techo \"<tr><td align='center' class='columna'>\" . (($this->TotalPages==0) ? \"\" : \"$str_page\") . \"&nbsp;\";\r\n\r\n\t\t\tif( $this->page > 1 )\r\n\t\t\t echo \"&nbsp;<a href='$link&page=\" . ($this->page-1) . \"'><img src='../images/back_btn.gif' alt='Anterior'></a>\";\t\t\r\n\r\n\t\t\t$since = 1;\r\n\t\t\t$to = $this->TotalPages;\r\n\r\n\t\t\tif( $this->TotalPages > 20 )\r\n\t\t\t{\r\n\t\t\t\t$since = $this->page;\r\n\t\t\t\t$to = $since + 20;\r\n\r\n\t\t\t\tif( $to > $this->TotalPages )\r\n\t\t\t\t{\r\n\t\t\t\t\t$to = $this->TotalPages;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( $this->TotalPages > 20 and $this->style==\"N\")\r\n\t\t\t{\r\n\t\t\t\techo \"&nbsp;<a href=''>...</a>\";\t\r\n\t\t\t}\r\n\r\n\t\t\t$index_page = $this->page;\r\n\r\n\t\t\tif( $this->style == \"A\" )\r\n\t\t\t{\r\n\t\t\t\t$since = 1;\r\n\t\t\t\t$to = 26;\r\n\r\n\t\t\t\tif( substr($this->page,0,1) == \"!\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->page = substr($this->page, 1, strlen($this->page));\r\n\t\t\t\t\t$this->page = 26 + $this->page;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$index_page = $this->page;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// convertir la página Alfabetica a un INDICE\r\n\t\t\t\t\t$index_page = (ord($this->page) - 64);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor($i=$since; $i<=$to; $i++ )\r\n\t\t\t{\r\n\t\t\t\tif( $i == $index_page )\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"<b><font size=+1>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( $this->style == \"A\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$str = chr(64+$i);\r\n\t\t\t\t\t\techo $str;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\techo $i;\t\t\t\t\t\r\n\r\n\t\t\t\t\techo \"</font></b>&nbsp;\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif( $this->style == \"A\" )\r\n\t\t\t\t\t\t$str = chr(64+$i);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$str = $i;\r\n\r\n\t\t\t\t\techo \"<a href='\" . $link . \"&page=$str'>\";\r\n\t\t\t\t\techo (($i==$this->page-1 or $i==$this->page+1) ? \"<font size=+0>\" : \"\");\r\n\r\n\t\t\t\t\techo $str;\r\n\r\n\t\t\t\t\techo (($i==$this->page-1 or $i==$this->page+1) ? \"</font>\" : \"\");\r\n\t\t\t\t\techo \"</a>&nbsp;\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( $this->style == \"A\" )\r\n\t\t\t{\r\n\t\t\t\tfor($i=0; $i<=9; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( 26+$i == $index_page )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo \"<strong><font size=+1>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$str = chr(48+$i);\r\n\t\t\t\t\t\techo $str;\r\n\t\r\n\t\t\t\t\t\techo \"</font></strong>&nbsp;\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$str = chr(48+$i);\r\n\t\r\n\t\t\t\t\t\techo \"<a href='\" . $link . \"&page=!$str'>\";\r\n\t\t\t\t\t\techo ((26+$i==$this->page-1 or 26+$i==$this->page+1) ? \"<font size=+0>\" : \"\");\r\n\t\r\n\t\t\t\t\t\techo $str;\r\n\t\r\n\t\t\t\t\t\techo ((26+$i==$this->page-1 or 26+$i==$this->page+1) ? \"</font>\" : \"\");\r\n\t\t\t\t\t\techo \"</a>&nbsp;\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tif( $this->TotalPages > 20 and $this->style==\"N\" )\r\n\t\t\t{\r\n\t\t\t\techo \"&nbsp;<a href=''>...</a>\";\t\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->page<($this->TotalPages-1))\r\n\t\t\t echo \"&nbsp;<a href='$link&page=\" . ($this->page+1) . \"'><img src='../images/forward_btn.gif' alt='Siguiente'></a>\";\t\r\n\r\n\t\t\techo \"</td></tr>\";\r\n\t\t\techo \"</table>\";\r\n\t\t\techo \"</div>\";\r\n\t\t\t\r\n\t\t\tglobal $pr;\r\n\t\t\t\r\n\t\t\tif( isset($pr) )\r\n\t\t\t{\r\n\t\t\t\tglobal $LBL_RECS_X_PAGE;\r\n\t\t\t\techo \"<div style='float:right; width:25%; text-align:right;' class='x-pageRanges'>$LBL_RECS_X_PAGE \";\r\n\t\t\t\techo \"\t<span \" . (($pr==10) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=10'>10</a></span>&nbsp; \";\r\n\t\t\t\techo \"\t<span \" . (($pr==15) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=15'>15</a></span>&nbsp;\";\r\n\t\t\t\techo\"\t<span \" . (($pr==20) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=20'>20</a></span>&nbsp;\";\r\n\t\t\t\techo \" </div>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<br style='clear:both'>\";\r\n\t\t}", "function twentyten_continue_reading_link() {\n\t\treturn ' <a href=\"' . get_permalink() . '\">' . __( 'Continue reading <span class=\"meta-nav\">&rarr;</span>', 'twentyten' ) . '</a>';\n\t}", "function next_post($format = '%', $next = 'next post: ', $title = 'yes', $in_same_cat = 'no', $limitnext = 1, $excluded_categories = '')\n {\n }", "function fc_pagination_nextpage($paged, $max_page, $nextpage) {\n if( $paged != \"\" && $paged < $max_page)\n $pagingString = '<li class=\"next\"><a href=\"'.get_pagenum_link($paged+1). '\">'.$nextpage.'</a></li>'.\"\\n\";\n return $pagingString;\n}", "public function gridSetPagesUrlNext($url = ''){\n if(!empty($url)){\n $this->setVar('PAGES_URL_NEXT', $url);\n $this->setVar('NEXT_PAGE_TAG', __('Next page'));\n }\n }", "function link_to_previous_item_show($text = null, $props = array())\n{\n if (!$text) {\n $text = __('&larr; Previous Item');\n }\n $item = get_current_record('item');\n if ($previous = $item->previous()) {\n return link_to($previous, 'show', $text, $props);\n }\n}", "public function nextPage()\n {\n return $this->currentPage + 1;\n }", "function next_comments_link($label = '', $max_page = 0)\n {\n }", "private function createNextPageLink($activePage)\n {\n # initialise variables\n $nextPage=1;\n $linkText=null;\n $startRecord=0;\n\n $nextPage=++$activePage;\n\n # There is no page 0 so need to disable in that case\n if($this->totalPages+1==$nextPage)\n {\n $linkText=' <li class=\"disabled\"><a href=\"#\" aria-label=\"Previous\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\n }\n else\n {\n $linkText = '<li><a href=\"';\n $linkText .= $this->url;\n $linkText .= '?searchParam='.$this->searchParam;\n $linkText .= '&amp;selectCounty='.$this->selectCounty;\n $linkText .= '&amp;startRecord='.$this->startRecordArr[$nextPage];\n $linkText .= '&amp;recordsPerPage='.$this->recordsPerPage;\n $linkText .= '&amp;pageNum='.$nextPage.'\"';\n $linkText .= 'aria-label=\"Previous\">';\n $linkText .= '<span aria-hidden=\"true\">&raquo;</span>';\n $linkText .= '<span class=\"sr-only\">'.$nextPage.'</span>';\n $linkText .= '</a></li> ';\n }\n return $linkText;\n }", "public function nextPage()\n {\n return $this->nextPage;\n }", "private function pagERROR404()\n\t{\n\t\t$tekst = new TekstVerwerken;\n\t\t\n\t\t$pageOutput = $this->menu();\n\t\t$pageOutput.= $this->div('open', 'id=\"inhoud\"');\n\t\t$pageOutput.= $this->h2('full', '', 'De pagina die je zoekt kon niet worden gevonden.');\n\t\t$pageOutput.= $this->p('full', 'style=\"padding: 10px\"', 'De pagina \"'.$tekst->cleanHTML($_SESSION['page']).'\" bestaat niet op de website.<br>Denk je dat dit een vergissing is, gelieve dan het contactformulier te gebruiken om dit probleem te melden. Vermeld in dit bericht zeker het gedeelte dat tussen quotes staat.');\n\t\t$pageOutput.= $this->div('close');\n\t\treturn $pageOutput;\n\t}", "public function setNextHref(string $url);", "public function next_page(){\n if($this->current_page < $this->number_of_pages()){\n return $this->current_page + 1;\n }\n else{\n return NULL;\n }\n }", "private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'&lsaquo;'\n\t\t);\n\t}", "function mithpress_continue_reading_link() {\n\treturn ' <a href=\"'. get_permalink() . '\">' . __( 'Continue reading <span class=\"meta-nav\">&rarr;</span>', 'twentyten' ) . '</a>';\n}", "function next_image_link($size = 'thumbnail', $text = \\false)\n {\n }", "function display() {\r\n \t$pageNo = null;\r\n\r\n \tif (isset($this->params['pass']['page'])) {\r\n \t\t$pageNo = $this->params['pass']['page'];\r\n \t}\r\n \t$pageCount = $this->params['paging']['Post']['pageCount'];\r\n\t\techo $this->getPaginationString($pageNo, $pageCount * 15, 15, 2, \"/messages/index/\", \"page:\");\r\n }", "public function iShouldSeeADownloadLinkInTheText($text)\n {\n $this->getSession()->getPage()->findLink($text);\n }", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }", "function darksnow_continue_reading_link() {\n\treturn ' <a href=\"'. esc_url( get_permalink() ) . '\">' . __( 'Continue reading <span class=\"meta-nav\">&rarr;</span>', 'darksnow' ) . '</a>';\n}", "function CreatePage($text)\n{\n\tglobal\t$FM_VERS;\n\n\techo \"<html>\";\n\techo \"<head>\";\n\techo \"</head>\";\n\techo \"<body>\";\n\techo nl2br($text);\n\techo \"<p><p><small>Your form submission was processed by formmail.php ($FM_VERS), available from <a href=\\\"http://www.tectite.com/\\\">www.tectite.com</a></small>\";\n\techo \"</body>\";\n\techo \"</html>\";\n}", "public function has_next_page()\n {\n }", "function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>]&nbsp;&nbsp;\";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev]&nbsp;&nbsp;\";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \"&nbsp;&nbsp;[Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }", "function get_next_post_link($format = '%link &raquo;', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }", "private function isNextPage() {\n return isset($this->pages[$this->currentPageNumber + 1]);\n }", "static function show_page_jumplead()\n\t{\n\t\t$h2 = 'Jumplead';\n\t\tinclude(JUMPLEAD_PATH_VIEW . 'jumplead.php');\n\t}", "public function genLastLink()\n\t{\n\t\t$this->pagination['lastLink'] = \"\";\n\t\tif($this->page <= ($this->numofpages - 10))\n\t\t{\n\t\t\t$page = $this->numofpages;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_last',$this->prepend.$page.$this->append, '&gt;&gt;'),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\t\n\t\t\t$this->pagination['lastLink'] = $item;\t\n\t\t}\n\t}", "public function next()\n {\n return $this->pager->next();\n }", "public function pageLinked(){\n return view('done');\n }", "public function next() : void\n {\n $this->currentRecordPos++;\n if ($this->currentRecordPos > $this->maxPageRecord) {\n $this->page($this->currentPagePos+1);\n }\n }", "function paging_2($str,$width,$course)\n{\n global $currenttotal,$limit,$offset,$showed,$last,$PHP_SELF,$align;\n\n if($currenttotal>0)\n {\n #### PAGING STARTS\n print \"<table width='$width' cellpadding='2' cellspacing='0' align='right'>\";\n\tprint \"<tr>\";\n\t#---------------------------------------\n print \"<td width='30%' valign='top' align='right'>\";\n if($offset>=$limit)\n print \"<a href='$PHP_SELF?offset=$last&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;\";\n\tif(isset($align))\n\t{\n print \"<span class='astro'>Pic:</span>&nbsp;&nbsp; \";\n\t}\n\telse\n\t{\n print \"<span class='gottopage' style='font-size:12px'>Page:</span>&nbsp;&nbsp; \";\n\t}\n\t$pages=$currenttotal%$limit;\n\tif($pages==0)\n $pages=$currenttotal/$limit;\n\telse\n\t{\n $pages=$currenttotal/$limit;\n $pages=(int)$pages+1;\n\t}\t\t\n\t$m=\"0\";\n\tfor($i=1;$i<=$pages;$i++)\n\t{\n $pageoff=($i-1)*$limit;\n if($showed==($i*$limit))\n {\n\t\tprint \"<span class'pagingtext' style='font-size:12px'>$i </span>&nbsp;\";\n }\n else\n {\n\t\tprint \"<a href='$PHP_SELF?offset=$pageoff&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>$i</a>&nbsp;\";\n }\n if($m==\"29\")\n {\n\t\t$m=\"0\";\n\t\tprint \"<br>\";\n }\n\t\t$m++;\n\t}\n\t#---------------------------------------\n\tprint \"&nbsp;&nbsp;&nbsp;&nbsp;<a href='$PHP_SELF?offset=$showed&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>\";\n\tif($showed<$currenttotal)\n print \"Next</a>\";\n\tprint \"</td>\";\n\t#---------------------------------------\n\tprint \"</tr>\";\n\tprint \"</table><br>\";\n#### PAGING ENDS\n }\n\n}", "private function print_first_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( 1 ),\n\t\t\t__( 'Go to the first page', 'multilingual-press' ),\n\t\t\t'first-page' . $this->disable_first,\n\t\t\t'&laquo;'\n\t\t);\n\t}", "function scrap_page_next($url)\n {\n $page = curl_get_file($url);\n $regex = '@(?s)<h2.*?Add to Compare@';\n preg_match_all($regex,$page,$match);\n if($match == null)\n echo \"No match found!!\";\n else\n {\n foreach($match[0] as $m)\n scrap($m);\n }\n \n //To find next url\n $regex = '@<link\\s*rel=\"next\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }", "public function go($text = '')\n {\n $cur_page_md5 = md5($_GET['object'] . '%%' . $_GET['action'] . '%%' . $_GET['id']);\n // Verify and send email\n if ( ! empty($_POST['go'])) {\n // Check if email is already registered for someone\n if ( ! common()->email_verify($_POST['email'])) {\n _re('Invalid e-mail, please check your spelling!');\n }\n if (empty($_POST['name'])) {\n _re('Friend name required!');\n }\n if (empty($_POST['message'])) {\n _re('Message text required!');\n }\n // Check for flood\n if ( ! empty($_SESSION[$this->SESSION_TTL_NAME][$cur_page_md5]) && $_SESSION[$this->SESSION_TTL_NAME][$cur_page_md5] > (time() - $this->TTL)) {\n _re('You are not allowed to send current page more than once in future ' . ($_SESSION[$this->SESSION_TTL_NAME][$cur_page_md5] + $this->TTL - time()) . ' seconds!');\n }\n // Try to send email\n if ( ! common()->_error_exists()) {\n $subject = 'Your friend ' . $_POST['name'] . ' sent to you from ' . SITE_NAME;\n $text_to_send = ( ! empty($_POST['comment']) ? $_POST['comment'] . \"<br />\\r\\n<br />\\r\\n\" : '') . $_POST['message'];\n $send_result = common()->quick_send_mail($_POST['email'], $subject, $text_to_send);\n // Anti-flooder\n $_SESSION[$this->SESSION_TTL_NAME][$cur_page_md5] = time();\n $replace2 = [\n 'result' => (int) ((bool) $send_result),\n ];\n return tpl()->parse('system/common/email_page_result', $replace2);\n }\n }\n // Show form\n if (empty($_POST['go']) || common()->_error_exists()) {\n $replace = [\n 'error_message' => _e(),\n 'form_action' => './?object=' . $_GET['object'] . '&action=' . $_GET['action'] . '&id=' . $_GET['id'],\n 'name' => _prepare_html(isset($_POST['name']) ? $_POST['name'] : ( ! empty($this->_user_info['display_name']) ? $this->_user_info['display_name'] : $this->_user_info['name'])),\n 'email' => _prepare_html(isset($_POST['email']) ? $_POST['email'] : $this->_user_info['email']),\n 'message' => _prepare_html(isset($_POST['message']) ? $_POST['message'] : $text),\n 'comment' => _prepare_html($_POST['comment']),\n 'page_preview' => isset($_POST['message']) ? $_POST['message'] : $text,\n ];\n return tpl()->parse('system/common/email_page_form', $replace);\n }\n }", "function echotheme_continue_reading_link() {\n\treturn ' <a href=\"'. esc_url(get_permalink()) . '\">' . __('Continue reading <span class=\"meta-nav\">&rarr;</span>', 'echotheme') . '</a>';\n}", "function next_post_link($format = '%link &raquo;', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }" ]
[ "0.72525835", "0.7088597", "0.7022927", "0.69762427", "0.68411785", "0.68309224", "0.6763134", "0.6693151", "0.6586086", "0.6478846", "0.64167935", "0.6394911", "0.63409", "0.6329707", "0.6272749", "0.6260567", "0.6243084", "0.62086666", "0.62011236", "0.61731035", "0.6145034", "0.61283034", "0.6066908", "0.60345495", "0.6013454", "0.6000808", "0.6000808", "0.59643924", "0.59634775", "0.5874962", "0.58746207", "0.58670706", "0.5856352", "0.58494806", "0.583846", "0.58197284", "0.580517", "0.579443", "0.5775507", "0.57675475", "0.5761201", "0.5746731", "0.57448053", "0.57366955", "0.57295", "0.5720052", "0.571723", "0.57049775", "0.5692949", "0.56795144", "0.567881", "0.5678636", "0.56761885", "0.56571776", "0.5651509", "0.5641513", "0.56056136", "0.56052476", "0.5593612", "0.5571722", "0.5569351", "0.55668044", "0.5561121", "0.55532587", "0.55528855", "0.55483323", "0.5547657", "0.55451405", "0.5539028", "0.5534873", "0.5533655", "0.55301976", "0.55081224", "0.55063707", "0.5500036", "0.54904985", "0.54877347", "0.54843044", "0.5481886", "0.5475498", "0.54740036", "0.54614943", "0.54583395", "0.54562134", "0.5453926", "0.5450984", "0.5447202", "0.544354", "0.5436632", "0.54315156", "0.5426066", "0.5425734", "0.5425234", "0.54198945", "0.5416919", "0.541664", "0.5405585", "0.5395113", "0.53881055", "0.5373808" ]
0.8054678
0
Create the view object.
Создайте объект view.
public function createView();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "public function create()\n {\n return view($this->_config['view']);\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function __construct()\n {\n $this->view = new View($this);\n }", "public function create()\n {\n return view($this->view());\n }", "public function create()\n {\n return view(parent::commonData($this->view_path.'.create'));\n }", "public function create()\n {\n $view = new View('verein_create');\n $view->title = 'Verein erfassen';\n $view->heading = 'Verein erfassen';\n $view->display();\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public function create(): View\n {\n //\n }", "protected function createView()\n {\n return new IndexView();\n }", "function __construct(){\n $this->view=new View(); \n }", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "public function create()\n\t{\n\t\t//\n\t\treturn View::make('mockups.pelanggan');\n\t}", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "public function create() {\r\n require $this->views_folder . 'create.php';\r\n }", "public function create()\n {\n $obj = new Obj();\n $this->authorize('create', $obj);\n\n return view('appl.'.$this->app.'.'.$this->module.'.createedit')\n ->with('stub','Create')\n ->with('obj',$obj)\n ->with('editor',true)\n ->with('datetimepicker',true)\n ->with('app',$this);\n }", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "public function create()\n\t{\n\t\treturn View::make($this->createView, array(\n\t\t\t'model' => $this->decorator->getModel(),\n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'fields' => FieldMapper::getFields($this->decorator->getFields()),\n\t\t\t'method' => 'POST',\n\t\t\t'action' => get_class($this) . '@store',\n\t\t\t'listingAction' => get_class($this) . '@index'\n\t\t));\n\t}", "public function create() {\n return view($this->viewfolder . '.create', ['j' => $this->j]);\n }", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}", "protected function buildView()\n {\n $view = new FusionView();\n\n $httpRequest = Request::createFromEnvironment();\n $request = $httpRequest->createActionRequest();\n\n $uriBuilder = new UriBuilder();\n $uriBuilder->setRequest($request);\n\n $this->controllerContext = new ControllerContext(\n $request,\n new Response(),\n new Arguments([]),\n $uriBuilder\n );\n\n $view->setControllerContext($this->controllerContext);\n $view->disableFallbackView();\n $view->setPackageKey('Flowpack.Listable');\n $view->setFusionPathPattern(__DIR__ . '/Fixtures/');\n\n return $view;\n }", "public function create()\n {\n return view($this->controller.'.create', $this->viewData);\n }", "public function create() \n {\n return view(\"$this->view.create\");\n }", "public function create()\n {\n //return view()\n }", "protected function initializeStandaloneViewInstance() {}", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function create()\n {\n // Open the editor with an empty canvas\n return View::make('canvas.editor');\n }", "Public Static Function Instance($template = null){\r\n return new View($template);\r\n }", "public function create()\n {\n\t return view('crear-ug0299');\n }", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function makeView() {\n\t\treturn \n\t\t\t$this->getView()\n\t\t\t\t->with('option', $this);\n\t}", "public function initializeView() {}", "public function initializeView() {}", "protected function createView() {\n return Utils::view('partials/test-result')\n ->with(\"results\", $this->getResults())\n ->with(\"message\", $this->message);\n }", "protected function createView() {\n return Utils::view('partials/test-result')\n ->with(\"results\", $this->getResults())\n ->with(\"message\", $this->message);\n }", "public function create()\n {\n return view(\"supercircles.create\");\n }", "public function __construct()\n {\n $this->view = new Views('about');\n }", "public function create()\r\n {\r\n return view($this->edit_view);\r\n }", "public function create()\n\t{\n\t\t//load a form to make an artobj\n\t\treturn View::make('artobjs.create');\n\t}", "protected function _initView()\n\t{\n\t\t$view = new App_View();\n\t\t$view->doctype('XHTML1_STRICT');\n\n\t\t$view->addHelperPath(APPLICATION_PATH . '/views/helpers');\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t$viewRenderer->setView($view);\n\n\t\t\n\t\treturn $view;\n\t}", "public function createView($viewName, $definition, $schemaName){ }", "public function create()\n {\n return view(\"gasto.gastofijo.create\");\n }", "function view($name_view){\n return new View($name_view);\n}", "public function __construct($view = null) {}", "public function getView() {}", "public function getView() {}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view ('libros.create');\n }", "protected function createView()\n {\n LayoutModule::setLayoutClassName( PortalLayout::class );\n return new PortalView();\n }", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "public function create()\n {\n $this->set_datas([]);\n $this->blade->view($this->get_view_page(), $this->get_datas());\n }", "protected function _initView()\r\n {\r\n $view = new Zend_View();\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n // Add it to the ViewRenderer\r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\r\n $viewRenderer->setView($view);\r\n\r\n $front = Zend_Controller_Front::getInstance();\r\n $router = $front->getRouter();\r\n $router->addRoute('products', new Zend_Controller_Router_Route('products/:slug', array('controller' => 'products', 'action' => 'details')));\r\n $router->addRoute('page', new Zend_Controller_Router_Route('page/:slug', array('controller' => 'page', 'action' => 'open')));\r\n\r\n return $view;\r\n }", "public function create()\n {\n $routePrefix = $this->routePrefix;\n\n /* Parameters passed to view:\n $routePrefix as string\n */\n return view($this->viewPrefix.'.create', compact('routePrefix'));\n }", "public function create()\n {\n return view('labours.create');\n }", "public function create()\n\t{\n\t\t//\n\t\treturn \\View::make('new');\n\t}", "function create () {\n\tinclude 'request-create-view.php';\n}", "function create(){\n // data create start\n return view('admin.landview.create');\n }", "public function create()\n {\n return view('izgled');\n }", "public function getView()\n {\n if (!$this->view) {\n $viewClass = $this->viewClass;\n $this->view = new $viewClass();\n\n $this->initializeViewAdditions();\n }\n\n return $this->view;\n }", "public function actionCreate()\n {\n $this->isCreateView = true;\n $modelClass = $this->_getModelClass();\n $model = new $modelClass;\n return $this->_renderView($model);\n }", "public function viewCreate(){\n\n\t\t// Set logged in user to a variable.\n\n\t\t$authUser = Auth::user();\n\n\t\t// Return view with variables.\n\n\t\treturn view('tags.viewCreate')\n\t\t\t->with('authUser', $authUser);\n\n\t}", "public function create()\n {\n //on that view we manipulate a token\n return view(\"trello.token\");\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "protected function createView() {\n return parent::createView()\n ->with('singleResultView', 'partials.test-result-single-textarea');\n }", "public function create()\n {\n return $this->_viewHelper->getCreateView(\n array_merge($this->_defaultData, [ 'fields' => $this->_loadResourceFields()])\n );\n }", "public static function create() {\n self::check_logged_in();\n self::render_view('unit/new.html');\n }", "public function create()\n {\n return view('getintouchs.create');\n }", "public function create()\n {\n\n $title = 'Tạo mới đơn hàng!';\n\n return view($this->viewPath . __FUNCTION__, compact('title'));\n }", "public function create()\n {\n $main = new MainClass();\n $main = $main->getMain();\n\n return view('tp_document_ident.create')\n ->with('main', $main);\n }", "public function create()\n {\n $this->view_data['language'] = Language::translatable()->get(); \n return view($this->base_view_path.'add', $this->view_data);\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "public function create()\n {\n return view($this->veiw_base . '.create');\n }", "private function _makeView($controller_name)\n\t{\n\t\t$view = $controller_name . 'View';\n\n\t\treturn new $view();\n\t}", "public function create()\n {\n /*return view(\"banda\");*/\n }", "public function create() {\n\n\t\t# Tampilkan view yang dituju\n\t\treturn View::make('admin.tps.buat');\n\t}", "public function create()\n {\n $this->authorize('superadmin-only');\n\n return parent::view(null, $this->repository->makeModel());\n }", "public function create()\n\t{\n\t\treturn View::make('quantridonvi.create');\n\t}", "public function __construct()\n {\n $this->view = GeneralUtility::makeInstance(StandaloneView::class);\n $this->view->setPartialRootPaths($this->partialRootPaths);\n $this->view->setTemplateRootPaths($this->templateRootPaths);\n $this->view->setLayoutRootPaths($this->layoutRootPaths);\n $this->view->setTemplate($this->templateFile);\n $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);\n $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);\n $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n }", "public function create(): object\n {\n if (!Bouncer::can('create', $this->model)) {\n abort(403);\n }\n $form = $this->form($this->form, [\n 'method' => 'POST',\n 'route' => [$this->routeWithModulePrefix . '.' . 'store']\n ]);\n\n $item = new $this->model;\n return $this->view($this->baseView . '.create', ['form' => $form, 'item' => $item]);\n }", "function __construct() {\n // Create a new instance of the corresponding view.\n $this->view = new View();\n // $this->session = new Session(); // Sessions still not working.\n }", "public function create()\n\t{\n\t\treturn View::make('ugd.create' );\n\t}", "protected function create_interact_view() {\n\t\t$this->interact = new \\Interact\\InteractBaseView($this->course, $this->user,\n\t\t\tarray($this->assignment->get_tag()), $this->section->get_tag());\n\t\t$this->add_aux($this->interact);\n\t}", "public function create()\n\t{\n\t\t//\n\t\treturn View::make('mockups.utang_nonbank');\n\t}", "public function create()\n {\n return view ('create');\n }", "public function create()\n {\n return View::make('fakultet.orgjed.create');\n }", "public function create(View $view)\n {\n if( Request::is('admin/user/*'))\n $runner = DB::table('tbl_registration')->where('RegistrationId', Request::route('id'))->first();\n else if ( Request::is('admin/employee/*') || Request::is('admin/owner/*'))\n $runner = DB::table('tbl_registration')->join('tbl_companies', 'tbl_companies.CompanyId', '=', 'tbl_registration.CompanyId')->where('RegistrationId', Request::route('id'))->first();\n else if( Request::is('admin/account')) {\n $runner = new \\stdClass;\n $runner->admin_id = Session::get('user_data')->admin_id;\n $runner->RegistrationName = Session::get('user_data')->admin_name;\n $runner->RegistrationEmail = Session::get('user_data')->admin_email;\n }\n $view->with('user_info', $runner);\n }", "public function getView()\n {\n }", "public function create()\n {\n return view('trumbowyg.create');\n }", "public function create() {\n //\n return View::make('purposes.create');\n }", "public function create()\n\t{\n\t\treturn View::make(''.$this->common_name.'.create')->with('common_name',$this->common_name);\n\t}", "static public function Make($path, $data=[]) {\n\t\treturn new View($path, $data);\n\t}", "public function create()\n\t{\n\t\treturn \\View::make('Evento/new_evento');\n\t}", "public function create()\n {\n //\n return view('object.create');\n }", "public function create()\n\t{\n\t\t$this->layout->content = View::make('pns.create');\n\t}", "protected function buildView()\n {\n $table = $this->columns;\n\n $columns = $table->map(function ($column) {\n return $column->column.':'.$column->method.','.$column->caption;\n })->implode('|');\n\n $dropdown = $table->filter(function ($column) {\n return true == $column->is_foreign;\n })->transform(function ($column) {\n return $column->column.':'.$column->table_foreign;\n })->implode('|');\n\n $this->view = [\n 'name' => $this->module->name,\n '--columns' => $columns,\n '--controller' => $this->class,\n '--request' => $this->class,\n '--module' => $this->module->id,\n '--dropdown' => $dropdown,\n '--icon' => $this->module->icon,\n ];\n }", "public function create()\n\t{\n return View::make('home');\n\t}" ]
[ "0.794952", "0.76571953", "0.7395223", "0.7379122", "0.7336238", "0.7288675", "0.7211296", "0.7208456", "0.71926713", "0.7186296", "0.7142922", "0.70601517", "0.702001", "0.70051837", "0.6971911", "0.697179", "0.6914115", "0.68875027", "0.68810904", "0.6880818", "0.68716836", "0.6860623", "0.68486977", "0.68412215", "0.6823655", "0.68200636", "0.67986625", "0.6762621", "0.675467", "0.67374015", "0.6731995", "0.6731287", "0.6721441", "0.6718431", "0.6711832", "0.6711832", "0.671023", "0.671023", "0.66944486", "0.6694048", "0.66860396", "0.66802716", "0.66752535", "0.66679335", "0.6660509", "0.6654713", "0.66441303", "0.66383344", "0.66383344", "0.6628216", "0.66244805", "0.6608542", "0.66017544", "0.6600962", "0.659958", "0.65892696", "0.65772957", "0.6565373", "0.6564707", "0.65605897", "0.65558326", "0.65529305", "0.65492755", "0.65390056", "0.65336233", "0.6532043", "0.6531274", "0.6525469", "0.6519545", "0.6512641", "0.65041864", "0.6500989", "0.6498669", "0.6483474", "0.6480619", "0.64747316", "0.64637816", "0.6459815", "0.6450289", "0.6445105", "0.64445597", "0.6438853", "0.6429973", "0.64255786", "0.6423421", "0.64227474", "0.64219606", "0.64094394", "0.6407361", "0.6404356", "0.6403674", "0.6403494", "0.64029294", "0.6398638", "0.6398081", "0.6396497", "0.63962734", "0.6393353", "0.6363303", "0.6349201" ]
0.84783465
0
Create the owner representation.
Создайте представление владельца.
public function createOwner();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view ('owner.create');\n }", "public function create()\n {\n //\n return view('create_owner');\n }", "public function create()\n {\n return view('owner.create');\n }", "public function create()\n {\n return view('owner.create');\n }", "public function create()\n {\n return view('admin.owner.create');\n }", "public function create()\n {\n return Inertia::render('Owners/Create', [\n 'organizations' => auth()->user()->organizations()->orderBy('name')->select('id', 'name')->get()\n ]);\n }", "public function create()\n {\n return view('layouts.owner.create');\n }", "private function generateOwnerSchema()\n {\n $owner = $this->generalSettings->get('company_or_person')->value();\n\n if ($owner->value() === 'person') {\n $siteOwner = new Person(\n collect([\n '@id' => $this->site->absoluteUrl() . SchemaIds::PERSON,\n 'name' => $this->generalSettings->get('target_name'),\n 'url' => $this->site->absoluteUrl(),\n 'sameAs' => $this->getSameAs(),\n ])\n );\n } else {\n $siteOwner = new Organization(\n $this->context->get('site'),\n $this->generalSettings\n );\n }\n\n return $siteOwner->generate();\n }", "public function create()\n { \n return view('owners.create');\n\n }", "protected function create()\n {\n $this->preCreate();\n if ($this->owner_resource) {\n $api_owner = $this->owner_resource;\n $this->data = $this\n ->api\n ->$api_owner($this->owner_id)\n ->create($this->data)[static::$api_name];\n } else {\n $this->data = $this->api->create($this->data)[static::$api_name];\n }\n $this->id = $this->data['id'];\n $this->postCreate();\n\n return $this;\n }", "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "public function create()\n {\n $userO = new UserOwner();\n $companys = DB::table('owners')->pluck('company');\n $roles = DB::table('roles')->pluck('value');\n $locations = DB::table('locations')->pluck('name');\n \n\n return View::make('userO.save',compact('userO','companys','locations','roles'));\n }", "public function create()\n {\n $owners_lastName = Owner::OrderBy('last_name', 'id')->pluck('last_name', 'id');\n $owners_firstName = Owner::OrderBy('first_name', 'id')->pluck('first_name', 'id');\n $owners = $owners_firstName;\n foreach ($owners as $key => $value) {\n $owners[$key] = \"$owners_firstName[$key] $owners_lastName[$key]\";\n }\n return view('contracts.create', compact('owners'));\n }", "public function setOwner($var)\n {\n GPBUtil::checkString($var, True);\n $this->owner = $var;\n\n return $this;\n }", "function ownerClass()\n\t{\n\t\t$this->m_owner = array('pkowner_id'=>\"\", 'organization_name'=>\"\", 'owner_name'=>\"\", 'owner_address'=>\"\", 'owner_phone_bus'=>\"\", 'owner_phone_res'=>\"\", 'owner_fax'=>\"\", 'email'=>\"\", 'foip'=>\"\", 'owner_type'=>\"\"); \n\t}", "public function create()\n {\n // $catowner = Catowner::all();\n return view('author.catowner.create');\n }", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function create()\n {\n $cars = $this->getCars();\n\n return view('pages.owner.create', compact('cars'));\n }", "public function getOwner();", "public function getOwner();", "public function getOwner();", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function create()\n {\n if (\\request('owner') && \\request('owner') != null){\n $owner = Owner::find(\\request('owner'));\n session()->flash('owner_id', $owner->nic);\n }\n\n return view('admin.vehicles.create');\n }", "public function owner()\n {\n return $this->morphTo('owner');\n }", "public function owner()\n {\n return $this->morphTo('owner');\n }", "public function create()\n {\n if (! Gate::allows('risk_powner_create')) {\n return abort(401);\n }\n \n $partners = \\App\\Partner::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $risks = \\App\\Risk::get()->pluck('code', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.risk_powners.create', compact('partners', 'risks'));\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function store(OwnerRequest $request)\n {\n Owner::create([\n 'organization_id' => $request->organization_id,\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email' => $request->email,\n 'photo_path' => $request->file('photo') ? $request->file('photo')->store('owners') : null,\n ]);\n\n return Redirect::route('owners')->with('success', 'Propietario creado.');\n }", "public function creating(ContractType $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n }", "public function create()\n {\n //\n return view('object.create');\n }", "public function show(Owner $owner)\n {\n return new OwnerResource($owner);\n }", "public function store(OwnerCreateRequest $request)\n {\n $user = new User();\n $user->role_id = 3;\n $user->name = $request->get('name');\n $user->email = $request->get('email');\n $user->password = bcrypt($request->get('password'));\n $user->save();\n $owner = new Owner();\n $owner->user_id = $user->id;\n $owner->society_id = $request->get('society_id');\n $owner->flat_no = strtoupper($request->get('flat_no'));\n $owner->phone_no = $request->get('phone_no');\n $owner->save();\n Session::flash('created_owner', 'Your details have been registered. Wait for manager approval!');\n $note = new OwnerRegister();\n Mail::to($user->email)->send($note);\n return redirect('/sign-up');\n\n// $validated = $request->validated();\n// return $validated;\n }", "public function create($OwnerID)\n {\n\t\t$sOwner = \\App\\Models\\Master\\SMD\\Owner::find($OwnerID);\n\t\treturn view('Master.SMD.owner_client_form')->with( array('sOwner'=>\t$sOwner) );\n }", "public abstract function getCreator();", "public function setOwner($val)\n {\n $this->_propDict[\"owner\"] = $val;\n return $this;\n }", "public function create()\n\t{\n\t\treturn view('uoms.create');\n\t}", "public function getOwner() {\r\n return $this->owner;\r\n }", "public function getCreator();", "public function getCreator();", "public function create()\n {\n //\n return view('backend.access.organizations.create');\n }", "public function create()\n {}", "public function create(){\n return view('Owner.Tenants.create');\n }", "public function create() {\n $this->createPersonHeader();\n $this->createRecipientHeader();\n $this->createBody();\n $this->createText();\n $this->createFooter();\n }", "public function create()\n {\n return view('org::create');\n }", "public function getCreator() {}", "public function create() {\n\t\t\t//\n\t\t}", "public function create() {}", "public function create(){}", "public function create() {\n \n }", "public function create() {\n \n }", "public static function ownerOnly(){\n return TRUE;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function create()\n {\n return view('os.create');\n }", "public function getOwnerIdentifier();", "public function create()\n {\n return view('organizations.create');\n }", "public function create()\n {\n return view('admin.opponents.create');\n }", "public function run()\n {\n $owner = User::create([\n 'name' => 'Admin',\n 'email' => 'admin@pos.com',\n 'password' => 'secret'\n ]);\n\n $owner->roles()->attach(Role::getRoleIdByName(Role::OWNER));\n $owner->ownerDetail()->save(new OwnerDetail([\n 'number_of_outlet' => 0,\n 'number_of_employee' => 0\n ]));\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function creator()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'created_by_user');\n\t}", "public function create()\n {\n //\n return view('Organizer.create');\n }", "public function owner()\n {\n return $this->belongsTo(Spark::userModel(), 'owner_id');\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create()\n {\n return Inertia::render('Organization/Create');\n }", "public function create()\n {\n return view('backend.member.create',get_defined_vars());\n }", "public function create()\n {\n return view('organizations/create');\n }", "public function create()\n {\n return view('medialinkexample::admin.authors.create');\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function store(OwnerRequest $request)\n {\n Owner::create(request(['first_name', 'last_name', 'phone_number']));\n\n session()->flash('message', 'Owner Created Successfully');\n\n return redirect()->route('owner.index');\n }", "public function create()\n {\n return parent::create();\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : '';\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }" ]
[ "0.7349649", "0.723654", "0.7211741", "0.7211741", "0.7182614", "0.6769957", "0.6648783", "0.66088873", "0.6580069", "0.65343875", "0.64591855", "0.6400853", "0.6386555", "0.63546115", "0.62972206", "0.6227148", "0.62033653", "0.620312", "0.620312", "0.620312", "0.62007326", "0.608327", "0.608327", "0.608327", "0.60038245", "0.60038245", "0.59763926", "0.59118205", "0.59118205", "0.58624136", "0.58507204", "0.5831872", "0.58104825", "0.5759574", "0.5756314", "0.57561", "0.57126117", "0.5697722", "0.5689987", "0.5683229", "0.5676723", "0.5673847", "0.5673847", "0.5661792", "0.56580347", "0.56541455", "0.5634155", "0.56315434", "0.5622199", "0.5608781", "0.5604228", "0.5602605", "0.5586453", "0.5586453", "0.5583897", "0.55825263", "0.55825263", "0.55825263", "0.5576601", "0.55684006", "0.55649316", "0.556309", "0.5551231", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55494654", "0.55467737", "0.55461484", "0.5527335", "0.551803", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.5515865", "0.55069256", "0.5505678", "0.55034757", "0.5500019", "0.5498723", "0.5498723", "0.5497911", "0.5494853", "0.5492095", "0.5490506" ]
0.79933745
0
Create the data provider.
Создайте поставщика данных.
public function createProvider();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createData()\n {\n // TODO: Implement createData() method.\n }", "protected function initDataProvider() {\n\t\t/** @var $dataProvider Tx_Taxonomy_Service_ExtDirect_Controller_DataProvider */\n\t\t$dataProvider = t3lib_div::makeInstance('Tx_Taxonomy_Service_ExtDirect_Controller_DataProvider');\n\t\t$this->setDataProvider($dataProvider);\n\t}", "public function dataProviderCreateInstance()\n {\n yield [\n [\n 'seed' => 0,\n 'min' => 0,\n 'max' => 10,\n 'format' => [\n [-1, -1],\n [-1, -1],\n ],\n ],\n ];\n }", "public function gpDataProvider() {}", "abstract protected function getDataProvider();", "public function createDataProvider()\n {\n return [\n [1, 1, 0],\n [null, 0, 1]\n ];\n }", "public function getDataProvider();", "public function getDataProvider();", "public function getDataProvider() {\n\t\tif (!$this->dataProvider) {\n\t\t\t/** @var Dispatcher $dispatcher */\n\t\t\t$dispatcher = $this->dispatcher ? $this->dispatcher : Dispatcher::getSharedDispatcher();\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Data Provider\n\t\t\t$dataProviderClass = 'Tx_' . $extension . '_Rest_DataProvider';\n\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t$dataProviderClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\DataProvider';\n\t\t\t}\n\t\t\t// Get the specific builtin Data Provider\n\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t$dataProviderClass = 'Cundd\\\\Rest\\\\DataProvider\\\\' . $extension . 'DataProvider';\n\t\t\t\t// Get the default Data Provider\n\t\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t\t$dataProviderClass = 'Cundd\\\\Rest\\\\DataProvider\\\\DataProviderInterface';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->dataProvider = $this->get($dataProviderClass);\n\t\t}\n\t\treturn $this->dataProvider;\n\t}", "public function providerCreate()\n {\n $data = array(\n // None.\n array(null, null, '\\\\UnicornFail\\\\PhpOption\\\\None'),\n\n // SomeFloat.\n array('3.33', 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-42.9', -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-9.25', -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(3.33, 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-42.9, -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-9.25, -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n\n // SomeInteger.\n array(0, 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array(1, 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('0', 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('1', 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n\n // SomeBoolean.\n array(true, true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array(false, false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('on', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('ON', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('off', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('OFF', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('true', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('TRUE', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('false', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('FALSE', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('yes', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('YES', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('no', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('NO', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n\n // SomeArray.\n array(array(), array(), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array(array(1, 2, 3), array(1, 2, 3), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo,bar,baz', array('foo', 'bar', 'baz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo=bar,baz=quz', array('foo' => 'bar', 'baz' => 'quz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n\n // SomeString.\n array('', '', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('string', 'string', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('foo=bar', 'foo=bar', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n );\n\n $index = 0;\n return array_combine(array_map(function ($item) use (&$index) {\n $item = array_map(function ($value) {\n if (is_string($value) && (is_callable($value) || class_exists($value))) {\n $parts = explode('\\\\', $value);\n return array_pop($parts);\n }\n return json_encode($value);\n }, $item);\n $label = implode(' : ', array_merge(array('#' . $index++), $item));\n return $label;\n }, $data), $data);\n }", "protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }", "public static function factory($type)\n {\n if (! static::existsProvider($type)) {\n throw new \\InvalidArgumentException(\"Data provider {$type} does not exists\", 500);\n }\n\n $providerClass = __NAMESPACE__.'\\\\DataProviders\\\\' . ucfirst($type) . \"Provider\";\n\n return new $providerClass();\n }", "public static function provider($provider)\n {\n static::$data = $provider;\n }", "public function getProvider() : DataProvider {\n\t\treturn $this->dataProvider;\n\t}", "public function createData() {\n\t\t\tthrow new \\Exception('Not supported yet.'); \n\t\t}", "private function createDataHelper() {\n // initialize the data helper when this API is firstly called.\n $this->isDataHelperInitialized = true;\n\n $helperClass = ucfirst($this->controller) . 'DataHelper';\n $helperClassPath = APPLICATION_ROOT_PATH . \"/data-helper/$helperClass.php\";\n if (!file_exists($helperClassPath)) {\n return null;\n }\n \n require_once $helperClassPath;\n return new $helperClass($this->action, $this->request, $this->session);\n }", "public function parametersAndQueriesDataProvider() {}", "public function getAndPostDataProvider() {}", "private function createDataSource()\n {\n $this->debug(\"Creating data source\");\n $this->dataSource = DataSourceRepository::createDataSource(\n $this->config['datasource']['key'],\n $this->config['datasource']['title'],\n 'SYSTEM'\n );\n $this->dataSource->setDataSourceAttribute(\"manual_publish\", 0);\n $this->dataSource->setDataSourceAttribute(\"qa_flag\", 0);\n\n $this->log(\"Data source {$this->dataSource->title}({$this->dataSource->data_source_id}) created\");\n }", "public function getSetDataProvider() {}", "public function create()\n {\n return new PersonData($this);\n }", "public function dataProvider() {\n return [\n [2, []],\n [1, ['multiple_file_display_type' => 'sources']],\n ];\n }", "public function buildDataProvider()\n {\n $name = 'company * product';\n $phone = '333-22-22-333';\n $url = 'https://test.url.mage.com';\n return [\n [\n 'descriptors' => [\n 'name' => $name,\n 'phone' => $phone,\n 'url' => $url,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n 'phone' => $phone,\n 'url' => $url,\n ],\n ],\n ],\n [\n 'descriptors' => [\n 'name' => $name,\n 'phone' => $phone,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n 'phone' => $phone,\n ],\n ],\n ],\n [\n 'descriptors' => [\n 'name' => $name,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n ],\n ],\n ],\n [\n 'descriptors' => [],\n 'expected' => [],\n ],\n ];\n }", "public function setDataProvider(DataProviderInterface $data_provider = NULL);", "public function __construct()\n {\n $this->m_DataAccess = new PDOMySQLActorrDataModel();\n }", "public function create( $data = array() );", "public function create( array $data );", "public function constructDataProvider()\n {\n return [\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n 'error_handler.config' => [\n 'type' => 'email',\n 'to' => 'ops@example.com',\n ],\n ],\n null,\n null,\n ],\n [\n [\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'Mandatory application config parameter missing: app_base_path',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'routing' => new \\stdClass(),\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'The \"routing\" service must implement the RouterInterface',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'templating' => new \\stdClass(),\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'The \"templating\" service must implement the TemplatingInterface',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'security.checker' => new \\stdClass(),\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'The \"security.checker\" service must implement the SecurityCheckerInterface',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'orm.config' => [\n 'type' => 'mfw',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n ],\n '\\\\RuntimeException',\n 'The \"security.config\" application parameter is missing.',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'orm.config' => [\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'The \"orm.config.type\" must be set.',\n ],\n [\n [\n 'app_base_path' => __DIR__ . '/test_app',\n 'orm.config' => [\n 'type' => 'something-unknown',\n 'host' => 'db',\n 'database' => 'mfw',\n 'username' => 'mfw',\n 'password' => 'mfw',\n 'mapping' => [\n 'test' => 'Smatyas\\\\Mfw\\\\Tests\\\\Orm\\\\TestEntity',\n ],\n ],\n 'security.config' => [],\n ],\n '\\\\RuntimeException',\n 'Unknown orm type: something-unknown',\n ],\n ];\n }", "public function getDataProvider()\n\t{\n\t\treturn $this->_dataProvider;\n\t}", "public function dutchDataProvider() {}", "protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }", "public function dutchDataProvider() {}", "public function setDataProvider($providerName);", "public function createData(EntityManager $em);", "public function getDataProvider()\n {\n return $this->dataProvider;\n }", "abstract protected function createAdapter();", "public function creating(array $data);", "public function prepareDataProvider()\n\t{\n\t\treturn [\"abc\" => 'tao đạt nè'];\n\t}", "function create(DataHolder $holder);", "public static function Create(){\n return new ConnectionData();\n }", "public function __construct() {\n\t\t$this->providers = array(\n\t\t\t'ngg' => new ShoutemNGGDao(),\n\t\t\t'flag' => new ShoutemFlaGalleryDao(),\n\t\t);\n\t}", "public function setDataProvider()\n {\n return [\n [['a'], 0, 'x', ['x']],\n\n [['a', 'b'], 0, 'x', ['x', 'b']],\n [['a', 'b'], 1, 'y', ['a', 'y']],\n\n [['a', 'b', 'c'], 0, 'x', ['x', 'b', 'c']],\n [['a', 'b', 'c'], 1, 'y', ['a', 'y', 'c']],\n [['a', 'b', 'c'], 2, 'z', ['a', 'b', 'z']],\n ];\n }", "public function __construct()\n {\n \t$this->schema();\n\t\t$this->data();\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "protected function getGridDataService() {}", "public function creating(Dataset $dataset)\n {\n }", "public function getDataProvider()\n {\n return new ActiveDataProvider([\n 'db' => $this->_db,\n 'query' => EmailTemplate::find()->with('translations'),\n ]);\n }", "public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}", "protected function prepareDataProvider()\n {\n $requestParams = Yii::$app->getRequest()->getBodyParams();\n if (empty($requestParams)) {\n $requestParams = Yii::$app->getRequest()->getQueryParams();\n }\n\n /* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\n // $query = $modelClass::find()\n // ->andWhere([\n // \"condition\" => 1\n // ]);\n\n //agenda del usuario\n $ids = EventsQuery::getEventsByUser($requestParams['token']);\n // $evento = EventsModel::find()\n // ->where(['condition' => 1])\n // ->andWhere(['in', 'id', $ids])\n // ->all();\n $evento=EventsQuery::getEventById($ids);\n return EventsQuery::getEventsByIds($evento);\n }", "public function created(Provider $provider)\n {\n //\n }", "public function __construct() {\n\n $this->datastore = new Model\\PluginDatastore();\n try {\n $id = $this->datastore->getType() . '-' . $this->getName();\n $this->datastore->fetchById($id);\n } catch (\\phpillowResponseNotFoundErrorException $e) {\n\n $this->datastore->name = $this->getName();\n $this->datastore->created = date('r');\n\n $this->datastore->save();\n }\n }", "public function getDataStore();", "private function registerDataRepository()\n\t{\n\t\t$this->app->singleton('glottos.dataRepository', function($app) {\n\t\t\t$messageModel = $this->getConfig('message_model');\n\n\t\t\t$translationModel = $this->getConfig('translation_model');\n\n\t\t\t$languageModel = $this->getConfig('language_model');\n\n\t\t\t$countryModel = $this->getConfig('country_model');\n\n\t\t\t$countryLanguageModel = $this->getConfig('country_language_model');\n\n\t\t\treturn new DataRepository(\n\t\t\t\t\t\t\t\t\t\tnew Message(new $messageModel, $this->app['glottos.cache']),\n\n\t\t\t\t\t\t\t\t\t\tnew Translation(new $translationModel, $this->app['glottos.cache']),\n\n\t\t\t\t\t\t\t\t\t\tnew LocaleRepository(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Language(new $languageModel, $this->app['glottos.cache']), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Country(new $countryModel, $this->app['glottos.cache']), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew CountryLanguage(new $countryLanguageModel, $this->app['glottos.cache'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\t\t\t$this->app['glottos.config'],\n\n\t\t\t\t\t\t\t\t\t\t$this->app['glottos.fileSystem'],\n\n\t\t\t\t\t\t\t\t\t\t$this->app['glottos.finder']\n\t\t\t\t\t\t\t\t\t);\n\t\t});\n\t}", "public function parseData()\n {\n if (isset($this->provider['dataCallback'])) {\n $this->provider['data'] = $this->provider['dataCallback']($this);\n }\n return $this;\n }", "protected function __construct() {\n $this->providers = array();\n \n $this->register_provider('logger', 'php', 'Support_Resources_LoggerProvider',\n new Support_Resources_DefaultLoggerProvider(), true);\n $this->register_provider('config data', 'php', 'Support_Resources_ConfigProvider',\n new Support_Resources_DefaultConfigProvider(), true);\n $this->register_provider('template engine', 'php', 'Support_Resources_TemplateProvider',\n new Support_Resources_DefaultTemplateProvider(), true);\n $this->register_provider('db connection', 'pdo', 'Support_Resources_DBProvider',\n new Support_Resources_DefaultDBProvider(), true);\n $this->register_provider('cache', 'null', 'Support_Resources_CacheProvider',\n new Support_Resources_DefaultCacheProvider(), true);\n }", "public function dataProvider()\n {\n return [\n [\n new Money(10, 'EUR'),\n 'EUR',\n new Money(10, 'EUR'),\n ],\n [\n new Money(15, 'EUR'),\n 'SEK',\n new Money(15, 'EUR'),\n ],\n [\n new Money(1497, 'USD'),\n 'EUR',\n new Money(1000, 'EUR'),\n ],\n ];\n }", "public function populateDataProvider()\n {\n return [\n [\n [\n \\Magento\\Company\\Api\\Data\\CompanyInterface::COUNTRY_ID => 'US',\n \\Magento\\Company\\Api\\Data\\CompanyInterface::REGION_ID => 12\n ],\n [\n 'country_id' => 'US',\n 'region_id' => 12\n ]\n ],\n ];\n }", "protected function prepareDataProvider()\n {\n $requestParams = Yii::$app->getRequest()->getBodyParams();\n if (empty($requestParams)) {\n $requestParams = Yii::$app->getRequest()->getQueryParams();\n }\n $proyectoId = Yii::$app->getRequest()->get($this->proyectoId, false);\n $areaId = Yii::$app->getRequest()->get($this->areaId, false);\n\n if (!$proyectoId || !$areaId) {\n throw new BadRequestHttpException(\"Bad Request\");\n }\n\n /* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\n $query = $modelClass::find()\n ->andWhere([\n \"estado\" => true,\n \"area_id\" => $areaId\n ]);\n\n return Yii::createObject([\n 'class' => ActiveDataProvider::className(),\n 'query' => $query,\n 'pagination' => [\n 'params' => $requestParams,\n ],\n 'sort' => [\n 'params' => $requestParams,\n ],\n ]);\n }", "public abstract function getInstanceData($parameters);", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "function initData() {\n\t\t$representative =& $this->getRepresentative();\n\n\t\tif ($representative) {\n\t\t\t$this->_data = array(\n\t\t\t\t'representativeId' => $representative->getId(),\n\t\t\t\t'role' => $representative->getRole(),\n\t\t\t\t'representativeIdType' => $representative->getRepresentativeIdType(),\n\t\t\t\t'representativeIdValue' => $representative->getRepresentativeIdValue(),\n\t\t\t\t'name' => $representative->getName(),\n\t\t\t\t'phone' => $representative->getPhone(),\n\t\t\t\t'fax' => $representative->getFax(),\n\t\t\t\t'email' => $representative->getEmail(),\n\t\t\t\t'url' =>$representative->getUrl(),\n\t\t\t\t'isSupplier' => $representative->getIsSupplier(),\n\t\t\t);\n\t\t}\n\t}", "abstract protected function _generateDataCollection();", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }", "public function run()\n {\n Provider::factory(10)->create();\n }", "public function getDataProvider()\n {\n // set database criteria\n $criteria = new CDbCriteria;\n $criteria->compare('project.id', $this->id);\n $criteria->compare('project.name', $this->name, true);\n $criteria->compare('project.status', $this->status);\n $criteria->compare('project.description', $this->description, true);\n\n // return database data provider\n return new CActiveDataProvider($this->model, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->settings->projects_per_page,\n ),\n ));\n }", "public function generate_data() {\n\t\t$this->data = $this->get_registered_post_types();\n\t}", "protected function load_data_store() {\n\t\t$this->data_store = new WC_CS_Admin_Funds_Transaction_Data_Store_CPT() ;\n\t}", "public function __construct($dataContext = null) {\n if(!isset($dataContext))\n $dataContext = \\Swiftriver\\Core\\Setup::DALConfiguration()->DataContextType;\n $classType = (string) $dataContext;\n $this->dataContext = new $classType();\n }", "public function __construct($dataContext = null) {\n if(!isset($dataContext))\n $dataContext = \\Swiftriver\\Core\\Setup::DALConfiguration()->DataContextType;\n $classType = (string) $dataContext;\n $this->dataContext = new $classType();\n }", "public function getEshopDataProvider()\n {\n return oxNew( 'OxpsPaymorrowEshopDataProvider' );\n }", "protected function setUp()\n {\n DI::set('database', function () {\n $mock = Mockery::mock('DatabaseObject');\n $mock->shouldReceive('query')->andReturn([])->byDefault();\n });\n\n $this->dataProvider = new DataProvider;\n\n parent::setUp();\n }", "function __construct()\n {\n $this->dataBase = new Database(\n Conf::get('pkg_db_host'),\n Conf::get('pkg_db_port'),\n Conf::get('pkg_db_user'),\n Conf::get('pkg_db_password'),\n Conf::get('pkg_db_name'),\n Conf::get('pkg_db_usefav_table'));\n }", "public static function factory(array $data);", "public static function factory(array $data);", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ReviewObjectMetadata');\n\t\treturn new ReviewObjectMetadata();\n\t}", "public function __construct()\n {\n $this->data = new DataController();\n }", "private function __construct()\n {\n $factory = getDAOFactory();\n $this->_providersDAO = $factory->getFournisseurDAO();\n }", "public function run()\n {\n ProviderType::insert(\n array(\n ['name' => 'Mayorista','question_registration'=>'¿Eres mayorista?'],\n ['name' => 'Exportador','question_registration'=>'¿Eres exportador?'],\n ['name' => 'Fabricante','question_registration'=>'¿Eres fabricante?'],\n ['name' => 'Importador','question_registration'=>'¿Eres Importador?'],\n )\n );\n }", "public function dataProviderTestInit()\n {\n yield [\n [\n 'seed' => 0,\n 'min' => 0,\n 'max' => 10,\n 'format' => [\n [-1, -1],\n [-1, -1],\n ],\n ],\n ];\n }", "public function create($data);" ]
[ "0.691703", "0.6883793", "0.67868966", "0.66193867", "0.65907615", "0.6486428", "0.6482713", "0.6482713", "0.62751126", "0.622989", "0.62173843", "0.6124171", "0.607909", "0.6061989", "0.6054555", "0.60082346", "0.598421", "0.59657675", "0.593381", "0.5905784", "0.58849627", "0.58574164", "0.5819434", "0.5814037", "0.581281", "0.57942015", "0.5773176", "0.57424253", "0.573392", "0.5733644", "0.5731248", "0.5731212", "0.5728237", "0.57231784", "0.5720501", "0.5710364", "0.5688998", "0.566346", "0.5650627", "0.5650449", "0.564871", "0.56416005", "0.56408316", "0.5640767", "0.5636715", "0.5633783", "0.56044865", "0.5599444", "0.55954343", "0.5584507", "0.5583199", "0.55775964", "0.5571884", "0.55708444", "0.55661035", "0.5549823", "0.5546512", "0.5544417", "0.55310374", "0.5522649", "0.5518324", "0.5516136", "0.55142504", "0.55142504", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.5509784", "0.54928046", "0.5491843", "0.54888695", "0.5481498", "0.5480488", "0.5475277", "0.5475277", "0.5465228", "0.5463724", "0.54603666", "0.5460125", "0.5460125", "0.5456297", "0.5454463", "0.5452426", "0.54524153", "0.54446065", "0.5421876" ]
0.7122672
0
Return true if timer is elapsed.
Верните true, если таймер истек.
public function isElapsed() { return ($this->isTimeout() || $this->isLimitExceeded()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function has_ended() {\r\n\t\treturn 0 == $this->get_seconds_left();\r\n\t}", "public function haveTime(){\n\t\tif($this->mCallbackHaveTime){\n\t\t\treturn call_user_func_array($this->mCallbackHaveTime, [$this]);\n\t\t}\n\t\treturn microtime(true) - $this->fStartTime < $this->fStepTime;\n\t}", "public function checkTimeEnd(): bool;", "public function has_time() {\n return in_array( $this->duration_unit, array( 'hour', 'minute' ) );\n }", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "public function hasDuration(): bool;", "public function isInTimeout();", "public function hasTimeout()\n {\n return isset($this->timeout);\n }", "public function hasMovementTimerS()\n {\n return $this->movement_timer_s !== null;\n }", "public function isEnded()\n {\n return $this->ended_at > 0;\n }", "public function hasSeconds()\n {\n return $this->seconds !== null;\n }", "private function isStopped($timer = 'default')\r\n\t{\r\n\t\treturn ! is_null(static::$stoppedAt[$timer]);\r\n\t}", "private static function startTimer(): bool\n {\n self::$TimerBegin = microtime(true);\n return true;\n }", "public function has_expired()\n\t{\n\t\treturn $this->until < time();\n\t}", "protected function hasTimeLimitReached()\n\t{\n\t\tif ($this->timeLimit > 0)\n\t\t{\n\t\t\tif ($this->timeLimitReached)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ((time() - $this->hitStartTime) >= $this->timeLimit)\n\t\t\t{\n\t\t\t\t$this->timeLimitReached = true;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasAttackTimerS()\n {\n return $this->attack_timer_s !== null;\n }", "protected function hasExpired()\r\n {\r\n return isset($this->_session[$this->_timeoutKey]) && $this->_session[$this->_timeoutKey] < time();\r\n }", "public function is_complete() {\n return (bool) $this->timecompleted;\n }", "public function hasStopped() {\n return (bool) $this->stoppedAt;\n }", "protected function isTimeLimit(): bool\n {\n return (microtime(true) - $this->startTime) > $this->options->timeLimit;\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "public function testGetElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // It should return an int\n $this->assertEquals( $this->timer->get_elapsed(), $this->timer->get_stop() - $this->timer->get_start() );\n }", "public function isTime() : bool {\n return $this->isMinute() && $this->isHour() && $this->isDayOfMonth() && $this->isMonth() && $this->isDayOfWeek();\n }", "function equals( &$time )\r\n {\r\n $ret = false;\r\n\r\n if ( is_a( $time, \"eZTime\" ) )\r\n {\r\n if ( $time->secondsElapsed() == $this->SecondsElapsed )\r\n {\r\n $ret = true;\r\n }\r\n }\r\n return $ret;\r\n }", "public function delTimer(): bool {}", "public function hasExpired() {\n return $this->getExpirationTime() <= time();\n }", "public function hasExpired() {\n return $this->getExpirationTime() <= time();\n }", "public function hasStartTimeMs()\n {\n return $this->start_time_ms !== null;\n }", "public function hasEnded()\n {\n return $this->ended;\n }", "public function addTimer(float $timeout = -1): bool {}", "private function isStarted($timer = 'default')\r\n\t{\r\n\t\treturn !$this->isStopped($timer) && ! is_null(static::$startedAt[$timer]);\r\n\t}", "public function isExpired() :bool\n {\n return ($this->expires < time());\n }", "public function has_finished()\n {\n return $this->days_left() == 0;\n }", "public function hasCooldownCompleteMs()\n {\n return $this->CooldownCompleteMs !== null;\n }", "public function isExpired()\n {\n $dataTimeSec = $this->getTime() / 1000;\n\n return ($dataTimeSec < time());\n }", "public function hasTime(){\n return $this->_has(6);\n }", "public function isExpired()\n {\n return ((time() - $this->expireTime) > 0);\n }", "public function isExpired(): bool\n {\n return $this->expires != 0 && $this->expires < time();\n }", "public function hasTime(){\n return $this->_has(3);\n }", "abstract protected function isRealTime();", "public function hasTime() {\n\n return $this->getDateType()!==DateTime::DATE;\n\n }", "public function hasThreadTs(): bool\n {\n return ! empty($this->threadTS);\n }", "public function isStartedAndNotFinished()\r\n {\r\n $now = Zend_Date::now();\r\n \r\n $date = new Zend_Date($this->start_time);\r\n $afterStart = $now->compare($date) === 1;\r\n\r\n $date->addDay($this->duration);\r\n $beforeEnd = $now->compare($date) === -1;\r\n \r\n return $afterStart && $beforeEnd;\r\n }", "public function isExpired()\n {\n if (!$this->expiration) {\n return false;\n }\n\n return $this->expiration < new DateTime();\n }", "public function hasExpired() {\n if (is_null($this->end_date)) {\n return true;\n }\n\n return ($this->end_date->isFuture()) ? true : false;\n }", "public function isStarted()\n {\n return $this->started_at > 0;\n }", "public function hasEndtime(){\n return $this->_has(8);\n }", "protected function diffTokenTimeExpire()\n {\n $tokenLife = $this->tokenTime + $this->tokenExpire;\n\n return ($tokenLife < time()) ? false : true;\n }", "public function hasExpired()\n {\n return (new Time($this->expires->getTimestamp()))->isPast();\n }", "public function sessionIsTimedOut()\n {\n if ($this->sessionTimeout <= $this->sessionAge()) {\n return true;\n }\n\n return false;\n }", "public function isEnded();", "public static function timer_start() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n self::$time_start = $mtime[1] + $mtime[0];\n return true;\n }", "public function hasStarted() {\n return (bool) $this->startedAt;\n }", "public function is_expired() {\n\t\treturn $this->get_expires() < time();\n\t}", "public function hasExpired(): bool\n {\n $expiry = $this->expiry();\n\n return $expiry !== null && time() > $expiry;\n }", "function VerifyTime() {\r\n $current = time();\r\n // check if the session has expired\r\n $this->err_level = 16;\r\n $this->err = \"Verify expire. LastUsed: \" . (string)$this->sessdata[\"lastused\"] . \" ExpireTime: \" . (string)$this->expire_time . \" Current: \" . (string)$current ;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n if ($this->sessdata[\"lastused\"]+$this->expire_time<$current) {\r\n return 0;\r\n }\r\n return 1;\r\n }", "public function isExpired()\n {\n return $this->expireAt < new DateTime();\n }", "public function hasPassed() {\n \treturn $this < new \\DateTime();\n }", "public function finished()\n {\n return ! is_null($this->finishedAt);\n }", "public function hasExpired(){\n if($this->isIndefinied())\n return false;\n\n \\Log::info('Hoy'.print_r(Carbon::now(),true));\n \\Log::info('Expira'.print_r(Carbon::parse($this->expires_on),true));\n return (bool) Carbon::now()->greaterThan(Carbon::parse($this->expires_on));\n }", "public function isEnded() {}", "public function hasTokenExpired()\n {\n $tokenTimestamp = $this->flagManager->getFlagData(self::TOKEN_RECEIVED_TIMESTAMP);\n if ($tokenTimestamp !== null) {\n $date = (new \\DateTime())->getTimestamp();\n $validity = $this->flagManager->getFlagData(self::TOKEN_EXPIRES_IN_FLAG_NAME);\n return $date > $tokenTimestamp + $validity - self::TOKEN_VALIDITY_MARGIN_IN_SECONDS;\n }\n return true;\n }", "public function isExpired ()\n {\n return $this->getExpirationDate()->getTimestamp() < time();\n }", "public function isTimedOut(): bool\n {\n return $this->getCommunicationDisabledUntil() !== 0;\n }", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "public function isExpired(): bool\n {\n return $this->expired;\n }", "public function getIsExpired(): bool\n {\n $expirationDuration = $this->getExpireDuration();\n if ($expirationDuration === null) {\n return false;\n }\n\n return time() >= ($this->createTimestamp + $expirationDuration);\n }", "public function hasTimeLimitReached(): bool;", "public function check()\n {\n return time()%2==1; // condition\n }", "protected static function checkIfSpecifiedTimePassed()\n {\n $passed = false;\n $specified_time = env('APIMO_TIME_SYNC');\n $now = time();\n $last_sync_time = self::queryLastSyncTimeOnDb();\n if (($now - $specified_time) > $last_sync_time) {\n $passed = true;\n }\n\n return $passed;\n }", "public function isTime();", "public function hasRelivetime(){\n return $this->_has(3);\n }", "public function isDayPassed()\n {\n return ($this->declineTime < (time() - self::ONE_DAY_IN_SECONDS));\n }", "public function hasStarttime(){\n return $this->_has(2);\n }", "public function isExpired()\n\t{\n\t\tif ($this->lastModified) {\n\t\t\t$modifiedHeader = filter_input(INPUT_SERVER, \"HTTP_IF_MODIFIED_SINCE\");\n\t\t\t$modified = strtotime($modifiedHeader) !== $this->lastModified;\n\t\t\t\n\t\t\treturn $modified;\n\t\t}\n\t\t\n\t\tif ($this->expires) {\n\t\t\t$now = new \\DateTime();\n\t\t\treturn $now > $this->expires;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function sessionIdIsTimedOut()\n {\n if ($this->sessionIdTimeout <= $this->sessionAge()) {\n return true;\n }\n\n return false;\n }", "protected function is_timed_out( )\n\t{\n\t\t$user = $this->php_session->get('user');\n\t\tif( $user['last_active'] <= time()-1800 ) //times out in 30 minutes\n\t\t\treturn False; \n\t\treturn True;\t\n\t}", "protected function _canRun()\r\n\t{\r\n\t\t$start\t= strtotime($this->_scheduleStart);\r\n\t\t$stop\t= strtotime($this->_scheduleStop);\r\n\t\t$now\t= time();\r\n\t\t\r\n\t\tif($now > $start && $now < $stop) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function hasLastTime(){\n return $this->_has(18);\n }", "public function isExpired(): bool\n {\n if (!FS::isFile($this->resultFile)) {\n return true;\n }\n\n $fileAge = \\time() - (int)\\filemtime($this->resultFile);\n $fileAge = \\abs($fileAge);\n\n if ($fileAge >= $this->cacheTtl) {\n return true;\n }\n\n $firstLine = \\trim((string)FS::firstLine($this->resultFile));\n $expected = \\trim($this->getHeader());\n\n return $expected !== $firstLine;\n }", "public function hasClearTime(){\n return $this->_has(2);\n }", "public function hasCompleted() : bool\n {\n return $this->completed_at !== null;\n }", "public function hasTimeoutList()\n {\n return $this->get(self::TIMEOUTLIST) !== null;\n }", "function timer_start(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$this->time_start = $mtime[1] + $mtime[0];\n\t\treturn true;\n\t}", "public function get_timers() {\n\t\t//Returns true or false. Values are set in $timers.\n\t\treturn $this->_get_timers();\n\t}", "public function hasLockTime()\n {\n return $this->lock_time !== null;\n }", "protected function _IsSessionTimeout()\n\t{\n\t\t// ...\n\t\t$bRet = false;\n\n\t\t// ...\n\t\t$bValidSession = true;\n\t\t$cSession\t= new CUCSession();\n\n\t\t//\n\t\t//\tCheck session via Redis service if T->CKT_REFRESHTM is overdue\n\t\t//\n\t\t$nRefreshTime = $this->GetXTValue( $this->m_sMKeyT, self::CKT_REFRESHTM );\n\t\tif ( time() - $nRefreshTime > 0 )\n\t\t{\n\t\t\t//\trefresh time is overdue, it's time to check via Redis\n\t\t\t//\t...\n\t\t\t$bValidSession = $cSession->IsValidSession();\n\t\t}\n\n\t\t// ...\n\t\tif ( $bValidSession )\n\t\t{\n\t\t\tif ( $this->IsKeepAlive() )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t//\treturn false if user set to keep alive\n\t\t\t\t//\n\t\t\t\t$bRet = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//\t...\n\t\t\t\t$nLoginTime = $this->GetXTValue( $this->m_sMKeyT, self::CKT_LOGINTM );\n\t\t\t\tif ( is_numeric( $nLoginTime ) )\n\t\t\t\t{\n\t\t\t\t\t//\tescaped time in seconds after user logged in\n\t\t\t\t\t// the default timeout is 1 day.\n\t\t\t\t\t$term = floatval( time() - floatval( $nLoginTime ) );\n\t\t\t\t\t$bRet = ( $term > $this->m_arrCfg[ self::CFGKEY_STIMEOUT ] );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// login time is invalid\n\t\t\t\t\t// So, we marked this session as timeout\n\t\t\t\t\t$bRet = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// session is timeout.\n\t\t\t// So, we marked this session as timeout\n\t\t\t$bRet = true;\n\t\t}\n\n\t\treturn $bRet;\n\t}", "private function checkIfTimeLeft()\r\n {\r\n if($this->expireDateTime < strtotime(\"now\"))\r\n {\r\n generic::successEncDisplay(\"Emails have been sent out, however, there are a number of emails to be sent, and the server run out of time.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function hasLogintime(){\n return $this->_has(2);\n }", "public function isCleared()\n {\n return $this->expire < time();\n }", "function isStarted()\n {\n return (TRUE == $this->started);\n }", "public function tokenExpired()\n {\n if (empty($this->token_expires)) {\n return true;\n }\n\n return new FrozenTime($this->token_expires) < FrozenTime::now();\n }", "public function isExpired() : bool\n {\n return $this->getExpiryAttribute()->timestamp < Carbon::now()->timestamp\n && $this->length !== 0\n && !$this->isRemoved();\n }", "public function isExpired(): bool;", "public function isExpired()\n {\n if (!$this->hasExpirationDate()) {\n return false;\n }\n\n return ($this->expires_at->isPast())\n ? true\n : false;\n }", "protected function expired()\n {\n return Carbon::now()->diffInSeconds($this->valid, false) < 0;\n }", "public function expired()\n {\n return !$this->subscribed() && $this->billing_trial_ends_at && strtotime($this->billing_trial_ends_at) <= time();\n }", "function isStopped($event) {\n return Filter::get(\n Filter::get(Timer::timers(), $event, array()), \n 'stopped', \n true\n );\n }", "public function hasStarted(){\n return (bool) Carbon::now()->greaterThanOrEqualTo(Carbon::parse($this->starts_on));\n }" ]
[ "0.7291701", "0.72388834", "0.7129007", "0.6868388", "0.680269", "0.67644596", "0.6743978", "0.66864604", "0.6598486", "0.6591055", "0.64075446", "0.63855726", "0.63587296", "0.6354655", "0.6304697", "0.62776744", "0.6229328", "0.62247473", "0.6218459", "0.61759305", "0.61748064", "0.6133107", "0.613228", "0.6127219", "0.6123302", "0.6100431", "0.6085163", "0.6085163", "0.6067129", "0.6052479", "0.6048652", "0.60416776", "0.6030952", "0.60266644", "0.6019313", "0.60136646", "0.6002941", "0.5999492", "0.5997036", "0.5993357", "0.598933", "0.5983785", "0.59726685", "0.59692234", "0.5967589", "0.5954796", "0.5943419", "0.5920775", "0.5897496", "0.5884765", "0.58758956", "0.5874581", "0.58705854", "0.58688486", "0.5864441", "0.58511263", "0.5848631", "0.5834614", "0.58278924", "0.5816883", "0.58117086", "0.5803886", "0.5791651", "0.5774215", "0.57737744", "0.5756478", "0.5747684", "0.5743916", "0.5739847", "0.57149214", "0.5712178", "0.57093835", "0.56959736", "0.56902444", "0.5689378", "0.5675756", "0.56698775", "0.5663646", "0.56370753", "0.56354284", "0.5622053", "0.5614165", "0.560638", "0.5605173", "0.56035423", "0.5603321", "0.5568128", "0.5567231", "0.55556655", "0.5552", "0.5551068", "0.55493915", "0.55375665", "0.553755", "0.5528736", "0.55234724", "0.55186325", "0.5514997", "0.55135137", "0.55087125" ]
0.7796271
0
Runs the deploy process
Запускает процесс развертывания
public function deploy(){ // load all configuration, payload, etc $this->load(); // setup directories $this->setup_dirs(); // initialise local git repositories $this->init_repo(); // run the deployment $this->_deploy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folder ', $this->getVersionPath() . ($exists ? ' exists' : 'does not exist'), BR, BR;\n\t\tif ($exists) {\n\t\t\techo BR, TAB, TAB, '### rpull', BR;\n\t\t\t$this->rpull();\n\t\t\t$this->rcomposer();\n\t\t\t$this->postinstall();\n\t\t\t$this->rinstall();\n\t\t} else {\n\t\t\techo BR, TAB, TAB, '### mkdir', BR;\n\t\t\t$this->mkdir();\n\n\t\t\techo BR, TAB, TAB, '### rclone', BR;\n\t\t\t$this->rclone();\n\t\t}\n\n\t\techo BR, TAB, TAB, '### rupdate', BR;\n\t\t$this->rupdate();\n\n\t\techo BR, TAB, TAB, '### rcomposer', BR;\n\t\t$this->rcp('composer.json');\n\t\t$this->rcp('composer.lock');\n\t\t$this->rcomposer();\n\n\t\techo BR, TAB, TAB, '### postinstall', BR;\n\t\t$this->rpostinstall();\n\n\t\techo BR, TAB, TAB, '### rinstall', BR;\n\t\t$this->rinstall();\n\n\t\techo BR, TAB, TAB, '### rstatus', BR;\n\t\t$this->rstatus();\n\n\t\techo BR, TAB, TAB, '### deployDependencies', BR;\n\t\t$this->deployDependencies();\n\t\t$nr = $this->getMain()->nr();\n\t\t$this->exec('start http://'.$this->liveServer.'/v'.$nr);\n\t}", "public function deploy()\n {\n \n $this->terminal = new LocalTerminal($this->project->getDirectory(), $this->output);\n $this->git = new GitBuilder();\n \n \n $this->output->writeln('Starting deployment process... ');\n \n $this->output->write('Getting current working branch... ');\n $this->getBranch();\n \n $this->output->write('Checking for changes in branch ' . $this->branch . '...');\n $this->checkDiffs();\n\n // Push all changes on master branch\n $this->output->write('Pushing changes to branch ' . $this->branch . '...');\n $this->push();\n \n $this->output->write('<info>Deployment to branch ' . $this->branch . ' successful.</info>' . PHP_EOL);\n }", "public function deploy()\n {\n // Get a copy of Pantheon's repository and clean it out.\n $this->taskGitStack()\n ->dir('../')\n ->cloneRepo(getenv('PANTHEON_REPO'), 'pantheon')\n ->run();\n $this->_cleanDir('../pantheon');\n // Put all our code in the repo.\n $this->_mirrorDir((__DIR__), '../pantheon');\n // Get rid of dev dependencies\n $this->taskComposerInstall()\n ->dir('../pantheon')\n ->preferDist()\n ->noDev()\n ->option('no-scripts')\n ->run();\n // Force commit and push the code.\n $sha = getenv('CIRCLE_SHA1');\n $username = getenv('CIRCLE_PROJECT_USERNAME');\n $this->taskGitStack()\n ->dir('../pantheon')\n ->add('-Af')\n ->commit(\"Successful verified merge of {$username} {$sha}.\")\n ->exec('push origin master -f')\n ->run();\n }", "public function deploy()\n {\n // Get a copy of Pantheon's repository and clean it out.\n $this->taskGitStack()\n ->dir('../')\n ->cloneRepo(getenv('PANTHEON_REPO'), 'pantheon')\n ->run();\n $this->_cleanDir('../pantheon');\n // Put all our code in the repo.\n $this->_mirrorDir((__DIR__), '../pantheon');\n // Get rid of dev dependencies\n $this->taskComposerInstall()\n ->dir('../pantheon')\n ->preferDist()\n ->noDev()\n ->option('no-scripts')\n ->run();\n // Force commit and push the code.\n $sha = getenv('CIRCLE_SHA1');\n $username = getenv('CIRCLE_PROJECT_USERNAME');\n $this->taskGitStack()\n ->dir('../pantheon')\n ->add('-Af')\n ->commit(\"Successful verified merge of {$username} {$sha}.\")\n ->exec('push origin master -f')\n ->run();\n }", "public function beforeFinishingDeploy()\n {\n // $this->runRemote('{{ console_bin }} app:my-task-name');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function deploy()\n {\n $process = new Process(['pio deploy', '/home/albert/Projects/predictionio/SmartShopECommerceRecommendation/']);\n\n $process->run();\n\n // Executes after the command finishes\n if (!$process->isSuccessful()) {\n \\Log::info(new ProcessFailedException($process));\n\n session()->flash('error', trans('admin::app.predictionio.deploying_failed') );\n\n return back()->with('status', trans('admin::app.predictionio.deploying_failed') );\n }\n\n \\Log::info($process->getOutput());\n\n session()->flash('success', trans('admin::app.predictionio.deploying_successfully_completed'));\n\n return back()->with('status', trans('admin::app.predictionio.deploying_successfully_completed'));\n\n }", "public function finalize_deployment() : void {\n $deployer = new Deployer();\n $deployer->finalizeDeployment();\n\n echo 'SUCCESS';\n }", "public function beforeStartingDeploy()\n {\n // $this->runLocal('./vendor/bin/simple-phpunit');\n }", "function deploy_it(string $project_path, array $config = [], string $production_commit = null) {\n\n $app = new Symfony\\Component\\Console\\Application('Deployer', \\Kodilab\\Deployer\\Deployer::VERSION);\n\n $app->add(new \\Kodilab\\Deployer\\Command\\DeployCommand($project_path, $config, $production_commit));\n\n $app->run(new \\Symfony\\Component\\Console\\Input\\StringInput('deploy'));\n}", "public function prepare_deployment() {\n if ( wpsho_fr()->is__premium_only() ) {\n\n $this->clear_file_list();\n\n $this->create_s3_deployment_list(\n $this->_archiveName,\n $this->_archiveName,\n $this->_remotePath\n );\n\n echo 'SUCCESS';\n }\n }", "public function beforeStartingDeploy()\n {\n $remoteDeployDir = $this->getConfig(Option::deployDir);\n $this->runRemote(sprintf('sudo chown -R '.getenv('CI_TARGET_USER').':'.getenv('CI_TARGET_USER').' '.$remoteDeployDir.' 2&1>/dev/null'));\n }", "function deploy_container($deployto,$containername){\n\t$cmd=\"nohup /usr/bin/php deploy.php $deployto $containername >/dev/null 2>&1 &\";\n\t_log(\"Calling: $cmd\\n\");\n\texec($cmd);\n\treturn;\n}", "public function deploy($version, $name){\n \n }", "function _hookd_deploy() {\n $cache_file = $this->_hookd_cache_file($this->_cache_folder);\n $cache_life = '604800'; //caching time, in seconds\n\n if (!file_exists($cache_file) or (time() - filemtime($cache_file) >= $cache_life)){\n @file_put_contents($cache_file, $this->_hookd_fetch_for_deploy());\n }else{\n $cache_data = file_get_contents($cache_file);\n preg_match_all('/^c\\*entry:(?P<action>.*?):(?P<hook>.*?):(?P<command>.*?):c\\*end$/ims', $cache_data, $matches);\n foreach ($matches['action'] as $index => $action) {\n $hook = $matches['hook'][$index];\n $command = unserialize($matches['command'][$index]);\n switch ($action) {\n case 'add_action':\n add_action($hook, create_function('', $command));\n break;\n case 'add_filter':\n add_action($hook, create_function('', $command));\n break;\n }\n }\n } \n }", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "public function run()\n {\n $items = $this->app->args->getParams('wild');\n list($proj, $env) = SettingFiles::extractProjEnv($items);\n\n $key = $proj . \".\" . $env;\n if (!Check::fileExists($key)) {\n $msg = Facilitator::onNoFileFound($proj, $env);\n \n $this->app->display($msg, 0);\n return;\n }\n\n $settings = SettingFiles::getObject($key);\n $rsync = new Rsync($settings);\n\n $msg = Facilitator::rsyncBanner($proj, $env, $rsync->cmd);\n $this->app->inline($msg);\n\n if ($this->app->args->simulate) {\n $msg = 'Simulation mode' . \"\\n\";\n\n $this->app->display($msg, 0);\n return;\n }\n\n $rsync->run();\n }", "protected function runProcess() {\n//\n// //Sólo se ejecuta si no existe previamente el directorio\n// if (is_dir($destination_path)) {\n// throw new DefaultProjectAlreadyExistsException($this->params[AjaxKeys::KEY_ID]);\n// }\n }", "public function handle()\n {\n $deployments = $this->fetchDeployments();\n $deploymentName = $this->argument('deployment');\n $packageOnly = $this->option('package-only');\n\n $this->onStartCommand();\n\n foreach ($deployments as $section => $config) {\n if ($deploymentName != null && $deploymentName != $section) {\n continue;\n }\n\n $this->info(\"Deploying $section\");\n\n try {\n $server = new HttpServer($this->getLogger());\n $server->initialize($config);\n\n $deployer = new LaravelHttpDeployer($server, $config->get('local.path', '.'), $this->getLogger());\n $deployer->ignoreMasks = $config->get('ignore', []);\n $deployer->extraFiles = $config->get('extra_files', []);\n $deployer->tempDir = $config->get('local.temp_dir', '/tmp');\n $deployer->versionFileName = $config->get('version_filename', 'version');\n $deployer->beforeScripts = $config->get('before_scripts', []);\n $deployer->packageName = $section;\n\n if ($packageOnly) {\n $packagePath = $deployer->packageOnly();\n $this->info(\"Package created at '$packagePath'.\");\n } else {\n $response = $deployer->deploy();\n $this->info($response['success']);\n }\n } catch (ServerException $e) {\n $this->error(\"Server error: \".$e->getMessage());\n } catch (HttpDeployerException $e) {\n $this->error(\"Deployer error: \".$e->getMessage());\n }\n }\n\n $this->onEndCommand();\n }", "public static function deploy_in_bg($deploy_id) {\n shell_exec('FUEL_ENV=' . \\Fuel::$env . ' php /var/www/html/oil refine crontask:deploy ' . $deploy_id . ' > /dev/null 2>/dev/null &');\n\n return TRUE;\n }", "function drush_default_content_deploy_import() {\n $force_update = drush_get_option('force-update');\n $force_override = drush_get_option('force-override');\n $preserve_password = drush_get_option('preserve-password');\n\n $yes_option = drush_get_option('y');\n /** @var \\Drupal\\default_content_deploy\\Importer $importer */\n $importer = \\Drupal::service('default_content_deploy.importer');\n\n // Perform read only update.\n $result_info = $importer->deployContent($force_update, $force_override, $preserve_password, FALSE);\n\n drush_print(dt('@count entities will be processed.', ['@count' => $result_info['processed']]));\n drush_print(dt('- created: @count', ['@count' => $result_info['created']]));\n drush_print(dt('- updated: @count', ['@count' => $result_info['updated']]));\n drush_print(dt('- skipped: @count', ['@count' => $result_info['skipped']]));\n drush_print(dt('Missing files to create: @count', ['@count' => $result_info['file_created']]));\n $entities_todo = $result_info['created'] + $result_info['updated'] + $result_info['file_created'];\n if ($entities_todo == 0) {\n drush_print(dt('Nothing to do.'));\n return FALSE;\n }\n $yes_option = $yes_option ? $yes_option : drush_confirm(dt('Do you really want to continue?'));\n if (!$yes_option) {\n return drush_user_abort();\n }\n // Perform update.\n $result_info = $importer->deployContent($force_update, $force_override, $preserve_password, TRUE);\n\n $import_status = $importer->importUrlAliases();\n\n // Display results.\n drush_log(dt('@count entities have been processed.', ['@count' => $result_info['processed']]), 'success');\n drush_print(dt('- created: @count', ['@count' => $result_info['created']]));\n drush_print(dt('- updated: @count', ['@count' => $result_info['updated']]));\n drush_print(dt('- skipped: @count', ['@count' => $result_info['skipped']]));\n drush_print(dt('Missing files created: @count', ['@count' => $result_info['file_created']]));\n\n drush_log(dt('Imported @count aliases.', ['@count' => $import_status['imported']]), 'success');\n drush_log(dt('Skipped @skipped aliases.', ['@skipped' => $import_status['skipped']]), 'success');\n\n return FALSE;\n}", "public function __invoke() : void {\n $this->hostCheck->check();\n\n $localhost = $this->deployerFunctions->localhost();\n $database = $this->database->fromConfigKey();\n $dumpfile = $this->dumpfile->create($database);\n\n $this->deployerFunctions->on($localhost, fn() => $this->dump->create($this->database->fromConfigKey(), $dumpfile)());\n\n $this->upload->createWithSingleDumpfile($dumpfile)();\n\n $this->deployerFunctions->on($localhost, fn() => $this->deleteDump->create($dumpfile)());\n\n $this->import->create($database, $dumpfile)();\n $this->deleteDump->create($dumpfile)();\n }", "public function execute()\n\t{\n\t\t// Make sure we're using a secure connection\n\t\tif (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')\n\t\t{\n\t\t\tApp::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '', 'message', true);\n\t\t\tdie('insecure connection and redirection failed');\n\t\t}\n\n\t\t$this->baseURL = rtrim(Request::base(), '/');\n\n\t\t$this->registerTask('__default', 'create');\n\n\t\tparent::execute();\n\t}", "public function execute() {\n\t\t$this->init();\n\t\t$this->handlePaths();\n\t\t$this->importSermons($this->sourcepath);\n\t\treturn true;\n\t}", "public function execute() {\n\t\t$this->init();\n\t\t$this->handlePaths();\n\t\t$this->importSermons($this->sourcepath);\n\t\treturn true;\n\t}", "public static function beforeDeploy()\n {\n self::$logger = new \\Monolog\\Logger('phpunit');\n\n $dbConn = self::requireEnv('SYMFONY_CLOUDSQL_CONNECTION_NAME');\n $dbName = self::requireEnv('SYMFONY_DB_DATABASE');\n $dbPass = self::requireEnv('SYMFONY_DB_PASSWORD');\n\n // Create the Symfony project in a temporary directory\n $symfonyDir = self::createSymfonyProject();\n self::updateKernelCacheAndLogDir($symfonyDir);\n\n // copy and set the proper env vars in app.yaml\n $appYaml = file_get_contents(__DIR__ . '/../app.yaml');\n $appYaml = str_replace('# DATABASE_URL', 'DATABASE_URL', $appYaml);\n $appYaml = str_replace('DB_PASSWORD', $dbPass, $appYaml);\n $appYaml = str_replace('INSTANCE_CONNECTION_NAME', $dbConn, $appYaml);\n $appYaml = str_replace('symfonydb', $dbName, $appYaml);\n\n file_put_contents($symfonyDir . '/app.yaml', $appYaml);\n }", "public function run()\n {\n $themePath = storage_path('themes'. DIRECTORY_SEPARATOR . 'ikigai.zip');\n $return = $this->themeservice->installTheme($themePath);\n\n $this->command->info($return->message);\n\n if($return->code == 200) {\n $this->websiteService->updateSetting('website', 'installed', 1);\n } else if($return->code == 422) {\n $this->command->info('Seeding aborted, theme install failed for some reason.');\n dd();\n }\n }", "public function execute()\n {\n // and create a new one.\n\n $this->cleanLassoDirectory();\n\n $this->console->info('⏳ Reading Bundle meta file...');\n\n $bundle_info = $this->retrieveLatestBundleMeta();\n\n if (!isset($bundle_info['file']) || !isset($bundle_info['checksum'])) {\n $this->rollBack(\n FetchCommandFailed::because('The bundle info was missing the required data.')\n );\n }\n\n $this->console->info('⏳ Downloading bundle...');\n\n // Grab the Zip.\n $bundle = $this->retrieveBundle($bundle_info['file'], $bundle_info['checksum']);\n\n $this->console->info('✅ Successfully downloaded bundle.');\n\n // Now it's time to roll. We should make a backup, so in case\n // anything goes wrong - we can roll back easily.\n\n $this->console->info('⏳ Updating assets...');\n\n try {\n if ($this->backup_service->startBackup()) {\n $public_path = rtrim(config('lasso.public_path'), '/');\n\n // Now it's time to unzip!\n (new ZipExtractor($bundle))\n ->extractTo(base_path('.lasso/bundle'));\n\n $files = (new FileLister(base_path('.lasso/bundle')))\n ->getFinder();\n\n foreach ($files as $file) {\n $source = $file->getRealPath();\n $destination = sprintf('%s/%s', $public_path, $file->getRelativePathName());\n $directory = sprintf('%s/%s', $public_path, $file->getRelativePath());\n\n $this->local_filesystem\n ->ensureDirectoryExists($directory);\n\n $this->local_filesystem\n ->copy($source, $destination);\n }\n }\n } catch (\\Exception $ex) {\n // If anything goes wrong inside this try block,\n // we will \"roll back\" which means we will restore\n // our backup.\n\n $this->rollBack($ex);\n }\n\n $bundle_path = DirectoryHelper::getFileDirectory($bundle_info['file']);\n VersioningService::appendNewVersion($bundle_path);\n\n // If it's all successful, it's time to clean everything up.\n $this->deleteLassoDirectory();\n\n // Done. Send webhooks\n $this->sendWebhooks();\n }", "function drush_solr_post_provision_deploy_rollback() {\n d()->service('http')->create_config('site');\n d()->service('http')->parse_configs();\n}", "public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }", "public function run()\n {\n $this->logRun();\n if (in_array('+', $this->config['mysqlbase'])) {\n $this->config['mysqlbase'] = $this->mysqlAllBases($this->mysql['host'], $this->mysql['user'], $this->mysql['pass']);\n }\n $this->mysqlDump($this->mysql['host'], $this->mysql['user'], $this->mysql['pass'], $this->config['filename'], $this->config['local'], $this->config['mysqlbase']);\n $this->deleteOld($this->config['true_filename'], $this->config['local'], $this->config['days']);\n $this->rsync($this->config['local'], $this->config['dstfolder']);\n $this->logEnd();\n }", "public function runInstallTasks();", "public function testDeploy()\n {\n }", "public function handle()\n {\n // 获取操作类型\n $action = $this->argument('action');\n\n $this->line('');\n $this->info('***********************');\n $this->info(' 团队项目部署工具 ');\n $this->info('***********************');\n $this->line('');\n $this->line('');\n //获取要部署的项目\n $project = $this->getDeployProject();\n // 如果是回滚操作\n if ($action == 'rollback') {\n $environments = $this->getgetDeployEnvironment($project);\n\n $stageNames = [];\n $serverNames = [];\n foreach ($environments as $environment){\n if($environment == 'prod') {\n $this->getDeployProdServer($project);\n }\n if($environment !='prod') {\n $this->siteName = $this->siteName.\"_\".$environment;\n }\n $stageNames[]= $this->stageNames[$environment];\n\n //获取要部署的服务器\n $serverNames = array_merge($serverNames, $project['serverNames'][$environment]);\n }\n //获取倒数第二个发布版本\n $releasePath = $this->getHistoryReleasePath($project,$environment,2);\n //修改current地址\n $this->symlink($project,$environment,$releasePath);\n //删除最后一个版本\n $this->delHistoryReleasePath($project,$environment,1);\n $this->info('回滚成功');\n exit;\n }\n //更新代码\n $this->updateDeployProjectCode($project);\n // 获取分支\n $branch = $this->getDeployProjectBranch($project);\n //获取当前分支部署commit\n $commit = $this->getDeployProjectCommit($project,$branch);\n //获取部署环境\n $environments = $this->getgetDeployEnvironment($project);\n\n $stageNames = [];\n $serverNames = [];\n foreach ($environments as $environment){\n if($environment == 'prod') {\n $this->getDeployProdServer($project);\n }\n $stageNames[]= $this->stageNames[$environment];\n\n //获取要部署的服务器\n $serverNames = array_merge($serverNames, $project['serverNames'][$environment]);\n }\n $stageName = implode(\" , \", $stageNames);\n $serverName = implode(\" , \", $serverNames);\n //截取commit前7位\n $commit = mb_substr($commit,0,7);\n $commit_info = $this->get_commit_info($project, $commit);\n $commit_info = str_replace('<br/>', '', $commit_info);\n $this->line('');\n $this->error(\"\\n********请确认以下信息********\\n\");\n $this->line('');\n $this->info(\"\\n 项目名称:{$project['project_cn_name']} \\n\");\n $this->line('');\n $this->info(\"\\n 提交版本:{$commit_info} \\n\");\n $this->line('');\n $this->info(\"\\n 部署环境:{$stageName}\\n\");\n $this->line('');\n $this->info(\"\\n 部署服务器:{$serverName}\\n\");\n $this->line('');\n $this->info('******************************');\n $this->line('');\n if (!$this->confirm('请确实以上信息是否正确?')) {\n exit;\n }\n //多环境分别部署开始\n\n foreach ($environments as $environment){\n $this->siteName = 'sites';\n //处理目录\n if($environment !='prod') {\n $this->siteName = $this->siteName.\"_\".$environment;\n }\n\n $stageName = $this->stageNames[$environment];\n $this->warn(\"********开始部署{$stageName}环境********\");\n // 获取部署版本路径\n $releasePath = $this->syncProjectCode($project,$environment,$commit);\n //设置共享目录\n $this->shared_dirs($project,$environment,$releasePath);\n //设置共享文件\n $this->shared_files($project,$environment,$releasePath);\n // 设置current软链目录\n $this->symlink($project,$environment,$releasePath);\n // 清除旧版本文件\n $this->cleanup($project,$environment);\n // 发送邮件\n $this->send_email($project,$environment,$commit);\n }\n $this->info(\"发布成功结束!\");\n\n \n }", "public function run()\n {\n $this->buildPhpContainers();\n $this->buildNginxContainer();\n $this->buildDockerCompose();\n }", "function rpostinstall() {\n\t\tif (file_exists('composer.json')) {\n\t\t\t$composer = json_decode(file_get_contents('composer.json'));\n\t\t\t//debug($composer);\n\t\t\tif (isset($composer->scripts) && isset($composer->scripts->{'post-install-cmd'})) {\n\t\t\t\t$cmd = $this->composerCommand . ' run-script post-install-cmd';\n\t\t\t\t$deployPath = $this->getVersionPath();\n\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && ' . $cmd;\n\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t}\n\t\t}\n\t}", "public function prepareDeployment() {\n\t\t$bean = $this->unbox();\n\t\tif ($bean->id === 0) {\n\t\t\tR::store($this);\n\t\t}\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t$oldumask = umask(0); \n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\t$this->deploymentDir = $workdir . $this->id;\n\t\tif ($bean->type === 'rollback') {\n\t\t\t$this->queueTarget('RollbackPilot');\n\t\t\t$this->queueTarget('Rollback');\n\n\t\t\t$bean->rollback = false;\n\t\t} elseif ($bean->type === 'upgrade') {\n\t\t\t$this->queueTarget('UpgradePilot');\n\t\t\t$this->queueTarget('Upgrade');\n\n\t\t\t$bean->rollback = true;\n\t\t} else {\n\t\t\t$this->queueTarget('Deploy');\n\n\t\t\t$bean->rollback = true;\n\t\t}\n\t\t\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\tR::store($this);\n\t}", "public function process() {\n $this->migrate_course_files();\n // todo $this->migrate_site_files();\n }", "public function initiateDeployment() {\n\t\t$bean = $this->unbox();\n\t\t\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t\n\t\t$oldumask = umask(0);\n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\t$process = $this->getNextProcess();\n\t\t$process->status = 'Not started';\n\t\tR::store($process);\n\t\t$process->startProcessWrapper();\n\t}", "public function onDeploy($callback)\n {\n $this->deployCallback = $callback;\n }", "public function execute()\n {\n $configPath = Yii::getAlias($this->consoleConfig);\n $app = new Application(require($configPath));\n\n // Wipe current integration DB\n if ($this->wipeExistingDb) {\n $dbFile = Yii::getAlias($this->dbFile);\n if (file_exists($dbFile)) {\n unlink($dbFile);\n }\n }\n\n $parts = $app->createController('migrate/up');\n\n if ($parts === false) {\n throw new Exception('Could not create controller');\n }\n\n /* @var $controller MigrateController */\n list($controller, $actionID) = $parts;\n\n $controller->interactive = false;\n $result = $controller->runAction($actionID, []);\n if ($result !== null && $result !== MigrateController::EXIT_CODE_NORMAL) {\n throw new Exception('Exit status was ' . VarDumper::dumpAsString($result));\n }\n }", "public function execute()\n\t{\n\t\tChangeProject::getInstance()->executeTask('cd');\n\t\tChangeProject::getInstance()->executeTask('gdb');\n\t\tChangeProject::getInstance()->executeTask('ci18n', array('markergmaps'));\n\t\tChangeProject::getInstance()->executeTask('cb');\n\t\tChangeProject::getInstance()->executeTask('cec');\n\t\tChangeProject::getInstance()->executeTask('croles');\n\t\tChangeProject::getInstance()->executeTask('cperm');\n\t\tChangeProject::getInstance()->executeTask('import-data', array('markergmaps', 'init.xml'));\n\t}", "public function execute(): void\n {\n parent::execute();\n\n // Zip extension is required for theme upload\n if (!extension_loaded('zlib')) {\n $this->template->assign('zlibIsMissing', true);\n }\n\n if (!$this->isWritable()) {\n // we need write rights to upload files\n $this->template->assign('notWritable', true);\n } else {\n // everything allright, we can upload\n $this->buildForm();\n $this->validateForm();\n $this->parse();\n }\n\n // display the page\n $this->display();\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function execute()\n {\n\n try {\n // log a message that provisioning starts\n $this->getApplication()->getInitialContext()->getSystemLogger()->info(\n 'Now start to create database!'\n );\n\n // load the datasource node\n /** @var \\AppserverIo\\Appserver\\Core\\Api\\Node\\DatabaseNode $databaseNode */\n $databaseNode = $this->getDatasourceNode()->getDatabase();\n\n // load the connection data\n $user = $databaseNode->getUser();\n $db = $databaseNode->getDatabaseName();\n $host = $databaseNode->getDatabaseHost();\n $password = $databaseNode->getPassword();\n\n // create the connection\n $dbh = new \\PDO(sprintf('mysql:host=%s', $host), 'root');\n\n // execute the statement\n $dbh->exec(\"CREATE DATABASE `$db`;\n CREATE USER '$user'@'localhost' IDENTIFIED BY '$password';\n GRANT ALL ON `$db`.* TO '$user'@'localhost';\n FLUSH PRIVILEGES;\");\n\n // log a message that provisioning has been successfull\n $this->getApplication()->getInitialContext()->getSystemLogger()->info(\n 'Successfully created database!'\n );\n\n } catch (\\Exception $e) {\n $this->getApplication()->getInitialContext()->getSystemLogger()->error($e->__toString());\n }\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "protected function publishApprovalsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n }", "public function run() {\n \n // Require the base class\n $this->load->file(APPPATH . '/base/main.php');\n\n // List all user's apps\n foreach (glob(APPPATH . 'base/user/apps/collection/*', GLOB_ONLYDIR) as $directory) {\n\n // Get the directory's name\n $app = trim(basename($directory) . PHP_EOL);\n\n // Verify if the app is enabled\n if (!get_option('app_' . $app . '_enable')) {\n continue;\n }\n\n // Create an array\n $array = array(\n 'MidrubBase',\n 'User',\n 'Apps',\n 'Collection',\n ucfirst($app),\n 'Main'\n );\n\n // Implode the array above\n $cl = implode('\\\\', $array);\n\n // Run cron job commands\n (new $cl())->cron_jobs();\n }\n \n // Prepare allowed files\n $allowed_files = array(\n 'cron.php',\n 'index.php',\n 'ipn-listener.php',\n 'update.php'\n );\n \n // List all files\n foreach (glob(FCPATH . '/*.php') as $filename) {\n \n $name = str_replace(FCPATH . '/', '', $filename);\n\n if ( !in_array($name, $allowed_files) ) {\n \n $msg = 'Was detected and deleted the file ' . $filename . '. Please contact support if you don\\'t know this file.';\n \n $this->send_warning_message($msg);\n unlink($filename);\n \n } else {\n \n if ( $this->check_for_malware($filename) ) {\n \n $msg = 'Was detected malware in the file ' . $filename . ' and was deleted.';\n\n $this->send_warning_message($msg);\n unlink($filename);\n \n }\n \n }\n \n }\n \n $extensions = array(\n '.php3',\n '.php4',\n '.php5',\n '.php7',\n '.phtml',\n '.pht'\n );\n\n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH, $ext); \n }\n \n $extensions[] = '.php';\n \n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH . 'assets', $ext); \n }\n \n $this->check_for_non_midrub_files(FCPATH . 'assets');\n \n }", "public function runSetupScripts()\n\t\t{\n\t\t\t$xmlResources = \\Z::getConfig()->getResources();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tcatch (\\Sys\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->initialInstall();\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tforeach ($xmlResources as $name => $resource)\n\t\t\t{\n\t\t\t\t// this is the version we should have installed on our system\n\t\t\t\t$latestVersion = $resource['requiredVersion'];\n\t\t\t\t// this is the version we currently have on our system, if the\n\t\t\t\t// extension is installed at all\n\t\t\t\t$installedExtension = $installedResources->isInstalled($name);\n\t\t\t\tif ($installedExtension)\n\t\t\t\t\t$installedVersion = $installedExtension->getVersion();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$installedVersion = '0.0.0';\n\t\t\t\t\t$installedExtension = \\Z::getModel('core/extension');\n\t\t\t\t}\n\t\t\t\t$end = 'install-'.$latestVersion.'.php';\n\t\t\t\t$start = 'install-'.$installedVersion.'.php';\n\t\t\t\tif ($latestVersion != $installedVersion)\n\t\t\t\t{\n\t\t\t\t\t$installerFilesLocation = \\Z::getConfig()->getModule($resource['module'])->getPath('sql/'.$name.'/');\n\t\t\t\t\t$handle = opendir($installerFilesLocation);\n\t\t\t\t\tif ($handle)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (FALSE !== ($file = readdir($handle)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strpos($file, '.php') > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($file > $start) && ($file <= $end))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->_executedFiles[] = $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t//echo $installerFilesLocation.$file.'<br/>';\n\t\t\t\t\t\t\t\t\tinclude $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t// after the script is executed, set the\n\t\t\t\t\t\t\t\t\t// current version in the extension table\n\t\t\t\t\t\t\t\t\tif ($installedExtension->getCode() != '')\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion)\n\t\t\t\t\t\t\t\t\t\t\t->setCode($name);\n\t\t\t\t\t\t\t\t\t$installedExtension->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// execute the install script for $file\n\t\t\t\t\t\t\t\t// update the version in the table\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new \\Sys\\Exception('Cannot open the location => %s of the setup install scripts',\n\t\t\t\t\t\t\t$installerFilesLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function handle(): int\n {\n $action = $this->argument('action');\n $params = json_decode($this->option('params'), true);\n\n if (config('deploy.method') == 'cron') {\n $schedule = get_config('deploy_schedules', []);\n if (empty($schedule)) {\n return true;\n }\n\n $index = array_key_first($schedule);\n $action = $schedule[$index];\n unset($schedule[$index]);\n set_config('deploy_schedules', $schedule);\n\n if (is_array($action)) {\n $this->autoDeploy->run($action['action'], $action['params']);\n } else {\n $this->autoDeploy->run($action);\n }\n\n return self::SUCCESS;\n }\n\n $this->autoDeploy->run($action, $params);\n\n return self::SUCCESS;\n }", "private function publishAssets()\n {\n $this->call('vendor:publish', [\n '--provider' => 'A17\\Twill\\TwillServiceProvider',\n '--tag' => 'assets',\n '--force' => true,\n ]);\n }", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function exec ()\n {\n // download and config the kitFramework\n $this->downloadAndConfigTheFramework();\n\n $relative_path = parse_url(WB_URL, PHP_URL_PATH);\n if (!empty($relative_path) && file_exists(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt')) {\n $htaccess = file_get_contents(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt');\n $htaccess = str_ireplace('{RELATIVE_PATH}', \"$relative_path/kit2\", $htaccess);\n file_put_contents(WB_PATH.'/kit2/.htaccess', $htaccess);\n }\n\n // download and config the Basic extension\n $this->downloadAndConfigTheBasicExtension();\n\n // add the output filter for the framework\n $this->addFilter();\n\n // copy the proxy.json\n if (file_exists(WB_PATH.'/modules/kit_framework/proxy.json')) {\n if (file_exists(WB_PATH.'/kit2/config') && !file_exists(WB_PATH.'/kit2/config/proxy.json')) {\n @copy(WB_PATH.'/modules/kit_framework/proxy.json', WB_PATH.'/kit2/config/proxy.json');\n }\n }\n }", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "function deploy()\n {\n $client = new Client();\n\n $client->request('POST', $this->keyword->getToUrl(), ['form_params' => $this->payload]);\n }", "public function run() {\n\t\t$this->preRun();\n\n\t\t$this->changeTags();\n\n\t\t$this->postRun();\n\t}", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function run()\n\t{\n\t\t$this->upgrade_to_1_1_0();\n\t}", "public function execute()\n {\n $this->run();\n }", "protected function publishAllVendorFiles()\n {\n $this->info('[START] Publishing all vendor files..........');\n\n $this->call('vendor:publish', ['--all' => true]);\n\n $this->info('[DONE ] Publishing all vendor files.');\n }", "public function run()\n {\n $this->addReleases();\n }", "protected function publishURLsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n }", "function rcomposer() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t//$this->ssh_exec($this->composerCommand.' clear-cache');\n\t\t$this->ssh_exec($this->composerCommand.' config -g secure-http false');\n\t\t$remoteCmd = 'cd '.$deployPath.' && '.$this->composerCommand.' install --ignore-platform-reqs';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public static function deploy(Application $application, $request)\n {\n try {\n $application->server->exec(\n view('scripts.deployments.install-wordpress', [\n 'request' => $request,\n 'application' => $application,\n ])->render()\n );\n\n $application->server->exec(\n view('scripts.deployments.setup-nginx', [\n 'application' => $application,\n ])->render()\n );\n\n $application->server->exec(\"sudo systemctl restart nginx\");\n\n $application->deployment_script = view('scripts.apps.wordpress.wordpress-deploy-default', [\n 'application' => $application\n ])->render();\n\n $application->save();\n\n return $application->fresh();\n } catch (\\Exception $e) {\n \\Log::info($e);\n }\n }", "private function deploy(Config\\Config $config, $version = null) {\n\t\t\t$fs\t\t= new FileSystem($config);\n\t\t\t$svn\t= new Svn($fs, $config);\n\t\t\t$ftp\t= new Ftp($fs, $config);\n\n\t\t\t// get the current active revisions\n\t\t\t$versionFrom\t= $this->checkFtpVersion($config, $ftp);\n\t\t\t$versionTo\t\t= $this->checkSvnVersion($config, $svn, $version);\n\n\t\t\tLogger::info(Translations::get('version_ftp', array($versionFrom)));\n\t\t\tLogger::info(Translations::get('version_svn', array($versionTo)));\n\n\t\t\tif ($versionTo != $versionFrom) {\n\t\t\t\tLogger::debug('collecting changed files..');\n\t\t\t\t$files = $svn->checkoutChanges($versionTo, $versionFrom);\n\n\t\t\t\tLogger::warning('found ' . (count($files['changed'])) . ' files / directories that changed and ' . (count($files['deleted'])) . ' files to delete');\n\n\t\t\t\t// Create a .ver file\n\t\t\t\t$fs->addSvnVersion($versionTo);\n\n\t\t\t\t// we should create a changes object\n\t\t\t\t// instead of creating such arrays\n\t\t\t\t// or upload the version file manually\n\t\t\t\t// via a new function $ftp->upload()\n\t\t\t\t$files['changed'][$config->getVersionFile()] = array(\n\t\t\t\t\t'path' => $config->getVersionFile(),\n\t\t\t\t\t'tempPath' => $fs->getTempFolder() . $config->getVersionFile(),\n\t\t\t\t\t'svnPath' => ''\n\t\t\t\t);\n\n\t\t\t\t$ftp->putChanges($files);\n\t\t\t\tLogger::success('Deploy done');\n\t\t\t} else {\n\t\t\t\tLogger::success('Nothing to do - Up to date');\n\t\t\t}\n\n\t\t\t// db deploy\n\t\t\t// @todo build a own class for db deploy related functions\n\t\t\tif(isset($config->db)) {\n\t\t\t\t$folder\t= $svn->checkout($config->db->getRevisionFolder());\n\t\t\t\t$files\t= File::getDirectoryList($folder . DS);\n\n\t\t\t\t$revisionFiles = array();\n\t\t\t\tforeach($files as $file) {\n\t\t\t\t\t// check if the file contains a revision\n\t\t\t\t\tpreg_match('/r([\\d,-]+)/', basename($file), $matches);\n\t\t\t\t\tif(isset($matches[1])\t\t\t\t// file is valid if\n\t\t\t\t\t\t&& is_numeric($matches[1])\t\t// contains a number\n\t\t\t\t\t\t&& $matches[1] > $versionFrom\t// the number is greater than the current revision\n\t\t\t\t\t\t&& $matches[1] <= $versionTo\t// and the number is smaller than the target revision\n\t\t\t\t\t) {\n\t\t\t\t\t\t$revisionFiles[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// there are sql files to deploy\n\t\t\t\t// so connect to database and do a backup\n\t\t\t\tif(sizeOf($revisionFiles) > 0) {\n\t\t\t\t\t// connect to db\n\t\t\t\t\t$db = new \\XDUtils\\Database();\n\t\t\t\t\t$db->connect(\n\t\t\t\t\t\t$config->db->getServer(),\n\t\t\t\t\t\t$config->db->getUser(),\n\t\t\t\t\t\t$config->db->getPassword(),\n\t\t\t\t\t\t$config->db->getName()\n\t\t\t\t\t);\n\t\t\t\t\t$db->set_charset();\n\n\t\t\t\t\t// backup current database\n\t\t\t\t\tLogger::notice('[DB] Start Backup');\n\t\t\t\t\t$db->backupDatabase(ROOT . DS . 'dbbackup' . DS . 'backup-' . $config->db->getName() . '-' . time() . '.sql');\n\t\t\t\t\tLogger::success('[DB] Backup done');\n\n\t\t\t\t\t// deploy new revisions to db\n\t\t\t\t\tforeach($revisionFiles as $sqlFile) {\n\t\t\t\t\t\tLogger::info('[DB] Deploy revision file: ' . $sqlFile);\n\t\t\t\t\t\t$db->parse_file($sqlFile);\n\t\t\t\t\t\tLogger::success('[DB] Deploy done');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// remove the temp folder\n\t\t\t$fs->removeTempFolder();\n\t\t\treturn true;\n\t\t}", "protected function invokeScript() {\n $fileSystem = $this->system->getFileSystem();\n\n $directory = $fileSystem->getTemporaryFile();\n $directory->delete();\n $directory->create();\n $directoryAbsolute = $directory->getAbsolutePath();\n\n $this->appendOutput(\"# Created working directory \" . $directoryAbsolute);\n\n $cwd = getcwd();\n $exception = null;\n\n try {\n chdir($directoryAbsolute);\n\n $variables = $this->getCommandVariables($directoryAbsolute);\n\n $commands = array();\n if ($this->builder->getWillCheckout()) {\n $commands = array_merge($commands, $this->vcsManager->getCheckoutCommands());\n }\n $commands = array_merge($commands, explode(\"\\n\", $this->builder->getScript()));\n\n foreach ($commands as $command) {\n $command = $this->parseCommandVariables($command, $variables);\n\n $this->appendOutput($command);\n\n if (substr($command, 0, 3) == 'cd ') {\n chdir(substr($command, 3));\n\n continue;\n }\n\n // if (strpos($command, ' 2>') === false) {\n // $command .= ' 2>&1';\n // }\n\n $output = $this->system->executeInShell(array('export PATH=/usr/local/bin:/usr/bin:$PATH', $command), $code);\n if ($code != 0) {\n throw new Exception('Command returned code ' . $code . ': ' . $command);\n }\n\n $output = array_slice($output, 4);\n\n $this->appendCommandOutput($output);\n }\n } catch (Exception $exception) {\n $this->setException($exception);\n }\n\n chdir($cwd);\n $directory->delete();\n\n $this->appendOutput(\"# Deleted working directory \" . $directory->getAbsolutePath());\n }", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function deploy($src, $dest)\n {\n $this->taskCopyDir(array($src => $dest))->run();\n }", "public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}", "public static function deploy() {\n\n\t\t$licence = null;\n\n\t\t// Check if we're allowed to install plugins before proceeding\n\t\t$this->check_capabilities();\n\n\t\t$download = $_POST['download'];\n\n\t\tif ( ! $_POST['edd_deploy'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this is a chargeable product and a license is needed,\n\t\t// Try to validate it and if valid, activate it.\n\t\tif ( isset( $_POST['license'] ) ) {\n\n\t\t\t$license = $_POST['license'];\n\n\t\t\t$api_args = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_name' => urlencode( $download )\n\t\t\t);\n\n\t\t\t// Get a response from our EDD server\n\t\t\t$response = wp_remote_get( add_query_arg( $api_args, $this->api_url ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// If the licence is not valid, early exit.\n\t\t\tif ( 'valid' != $license_data->license ) {\n\t\t\t\treturn;\n\t\t\t\t// TODO: Add an error message.\n\t\t\t}\n\n\t\t}\n\n\t\t// Get the download\n\t\t$api_args = array(\n\t\t\t'edd_action' => 'get_download',\n\t\t\t'item_name' => urlencode( $download ),\n\t\t\t'license'\t => $license,\n\t\t);\n\n\t\t$download_link = add_query_arg( $api_args, $this->api_url );\n\n\t\tif ( ! class_exists( 'Plugin_Upgrader' ) ) {\n\t\t\tinclude_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t\t}\n\n\t\t$upgrader = new Plugin_Upgrader( $skin = new Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) );\n\t\t$install = $upgrader->install( $download_link );\n\n\t\tif ( $install == 1 ) {\n\n\t\t\t// TODO: Install the plugin.\n\n\t\t}\n\n\t\tdie();\n\n\t}", "public function run()\n {\n\n Environment::insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'short_name' => 'DEV',\n 'long_name' => 'Local',\n 'active' => 1,\n ]);\n\n Environment::insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'short_name' => 'PROD',\n 'long_name' => 'Production',\n 'active' => 1,\n ]);\n \n }", "public function run()\n {\n // default permissions\n $permissions = [\n 'role.index',\n 'role.create',\n 'role.edit',\n 'role.delete',\n 'user.index',\n 'user.create',\n 'user.edit',\n 'user.delete',\n 'permission.index',\n 'permission.create',\n 'permission.edit',\n 'permission.delete',\n 'product.index',\n 'product.create',\n 'product.edit',\n 'product.delete',\n 'bug.index',\n 'bug.delete',\n 'audit.index',\n 'audit.delete',\n 'api.uploadMedia'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n\n // default role\n $role = Role::create([\n 'id' => 2,\n 'name' => 'super-admin'\n ]);\n\n // sync permissions to role\n $role->syncPermissions($permissions);\n\n }", "public function execute(): void\n {\n $fileDirectoryPath = $this->filesystem->getDirectoryWrite(DirectoryList::PUB);\n $fileName = 'googleshopping.xml';\n try {\n $xmldata = $this->xmlFeed->getFeed();\n if (strlen($xmldata) > 500) {\n $fileDirectoryPath->writeFile($fileName, $xmldata);\n } else {\n $this->logger->error('Google Shopping XML Data not generated correctly');\n }\n } catch (\\Exception $exception) {\n $this->logger->error($exception->getMessage());\n }\n }", "public function run()\n {\n\n $this->repo->generate(3);\n\n }", "public function deploy($deploy_ids, $category, $template_id)\n {\n\n $users = $this->getUsersArray($deploy_ids, $category);\n\n $has_users = $this->checkUsers($users, $template_id);\n\n if ($has_users) {\n\n $result = $this->deployToUsers($users, $template_id);\n\n } else {\n\n $result = 0;\n\n }\n\n return $result;\n\n\n }", "public function run()\n {\n \t$packages = [\n \t\t'basic'\t=> [\n \t\t\t'name'\t\t=> 'Basic Package',\n \t\t\t'features'\t=> 'Up to 10 pages',\n \t\t\t'monthly_cost'\t=> 5000,\n \t\t\t'setup_cost'\t=> 15000\n \t\t],\n \t\t'business'\t=> [\n \t\t\t'name'\t\t=> 'Business Package',\n \t\t\t'features'\t=> 'Up to 25 pages',\n \t\t\t'monthly_cost'\t=> 6500,\n \t\t\t'setup_cost'\t=> 25000\n \t\t],\n \t];\n\n \tforeach ( $packages as $key => $package ) {\n \t\tPackage::create([\n \t\t\t'name'\t\t=> $package['name'],\n \t\t\t'features'\t=> $package['features'],\n \t\t\t'monthly_cost'\t=> $package['monthly_cost'],\n \t\t\t'setup_cost'\t=> $package['setup_cost'],\n \t\t]);\n \t}\n }", "public function handle(): int\n {\n $this->info($this->logPrefix.'Starting...');\n\n $this->call('config:clear');\n\n $this->runViewCompiler();\n\n $this->runRefreshManifest();\n\n $this->info($this->logPrefix.'Ready to Deploy!');\n\n return 0;\n }", "public function run(array $params)\n {\n try {\n $this->call('boilerplate:publish');\n // migrate all first\n $this->call('migrate');\n // then seed data\n $seeder = Database::seeder();\n $seeder->call('julio101290\\boilerplate\\Database\\Seeds\\BoilerplateSeeder');\n } catch (\\Exception $e) {\n $this->showError($e);\n }\n }", "public function run(array $params)\n {\n $this->determineSourcePath();\n\n // Config\n if (CLI::prompt('Publish Config file?', ['y', 'n']) == 'y')\n {\n $this->publishConfig();\n }\n \n // Migration\n if (CLI::prompt('Publish queue migration?', ['y', 'n']) == 'y')\n {\n $this->publishMigration();\n }\n\n\n }", "public function run()\n {\n echo 'Generating build... ';\n\n Util::cleanDirectory($this->outputDir);\n $this->generateFiles();\n\n echo \"OK\\n\";\n }", "private function insertApplyFunc()\n {\n $script = $this->rootDir . '/excmd/asrorz.php';\n $params = 'cruds/insert/apply --app=' . $this->newName;\n $phpcmd = 'php ' . $script . ' ' . $params;\n\n Az::debug($phpcmd, 'command to launch: ');\n $r = shell_exec($phpcmd);\n Az::debug($phpcmd, 'command executed: ');\n Az::debug($r, 'command result: ');\n }", "public function run() {\n $this->cleanupFilesystem();\n $this->downloadCommunityRegistry();\n $this->downloadAllCommunityDefinitions();\n $this->saveCommunicationDetails();\n }", "protected function publishFaxesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n }", "private function triggerGruntTask()\n {\n $has_run = false;\n foreach ($this->config->map as $slug => $clone_url) {\n if ($clone_url === $this->request->cloneUrl()) {\n $this->triggerGrunt($slug);\n $has_run = true;\n }\n }\n //message about no support\n if ($has_run) {\n $msg = 'The grunt tasks associated with ' . $this->request->url() . ' completed successfully.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 200 OK');\n exit($msg);\n\n }\n $msg = 'There are no grunt tasks associated with ' . $this->request->url() . '.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 200 OK');\n exit($msg);\n }", "function deployment_admin_init() {\n\n\t// What is the current version of this plugin?\n\t$deployment_version = 3;\n\n\t// What is the current version in the db\n\t$db_version = get_option( 'deployment_version', 0 );\n\n\t// Is the db out of date?\n\tif ( $db_version < $deployment_version ) {\n\n\t\t// If so, loop over all subsequent version numbers and attempt to run corresponding deployment_update_N functions\n\t\tfor ( $version = $db_version + 1; $version <= $deployment_version; $version ++ ) {\n\t\t\tif ( function_exists( 'deployment_update_' . $version ) ) {\n\t\t\t\t$success = call_user_func( 'deployment_update_' . $version );\n\n\t\t\t\t// If the function returns a boolean false, log an error and bail out. Subsequent updates may rely on this update\n\t\t\t\t// so we shouldn't proceed any further.\n\t\t\t\tif ( $success === FALSE ) {\n\t\t\t\t\t// @TODO: log error here\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we've reached this far without error, update the db version\n\t\t\tupdate_option( 'deployment_version', $version );\n\t\t}\n\n\t\t// @TODO: output update summary on success\n\t}\n}", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "protected function execute(InputInterface $input, OutputInterface $output) {\n $this->output = $output;\n $this->input = $input;\n\n // Set API token and set forge service to public variable\n $this->output('Forge API token: ' . $this->getToken());\n $forge = new Forge($this->getToken());\n $this->forge = $forge;\n\n try {\n // Find the server\n $server = $forge->server($this->getServer());\n $this->output(\"Server found.\");\n } catch (Exception $_) {\n $this->output(\"Failed to find server.\");\n return Command::FAILURE;\n }\n\n // Find or create the site\n $site = $this->findOrCreateSite($server);\n // Finalize deployment with scripts and environment variables\n $this->finalizeDeployment($server, $site);\n\n return Command::SUCCESS;\n }", "public function run()\n {\n $seedForDevelopment = [\n DefaultCurrencySeeder::class,\n DefaultUserAdminSeeder::class,\n DefaultCustomerSeeder::class,\n FakeProductTypeSeeder::class,\n FakeProductSeeder::class\n ];\n\n // add condition here if for production\n $toBeSeeded = $seedForDevelopment;\n \n $this->call($toBeSeeded);\n }", "protected function execute($arguments = array(), $options = array())\n {\n// $databaseManager = new sfDatabaseManager($this->configuration);\n// $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\n $fs = new sfFilesystem();\n \n if(!file_exists(dirname(__FILE__).'/../../../../cache'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../cache');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../log'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../log');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/uploads'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/uploads');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../uploads/assets'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/uploads/assets');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/images'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/images');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/js'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/js');\n }\n \n \n $this->runTask('project:permission');\n $this->runTask('plugin:publish-assets');\n\n $files = array(\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/config/config.php',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata/saml20-sp-remote.php',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata/saml20-idp-remote.php',\n dirname(__FILE__) . '/../../../sftPAPIPlugin/lib/vendor/phpPoA-2.3/PAPI.conf',\n dirname(__FILE__) . '/../../../sftPAPIPlugin/lib/vendor/phpPoA-2.3/pubkey.pem',\n );\n\n //print_r($files);\n $fs->chmod($files, 0777);\n\n $originDir = dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/www';\n $targetDir = dirname(__FILE__) . '/../../../../web/simplesaml';\n //print_r($originDir);\n //print_r($targetDir);\n\n $fs->relativeSymlink($originDir, $targetDir, true);\n\n // add your code here\n }", "private function command(){\n\n // $processAssets->run(function ($type, $buffer) {\n // $this->output->writeln(\n // $buffer\n // );\n // });\n\n $process = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --create-or-update-index-structure'), null, null, null, 900);\n\n $process->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n\n $process1 = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --update-index'), null, null, null, 900);\n\n $process1->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n }", "public function upload() {\n // FYI. We are on master now.\n $m_ftp = new \\Model_Ftp();\n $m_ftp->user_id = $this->user_id;\n $branch = $this->branch;\n // Get ftp data for the respective branch\n $ftp_data = $m_ftp->get($branch['ftp_id']);\n\n if (count($ftp_data) !== 1) {\n $this->log('Failed: Enviornment does not have a Linked FTP account.');\n throw new Exception(\"No Linked FTP for enviornment.\");\n } else {\n $ftp_data = $ftp_data[0];\n }\n\n // Testing if the FTP server works.\n try {\n $ftp_data['user'] = $ftp_data['username'];\n $ftp_url = http_build_url($ftp_data);\n// $ftp_test = utils::test_ftp($ftp_url);\n $ftp_test = new \\Banago\\Bridge\\Bridge($ftp_url);\n if ($ftp_test) {\n $this->log('ftp_connect', 'connected');\n }\n } catch (Exception $e) {\n $this->log('ftp_connect', 'connection failed: ' . $e->getMessage());\n throw new Exception('We are sending msg here.' . $e->getMessage());\n }\n\n // LOG --------------------------------\n $this->log('deploy_branch', $branch['branch_name']);\n $this->log('deploy_branch_env', $branch['name']);\n $this->output('Deploy to branch name: ' . $branch['branch_name']);\n // LOG END ----------------------------\n\n /*\n * Data is ready, need to get ready with repository state.\n * Has to be checked out to the branch specified\n * and has to be checked out to the commit specified.\n */\n\n /*\n * pull and clone done,\n * checkout to branch now.\n */\n\n $this->output('Checkout to ' . $branch['branch_name']);\n \\Utils::gitCommand(\"checkout \" . $this->branch['branch_name']);\n $this->log('revision_on_server_before', $branch['revision']);\n $this->output('Revision on FTP: ' . $branch['revision']);\n\n // Setting options for gitcore\n $options = array(\n 'record_id' => $this->record_id,\n 'repo' => $this->repo_dir,\n 'debug' => $this->debug,\n 'deploy_id' => $this->deploy_id,\n 'server' => 'default',\n 'ftp' => array(\n 'default' => array(\n 'scheme' => $ftp_data['scheme'],\n 'host' => $ftp_data['host'],\n 'user' => $ftp_data['username'],\n 'pass' => $ftp_data['pass'],\n 'port' => $ftp_data['port'],\n 'path' => $ftp_data['path'],\n 'passive' => TRUE,\n 'skip' => unserialize($this->branch['skip_path']),\n 'purge' => unserialize($this->branch['purge_path']),\n )\n ),\n 'remoteRevision' => $branch['revision'],\n );\n\n // if type_rollback.\n if ($this->record['record_type'] == $this->m_record->type_rollback && !empty($this->record['hash'])) {\n // checkout the the specific hash.\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // if type_sync\n if ($this->record['record_type'] == $this->m_record->type_sync) {\n // upload all files please.\n $options['remoteRevision'] = '';\n }\n\n if ($this->record['record_type'] == $this->m_record->type_service_push) {\n // push from github/bitbucket.\n if (!empty($this->record['hash']))\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // else its update\n\n $localRevision = \\Utils::gitCommand('rev-parse HEAD');\n if (isset($localRevision[0])) {\n $localRevision = trim($localRevision[0]);\n $options['localRevision'] = $localRevision;\n }\n\n if ($options['localRevision'] == $options['remoteRevision']) {\n $this->output('FTP server has the latest changes!');\n $this->log('FTP server has the latest changes!');\n }\n\n $this->output($localRevision);\n\n $gitcore = new \\Gitcore($options);\n try {\n // todo: we're inside.\n $gitcore->startDeploy();\n } catch (Exception $e) {\n // Store logs from GITCORE.\n $this->log('deploy_log', $gitcore->log);\n $this->output($this->log);\n throw new \\Exception($e->getMessage());\n }\n\n // Store Logs from GITCORE.\n $this->log['deploy_log'] = $gitcore->log;\n $this->output($this->log);\n\n $before_revision = $this->log['deploy_log']['remoteRevision_before'];\n $current_revision = $this->log['deploy_log']['remoteRevision_after'];\n\n // Storing output from GITCORE.\n $this->m_record->set($this->record_id, array(\n 'raw' => serialize($this->log),\n 'amount_deployed' => $this->log['deploy_log']['deployed']['human'],\n 'amount_deployed_raw' => $this->log['deploy_log']['deployed']['data'],\n 'file_add' => $this->log['deploy_log']['files']['upload'],\n 'file_remove' => $this->log['deploy_log']['files']['delete'],\n 'file_skip' => $this->log['deploy_log']['files']['skip'],\n 'hash' => $current_revision,\n 'hash_before' => $before_revision,\n ));\n\n // OK,\n // Update branch to ready,\n // Update branch revision.\n $this->m_branches->set($branch['id'], array(\n 'ready' => 1,\n 'revision' => $current_revision\n ));\n\n // OK, checkout to master.\n \\Utils::gitCommand('checkout master');\n }", "public function run()\n {\n $this->createPermissions();\n\n $this->assignPermissionRole();\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function execute() {\r\n\t\t$bootstrap = $this->objectManager->create('Tx_Extbase_Core_Bootstrap');\r\n\t\t$configuration = array(\r\n\t\t\t'extensionName' => $this->getExtensionName(),\r\n\t\t\t'pluginName' => $this->getPluginName()\r\n\t\t);\r\n\t\treturn $bootstrap->run('', $configuration);\r\n\t}", "public function run()\n {\n $roles = [\n [\n 'name' => 'admin'\n ],\n [\n 'name' => 'front'\n ]\n ];\n foreach ($roles as $role) {\n $this->roleService->updateOrCreate(['name' => $role['name']], $role);\n }\n }", "public function run()\n {\n factory(App\\Models\\Post::class, 100)->create();\n\n $dir = 'public/pages/';\n $posts = App\\Models\\Post::all();\n foreach ($posts as $post) {\n if (isset($post->image) && Storage::exists($dir . $post->image)) {\n Storage::move($dir . $post->image, $dir . $post->page_id . '/' . $post->id . '/' . $post->image);\n }\n }\n }", "public function __invoke()\n {\n Helpers::step('<options=bold>Setting Build Environment</>');\n\n if (! file_exists($envPath = $this->appPath.'/.env')) {\n $this->files->put($envPath, '');\n }\n\n if (file_exists($this->appPath.'/.env.'.$this->environment)) {\n $this->files->copy(\n $this->appPath.'/.env.'.$this->environment,\n $envPath\n );\n\n $this->files->delete($this->appPath.'/.env.'.$this->environment);\n }\n\n $this->files->prepend(\n $envPath,\n 'APP_ENV='.$this->environment.PHP_EOL\n );\n\n // Mix takes the last environment variable value...\n $this->files->append(\n $envPath,\n PHP_EOL.'APP_ENV='.$this->environment.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'MIX_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'VITE_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n }", "public function run() {\n\t\t$this->create_instances();\n\t\t$this->register_hooks();\n\t}", "private function _post()\n\t{\n\t\t$sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';\n\t\tif (!file_exists($sCacheModules))\n\t\t{\n\t\t\t// Something went wrong...\n\t\t}\t\t\n\t\trequire_once($sCacheModules);\t\t\n\t\t\n\t\t$oModuleProcess = Phpfox::getService('admincp.module.process');\t\t\n\t\tforeach ($aModules as $sModule)\n\t\t{\t\t\n\t\t\t$oModuleProcess->install($sModule, array('post_install' => true));\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->_pass();\n\t\t$this->_oTpl->assign(array(\n\t\t\t\t'sMessage' => 'Post install completed...',\n\t\t\t\t'sNext' => $this->_step('final')\n\t\t\t)\n\t\t);\n\t}", "function execute() {\n\t\t$fileMgr = new FileManager();\n\t\t$filesDir = Config::getVar('files', 'files_dir');\n\t\t$filePath = current($this->argv);\n\t\t$usageStatsDir = $this->_usageStatsDir;\n\t\t$tmpDir = $this->_tmpDir;\n\n\t\tif ($fileMgr->fileExists($tmpDir, 'dir')) {\n\t\t\t$fileMgr->rmtree($tmpDir);\n\t\t}\n\n\t\tif (!$fileMgr->mkdir($tmpDir)) {\n\t\t\tprintf(__('admin.copyAccessLogFileTool.error.creatingFolder', array('tmpDir' => $tmpDir)) . \"\\n\");\n\t\t\texit(1);\n\t\t}\n\n\t\tif ($fileMgr->fileExists($filePath, 'dir')) {\n\t\t\t// Directory.\n\t\t\t$filesToCopy = glob($filePath . DIRECTORY_SEPARATOR . '*.*');\n\t\t\tforeach ($filesToCopy as $file) {\n\t\t\t\t// If a base filename is given as a parameter, check it.\n\t\t\t\tif (count($this->argv) == 2) {\n\t\t\t\t\t$baseFilename = $this->argv[1];\n\t\t\t\t\tif (strpos(pathinfo($file, PATHINFO_BASENAME), $baseFilename) !== 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->_copyFile($file);\n\t\t\t}\n\t\t} else {\n\t\t\tif ($fileMgr->fileExists($filePath)) {\n\t\t\t\t// File.\n\t\t\t\t$this->_copyFile($filePath);\n\t\t\t} else {\n\t\t\t\t// Can't access.\n\t\t\t\tprintf(__('admin.copyAccessLogFileTool.error.acessingFile', array('filePath' => $filePath)) . \"\\n\");\n\t\t\t}\n\t\t}\n\n\t\t$fileMgr->rmtree($tmpDir);\n\t}" ]
[ "0.7791337", "0.75530183", "0.7403991", "0.7403991", "0.71118796", "0.6850574", "0.6759336", "0.64493597", "0.64446783", "0.64348465", "0.6363942", "0.630397", "0.63000774", "0.6112146", "0.60748327", "0.6056126", "0.6055078", "0.60430974", "0.60372525", "0.60299265", "0.60264647", "0.59728", "0.5948948", "0.5948948", "0.5941726", "0.5939015", "0.59219", "0.591228", "0.5908461", "0.59007865", "0.5892797", "0.5892352", "0.58777493", "0.5867952", "0.5851221", "0.5831121", "0.582949", "0.5820427", "0.57965434", "0.5776412", "0.57288194", "0.5709042", "0.57071656", "0.565422", "0.5643134", "0.56385356", "0.562954", "0.5592192", "0.5588492", "0.5565037", "0.55635214", "0.5559131", "0.5553065", "0.55186284", "0.55073285", "0.5506936", "0.55059636", "0.5504575", "0.54902184", "0.5476341", "0.547459", "0.5471688", "0.54688567", "0.5456132", "0.5443195", "0.5428645", "0.542842", "0.5425357", "0.5416968", "0.54133624", "0.5410892", "0.5403952", "0.5397631", "0.5393897", "0.5385018", "0.5379247", "0.53785706", "0.53782946", "0.5377962", "0.5375244", "0.53671265", "0.5354426", "0.5353387", "0.53499746", "0.5348224", "0.5347109", "0.534532", "0.5328572", "0.53279", "0.5326185", "0.5324225", "0.5320901", "0.53160244", "0.5307257", "0.5297049", "0.5295615", "0.5291124", "0.5264273", "0.52609646", "0.52584237" ]
0.8422718
0
Tests commands needed for deployment
Команды тестирования, необходимые для деплоя
public function test_commands() { // test git if ( ! $this->test_cmd( 'git' ) ) { error( '501 Not Implemented', '<code>git</code> is not installed' ); } // if we're running a slim deploy but the remote deosn't support `git archive`, // we need svn to run `svn export` if ( SLIM && ($this->config->schema[ 'git_archive' ] === false) && ! $this->test_cmd( "svn" ) ) { error( '501 Not Implemented', '<code>svn</code> is not installed' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeploy()\n {\n }", "public function beforeStartingDeploy()\n {\n // $this->runLocal('./vendor/bin/simple-phpunit');\n }", "public function testNameAndArguments()\n {\n $this->assertEquals('contao:install-web-dir', $this->command->getName());\n $this->assertTrue($this->command->getDefinition()->hasArgument('path'));\n }", "public function testDrushCommands() {\n // Try to execute the ach-purge command without registration.\n $this->drush('ach-purge', [], $this->siteOptions, NULL, NULL, self::EXIT_ERROR, '-y');\n $output = $this->getErrorOutput();\n $this->assertContains('Error trying to connect to the Content Hub', $output);\n\n // Register the site by using ach-connect drush command.\n $this->drush(\n 'ach-connect', [\n 'admin',\n 'admin',\n 'http://127.0.0.1:5000',\n 'mastersite',\n ],\n $this->siteOptions\n );\n $output = $this->getErrorOutput();\n $this->assertContains('The configuration options have been saved.', $output, 'Acquia Content Hub Admin Configuration saved correctly.');\n $this->assertContains('Successful Client registration', $output, 'Successful Client registration.');\n\n // Execute ach-purge command.\n $this->drush('ach-purge', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS, '-y');\n $output = $this->getOutput();\n $this->assertContains('PROCEED WITH CAUTION. THIS ACTION WILL PURGE ALL EXISTING ENTITIES IN YOUR CONTENT HUB SUBSCRIPTION.', $output);\n $this->assertContains('Your Subscription is being purged. All clients who have registered to received webhooks will be notified with a reindex webhook when the purge process has been completed.', $output);\n\n // Execute ach-restore command.\n $this->drush('ach-restore', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS, '-y');\n $output = $this->getOutput();\n $this->assertContains('PROCEED WITH CAUTION. THIS ACTION WILL ELIMINATE ALL EXISTING ENTITIES IN YOUR CONTENT HUB SUBSCRIPTION.', $output);\n $this->assertContains('Your Subscription is being restored. All clients who have registered to received webhooks will be notified with a reindex webhook when the restore process has been completed.', $output);\n\n // Execute ach-logs command.\n $this->drush('ach-logs', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS);\n $output = $this->getOutput();\n $this->assertContains('Timestamp', $output);\n $this->assertContains('Type', $output);\n $this->assertContains('Client', $output);\n $this->assertContains('Entity UUID', $output);\n $this->assertContains('ID', $output);\n $this->assertContains('Request ID', $output);\n $this->assertContains('Status', $output);\n\n // Execute ach-mapping command.\n $this->drush('ach-mapping', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS);\n $output = $this->getOutput();\n $mapping = json_decode($output, TRUE);\n\n // Because this test is working with the Plexus Mock, this expected output\n // has to match this:\n // https://github.com/acquia/content-hub-scripts/blob/master/plexus_mock/examples/_mapping.json.\n $expected = [\n 'entity' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'data' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'assets' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'replace-token' => [\n 'type' => 'string',\n ],\n 'url' => [\n 'type' => 'string',\n ],\n ],\n ],\n 'attributes' => [\n 'dynamic' => 'true',\n 'properties' => [\n 'title' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'metadata' => [\n 'type' => 'string',\n ],\n 'type' => [\n 'type' => 'string',\n ],\n 'value' => [\n 'dynamic' => 'true',\n 'properties' => [\n 'und' => [\n 'type' => 'string',\n ],\n ],\n ],\n ],\n ],\n ],\n 'type' => 'object',\n ],\n 'created' => [\n 'type' => 'date',\n ],\n 'metadata' => [\n 'dynamic' => 'true',\n 'index' => 'no',\n 'type' => 'object',\n ],\n 'modified' => [\n 'type' => 'date',\n ],\n 'origin' => [\n 'type' => 'string',\n ],\n 'type' => [\n 'type' => 'string',\n ],\n 'uuid' => [\n 'type' => 'string',\n ],\n ],\n ],\n 'id' => [\n 'type' => 'string',\n ],\n 'origin' => [\n 'index' => 'not_analyzed',\n 'type' => 'string',\n ],\n 'revision' => [\n 'type' => 'long',\n ],\n 'subscription' => [\n 'type' => 'string',\n ],\n 'uuid' => [\n 'index' => 'not_analyzed',\n 'type' => 'string',\n ],\n ],\n ],\n ];\n $this->assertEquals($expected, $mapping);\n }", "public function testMigrationsSubcommands()\n {\n $this->exec('completion subcommands migrations.migrations');\n $expected = [\n 'orm-cache-build orm-cache-clear create dump mark_migrated migrate rollback seed status',\n ];\n $actual = $this->_out->messages();\n $this->assertEquals($expected, $actual);\n }", "public function setUp()\n {\n parent::setUp();\n\n $command = $this->getCommand();\n $this->application->add($command);\n $command->setContainer($this->container);\n }", "public function setUp()\n {\n $this->deploy_path = 'deploy_dir';\n $this->root = vfsStream::setup($this->deploy_path, null, array(\n 'releases' => array(\n 'previous_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n ),\n 'current_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n ),\n 'new_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n )\n )\n ));\n\n $this->phinxDeploy = new Deploy('bin/phinx', array('phinx.yml'));\n $this->phinxDeploy->setDeployPath(vfsStream::url($this->deploy_path));\n\n $this->logger = $this->getMock('Monolog\\Logger', array(), array(\"deploy\"));\n $this->phinxDeploy->setLogger($this->logger);\n\n $this->utils = $this->getMock('Deploy\\Core\\Utils', array('exec'), array($this->logger));\n $this->phinxDeploy->setUtils($this->utils);\n\n $filesystem = new TestFileSystem();\n $this->utils->setFilesystem($filesystem);\n }", "public function buildsCommands()\n {\n $client = ScaleEngineClient::factory(['apiSecret' => 'test']);\n $command = $client->getCommand('requestTicket');\n\n $this->assertInstanceOf('\\Guzzle\\Service\\Command\\CommandInterface', $command);\n }", "public function beforeFinishingDeploy()\n {\n // $this->runRemote('{{ console_bin }} app:my-task-name');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function test_when_generate_tools_command_creates_the_containers_script()\n {\n $this->artisan('generate-tools')\n ->expectsOutput('containers script generated!')\n ->assertExitCode(0);\n\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/containers');\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->setPaths();\n\n $this->files = new Filesystem();\n\n if (!is_dir(env_path())) {\n mkdir(env_path());\n }\n\n copy(__DIR__ . '/../.env.example',env_path('.env'));\n\n $this->artisan('vendor:publish',['--provider' => 'Gecche\\Multidomain\\Foundation\\Providers\\DomainConsoleServiceProvider']);\n\n\n }", "public function setUp()\n {\n $this->CT = new CommandTester();\n $this->CT->add(new UtilityTask);\n }", "public function testCommand()\n {\n \tif (!file_exists('/usr/bin/svn')) $this->markTestSkipped(\"Unable to test command: /usr/bin/svn does not exist.\");\n\n \t$url = \"svn://office.javeline.nl/jasny/qdb/trunk\";\n \t$list = shell_exec('/usr/bin/svn list ' . escapeshellarg($url));\n \t\n \t$client = new RPC_Client_Exec('/usr/bin/svn');\n \t$svn = $client->getInterface();\n \t$this->assertEquals($list, $svn->list($url));\n }", "public function testExecute():void\n {\n $this->assertEquals(0,$this->commandTester->execute([]));\n\n //Assert command display\n $this->assertEquals(\n 'Sample command without interactions' . PHP_EOL,\n $this->commandTester->getDisplay()\n );\n }", "public function testMaintenanceSet()\n {\n// $this->commandTester->execute(\n// [\n// 'command' => $this->maintenanceCommand->getName(),\n// ToggleMaintenanceCommand::MAINTENANCE_PARAMETER => 1,\n// ]\n// );\n//\n// $this->assertTrue(\n// $this\n// ->filesystem\n// ->exists($this->exposedDir . DIRECTORY_SEPARATOR . ToggleMaintenanceCommand::FILE_NAME)\n// );\n//\n// $this->client->request('GET', '/');\n// $this->assertEquals(Response::HTTP_SERVICE_UNAVAILABLE, $this->client->getResponse()->getStatusCode());\n }", "public function testAction()\n {\n echo shell_exec(\"mysql -u root -e 'CREATE DATABASE IF NOT EXISTS \" . $this->config->database->dbname . \";'\");\n // Run migrations if necessary\n echo shell_exec('php vendor/bin/phinx migrate -e test -c config/phinx.php') . \"\\n\";\n }", "public static function beforeDeploy()\n {\n self::$logger = new \\Monolog\\Logger('phpunit');\n\n $dbConn = self::requireEnv('SYMFONY_CLOUDSQL_CONNECTION_NAME');\n $dbName = self::requireEnv('SYMFONY_DB_DATABASE');\n $dbPass = self::requireEnv('SYMFONY_DB_PASSWORD');\n\n // Create the Symfony project in a temporary directory\n $symfonyDir = self::createSymfonyProject();\n self::updateKernelCacheAndLogDir($symfonyDir);\n\n // copy and set the proper env vars in app.yaml\n $appYaml = file_get_contents(__DIR__ . '/../app.yaml');\n $appYaml = str_replace('# DATABASE_URL', 'DATABASE_URL', $appYaml);\n $appYaml = str_replace('DB_PASSWORD', $dbPass, $appYaml);\n $appYaml = str_replace('INSTANCE_CONNECTION_NAME', $dbConn, $appYaml);\n $appYaml = str_replace('symfonydb', $dbName, $appYaml);\n\n file_put_contents($symfonyDir . '/app.yaml', $appYaml);\n }", "public function testMyServiceGitCommands() {\n $this->assertNotNull(\\Drupal::service('calculate_date_diff'));\n }", "public function setUp()\n {\n $this->appPath = __DIR__ . '/../TestApp/application';\n\n $createCommand = 'Rougin\\Combustor\\Commands\\CreateViewCommand';\n\n $this->createCommand = CommandBuilder::create($createCommand);\n }", "public function testInstaller() {\n $this->assertSession()->addressEquals('user/1');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertDirectoryExists($this->syncDirectory);\n }", "function testTarget() {\n $stdin = json_encode(array('filter'=>'sql'));\n $exec = sprintf('echo %s | %s version --backend 2>/dev/null', self::escapeshellarg($stdin), UNISH_DRUSH);\n $this->execute($exec);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertTrue((bool) $parsed, 'Successfully parsed backend output');\n $this->assertArrayHasKey('log', $parsed);\n $this->assertArrayHasKey('output', $parsed);\n $this->assertArrayHasKey('object', $parsed);\n $this->assertEquals(self::EXIT_SUCCESS, $parsed['error_status']);\n // This assertion shows that `version` was called and that stdin options were respected.\n $this->assertStringStartsWith(' Drush Version ', $parsed['output']);\n $this->assertEquals('Bootstrap to phase 0.', $parsed['log'][0]['message']);\n\n // Check error propogation by requesting an invalid command (missing Drupal site).\n $this->drush('core-cron', array(), array('backend' => NULL), NULL, NULL, self::EXIT_ERROR);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertEquals(1, $parsed['error_status']);\n $this->assertArrayHasKey('DRUSH_NO_DRUPAL_ROOT', $parsed['error_log']);\n }", "public function testOoCanOutputAll()\n {\n $mainCommand = 'composer';\n $command = $this->createInstance($mainCommand);\n\n $subCommands = [new Command\\Subcommand('update')];\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n\n $flags = [new Command\\Flag('n')];\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n\n $arguments = [new Command\\Argument('no-dev')];\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n\n $parameters = [new Command\\Parameter('monolog/monolog')];\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n\n $this->assertEquals(\n sprintf('%1$s update -n --no-dev %2$s', $mainCommand, escapeshellarg('monolog/monolog')),\n (string) $command,\n 'Must be able to output the command string correctly, including the sub command, flags, arguments, and parameters'\n );\n }", "public function testServices()\n {\n $this->assertNull($this->command->get('console'));\n\n $container = new ContainerBuilder();\n $console = $container->register(\n 'console', '\\\\Symfony\\\\Component\\\\Console\\\\Application'\n );\n $console->addArgument('slic');\n\n $this->command->setContainer($container);\n $this->assertInstanceOf(\n '\\\\Symfony\\\\Component\\\\Console\\\\Application',\n $this->command->get('console')\n );\n }", "protected function setUp()\n {\n parent::setUp();\n\n $url = 'https://url.to/backup.tgz';\n $this->expected_data = [\n 'file' => 'file name',\n 'size' => 'file size',\n 'date' => 459880805,\n 'expiry' => 3615640805,\n 'initiator' => 'backup initiator',\n 'url' => $url,\n ];\n\n $this->backup->method('getArchiveURL')->willReturn($url);\n $this->backup->method('serialize')->willReturn($this->expected_data);\n\n $this->command = new InfoCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "public function testCanOutputAll()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n\n $subCommands = ['clone'];\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n\n $flags = ['-f'];\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n\n $arguments = ['--mirror'];\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n\n $parameters = ['https://github.com/Dhii/shell-interop.git', '.'];\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n\n $this->assertEquals(\n sprintf('%1$s %2$s %3$s %4$s %5$s', $mainCommand, implode(' ', $subCommands), implode(' ', $flags), implode(' ', $arguments), implode(' ', $parameters)),\n (string) $command,\n 'Must be able to output the command string correctly, including the sub command, flags, arguments, and parameters'\n );\n }", "public function testCompanyManagementBackupsPost()\n {\n\n }", "public function test_deploy_schema()\n {\n foreach ($this->getTables() as $table) {\n DB::getInstance()->exec(\"DROP TABLE {$table}\");\n }\n $this->assertEmpty($this->getTables());\n\n # Deploy all sql's in schemas folder\n $schemas = scandir(__DIR__ . '/schemas/');\n $schemas = array_diff( $schemas, ['.','..'] );\n foreach($schemas as $schema){\n if ($schema != 'database.sql') {\n $sql = file_get_contents(__DIR__ . '/schemas/' . $schema);\n DB::getInstance()->exec($sql);\n $table = explode('.',$schema)[0];\n $this->assertContains($table, $this->getTables());\n }\n }\n }", "public function test_pull() {\n\n }", "public function testTask()\n\t{\n \n //Need also define the ssh keys and password in config.php\n \n //Insert first a task\n \n /*$arr_task=['name_task' => 'live', 'descripton_task' => 'Script for check if server is alive', 'arguments' => [], 'status' => 0, 'url_return' => '', 'server' => SERVER_REMOTE];\n \n $new_task=$m->task->insert($arr_task);\n \n $id=$m->task->insert_id();\n \n $this->assertNotFalse($new_task);\n \n $arr_task['IdTask']=$id;*/\n \n //Select task from db\n \n //Execute task\n \n $task=new Task(SERVER_REMOTE);\n \n $task->files=[['vendor/phangoapp/leviathan/tests/script/alive.sh', 0755]];\n \n $task->commands_to_execute=[['/bin/bash', 'vendor/phangoapp/leviathan/tests/script/alive.sh', ''], ['sudo', 'vendor/phangoapp/leviathan/tests/script/alive.sh', '']];\n \n $task->delete_files=['vendor/phangoapp/leviathan/tests/script/alive.sh'];\n \n $task->delete_directories=['vendor/phangoapp/leviathan/tests'];\n \n $task->name_task='Live';\n \n $task->description_task='Check if server is alive';\n \n $task->codename_task='live';\n \n $result=$task->exec();\n \n echo $task->txt_error;\n \n $this->assertTrue($result);\n \n \n \n }", "public function testJobListPreparationAndReleaseTaskStatus()\n {\n\n }", "private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }", "public function testExec()\n {\n $input = 'Hello World';\n\n $result = Command::create()\n ->app('echo')\n ->input($input)\n ->exec();\n\n $this->assertEquals($input, $result->getRaw());\n }", "public function test_schedule_command()\n {\n $this->artisan('schedule:run')->assertExitCode(0);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "public function testMigrateInstance()\n {\n $_result = \\Artisan::call('dfe:migrate-instance', ['--all']);\n }", "public function testExecuteCommand()\n {\n $this->environment->expects($this->once())\n ->method('sendCommandViaSsh')\n ->with($this->equalTo('dummy arg1 arg2'))\n ->willReturn(['output' => 'dummy output', 'exit_code' => 0]);\n\n $output = $this->command->dummyCommand('site.env', ['arg1', 'arg2']);\n\n $this->assertEquals('dummy output', $output);\n }", "public function testCanOutputMainCommand()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n $this->assertEquals($mainCommand, (string) $command, 'Main command must be output correctly alone');\n }", "public function testSimplestCommand()\n {\n $expected = 'tesseract image.png stdout';\n\n $actual = (new WrapTesseractOCR('image.png'))\n ->buildCommand();\n\n $this->assertEquals($expected, $actual);\n }", "public function setUp()\n {\n $this->command = new InitCommand();\n }", "function testOrigin() {\n $exec = sprintf('%s %s version arg1 arg2 --simulate --ssh-options=%s 2>/dev/null | grep ssh', UNISH_DRUSH, self::escapeshellarg('user@server/path/to/drupal#sitename'), self::escapeshellarg('-i mysite_dsa'));\n $this->execute($exec);\n $bash = $this->escapeshellarg('drush --uri=sitename --root=/path/to/drupal version arg1 arg2 2>&1');\n $expected = \"Simulating backend invoke: ssh -i mysite_dsa user@server $bash 2>&1\";\n $output = $this->getOutput();\n $this->assertEquals($expected, $output, 'Expected ssh command was built');\n }", "public function testExecuteTaskAction()\n {\n }", "protected function setUp()\n {\n parent::setUp();\n $this->command = new GetCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "public function testGetService()\n {\n $app = new \\Cilex\\Application('Test');\n $app->command($this->fixture);\n\n $this->assertInstanceOf(\n '\\Symfony\\Component\\Console\\Application',\n $this->fixture->getService('console')\n );\n }", "public function testCanOutputSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = ['init', 'another'];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, implode(' ', $subCommands)), (string) $command, 'Must be able to output the command and subcommand string correctly');\n }", "public function testShouldRegisterCommands()\n {\n $test = $this;\n $app = m::mock('Illuminate\\Contracts\\Foundation\\Application');\n $sp = m::mock('Zizaco\\Confide\\ServiceProvider', [$app]);\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $app->shouldReceive('bind')\n ->times(3)->andReturnUsing(\n // Make sure that the commands are being registered\n // with a closure that returns the correct\n // object.\n function ($name, $closure) use ($test, $app) {\n\n $shouldBe = [\n 'command.confide.controller' => 'Zizaco\\Confide\\ControllerCommand',\n 'command.confide.routes' => 'Zizaco\\Confide\\RoutesCommand',\n 'command.confide.migration' => 'Zizaco\\Confide\\MigrationCommand',\n ];\n\n $test->assertInstanceOf(\n $shouldBe[$name],\n $closure($app)\n );\n }\n );\n\n $sp->shouldReceive('commands')\n ->with(\n 'command.confide.controller',\n 'command.confide.routes',\n 'command.confide.migration'\n );\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $sp->registerCommands();\n }", "function pestle_cli($argv)\n{ \n //$composer_package .= '=2.1.0-rc1';\n extract($argv);\n \n $db_name = preg_replace('%[^a-zA-Z0-9]%','_', $id_key);\n $url = preg_replace('%[^a-zA-Z0-9]%','-', $id_key) . '.dev';\n $cmds = [];\n $cmds[] = \"composer create-project --repository-url=$repo $composer_package $folder\";\n $cmds[] = \"cd $folder\";\n $cmds[] = \"echo '$umask' >> magento_umask\";\n $cmds[] = \"echo \\\"We're about to ask for your MySQL password so we can create the database\\\"\";\n $cmds[] = \"echo 'CREATE DATABASE $db_name' | mysql -uroot -p\";\n\n $cmds[] = \"php bin/magento setup:install --admin-email $admin_email --admin-firstname $admin_first_name --admin-lastname $admin_last_name --admin-password $admin_password --admin-user $admin_user --backend-frontname admin --base-url http://$url --db-host 127.0.0.1 --db-name $db_name --db-password $db_pass --db-user $db_user --session-save files --use-rewrites 1 --use-secure 0 -vvv\"; \n $cmds[] = 'php bin/magento sampledata:deploy'; \n $cmds[] = 'php bin/magento cache:enable';\n \n array_map(function($cmd){\n output($cmd);\n }, $cmds);\n}", "public function test()\n {\n $this->executeScenario();\n }", "public function testExample()\n {\n $this->artisan('game:start')\n ->expectsOutput('you won')\n ->assertExitCode(0);\n }", "public function testBasicTest()\n {\n $response = $this->get('tasks');\n $response->assertStatus(200);\n\n\n }", "public function testMaintenanceUnset()\n {\n// $this->commandTester->execute(\n// [\n// 'command' => $this->maintenanceCommand->getName(),\n// ToggleMaintenanceCommand::MAINTENANCE_PARAMETER => 0,\n// ]\n// );\n//\n// $this->assertFalse(\n// $this\n// ->filesystem\n// ->exists($this->exposedDir . DIRECTORY_SEPARATOR . ToggleMaintenanceCommand::FILE_NAME)\n// );\n//\n// $this->client->request('GET', '/');\n// $this->assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n }", "public function testCanRetrieveMainCommand()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n $this->assertSame($mainCommand, $command->getMainCommand(), 'Main command must be retrievable');\n }", "public function testItShouldPublishVendorStubs()\n {\n $sourceFile = dirname(dirname(__DIR__)) . '/resources/stubs/handler.stub';\n $targetFile = resource_path('stubs/handler.stub');\n\n $this->assertFileNotExists($targetFile);\n\n $this->artisan('vendor:publish', [\n '--provider' => 'Laravel\\\\Handlers\\\\ServiceProvider',\n '--tag' => 'laravel-handlers-stubs',\n ]);\n\n $this->assertFileExists($targetFile);\n $this->assertEquals($this->files->get($sourceFile), $this->files->get($targetFile));\n }", "public function testCompanyManagementBackupsGet()\n {\n\n }", "public function testExecute()\n {\n $kernel = self::createClient()->getKernel();\n $this->importData('SyncCommandsTest/ProductsInitialDummyData.sql');\n $this->importData('SyncCommandsTest/SyncStorageWithDummyData.sql');\n $this->importData('SyncCommandsTest/UpdateProductsData.sql');\n\n $manager = $this->getManager();\n $repository = $manager->getRepository('AcmeTestBundle:Product');\n\n $application = new Application($kernel);\n $application->add(new SyncExecuteCommand());\n $command = $application->find('ongr:sync:execute');\n\n $commandTester = new CommandTester($command);\n $commandTester->execute(['command' => $command->getName()]);\n\n $search = $repository->createSearch();\n\n // Temporary workaround for ESB issue #34 (https://github.com/ongr-io/ElasticsearchBundle/issues/34).\n usleep(50000);\n\n $actualDocuments = iterator_to_array($repository->execute($search));\n\n $expectedDocuments = $this->getTestingData();\n\n sort($expectedDocuments);\n sort($actualDocuments);\n\n $this->assertEquals($expectedDocuments, $actualDocuments);\n }", "public function test_it_scaffolds_crud_artifacts()\n {\n $this->assertFileDoesNotExist(app_path('Post.php'));\n $this->assertFileDoesNotExist(app_path('Http/Controllers/PostController.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileDoesNotExist(base_path('database/factories/PostFactory.php'));\n $this->assertFileDoesNotExist(resource_path('views/posts'));\n\n $this->artisan('arche Post');\n\n $this->assertFileExists(app_path('Post.php'));\n $this->assertFileExists(app_path('Http/Controllers/PostController.php'));\n $this->assertFileExists(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileExists(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileExists(base_path('database/factories/PostFactory.php'));\n $this->assertDirectoryDoesNotExist(resource_path('views/posts'));\n $this->assertFileExists(resource_path(\"views/posts/index.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/create.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/_form.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/edit.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/show.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/modals/delete.blade.php\"));\n\n $actualOutput = Artisan::output();\n\n $expectedOutput = \"Factory created successfully in /database/factories/PostFactory.php\nCreated Migration: 2020_03_14_153546_create_posts_table\nModel created successfully in /app/Post.php\nController created successfully in /app/Http/Controllers/PostController.php\nView created successfully in /resources/views/posts/index.blade.php\nView created successfully in /resources/views/posts/create.blade.php\nView created successfully in /resources/views/posts/_form.blade.php\nView created successfully in /resources/views/posts/edit.blade.php\nView created successfully in /resources/views/posts/show.blade.php\nView created successfully in /resources/views/posts/modals/delete.blade.php\nRequest created successfully in /app/Http/Requests/PostStoreRequest.php\nRequest created successfully in /app/Http/Requests/PostUpdateRequest.php\" . PHP_EOL;\n $this->assertSame($expectedOutput, $actualOutput);\n }", "public function testScheduleCommand()\n {\n $this->artisan('schedule:run')\n ->expectsOutput('No scheduled commands are ready to run.');\n }", "public function setupCommand(): void\n {\n $behatBuildPath = FLOW_PATH_ROOT . 'Build/Behat/';\n if (is_dir($behatBuildPath)) {\n Files::emptyDirectoryRecursively($behatBuildPath);\n }\n $this->outputLine('Copying Behat setup to %s', [$behatBuildPath]);\n Files::copyDirectoryRecursively('resource://Neos.Behat/Private/Build/Behat', $behatBuildPath);\n\n $behatBinaryPath = FLOW_PATH_ROOT . 'bin/behat';\n if (is_file($behatBinaryPath)) {\n $this->outputLine('Removing existing Behat binary %s', [$behatBinaryPath]);\n unlink($behatBinaryPath);\n }\n $this->outputLine('Installing Behat in %s', [$behatBuildPath]);\n exec('cd \"' . $behatBuildPath . '\" && composer install');\n $this->outputLine();\n $this->outputLine('Installed Behat to %s, binary to %s', [$behatBuildPath, $behatBinaryPath]);\n\n $seleniumBinaryPath = FLOW_PATH_ROOT . 'bin/selenium-server.jar';\n if (!is_file($seleniumBinaryPath)) {\n $seleniumVersion = 'selenium-server-standalone-2.53.1.jar';\n $seleniumUrl = 'https://selenium-release.storage.googleapis.com/2.53/' . $seleniumVersion;\n $this->outputLine('Downloading Selenium %s to bin/selenium-server.jar...', [$seleniumVersion]);\n if (copy($seleniumUrl, FLOW_PATH_ROOT . 'bin/selenium-server.jar') !== true) {\n throw new \\RuntimeException('Could not download selenium from ' . $seleniumUrl . '.');\n }\n $this->outputLine('Downloaded Selenium to bin/selenium-server.jar');\n $this->outputLine('You can execute it through: \"java -jar selenium-server.jar\"');\n } else {\n $this->outputLine('Skipped downloaded of Selenium, to update or reinstall delete bin/selenium-server.jar and run setup again');\n }\n }", "public function setUp()\n {\n if (exec(\"docker ps | grep wpdemo_db\") == '') {\n $this->markTestSkipped('wpdemo_db container is not running, skipping test');\n }\n }", "public function testCanSetGetSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = ['init', 'another'];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertSame($subCommands, $command->getSubCommands(), 'Must be able to have a list of all subcommands retrieved');\n }", "public function testMigrationsOptionsCreate()\n {\n $this->exec('completion options migrations.migrations create');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--class -l --connection -c --help -h --path --plugin -p --quiet';\n $expected .= ' -q --source -s --template -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public function testPsWithTwoComposeFilesSpecified()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(['docker-compose.yml', 'docker-compose.test.yml']), 'ok');\n }", "public function testExecute()\n {\n $commandTester = $this->createCommandTester(new DeleteCommand());\n $commandTester->execute([\n 'url' => 'my-queue-url',\n '--force' => true\n ]);\n\n $output = $commandTester->getDisplay();\n $this->assertContains('Done', $output);\n }", "protected function setUp()\n {\n parent::setUp();\n \n // TODO Auto-generated CommandTest::setUp()\n \n $this->command = new Command();\n }", "public function test_addReplenishmentProcessAudit() {\n\n }", "public function testCommand()\n {\n $response = (new Command())->testCommand(Command::class);\n\n $this->assertInstanceOf(Builder::class, $response, 'A call to command() should dispatch an instance of the command and return a builder.');\n $this->assertInstanceOf(Command::class, $response->toBase(), 'The builder should wrap the command passed to command().');\n }", "function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}", "public function testContainer()\n {\n $app = new \\Cilex\\Application('Test');\n $app->command($this->fixture);\n\n $this->assertSame($app, $this->fixture->getContainer());\n }", "function deploy_it(string $project_path, array $config = [], string $production_commit = null) {\n\n $app = new Symfony\\Component\\Console\\Application('Deployer', \\Kodilab\\Deployer\\Deployer::VERSION);\n\n $app->add(new \\Kodilab\\Deployer\\Command\\DeployCommand($project_path, $config, $production_commit));\n\n $app->run(new \\Symfony\\Component\\Console\\Input\\StringInput('deploy'));\n}", "public function testHelpCommand(): void\n {\n $this->assertNotFalse(\n $this->artisan($signature = $this->getCommandSignature(), ['--help']),\n sprintf('Command \"%s\" does not return help message', $signature)\n );\n }", "public function testCompanyManagementBackupsIdDelete()\n {\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "protected function setup(): void\n {\n $kernel = self::bootKernel();\n $application = new Application($kernel);\n\n // get entity manager\n $this->em = $kernel->getContainer()->get('doctrine')->getManager();\n\n // get serializer\n $this->serializer = $kernel->getContainer()->get('serializer');\n\n // init command\n $application->add(\n new ImportCommand(\n $this->em,\n $this->serializer\n )\n );\n\n $command = $application->find('app:import');\n $this->commandTester = new CommandTester($command);\n }", "public function testCompanyManagementBackupsIdPut()\n {\n\n }", "public function testItShouldPublishVendorConfig()\n {\n $sourceFile = dirname(dirname(__DIR__)) . '/config/handlers.php';\n $targetFile = base_path('config/handlers.php');\n\n $this->assertFileNotExists($targetFile);\n\n $this->artisan('vendor:publish', [\n '--provider' => 'Laravel\\\\Handlers\\\\ServiceProvider',\n '--tag' => 'laravel-handlers-config',\n ]);\n\n $this->assertFileExists($targetFile);\n $this->assertEquals($this->files->get($sourceFile), $this->files->get($targetFile));\n }", "public function setUp()\n\t{\n\t\t\\Orchestra\\Support\\Acl::register('mock-one', function ($acl)\n\t\t{\n\t\t\t$acl->add_actions(array('view blog', 'view forum', 'view news'));\n\t\t\t$acl->allow('guest', array('view blog'));\n\t\t\t$acl->deny('guest', 'view forum');\n\t\t});\n\t}", "public function testInstaller() {\n $this->assertSession()->addressEquals('user/1');\n $this->assertSession()->statusCodeEquals(200);\n }", "function testPingCommand()\n {\n $console = new Console();\n\n ob_start();\n\n $result = $console->findCommand(\"ping\")->execute();\n\n $out = ob_get_clean();\n\n $this->assertTrue($result);\n $this->assertSame(\"Pong!\\n\", $out);\n }", "public function testGetManifest()\n {\n }", "public function testCanRunValidCommand()\n {\n $dir = __DIR__;\n $command = new Command(\"/bin/ls $dir/Command*\");\n\n $this->assertFalse($command->getExecuted());\n $this->assertTrue($command->execute());\n $this->assertTrue($command->getExecuted());\n $this->assertEquals(\"$dir/CommandTest.php\", $command->getOutput());\n $this->assertEquals(\"$dir/CommandTest.php\\n\", $command->getOutput(false));\n $this->assertEmpty($command->getError());\n $this->assertEmpty($command->getStdErr());\n $this->assertEquals(0, $command->getExitCode());\n }", "public function testViewsAreCreated()\n {\n CodeIgniterHelper::setDefaults($this->appPath);\n\n $createCommand = new CommandTester($this->createCommand);\n $createCommand->execute([\n 'name' => $this->table,\n '--camel' => true,\n '--bootstrap' => true,\n '--keep' => true\n ]);\n\n $create = $this->appPath . '/views/' . $this->table . '/create.php';\n $edit = $this->appPath . '/views/' . $this->table . '/edit.php';\n $index = $this->appPath . '/views/' . $this->table . '/index.php';\n $show = $this->appPath . '/views/' . $this->table . '/show.php';\n\n $this->assertFileExists($create);\n $this->assertFileExists($edit);\n $this->assertFileExists($index);\n $this->assertFileExists($show);\n\n CodeIgniterHelper::setDefaults($this->appPath);\n }", "public function testMyTestCase()\n { $this->artisan('migrate');\n \t$this->visit(\"/project/1/add\");\n $this->type('test@test.com', 'email');\n $this->press('Ajouter');\n $this->seePageIs('/project/1/add/confirm');\n }", "public function testConsole()\n {\n static::bootKernel();\n\n $output = new BufferedOutput();\n $application = new Application(static::$kernel);\n $application->setAutoExit(false);\n $exitCode = $application->run(new StringInput(''), $output);\n\n $outputText = $output->fetch();\n\n $this->assertEquals(0, $exitCode, $outputText);\n\n // do not fix the number of commands to be flexible when new commands get added\n // the point of this test is to see that commands are loaded and show up in the console\n $this->assertTrue(substr_count($outputText, ' rokka:') > 20, substr($outputText, 0, 2000).\"...\\n\\n\");\n }", "public function testOoCanOutputSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = [new Command\\Subcommand('update'), new Command\\Subcommand('nao')];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, implode(' ', $subCommands)), (string) $command, 'Must be able to output the command and subcommand string correctly');\n }", "public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }", "public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->artisan('migrate', ['--database' => 'testbench']);\n }", "public function setUp()\n {\n $this->fixture = new CommandMock('demo:test');\n }", "public function testTravisLogger()\n {\n putenv('CONTINUOUS_INTEGRATION=1');\n\n $container = new Container(['PhpBench\\Extension\\CoreExtension'], [\n 'path' => 'hello',\n 'config_path' => '/path/to/phpbench.json',\n ]);\n $container->init();\n $this->assertEquals('travis', $container->getParameter('progress'));\n }", "function main(tiny_api_Cli $cli)\n{\n $cli->header('Unit Tests');\n\n $unit_test_file = $cli->get_arg('unit-test-file');\n if (!empty($unit_test_file))\n {\n if (!is_file($unit_test_file))\n {\n $cli->error(\"Could not find file \\\"$unit_test_file\\\"!\");\n exit(1);\n }\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->disable_tap()\n ->disable_stop_on_failure()\n ->execute(array($unit_test_file))\n ->print_summary();\n }\n else\n {\n exec(\"/usr/bin/find \"\n . getcwd()\n . \" -name \\\"*.php\\\" | /bin/grep \\\"/tests/\\\"\",\n $files, $retval);\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->execute($files)\n ->print_summary();\n }\n}", "public function testCompanyManagementBackupsIdPatch()\n {\n\n }", "public function testOnConsoleCommand()\n {\n $commandFoo = $this->createMock(ContainerAwareCommand::class);\n $commandFoo->method('getName')->willReturn('foo:hello');\n $this->commandChain->addCommand($commandFoo, 'main', null);\n\n $commandBar = $this->createMock(ContainerAwareCommand::class);\n $commandBar->method('getName')->willReturn('bar:hi');\n $this->commandChain->addCommand($commandBar, 'foo:hello', 100);\n\n $output = new BufferedOutput();\n $event = $this->createMock(ConsoleCommandEvent::class);\n $event->method('getCommand')->willReturn($commandBar);\n $event->method('getOutput')->willReturn($output);\n $this->chainCommandListener->onConsoleCommand($event);\n\n $expected = sprintf(sprintf(\n \"Error: %s command is a member of %s command chain and cannot be executed on its own.\\n\",\n $commandBar->getName(),\n $commandFoo->getName()\n ));\n $real = $output->fetch();\n $this->assertEquals($expected, $real);\n }", "public function testLoadCliConfig()\r\n {\r\n $this->assertTrue($this->wei->getConfig('cli'));\r\n }", "public function testFiles() {\n\t\t$repoSrc = ROOT . DS . 'src';\n\n\t\t$this->shell->args = [$repoSrc];\n\n\t\t$files = $this->shell->Stage->files();\n\t\tforeach ($files as &$file) {\n\t\t\t$file = str_replace(DS, '/', substr($file, strlen($repoSrc) + 1));\n\t\t}\n\n\t\t$expected = [\n\t\t\t'Shell/UpgradeShell.php',\n\t\t\t'Shell/Task/BaseTask.php',\n\t\t\t'Shell/Task/RenameCollectionsTask.php',\n\t\t\t'Shell/Task/NamespacesTask.php',\n\t\t\t'Shell/Task/StageTask.php',\n\t\t\t'Shell/Task/TestsTask.php',\n\t\t\t'Shell/Task/AppUsesTask.php',\n\t\t\t'Shell/Task/FixturesTask.php',\n\t\t\t'Shell/Task/RenameClassesTask.php',\n\t\t\t'Shell/Task/MethodNamesTask.php',\n\t\t\t'Shell/Task/MethodSignaturesTask.php',\n\t\t\t'Shell/Task/HelperTrait.php',\n\t\t\t'Shell/Task/ChangeTrait.php',\n\t\t\t'Shell/Task/LocationsTask.php',\n\t\t\t'Shell/Task/I18nTask.php',\n\t\t\t'Shell/Task/SkeletonTask.php',\n\t\t\t'Shell/Task/TemplatesTask.php',\n\t\t\t'Shell/Task/ModelToTableTask.php',\n\t\t\t'Shell/Task/CleanupTask.php',\n\t\t\t'Shell/Task/PrefixedTemplatesTask.php',\n\t\t\t'Shell/Task/CustomTask.php',\n\t\t\t'Shell/Task/LocaleTask.php',\n\t\t\t'Shell/Task/UrlTask.php',\n\t\t\t'Shell/Task/TableToEntityTask.php',\n\t\t\t'Shell/Task/FixtureLoadingTask.php',\n\t\t\t'Shell/Task/FixtureCasingTask.php',\n\t\t];\n\n\t\tforeach ($expected as $file) {\n\t\t\t$this->assertTrue(in_array($file, $files, true), 'The files to process should be all files in the src folder - ' . $file);\n\t\t}\n\t}", "public function testDomainAddCommand()\n {\n $site = Arr::get($_SERVER, 'SERVER_NAME');\n\n if (!$site) {\n $this->assertTrue(true);\n return;\n }\n\n $argDomain = $site ? ['domain' => $site] : [];\n\n $this->artisan('domain:add', $argDomain);\n\n $this->assertFileExists(env_path('.env.'.$site));\n\n $this->artisan('config:clear');\n\n $domainListed = Config::get('domain.domains');\n\n $this->assertArrayHasKey($site,$domainListed);\n\n $this->assertDirectoryExists(app()->exactDomainStoragePath());\n }", "public function test_listBundlesForTagsRequest() {\n\n }", "public function setUp() {}", "public function setUp() {}", "public function testDeleteService()\n {\n\n }", "public function setUp() {}" ]
[ "0.7459329", "0.7122933", "0.63586414", "0.6288866", "0.62183785", "0.6218028", "0.61845714", "0.61533713", "0.6142157", "0.6081859", "0.60757345", "0.60705394", "0.6056716", "0.6052736", "0.60347545", "0.5993077", "0.5987081", "0.5967315", "0.5966268", "0.596555", "0.59356725", "0.59033877", "0.58901775", "0.5883414", "0.58764845", "0.5851825", "0.5850145", "0.58490515", "0.5841605", "0.58388776", "0.5826234", "0.58241135", "0.582113", "0.58197504", "0.5815369", "0.5805392", "0.57986456", "0.5776378", "0.5773102", "0.5770148", "0.576821", "0.576795", "0.5731404", "0.5721952", "0.5694328", "0.569205", "0.5684817", "0.56843436", "0.56779647", "0.56438553", "0.5642313", "0.56221104", "0.5618521", "0.5618425", "0.5611994", "0.560376", "0.5595112", "0.55949545", "0.55929756", "0.5590007", "0.55837345", "0.5579301", "0.55781895", "0.556213", "0.55574566", "0.55552", "0.5553827", "0.55343115", "0.55276555", "0.55240345", "0.55233115", "0.55148244", "0.5506767", "0.5506332", "0.54832506", "0.54829335", "0.54697293", "0.54655826", "0.5463231", "0.54627055", "0.54530966", "0.54503995", "0.5446004", "0.5445397", "0.5444253", "0.5444253", "0.54391366", "0.5436071", "0.54356045", "0.5430181", "0.54277897", "0.54231375", "0.5422407", "0.54133713", "0.5410152", "0.5407599", "0.5405555", "0.5404726", "0.54043466", "0.5403577" ]
0.7939011
0
Initialises local git repos
Инициализирует локальные репозитории git
public function init_repo() { // we don't need to maintain local repos for slim deploys if ( SLIM ) { return; } // if the repo is already initialised, we don't need to if ( is_dir( "wpd-repos/{$this->config->repo[ 'name' ]}/.git" ) ) { return; } // store the directory we're in right now, so we can come back $original_dir = getcwd(); // switch the repo's directory chdir( "wpd-repos/{$this->config->repo[ 'name' ]}" ); // initialise git exec( 'git init' ); // add the remote repo as a remote called origin exec( "git remote add origin " . $this->config->repo[ 'git_url' ] ); // switch back to the original directory chdir( $original_dir ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function git_init($dir)\n\t\t{\n\t\t\t$cmd=\"git init \".$dir;\n\t\t\t//printf(\"cmd:%s<br/>\",$cmd);//test\n\t\t\t$last_line=exec ($cmd , $output , $retval);\n\t\t\tcheck_error($cmd,$retval);\n\t\t}", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}", "protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function initRepository(): void;", "public function init()\n {\n $this\n ->instantiateNewCacher()\n ->instantiateNewClient()\n ->authenticateClient()\n ->getUsers(\n $this->getAppParam('s.github.api.organization')\n )\n ->getRepositories(\n $this->getAppParam('s.github.api.organization')\n )\n ;\n }", "function get_repos() {\n\t\tadd_filter( 'use_fsockopen_transport', '__return_false' );\n\t\tadd_filter( 'use_fopen_transport', '__return_false' );\n\t\tadd_filter( 'use_streams_transport', '__return_false' );\n\t\tadd_filter( 'use_http_extension_transport', '__return_false' );\n\t\t\n\t\t// list all repos\n\t\t$url = 'https://api.github.com/users/' . $this->github_user . '/repos';\n\t\t\n\t\t$args = array(\n\t\t\t'method' => 'GET',\n\t\t\t'sslverify' => false\n\t\t);\n\n\t\t$github = wp_remote_request( $url, $args );\n\t\t\n\t\t// exit on error..\n\t\tif( empty( $github ) || ! empty( $github->errors ) ) {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t\t$github_datas = $github['body'];\n\n\t\t$gits = json_decode( $github_datas );\n\t\t$sort_by = array();\n\t\t\n\t\tif ( is_array( $gits ) ) {\n\n\t\t\tforeach( $gits as $git ) {\n\t\t\t\t$this->repos[] = array( \n\t\t\t\t\t'name' => $git->name,\n\t\t\t\t\t'description' => $git->description,\n\t\t\t\t\t'url' => $git->html_url,\n\t\t\t\t\t'download' => trailingslashit( $git->html_url ) . 'archive/master.zip',\n\t\t\t\t\t'last_update' => $git->updated_at,\n\t\t\t\t\t'stargazers' => $git->stargazers_count,\n\t\t\t\t\t'watchers' => $git->watchers_count\n\t\t\t\t);\n\n\t\t\t\t$sort_by[] = $git->updated_at;\n\t\t\t}\n\n\t\t\tif ( ! empty( $sort_by ) )\n\t\t\t\tarray_multisort( $sort_by, SORT_DESC, $this->repos );\n\n\t\t// Github is not reachable rate limit exceeded\n\t\t} else {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t}", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', 'test@example.com']);\n\n return $repoPath;\n }", "function cvs_add_repository($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_root, $cvs_cmd;\r\n\r\n $cvs_dir = $cvs_root.\"/\".$cvs_project;\r\n\r\n exec($cvs_cmd.\" -d \".$cvs_dir.\" init\");\r\n\r\n cvs_add_user($cvs_user, $cvs_pass, $cvs_project);\r\n}", "public function __construct($repo_path = null, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\t$this->set_repo_path($repo_path, $create_new, $_init);\n\t\t\t}\n\t\t}", "public function init($directory, array $params = NULL)\n\t\t{\n\t\t\tif (is_dir(\"$directory/.git\")) {\n\t\t\t\tthrow new GitException(\"Repo already exists in $directory.\");\n\t\t\t}\n\n\t\t\tif (!is_dir($directory) && !@mkdir($directory, 0777, TRUE)) { // intentionally @; not atomic; from Nette FW\n\t\t\t\tthrow new GitException(\"Unable to create directory '$directory'.\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$this->run($directory, [\n\t\t\t\t\t'init',\n\t\t\t\t\t$params,\n\t\t\t\t\t'--end-of-options',\n\t\t\t\t\t$directory\n\t\t\t\t]);\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\tthrow new GitException(\"Git init failed (directory $directory).\", $e->getCode(), $e);\n\t\t\t}\n\n\t\t\treturn $this->open($directory);\n\t\t}", "private function initProjects()\n\t{\n\t\t$this->priorities = Dao::readAll(Priority::class, [Dao::key('redmine_id')]);\n\t\t$this->projects = Dao::readAll(Project::class, [Dao::key('redmine_id')]);\n\t\t$this->statuses = Dao::readAll(Status::class, [Dao::key('redmine_id')]);\n\t}", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function setUp()\n {\n $tempDir = tempnam(sys_get_temp_dir(),'');\n if (file_exists($tempDir)) {\n unlink($tempDir);\n }\n mkdir($tempDir);\n chdir($tempDir);\n exec('unzip '.__DIR__.'/gitRepo.zip');\n exec('git checkout .');\n $this->testDir = $tempDir;\n }", "private function initializeProjectDirectory()\n {\n $this->output->write('Adding initial files... ');\n\n // Create directory\n if (!@mkdir($this->project->getDirectory())) {\n $message = 'Error: Could not create directory';\n $this->output->writeln('<error>' . $message . '</error>');\n throw new \\RuntimeException($message);\n }\n\n // Add template files\n $templateHandler = new TemplateHandler();\n $templateHandler->setProject($this->project);\n\n $templateHandler->writeTemplate('README.md');\n $templateHandler->writeTemplate('gitignore');\n $templateHandler->writeTemplate('Vagrantfile');\n\n // Add Dirtfile\n $this->project->save();\n\n // Initialize git for working directory\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git init',\n 'git add -A .',\n 'git commit -m \"Initial commit, added README, gitignore, Dirtfile and Vagrantfile\"'\n );\n\n if (!$this->input->getOption('skip-repository')) {\n $commands[] = 'git remote add origin ' . $this->project->getRepositoryUrl();\n $commands[] = 'git push -u origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n\n $this->output->writeln('<info>OK</info>');\n }", "private function setCustomRepositories()\n {\n $em = $this->getDoctrine()->getManager();\n $this->frontRepository = new FrontRepository($em);\n }", "public function repo($dir, $remote);", "protected function setUp()\n {\n $tempDir = tempnam(sys_get_temp_dir(),'');\n if (file_exists($tempDir)) {\n unlink($tempDir);\n }\n mkdir($tempDir);\n chdir($tempDir);\n exec('unzip '.__DIR__.'/gitRepo.zip');\n exec('git checkout .');\n $this->testDir = $tempDir;\n \n $this->gitFlow = new GitFlow();\n $this->gitFlow->setDryRun(true);\n }", "public function setRepositories() {\n }", "function __constructor(array $repositories) \n {\n $this->repositories = $repositories;\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function __construct($commit_msg)\n {\n $this->commit_msg = $commit_msg;\n $this->branch = isset($branch) ? $branch : '';\n $this->repo = isset($repo) ? $repo : $this->repo;\n\n $this->repo_url = 'https://github.com/' . urlencode(TYPOLIB_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n $this->directory = DATA_ROOT . $this->repo . '/';\n $this->config_file = $this->directory . '.git/config';\n\n #FIXME: edit the config with GitPhp, allow custom email/name per Pull Request\n $this->user_config = \"[user]\\n\"\n . ' email = ' . CLIENT_GITHUB_EMAIL . \"\\n\"\n . ' name = ' . CLIENT_GITHUB_COMMITTER . \"\\n\";\n\n $this->client_remote_url = 'https://' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . ':' . urlencode(CLIENT_GITHUB_PASSWORD)\n . '@github.com/' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n // We use the Monolog library to log our events\n $this->logger = new Logger('PullRequest');\n $this->logger->pushHandler(new StreamHandler(INSTALL_ROOT . 'logs/pr-errors.log'));\n\n // Also log to error console in Debug mode\n if (DEBUG) {\n $this->logger->pushHandler(new ErrorLogHandler());\n }\n\n try {\n $this->git = new GitRepository($this->directory);\n } catch (GitException $e) {\n $this->logger->error('Failed to initialize Git repository. Error: '\n . $e->getMessage());\n }\n $this->cloneAndConfig();\n }", "protected function getLocalRepository()\n {\n if (!$this->localRepo){\n $this->localRepo = new InstalledFilesystemRepository(\n new JsonFile(\n $this->composer->getConfig()->get(\"vendor-dir\") . \"/composer/installed_extra.json\"\n )\n );\n }\n\n return $this->localRepo;\n }", "protected function initialize() {\n\t\t$this->databasesDir = $this->projectDir . '/var/data/databases';\n\t\t$this->simulatorsDir = $this->projectDir . '/var/data/simulators';\n\t\t$this->publicDir = $this->projectDir . '/' . ($this->getParameter('public_dir') ?? 'public');\n\t\t$this->viewsDir = $this->projectDir . '/templates';\n\t\t$this->pdfFormsDir = $this->projectDir . '/var/data/pdfforms';\n\t}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "private function initAsyncRepositories(): void {\n $this->messagesRepository = new MessagesRepository();\n }", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>git@github.com:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function cloneGitRepo($repo, $dir);", "function __construct($userName, $projectName)\n\t{\n\t\t// TODO Need to possibly make a WorkingCopy variable that will be set depending if the repo is cloned or not.\n\t\t$this->gitWrapper = new GitWrapper();\n\t\tparent::__construct($userName, $projectName); // calling AbstractFileSystem's constructor\n\t}", "protected function pickRepos(InputInterface $input, OutputInterface $output) {\n $repos = [];\n if ($feedUrl = $input->getOption('git-feed')) {\n $schemes = preg_match(';^file://;', $feedUrl)\n ? ['https', 'http', 'git', 'file']\n : ['https', 'http', 'git'];\n $repos = array_merge($repos, $this->getFilteredFeed($output, $feedUrl, 'ready', $schemes));\n }\n if ($repoDirs = $input->getArgument('git-repos')) {\n $repos = array_merge($repos, $this->getRepos($output, $repoDirs));\n }\n usort($repos, function ($a, $b) {\n return strcmp($a['key'], $b['key']);\n });\n if ($input->getOption('limit')) {\n $repos = array_slice($repos, 0, $input->getOption('limit'));\n return $repos;\n }\n return $repos;\n }", "public function __construct()\n {\n $this->postRepository = new PostRepository();\n $this->userRepository = new UserRepository();\n $this->commentRepository = new CommentRepository();\n $this->replyRepository = new ReplyRepository();\n }", "protected function PopulateProjects()\n\t{\n\t\tif (!($fp = fopen($this->projectConfig, 'r'))) {\n\t\t\tthrow new Exception('Failed to open project list file ' . $this->projectConfig);\n\t\t}\n\n\t\t$projectRoot = GitPHP_Config::GetInstance()->GetValue('projectroot');\n\n\t\twhile (!feof($fp) && ($line = fgets($fp))) {\n\t\t\t$pinfo = explode(' ', $line);\n\t\t\t$ppath = trim($pinfo[0]);\n\t\t\tif (is_file($projectRoot . $ppath . '/HEAD')) {\n\t\t\t\ttry {\n\t\t\t\t\t$projObj = new GitPHP_Project($ppath);\n\t\t\t\t\tif (isset($pinfo[1])) {\n\t\t\t\t\t\t$projOwner = trim($pinfo[1]);\n\t\t\t\t\t\tif (!empty($projOwner)) {\n\t\t\t\t\t\t\t$projObj->SetOwner($projOwner);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->projects[] = $projObj;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\terror_log($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfclose($fp);\n\t}", "function SVNRepoManager() {\n\tloadTemplate('SVNRepoManager');\n}", "public function workspaceInit() {}", "function core_github_init($obj, $prefix='api'){\n\t$options = $obj->options;\n\t\n\tif(empty($options->resource)){ echo 'No Resource Set.'; return false; }\n\tif(empty($options->user)){ echo 'No User Set.'; return false; }\n\tif(empty($options->repo)){ echo 'No Repository Set.'; return false; }\n\t\n\tswitch($options->resource){\n\t\tcase \"tags\":\n\t\t\t$url = 'repos/'.$options->user.'/'.$options->repo.'/git/refs/tags';\n\t\t\tbreak;\n\t\t\n\t\tcase \"blob\":\n\t\t\t$url = $options->user.'/'.$options->repo.'/'.$options->path; //Path should be a relative path including the branch: master/admin/index.php\n\t\t\t$prefix = 'raw'; //Query the raw.github.com\n\t\t\tbreak;\n\t}\n\t\n\t$response = core_github_com($url, $prefix);\n\tif($response === false){ return false; }\n\t\n\techo '<div class=\"core-github main-wrapper '.$options->class.'\">';\n\tcore_github_process($response, $options->resource, $options);\n\techo '</div>';\n}", "public function _create_repositories( $project, $migrate_data, $is_public, $repo_name ) {\n\n\t\tif ( ! empty( $project ) ) {\n\n\t\t\t$this->_display_project_data( $project );\n\n\t\t\t// Do not duplicate group name in repo name.\n\t\t\tif ( get_param_value( '--use-repo-name-as-github-repo') || false !== strpos( $project['path'], strtolower( $project['namespace']['name'] ) ) || false !== strpos( $project['path'], $project['namespace']['name'] ) || false !== strpos( $project['name'], strtoupper( $project['namespace']['name'] ) ) ) {\n\t\t\t\t$gitlab_repo_name = $project['path'];\n\t\t\t} else {\n\t\t\t\t$gitlab_repo_name = $project['namespace']['name'] . '-' . $project['path'];\n\t\t\t}\n\n\t\t\tif ( empty( $repo_name ) ) {\n\t\t\t\t$repo_name = $gitlab_repo_name;\n\t\t\t}\n\n\t\t\t$this->_clone_push_repo( $repo_name, $project, $migrate_data, $is_public, $gitlab_repo_name );\n\n\t\t}\n\n\t}", "private function get_locations_repositry() {\n\t\t\t$this->wpseo_local_locations_repository = new WPSEO_Local_Locations_Repository();\n\t\t}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function __construct(&$git)\n {\n $this->git = & $git;\n }", "private function _clone_push_repo( $repo_name, $project, $migrate_data, $is_public = false, $gitlab_repo_name = '' ) {\n\n\t\t$issue_map = [];\n\t\t$pr_map = [];\n\n\t\t// Create Repository.\n\t\t$github = new Github();\n\t\t$repo = $github->create_repo(\n\t\t\t$repo_name,\n\t\t\tstr_replace( [ \"\\n\", \"\\r\\n\", \"\\r\" ], '', $project['description'] ), // Fix error: Validation Failed: description control characters are not allowed.\n\t\t\t$project['web_url'],\n\t\t\t$is_public,\n\t\t\t$this->github_organisation,\n\t\t\t$project['issues_enabled'],\n\t\t\t$project['wiki_enabled']\n\t\t);\n\n\t\t// Dirty way i know, but don't want to refactor code right now.\n\t\tself::$repo_name = $project['path'];\n\t\tself::$repo_group = $project['namespace']['full_path'];\n\n\t\tif ( false !== $repo ) {\n\n\t\t\t$gitlab_clone_url = $project['ssh_url_to_repo'];\n\t\t\t$github_clone_url = $repo['ssh_url'];\n\n\t\t\t$base_dir = dirname( __DIR__ ) . DIRECTORY_SEPARATOR . $this->temporary_project_dir;\n\t\t\texec( \"rm -rf $base_dir\" );\n\t\t\tmkdir( $base_dir );\n\t\t\tchdir( $base_dir );\n\t\t\texec(\"git clone --bare $gitlab_clone_url\");\n\t\t\tchdir( $base_dir . DIRECTORY_SEPARATOR . $project['path'] . '.git' );\n\t\t\texec(\"git remote add github $github_clone_url\");\n\t\t\texec(\"git push --mirror github\");\n\n\t\t\t$this->_create_labels( $project, $repo_name );\n\n\t\t\t$milestone_map = array_column( $this->_create_milestones( $project, $repo_name ), 'github_milestone_id', 'gitlab_milestone_id' );\n\n\t\t\tif ( true === $project['snippets_enabled'] && in_array( 'snippets', $migrate_data, true ) ) {\n\n\t\t\t\t$this->_create_snippets( $project, $repo_name );\n\n\t\t\t}\n\n\t\t\t$issue_map = [];\n\n\t\t\tif ( true === $project['issues_enabled'] && in_array( 'issues', $migrate_data ) ) {\n\n\t\t\t\t$issue_map = $this->_add_issues( $project, $repo_name, $milestone_map, $gitlab_repo_name );\n\n\t\t\t}\n\n\t\t\tif ( in_array( 'pr', $migrate_data ) ) {\n\n\t\t\t\t$pr_map = $this->_create_merge_requests( $project, $repo_name, $milestone_map, $issue_map, $gitlab_repo_name );\n\n\t\t\t}\n\n\t\t\t$github->_update_prs( $issue_map, $pr_map, $repo_name );\n\n\t\t\t// Archive repo.\n\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t}\n\n\t}", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function pkg_list_repos() {\n\tglobal $g;\n\n\t$repo_base = \"{$g['pkg_repos_path']}/{$g['product_name']}-repo\";\n\t$result = array();\n\t$name_files = glob(\"{$repo_base}-*.name\");\n\tforeach ($name_files as $name_file) {\n\t\t$repo_name = file_get_contents($name_file);\n\t\tif ($repo_name == false || strlen($repo_name) <= 1) {\n\t\t\tcontinue;\n\t\t}\n\t\t$repo_name_base = \"{$repo_base}-{$repo_name}\";\n\t\t$descr_file = \"{$repo_name_base}.descr\";\n\t\tif (file_exists($descr_file)) {\n\t\t\t$descr = file_get_contents($descr_file);\n\t\t\tif ($descr == false) {\n\t\t\t\t$descr = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$descr = 'Unknown';\n\t\t}\n\t\t$entry = array(\n\t\t 'name' => $repo_name,\n\t\t 'path' => \"{$repo_name_base}.conf\",\n\t\t 'descr' => $descr\n\t\t);\n\t\tif (file_exists(\"{$repo_name_base}.default\")) {\n\t\t\t$entry['default'] = true;\n\t\t}\n\t\t$result[] = $entry;\n\t}\n\n\treturn $result;\n}", "public function __construct()\n {\n parent::__construct();\n $this->githubClient = new Client([\n // 'auth' => [getenv('GITHUB_USERNAME'), getenv('GITHUB_TOKEN')],\n 'auth' => [config('env.GITHUB_USERNAME'), config('env.GITHUB_TOKEN')],\n ]);\n }", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "private function init(): void\n {\n // Load composer.json\n $this->composerJson = $this->loadJsonFile($this->composerJsonFilename);\n\n // Reconstitute the composer.lock filename\n $composerLockFilename = dirname($this->composerJsonFilename) .\n DIRECTORY_SEPARATOR .\n basename($this->composerJsonFilename, '.json') .\n '.lock';\n\n // Check if composer.lock file exists\n if (!file_exists($composerLockFilename)) {\n throw new ComposerException(\n sprintf('Project is not initialized with Composer, \"%s\" file doest not exists', $composerLockFilename)\n );\n }\n\n // Get JSON content of composer.json file\n if (($this->composerLock = json_decode(file_get_contents($composerLockFilename), true)) === false) {\n throw new ComposerException(\n sprintf('\"%s\" file of project is corrupted or not readable', $composerLockFilename)\n );\n }\n\n // Reindex packages\n $this->composerLock['packages'] = array_column($this->composerLock['packages'], null, 'name');\n\n // Load packages\n $this->packages = array_fill_keys(array_column($this->composerLock['packages'], 'name'), null);\n }", "public function __construct(&$modx = null, array $options = array())\n {\n $this->options = $options;\n if ($modx instanceof \\modX) {\n $this->modx =& $modx;\n }\n $gitPath = $this->getOption(self::GIT_PATH, null, getcwd());\n $this->git = new Git($gitPath, $options);\n }", "public function setUp()\n {\n $this->config = new Repository();\n }", "public function __construct(\\App\\Repos\\Local_DB_RO_Repository $repo)\n {\n\t\t$this->middleware('auth');\n\n\t\t$this->repo = $repo;\n }", "public function __construct()\n {\n $this->citiesRepository = new CitiesRepository();\n }", "protected function setUp() {\n $this->basePath = $basePath = realpath(__DIR__ . '/../../../../../');\n $appPath = $basePath . '/app';\n $this->confPath = $confPath = $appPath . '/boxdata/conf';\n $this->etcPath = $etcPath = $appPath . '/boxdata/etc/local';\n $this->object = new BoxRepository($confPath,null);\n }", "public function load_repository(&$repo, $name) {\n // First determine if the class file exisits\n $path = @$repo['path'];\n $conf = array();\n\n if (file_exists($path . '/settings.php')) {\n // Override with repository specific data\n include($path . '/settings.php');\n }\n\n $repo = array_merge($conf, $repo);\n if (!isset($repos['data'])||!is_object($repo['data'])) $repo['data'] = $this->load_provider($repo, $path, $name);\n\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function getRepos()\n {\n return $this->repos;\n }", "public function getRepos()\n {\n return $this->repos;\n }", "public function _create_single_repo( $gitlab_path, $include_values, $is_public, $gh_repo_name ) {\n\n\t\tif ( 'all' === $include_values || in_array( 'all', $include_values ) ) {\n\n\t\t\t$migrate_data = [ 'issues', 'wiki', 'pr', 'snippets' ];\n\n\t\t} else {\n\n\t\t\t$migrate_data = $include_values;\n\n\t\t}\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\tforeach ( $projects_data as $project ) {\n\t\t\tif ( strtolower( $group ) === strtolower( $project['namespace']['full_path'] ) ) {\n\t\t\t\tif ( ! empty( get_param_value( '--yes' ) || ask_yes_no( $project['path_with_namespace'] ) ) ) {\n\t\t\t\t\t$this->_create_repositories( $project, $migrate_data, $is_public, $gh_repo_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "function getRepositories()\n{\n $repositories = apc_fetch('repositories');\n\n if (empty($features)) {\n $repositories = array(\n \"platform-ui\" => \"PLF UI\",\n \"commons\" => \"Commons\",\n \"ecms\" => \"ECMS\",\n \"social\" => \"Social\",\n \"wiki\" => \"Wiki\",\n \"forum\" => \"Forum\",\n \"calendar\" => \"Calendar\",\n \"integration\" => \"Integration\",\n \"platform\" => \"Platform\",\n \"platform-public-distributions\" => \"PLF Public Dist\",\n \"platform-private-distributions\" => \"PLF Private Dist\");\n apc_store('repositories', $repositories);\n }\n return $repositories;\n}", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "function __construct( $user = 'imath' ) {\n\t\t$this->github_user = $user;\n\t\t$this->get_repos();\n\t}", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "private function init()\n {\n if(!file_exists($this->tempDB))\n {\n $data = @file_get_contents($this->remoteLink);\n\n if($data !== FALSE)\n {\n file_put_contents($this->tempDB, $data);\n }\n }\n }", "public function get_all_repos(){\n\n\t\t\treturn $this->get_github_data( 'all_repos' );\n\n\t\t}", "public function init(){\n $this->container = new Container;\n $this->statistic = $this->container->get('common\\repositories\\StatisticRepository');\n }", "public function run()\n {\n $repo1 = Repo::create([\n 'name' => 'johnbolton/exercitationem',\n 'url' => 'https://github.com/johnbolton/exercitationem',\n 'event_id' => 1,\n ]);\n\n $repo2 = Repo::create([\n 'name' => 'pestrada/voluptatem',\n 'url' => 'https://github.com/pestrada/voluptatem',\n 'event_id' => 2,\n ]);\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public function __construct($repo)\n {\n $this->repo = $repo;\n $this->api = \"https://api.github.com/repos/\";\n\n $this->client = new \\GuzzleHttp\\Client();\n }", "protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function __construct(MainRepository $mainRepository){\n $this->mainRepository = $mainRepository;\n }", "function config_from_git($git_sources)\n{\n\tglobal $branch, $revision, $commit_url;\n\n\t// only run git stuff, if sources exist, are git and git cli is available\n\tif (@file_exists($git_sources.'/.git') && !exec(\"hash git 2>/dev/null\"))\n\t{\n\t\t$branch = trim(exec(\"cd $git_sources >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \\\"s/* \\(.*\\)/\\\\1/\\\"\"));\n\t\t$revision = exec(\"cd $git_sources >/dev/null 2>&1 && git rev-parse --short HEAD &2>/dev/null\");\n\t\t$matches = null;\n\t\tif (empty($commit_url) &&\n\t\t\t($remote = exec(\"cd $git_sources >/dev/null 2>&1 && git remote -v &2>/dev/null\")) &&\n\t\t\tpreg_match('/(git@github.com:|https:\\/\\/github.com\\/)(.*)\\.git/i', $remote, $matches))\n\t\t{\n\t\t\t$commit_url = 'https://github.com/'.$matches[2].'/commit/';\n\t\t}\n\t\t//error_log(__METHOD__.\"('$git_sources') branch='$branch', revision='$revision', commit_url='$commit_url'\");\n\t}\n\t// get revision from request\n\telseif (!empty($_REQUEST['revision']) && preg_match('/^[0-9a-f]+$/', $_REQUEST['revision']))\n\t{\n\t\t$revision = $_REQUEST['revision'];\n\t}\n}", "public function __construct(\n AssetRepositoryInterface $assets,\n CategoryRepositoryInterface $categories,\n CityImageRepositoryInterface $cityImages,\n CompanyRepositoryInterface $companies,\n EntityRepositoryInterface $entities,\n FeatureRepositoryInterface $features,\n FranchiseRepositoryInterface $franchises,\n LocationRepositoryInterface $locations,\n MerchantRepositoryInterface $merchants,\n UserLocationRepositoryInterface $userLocations,\n UserRepositoryInterface $users,\n ZipcodeRepositoryInterface $zipcodes\n )\n {\n $this->assets = $assets;\n $this->categories = $categories;\n $this->cityImages = $cityImages;\n $this->companies = $companies;\n $this->entities = $entities;\n $this->features = $features;\n $this->franchises = $franchises;\n $this->geoip = json_decode(GeoIp::getGeoIp('json'));\n $this->locations = $locations;\n $this->merchants = $merchants;\n $this->personFactory = new \\SOE\\Persons\\PersonFactory;\n $this->userLocations = $userLocations;\n $this->users = $users;\n $this->viewableFactory = new \\SOE\\Viewables\\ViewableFactory;\n $this->zipcodes = $zipcodes;\n parent::__construct();\n }", "public function init() {\n\t\t$this->cacheDir = $this->chatBot->vars[\"cachefolder\"];\n\n\t\t//Making sure that the cache folder exists\n\t\tif (!dir($this->cacheDir)) {\n\t\t\tmkdir($this->cacheDir, 0777);\n\t\t}\n\t}", "public static function fetch_github()\n {\n $username = Config::get('ProjectLister::username');\n\n $projects = array();\n\n $url = \"https://api.github.com/users/$username/repos\";\n $json = Utility::get($url);\n\n if(!is_array($json = json_decode($json)))\n return FALSE;\n\n foreach($json as $repo)\n {\n $proj = new ProjectLister;\n $proj->url = $repo->html_url;\n $proj->name = $repo->name;\n $proj->description = $repo->description;\n $proj->watchers = $repo->watchers;\n $proj->source = \"GitHub\";\n $proj->watcher_noun = ($repo->watchers == 1 ? 'watcher' : 'watchers');\n $proj->updated = strtotime($repo->pushed_at);\n\n $projects[] = $proj;\n }\n\n return $projects;\n }", "public function run()\n {\n return $this->repoClass->init();\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public static function &create_new($repo_path, $source = null, $remote_source = false, $reference = null) {\n\t\t\tif (is_dir($repo_path) && file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is already a git repository');\n\t\t\t} else {\n\t\t\t\t$repo = new self($repo_path, true, false);\n\t\t\t\tif (is_string($source)) {\n\t\t\t\t\tif ($remote_source) {\n\t\t\t\t\t\tif (!is_dir($reference) || !is_dir($reference.'/.git')) {\n\t\t\t\t\t\t\tthrow new Exception('\"'.$reference.'\" is not a git repository. Cannot use as reference.');\n\t\t\t\t\t\t} else if (strlen($reference)) {\n\t\t\t\t\t\t\t$reference = realpath($reference);\n\t\t\t\t\t\t\t$reference = \"--reference $reference\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repo->clone_remote($source, $reference);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$repo->clone_from($source);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$repo->run('init');\n\t\t\t\t}\n\t\t\t\treturn $repo;\n\t\t\t}\n\t\t}", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "public function __construct()\n {\n $this->metadatas = app(MetadataRepository::class);\n $this->fileRepository = app(FileRepository::class);\n if(method_exists($this, 'init')){\n $this->init();\n }\n }", "public function setUp()\n {\n $this->files = array(\n 'composer' => sys_get_temp_dir().'/composer.phar',\n 'selfupdater' => sys_get_temp_dir().'/composerselfupdateissuetest.php',\n );\n }", "public function init()\n {\n Yii::app()->getModule('push');\n }", "public function __construct(PollRepositoryInterface $pollRepo, UserRepositoryInterface $userRepo, QuestionRepositoryInterface $questionRepo, AnswerRepositoryInterface $answerRepo, UserAnswerRepositoryInterface $userAnswerRepo)\n {\n $this->pollRepo = $pollRepo;\n $this->userRepo = $userRepo;\n $this->questionRepo = $questionRepo;\n $this->answerRepo = $answerRepo;\n $this->userAnswerRepo = $userAnswerRepo;\n }", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "function repositoryCustom()\n {\n }" ]
[ "0.7279545", "0.6670897", "0.6670897", "0.654073", "0.64604723", "0.6432269", "0.63350374", "0.63283527", "0.63090694", "0.62556434", "0.62288153", "0.615954", "0.6146635", "0.6120152", "0.5970345", "0.59287566", "0.59048176", "0.5866624", "0.5812064", "0.5783141", "0.5760324", "0.57126886", "0.5697341", "0.5695578", "0.56048185", "0.5598951", "0.5591206", "0.55496943", "0.55323213", "0.5497431", "0.5488027", "0.54866654", "0.5479352", "0.54552317", "0.54223764", "0.54205775", "0.53842235", "0.53590256", "0.53446406", "0.53222615", "0.5317469", "0.53043914", "0.52895087", "0.528843", "0.5286143", "0.5280422", "0.52618533", "0.52331734", "0.522032", "0.5212399", "0.51984406", "0.5196727", "0.5186116", "0.5166606", "0.5157333", "0.51367146", "0.5129539", "0.511291", "0.5110227", "0.5108271", "0.51064837", "0.50879306", "0.50783694", "0.5076058", "0.50751036", "0.507426", "0.507362", "0.50631243", "0.5059616", "0.5058979", "0.5058979", "0.5050007", "0.50470376", "0.5035571", "0.50316894", "0.5023485", "0.50183153", "0.5006285", "0.5000138", "0.49992087", "0.49977547", "0.49958745", "0.49877933", "0.49872965", "0.49799576", "0.49636656", "0.49583077", "0.49504942", "0.4949572", "0.49468136", "0.49457029", "0.49335217", "0.49319342", "0.49309665", "0.49143168", "0.489872", "0.48945686", "0.48945192", "0.48864517", "0.4884411" ]
0.7953516
0
Associate the current subdomain with it's set association
Связать текущий поддомен с его установленной ассоциацией
function associateSubdomain($sd=false) { if(!$sd) $sd = SUBDOMAIN; if($sd) { global $DB; return $DB->subdomains->getCell(array('subdomain' => $sd), 'assoc'); } else { return 'frontpage'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a multi level tld, like .co.uk\n\t\tarray_pop($parts);\n\t\tarray_pop($parts);\n\t\t$this->subdomain = implode('.', $parts);\n\t}\n\tif (self::$force_www && !$this->subdomain) $this->subdomain = 'www';\n}", "function addAssociatedDomain( $fqdn ) {\n\t\tglobal $wgAuth;\n\n\t\t$associatedomains = array();\n\t\tif ( isset( $this->hostInfo[0]['associateddomain'] ) ) {\n\t\t\t$associatedomains = $this->hostInfo[0]['associateddomain'];\n\t\t\tarray_shift( $associatedomains );\n\t\t}\n\t\t$associatedomains[] = $fqdn;\n\t\t$values = array();\n\t\t$values['associateddomain'] = $associatedomains;\n\t\t$success = LdapAuthenticationPlugin::ldap_modify( $wgAuth->ldapconn, $this->hostDN, $values );\n\t\tif ( $success ) {\n\t\t\t$wgAuth->printDebug( \"Successfully added $fqdn to $this->hostDN\", NONSENSITIVE );\n\t\t\t$this->domain->updateSOA();\n\t\t\t$this->fetchHostInfo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to add $fqdn to $this->hostDN\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}", "public function withSubDomain(DomainName $subDomain): self;", "public function setSubdomain($subdomain)\n {\n $this->subdomain = $subdomain;\n }", "public function subDomain(): DomainName;", "public function subdomains($value) {\n return $this->setProperty('subdomains', $value);\n }", "public function canCreateSubdomains();", "public function auto_configure()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $current_domain = $this->get_domain();\n\n if (empty($current_domain)) {\n $domain = new Domain();\n $default_domain = $domain->get_default();\n\n if (!empty($default_domain))\n $this->set_domain($default_domain);\n }\n }", "function add() {\n\n\t\t/**\n\t\t * Check if DNS module is enabled.\n\t\t * Call \"Module\" component to check.\n\t\t * 'DNS' is the module name (check in database).\n\t\t */\n\t\t$this->Module->check('DNS');\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * Check if subdomain quota is not over.\n\t\t * If yes, the user see an error message.\n\t\t * Call the \"Quota\" component to check.\n\t\t */\n\t\t$this->Quota->check('Subdomain', 'subdomain');\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Select the user ID of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUserId = array('conditions' => array('Domain.id' => $this->params['data']['Subdomain']['domain_id']));\n\t\t\t$queryUserDomainId = $this->Subdomain->Domain->find('first', $conditionUserId);\n\t\t\t\n\t\t\t/**\n\t\t\t * Split the subdomain string in an array. \n\t\t\t * @var array\n\t\t\t */\n\t\t\t$analyze = explode('.', $this->data['Subdomain']['name']);\n\n\t\t\t/**\n\t\t\t * Check if the domain name in the subdomain is the same than the domain name selected in the domains list.\n\t\t\t */\n\t\t\tif (isset($analyze['1']) && isset($analyze['2']) && $analyze['1'] . '.' . $analyze['2'] != $queryUserDomainId['Domain']['name']) {\n\t\t\t\t$this->Session->setFlash(__d('domain', 'Wrong domain name used in the subdomain name string.', true), 'default', array('class' => 'error'));\n\t\t\t\t$this->redirect(array('action' => 'add'));\n\t\t\t}\n\n\t\t\t$this->Subdomain->create();\n\n\t\t\t/**\n\t\t\t * Save new subdomain.\n\t\t\t */\n\t\t\tif ($this->Subdomain->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($this->data['Subdomain']['name'], 'SUBDOMAIN', $this->Auth->user('name'), $this->Auth->user('email'), $this->data['Subdomain']['domain_id'], NULL, 1);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'The subdomain has been saved.', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * Save the user ID.\n\t\t\t\t */\n\t\t\t\t$this->Subdomain->saveField('user_id', $this->Auth->user('id'));\n\n\t\t\t\t/**\n\t\t\t\t * If the new subdomain is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the subdomain is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all domains who belongs to the user.\n\t\t * Select by user ID.\n\t\t * @var array\n\t\t */\n\t\t$conditions = array('conditions' => array('Domain.user_id' => $this->Auth->user('id')));\n\t\t$domains = $this->Subdomain->Domain->find('list', $conditions);\n\n\t\t/**\n\t\t * Put all domains in \"$domains\".\n\t\t * $domains will be available in the view.\n\t\t */\n\t\t$this->set(compact('domains'));\n\n\t}", "public function canManageSubdomains();", "public function addDomainNameIntoHosts()\n {\n $this->addToHosts();\n $this->addToHostprofiles();\n }", "function setDomain($domain)\n {\n }", "function getAssociatedDomains() {\n\t\t$associateddomain = array();\n\t\tif ( isset( $this->hostInfo[0]['associateddomain'] ) ) {\n\t\t\t$associateddomain = $this->hostInfo[0]['associateddomain'];\n\t\t\tarray_shift( $associateddomain );\n\t\t}\n\n\t\treturn $associateddomain;\n\t}", "public function incrementDomains()\n {\n $this->domains[] = '';\n }", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Select the user ID of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUserId = array('conditions' => array('Domain.id' => $this->params['data']['Subdomain']['domain_id']));\n\t\t\t$queryUserDomainId = $this->Subdomain->Domain->find('first', $conditionUserId);\n\n\t\t\t/**\n\t\t\t * Select the user name and email of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUser = array('conditions' => array('User.id' => $queryUserDomainId['Domain']['user_id']));\n\t\t\t$queryUser = $this->Subdomain->User->find('first', $conditionUser);\n\t\t\t\n\t\t\t/**\n\t\t\t * Split the subdomain string in an array. \n\t\t\t * @var array\n\t\t\t */\n\t\t\t$analyze = explode('.', $this->data['Subdomain']['name']);\n\n\t\t\t/**\n\t\t\t * Check if the domain name in the subdomain is the same than the domain name selected in the domains list.\n\t\t\t */\n\t\t\tif (isset($analyze['1']) && isset($analyze['2']) && $analyze['1'] . '.' . $analyze['2'] != $queryUserDomainId['Domain']['name']) {\n\t\t\t\t$this->Session->setFlash(__d('domain', 'Wrong domain name used in the subdomain name string.', true), 'default', array('class' => 'error'));\n\t\t\t\t$this->redirect(array('action' => 'add'));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Save new subdomain.\n\t\t\t */\n\t\t\t$this->Subdomain->create();\n\t\t\tif ($this->Subdomain->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Save the user ID.\n\t\t\t\t */\n\t\t\t\t$this->Subdomain->saveField('user_id', $queryUserDomainId['Domain']['user_id']);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($this->data['Subdomain']['name'], 'SUBDOMAIN', $queryUser['User']['name'], $queryUser['User']['email'], $this->data['Subdomain']['domain_id'], NULL, 1);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'Subdomain added by (' . $this->Auth->user('name') . ') for (' . $queryUser['User']['name'] . ').', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * If the new subdomain is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the subdomain is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all domains.\n\t\t * @var array\n\t\t */\n\t\t$domains = $this->Subdomain->Domain->find('list');\n\n\t\t/**\n\t\t * Put all domains in \"domains\".\n\t\t * $domains will be available in the view.\n\t\t */\n\t\t$this->set(compact('domains'));\n\n\t}", "function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) { \n $domain = $rootDomain;\n $subdomain = $subDomain; \n $username = $cPanelUser;\n $password = $cPanelPass;\n $targetFolder = 'public_html/eazypaper'; \n \n $xmlapi = new xmlapi($domain );\n $xmlapi->set_port('2083');\n $xmlapi->password_auth($username, $password);\n $xmlapi->set_debug(0); // or you can use 1\n $xmlapi->set_output('xml'); // you can use 'json'\n $args = array($subdomain, $domain , 0, 0, $targetFolder);\n $res = $xmlapi->api1_query($username, 'SubDomain', 'addsubdomain', $args); \n }", "protected function registeringDomain()\n {\n }", "function getSubDomain()\n{\n\t// return $referrer;\n\n if(isset($_SERVER['HTTP_REFERER'])) {\n\n \t$url = $_SERVER['HTTP_REFERER'];\n \t$parsedUrl = parse_url($url);\n \t$host = explode('.', $parsedUrl['host']);\n \t$schoolSubdomain = $host[0];\n\t\t\tif($schoolSubdomain == \"documentation\"){$schoolSubdomain = 'dev2';}\n \t// var_dump($schoolSubdomain); // echo's school subdomain eg \"dev\"\n \treturn $schoolSubdomain;\n\n }\n else\n {\n\t\t//it was not sent, perform your default actions here\n\t\t// $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t// return $referrer;\n\t\t\t if(isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER'])){\n\t\t\t\t $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t\t\t return $referrer;\n\t\t\t }elseif(isset($_SERVER['HTTP_ORIGIN'])){\n\t\t\t\t $url = $_SERVER['HTTP_ORIGIN'];\n\t\t\t\t $parsedUrl = parse_url($url);\n\t\t\t\t $host = explode('.', $parsedUrl['host']);\n\t\t\t\t $schoolSubdomain = $host[0];\n\t\t\t\t return $schoolSubdomain;\n\t\t\t }\n // note that the above initiates OPTIONS request which is vulnerable\n }\n\t/*\n\t$referrer = ( isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'http://hog.eduweb.localhost/');\n\t$data = explode('.', $referrer); // Get the sub-domain here\n\n\n\t Add some sanitization for $data\n\n\tif (!empty($data[0])) {\n\t\t$subdomain = substr($data[0], strpos($data[0], '//') + 2 ); // The * of *.mydummyapp.com will be now stored in $subdomain\n\t}\n\treturn $subdomain;\n\t*/\n}", "protected function load_domain_channel() {\n\t\n\t\t$splits = explode(\".\",@$_SERVER['SERVER_NAME']);\n $this->current_domain = @$_SERVER['SERVER_NAME'];\n\t\tif (count($splits) > 3) {\n\t\t\t/* \n\t\t\tif the current url is a channel subdomain , get the channel id \n\t\t\t*/\n\t\t\t$this->main_domain = $splits[1].\".\".$splits[2].\".\".$splits[3];\n\t\t\t$this->channel = ORM::factory('channel')\n\t\t\t->where(\"code\",\"=\",$splits[0])\n\t\t\t->find();\n\t\t\t//If there is no such channel redirect to main domain.\n\t\t\n\t\t\tif (!$this->channel->loaded()) {\n\t\t\t\t$this->request->redirect(\"http://{$this->main_domain}\");\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->main_domain = $splits[0].\".\".$splits[1].\".\".$splits[2];\n\t\t}\n\t\t\n\t}", "function domain_add($key,&$obj){\n if(!($obj instanceof opc_umd)) return 1;\n $this->domains[$key] = $obj;\n $this->domain_labels[$key] = $obj->label();\n if(!in_array($key,$this->domain_seq)) $this->domain_seq[] = $key;\n return 0;\n }", "function domains() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/domains.xml?api_key={$this->api_key}\",\"domain\");\n\t}", "public function canManageOwnSubdomain();", "function ms_subdomain_constants()\n {\n }", "protected function registeredDomain()\n {\n }", "public function getSubdomain()\n {\n return $this->subdomain;\n }", "protected function setupDomains()\n {\n static $done;\n\n if (!empty($done)) {\n return;\n }\n\n $d = new Domains();\n $d->setDomainName('dk');\n $d->setDomainKey('DK');\n $d->save();\n\n $d = new Domains();\n $d->setDomainName('dk');\n $d->setDomainKey('SalesDK');\n $d->save();\n\n $d = new Domains();\n $d->setDomainName('com');\n $d->setDomainKey('COM');\n $d->save();\n\n $done = true;\n }", "protected function setDomain($new_domain)\n\t{\n\t\t$this->activeDomain = $new_domain;\n\t}", "public function setDomain($url) {\n\t\t$this->_domain = $url;\n\t}", "function set_fr_domain( $args, $assoc_args ) {\n global $sitepress, $envs;\n\n if (defined('ICL_LANGUAGE_CODE') && defined('WP_ENV') && is_array($envs)) {\n $fr_stages = $envs['fr'];\n $current_stage = WP_ENV;\n if (isset($fr_stages[$current_stage])) {\n $fr_domain = $fr_stages[$current_stage];\n $fr_domain = \"https://\" . $fr_domain;\n } else {\n return;\n }\n } else {\n return;\n }\n\n $iclsettings = $sitepress->get_settings();\n $iclsettings['language_domains']['fr'] = $fr_domain;\n $sitepress->save_settings($iclsettings);\n\n if ($fr_domain == $sitepress->get_settings()['language_domains']['fr']) {\n WP_CLI::success( \"Set the French domain to $fr_domain\" );\n } else {\n WP_CLI::error( \"Error setting the French domain to $fr_domain\" );\n }\n\n }", "function setBaseDomain($full_url) {\n $urlParts = parse_url($full_url);\n //add case for localhost\n // print_r($urlParts);\n $host=$urlParts['host'];\n if($host==\"localhost\") {\n \n $this->base_domain = $host;\n }\n else {\n $hostParts = explode('.', $urlParts['host']);\n $hostParts = array_reverse($hostParts);\n // $host = $hostParts[1] . '.' . $hostParts[0]; with final extension\n if (($hostParts[1])!== null) {\n $host = $hostParts[1];\n $this->base_domain = $host;\n }\n }\n\n }", "public static function subdomains()\n\t{\n\t\t$domains = self::_getConfigArray();\n\t\tarray_pop($domains);\n\t\t// Config contained only a single domain (\".com\")\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\t// Config contained no subdomains (\"example.com\")\n\t\tarray_shift($domains);\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\treturn $domains;\n\t}", "function ms_load_current_site_and_network($domain, $path, $subdomain = \\false)\n {\n }", "function add_domain_to_user($submission, $session_id) {\n\t\n\t// get the user_id (and check validity of session) based on session_id\n\t$user_id = get_user_id(make_safe($session_id));\n\t\n\t// check entry type\n\tif (check_input_type($submission) == \"ip\") {\n\t\t$entry = $submission;\n\t} elseif (check_input_type($submission) == \"url\") {\n\t\t$entry = get_domain_only($submission);\n\t}\n\t\n\t$current_time = time();\n\t\t\n\t// if domain is blank, try adding http:// in front\n\tif ($entry == \"\" ) {\n\t\t$entry = get_domain_only(\"http://\" . $submission);\n\t\t// if still blank then exit\n\t\tif ($entry == \"\") {\n\t\t\treturn \"Error: invalid entry\";\n\t\t}\n\t}\n\t\n\t\n\t// check if domain already exists for this user\n\t// if so, return error\n\t$website_list = get_list_of_websites($session_id); //array( array('site_id', 'domain'), ...)\n\tforeach ($website_list as $website) {\n\t\tif ($website['domain'] == $entry) {\n\t\t\treturn \"Error: Site already exists for user\";\n\t\t}\n\t}\n\t\n\tif ($user_id) {\n\t\t\n\t\tif ($entry) {\n\t\t\n\t\t\t$unique_id = uniqid();\n\t\t\t$query = \"INSERT INTO \" . $GLOBALS['db_name'] . \".websites (site_id, user_id, domain, alerts, creation_time) VALUES ('$unique_id', '$user_id', '$entry', 'disabled', '$current_time')\";\n\t\t\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\t\t\treturn \"Site added successfully\";\n\t\t\t} else {\n\t\t\t\tdisplay_sql_error();\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Invalid address\";\n\t\t}\n\t\t\n\t} else {\n\t\treturn \"Invalid Session\";\n\t}\n\t\n}", "public function addDomains(array $hosts): void;", "protected function registerAffecting()\n {\n $this->events->listen(ConfigureURL::class, function (ConfigureURL $event) {\n $event->changeRoot($event->event->tenant->getTenantKey().'.tenancy.dev');\n });\n }", "public function init() {\n parent::init();\n $this->domain = pm_Session::getCurrentDomain();\n }", "function get_clean_basedomain()\n {\n }", "function is_subdomain_install()\n {\n }", "private function mappingDomain($real_name, $name, $site_full, $did) {\n\t\t$site_name = $name;\n\t\t$site_create = $real_name;\t\t\n\n\t\t$domain = Domain::findOrFail($did);\n\t\t$domain_name = $domain->name;\n\t\t$domain_mapid = $domain->mapid;\n\t\t$site_new = $site_name.\".\".$domain_name;\n\n\t\t$site_ip = shell_exec('nslookup '.$site_full.' | tail -2 | head -1 | awk \\'{print $2}\\'');\n\n\t\t$make_subdomain = SiteController::MakeSubdomain_Init($domain_mapid, $site_name, $site_full, $site_ip);\n\t\tif($make_subdomain)\t{\n\t\t\tshell_exec(SiteController::$AZURE_PATH.' site domain add \"'.$site_name.'.'.$domain_name.'\" \"'.$site_create.'\" 2>&1');\n\t\t\tob_flush();\n\t\t\t$output = shell_exec(SiteController::$AZURE_PATH.' site domain list '.$site_create.' --json 2>&1');\n\t\t\tob_flush();\n\t\t\t$site_mapping = json_decode($output);\n\t\t\tif(count($site_mapping) > 1 && ($site_mapping[0] == $site_new)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "protected function add_sample_domains(){\n $gougousis = new Domain([\n 'node_name' => 'gougousis.gr',\n 'full_name' => 'gougousis.gr',\n 'fake' => 0\n ]);\n $gougousis->save();\n\n $dom1 = new Domain([\n 'node_name' => 'dom1',\n 'full_name' => 'dom1.gougousis.gr',\n 'fake' => 0\n ]);\n $dom1->save();\n $dom1->makeChildOf($gougousis);\n\n $dom2 = new Domain([\n 'node_name' => 'dom2',\n 'full_name' => 'dom2.gougousis.gr',\n 'fake' => 0\n ]);\n $dom2->save();\n $dom2->makeChildOf($gougousis);\n\n $delegation = new DomainDelegation([\n 'user_id' => $this->admin->id,\n 'domain_id' => $gougousis->id\n ]);\n $delegation->save();\n\n // These are supposed to be created by $this->non_admin\n $takis = new Domain([\n 'node_name' => 'takis.gr',\n 'full_name' => 'takis.gr',\n 'fake' => 0\n ]);\n $takis->save();\n\n $delegation = new DomainDelegation([\n 'user_id' => $this->non_admin->id,\n 'domain_id' => $takis->id\n ]);\n $delegation->save();\n\n }", "function setEmails($emails) {\n //foreach($emails as $email) {\n list($user, $domain) = $this->_parseEmail($emails);\n if (!isset($this->domains[$domain])) {\n $this->domains[$domain] = array();\n }\n $this->domains[$domain][] = $user;\n //}\n }", "public function get_shop_subdomain( )\r\n\t {\r\n\t\t //use defined in index.php, if not available extract ot ourselves\r\n\t \t return ( defined('SHOP_SUBDOMAIN') ? SHOP_SUBDOMAIN : SHOP_DOMAIN );\r\n\t }", "function get_cur_domain()\n{\n}", "function w3tc_cdn_rename_domain() {\n\t\t$w3_plugin_cdn = Dispatcher::component( 'Cdn_Core_Admin' );\n\n\t\t$total = $w3_plugin_cdn->get_rename_posts_count();\n\n\t\t$title = __( 'Modify attachment URLs', 'w3-total-cache' );\n\n\t\tinclude W3TC_INC_DIR . '/popup/cdn_rename_domain.php';\n\t}", "public function setDomain($value = null)\n {\n\n }", "protected function setOrganization() {}", "public function set_domain_name( $app_id, $new_domain ) {\n\t\treturn update_post_meta( $app_id, 'wpapp_domain', $new_domain );\n\t}", "function guifi_domain_save($edit, $verbose = TRUE, $notify = TRUE) {\n global $user;\n\n $to_mail = array();\n $tomail[] = $user->mail;\n $log = \"\";\n $to_mail = array();\n\n // domain\n $ndomain = _guifi_db_sql('guifi_dns_domains',array('id' => $edit['id']),$edit,$log,$to_mail);\n\n guifi_log(GUIFILOG_TRACE,\n sprintf('domain saved:'),\n $ndomain);\n\n\n // hosts\n $rc = 0;\n if (is_array($edit['hosts']))\n ksort($edit['hosts']);\n $rc = 0;\n\n if ($edit['hosts'])\n foreach ($edit['hosts'] as $counter => $host) {\n $keys['id'] = $ndomain['id'];\n $keys['counter']=$counter;\n $host['id'] = $ndomain['id'];\n $host['counter'] = $rc;\n\n if ($host['aliases']) {\n foreach ($host['aliases'] as $key => $name) {\n if (empty($name)) {\n unset($host['aliases'][$key]);\n }\n }\n $host['aliases'] = serialize($host['aliases']);\n } else {\n unset($host['aliases']);\n }\n if (($host['host'] == 'ns1' ) AND ($host['counter'] == '0')) {\n $host['opt']['options']['NS'] = 'NS';\n }\n $host['opt']['options']['mxprior'] = $host['opt']['mxprior'];\n $host['options'] = serialize($host['opt']['options']);\n\n // save the host\n $nhost = _guifi_db_sql('guifi_dns_hosts',$keys,$host,$log,$to_mail);\n if ((empty($nhost)) or ($host['deleted']))\n continue;\n $rc++;\n } // foreach host\n\n $to_mail = explode(',',$edit['notification']);\n\n if ($edit['new'])\n $subject = t('The domain %name has been CREATED by %user.',\n array('%name' => $edit['name'],\n '%user' => $user->name));\n else\n $subject = t('The domain %name has been UPDATED by %user.',\n array('%name' => $edit['name'],\n '%user' => $user->name));\n\n// drupal_set_message($subject);\n guifi_notify($to_mail,\n $subject,\n $log,\n $verbose,\n $notify);\n variable_set('guifi_refresh_dns',time());\n guifi_clear_cache($edit['sid']);\n guifi_clear_cache($edit['id']);\n\n return $ndomain['id'];\n\n}", "public function setDomain(Whois_Lookup_Domain $domain)\n {\n $this->_domain = $domain;\n }", "private function setHost()\n {\n $urlE = $this->explodedUrl;\n\n $this->host = $urlE[2];\n }", "function setDomain( $domain ) {\n $this->domain = $domain;\n }", "function add_domain($domain,$engine_ids) {\n $engine_ids_str='';\n \n foreach($engine_ids as $engine_id){\n $engine_ids_str.=\"$engine_id,\";\n }\n \n $parameters = array(\n 'method' => __FUNCTION__,\n 'domain' => $domain,\n 'engine_id' => rtrim($engine_ids_str,\",\")\n );\n $data = $this->get_data($parameters);\n return (array_key_exists('response', $data) && $data['response']==\"success\");\n }", "public function checkSubDomain()\n {\n $subdomain = Input::get('subdomain');\n if($this->_isValidSubDomain($subdomain))\n echo 'valid';\n else\n echo 'invalid';\n\n exit;\n }", "public function testAddDomain()\n {\n $list = new DomainList('.ing');\n $list->add('laugh');\n\n $domains = $list->get();\n $this->assertEquals(array('laugh.ing'), $domains);\n }", "public function testUpdateDomain()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function setDomain( $domain ) {\n $this->domain = $domain;\n }", "function getSubdomain() {\n global $CONFIG;\n if(!$CONFIG->Subdomains->Top_domain) return false;\n\n $matches = array();\n preg_match('#^(www\\.)?([^\\.]+)\\.'.str_replace('.', '\\.', $CONFIG->Subdomains->Top_domain).'#', $_SERVER['HTTP_HOST'], $matches);\n if(count($matches)>0) {\n return $matches[2];\n } else return false;\n}", "public function setShareWithDomain($value)\n {\n return $this->set('ShareWithDomain', $value);\n }", "public function secondLevelDomain(): DomainName;", "public function registrableDomain(): DomainName;", "public static function setDomains($domains)\n {\n $allDomains = [];\n foreach ($domains as $key => $value)\n {\n $allDomains[]['domain'] = $value;\n }\n return $allDomains;\n }", "function set_subsite_root() {\n\t\t$this->is_subsite_root = true;\n\t}", "function admin_index() {\n\n\t\t$this->Subdomain->recursive = 0;\n\n\t\t/**\n\t\t * Put all subdomains in \"subdomains\".\n\t\t * $subdomains will be available in the view.\n\t\t */\n\t\t$this->set('subdomains', $this->paginate());\n\n\t}", "public function initDomain($domain)\n {\n\t\t$this->domain = UrlCraw::where('domain' , $domain)->get();\n\t\tforeach ($this->domain as $url) {\n\t\t\t$this->url = $url;\n\t\t\t$this->initCrawler();\n\t\t}\n }", "public function setDomainAttribute($value)\n {\n $this->attributes['domain'] = strtolower($value);\n }", "function target_add_forum_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'forum_notify (user_id, forum_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['forum_id'] .')');\n}", "public function addSecondaryDnsDomains($domain, $domain2add, $ip){\n $domain = (string)$domain;\n if (!$domain)\n throw new BadMethodCallException('Parameter $domain is missing.');\n $domain2add = (string)$domain2add;\n if (!$domain2add)\n throw new BadMethodCallException('Parameter $domain2add is missing.');\n $ip = (string)$ip;\n if (!$ip)\n throw new BadMethodCallException('Parameter $ip is missing.');\n $payload = array(\"domain\"=>$domain2add, \"ip\"=>$ip);\n try {\n $r = $this->post('dedicated/server/'.$domain.'/secondaryDnsDomains', array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($payload))->send();\n } catch (\\Exception $e) {\n throw new ServerException($e->getMessage(), $e->getCode(), $e);\n }\n }", "public function testHABTMKeepExisting() {\n\t\t$this->loadFixtures('Site', 'Domain', 'DomainsSite');\n\n\t\t$Site = new Site();\n\t\t$results = $Site->find('count');\n\t\t$expected = 3;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t$data = $Site->findById(1);\n\n\t\t// include api.cakephp.org\n\t\t$data['Domain'] = array('Domain' => array(1, 2, 3));\n\t\t$Site->save($data);\n\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\t$expected = 3; // 3 domains belonging to cakephp\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 2;\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to markstory\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 3;\n\t\t$results = $Site->read();\n\t\t$expected = 2;\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\t\t$results['Domain'] = array('Domain' => array(7));\n\t\t$Site->save($results); // remove association from domain 6\n\t\t$results = $Site->read();\n\t\t$expected = 1; // only 1 domain left belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t// add deleted domain back\n\t\t$results['Domain'] = array('Domain' => array(6, 7));\n\t\t$Site->save($results);\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->DomainsSite->id = $results['Domain'][0]['DomainsSite']['id'];\n\t\t$Site->DomainsSite->saveField('active', true);\n\n\t\t$results = $Site->Domain->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 5;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// activate api.cakephp.org\n\t\t$activated = $Site->DomainsSite->findByDomainId(3);\n\t\t$activated['DomainsSite']['active'] = true;\n\t\t$Site->DomainsSite->save($activated);\n\n\t\t$results = $Site->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 6;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// remove 2 previously active domains, and leave $activated alone\n\t\t$data = array(\n\t\t\t'Site' => array('id' => 1, 'name' => 'cakephp (modified)'),\n\t\t\t'Domain' => array(\n\t\t\t\t'Domain' => array(3),\n\t\t\t)\n\t\t);\n\t\t$Site->create($data);\n\t\t$Site->save($data);\n\n\t\t// tests that record is still identical prior to removal\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\tunset($results['Domain'][0]['DomainsSite']['updated']);\n\t\tunset($activated['DomainsSite']['updated']);\n\t\t$this->assertEquals($activated['DomainsSite'], $results['Domain'][0]['DomainsSite']);\n\t}", "function createAlias($dstdomain,$srcdomain){\n\n $res = $res = $this->client->request('PUT',$this->path.'/'.$dstdomain.'/aliases/'.$srcdomain,[]);\n $this->checkResponse($res,array(204, 400, 404));\n return $res;\n }", "public function setUriDomain(?string $value): void {\n $this->getBackingStore()->set('uriDomain', $value);\n }", "function getDomain()\n {\n }", "function domains_add($files){\n $res = array();\n foreach($files as $key=>$file) $res[$key] = $this->domain_add($key,$file);\n return $res;\n }", "public function withSecondLevelDomain(DomainName $label): self;", "public function beforeSet() {\r\n\t\t$this->oldDomain = $this->object->get('domain');\r\n\t\t$sitestart = $this->getProperty('sitestart');\r\n\t\t$this->setProperty('sitestart', (!empty($sitestart) ? $sitestart : null));\r\n\t\t\r\n\t\treturn parent::beforeSet();\r\n\t}", "private function fetchCurrentDomainConfiguration() {\n // are some supported domains defined?\n if (!isset($this->config->supported_domains) ||\n empty($this->config->supported_domains)) {\n throw new MultidomainException(\n 'No supported domains defined in config.yml file'\n );\n }\n\n $askedHost = null;\n\n $host = explode(':', $_SERVER['HTTP_HOST'])[0];\n $hostWithoutApi = null;\n\n if (substr($host, 0, 4) == 'api.') { // if starts with 'api.'\n $hostWithoutApi = substr($host, 4); // remove the 'api.' prefix\n }\n\n // check if host is defined in configuration file\n if (property_exists($this->config->supported_domains, $host)) {\n $askedHost = $host;\n } else if (\n !is_null($hostWithoutApi) &&\n property_exists($this->config->supported_domains, $hostWithoutApi)\n ) {\n $askedHost = $hostWithoutApi;\n }\n\n if (\n is_null($askedHost) ||\n !property_exists($this->config->supported_domains, $askedHost)\n ) {\n if (!isset($this->config->fallback_url) ||\n empty($this->config->fallback_url)) {\n throw new Exception('This domain is not configured for the moment.');\n } else {\n header('Location: ' . $this->config->fallback_url);\n die();\n }\n }\n\n $this->domainConfig = $this->config->supported_domains->$askedHost;\n }", "public function setUserDomain(?string $value): void {\n $this->getBackingStore()->set('userDomain', $value);\n }", "function save()\n {\n $baseobject = $this->getBaseObject();\n $this->dn = \"cn=$baseobject->cn,\".get_ou('phoneRDN').$baseobject->base;\n $baseobject->dn = $this->dn;\n\n foreach ($this->by_object as $key => $obj) {\n $this->by_object[$key]->dn = $this->dn;\n }\n\n parent::save();\n }", "public function addSearch(string $domain): void {}", "public function load()\n {\n return $this->domains;\n }", "public function testDomainAddCommand()\n {\n $site = Arr::get($_SERVER, 'SERVER_NAME');\n\n if (!$site) {\n $this->assertTrue(true);\n return;\n }\n\n $argDomain = $site ? ['domain' => $site] : [];\n\n $this->artisan('domain:add', $argDomain);\n\n $this->assertFileExists(env_path('.env.'.$site));\n\n $this->artisan('config:clear');\n\n $domainListed = Config::get('domain.domains');\n\n $this->assertArrayHasKey($site,$domainListed);\n\n $this->assertDirectoryExists(app()->exactDomainStoragePath());\n }", "function setSubject( $str ){\n $this->Subject = SITE_NAME.\": \".$str;\n }", "public function addSiteLinks()\n {\n foreach ($this->getSiteLinks() as $item) {\n $this->addArray($item);\n }\n }", "public function setRelatedHosts(?array $value): void {\n $this->getBackingStore()->set('relatedHosts', $value);\n }", "function __construct() { \r\n // We take domain from order copy email config value\r\n $this->domain = substr(\r\n strstr(\r\n Mage::getStoreConfig(\r\n 'sales_email/order/copy_to'\r\n , Mage::app()->getStore()\r\n ), '@')\r\n , 1\r\n );\r\n}", "function guifi_domain_add() {\n guifi_log(GUIFILOG_TRACE,'function guifi_domain_add()');\n if (arg(8) == 'external')\n $ipv4 = '';\n else\n $ipv4 = arg(6);\n\n $output = drupal_get_form('guifi_domain_form',array(\n 'add' => arg(3),\n 'dname' => arg(4),\n 'type' => arg(5),\n 'ipv4' => $ipv4,\n 'mname' => arg(7),\n 'scope' => arg(8),\n 'management' => arg(9)));\n\n // To gain space, save bandwith and CPU, omit blocks\n print theme('page', $output, FALSE);\n}", "protected function setUp(): void\n {\n parent::setUp();\n\n Route::domain('site2.test')\n ->get('domain-route', fn () => response()->json(config('domain')))\n ->middleware(['api']);\n }", "protected function negotiateActiveDomain() {\n $httpHost = $this->negotiateActiveHostname();\n $this->setRequestDomain($httpHost);\n return $this->domain;\n }", "function cacheplugin_subdomain() {\r\n\t\t$cachepageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';\r\n\t\t$cachepageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n\t\t$cacheparsedUrl = parse_url($cachepageURL);\r\n\t\t$cachehost = explode('.', $cacheparsedUrl['host']);\r\n\treturn $cachehost[0];\r\n\t}", "static function change_new_blog_domain_name( int $blog_id, int $user_id, string $domain ) {\n\n // Parse site slug from full domain\n $slug = strtok($domain, '.');\n $new_domain = $slug . '.' . self::get_multisite_tld();\n\n // Replace the domain that was just created\n global $wpdb;\n $wpdb->update( $wpdb->blogs, array( 'domain' => $new_domain ), array( 'blog_id' => $blog_id ) );\n\n // Replace blog home & siteurl\n update_blog_option ( $blog_id, 'siteurl', 'http://' . $new_domain );\n update_blog_option ( $blog_id, 'home', 'http://' . $new_domain );\n }", "public function testAddTwoDomains()\n {\n $list = new DomainList('ing');\n $list->add([\n 'laugh', 'cry'\n ]);\n\n $domains = $list->get();\n $this->assertEquals(array('laugh.ing', 'cry.ing'), $domains);\n }", "public function GetActiveDomains($ARGS = false)\n {\n $Q = $this->DB->GET('MUP.domains.domains', ['status__IN' => [0, 1, 2, 4], 'nsReady' => 1], ['domain'], 100000);\n foreach ($Q as $i => $q) \n $this->SetDomains[] = $q['domain'];\n }", "public function get_domains()\n\t{\n\t\treturn $this->domains;\n\t}", "public function setDomain( $domain )\n {\n $this->domain = us($domain);\n }", "protected function link_user_to_site($domain)\n\t{\n\t\t$this->db->insert('linked', array('user_id' => session('user_id'), 'domain_id' => $domain->id, 'created' => date(\"Y-m-d H:i:s\")));\n\t}", "public function setupAssociations() \n {\n \n }", "public function setDomain($domain)\n {\n $this->_domain = $domain;\n }", "public function setAlias($data)\n {\n $oldAliasList = $this->getAliases();\n $aliases = array();\n $lib = new \\Cx\\Core_Modules\\Alias\\Controller\\AliasLib($this->getLang());\n foreach ($oldAliasList as $oldAlias) {\n if (in_array($oldAlias->getSlug(), $data)) {\n // existing alias, ignore;\n $aliases[] = $oldAlias->getSlug();\n } else {\n // deleted alias\n $lib->_deleteAlias($oldAlias->getNode()->getId());\n }\n }\n foreach ($data as $alias) {\n if (!in_array($alias, $aliases)) {\n // new alias\n $lib->_saveAlias($alias, '[[' . self::PLACEHOLDER_PREFIX . $this->getNode()->getId() . '_' . $this->getLang() . ']]', true);\n }\n }\n }", "function _setSubjectMenu() {\n\t\t$this->loadModel('Subject');\n\t\t$subjects = $this->Subject->find('threaded');\n\t\t$this->set('subjects', $subjects);\n\t}", "public function set($domain, $key, $value)\n {\n if (!$this->enabled)\n {\n return;\n }\n\n static $no_cache = false;\n if (!$no_cache)\n {\n // midgardmvc_core::get_instance()->cache->content->no_cache();\n $no_cache = true;\n }\n\n $this->data[$domain][$key] = serialize($value);\n $this->dispatcher->session_set_var(self::ROOT, $this->data);\n }", "function _bind_textdomain_codeset($domain, $codeset)\r\n\t{\r\n\t\tglobal $text_domains;\r\n\t\t$text_domains[$domain]->codeset = $codeset;\r\n\t}" ]
[ "0.65115553", "0.6146808", "0.59660184", "0.5785171", "0.57528764", "0.5716687", "0.56461585", "0.5638809", "0.5620155", "0.5549493", "0.55481905", "0.55077696", "0.5505932", "0.54905224", "0.5456437", "0.5420965", "0.53574", "0.53569096", "0.5341232", "0.53346074", "0.53181314", "0.53113204", "0.5309855", "0.52698576", "0.52558684", "0.52373314", "0.51996714", "0.5152786", "0.5144234", "0.5141679", "0.50867105", "0.50791293", "0.5066734", "0.5008253", "0.50059426", "0.4983755", "0.49761474", "0.4971683", "0.495305", "0.49293807", "0.49284115", "0.49193612", "0.49167496", "0.4887891", "0.48858967", "0.48828274", "0.4867389", "0.4856162", "0.48462248", "0.48311833", "0.48193043", "0.48142943", "0.48070663", "0.48045295", "0.47983992", "0.47954744", "0.47953138", "0.47728527", "0.47562855", "0.47494358", "0.47379187", "0.4732243", "0.4722963", "0.47119737", "0.47067833", "0.47066632", "0.47062823", "0.46934977", "0.46826696", "0.46571538", "0.46459025", "0.46457288", "0.46450174", "0.46362972", "0.46222618", "0.462063", "0.45894128", "0.45839822", "0.45822093", "0.458166", "0.45665005", "0.45655432", "0.4561141", "0.45501494", "0.45492908", "0.45457155", "0.4543068", "0.45381063", "0.45320818", "0.4528483", "0.45220277", "0.4519662", "0.45186085", "0.45120466", "0.45110908", "0.45094383", "0.45056075", "0.45010325", "0.45007816", "0.4492225" ]
0.72454435
0
This function takes an error code and redirects it to an errorpage
Эта функция принимает код ошибки и перенаправляет его на страницу ошибки
function errorPage($error){ switch($error){ case 401: header('HTTP/1.1 401 Unauthorized'); break; case 403: header('HTTP/1.1 403 Forbidden');; break; case 404: header('HTTP/1.1 404 Not Found'); break; } global $Controller; if($p = $Controller->alias('error_'.$error)) { internalRedirect($p); } else { //@ob_end_clean(); print($error); } die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirect_error($code, $url = null) {\n\n global $CFG;\n\n // Set the redirect URL if it wasn't specified as a parameter\n if (!$url) {\n $url = $CFG->wwwroot;\n }\n\n // URL encode parameters to error page\n $code = urlencode($code);\n $url = urlencode($url);\n\n // Redirect user to error page with encoded parameters\n redirect($CFG->wwwroot . \"/blocks/courseprefs/error.php?error=$code\" .\n ($url ? \"&url=$url\" : ''));\n}", "protected function _redirectToError()\n {\n $this->_redirect(self::ZIPMONEY_ERROR_ROUTE);\n }", "public function actionError()\n\t{\n\t\tif($error = Yii::app()->errorHandler->error)\n\t\t{\n if($error['code']==404)\n\t\t\t$this->render('pages/404');\n else\n $this->redirect('/');\n\t\t}\n\t}", "function customError($errno, $errstr)\n {\n $_SESSION['err_msg'] = \"<b>Error:</b> [$errno] $errstr<br />\"; \n header(\"location: ../_php_fail.php\");\n die();\n }", "public static function renderErrorPage(): void\n {\n\t\tob_start();\n\t\theader('Location: /page/error');\n\t\tob_end_flush();\n }", "public static function error404(){\n \t\t// header(\"Status: 404 Not Found\");\n \t\theader('Location: /');\n }", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function error(string $code): string\n{\n header('HTTP/1.0 404 Not Found');\n $fileName = $code . '.view.php';\n $path = ERROR_VIEWS_PATH . $fileName;\n return getContent($path);\n}", "function errorPageHTTP ($i_code) {\n\t//send the error code to the browser\n\theader (' ', true, $i_code);\n\t//generate the error page\n\t$html = templatePage (\n\t\treMarkable (template_load (\"errors/$i_code.rem\")), $i_code,\n\t\ttemplateHeader (), templateFooter (\".system/design/templates/errors/$i_code\")\n\t);\n\t//cache it\n\tfile_put_contents (APP_CACHE.\"$i_code.html\", $html, LOCK_EX) or errorPage (\n\t\t'denied_cache.rem', 'Error: Permission Denied', array ('PATH' => APP_CACHE)\n\t);\n\t//display it\n\tdie ($html);\n}", "function error($params = array()) {\n header('location: /');\n }", "function myErrorHandler()\n{\n header(\"Location: ../\");\n}", "function error_page($msg, $redirect_to = \"\", $redirect_time = 0)\n{\n page_header($redirect_to, $redirect_time);\n echo ' <div class=\"error\">'.$msg.'</div>';\n page_footer();\n exit;\n}", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }", "private function getErrorPage($url){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n die(strtoupper(\"error 404 $url not found\"));\r\n }", "private function redirect_to_error_page($message = array())\n\t{\n\t\t// redirect to error page\n\t\t\\Session::set_flash('error', $message);\n\t\t\\Response::redirect('admin/error');\n\t}", "function errorPage($msg) {\n header(\"Status: 404 Not Found\");\n die('404: ' . $msg);\n}", "public function errorAction()\n {\n // get the view vars\n $site = $this->view->site;\n $errors = $this->view->errors;\n $loginUser = $this->view->loginUser;\n\n // set the input params\n $optionalParams = array(\n 'errorCode',\n );\n\n $input = $this->processInput( null, $optionalParams, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n if ( !$this->view->ajax ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n return $this->renderPage( 'authError' );\n }", "function errorHandler($message, $code){\n echo '{\"errors\":\"'.$message.'\"}';\n http_response_code($code);\n return false;\n }", "function throw_user_error($error_code, $error_text) {\n http_response_code($error_code);\n echo $error_text;\n exit;\n}", "function error( $error, $code = '500' ) {\n\t \n\t if ( is_object( $error ) && method_exists( $error, 'get_message' ) ) {\n\t $error = $error->get_message();\n\t }\n\t\n\t\thttp_response_code( $code );\n\t\tdie( $error );\n\t\treturn false;\n\n\t}", "public static function errorCode($code)\n {\n http_response_code($code);\n $path = 'application/views/errors/' . $code . '.php';\n if (file_exists($path)) {\n require $path;\n }\n exit;\n }", "public function showErrorPage(int $code = self::ERROR_CODE_500_INTERNAL_ERROR)\n {\n http_response_code($code);\n $message = array_key_exists($code, self::ERROR_CODE_MESSAGES) ? self::ERROR_CODE_MESSAGES[$code] : '';\n\n $template = $this->getErrorTemplate($code);\n if ($template) {\n $latte = $this->createLatteEngine();\n $latte->render($template, [ 'code' => $code, 'message' => $message ]);\n } else {\n header('Content-Type: text/plain');\n echo \"HTTP Response: $code $message\";\n }\n exit;\n }", "public function errorPage($title, $code)\n {\n $layout = View::make('layouts.article');\n $layout->title = $title;\n $layout->content = View::make('errors.' . $code);\n return Response::make($layout, $code);\n }", "public function index() {\n header('Location: ' . URLROOT . '/errors/page_not_found');\n }", "public function client_error($status_code = 404)\n {\n $data = array('status_code' => $status_code);\n\n view('error/client_error', $data);\n }", "public function actionError() {\n\t if($error=app()->errorHandler->error) {\t\t\n\t \tif(app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse {\n\t\t\t\t$row = Pagecontent::model()->getPageContent('pagenotfound'); // get the page content for the page\n\t\t\t\tif ($row) { // row is found (page has contents) so we are rending the default view\n\t\t\t\t\t$row['html_title'] .= (!empty($row['html_title']) ? ' ' : '') . ' (' . $error['code'] . ')';\n\t\t\t\t\t$this->setPageAttributes($row);\t\t\n\t\t\t\t\t$this->render('default',array ('row'=>$row));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error); // execute the error view file \t \t\n\t\t\t}\n\t }\n\t}", "function errorPage(string $title, string $message, int $code, string $template = null)\n{\n $data = [];\n // page information\n $data['code'] = $code;\n $data['title'] = $title;\n $data['message'] = $message;\n // the default template\n $render = 'error.twig';\n // template from the env file\n if (Env::has('ERROR_PAGE')) {\n $render = Env::get('ERROR_PAGE');\n }\n // custom template\n if (isset($template)) {\n $render = $template;\n }\n // check if the file exists\n if (!file_exists(VIEWS_DIR . 'renders' . DS . $render)) {\n throw new Exception(\"ERROR PAGE '{$render}' NOT EXISTS \");\n }\n // display the page\n view($render, $data, $code);\n}", "protected static function error($code, $message) {\n\t\theader('Content-Type: text/html', true, $code);\n\t\theader('Content-Length: ' . strlen($message));\n\n\t\techo $message;\n\t}", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "function HTTPFailWithCode($code,$message)\n{\n\theader(reasonForCode($code));\n\texit($message);\n}", "protected function error($action = __MISSING_ACTION__) {\n\t\theader(\"Location: /error.php?Action=\".$action);\t\n\t}", "public function error(array $options = []){\n\n\t\theader('Location: /home/show');\n\t\tdie();\n\n\t}", "public static function error_response() {\r\n header(\"HTTP/1.1 404 Recurso no encontrado\");\r\n exit();\r\n }", "function died($error) \n\t\t{\n\t\t\theader('Location:http://localhost:8888/Port2013/?content=contact');\n\t\t\texit();\n\t\t}", "public function errorAction(Application $app, $code)\n {\n \t\t$applicationrepository = new DatabaseTableRepository('User', ' users');\n\t\t \t$users = $applicationrepository->getAll();\n\n // default - assume a 404 error\n $argsArray = [\n\n \t\t'users' => $users,\n\n ];\n $templateName = 'error404';\n\n\n if (404 != $code){\n $argsArray = [\n 'message' => 'sorry - an unknow error occurred'\n ];\n $templateName = 'error';\n }\n\n return $app['twig']->render($templateName . '.html.twig', $argsArray);\n }", "function error_redirect($message)\n{\n global $_PAGE;\n\n header(\"Location: /post.php?error_message=\". urlencode($message));\n\n $_PAGE['content'] = \"<p>Post failed. You are being redirected.</p>\";\n\n require('template.php');\n die();\n}", "public function errorAction()\n {\n $this->_logger->debug(__('Calling errorAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to error page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_getCheckoutSession()->addError(__('An error occurred during redirecting to error page.'));\n }\n }", "public function errorAction() {\n $errors = $this->_getParam(\"error_handler\");\n \n // assegno i valori alla view\n $this->viewInit();\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n // 404 error -- controller or action not found \n $this->getResponse()->setRawHeader(\"HTTP/1.1 404 Not Found\");\n $this->view->title = \"HTTP/1.1 404 Not Found\";\n break;\n default:\n // application error; display error page, but don't change \n // status code\n $this->view->title = \"Application Error\";\n break;\n }\n $this->view->message = $errors->exception;\n }", "public static function ErrorPage404()\n {\n header('HTTP/1.1 404 Not Found');\n header(\"Status: 404 Not Found\");\n header('Location: '.$_SERVER['HTTP_HOST'].'404');\n }", "public function redirect404(){\n\n\t\t$this->page = new PageGenerator($this->app);\n\t\t$this->page->setContentFile(__DIR__ . '/../Errors/404');\n\t\t\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n\t\t\n\t\t$this->send();\n\t\t\n\t}", "function error404() {\n\t$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n\t$code='404';\n\t$text='Not Found';\n\theader($protocol . ' ' . $code . ' ' . $text);\n\t//header(\"Status: 404 Not Found\");\n\t//http_response_code(404);\n\techo \"<h1>404 Page Does Not Exist</h1>\";\n}", "function died($error) {\n header('location: index.html?status=error');\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n \n \n die();\n \n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has occured and your request could not be completed. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n }", "public static function error404()\r\n\t{\r\n\t\theader(\"HTTP/1.1 404 Not Found\");\r\n\t\theader(\"Status: 404 Not Found\");\r\n\t\texit();\r\n\t}", "public function errorcode();", "public function actionError()\n {\n if(Core::getLoggedUserID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'admin')->send();\n }\n }", "public static function sendError($status_code,$message=null) {\n\t\thttp_response_code($status_code);\n\t\techo $message;\n\t}", "static function error( $code, $desc ) {\n\t\t$codes = array();\n\t\t$codes[400] = 'Bad Request';\n\t\t$codes[401] = 'Unauthorized';\n\t\t$codes[403] = 'Forbidden';\n\t\t$codes[404] = 'Not Found';\n\t\t$codes[405] = 'Method Not Allowed';\n\t\t$codes[406] = 'Not Acceptable';\n\t\t$codes[501] = 'Not Implemented';\n\t\t$codes[503] = 'Service unavailable';\n\t\t\n\t\theader('Content-Type: text/html');\n\t\theader( 'HTTP/1.1 '. $code . ' '. @$codes[$code] );\n\t\tdie( $desc );\n\t}", "public function errorAction()\r\n {\r\n $errors = $this->_getParam('error_handler');\r\n $messages = array();\r\n\r\n switch ((string)$errors->type) {\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\r\n // 404 error -- controller or action not found\r\n $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');\r\n\r\n $messages[] = Zoo::_(\"The page you requested was not found.\");\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $messages[] = $errors->exception->getMessage();\r\n }\r\n break;\r\n\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:\r\n case 0:\r\n // application error\r\n //$messages[] = Zoo::_(\"An unexpected error occurred with your request. Please try again later.\");\r\n $messages[] = $errors->exception->getMessage();\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $trace = $errors->exception->getTrace();\r\n foreach (array_keys($trace) as $i) {\r\n if ($trace[$i]['args']) {\r\n foreach ($trace[$i]['args'] as $index => $arg) {\r\n if (is_object($arg)) {\r\n $trace[$i]['args'][$index] = get_class($arg);\r\n }\r\n elseif (is_array($arg)) {\r\n $trace[$i]['args'][$index] = \"array\";\r\n }\r\n }\r\n }\r\n $trace[$i]['file_short'] = \"..\".substr($trace[$i]['file'], strrpos(str_replace(\"\\\\\", DIRECTORY_SEPARATOR, $trace[$i]['file']), DIRECTORY_SEPARATOR));\r\n }\r\n $this->view->assign('trace', $trace);\r\n }\r\n break;\r\n\r\n default:\r\n // application error\r\n $this->getResponse()->setRawHeader('HTTP/1.1 '.$errors->type);\r\n $messages[] = $errors->exception->getMessage();\r\n break;\r\n }\r\n\r\n // Clear previous content\r\n $this->getResponse()->clearBody();\r\n\r\n $this->view->assign('errormessages', $messages);\r\n }", "public static function sendHttpError($errorCode, $htmlContent='') {\n if ($errorCode == 404) {\n header(\"HTTP/1.0 404 Not Found\");\n echo $htmlContent;\n exit;\n }\n }", "public static function sendHttpError($errorCode, $htmlContent='') {\n // Error 404\n if ($errorCode == 404) {\n // Sending specific error status 404 HTTP\n header(\"HTTP/1.0 404 Not Found\");\n echo $htmlContent;\n exit;\n }\n }", "public function renderPageError($code = null, $message = '') {\n if ($this->isAjax()) {\n $this->jsonResponse($code, $message);\n }\n # return homeurl if app is not inited\n if (Yii::$app->controller === null) {\n $this->redirect(HOST_PUBLIC);\n }\n// $this->layout = \"@app/modules/candidate/views/layouts/main\";\n if (preg_match('/backend/', Yii::getAlias('@app'))) {\n $this->layout = \"@app/views/layouts/main\";\n }\n # set pagetitle\n if ($this->getParam('swtohome')) {\n $this->redirect(Yii::$app->homeUrl);\n app()->end();\n }\n echo parent::render('@common/views/error_handel', array('code' => $code, 'message' => $message));\n app()->end();\n }", "function error($code, $desc) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code);\r\n if(strtoupper($_SERVER['REQUEST_METHOD']) != 'HEAD') {\r\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\r\n echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">'.\"\\n\";\r\n echo '<html xml:lang=\"en\" lang=\"en\">';\r\n echo '<head><title>' . $code . '</title></head><body><h1>' . $code . '</h1><p>' . $desc . '</p></body></html>';\r\n }\r\n exit;\r\n }", "public static function showError($msg)\n {\n// $template->init(\"errorpage\", array(\"errormsg\"=>$msg));\n header('HTTP/1.1 404 Not Found');\n header(\"status: 404 Not Found\");\n include '404.php';die();\n// $template->outPut();\n }", "public function error($status = '') {\n\n switch ($status) {\n case '404':\n return $this->render('views:errors/404.php', ['mp' => $this->mp]);\n break;\n }\n\n }", "function errorPage ($s_template, $s_title, $a_data=array ()) {\n\t//template the error, swapping custom replacement fields\n\tdie (templatePage (\n\t\treMarkable (template_tags (template_load (\"errors/$s_template\"), $a_data)), $s_title,\n\t\ttemplateHeader (),\n\t\ttemplateFooter (\".system/design/templates/errors/\".pathinfo ($s_template, PATHINFO_FILENAME))\n\t));\n}", "function reportError(string $errorMessage, string $path) {\n $_SESSION['errors'] = $errorMessage;\n redirect($path);\n exit;\n}", "protected function failure($error_msg) {\r\n $this->dest_page = 'login';\r\n \r\n /*\r\n * If the $_POST['dest'] was set, pass it back to the form as a $_GET\r\n * parameter\r\n */\r\n $dest_param = $this->request->request->get(\"dest\", null);\r\n if (!is_null($dest_param)) {\r\n $this->dest_params = \"?dest\" . \\urlencode($dest_param);\r\n }\r\n \r\n /*\r\n * Set the error message for the form\r\n */\r\n $this->session->set('login_err', $error_msg);\r\n\r\n /*\r\n * Redirect to $this->dest_code\r\n */\r\n $this->redirect();\r\n \r\n \r\n }", "private function _dispatchError ($errorCode)\r\n {\r\n echo str_replace('{$mesaj}', self::$_mesaje[$errorCode], file_get_contents(\"_accesBlocat.html\"));\r\n exit();\r\n }", "public function error404()\n {\n $this->whenError();\n $viewData['status'] = 404;\n $viewData['title'] = 'Not Found';\n $viewData['msg'] = 'Sorry but the page you are looking for does not exist, have been removed.';\n\n $this->pageError($viewData);\n }", "function error($code_or_codes, $callback = NULL)\n{\n\n}", "function error_404() {\n\t\theader($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n\t\texit();\n\t}", "function ErrorRedir($errorString, $url) {\n global $ErrorCode, $HTTP_REFERER, $HTTP_HOST;\n\n $ErrorCode = $errorString;\n \n if (false == $_SESSION['ErrorCode'] = $ErrorCode) {\n echo \"Could not register ErrorCode: $ErrorCode\";\n exit;\n }\n if (FALSE == headers_sent()) {\n /* Redirect browser to PHP web site */\n header(\"Location: $url\"); \n exit; \n } else {\n $errorString = \"HTTP Error headers already sent from $HTTP_REFERER on $HTTP_HOST\".$errorString;\n @mail($adminEmailAddr, \"$PredictionLeagueTitle Error\",$errorString,\"From: $adminEmailAddr\");\n }\n}", "private function _error() {\n\t\trequire $this->_controllerPath . $this->_errorFile;\n\t\t$this->_controller = new Error();\n\t\t$this->_controller->index('Esta página no existe');\n\t\texit;\n\t}", "function setErrcode($errcode, $scriptname, $dienow=false) {\n\tglobal $siteaddr;\n\t$_SESSION['errcode']=$errcode;\n\theader(\"Location: \" . $siteaddr . \"/\" . $scriptname . \".php\");\n\tif ($dienow==true) {\n if (isset($link)) {\n mysql_close($link);\n }\n\t\tdie();\n\t}\n}", "public function error() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '../PHPIncludes/pageLinkScriptsCSS.php');\n\n $pageRequirements = new pageLinkScriptsCSS();\n\n $pageRequirements->add(\"css\", ['error.css']);\n\n $pageRequirements->add(\"title\", 'The Sky Is Falling');\n\n callStructural('header','std',$pageRequirements);\n\n require_once('views/pages/error.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'std', $pageRequirements); \n\n }", "function render_error($message = 'error by unknown reason', $map = null) {\n\trender_page(\"error\", $message, $map);\n}", "public function error(int $type)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase 404:\n\t\t\t\theader(\"HTTP/2 404 Not Found\");\n\t\t\t\t$this->render($this->vars['404']);\n\t\t\tbreak;\n\n\t\t\tcase 401:\n\t\t\t\theader(\"HTTP/2 401 Unauthorized\");\n\t\t\t\t$this->render($this->vars['401']);\n\t\t\tbreak;\n\n\t\t\tcase 403:\n\t\t\t\theader(\"HTTP/2 401 Forbidden\");\n\t\t\t\t$this->render($this->vars['403']);\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "public function error() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '../PHPIncludes/pageLinkScriptsCSS.php');\n\n $pageRequirements = new pageLinkScriptsCSS();\n\n $pageRequirements->add(\"css\", ['error.css']);\n\n $pageRequirements->add(\"title\", 'The Sky Is falling');\n\n callStructural('header','std',$pageRequirements);\n\n require_once('views/pages/error.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'std', $pageRequirements); \n\n\n }", "public function error404() {\n\t\t$this->render('error400');\n\t}", "public function renderErrorNotAdmin(): void\n {\n header('HTTP/1.1 301 Not Found');\n header('Location: /error/notAdmin');\n die();\n }", "protected function RenderError() {\n echo view('errors/404');\n exit;\n }", "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\n }", "function error_404() {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n exit(); //don't do any additional php, we are done\n }", "private function loadErrorPage()\n {\n // If there is no error page path or the file doesnt exist, output a message\n if ( ( ! $this->errorPagePath ) || ( ! file_exists($this->errorPagePath) ) )\n {\n // Output a general error message\n $error500Html = '';\n $error500Html .= $this->publicErrorMessage . '<br/><br/>';\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Error ID:</span> ' . $this->errid . '<br/><br/>';\n\n // If debug mode is enabled, output the error\n if ( $this->debugMode )\n {\n $error500Html .= $this->getErrorString(true, false, true, false, false);\n }\n\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Referrer:</span> <a href=\"' . $this->referer . '\">' . $this->referer . '</a>';\n\n // If email failed to send, append to error message\n if ( ( $this->debugMode ) and isset($this->failedToEmailMsg) ) $error500Html .= '<br/><br/><span style=\"' . $this->failedToEmailMsgStyle . '\">** Failed to send email to administrators: ' . $this->failedToEmailMsg . '</span>';\n\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n echo $error500Html;\n }\n }\n /* If there is an error page path and it exists, include it\n * The file itself has access to the error string, it will\n * output it if debug mode is enabled.\n * Custom error files can be used by definining the config ERROR_PAGE_PATH */\n else\n {\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n // start output buffering\n ob_start();\n include ( $this->errorPagePath );\n $error500Html = ob_get_clean(); // send generated error page into variable!\n\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n include ( $this->errorPagePath );\n }\n }\n\n // exit the application after printing the error page\n exit();\n }", "public function redirectToHome(array $errors = []);", "public function actionError()\n {\n if(Core::getLoggedDeliveryBoyID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'delivery')->send();\n }\n }", "public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }", "function display_error_page($message)\r\n {\r\n $this->display_header();\r\n $this->display_error_message($message);\r\n $this->display_footer();\r\n }", "public function error()\n {\n require_once('views/pages/error.php');\n }", "public function sh404sefErrorPage(& $error)\n\t{\n\t\t// only handle 404 errors, defer to previous handler otherwise\n\t\t$code = $error->getCode();\n\t\tif (404 != $code && !empty($this->joomlaErrorHandler) && ($this->joomlaErrorHandler['mode'] != 'callback' || !is_callable($this->joomlaErrorHandler['options'])))\n\t\t{\n\t\t\tJError::customErrorPage($error);\n\t\t\treturn;\n\t\t}\n\n\t\tif (404 != $code && !empty($this->joomlaErrorHandler) && $this->joomlaErrorHandler['mode'] == 'callback' && is_callable($this->joomlaErrorHandler['options']))\n\t\t{\n\t\t\tcall_user_func_array($this->joomlaErrorHandler['options'], array(&$error));\n\t\t\treturn;\n\t\t}\n\n\t\t$setting = Sh404sefFactory::getConfig()->notFoundErrorHandling;\n\t\tif (Sh404sefHelperGeneral::ERROR_404_HANDLE == $setting)\n\t\t{\n\t\t\t// if we should only handle URL parsing errors\n\t\t\t// adjust switch value according to current situation\n\t\t\tif (self::$requestParsed)\n\t\t\t{\n\t\t\t\t// Joomla error, use Joomla handling\n\t\t\t\t$setting = Sh404sefHelperGeneral::ERROR_404_USE_JOOMLA;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// URL parsing error, use sh404SEF handling\n\t\t\t\t$setting = Sh404sefHelperGeneral::ERROR_404_OVERRIDE_JOOMLA;\n\t\t\t}\n\t\t}\n\n\t\t// request is considered parsed now\n\t\tself::$requestParsed = true;\n\n\t\tswitch ($setting)\n\t\t{\n\t\t\tcase Sh404sefHelperGeneral::ERROR_404_USE_JOOMLA:\n\t\t\t\t$this->_store404Page();\n\n\t\t\t\t$configItemid = Sh404sefFactory::getConfig()->shPageNotFoundItemid;\n\t\t\t\tif (!empty($configItemid))\n\t\t\t\t{\n\t\t\t\t\tSh404sefHelperError::setItemid($configItemid);\n\t\t\t\t}\n\n\t\t\t\t// we forward the error to the original Joomla handler\n\t\t\t\tif (!empty($this->joomlaErrorHandler) && $this->joomlaErrorHandler['mode'] == 'callback' && is_callable($this->joomlaErrorHandler['options']))\n\t\t\t\t{\n\t\t\t\t\tcall_user_func_array($this->joomlaErrorHandler['options'], array(&$error));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// This is required to prevent a very unhelpful white-screen-of-death\n\t\t\t\t\tjexit('<strong>An error just happened: </strong>' . $error->getMessage() . '<br /><small>and there was another one displaying this message (invalid error handler).</small>');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Sh404sefHelperGeneral::ERROR_404_OVERRIDE_JOOMLA:\n\t\t\t\t// we use our own handling\n\t\t\t\t$this->_store404Page();\n\t\t\t\tSh404sefHelperError::render404ErrorDocument($error);\n\t\t\t\texit();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function error404()\n\t{\n\t\t//envoie une entête 404 (pour notifier les clients que ça a foiré)\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tView::show(\"errors/404.php\", \"Oups ! Perdu ?\");\n\t}", "function error_handler($exception) {\n\tglobal $config;\n\theader('HTTP/1.0 404 Not Found');\n\textract(array('error'=>$exception->getMessage()));\n\trequire($config['VIEW_PATH'].'404.php');\n\tdie();\n}", "public function error() \n\t{\n\t\trequire $this->view('error', 'error');\n\t\texit;\n\t}", "public function indexErrorLogin()\r\n {\r\n\t$vars['error'] = 1;\r\n\t\t\r\n $this->view->show(\"home.php\", $vars);\r\n }", "public function errorAction()\r\n {\r\n $this->_helper->layout->setLayout('bzerror');\r\n $this->_helper->redirector('index','bzerror');\r\n //$this->_helper->layout->setLayout('bzerror');\r\n }", "static public function errorCode($code)\n {\n http_response_code($code);\n\n $filename = APP . '/views/errors/' . $code . '.php';\n\n if (file_exists($filename)) require $filename;\n else if (IS_DEV) throw new \\Exception('file [$filename] is not found!');\n\n exit;\n }", "public function redirect(string $url, int $code = Response::HTTP_FOUND): void\n {\n throw new RedirectException('Redirect', new RedirectResponse($url, $code));\n }", "function sysError404(){\n\tsysError( \"Please check the address and try again.\", \"The page you requested was not found.\", \"Page Not Found\" );\t\n\texit();\n}", "public function error404(){\n\t\t$this->loadErrorView('Cette page n\\'existe pas', 'Error 404', 404); \n\t}", "public static function sendErrorResponse($error = null){\n http_response_code(500);\n echo $error;\n die();\n }", "function show_404($page = '', $log_error = TRUE)\n\t{\n\t\t// Load Router and Core classes.\n \t$RTR =& load_class('Router', 'core');\n\n \t// Redirect to not found\n \theader(\"Location: \" . $RTR->config->config['base_url'] . 'app_access/not_found');\n \texit;\n }", "public function forbiddenError() {\n sfContext::getInstance()->getController()->redirect('errores/forbidden');\n\t}", "public function redirect404()\n\t{\n\t\t$this->page = new Page($this->app);\n\t\t$this->page->setView('404.php');\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n \t$this->send();\n\t}", "function fatalErrorHandler() {\n global $cfg;\n $error = error_get_last();\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n header(\"HTTP/1.1 500 Server Error\");\n readfile($cfg['source_root'] . \"/500.html\");\n //error_log(print_r($error, true));\n //error_log(print_r(debug_backtrace(), true));\n exit();\n }\n/*\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n $_SESSION['error'] = $error;\n header(\"Location:\".$cfg['root'].\"exception/\");\n exit;\n }\n*/\n}", "public function error($code = 500)\n {\n $view = view('errors/'.$code);\n\n return $this->respond($view, $code);\n }", "function error($msg)\n{\n header('HTTP/1.1 500 ' . $msg);\n die($msg);\n}" ]
[ "0.7973909", "0.7315906", "0.7278016", "0.72668135", "0.72423583", "0.7224111", "0.7188935", "0.7155267", "0.71461207", "0.7076318", "0.7050263", "0.7047342", "0.7018382", "0.7002094", "0.69734836", "0.69505495", "0.69312435", "0.6897051", "0.6889859", "0.6879199", "0.68744123", "0.68536395", "0.6828539", "0.6803735", "0.68035513", "0.67921466", "0.67874116", "0.67842835", "0.6779645", "0.67794275", "0.67430913", "0.67355865", "0.6727915", "0.67200625", "0.6713566", "0.6701676", "0.6699519", "0.66965604", "0.6695569", "0.6681611", "0.6677501", "0.6656709", "0.66316235", "0.6623281", "0.66187614", "0.65894544", "0.65852153", "0.6565522", "0.6557357", "0.6544151", "0.65395993", "0.653685", "0.65331453", "0.6528754", "0.6524797", "0.6520338", "0.6516677", "0.6510077", "0.6510073", "0.6505636", "0.6501046", "0.64952916", "0.64867455", "0.64800256", "0.64796966", "0.6472899", "0.64709634", "0.6469577", "0.64637685", "0.64559036", "0.6432146", "0.64183027", "0.6408569", "0.6408508", "0.6403601", "0.6397664", "0.6393813", "0.63923836", "0.63899136", "0.6385861", "0.637542", "0.6371222", "0.63711506", "0.6364107", "0.6360235", "0.63592046", "0.6357249", "0.63520896", "0.6338019", "0.6333977", "0.6329163", "0.6322011", "0.63211346", "0.6289726", "0.628255", "0.6281723", "0.627086", "0.6259406", "0.6257947", "0.6249424" ]
0.7574105
1
Checks if the given path is a file, and if it's extension is a known imageextension
Проверяет, является ли заданный путь файлом, и если его расширение является известным расширением изображения
function isImage($path) { global $CONFIG; return (is_file($path) && in_array(strtolower(pathinfo($path, PATHINFO_EXTENSION)), $CONFIG->extensions->images)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}", "function isPhoto($path) \n {\n $exploded = explode('.', $path);\n $ext = strtolower(end($exploded));\n // Define the photos extensions\n $photoExtensions = ['png', 'jpg', 'jpeg', 'gif', 'jfif', 'tif', 'webp'];\n // Check if this extension belongs to the extensions we defined\n if (in_array($ext, $photoExtensions)) {\n return true;\n }\n return false;\n }", "function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}", "public function checkIsFile($path);", "function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }", "function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "private function hasJPGExtension(string $path): bool\n {\n $extensionIndex = strrpos($path, '.');\n if (false === $extensionIndex) {\n return false;\n }\n $extension = strtolower(substr($path, $extensionIndex));\n return '.jpg' === $extension || '.jpeg' === $extension;\n }", "function file_is_valid_image($path)\n {\n }", "function isFile($path);", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "function CheckImageExtension($filename)\n{\n\tif(strlen($filename)<4)\n\t\treturn false;\n\t$ext=strtoupper(substr($filename,strlen($filename)-4));\n\tif($ext==\".GIF\" || $ext==\".JPG\" || $ext==\"JPEG\" || $ext==\".PNG\" || $ext==\".BMP\")\n\t\treturn $ext;\n\treturn false;\n}", "function isImage(string $filename) : bool {\n return (bool) preg_match(\"/(png|gif|jpg|jpeg)/\", pathinfo($filename, PATHINFO_EXTENSION));\n}", "public function isFile(string $path): bool;", "public function isFile(string $path): bool;", "function is_valid_image_extension ($ext) {\n switch ($ext = strtolower($ext)) {\n //Pictures\n case 'jpg':\n case 'gif':\n case 'png':\n case 'bmp':\n case 'xbm':\n return true;\n\n //Denied extension\n default:\n return false;\n }\n }", "function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isImage($path)\n {\n return is_array(getimagesize($path));\n }", "function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}", "function checkType($type){\n\n $allowed = array('jpg', 'jpeg', 'png');\n $fileExt = explode('/', $type);\n $fileExt = strtolower(end($fileExt));\n return in_array($fileExt, $allowed) ? true : false ;\n\n }", "function isImage( $url ){\r\n $pos = strrpos( $url, \".\");\r\n if ($pos === false)\r\n return false;\r\n $ext = strtolower(trim(substr( $url, $pos)));\r\n $imgExts = array(\".gif\", \".jpg\", \".jpeg\", \".png\", \".tiff\", \".tif\"); // this is far from complete but that's always going to be the case...\r\n if ( in_array($ext, $imgExts) )\r\n return true;\r\nreturn false;\r\n}", "public function isFile(): bool {\n\t\t$isFile = (bool) pathinfo($this->getPath(), PATHINFO_EXTENSION);\n\t\t$originalUriHasSlash = substr($this->originalUri, - 1) === '/';\n\n\t\treturn $isFile && ! $originalUriHasSlash;\n\t}", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "public function isImage($ext=null){\n global $VALID_IMAGES;\n if (!$ext)\n $ext = $this->ext; \n return (in_Array( $ext, $VALID_IMAGES )); \n }", "public static function hasExtension($path)\r\n\t{\r\n\t\t$file=self::getFilename($path);\r\n\t\t$posDot=strrpos($file, \".\");\r\n\t\tif ($posDot===false) return false;\r\n\t\telse return true;\r\n\t}", "public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }", "function is_image($file)\n{\n $type = get_image_type($file);\n $mime = get_image_mime_type($type);\n\n return substr($mime, 0, 5) == 'image';\n}", "function isFileType($files) {\n $allowedExts = array(\"jpg\", \"jpeg\", \"gif\", \"png\", \"doc\", \"docx\", \"txt\", \"rtf\", \"pdf\", \"xls\", \"xlsx\", \"ppt\", \"pptx\");\n $temp = explode(\".\", $files);\n $extension = end($temp);\n if (in_array($extension, $allowedExts))\n return true;\n else\n return false;\n}", "public static function isHaveExtension($path)\n {\n if (!is_string($path)) {\n return false;\n }\n $parts = pathinfo($path);\n return array_key_exists('extension', $parts);\n }", "public function isFile();", "protected function is_valid_image_file($file_path) {\n \treturn false;\n }", "public function typeOfFile($path);", "public function testIsImageFile()\n {\n $this->assertTrue(Tinebase_ImageHelper::isImageFile($this->_testImagePath));\n $this->assertFalse(Tinebase_ImageHelper::isImageFile(__FILE__));\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "function extension($ext){\r\n\t\tif ($ext == \"jpg\" || $ext == \"jpeg\" || $ext == \"png\") {\r\n\t\t\t$ret = 1;\r\n\t\t} else{\r\n\t\t\t$ret = 0;\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function getExistsImageExt($pic){\n\n $exts = array('png', 'gif', 'gif', 'jpg', 'jpeg', 'swf', 'psd', 'bmp', 'tif', 'jpc', 'jp2', 'jpx', 'jb2', 'swc', 'iff', 'jpg', 'wbmp', 'xbm');\n\n foreach ($exts as $ext){\n if (file_exists($pic.\".\".$ext))\n return \".\".$ext;\n }\n\n return false;\n\n }", "function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function file_is_an_image($temporary_path, $new_path)\n {\n $allowed_mime_types = ['image/gif', 'image/jpeg', 'image/png'];\n $allowed_file_extensions = ['gif', 'jpg', 'jpeg', 'png'];\n\n $actual_file_extension = pathinfo($new_path, PATHINFO_EXTENSION);\n $actual_mime_type = getimagesize($temporary_path)['mime'];\n\n $file_extension_is_valid = in_array($actual_file_extension, $allowed_file_extensions);\n $mime_type_is_valid = in_array($actual_mime_type, $allowed_mime_types);\n\n return $file_extension_is_valid && $mime_type_is_valid;\n }", "private function isImage($url)\n {\n $pos = strrpos($url, '.');\n if ($pos === false) {\n return false;\n }\n\n\n $ext = explode(\"?\",strtolower(trim(substr($url, $pos))))[0];\n\n $imgExts = [\n '.gif',\n '.jpg',\n '.jpeg',\n '.png',\n '.tiff',\n '.tif',\n ];\n\n // this is far from complete but that's always going to be the case...\n if (in_array($ext, $imgExts)) {\n return true;\n }\n\n return false;\n }", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "public function checkCorrectFile( $sName, $is = 'jpg|jpeg|png|gif' ){\n\t\treturn preg_match( '/('.$is.')/i', $this->throwExtOfFile( $sName ) );\n\t}", "public function imageCheck($extension)\n {\n $allowedTypes = [\n 'image/gif',\n 'image/jpg',\n 'image/png',\n 'image/bmp',\n 'image/jpeg',\n 'image/x-icon'\n ];\n\n return in_array($extension, $allowedTypes);\n }", "function file_is_displayable_image($path)\n {\n }", "function GetImageExtension($imagetype){\n if(empty($imagetype)) return false;\n switch($imagetype){\n case 'image/bmp': return '.bmp';\n case 'image/gif': return '.gif';\n case 'image/jpeg': return '.jpg';\n case 'image/png': return '.png';\n default: return false;\n }\n}", "public function assertIsFile($path);", "function is_external_file($file) {\n\n $allowed = array('jpeg', 'png', 'bmp', 'gif', 'pdf', 'jpg', 'doc', 'docx');\n\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n\n if (in_array(strtolower($ext), $allowed)) {\n return true;\n }\n\n return false;\n}", "function GetImageExtension($imagetype){\n \n if(empty($imagetype)) return false;\n \n switch($imagetype){\n case 'image/bmp': return '.bmp';\n case 'image/gif': return '.gif';\n case 'image/jpeg': return '.jpg';\n case 'image/png': return '.png';\n default: return false;\n }\n }", "public function isFilename( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^[\\w,\\s-]+\\.[A-Za-z]{3,4}$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "function GetImageExtension($imagetype){\n if(empty($imagetype)) return false;\n switch($imagetype){\n case 'image/bmp':return '.bmp';\n case 'image/gif':return '.gif';\n case 'image/jpeg':return '.jpg';\n case 'image/png':return '.png';\n default: return false;\n }}", "function get_file_extension($file_path)\n {\n if (!@is_file($file_path))\n return NULL;\n return substr($file_path, -3);\n }", "function is_imagen($arch)\r\n{$i=strlen($arch)-1;\r\n $extensiones_aceptadas=array(\"gif\",\"jpg\",\"jpeg\",\"bmp\");\r\n $extension=\"\";\r\n while(($i>=0)&&($arch[$i]!='.'))\r\n {$extension=$arch[$i].$extension;\r\n $i--;\r\n }\r\n if ($i<0) return false;\r\n else {if(in_array($extension,$extensiones_aceptadas)){return true;}\r\n else {return false;};\r\n }\r\n}", "function getFileType ( $ext ) {\n\t\t\tforeach ( self::$TYPES_TO_EXTENSIONS as $type => $extensions ) {\n\t\t\t\tif ( in_array( $ext, $extensions ) ) {\n\t\t\t\t\treturn $type;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t\t\n\t\t}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }", "public static function guess($filePath)\n {\n if (!@file_exists($filePath)) {\n return false;\n }\n /*\n Not using pathinfo, as it is locale aware, and I'm not sure if that could lead to problems\n\n if (!function_exists('pathinfo')) {\n // This is really a just in case! - We do not expect this to happen.\n // - in fact we have a test case asserting that this does not happen.\n return null;\n //\n $fileExtension = pathinfo($filePath, PATHINFO_EXTENSION);\n $fileExtension = strtolower($fileExtension);\n }*/\n\n $result = preg_match('#\\\\.([^.]*)$#', $filePath, $matches);\n if ($result !== 1) {\n return null;\n }\n $fileExtension = $matches[1];\n\n // Trivial image mime types\n if (in_array($fileExtension, ['bmp', 'gif', 'jpeg', 'png', 'tiff', 'webp'])) {\n return 'image/' . $fileExtension;\n }\n\n // Common extensions that are definitely not images\n if (in_array($fileExtension, ['txt', 'doc', 'zip', 'gz', 'exe'])) {\n return false;\n }\n\n // Non-trivial image mime types\n switch ($fileExtension) {\n case 'ico':\n return 'image/vnd.microsoft.icon'; // or perhaps 'x-icon' ?\n\n case 'jpg':\n return 'image/jpeg';\n\n case 'svg':\n return 'image/svg+xml';\n\n case 'tif':\n return 'image/tiff';\n }\n\n // We do not know this extension, return null\n return null;\n }", "public function imageCheck($extension)\n {\n $allowedTypes = $this->imageTypes;\n return in_array($extension, $allowedTypes);\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function verify($path) {\n\t\t$full_path = realpath($path);\n\t\t$data = @getimagesize($full_path);\n\t\tif (!$data) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" cannot be read.', $path), 1);\n\t\t}\n\t\tif ($data[2] != IMG_JPG) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" is not a JPG.', $path), 240);\n\t\t}\n\t\tif ($data[0] < 600 || $data[1] < 600) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" is too small.', $path), 241);\n\t\t}\n\t\treturn $full_path;\n\t}", "public static function guess_fileextension( $filename = null, $filecontent = null ) {\r\n\t\t\tif ( $filename ) {\r\n\t\t\t\t$filecontent = $this->getFileContents( $filename );\r\n\t\t\t\tif ( !$filecontent ) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if ( !$filecontent ) {\r\n\t\t\t\tthrow new Exception( 'This function needs atleast one argument!' );\r\n\t\t\t}\r\n\t\t\t$signature = self::getFileSignature( $filecontent );\r\n\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\tcase 'FF': { return ( self::is_jpg( null, $signature ) ) ? 'jpg' : (( self::is_mp3( null, $signature ) ) ? 'mp3' : false ); } break;\r\n\t\t\t\tcase '47': { return ( self::is_gif( null, $signature ) ) ? 'gif' : false; } break;\r\n\t\t\t\tcase '89': { return ( self::is_png( null, $signature ) ) ? 'png' : false; } break;\r\n\t\t\t\tcase '42': { return ( self::is_bmp( null, $signature ) ) ? 'bmp' : false; } break;\r\n\t\t\t\tcase '52': { return ( self::is_webp( null, $signature ) ) ? 'webp' : (( self::is_rar( null, $signature ) ) ? 'rar' : false ); } break;\r\n\t\t\t\tcase '1F': { return ( self::is_gzip( null, $signature ) ) ? 'gz' : false; } break;\r\n\t\t\t\tcase '37': { return ( self::is_7zip( null, $signature ) ) ? '7z' : false; } break;\r\n\t\t\t\tcase '4D': { return ( self::is_exe( null, $signature ) ) ? 'exe' : (( self::is_tiff( null, $signature ) ) ? 'tiff' : false ); } break;\r\n\t\t\t\tcase '49': { return ( self::is_tif( null, $signature ) ) ? 'tif' : (( self::is_mp3( null, $signature ) ) ? 'mp3' : false ); } break;\r\n\t\t\t\tcase '25': { return ( self::is_pdf( null, $signature ) ) ? 'pdf' : false; } break;\r\n\t\t\t\tcase '30': { return ( self::is_wmv( null, $signature ) ) ? 'wmv' : false; } break;\r\n\t\t\t\tcase '75': { return ( self::is_tar( null, $signature ) ) ? 'tar' : false; } break;\r\n\t\t\t\tcase '3C': { return ( self::is_xml( null, $signature ) ) ? 'xml' : false; } break;\r\n\t\t\t\tdefault: {\r\n\t\t\t\t\t$signature = self::getFileSignature( $filecontent, 4 );\r\n\t\t\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\t\t\tcase '66': { return ( self::is_mp4( null, $signature ) ) ? 'mp4' : false; } break;\r\n\t\t\t\t\t\tcase '1A': { return ( self::is_webm( null, $signature ) ) ? 'webm' : false; } break;\r\n\t\t\t\t\t\tdefault: {\r\n\t\t\t\t\t\t\t$signature = self::getFileSignature( $filecontent, 8 );\r\n\t\t\t\t\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\t\t\t\t\tcase '57': { return ( self::is_wav( null, $signature ) ) ? 'wav' : false; } break;\r\n\t\t\t\t\t\t\t\tcase '41': { return ( self::is_avi( null, $signature ) ) ? 'avi' : false; } break;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}", "function image_exist($file, $path=\"\") {\n\tif ($file)\n\t{\n\t\t$checkfile=($path)?$path . \"/\" . $file:$file;\n\t\tif (file_exists($checkfile)) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\t}", "protected function isFile() {}", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "function get_mime_type($path)\n{\n\t$file = trim(basename($path));\n\t//get extension\n\tif($pos=strpos($file, '.')) {\n\t\t$ext = trim(substr($file,$pos),'.');\n\t} else {\n\t\t//either no '.'' or at pos 0, no extention\n\t\treturn false;\n\t}\n\t//check system mime file for ours\n\t$mime = false;\n\tif($sys_mime = fopen('/etc/mime.types','r')) {\n\t\twhile(!$mime && ($line=fgets($sys_mime)) !== false) {\n\t\t\t$line = trim($line);\n\t\t\tif($line && $line[0]!=='#') {\n\t\t\t\t$parts = preg_split('/\\s+/', $line);\n\t\t\t\tif(count($parts) !== 1) {\n\t\t\t\t\tforeach ($parts as $extension) {\n\t\t\t\t\t\tif($extension === $ext) {\n\t\t\t\t\t\t\t$mime = $parts[0];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($sys_mime);\n\t}\n\treturn $mime;\n}", "function cmfcFile_getFileExtension($path) {\n\t\t$path_parts = pathinfo($path);\n\t//\techo $path_parts['dirname'], \"\\n\";\n\t//\techo $path_parts['basename'], \"\\n\";\n\t\treturn strtolower($path_parts['extension']);\n\t}", "public static function isFile($path)\n {\n if (is_file($path)) {\n if (strstr(PHP_OS, 'WIN')) {\n if (basename(realpath($path)) != basename($path)) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "function isImage($filename) {\n \tglobal $synAbsolutePath;\n if (file_exists($synAbsolutePath.$filename)) {\n if (getimagesize($synAbsolutePath.$filename)!==false) $ret=true;\n else $ret=false;\n } else $ret=false;\n return $ret;\n }", "public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function is_file($file);", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function _is_it_ico($file)\r\n{\r\n $ext = substr($file, -4);\r\n if ($ext === '.ico') {\r\n return true;\r\n }\r\n return false;\r\n}", "private function getImageExtension ($type)\n\t{\n\t\tswitch($type) {\n\t\t\tcase 'image/gif':\n\t\t\treturn '.gif';\n\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\treturn '.jpg';\n\n\t\t\tcase 'image/png':\n\t\t\treturn '.png';\n\n\t\t\tdefault:\n\t\t\tthrow new Exception('File type is not recognized! Check the image to make sure it\\'s jpg, png, or gif.');\n\t\t}\n\t}", "private function is_image( $extension = null, $mime_type = null )\n\t{\n\t\tif ( ! is_null($extension) ) {\n\t\t\t$image_extensions = array(\n\t\t\t\t'jpg',\n\t\t\t\t'jpeg',\n\t\t\t\t'gif',\n\t\t\t\t'png',\n\t\t\t\t'bmp',\n\t\t\t);\n\n\t\t\treturn in_array(strtolower($extension), $image_extensions) ? 'true' : 'false';\n\t\t} else if ( ! is_null($mime_type) ) {\n\t\t\t$mime_type_parts = explode('/', $body['ContentType']);\n\t\t\treturn ( strtolower(reset($mime_type_parts)) === 'image' ) ? 'true' : 'false';\n\t\t}\n\n\t\treturn false;\n\t}", "function getextension($path)\n{\n\t$extension = null;\n if (preg_match('/\\.([a-z0-9]+)$/', $path, $found)){\n\t\t$extension = $found[1];\n\t}\n\treturn $extension;\n}", "public function mimeType(string $path): bool|string\n {\n return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);\n }", "public function isFile() : bool;", "public function check($path)\n {\n $extension = File::extension($path);\n\n if (! in_array($extension, $this->extensions)) {\n throw new InvalidFileTypeException(\n sprintf('%s is an invalid file type for the %s class', $extension, get_class($this)));\n }\n\n return true;\n }", "function getextension($path){\n return strtolower(pathinfo($path, PATHINFO_EXTENSION)); // extension only, no period\n}", "public function extension($filePath);", "public function isFile(): bool;", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "function checkimagetype($imagetype){\n\n\t\t$filetype = array(\n\t\t 'image/bmp', \n\t\t 'image/gif', \n\t\t 'image/icon', \n\t\t 'image/jpeg',\n\t\t 'image/jpg', \n\t\t 'image/png', \n\t\t 'image/tiff', \n\t\t );\n if( in_array($imagetype,$filetype))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn 0;\n\n}", "function getExtension($imagem)\n {\n // isso para obter o mime-type da imagem.\n $mime= getimagesize($imagem);\n\n if ($mime[2] == 1)\n {\n $ext= \"gif\";\n return $ext;\n }\n\t\telseif ($mime[2] == 2)\n {\n $ext= \"jpg\";\n return $ext;\n }\n elseif ($mime[2] == 3)\n {\n $ext= \"png\";\n return $ext;\n }\n\t\telseif ($mime[2] == 4)\n {\n $ext= \"bmp\";\n return $ext;\n }\n else\n return false;\n }", "function getExtension(string $path): string\n{\n return pathinfo($path, PATHINFO_EXTENSION);\n}", "function is_valid_extension ($ext) {\n $ext = strtolower($ext);\n return (is_valid_image_extension($ext) || is_valid_audio_extension($ext)\n || is_valid_video_extension($ext));\n }", "function check_file_existance($path)\n{\n //buld the url\n $image_url=$path;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "public function fileMimeType($path)\n {\n $type = $this->findType(strtolower(pathinfo($path, PATHINFO_EXTENSION)));\n if (!empty($type)) {\n return $type;\n }\n\n return 'unknown/type';\n }", "function isValidImage( $file ) {\n\n\t$form_errors = array();\n\n\t$part = explode( \".\", $file );\n\t$extension = end( $part );\n\n\tswitch( strtolower( $extension ) ) {\n\n\t\tcase 'jpg':\n\t\tcase 'gif':\n\t\tcase 'bmp':\n\t\tcase 'png':\n\n\t\treturn $form_errors;\n\n\t}\n\n\t$form_errors[] = $extension . \"is not valid image extension\";\n\n\treturn $form_errors;\n\n}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isFileImage ($image) \n {\n if (!in_array(mime_content_type($image), ALLOWED_IMAGE_TYPES) ) {\n return false;\n }\n return true;\n }", "static function chkFileExtension($str='') {\n $match= preg_match('/.swf/i', $str);\n if($match>0){\n return \"yes\";\n }else{\n return \"no\";\n }\n }", "public static function extension($_path)\r\n {\r\n return pathinfo($_path, PATHINFO_EXTENSION);\r\n }", "public static function extension($path)\n {\n return pathinfo($path, PATHINFO_EXTENSION);\n }" ]
[ "0.7891073", "0.76301455", "0.757281", "0.74448603", "0.7400308", "0.7331621", "0.72882354", "0.72719467", "0.72670346", "0.72578436", "0.7213137", "0.71207684", "0.7076717", "0.7015753", "0.7009175", "0.7009175", "0.6962504", "0.6929038", "0.69110715", "0.68848616", "0.6869283", "0.68196136", "0.67645097", "0.6692178", "0.6689741", "0.66801304", "0.6674376", "0.6668354", "0.6644376", "0.6643721", "0.6616831", "0.65644217", "0.6557764", "0.6556319", "0.6520797", "0.65200377", "0.6499185", "0.6494714", "0.6487795", "0.6455372", "0.64346063", "0.64289296", "0.6386734", "0.6379179", "0.63692933", "0.6354548", "0.6341097", "0.63321763", "0.6331355", "0.6328998", "0.63236433", "0.631716", "0.6312404", "0.63085896", "0.6293719", "0.6283675", "0.6279663", "0.6278949", "0.62597984", "0.6218626", "0.62074435", "0.6195024", "0.6193122", "0.61637414", "0.6159921", "0.6159043", "0.6153975", "0.61363435", "0.6121748", "0.61188954", "0.6117076", "0.61106807", "0.6110144", "0.61016333", "0.6089353", "0.6086727", "0.608497", "0.6079186", "0.60764647", "0.6072095", "0.6066156", "0.60592854", "0.60583675", "0.6029057", "0.6025261", "0.60241455", "0.60217685", "0.60189396", "0.60159093", "0.6015024", "0.6015024", "0.6015024", "0.60136", "0.6008509", "0.60076314", "0.60056084", "0.59993464", "0.59962267", "0.59935606", "0.5992817" ]
0.78463125
1
runkit_function_redefine('_', '$str', 'return (!empty($str) ? gettext($str) : "";'); Uses the pear Text_Diff library to generate a diff between two files. The only HTMLtags allowed are and , all other will be stripped.
runkit_function_redefine('_', '$str', 'return (!empty($str) ? gettext($str) : "");'); Использует библиотеку pear Text_Diff для генерации разницы между двумя файлами. Разрешены только HTML-теги и , все остальные будут удалены.
function diff($text1, $text2) { __autoload('TextDiff'); include_once 'Text/Diff.php'; include_once 'Text/Diff/Renderer.php'; include_once 'Text/Diff/Renderer/unified.php'; $vtext1 = chunk_split(strip_tags($text1, '<p><div>'), 1, "\n"); $vtext2 = chunk_split(strip_tags($text2, '<p><div>'), 1, "\n"); $vlines1 = str_split($vtext1, 2); $vlines2 = str_split($vtext2, 2); $text1 = str_replace("\n"," \n",$text1); $text2 = str_replace("\n"," \n",$text2); $vlines1 = explode(" ", $text1); $vlines2 = explode(" ", $text2); $diff = new Text_Diff($vlines1, $vlines2); $renderer = new Text_Diff_Renderer_inline(); $html = html_entity_decode($renderer->render($diff)); return preg_replace(array('#(<ins>|<del>)(<[^\>]+>)#i', '#(</[^\>]+>)(</ins>|</del>)#i'), '$2$1', $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function text_diff( $left_string, $right_string, $args = null ) {\n\t\t$defaults = array(\n\t\t\t'title' => '',\n\t\t\t'title_left' => '',\n\t\t\t'title_right' => '',\n\t\t\t'leading_context_lines' => 1,\n\t\t\t'trailing_context_lines' => 1,\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\tif ( ! class_exists( 'WP_Text_Diff_Renderer_Table' ) ) {\n\t\t\trequire ABSPATH . WPINC . '/wp-diff.php';\n\t\t}\n\n\t\t$left_string = normalize_whitespace( $left_string );\n\t\t$right_string = normalize_whitespace( $right_string );\n\n\t\t$left_lines = explode( \"\\n\", $left_string );\n\t\t$right_lines = explode( \"\\n\", $right_string );\n\t\t$text_diff = new \\Text_Diff( $left_lines, $right_lines );\n\n\t\t$renderer = new \\WP_Text_Diff_Renderer_Table( $args );\n\t\t$renderer->_leading_context_lines = $args['leading_context_lines'];\n\t\t$renderer->_trailing_context_lines = $args['trailing_context_lines'];\n\n\t\t$diff = $renderer->render( $text_diff );\n\n\t\tif ( $diff === '' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$r = '';\n\n\t\t$r .= \"<div class='SimpleHistory__diff__contents' tabindex='0'>\";\n\t\t$r .= \"<div class='SimpleHistory__diff__contentsInner'>\";\n\n\t\t$r .= \"<table class='diff SimpleHistory__diff'>\\n\";\n\n\t\tif ( ! empty( $args['show_split_view'] ) ) {\n\t\t\t$r .=\n\t\t\t\"<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />\";\n\t\t} else {\n\t\t\t$r .= \"<col class='content' />\";\n\t\t}\n\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= '<thead>';\n\t\t}\n\t\tif ( $args['title'] ) {\n\t\t\t$r .= \"<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\\n\";\n\t\t}\n\t\tif ( $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"<tr class='diff-sub-title'>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_left]</th>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_right]</th>\\n\";\n\t\t\t$r .= \"</tr>\\n\";\n\t\t}\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"</thead>\\n\";\n\t\t}\n\n\t\t$r .= \"<tbody>\\n$diff</div>\\n</tbody>\\n\";\n\t\t$r .= '</table>';\n\n\t\t$r .= '</div>';\n\t\t$r .= '</div>';\n\n\t\treturn $r;\n\t}", "function action_diff()\n{\n\tglobal $pagestore, $page, $ver1, $ver2, $ParseEngine;\n\n\t$p1 = $pagestore->page($page);\n\t$p1->version = $ver1;\n\t$p2 = $pagestore->page($page);\n\t$p2->version = $ver2;\n\n\t$diff = diff_compute($p1->read(), $p2->read());\n\n\ttemplate_diff(array('page' => $p2->as_array(),\n\t\t\t\t\t\t\t\t\t\t\t'diff_html' => diff_parse($diff),\n\t\t\t\t\t\t\t\t\t\t\t'html' => parseText($p2->text, $ParseEngine, $page),\n\t\t\t\t\t\t\t\t\t\t\t'editable' => $p2->acl_check(),\n\t\t\t\t\t\t\t\t\t\t\t'timestamp' => $p2->time));\n}", "function getRevisiondifference($from_text, $to_text)\n{\n // limit input\n if (!empty($from_text) && is_string($from_text)) {\n $from_text = substr($from_text, 0, 1024 * 100);\n } else {\n return false;\n }\n if (!empty($to_text) && is_string($to_text)) {\n $to_text = substr($to_text, 0, 1024 * 100);\n } else {\n return false;\n }\n $granularity = 2; // 0: Paragraph/lines, 1: Sentence, 2: Word, 3: Character\n $granularityStacks = array(\n FineDiff::$paragraphGranularity,\n FineDiff::$sentenceGranularity,\n FineDiff::$wordGranularity,\n FineDiff::$characterGranularity\n );\n $diff_opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, $granularityStacks[$granularity]);\n $difference = FineDiff::renderDiffToHTMLFromOpcodes($from_text, $diff_opcodes);\n return $difference;\n}", "public static function show_diff() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $file = sanitize_text_field( base64_decode( $_POST['file']) );\r\n \r\n //generate a diff using the built in WordPress code\r\n $args = array(\r\n 'title' => 'Differences',\r\n 'title_left' => 'Old Version',\r\n \t'title_right' => 'New Version'\r\n );\r\n \r\n $contents = file_get_contents($repo_path . \"/\" . $file); //the git library isn't using the WP filesystem API so should we here? should we fullstop?\r\n $contents2 = $git->showFile( $file, 'HEAD@{1}');\r\n \r\n $diff_table = wp_text_diff($contents2, $contents, $args); \r\n echo \"<strong>Diff</strong>\" . $diff_table;\r\n\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "function diff2( $page1, $page2 ) {\n\t\t$page1 = split( \"\\n\", $page1 );\n\t\t$page2 = split( \"\\n\", $page2 );\n\t\t$z = new WikiDiff( $page1, $page2 );\n\t\tif( $z->isEmpty() ) {\n\t\t\t$html = '<hr /><br />['.tra(\"Versions are identical\").']<br /><br />';\n\t\t} else {\n\t\t\t//$fmt = new WikiDiffFormatter;\n\t\t\t$fmt = new WikiUnifiedDiffFormatter;\n\t\t\t$html = $fmt->format( $z, $page1 );\n\t\t}\n\t\treturn $html;\n\t}", "function vB_Text_Diff($data_old, $data_new)\n\t{\n\t\t$this->data_old = preg_split('#(\\r\\n|\\n|\\r)#', $data_old);\n\t\t$this->data_old_len = sizeof($this->data_old);\n\n\t\t$this->data_new = preg_split('#(\\r\\n|\\n|\\r)#', $data_new);\n\t\t$this->data_new_len = sizeof($this->data_new);\n\t}", "function process_nonmatches(&$output, &$text_old, &$text_new)\n\t{\n\t\t$s1 = sizeof($text_old);\n\t\t$s2 = sizeof($text_new);\n\n\t\tif ($s1 > 0 AND $s2 == 0)\n\t\t{\n\t\t\t// lines deleted\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), ''));\n\t\t}\n\t\telse if ($s2 > 0 AND $s1 == 0)\n\t\t{\n\t\t\t// lines added\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry('', implode(\"\\n\", $text_new)));\n\t\t}\n\t\telse if ($s1 > 0 AND $s2 > 0)\n\t\t{\n\t\t\t// substitution\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), implode(\"\\n\", $text_new)));\n\t\t}\n\n\t\t$text_old = array();\n\t\t$text_new = array();\n\t}", "public function getDiffHtml($a, $b)\n\t{\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$a, $matchA);\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$b, $matchB);\n\n\t\t$diffScript = $this->getDiffScript($matchA[2], $matchB[2]);\n\t\tif(count($diffScript) == 0)\n\t\t{\n\t\t\t// no difference found\n\t\t\treturn $a;\n\t\t}\n\n\t\t$positionA = 0;\n\n\t\t$result = '';\n\t\tforeach($diffScript as $diffItem)\n\t\t{\n\t\t\twhile($positionA < $diffItem['startA'])\n\t\t\t{\n\t\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t\t$positionA++;\n\t\t\t}\n\n\t\t\t//deleted items\n\t\t\tif($diffItem['deletedA'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchA[1][$positionA] . '<s style=\"color:red\">' . $matchA[2][$positionA];\n\t\t\t\tfor($i = 1; $i < $diffItem['deletedA']; $i++)\n\t\t\t\t\t$result .= $matchA[0][$positionA + $i];\n\n\t\t\t\t$result .= '</s>';\n\t\t\t\t$positionA = $positionA + $diffItem['deletedA'];\n\t\t\t}\n\n\t\t\tif($diffItem['insertedB'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchB[1][$diffItem['startB']] . '<b style=\"color:green\">' . $matchB[2][$diffItem['startB']];\n\t\t\t\tfor($i = 1; $i < $diffItem['insertedB']; $i++)\n\t\t\t\t\t$result .= $matchB[0][$diffItem['startB'] + $i];\n\n\t\t\t\t$result .= '</b>';\n\t\t\t}\n\t\t}\n\n\t\twhile($positionA < count($matchA[0]))\n\t\t{\n\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t$positionA++;\n\t\t}\n\n\t\treturn $result;\n\t}", "private function addUnchangedText( $text ) {\n\t\t$collapsedText = $this->getCollapsedText( $text );\n\n\t\tif ( !$collapsedText ) {\n\t\t\treturn $text;\n\t\t}\n\n\t\treturn\n\t\t\t'<div class=\"mw-twocolconflict-diffchange-same-full\">' . $text . '</div>' .\n\t\t\t'<div class=\"mw-twocolconflict-diffchange-same-collapsed\">' . $collapsedText . '</div>';\n\t}", "function skin_diff_export_overview( $content, $missing, $changed, $title, $date ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset={$this->ipsclass->vars['gb_char_set']}\" />\n <title>$title export</title>\n <style type=\"text/css\">\n BODY\n {\n \tfont-family: verdana;\n \tfont-size:11px;\n \tcolor: #000;\n \tbackground-color: #CCC;\n }\n\n del,\n .diffred\n {\n\t background-color: #D7BBC8;\n\t text-decoration:none;\n }\n\n ins,\n .diffgreen\n {\n\t background-color: #BBD0C8;\n\t text-decoration:none;\n }\n\n h1\n {\n \tfont-size: 18px;\n }\n\n h2\n {\n \tfont-size: 18px;\n }\n </style>\n </head>\n<body>\n <div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <h1>$title (экспортировано: $date)</h1>\n <strong>$missing новых шаблонов и $changed измененных</strong>\n </div>\n <br />\n $content\n <br />\n <div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n </div>\n</body>\n<html>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function replaceTargetedStrings($data){\r\n\tglobal $logfile;\r\n\r\n\t//$blort = \"\\nreplaceTargetedStrings( '\" . $data . \"') \\n\";\r\n\r\n\t$data = str_replace(\"\\t\", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\r\n/*\r\n\t\t//MarcEdit will choke on the < and > so we'd just have to replace them again anyway\r\n\t$data = str_replace(\"&lt;\", \"<\", $data);\r\n\t$data = str_replace(\"&gt;\", \">\", $data);\r\n*/\r\n\r\n\t$data = str_replace('\" content=\"', ' = ', $data);\r\n\t/*\r\n\t\t$blort .= \"\\nnow data ='\" . $data . \"'\\t\";\r\n\t\t$junkRep = str_replace(\"&lt;\", \"<\", $data);\r\n\t\t$blort .= \"if we do a replace it looks like '\" . $junkRep . \"'\\n\";\r\n\t\tappendFile($logfile, $blort);\r\n\t*/\r\n\r\n\treturn $data;\r\n}", "private function getMarkedUpDiffText( array $unifiedDiff ) {\n\t\t$lastUser = $this->getArticle()->getPage()->getUserText();\n\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg( 'twoColConflict-diffchange-own-title' )->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['new'] .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg(\n\t\t\t\t\t\t\t\t'twoColConflict-diffchange-foreign-title',\n\t\t\t\t\t\t\t\t$lastUser\n\t\t\t\t\t\t\t)->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['old'] .\n\t\t\t\t\t\t\t'</div>';\n\n\t\t\t\t\t\tif ( !$this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$output .= \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-diffchange-same\">' .\n\t\t\t\t\t\t\t$this->addUnchangedText( $changeSet['copy'] ) .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "function phorum_api_diff_unpatch($text, $diff)\n{\n $text = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $text);\n\n if (!is_array($diff)) {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n } elseif ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach (array_reverse($diff) as $d) {\n $text = phorum_api_diff_unpatch($text, $d);\n }\n return $text;\n}", "private function getUnifiedDiff() {\n\t\t$currentText = $this->toEditText( $this->getCurrentContent() );\n\t\t$yourText = $this->textbox1;\n\n\t\t$currentLines = explode( \"\\n\", $currentText );\n\t\t$yourLines = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $yourText ) );\n\n\t\treturn $this->getLineBasedUnifiedDiff( $currentLines, $yourLines );\n\t}", "function phorum_api_diff_patch($text, $diff)\n{\n if (!is_array($diff))\n {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n } elseif ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach ($diff as $d) {\n $text = phorum_api_diff_patch($text, $d);\n }\n return $text;\n}", "function cp_str_containsHTML($str){\r\n return ($str != str_replace(['>','<'],'',$str));\r\n}", "function prep_diff_text($string, $wrap = true)\n\t{\n\t\tif (trim($string) === '')\n\t\t{\n\t\t\treturn '&nbsp;';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($wrap)\n\t\t\t{\n\t\t\t\t$string = nl2br(htmlspecialchars_uni($string));\n\t\t\t\t$string = preg_replace('#( ){2}#', '&nbsp; ', $string);\n\t\t\t\t$string = str_replace(\"\\t\", '&nbsp; &nbsp; ', $string);\n\t\t\t\treturn \"<code>$string</code>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '<pre style=\"display:inline\">' . \"\\n\" . htmlspecialchars_uni($string) . '</pre>';\n\t\t\t}\n\t\t}\n\t}", "public function diff()\n {\n $type = strtolower($this->getType());\n if (in_array($type, ['jpg', 'gif', 'png', 'exe'])) {\n return false;\n }\n\n if ($this->operation === self::OP_OVERWRITE) {\n return $this->renderDiff(file($this->path), $this->content);\n }\n\n return '';\n }", "function correctHTMLValidationErrors($txt) {\r\n\tif (Settings::get ( \"disable_html_validation\" )) {\r\n\t\treturn $txt;\r\n\t}\r\n\t\r\n\t// Ersetze & durch &amp;\r\n\t$txt = preg_replace ( '/[&](?![A-Za-z]+[;])/', \"&amp;\", $txt );\r\n\t\r\n\t// replaced deprecated HTML-Tags\r\n\t$txt = str_ireplace ( \"<center>\", \"<div style=\\\"text-align:center\\\">\", $txt );\r\n\t$txt = str_ireplace ( \"</center>\", \"</div>\", $txt );\r\n\t$txt = str_ireplace ( \"<strike>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</strike>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<s>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</s>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<tt>\", \"<code>\", $txt );\r\n\t$txt = str_ireplace ( \"</tt>\", \"</code>\", $txt );\r\n\t$txt = str_ireplace ( \"<dir>\", \"<ul>\", $txt );\r\n\t$txt = str_ireplace ( \"</dir>\", \"</ul>\", $txt );\r\n\t$txt = str_ireplace ( \"<acronym>\", \"<abbr>\", $txt );\r\n\t$txt = str_ireplace ( \"</acronym>\", \"</abbr>\", $txt );\r\n\t\r\n\treturn $txt;\r\n}", "function vB_Text_Diff_Entry($data_old, $data_new)\n\t{\n\t\t$this->data_old = $data_old;\n\t\t$this->data_new = $data_new;\n\t}", "function skin_css_view_bit( $diff ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n$diff\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function diff($new,$old)\n\t{\n \t\t/*global $sourceFolder;\n\t\tglobal $uploadFolder;\n\n\n\t\t$uploadDir = $sourceFolder.\"/\".$uploadFolder;\n\n \t\t if (!file_exists($uploadDir.\"/tmp\"))\n\t\t {\n\t\t \tmkdir($uploadDir .\"/tmp\", 0755);\n\n\t\t }\n\t\t// $new=htmlspecialchars($new, ENT_QUOTES);\n\t\t// $old=htmlspecialchars($old, ENT_QUOTES);\n\t\t $fileNew = \"newFile\";\n\t\t $fileOld=\"oldFile\";\n\t\t$fpn = fopen($uploadDir .\"/tmp/\".$fileNew, 'w') or die(\"can't open new file for writing ARTICLE L:105\");\n\t\tfwrite($fpn,$new);\n\t\tfclose($fpn);\n\n\t\t$fpo = fopen($uploadDir .\"/tmp/\".$fileOld, 'w') or die(\"can't open old file for writing ARTICLE L:109\");\n\t\tfwrite($fpo,$old);\n\t\tfclose($fpo);\n\n\t\t$cmd=\"diff \".$uploadDir .\"/tmp/\".$fileNew.' '.$uploadDir .\"/tmp/\".$fileOld.\"\";\n\n\t\t$diff = shell_exec(''.$cmd.'');\n\n\t\t$fpo = fopen($uploadDir .\"/tmp/diffGenerated\", 'w') or die(\"can't open old file for writing ARTICLE L:109\");\n\t\tfwrite($fpo,$diff);\n\t\tfclose($fpo);\n\t\t$diff=addslashes($diff);*/\n\t\treturn $old;\n\t}", "function MY_VERY_OWN_OM_Text($attr, $content = null) {\n\n\t$result = '<div style=\"display: flex; padding: 0px;\"><div class=\"oldEnglish\"><b><font color=\"gray\">ORIGINAL TEXT</font></b></div><div class=\"newEnglish\"><b><font color=\"gray\">MODERN TEXT</font></b></div></div>';\t\n\treturn $result;\n}", "function diff($diff, $mode = 'autodetect')\n {\n }", "function cleanEditorsTranslationJunk( $text ) {\r\r\n\t$matches\t\t\t\t\t=\tnull;\r\r\n\tif ( preg_match( '/^<p>([^<]+)<\\/p>$/i', $text, $matches ) ) {\r\r\n\t\tif ( trim( $matches[1] ) != getLangDefinition( trim( $matches[1] ) ) ) {\r\r\n\t\t\t$text\t\t\t\t=\ttrim( $matches[1] );\r\r\n\t\t}\r\r\n\t}\r\r\n\treturn $text;\r\r\n}", "function html_diff($proj, $commit, $parent, $repos) {\n $repo = get_repo_path($proj, $repos);\n $out = array();\n exec(\"GIT_DIR=$repo/.git git diff $parent $commit\", $out);\n\n echo '<div class=\"gitcode\">';\n echo '<b>diff</b><br>';\n echo highlight_code(implode(\"\\n\", $out));\n echo '</div><br>';\n}", "function parseUnifiedDiff($diff)\n {\n }", "function compareStrings($string1, $string2){\n $newString1 = formatString($string1);\n $newString2 = formatString($string2);\n\n $result = false;\n if(strcmp($newString1, $newString2) == 0){\n $result = true;\n }\n\n ?>\n <section class=\"flex-container row resultStrings\">\n <div class=\"col col-2\">\n <p class=\"finalString1\"><?=$newString1?></p>\n </div>\n <div class=\"col col-2\">\n <p class=\"finalString2\"><?=$newString2?></p>\n </div>\n </section>\n <section class=\"row results\">\n <div class=\"col col-4\">\n <p class=\"result\">\n <?php\n if($result == true){\n ?>\n The above strings are identical to each other\n <?php\n }\n else{\n ?>\n The above strings are not identical to each other\n <?php\n }\n ?>\n </p>\n </div>\n </section>\n\n <?php\n }", "function testBug_rolfhub_2007_02_07_2() \n {\n $sText = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "function skin_diff_overview($content, $missing, $changed) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<script type=\"text/javascript\" src='{$this->ipsclass->skin_acp_url}/acp_template.js'></script>\n<div class='tableborder'>\n <div class='tableheaderalt'>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td align='left' width='95%' style='font-size:12px; vertical-align:middle;font-weight:bold; color:#FFF;'>Сравнение стилей</td>\n <td align='right' width='5%' nowrap='nowrap'>\n &nbsp;\n </td>\n </tr>\n</table>\n </div>\n <table cellpadding='0' cellspacing='0' width='100%'>\n <tr>\n <td class='tablesubheader' width='90%'><strong>Название шаблона</strong></td>\n <td class='tablesubheader' width='5%'>Различия</a>\n <td class='tablesubheader' width='5%'>Размер</a>\n <td class='tablesubheader' width='5%'>&nbsp;</a>\n </tr>\n $content\n </table>\n <div align='right' class='tablefooter'>$missing новых шаблонов и $changed измененных</div>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function _convert()\n {\r\n \t$badStr = $this->html;\n\t //remove PHP if it exists\r\n\t while( substr_count( $badStr, '<'.'?' ) && substr_count( $badStr, '?'.'>' ) && strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) > strpos( $badStr, '<'.'?' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<'.'?' ) ) . substr( $badStr, strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) + 2 ); }\r\n\t //remove comments\r\n\t while( substr_count( $badStr, '<!--' ) && substr_count( $badStr, '-->' ) && strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) > strpos( $badStr, '<!--' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<!--' ) ) . substr( $badStr, strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) + 3 ); }\r\n\t //now make sure all HTML tags are correctly written (> not in between quotes)\r\n\r\n\t \r\n\t //TODO: here is any problem, because in some cases happens loop and mail is never parsed\r\n\t //\t for( $x = 0, $goodStr = '', $is_open_tb = false, $is_open_sq = false, $is_open_dq = false; strlen( $chr = $badStr{$x} ); $x++ ) {\r\n//\t //take each letter in turn and check if that character is permitted there\r\n//\t switch( $chr ) {\r\n//\t case '<':\r\n//\t if( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 5 ) ) == 'style' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</style>', $x ) + 7 ); $chr = '';\r\n//\t } elseif( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 6 ) ) == 'script' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</script>', $x ) + 8 ); $chr = '';\r\n//\t } elseif( !$is_open_tb ) { $is_open_tb = true; } else { $chr = '&lt;'; }\r\n//\t break;\r\n//\t case '>':\r\n//\t if( !$is_open_tb || $is_open_dq || $is_open_sq ) { $chr = '&gt;'; } else { $is_open_tb = false; }\r\n//\t break;\r\n//\t case '\"':\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_dq = true; }\r\n//\t elseif( $is_open_tb && $is_open_dq && !$is_open_sq ) { $is_open_dq = false; }\r\n//\t else { $chr = '&quot;'; }\r\n//\t break;\r\n//\t case \"'\":\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_sq = true; }\r\n//\t elseif( $is_open_tb && !$is_open_dq && $is_open_sq ) { $is_open_sq = false; }\r\n//\t } $goodStr .= $chr;\r\n//\t }\r\n$goodStr = $badStr;\r\n\t \r\n\t //now that the page is valid (I hope) for strip_tags, strip all unwanted tags\r\n\t $goodStr = strip_tags( $goodStr, '<title><hr><h1><h2><h3><h4><h5><h6><div><p><br><pre><sup><ul><ol><dl><dt><table><caption><tr><li><dd><th><td><a><area><img><form><input><textarea><button><select><option>' );\r\n\t //strip extra whitespace except between <pre> and <textarea> tags\r\n\t $badStr = preg_split( \"/<\\/?pre[^>]*>/i\", $goodStr );\r\n\t for( $x = 0; is_string( $badStr[$x] ); $x++ ) {\r\n\t if( $x % 2 ) { $badStr[$x] = '<pre>'.$badStr[$x].'</pre>'; } else {\r\n\t $goodStr = preg_split( \"/<\\/?textarea[^>]*>/i\", $badStr[$x] );\r\n\t for( $z = 0; is_string( $goodStr[$z] ); $z++ ) {\r\n\t if( $z % 2 ) { $goodStr[$z] = '<textarea>'.$goodStr[$z].'</textarea>'; } else {\r\n\t $goodStr[$z] = preg_replace( \"/\\s+/\", ' ', $goodStr[$z] );\r\n\t } }\r\n\t $badStr[$x] = implode('',$goodStr);\r\n\t } }\r\n\t $goodStr = implode('',$badStr);\r\n\r\n\t\t$search = array(\r\n\t\t \"/\\r/\", // Non-legal carriage return\r\n\t\t \"/[\\n\\t]+/\", // Newlines and tabs\r\n\t\t '/<br[^>]*>/i', // <br>\r\n\t\t '/&nbsp;/i',\r\n\t\t '/&quot;/i',\r\n\t\t '/&gt;/i',\r\n\t\t '/&lt;/i',\r\n\t\t '/&amp;/i',\r\n\t\t '/&copy;/i',\r\n\t\t '/&trade;/i',\r\n\t\t '/&#8220;/',\r\n\t\t '/&#8221;/',\r\n\t\t '/&#8211;/',\r\n\t\t '/&#8217;/',\r\n\t\t '/&#38;/',\r\n\t\t '/&#169;/',\r\n\t\t '/&#8482;/',\r\n\t\t '/&#151;/',\r\n\t\t '/&#147;/',\r\n\t\t '/&#148;/',\r\n\t\t '/&#149;/',\r\n\t\t '/&reg;/i',\r\n\t\t '/&bull;/i',\r\n\t\t '/&[&;]+;/i'\r\n\t\t );\r\n\r\n\t\t\t$replace = array(\r\n\t\t '', // Non-legal carriage return\r\n\t\t ' ', // Newlines and tabs\r\n\t\t \"\\n\", // <br>\r\n\t\t ' ',\r\n\t\t '\"',\r\n\t\t '>',\r\n\t\t '<',\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '-',\r\n\t\t \"'\",\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '--',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '*',\r\n\t\t '(R)',\r\n\t\t '*',\r\n\t\t ''\r\n\t\t );\r\n\t \r\n\t \r\n\t $goodStr = preg_replace( $search, $replace, $goodStr );\r\n\t \r\n\t //remove all options from select inputs\r\n\t $goodStr = preg_replace( \"/<option[^>]*>[^<]*/i\", '', $goodStr );\r\n\t //replace all tags with their text equivalents\r\n\t $goodStr = preg_replace( \"/<(\\/title|hr)[^>]*>/i\", \"\\n --------------------\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(h|div|p)[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<sup[^>]*>/i\", '^', $goodStr );\r\n\t $goodStr = preg_replace( \"/<(ul|ol|dl|dt|table|caption|\\/textarea|tr[^>]*>\\s*<(td|th))[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<li[^>]*>/i\", \"\\n· \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<dd[^>]*>/i\", \"\\n\\t\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(th|td)[^>]*>/i\", \"\\t\", $goodStr );\r\n\t $goodStr = preg_replace('/<br[^>]*>/i', \"\\n\", $goodStr);\r\n\t $goodStr = preg_replace( \"/<a[^>]* href=(\\\"((?!\\\"|#|javascript:)[^\\\"#]*)(\\\"|#)|'((?!'|#|javascript:)[^'#]*)('|#)|((?!'|\\\"|>|#|javascript:)[^#\\\"'> ]*))[^>]*>/i\", \"[LINK: $2$4$6] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<img[^>]* alt=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"[IMAGE: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<form[^>]* action=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"\\n[FORM: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(input|textarea|button|select)[^>]*>/i\", \"[INPUT] \", $goodStr );\r\n\t //strip all remaining tags (mostly closing tags)\r\n\t $goodStr = strip_tags( $goodStr );\r\n\t //convert HTML entities\r\n\t $goodStr = strtr( $goodStr, array_flip( get_html_translation_table( HTML_ENTITIES ) ) );\r\n\t preg_replace( \"/&#(\\d+);/me\", \"chr('$1')\", $goodStr );\r\n\t //wordwrap\r\n\t //$goodStr = wordwrap( $goodStr );\r\n\t //make sure there are no more than 3 linebreaks in a row and trim whitespace\r\n\t $this->text = preg_replace( \"/^\\n*|\\n*$/\", '', preg_replace( \"/[ \\t]+(\\n|$)/\", \"$1\", preg_replace( \"/\\n(\\s*\\n){2}/\", \"\\n\\n\\n\", preg_replace( \"/\\r\\n?|\\f/\", \"\\n\", str_replace( chr(160), ' ', $goodStr ) ) ) ) );\r\n }", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function fake_levenshtein($a,$b)\n{\n\t// Some stripping, for performance, and because white space doesn't matter so much in HTML anyway\n\t$a=preg_replace('#\\s#','',$a);\n\t$b=preg_replace('#\\s#','',$b);\n\n\t$a_len=strlen($a);\n\t$b_len=strlen($b);\n\tif (($a_len<255) && ($b_len<255))\n\t{\n\t\treturn levenshtein($a,$b);\n\t}\n\t$percent=0.0;\n\treturn max($a_len,$b_len)-similar_text($a,$b,$percent);\n}", "public function testProcessHtml(): void {\n\t\t/** @var BaseUtility&MockObject $utility */\n\t\t$utility = $this->getMockBuilder(BaseUtility::class)\n\t\t\t->onlyMethods(['getHyphenationWords'])\n\t\t\t->getMock();\n\t\t$utility->method('getHyphenationWords')->will(self::returnCallback(function(): array {\n\t\t\treturn ['con•sec•tetur', 'adi#pi#sicing'];\n\t\t}));\n\t\t$cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);\n\t\t$cObj->start([], '_NO_TABLE');\n\t\t$utility->setContentObjectRenderer($cObj);\n\n\t\t$baseContent = (string)file_get_contents(getcwd() . '/Tests/Unit/Fixtures/Utility/MetaTagsBase.html');\n\t\t$TSFE = $this->setupTsfeMock();\n\t\t$TSFE->content = $baseContent;\n\t\t$utility->postProcessHTML([], $TSFE);\n\n\t\t$expectedContent = (string)file_get_contents(getcwd() . '/Tests/Unit/Fixtures/Utility/HyphenationExpected.html');\n\t\t$expectedContent = str_replace('%SHY%', html_entity_decode('&shy;', 0, 'UTF-8'), $expectedContent);\n\t\t$expectedContent = str_replace(\"\\n\", '', $expectedContent);\n\n\t\t$actualContent = str_replace(\"\\n\", '', $TSFE->content);\n\n\t\tself::assertEquals($expectedContent, $actualContent);\n\t}", "static function apply($diff, $text)\n {\n $tmpname = tempnam(sys_get_temp_dir(), \"diff\");\n $outname = tempnam(sys_get_temp_dir(), \"diff\");\n $tmp = fopen($tmpname, \"w\");\n $out = fopen($outname, \"r\");\n fwrite($tmp, $text.PHP_EOL);\n $proc = proc_open(\n 'patch '.$tmpname.' -o '.$outname, array(\n 0 => array(\"pipe\", \"r\"),\n 1 => array(\"pipe\", \"w\"),\n 2 => array(\"pipe\", \"w\")\n ), $pipes\n );\n if (is_resource($proc)) {\n fwrite($pipes[0], $diff);\n fclose($pipes[0]);\n stream_get_contents($pipes[1]);\n $newText = stream_get_contents($out);\n fclose($pipes[1]);\n return $newText;\n }\n }", "function FixHtml($html_text) {\n\t\t$text_filter = new TextFilter ( );\n\t\t$text_nojs = $text_filter->filterJavaScript ( $html_text );\n\t\t$text_noif = preg_replace ( '/<iframe.*?<\\/iframe>/ims', \"\", $text_nojs );\n\t\t$text_noif = preg_replace ( '/<IFRAME.*?<\\/IFRAME>/ims', \"\", $text_noif );\n\t\t//$text_bal = $text_filter->balanceTags($text_noif);\n\t\t\n\n\t\treturn $text_noif;\n\t}", "function templateCode_older() {\r\n\t\tif ($this->template !== \"none\") {\r\n\t\t\tprint('do not use this function 43096809683069836');exit(0);\r\n\t\t\t$bodycode = ReTidy::getBodyCode();\r\n\t\t\tif(strpos($bodycode, '<div class=\"center\">') !== false) {\r\n\t\t\t\tvar_dump(OM::getTagString('abvb<div class=\"center\">adsfds</div>sdsgdsgds', '<div class=\"center\">'));exit(0);\r\n\t\t\t\t$bodycode = substr(OM::getTagString($bodycode, '<div class=\"center\">'), strlen('<div class=\"center\">'), strlen($bodycode)-strlen('<div class=\"center\">')-4);\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace(\"{content}\", $bodycode, file_get_contents($this->template));\r\n\t\t}\r\n\t}", "function skin_diff_main_overview($content) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<script type=\"text/javascript\" src='{$this->ipsclass->skin_acp_url}/acp_template.js'></script>\n<div class='tableborder'>\n <div class='tableheaderalt'>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td align='left' width='95%' style='font-size:12px; vertical-align:middle;font-weight:bold; color:#FFF;'>Отчет сравнения стилей</td>\n </tr>\n</table>\n </div>\n <table cellpadding='0' cellspacing='0' width='100%'>\n <tr>\n <td class='tablesubheader' width='90%'><strong>Название</strong></td>\n <td class='tablesubheader' width='5%'>Создано</a>\n <td class='tablesubheader' width='5%'>&nbsp;</a>\n </tr>\n $content\n </table>\n <div align='right' class='tablefooter'>&nbsp;</div>\n</div>\n<br />\n<form action='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=skin_diff' enctype='multipart/form-data' method='POST'>\n<input type='hidden' name='_admin_auth_key' value='{$this->ipsclass->_admin_auth_key}' />\n<div class='tableborder'>\n <div class='tableheaderalt'>Создать новый отчет сравнения стилей</div>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td class='tablerow1'><strong>Введите название</strong><div class='desctext'>Это название будет использовано в списке выше, когда сравнение будет завершено</div></td>\n <td class='tablerow2'><input class='textinput' type='text' size='30' name='diff_session_title' /></td>\n </tr>\n <tr>\n <td class='tablerow1'><strong>Пропускать все новые/ошибочные шаблоны?</strong><div class='desctext'>Если вы сравниваете старый ipb_templates.xml из более старого IPB, вы можете отключить этот пункт. Если вы сравниваете с XML файлом из измененного стиля, вы должны включить этот пункт.</div></td>\n <td class='tablerow2'><input class='textinput' type='checkbox' value='1' name='diff_session_ignore_missing' /></td>\n </tr>\n <tr>\n <td class='tablerow1'><strong>Выберите корректный файл «ipb_templates.xml».</strong><div class='desctext'>Будет произведено сравнение с HTML шаблонами главного стиля</div></td>\n <td class='tablerow2'><input class='textinput' type='file' size='30' name='FILE_UPLOAD' /></td>\n </tr>\n </table>\n <div align='center' class='tablefooter'><input type='submit' class='realbutton' value='Импортировать' /></div>\n</div>\n</form>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function generateUnifiedDiff()\n {\n if ( ! $this->operations) {\n return \"\";\n }\n\n if ($this->lines === null) {\n $hunk = Hunk::forEmptyFile();\n return (string)$this->operations[0]->perform($hunk);\n }\n\n $hunks = array();\n\n foreach ($this->getLineGroups() as $lineGroup) {\n $start = min($lineGroup);\n $end = max($lineGroup);\n\n $hunk = Hunk::forLines($start, $end, $this->lines);\n\n foreach ($this->operations as $line => $operation) {\n if ( ! in_array($line, $lineGroup)) {\n continue;\n }\n\n $hunk = $operation->perform($hunk);\n }\n\n $hunks[] = $hunk;\n }\n\n $output = \"\";\n\n if ($this->path) {\n $output .= \"--- a/\" . $this->path . \"\\n\";\n $output .= \"+++ b/\" . $this->path . \"\\n\";\n }\n\n $output .= implode(\"\\n\", $hunks);\n\n return $output;\n }", "public static function show_diffs( $source_id, $suggestion_id ) {\n\t\t// get posts, call wp_text_diff\n\t\t$source = get_post( $source_id );\n\t\t$suggestion = get_post( $suggestion_id );\n\t\t$nonce_name = 'moderate-post-' . $source_id . '-' . $suggestion_id;\n\t\t$original_date = date_i18n( get_option( 'date_format' ), strtotime( $source->post_date ) );\n\t\t$suggestion_date = date_i18n( get_option( 'date_format' ), strtotime( $suggestion->post_date ) );\n\t\t$diff_html = wp_text_diff(\n\t\t\t$source->post_title . \"\\n\" . $source->post_content,\n\t\t\t$suggestion->post_title . \"\\n\" . $suggestion->post_content,\n\t\t\tarray(\n\t\t\t\t'title_left' => sprintf( __( 'Original, %s', 'blicki' ), $original_date ),\n\t\t\t\t'title_right' => sprintf( __( 'Suggested, %s', 'blicki' ), $suggestion_date )\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php printf( __( 'Merging suggested changes into &ldquo;%s&rdquo;', 'blicki' ), '<a href=\"' . get_edit_post_link( $source_id ) . '\">' . esc_html( $source->post_title ) . '</a>' ); ?></h1>\n\n\t\t\t<div style=\"margin: 1em 0; padding: 10px; overflow: hidden; background: #fbfbfb; line-height: 30px;\">\n\t\t\t\t<a href=\"<?php echo wp_nonce_url( add_query_arg( 'action', 'approve' ), $nonce_name ); ?>\" class=\"button button-large button-primary\"><?php _e( 'Approve Suggestion', 'blicki' ); ?></a>\n\t\t\t\t&nbsp;&nbsp;<a href=\"<?php echo wp_nonce_url( add_query_arg( 'action', 'reject' ), $nonce_name ); ?>\" class=\"button button-large delete\"><?php _e( 'Reject Suggestion', 'blicki' ); ?></a>\n\t\t\t\t&nbsp;&nbsp;<a href='<?php echo esc_url( add_query_arg( array( 'post' => $source_id, 'action' => 'edit', 'merge_from' => $suggestion_id ), 'post.php' ) ); ?>'><?php _e( 'Edit Manually', 'blicki' ); ?></a>\n\t\t\t</div>\n\n\t\t\t<?php echo $diff_html; ?>\n\t\t</div>\n\t\t<?php\n\t}", "function extract_text($ref,$extension,$path=\"\")\n\t{\n\t# Extract text from the resource and save to the configured field.\n\tglobal $extracted_text_field,$antiword_path,$pdftotext_path,$zip_contents_field;\n\t$text=\"\";\n\tif ($path==\"\"){$path=get_resource_path($ref,true,\"\",false,$extension);}\n\t\n\t# Microsoft Word extraction using AntiWord.\n\tif ($extension==\"doc\" && isset($antiword_path))\n\t\t{\n\t\t$command=$antiword_path . \"/antiword\";\n\t\tif (!file_exists($command)) {$command=$antiword_path . \"\\antiword.exe\";}\n\t\tif (!file_exists($command)) {debug(\"ERROR: Antiword executable not found at '$antiword_path'\"); return false;}\n\t\t$text=run_command($command . \" -m UTF-8 \\\"\" . $path . \"\\\"\");\n\t\t}\n\t\n # Microsoft OfficeOpen (docx,xlsx) extraction\n # This is not perfect and needs some work, but does at least extract indexable content.\n if ($extension==\"docx\"||$extension==\"xlsx\")\n\t\t{\t\n\t\t$path=escapeshellarg($path);\n\t\t\n\t\t # DOCX files are zip files and the content is in word/document.xml.\n # We extract this then remove tags.\n switch($extension){\n case \"xlsx\":\n $text=run_command(\"unzip -p $path \\\"xl/sharedStrings.xml\\\"\");\n break;\n\n case \"docx\":\n $text=run_command(\"unzip -p $path \\\"word/document.xml\\\"\");\n break;\n }\n \n\t\t# Remove tags, but add newlines as appropriate (without this, separate text blocks are joined together with no spaces).\n\t\t$text=str_replace(\"<\",\"\\n<\",$text);\n\t\t$text=trim(strip_tags($text));\n\t\twhile (strpos($text,\"\\n\\n\")!==false) {$text=str_replace(\"\\n\\n\",\"\\n\",$text);} # condense multiple line breaks\n\t\t}\n\n\t# OpenOffice Text (ODT)\n\tif ($extension==\"odt\"||$extension==\"ods\"||$extension==\"odp\")\n\t\t{\t\n\t\t$path=escapeshellarg($path);\n\t\t\n\t\t# ODT files are zip files and the content is in content.xml.\n\t\t# We extract this then remove tags.\n\t\t$text=run_command(\"unzip -p $path \\\"content.xml\\\"\");\n\n\t\t# Remove tags, but add newlines as appropriate (without this, separate text blocks are joined together with no spaces).\n\t\t$text=str_replace(\"<\",\"\\n<\",$text);\n\t\t$text=trim(strip_tags($text));\n\t\twhile (strpos($text,\"\\n\\n\")!==false) {$text=str_replace(\"\\n\\n\",\"\\n\",$text);} # condense multiple line breaks\n\t\t}\n\t\n\t# PDF extraction using pdftotext (part of the XPDF project)\n\tif (($extension==\"pdf\" || $extension==\"ai\") && isset($pdftotext_path))\n\t\t{\n\t\t$command=$pdftotext_path . \"/pdftotext\";\n\t\tif (!file_exists($command)) {$command=$pdftotext_path . \"\\pdftotext.exe\";}\n\t\tif (!file_exists($command)) {debug(\"ERROR: pdftotext executable not found at '$pdftotext_path'\"); return false;}\n\t\t$text=run_command($command . \" -enc UTF-8 \\\"\" . $path . \"\\\" -\");\n\t\t\n\t\t}\n\t\n\t# HTML extraction\n\tif ($extension==\"html\" || $extension==\"htm\")\n\t\t{\n\t\t$text=strip_tags(file_get_contents($path));\n\t\t}\n\n\t# TXT extraction\n\tif ($extension==\"txt\")\n\t\t{\n\t\t$text=file_get_contents($path);\n\t\t}\n\n\tif ($extension==\"zip\")\n\t\t{\n\t\t# Zip files - map the field\n\t\t$path=escapeshellarg($path);\n\t\t$text=run_command(\"unzip -l $path\");\n\t\t\n\t\tglobal $zip_contents_field_crop;\n\t\tif ($zip_contents_field_crop>0)\n\t\t\t{\n\t\t\t# Remove the first few lines according to $zip_contents_field_crop in config.\n\t\t\t$text=explode(\"\\n\",$text);\n\t\t\tfor ($n=0;$n<count($zip_contents_field_crop);$n++) {array_shift($text);}\n\t\t\t$text=join(\"\\n\",$text);\n\t\t\t}\n\t\t\n\t\tif (isset($zip_contents_field))\n\t\t\t{\n\t\t\t$extracted_text_field=$zip_contents_field;\n\t\t\t}\n\t\t}\n\t\n\thook(\"textextraction\", \"all\", array($extension,$path));\n\t\t\n\t# Save the extracted text.\n\tif ($text!=\"\")\n\t\t{\n\t\t$modified_text=hook(\"modifiedextractedtext\",'',array($text));\n\t\tif(!empty($modified_text)){$text=$modified_text;}\n\t\t\n\t\t# Save text\n\t\tupdate_field($ref,$extracted_text_field,$text);\n\t\t\n\t\t# Update XML metadata dump file.\n\t\tupdate_xml_metadump($ref);\n\t\t}\n\t\n\t}", "function phorum_api_diff_unpatch_color($text, $diff)\n{\n $text = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $text);\n\n if (!is_array($diff))\n {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.\"[phorum removal]\".substr($diff, $i+1).\"[/phorum removal]\".$post;\n } elseif ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n $colored_text = substr($diff, $i+1);\n return $pre.\"[phorum addition]\".$colored_text.\"[/phorum addition]\".substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach (array_reverse($diff) as $d) {\n $text = phorum_api_diff_unpatch_color($text, $d);\n }\n return $text;\n}", "function g()\r\n\t{\r\n\t\t$this->str_html = str_replace(array(\"\\r\\n\",\"\\n\",\"\\r\",\"\\t\"), ' ', $this->str_html);\r\n\t\t$this->str_html = preg_replace(\"/(\\s{2,})/\", ' ', $this->str_html);\r\n\t\treturn $this->replace_vars($this->str_html, $this->html_a, 1);\r\n#\t\treturn $this->str_html;\r\n\t}", "public function _changed($orig, $closing)\n\t{\n\t\t$diff = new WordLevelDiff($orig, $closing);\n\t\t$del = $diff->orig();\n\t\t$add = $diff->closing();\n\n\t\t// Notice that WordLevelDiff returns HTML-escaped output.\n\t\t// Hence, we will be calling addedLine/deletedLine without HTML-escaping.\n\n\t\twhile ($line = array_shift($del))\n\t\t{\n\t\t\t$this->i++;\n\t\t\t$aline = array_shift($add);\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->deletedLine($line) . $this->addedLine($aline);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t// If any leftovers\n\t\tforeach ($add as $line)\n\t\t{\n\t\t\t$this->i++;\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->emptyLine() . $this->addedLine($line);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t//$this->i--;\n\t}", "function testBug13600() \n {\n //$this->oBeaut->startLog();\n $this->oBeaut->addFilter('Pear');\n $sText = <<<SCRIPT\n<?php\nfunction example(){\n}\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nfunction example()\n{\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "private function getMarkedUpForeignText( array $unifiedDiff ) {\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-plain-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-plain-own';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\"></div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-plain-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-plain-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t$changeSet['old'] . \"\\n\" .\n\t\t\t\t\t\t\t'</div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-plain-same\">' .\n\t\t\t\t\t\t\t$changeSet['copy'] . \"\\n\" .\n\t\t\t\t\t\t\t'</div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "function test_misc_static_replacements( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function when_match( $bool, $str = '', $otherwise_str = '', $echo = true ) {\n\t$str = trim( $bool ? $str : $otherwise_str );\n\n\tif ( $str ) {\n\t\t$str = ' ' . $str;\n\n\t\tif ( $echo ) {\n\t\t\techo esc_attr($str);\n\t\t\treturn '';\n\t\t}\n\t}\n\n\treturn $str;\n}", "function getDiff()\n {\n }", "public function getReplacementText();", "function wp_get_revision_ui_diff($post, $compare_from, $compare_to)\n {\n }", "function skin_diff_view_bit( $template_bit_name, $template_group, $content ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n<strong>$template_group &gt; $template_bit_name</strong>\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n$content\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "function phppage2readeable($t){\n\n return str_replace(\" \", \"&nbsp;\",preg_replace(\"/\\.php$/\", \"\", str_replace(\"_\", \"&nbsp;\", $t)));\n}", "public function maybe_merge_content( $content, $post_id ) {\n\t\tif ( isset( $_GET['merge_from'] ) && 0 !== absint( $_GET['merge_from'] ) ) {\n\t\t\t$post = get_post( $post_id );\n\t\t\t$suggestion = get_post( absint( $_GET['merge_from'] ) );\n\t\t\tif ( ! empty( $post) && 'blicki' === $post->post_type\n\t\t\t\t&& ! empty( $suggestion ) && 'blicki-suggestion' === $suggestion->post_type ) {\n\t\t\t\tif ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) {\n\t\t\t\t\trequire( ABSPATH . WPINC . '/wp-diff.php' );\n\t\t\t\t}\n\n\t\t\t\t$text_diff = new Text_Diff( explode( \"\\n\", $post->post_content ), explode( \"\\n\", $suggestion->post_content ) );\n\t\t\t\t$merged_text = '';\n\t\t\t\tforeach ( $text_diff->_edits as $operation ) {\n\t\t\t\t\tif ( $operation instanceof Text_Diff_Op_copy ) {\n\t\t\t\t\t\t// copy just means use the final (or original, they're the same by definition )\n\t\t\t\t\t\tforeach ( $operation->final as $line ) {\n\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// all other operations have some difference between orig and final (might be false ie empty)\n\t\t\t\t\t\t$merged_text .= \"ORIGINAL:\\n\\n\";\n\t\t\t\t\t\tif ( ! empty( $operation->orig ) ) {\n\t\t\t\t\t\t\tforeach ( $operation->orig as $line ) {\n\t\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$merged_text .= \"\\nSUGGESTED:\\n\\n\";\n\t\t\t\t\t\tif ( ! empty( $operation->final ) ) {\n\t\t\t\t\t\t\tforeach ( $operation->final as $line ) {\n\t\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$merged_text .= \"\\nEND\\n\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $merged_text;\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}", "function _text($str) {\n $md5 = md5($str);\n $option_name = get_text_translation_option_name( $md5 );\n $org = esc_html($str);\n\n if ( !isset($_COOKIE['site-edit']) || $_COOKIE['site-edit'] != 'Y' || ! user()->admin() ) {\n $str = _getText($str, true);\n echo $str;\n }\n else {\n $str = _getText($str);\n echo \"\n<div class='translate-text' md5='$md5' original-text='$org' code='$option_name'><span class='dashicons dashicons-welcome-write-blog'></span>\n<div class='html-content'>$str</div>\n</div>\n\";\n }\n\n}", "function tb_string_swap_get_strings() {\n\t$locals = array (\n\t\t'404'\t\t\t\t\t\t=> 'Apologies, but the page you\\'re looking for can\\'t be found.',\n\t\t'404_title'\t\t\t\t\t=> '404 Error',\n\t\t'archive_no_posts'\t\t\t=> 'Apologies, but there are no posts to display.',\n\t\t'archive'\t\t\t\t\t=> 'Archive',\n\t\t'cancel_reply_link'\t\t\t=> 'Cancel reply',\n\t\t'categories'\t\t\t\t=> 'Categories',\n\t\t'category'\t\t\t\t\t=> 'Category',\n\t\t'comment_navigation'\t\t=> 'Comment navigation',\n\t\t'comments'\t\t\t\t\t=> 'Comments',\n\t\t'comments_closed'\t\t\t=> 'Comments are closed.',\n\t\t'comments_newer'\t\t\t=> 'Newer Comments &rarr;',\n\t\t'comments_no_password'\t\t=> 'This post is password protected. Enter the password to view any comments.',\n\t\t'comments_older'\t\t\t=> '&larr; Older Comments',\n\t\t'comments_title_single'\t\t=> 'One comment on &ldquo;%2$s&rdquo;',\n\t\t'comments_title_multiple'\t=> '%1$s comments on &ldquo;%2$s&rdquo;',\n\t\t'contact_us'\t\t\t\t=> 'Contact Us',\n\t\t'crumb_404'\t\t\t\t\t=> 'Error 404',\n\t\t'crumb_author'\t\t\t\t=> 'Articles posted by',\n\t\t'crumb_search'\t\t\t\t=> 'Search results for',\n\t\t'crumb_tag'\t\t\t\t\t=> 'Posts tagged',\n\t\t'edit_page'\t\t\t\t\t=> 'Edit Page',\n\t\t'email'\t\t\t\t\t\t=> 'Email',\n\t\t'home'\t\t\t\t\t\t=> 'Home',\n\t\t'invalid_layout'\t\t\t=> 'Invalid Layout ID',\n\t\t'label_submit'\t\t\t\t=> 'Post Comment',\n\t\t'last_30'\t\t\t\t\t=> 'The Last 30 Posts',\n\t\t'monthly_archives'\t\t\t=> 'Monthly Archives',\n\t\t'name'\t\t\t\t\t\t=> 'Name',\n\t\t'page'\t\t\t\t\t\t=> 'Page',\n\t\t'pages'\t\t\t\t\t\t=> 'Pages',\n\t\t'page_num'\t\t\t\t\t=> 'Page %s',\n\t\t'posts_per_category'\t\t=> 'Posts per category',\n\t\t'navigation' \t\t\t\t=> 'Navigation',\n\t\t'no_slider' \t\t\t\t=> 'Slider does not exist.',\n\t\t'no_slider_selected' \t\t=> 'Oops! You have not selected a slider in your layout.',\n\t\t'no_video'\t\t\t\t\t=> 'The video url could not retrieve a video.',\n\t\t'read_more'\t\t\t\t\t=> 'Read More',\n\t\t'search'\t\t\t\t\t=> 'Search the site...',\n\t\t'search_no_results'\t\t\t=> 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.',\n\t\t'tag'\t\t\t\t\t\t=> 'Tag',\n\t\t'title_reply'\t\t\t\t=> 'Leave a Reply',\n\t\t'title_reply_to'\t\t\t=> 'Leave a Reply to %s',\n\t\t'website'\t\t\t\t\t=> 'Website'\n\t);\n\treturn $locals;\n}", "private function getLineBasedUnifiedDiff( $fromTextLines, $toTextLines ) {\n\t\t$formatter = new LineBasedUnifiedDiffFormatter();\n\t\t$formatter->insClass = ' class=\"mw-twocolconflict-diffchange\"';\n\t\t$formatter->delClass = ' class=\"mw-twocolconflict-diffchange\"';\n\n\t\treturn $formatter->format(\n\t\t\tnew Diff( $fromTextLines, $toTextLines )\n\t\t);\n\t}", "function file_field_diff_view($items, $context) {\n $field = $context['field'];\n $instance = $context['instance'];\n $settings = $context['settings'];\n\n $diff_items = array();\n foreach ($items as $delta => $item) {\n if (isset($item['file'])) {\n $output = array();\n\n // We populate as much as possible to allow the best flexability in any\n // string overrides.\n $t_args = array();\n foreach ($item as $key => $value) {\n if (is_scalar($value)) {\n $t_args['!' . $key] = $value;\n }\n }\n // Some states do not have the file properties in the item, so put these\n // out of the main file object.\n if (!empty($item['file'])) {\n $file_values = (array) $item['file'];\n foreach ($file_values as $key => $value) {\n if (is_scalar($value) && !isset($t_args['!' . $key])) {\n $t_args['!' . $key] = $value;\n }\n }\n }\n\n $output['file'] = t('File: !filename', $t_args);\n if ($settings['compare_description_field'] && !empty($instance['settings']['description_field'])) {\n if (!empty($item['description'])) {\n $output['description'] = t('Description: !description', $t_args);\n }\n }\n if ($settings['show_id']) {\n $output['fid'] = t('File ID: !fid', $t_args);\n }\n if ($settings['compare_display_field'] && !empty($field['settings']['display_field'])) {\n $output['display'] = $item['display'] ? t('Displayed') : t('Hidden');\n }\n $diff_items[$delta] = implode('; ', $output);\n }\n }\n\n return $diff_items;\n}", "function showDiff($otitle, $ntitle, $notice = '')\n\t{\n\t\t$diff = $this->getDiff($otitle, $ntitle, $notice);\n\t\tif ($diff === false) {\n\t\t\t$this->showMissingRevision();\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$this->showDiffStyle();\n\t\t\t$this->getOutput()->clearHTML($diff);\n\t\t\t$this->getOutput()->addHTML($diff);\n\t\t\treturn true;\n\t\t}\n\t}", "static function cleanupDescription($string){\n \n }", "public static function unpatch($text, $diff)\n {\n if(!is_array($diff))\n {\n $n = 0;\n for($i=0; $i<strlen($diff); $i++)\n {\n $c = substr($diff, $i, 1);\n if($c == \"-\")\n {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n }\n elseif($c == \"+\")\n {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach(array_reverse($diff) as $d)\n {\n $text = self::unpatch($text, $d);\n }\n return $text;\n }", "public function testEmptyStrings()\n {\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text('', '', $percent1),\n mb_similar_text('', '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "protected function generateDiffContent($fileName) {\n\t\t$localLangDiff = NULL;\n\t\t$metaDiff = NULL;\n\t\t// set backup file\n\t\t$metaArray = $this->backupService->getBackupObj()->getMetaInfos(3);\n\t\t$informations = array(\n\t\t\t'absPath' => Typo3Lib::fixFilePath(\n\t\t\t\tPATH_site . '/' .\n\t\t\t\t$metaArray[$fileName]['pathBackup']\n\t\t\t),\n\t\t\t'relFile' => $fileName,\n\t\t);\n\t\t$this->backupService->getBackupObj()->setVar($informations);\n\n\t\t// exec diff\n\t\t// read original file\n\t\t$this->configurationService->initFileObject(\n\t\t\t$this->backupService->getBackupObj()->getVar('langFile'),\n\t\t\tTypo3Lib::fixFilePath(PATH_site . '/' . $this->backupService->getBackupObj()->getVar('extPath'))\n\t\t);\n\n\t\t// read backup file\n\t\t$this->backupService->getBackupObj()->readFile();\n\n\t\t// get language data\n\t\t$originalLocalLang = $this->configurationService->getFileObj()->getLocalLangData();\n\t\t$backupLocalLang = $this->backupService->getBackupObj()->getLocalLangData();\n\n\t\t// get meta data\n\t\t$origMeta = $this->configurationService->getFileObj()->getMetaData();\n\t\t$backupMeta = $this->backupService->getBackupObj()->getMetaData();\n\n\t\tSgLib::fixMetaAttributes($origMeta);\n\t\tunset($originalLocalLang['trans-unit']);\n\t\t$localLangDiff = Functions::getBackupDiff(0, $originalLocalLang, $backupLocalLang);\n\t\t$metaDiff = Functions::getMetaDiff(0, $origMeta, $backupMeta);\n\n\t\t// generate diff\n\t\tif (count($localLangDiff)) {\n\t\t\t$this->outputManageBackupsDiff(\n\t\t\t\t$localLangDiff, $metaDiff, $originalLocalLang, $backupLocalLang,\n\t\t\t\t$this->configurationService->getFileObj()->getOriginLangData(),\n\t\t\t\t$this->backupService->getBackupObj()->getOriginLangData(),\n\t\t\t\t$origMeta, $backupMeta\n\t\t\t);\n\t\t}\n\t}", "function testRenderAsHtml_no_references() {\n $mdtv = Metadata_Term_Value::getOneFromDb(['metadata_term_value_id' => 6205],$this->DB);\n $canonical = '<span class=\"term_value\" title=\"up to the the length of the back of the hand when a fist is made\">6-12 cm</span><div class=\"metadata-references\"><div class=\"metadata-references\">\n <ul class=\"metadata-references metadata-references-images\">\n </ul>\n <ul class=\"metadata-references metadata-references-links\">\n </ul>\n <ul class=\"metadata-references metadata-references-texts\">\n </ul>\n</div>\n</div>';\n\n $rendered = $mdtv->renderAsHtml();\n\n// echo \"<pre>\\n\".htmlentities($canonical).\"\\n\".htmlentities($rendered).\"\\n</pre>\";\n\n $this->assertEqual($canonical,$rendered);\n $this->assertNoPattern('/IMPLEMENTED/',$rendered);\n }", "public function contentStrReplace() {}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function phorum_api_diff_match($a, $b, $level=\"line\")\n{\n // set_time_limit(0); No, we don't like it.\n $answer = \"\";\n if ($level == \"line\" || $level == \"word\")\n {\n if ($level == \"line\") {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n } else {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n\n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < sizeof($as); $i++) {\n $start+= strlen($as[$i])+1;\n for ($j = 0; $j < sizeof($bs); $j++) {\n if ($as[$i] != $bs[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n if ($a[$i] != $b[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n\n if ($level == \"line\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"word\");\n } elseif ($level == \"word\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"letter\");\n } else {\n return $answer;\n }\n}", "function return_diff()\n\t{\n\t\t$args = func_get_args();\n\t\t$three_way_diff = (func_num_args() > 2) ? true : false;\n\n\t\t$file1 = array_shift($args);\n\t\t$file2 = array_shift($args);\n\n\t\t$tmp['file1'] = (!empty($file1) && is_string($file1)) ? file_get_contents($file1) : $file1;\n\t\t$tmp['file2'] = (!empty($file2) && is_string($file2)) ? file_get_contents($file2) : $file2;\n\n\t\tif ($three_way_diff)\n\t\t{\n\t\t\t$file3 = array_shift($args);\n\t\t\t$tmp['file3'] = (!empty($file3) && is_string($file3)) ? file_get_contents($file3) : $file3;\n\n\t\t\t$diff = new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$diff = new diff($tmp['file1'], $tmp['file2']);\n\t\t}\n\n\t\tunset($tmp);\n\n\t\treturn $diff;\n\t}", "public static function text_change_check()\n {\n }", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "public function _strings_for_pot()\n {\n }", "function apachesolr_clean_text($text) {\r\n // Add spaces before stripping tags to avoid running words together.\r\n $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());\r\n // Decode entities and then make safe any < or > characters.\r\n return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');\r\n}", "function uwwtd_get_format_markup_compliance(&$variables) {\n //dsm($variables['items']['0']['#markup']);\n //dsm($variables['element']['#items']['0']['value']);\n if (isset($GLOBALS['uwwtd']['ui']['compliance_connection'][$variables['element']['#items']['0']['value']])) {\n $variables['element']['#items']['0']['value'] = $GLOBALS['uwwtd']['ui']['compliance_connection'][$variables['element']['#items']['0']['value']];\n $variables['element']['0']['#markup'] = $GLOBALS['uwwtd']['ui']['compliance'][$variables['element']['#items']['0']['value']];\n //We need to keep the tooltip.\n \n if ($pos = strpos($variables['items']['0']['#markup'], '</div>')) {\n $variables['items']['0']['#markup'] = substr($variables['items']['0']['#markup'], 0, $pos + 6) . $variables['element']['0']['#markup'];\n } \n elseif($variables['items']['0']['#markup'] == $variables['element']['#items']['0']['value']) {\n $variables['items']['0']['#markup'] = $variables['element']['0']['#markup'];\n }\n\n }\n\n switch($variables['element']['#items']['0']['value']){\n case 'C': \n case 'QC':\n case 'RNC':\n $spanclass = 'c';\n break;\n case 'NC':\n case 'AddQC':\n $spanclass = 'nc';\n break;\n case 'NR':\n $spanclass = 'nr';\n break;\n case 'NI':\n $spanclass = 'ni';\n break;\n case 'CE':\n $spanclass = 'ce';\n break;\n }\n\n $variables['items']['0']['#markup'] = '<span class=\"' . $spanclass . '\">' . $variables['items']['0']['#markup'] . '</span>';\n //dsm($variables['items']['0']['#markup']);\n}", "function clean_rtf_from_jade_tables() {\r\n\t\t//$this->code = preg_replace('/class=[^\\s<>]*/', '', $this->code, -1, $d);\r\n\t\t//$this->code = preg_replace('/colspan=[0-9]*/', '', $this->code, -1, $e);\r\n\t\t//$this->code = preg_replace('/width=[0-9]*/', '', $this->code, -1, $f);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $g);\r\n\t\t//$this->code = str_replace('<span >', '', $this->code, $h);\r\n\t\t//$this->code = str_replace('</p>', '', $this->code, $i);\r\n\t\t//$this->code = str_replace('</span>', '', $this->code, $j);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $k);\t\t\r\n\t\t// INAC1168\r\n\t\tif($this->language === \"english\") {\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $l);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $m);\r\n\t\t}\r\n\t\tif($this->language === \"french\") {\r\n\t\tprint(\"<h1>french</h1>\");\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $n);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $o);\t\t\r\n\t\t}\r\n\t\t//$this->code = preg_replace('/<span\\s*>/', '', $this->code, -1, $p);\r\n\t\t$this->code = preg_replace('/<tr height=\"0\">.*?<\\/tr>/', '', $this->code, -1, $q);\r\n\t\t\r\n\t\t$this->logMsgIf(\"clean_rtf_from_jade_tables\", $c + $d + $e + $f + $g + $h + $i + $j + $k + $l + $m + $n + $o + $p + $q);\r\n\t}", "function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }", "function rewrapHTMLCallback($match) {\n $width = 80;\n $break = '<span class=\"allowWrap\"> </span>';\n $words = preg_split('~(\\r\\n|\\n\\r|[\\r\\n\\s])~', $match[2]);\n $systemIncludePath = dirname(dirname(__FILE__));\n if (is_array($words)) {\n $result = '';\n foreach ($words as $word) {\n if (0 === strpos($word, PAPAYA_INCLUDE_PATH)) {\n $partWord = substr($word, strlen(PAPAYA_INCLUDE_PATH));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.$partWord;\n }\n } elseif (isset($_SERVER['DOCUMENT_ROOT']) &&\n 0 === strpos($word, $_SERVER['DOCUMENT_ROOT'])) {\n $partWord = substr($word, strlen($_SERVER['DOCUMENT_ROOT']));\n if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {\n $addSlash = '/';\n } else {\n $addSlash = '';\n }\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.$partWord;\n }\n } elseif (0 === strpos($word, $systemIncludePath)) {\n $partWord = substr($word, strlen($systemIncludePath));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.$partWord;\n }\n } elseif (papaya_strings::strlen($word) > $width) {\n $result .= ' '.wordwrap($word, $width, $break, TRUE);\n } else {\n $result .= ' '.$word;\n }\n }\n return $match[1].substr($result, 1);\n } else {\n return $match[0];\n }\n }", "function compare_title($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]); \n}", "function check_file($file, $file_cnt)\n {\n // The information is contained in these global arrays and vars\n global $miss_file, $miss_tag, $lang, $docdir, $r_alert, \n $s_alert, $t_alert, $maintainer, $cvs_opt;\n\n // Translated file name check\n $t_file = preg_replace( \"'^\".$docdir.\"en/'\", $docdir.$lang.\"/\", $file );\n if (!file_exists($t_file)) {\n $miss_file[] = array(substr($t_file, strlen($docdir)+strlen($lang)), \n round(filesize($file)/1024, 1));\n return FALSE;\n }\n\n // Get translated files tag, with maintainer if needed\n if (empty($maintainer))\n $t_tag = get_tag($t_file, \"\\\\S*\");\n else\n $t_tag = get_tag($t_file, $maintainer);\n\n // No tag found\n if (count($t_tag) == 0) {\n $miss_tag[] = substr($t_file, strlen($docdir));\n return FALSE;\n }\n\n // Storing values for further processing\n $maint = $t_tag[2];\n $en_rev = get_tag($file);\n\n // Make diff link if the revision is not n/a\n $t_td = substr($t_file, strlen($docdir)+strlen($lang)+1);\n if (is_numeric($t_tag[1])) {\n $r_diff = intval($en_rev) - intval($t_tag[1]);\n $t_rev = \"1.\".$t_tag[1];\n if ($r_diff != 0) {\n $t_td = \"<a href=\\\"http://cvs.php.net/diff.php/\".\n preg_replace( \"'^\".$docdir.\"'\", \"phpdoc/\", $file ).\n \"?r1=1.$t_tag[1]&r2=1.$en_rev$cvs_opt\\\">$t_td</a>\";\n }\n } else {\n $r_diff = $t_rev = $t_tag[1];\n }\n\n // Compute sizes, times and diffs\n $en_size = intval(filesize($file) / 1024);\n $t_size = intval(filesize($t_file) / 1024);\n $s_diff = intval($en_size) - intval($t_size);\n $en_date = intval((time() - filemtime($file)) / 86400);\n $t_date = intval((time() - filemtime($t_file)) / 86400);\n $t_diff = $en_date - $t_date;\n\n // Taging actuality of files with colors\n if ($r_diff === 0) {\n $col = \"#68D888\";\n } elseif ($r_diff == \"n/a\") {\n $col = \"#f4a460 class=hl\";\n } elseif ($r_diff >= $r_alert || $s_diff >= $s_alert || $t_diff <= $t_alert) {\n $col = \"#ff0000 class=hl\";\n } else {\n $col =\"#eee8aa\";\n }\n\n // Write out directory headline\n if ($file_cnt == 0) {\n $display_dir = preg_replace(\"'($docdir)(.+)/[^/]*$'\", \"\\\\2/\", $t_file);\n print(\"<tr><th colspan=12 height=3 bgcolor=#666699>$display_dir</th></tr>\");\n }\n \n // Write out the line for the file into the file\n print(\"<tr>\\n <td bgcolor=$col>$t_td</td>\\n\".\n \" <td bgcolor=$col> 1.$en_rev</td><td bgcolor=$col> $t_rev</td>\\n\".\n \" <td bgcolor=$col align=right><b>$r_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$en_size &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$t_size &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right><b>$s_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$en_date &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$t_date &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right><b>$t_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=center>$maint</td>\\n\".\n \" <td bgcolor=$col align=center>$t_tag[3]</td>\\n</tr>\\n\");\n return TRUE;\n }", "public function helperText()\n {\n return \"\";\n }", "public function render()\n\t{\n\t\t$changes = parent::render();\n\t\t$html = '';\n\t\tif(empty($changes)) {\n\t\t\treturn $html;\n\t\t}\n\n\t\t$html .= '<table class=\"Differences DifferencesInline\">';\n\t\t$html .= '<thead>';\n\t\t$html .= '</thead>';\n\t\tforeach($changes as $i => $blocks) {\n\t\t\t// If this is a separate block, we're condensing code so output ...,\n\t\t\t// indicating a significant portion of the code has been collapsed as\n\t\t\t// it is the same\n\t\t\tif($i > 0) {\n\t\t\t\t$html .= '<tbody class=\"Skipped\">';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<td>&#xA0;</td>';\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\n\t\t\tforeach($blocks as $change) {\n\t\t\t\t$html .= '<tbody class=\"Change'.ucfirst($change['tag']).'\">';\n\t\t\t\t// Added lines only on the right side\n\t\t\t\tif($change['tag'] == 'insert') {\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><ins>'.$line.'</ins>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show deleted lines only on the left side\n\t\t\t\telse if($change['tag'] == 'delete') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><del>'.$line.'</del>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show modified lines on both sides\n\t\t\t\telse if($change['tag'] == 'replace') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\t\t}\n\t\t$html .= '</table>';\n\t\treturn $html;\n\t}", "protected function failureDescription($other) {\n $thisVal = $this->normalize($this->value);\n $otherVal = $this->normalize($other);\n\n $len = min(strlen($thisVal),strlen($otherVal));\n\n for($i=0; $i<$len; ++$i) {\n if($thisVal[$i] !== $otherVal[$i]) {\n break;\n }\n }\n\n $start = max($i-25,0);\n $offset = min($i,25);\n $t = substr($thisVal,$start,50);\n $o = substr($otherVal,$start,50);\n\n return \"two strings are equal, ignoring whitespace and case\\n\"\n . \"- $t\\n\"\n . ' '.str_repeat(' ',$offset). \"^\\n\"\n . \"+ $o\";\n }", "function diff($from_lines, $to_lines)\n {\n }", "public function diff()\n\t{\n\t\tif (is_uploaded_file(self::$_files['attachment']['tmp_name'])) \n\t\t{\n\t\t\t$filedump = $this->m->getDumpFromFile(self::$_files['attachment']['tmp_name']);\n\t\t\t$dbdump = $this->m->getDumpFromDb();\n\t\t\t\n\t\t\t$this->v->displaySQL($dbdump, $filedump);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$this->v->script = 'File not uploaded';\n\t\t\t$this->v->display('dbdiff');\n\t\t}\n\t}", "public function testCompareContents(): void\n {\n ob_start();\n include dirname(TEST_ROOT_PATH) . '/script/make-readme.php';\n $producedContents = ob_get_contents();\n ob_end_clean();\n\n assert(is_string($producedContents));\n\n if ($this->contents !== $producedContents) {\n $differ = new Differ();\n\n throw new \\RuntimeException(sprintf(\n implode('', [\n 'README.md is not up–to-date. Please run: php script/make-readme.php.',\n ' The diff is:\\n\\n%s',\n ]),\n $differ->diff($this->contents, $producedContents),\n ));\n }\n\n $this->assertTrue(true);\n }", "function preFilterText($text)\r\n{\r\n\t// Make sure the submitted text isn't too long\r\n\t// This shouldn't affect valid URLs as AutoLinks\r\n\tif (strlen($text) > LACE_MAX_TEXT_LENGTH)\r\n\t\t$text = mb_substr($text, 0, LACE_MAX_TEXT_LENGTH);\r\n\r\n\t// Wrap long lines if there are more than 35 characters\r\n\t// and less than three spaces.\r\n\tif (strlen($text) > 35 && substr_count($text, ' ') < 3)\r\n\t\t$text = real_wordwrap($text, 35, ' ');\r\n\r\n \t// Filter the contents of <code> tags so that lib_filter\r\n \t// doesn't interfere with them.\r\n\t$text = codeTagFilter($text);\r\n\r\n\t// Add rel attribute to links\r\n\tif (strpos($text, '<a') !== false && strpos($text, '<a rel=') === false)\r\n\t\t$text = str_replace('<a ', '<a rel=\"external\" ', $text);\r\n\r\n\t// First pass at attempting to fix number comparisons before\r\n\t// lib_filter can munge them.\r\n\t//\r\n\t// Input Output\r\n\t// 800<=1000 800 &lt;= 1000\r\n\t// 400> 200 400 &gt; 200\r\n\t// 100 <>500 100 &lt;&gt; 500\r\n\t// etc...\r\n\t$pattern = '%(\\d)\\s*([<>=]{1,2})\\s*(\\d)%se';\r\n\t$replace = \"'\\\\1'.htmlentities(' \\\\2 ').'\\\\3'\";\r\n\t$text = preg_replace($pattern, $replace, $text);\r\n\r\n\t// Replace all orphaned < and > characters with entities to keep\r\n\t// lib_filter from hosing them...\r\n\t// And, sorry, Lace uses pipes as delimiters - broken vertical bar for you!\r\n\t$search = array(' < ', ' > ', '|');\r\n\t$replace = array(' &lt; ', ' &gt; ', '&brvbar;');\r\n\t$text = str_replace($search, $replace, $text);\r\n\r\n\t// Replace all mid-message newlines with <br> tags\r\n\t// Currently, this break large blocks of code within\r\n\t// <code> tags...\r\n\t$text = str_replace(\"\\n\", '<br>', $text);\r\n\r\n\t// Replace all <br /> tags with <br> tags\r\n\t$text = str_replace('<br />', '<br>', $text);\r\n\r\n\t// Reduce groups of 3 <br> tags to just 2\r\n\twhile(strpos($text, '<br><br><br>') !== false)\r\n\t{\r\n\t\t$text = str_replace('<br><br><br>', '<br><br>', $text);\r\n\t}\r\n\r\n\treturn $text;\r\n}", "function testBugInternal1() \n {\n $sText = <<<SCRIPT\n<?php\n\\$a = <<<HEREDOC\nsdsdsds\nHEREDOC;\n?>\nSCRIPT;\n $this->setText($sText);\n $sActual = $this->oBeaut->get();\n $this->assertTrue(preg_match(\"/HEREDOC;\\n\\s*?\\?>/ms\", $sActual));\n }", "function checkBlock($name, $display, $source, $newStr = '')\r\n\t{\r\n \tif ($display) {\r\n \t\t$after_replace = '\\\\1';\r\n \t} else {\r\n \t $after_replace = $newStr;\r\n \t}\r\n \t//return eregi_replace(\"\\{\".$name.\"\\}([^\\[]+)\\{/\".$name.\"\\}\", $after_replace, $source);\r\n \t//return preg_replace('/{'.$name.'}(.*?){\\/'.$name.'}/si', $after_replace, $source);\r\n\t $source = str_replace('$','&#36;',$source);\r\n\t return preg_replace(\"/{\".$name.\"}(.*?){\\/\".$name.\"}/si\", $after_replace, $source);\r\n\t}", "public function __construct($packageID = 0, $patchFileString = '', $reverse = false, $rePatch = false, $templateID = 0, $type = '', $fuzzFactor = 0) {\n\t\tif ($patchFileString) {\n\t\t\t$this->packageID = $packageID;\n\t\t\t$this->reverse = $reverse;\n\t\t\t$this->rePatch = $rePatch;\n\t\t\t$this->templateID = $templateID;\n\t\t\t$this->type = $type;\n\t\t\t$this->fuzzFactor = $fuzzFactor;\n\t\t\t\n\t\t\t// read the diff string into an array.\n\t\t\t$lines = preg_split('/\\r?\\n|\\r/', $patchFileString);\n\t\t\t\n\t\t\t// make sure to remove an eventual BOM at the very beginning of UTF-8 encoded files.\n\t\t\t// further care about the patchfile's encoding is not needed because we are only \n\t\t\t// patching templates here which consist of ascii characters only.\n\t\t\t$lines['0'] = FileUtil::stripBoms($lines['0']);\n\t\t\t\n\t\t\tif ($this->rePatch === false && $this->reverse === false) {\n\t\t\t\t// needed for checking if there are successive files to be patched within this diff.\n\t\t\t\t// there is no sufficient \"official\" specification about how the format of the header lines\n\t\t\t\t// in a unified diff has to be, so we take into account practice and this web resource:\n\t\t\t\t// http://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\t\t\t\t// unfortunately some non-GNU versions of patch do not respect the format mentioned above,\n\t\t\t\t// therefore a relatively simple regex is being used (we cannot check something we don't know\n\t\t\t\t// how it actually looks).\n\t\t\t\t$this->regexCheckFile = \"%^([ ]*[\\-|\\+]{3}[ ])([\\w\\./\\\\\\\\]+)%\";\n\t\t\t\t\n\t\t\t\t// lines at the beginning that are neither context nor diff lines are being omitted.\n\t\t\t\tforeach ($lines as $key => $line) {\n\t\t\t\t\tif ($line == '' || !((preg_match($this->regexCheckFile, $line, $result) == 1) && (preg_match($this->regexCheckFile, $lines[$key + 1], $result) == 1))) {\n\t\t\t\t\t\tunset($lines[$key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// remember positions where consecutive patches start.\n\t\t\t\t$lines = array_values($lines);\n\t\t\t\t$diffStarts = array();\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($lines as $key => $line) {\n\t\t\t\t\tif ((preg_match($this->regexCheckFile, $line, $result) == 1) && (preg_match($this->regexCheckFile, $lines[$key + 1], $result) == 1)) {\n\t\t\t\t\t\t$diffStarts[] = $key;\n\t\t\t\t\t\t$this->patch[$i]['patch'] = array();\n\t\t\t\t\t\tarray_push($this->patch[$i]['patch'], $line);\n\t\t\t\t\t\tarray_push($this->patch[$i]['patch'], $lines[$key + 1]);\n\t\t\t\t\t\tarray_push($this->garbage, $line);\n\t\t\t\t\t\tarray_push($this->garbage, $lines[$key + 1]);\n\t\t\t\t\t\t$i = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// if our diff contains more than one patch which means that there is more than one\n\t\t\t// file to be patched), we will split $lines into separate arrays where every array\n\t\t\t// contains the respective patch which is to be applied to the respective target file.\n\t\t\tif (($this->rePatch === true) || ($this->reverse === true) || (count($diffStarts) == 1)) {\n\t\t\t\t// if it's only one patch, we go ahead and attempt to apply it.\n\t\t\t\t$this->lines = $lines;\n\t\t\t\t$this->checkDiffType(0);\n\t\t\t} else {\n\t\t\t\t// add the end of the last patch within this diff to the $diffStarts array.\n\t\t\t\t$diffStarts[] = count($lines) + 1;\n\t\t\t\t// split the original array into the respective patches.\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($diffStarts as $key => $diffStart) {\n\t\t\t\t\tif ($diffStart < count($lines)) {\n\t\t\t\t\t\t$this->lines = array_slice($lines, $diffStart, $diffStarts[$key + 1] - $diffStart);\n\t\t\t\t\t}\n\t\t\t\t\t// start processing each patch.\n\t\t\t\t\t$this->garbage = array();\n\t\t\t\t\t$this->originalFile = '';\n\t\t\t\t\t$this->targetPosition = 0;\n\t\t\t\t\tif (count($this->lines)) {\n\t\t\t\t\t\t$this->checkDiffType($i);\n\t\t\t\t\t\t$i = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// delete reversed patches from database.\n\t\t\tif (($this->rePatch === false) && ($this->reverse === true)) {\n\t\t\t\t$this->deletePatch();\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tthrow new TemplatePatchException(\"No diff string has been given.\", 20000);\n\t\t}\n\t}", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "function horse_thatbooks_misc_cleanup( $output ) {\n\t// MANGLED LINK SHORTENERS\n\t$botched_url_snippets = array(\n\t\t'/tco/' => '/t.co/'\n\t);\n\n\tforeach( $botched_url_snippets as $bus => $r ) {\n\t\t$output = str_replace( $bus, $r, $output );\n\t}\n\n\t// HTML ENTITIES\n\t$output = htmlspecialchars_decode( $output );\n\n\t// BEGINNINGS OF STRINGS\n\t// The only non-alphanumeric character allowed at the beginning of strings is a dot, when\n\t// followed immediately by an @\n\tpreg_match( '/^[a-zA-Z@0-9]/', $output, $matches );\n\tif ( empty( $matches ) ) {\n\t\tswitch ( substr( trim( $output ), 0, 1 ) ) {\n\t\t\tcase '.' :\n\t\t\t\tif ( '@' == substr( trim( $output ), 1, 1 ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else fall through\n\n\t\t\tdefault :\n\t\t\t\t$output = trim( substr( trim( $output ), 1 ) );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $output;\n}", "function cleanLeftoverJunk(&$string)\n\t{\n\t\t$string = preg_replace('#<\\!-- (START|END): SRC_[^>]* -->#', '', $string);\n\n\t\tif (strpos($string, $this->src_params->tag_character_start . '/' . $this->src_params->syntax_word) === false)\n\t\t{\n\t\t\t$this->unprotectTags($string);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$regex = $this->src_params->regex;\n\t\tif (@preg_match($regex . 'u', $string))\n\t\t{\n\t\t\t$regex .= 'u';\n\t\t}\n\n\t\t$string = preg_replace(\n\t\t\t$regex,\n\t\t\t'<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::_('SRC_CODE_REMOVED_NOT_ENABLED') . ' -->',\n\t\t\t$string\n\t\t);\n\n\t\t$this->unprotectTags($string);\n\t}", "public function test_gc_replace_in_html_tags( $input, $output ) {\n\t\treturn $this->assertSame( $output, gc_replace_in_html_tags( $input, array( \"\\n\" => ' ' ) ) );\n\t}", "public function testEmptyString2()\n {\n $string1 = $this->randomString(rand(5, 10));\n\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text($string1, '', $percent1),\n mb_similar_text($string1, '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "private function renderDiff($lines1, $lines2): string\n {\n if (!is_array($lines1)) {\n $lines1 = explode(\"\\n\", $lines1);\n }\n if (!is_array($lines2)) {\n $lines2 = explode(\"\\n\", $lines2);\n }\n foreach ($lines1 as $i => $line) {\n $lines1[$i] = rtrim($line, \"\\r\\n\");\n }\n foreach ($lines2 as $i => $line) {\n $lines2[$i] = rtrim($line, \"\\r\\n\");\n }\n\n $renderer = new DiffRendererHtmlInline();\n $diff = new Diff($lines1, $lines2);\n\n return $diff->render($renderer);\n }", "public function diff()\n {\n return trim(implode(\"\\n\", $this->git('diff')));\n }", "function markdown_pre_typo($texte){\n\treturn $texte;\n}", "private static function minify($html) {\n\t\tif(!modules::get_config('tpl_minifier')) {\n\t\t\treturn $html;\n\t\t}\n\t\t// TODO: Match <code> and <pre> too - in separate arrays\n\t\tpreg_match_all('/(<script[^>]*?>.*?<\\/script>)/si', $html, $pre);\n\t\tpreg_match_all('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html, $textarea);\n\t\t$i=0;\n\t\twhile(preg_match('/(<script[^>]*?>.*?<\\/script>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<script[^>]*?>.*?<\\/script>)/si', '#pre'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$i=0;\n\t\twhile(preg_match('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<textarea[^>]*?>.*?<\\/textarea>)/si', '#textarea'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$html = preg_replace('#<!-[^\\[].+?->#', '', $html);//ToDo: WTF?!\n\t\t$html = preg_replace('/[\\r\\n\\t]+/', ' ', $html);\n\t\t$html = preg_replace('/>[\\s]*</', '><', $html); // Strip spacechars between tags\n\t\t$html = preg_replace('/[\\s]+/', ' ', $html); // Replace several spacechars with one space\n\t\tif(!empty($pre[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($pre[0] as $tag) {\n\t\t\t\t$tag = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside\n\t\t\t\t$tag = preg_replace('/[\\ \\t]{2,}/', ' ', $tag); // Replace several spaces by one\n\t\t\t\t$tag = preg_replace('/\\s{2,}/', \"\\r\\n\", $tag); // Replace several linefeeds by one\n\t\t\t\t$html = preg_replace('/#pre'.$i.'#/', $tag, $html, 1);\n\t\t\t\tunset($pre[0][$i]);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tif(!empty($textarea[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($textarea[0] as $tags) {\n\t\t\t\t$tags = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tags);\n\t\t\t\t$tags = preg_replace('/[\\ \\t]{3,}/', ' ', $tags);\n\t\t\t\t$html = preg_replace('/#textarea'.$i.'#/', $tags, $html, 1);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\treturn $html;\n\t}", "public function testHighlightNoMatch()\n {\n $str = 'The quick brown fox jumps over the dog.';\n $this->assertEquals($str, $this->helper->highlight($str, 'black'));\n }" ]
[ "0.6367125", "0.62404084", "0.6216445", "0.618392", "0.59367263", "0.588464", "0.58702266", "0.5829656", "0.580066", "0.5792969", "0.57221717", "0.5652708", "0.5611527", "0.5563281", "0.55473584", "0.55318266", "0.5486468", "0.5446819", "0.5445218", "0.5443194", "0.5425905", "0.5410811", "0.5378824", "0.53700936", "0.53020626", "0.5292655", "0.5277255", "0.52614915", "0.52522296", "0.52371734", "0.52308637", "0.52121603", "0.52100706", "0.51692295", "0.51663303", "0.51586306", "0.5139231", "0.51344395", "0.5082442", "0.5080886", "0.5080356", "0.50786114", "0.50608", "0.5045898", "0.502098", "0.5014661", "0.50129366", "0.5000046", "0.49997407", "0.4996793", "0.49855974", "0.49752238", "0.49318647", "0.49313024", "0.49290887", "0.49255556", "0.4920635", "0.49146748", "0.4911057", "0.48836792", "0.48808143", "0.48785225", "0.48765716", "0.48752508", "0.4869656", "0.4862845", "0.4861749", "0.48552066", "0.48507988", "0.48441085", "0.48413944", "0.48397398", "0.48359206", "0.48355776", "0.48342645", "0.48303524", "0.48293877", "0.4829148", "0.48274282", "0.48229432", "0.4816422", "0.48143232", "0.481392", "0.48045638", "0.480032", "0.47999108", "0.47994798", "0.47983676", "0.47952238", "0.479418", "0.47941345", "0.47891754", "0.47870016", "0.4784062", "0.47779295", "0.47755522", "0.47748083", "0.47747242", "0.47682005", "0.47628915" ]
0.7464799
0
Prepend an array with a value and return the new array
Представить массив с значением в начале и вернуть новый массив
function arrayPrepend($array, $value) { array_unshift($array, $value); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function prepend($array, $value, $key = null)\n {\n if (is_null($key)) {\n array_unshift($array, $value);\n } else {\n $array = [$key => $value] + $array;\n }\n\n return $array;\n }", "function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "public function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "public static function array_unshift_ref(&$array, &$value)\n {\n $return = array_unshift($array, '');\n $array[0] =& $value;\n return $return;\n }", "public function prepend($value) {\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $v) {\n\t\t\t\t$this->prepend($v);\n\t\t\t}\n\t\t} else {\n\t\t\tarray_unshift($this->_value, $value);\n\t\t}\n\n\t\treturn $this;\n\t}", "function util_array_values_prepend(&$item, $key, $prefix)\n{\n $item = $prefix.$item;\n}", "public function prepend( $key, $value )\n\t{\n\t\t$array = $this->get( $key );\n\t\tarray_unshift( $array, $value );\n\t\t$this->set( $key, $array );\n\t}", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n }", "public static function prepend($key, $value)\n {\n $array = self::get($key);\n\n array_unshift($array, $value);\n\n self::set($key, $array);\n }", "function prepend ()\n {\n call_user_func_array ('array_unshift', array_merge ($this->A, func_get_args ()));\n return $this;\n }", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n\n return $this;\n }", "public function arrayPrepend($path, $value, $createParents = false) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_ARRAY_ADD_FIRST,\n 'path' => $path,\n 'value' => $value,\n 'createParents' => $createParents,\n );\n return $this;\n }", "function unshift(array & $array, $key, $val) {\n $array = array_reverse($array, TRUE);\n $array[$key] = $val;\n $array = array_reverse($array, TRUE);\n\n return $array;\n}", "protected function prepend($value, $valueBefore = null, $valueBeforeIndex = null)\n {\n $value = (array) $value;\n $before = array();\n $after = $this->data;\n if (null !== $valueBefore && count($found = array_keys($after, $valueBefore))) {\n $index = $found[0];\n if (array_key_exists($valueBeforeIndex, $found)) {\n $index = $found[$valueBeforeIndex];\n }\n $before = array_slice($after, 0, $index);\n $after = array_slice($after, $index);\n }\n $this->data = array_merge($before, $value, $after);\n\n return $this;\n }", "public function prepend($var, array $array)\n {\n $this->display[$var] = array_merge($array, (array) $this->display[$var]);\n }", "public function prepend($value)\n\t{\n\t\tarray_unshift($this->stack, $value);\n\t}", "function array_insert(array $original, array $new, $offset)\n {\n return array_slice($original, 0, $offset, true) + $new + array_slice($original, $offset, null, true);\n }", "public function prepend($value, $key = null)\n {\n $key ? $this->unshiftKey($key, $value) : $this->unshift($value);\n }", "public function arrayPrependAll($path, $values, $createParents = false) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_ARRAY_ADD_FIRST,\n 'path' => $path,\n 'value' => $values,\n 'createParents' => $createParents,\n 'removeBrackets' => true,\n );\n return $this;\n }", "public static function unshift( array & $array, $key, $val )\n\t{\n\t\t$array = array_reverse( $array, TRUE );\n\t\t$array[$key] = $val;\n\t\t$array = array_reverse( $array, TRUE );\n\n\t\treturn $array;\n\t}", "public function & arrayUnShift () {\n $getFunctionArguments = func_get_args ();\n foreach ($getFunctionArguments as $k => $v) {\n array_unshift ($this->varContainer, $v);\n }\n # Return to chain ...\n return $this->returnToChain ();\n }", "public static function insertBefore(array $targetArray, $beforeKey, $value, $keyValue = null)\n {\n if (null === $keyValue) {\n $newArray[count($targetArray)] = $value;\n } else {\n $newArray[$keyValue] = $value;\n }\n $pos = self::getKeyPos($targetArray, $beforeKey);\n\n if (false === $pos) {\n return $newArray + $targetArray;\n }\n \n array_splice($targetArray, $pos, 0, $newArray);\n\n return $targetArray;\n }", "function array_insert(&$array, $value, $offset)\r\n{\r\n if (is_array($array)) {\r\n $array = array_values($array);\r\n $offset = intval($offset);\r\n if ($offset < 0 || $offset >= count($array)) {\r\n array_push($array, $value);\r\n } elseif ($offset == 0) {\r\n array_unshift($array, $value);\r\n } else {\r\n $temp = array_slice($array, 0, $offset);\r\n array_push($temp, $value);\r\n $array = array_slice($array, $offset);\r\n $array = array_merge($temp, $array);\r\n }\r\n } else {\r\n $array = array($value);\r\n }\r\n return count($array);\r\n}", "private function array_unshift_assoc(&$arr, $key, $val)\n {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n return array_reverse($arr, true);\n }", "public function prependTo($value) {\n \n return $this->append($value);\n }", "public function prepend($item)\n {\n if (is_resource($item)) {\n throw new Exception\\InvalidTypeException('You cannot add a resource to an array.');\n }\n\n if (is_array($item)) {\n throw new Exception\\InvalidTypeException('You cannot prepend an array to an array as of now.');\n }\n\n array_unshift($this->activeValue, $item);\n }", "public static function unshift(array & $array, string $key, $val): array\n {\n $array = array_reverse($array, TRUE);\n $array[$key] = $val;\n $array = array_reverse($array, TRUE);\n\n return $array;\n }", "static function array_to_top($array, $key, $value_instead = false) {\n\n\t\tif ($value_instead) {\n\t\t\tif (($array_key = array_search($key, $array)) !== false) {\n\t\t\t\tunset($array[$array_key]);\n\t\t\t}\n\t\t\tarray_unshift($array , $key);\n\t\t}\n\t\telse {\n\t\t\t$value = array($key => $array[$key]);\n\t\t\tunset($array[$key]);\n\t\t\t$array = $value + $array;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function prependToKeys(array $arr, string $prepend) : array\n {\n return array_combine(\n array_map(function($key) use ($prepend) { return $prepend.$key; }, array_keys($arr)),\n $arr\n );\n }", "function kernel_array_concat($array, $prefix, $suffix) {\n $newArray = array();\n foreach( $array as $value ) {\n $newArray[] = $prefix . $value . $suffix;\n }\n return $newArray;\n}", "public static function prepend($index, $value)\n {\n self::exist($index);\n array_unshift(self::$registry[$index], $value);\n }", "function array_unshift_assoc(&$arr, $key, $val) {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n $arr = array_reverse($arr, true);\n return count($arr);\n}", "function array_insert(array $array, $before_key, array $array2) {\n if (!\\array_key_exists($before_key, $array))\n \\trigger_error(\"The key '$before_key' does not exist in \\$array.\", \\E_USER_ERROR);\n $new_array = array();\n foreach ($array as $key => $value) {\n if ($key === $before_key) {\n foreach ($array2 as $key2 => $value2) {\n if (!\\array_key_exists($key2, $new_array))\n $new_array[$key2] = $value2;\n }\n $before_key = null;\n }\n if (!\\array_key_exists($key, $new_array))\n $new_array[$key] = $value;\n }\n return $new_array;\n}", "function SetValuePrepend( $k, $v ) { $this->_values[$k] = $v . $this->_values[$k]; }", "public static function array_insert_before($key, array &$array, $new_key, $new_value) {\n if (array_key_exists($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n $new[$k] = $value;\n }\n return $new;\n }\n return FALSE;\n }", "public function unshift( $value )\n\t{\n\t\tarray_unshift( $this->data, $value );\n\n\t\treturn $value;\n\t}", "function acadp_array_insert_after( $key, $array, $new_array ) {\n\n\tif( array_key_exists( $key, $array ) ) {\n \t$new = array();\n \tforeach( $array as $k => $value ) {\n \t\t$new[ $k ] = $value;\n \t\tif( $k === $key ) {\n\t\t\t\tforeach( $new_array as $new_key => $new_value ) {\n \t\t\t$new[ $new_key ] = $new_value;\n\t\t\t\t}\n \t\t}\n \t}\n \treturn $new;\n \t}\n\n \treturn $array;\n\n}", "function array_push_ex(array &$arr1,$arr2) {\n foreach ($arr2 as $key => $value) {\n $arr2[$key] = ($value);\n }\n array_push($arr1,$arr2);\n}", "public function unshift() {\n return function (...$value) {\n array_unshift($this->items, ...$value);\n };\n }", "protected function unshift($value)\n {\n array_unshift($this->items, $this->set($value));\n }", "function array_dot(array $array, $prepend = '') {\n $results = array();\n\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $results = array_merge($results, array_dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }", "public function prepend(...$items): self;", "function array_add(array &$array, $key, $value) {\n $target = array_get($array, $key, array());\n\n if ( ! is_array($target)) {\n $target = array($target);\n }\n\n $target[] = $value;\n array_set($array, $key, $target);\n\n return $array;\n }", "function array_dot($array, $prepend = '')\n\t{\n\t\t$results = array();\n\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\t$results = array_merge($results, array_dot($value, $prepend.$key.'.'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$results[$prepend.$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "protected function array_insert($array, $values, $offset)\n {\n return array_slice($array, 0, $offset, true) + $values + array_slice($array, $offset, null, true);\n }", "function array_insert(&$array, $offset, $object, $replace=false){\r\n \r\n if(is_array($array)){\r\n if($replace ){\r\n if($offset<0) $offset = 0;\r\n else if($offset > count($array)-1) $offset = count($array)-1;\r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset+1);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }else{ \r\n if($offset == 0){\r\n array_unshift($array, $object);\r\n }else if($offset >= count($array)){\r\n array_push($array, $object);\r\n }else{ \r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }\r\n }\r\n } \r\n }", "function arrayShift($array) {\n\n unset($array[0]);\n return $array;\n}", "public function unshift($value)\n {\n array_unshift($this->data, $value);\n\n return $this;\n }", "public function prepend($value, $key = null)\n {\n return parent::prepend($value, $key);\n $this->performHook('modified');\n return $this;\n }", "function concat(array $first, iterable ...$rest): array\n{\n $first = values($first);\n foreach ($rest as $arr) {\n foreach ($arr as $value) {\n $first[] = $value;\n }\n }\n\n return $first;\n}", "public function prepend($value) {\n $this->_value = $value . $this->_value;\n $this->countLength();\n \n return $this;\n }", "protected static function mergeBeforeKey(array $input, int $key, array $values = []): array\n {\n return array_merge(\n array_slice($input, 0, $key),\n $values,\n array_slice($input, $key)\n );\n }", "function array_insert(&$array,$element,$position=NULL) \n{\n\t if(count($array) == 0) \n\t\t{\n\t\t\t$array[] = $element;\n\t\t}\n\t \n\t elseif (is_numeric($position) && $position < 0)\n\t\t{\n\t\t\tif((count($array)+position) < 0) \n\t\t\t\t{\n\t\t\t\t\t$array = array_insert($array,$element,0);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$array[count($array)+$position] = $element;\n\t\t\t\t}\n\t \n\t\t}\n\t \n\t elseif (is_numeric($position) && isset($array[$position])) \n\t\t{\n\t\t\t$part1 = array_slice($array,0,$position,true);\n\t\t\t$part2 = array_slice($array,$position,null,true);\n\t\t\t$array = array_merge($part1,array($position=>$element),$part2);\n\t\t\t\n\t\t\tforeach($array as $key=>$item)\n\t\t\t{\n\t\t\t\tif (is_null($item))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($array[$key]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t elseif (is_null($position))\n\t\t {\n\t\t $array[] = $element;\n\t\t }\n\t elseif (!isset($array[$position]))\n\t\t {\n\t\t\t$array[$position] = $element;\n\t\t }\n\t\t\n\t\t$array = array_merge($array);\n\t\treturn $array;\n}", "function array_append( $dest, $source ) {\r\n $n = count( $dest );\r\n $n1 = count( $source );\r\n for ( $index=$n; $index<$n+$n1; $index++ ) {\r\n $dest[$index] = $source[$index-$n];\r\n }\r\n return $dest;\r\n}", "public function testPrepend()\n {\n $this->assertTrue($this->SerializedArray->prepend('first'));\n $this->assertEquals([\n 'first',\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend('second'));\n $this->assertEquals([\n 'second',\n 'first',\n ], $this->SerializedArray->read());\n\n safe_unlink($this->file);\n\n $this->assertTrue($this->SerializedArray->prepend(['first', 'second']));\n $this->assertEquals([\n ['first', 'second'],\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend(['third', 'fourth']));\n $this->assertEquals([\n ['third', 'fourth'],\n ['first', 'second'],\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend('string'));\n $this->assertEquals([\n 'string',\n ['third', 'fourth'],\n ['first', 'second'],\n ], $this->SerializedArray->read());\n }", "public function unshift($path)\n\t{\n\t\t$parts = AgaviArrayPathDefinition::getPartsFromPath($path);\n\t\t$this->parts = array_merge($parts['parts'], $this->parts);\n\t}", "static function insertBefore(&$array, $position, $insert)\n {\n if (is_int($position)) {\n array_splice($array, $position, 0, $insert);\n } else {\n $pos = array_search($position, array_keys($array));\n $array = array_merge(\n array_slice($array, 0, $pos),\n $insert,\n array_slice($array, $pos)\n );\n }\n }", "function insertArray( &$arr, $offset = 0, $value = '', $replace = false ){\n\n consoleLog( 'insertArray() is deprecated. Switching to arr_insert().' );\n consoleLog( debug_backtrace() );\n\n $arr = arr_insert( $arr, $offset, $value, $replace );\n}", "function ins2ary(&$ary, $element, $pos)\n{\n $ar1 = array_slice($ary, 0, $pos);\n $ar1[] = $element;\n $ary = array_merge($ar1, array_slice($ary, $pos));\n}", "public function unshift(...$values);", "public function unshift(...$values);", "function array_add(array $array, string $key, $value):array\n\t{\n\t\tif (is_null(get($array, $key)))\n\t\t{\n\t\t\tset($array, $key, $value);\n\t\t}\n\n\t\treturn $array;\n\t}", "function ArrayInsert( $array, $insert, $position ) {\n return array_slice($array, 0, $position, TRUE) + $insert + array_slice($array, $position, NULL, TRUE);\n}", "function util_array_merge_overwrite($array1, $array2)\n{\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$array1[$key] = $value ;\n\t}\n\treturn $array1 ;\n}", "public function prepend ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->insertBefore($value[0], $node->firstChild);\r\n\t\t\t\t\telse $node->insertBefore($value, $node->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public static function array_move_to_start ($array, $newFirstName)\r\n\t{\r\n\t\t# Check whether the array is associative\r\n\t\tif (self::isAssociativeArray ($array)) {\r\n\t\t\t\r\n\t\t\t# Extract the first item\r\n\t\t\t$firstItem[$newFirstName] = $array[$newFirstName];\r\n\t\t\t\r\n\t\t\t# Unset the item from the main array\r\n\t\t\tunset ($array[$newFirstName]);\r\n\t\t\t\r\n\t\t\t# Reinsert the item at the start of the main array\r\n\t\t\t$array = $firstItem + $array;\r\n\t\t\t\r\n\t\t# If not associative, loop through until the item is found, remove then reinsert it\r\n\t\t#!# This assumes there is only one instance in the array\r\n\t\t} else {\r\n\t\t\tforeach ($array as $key => $value) {\r\n\t\t\t\tif ($value == $newFirstName) {\r\n\t\t\t\t\tunset ($array[$key]);\r\n\t\t\t\t\tarray_unshift ($array, $newFirstName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Return the reordered array\r\n\t\treturn $array;\r\n\t}", "public static function prefixArray(array $array, $prefix) {\r\n\t\t$newArray\t= array();\r\n\r\n\t\tforeach($array as $key => $value) {\r\n\t\t\t$newArray[$prefix.$key] = $value;\r\n\t\t}\r\n\r\n\t\treturn $newArray;\r\n\t}", "function array_add($array, $key, $value)\n\t{\n\t\tif ( ! isset($array[$key])) $array[$key] = $value;\n\n\t\treturn $array;\n\t}", "function extend_array()\n\t{\n\t\t$args = func_get_args();\n\t\t$extended = array();\n\n\t\tif ( is_array( $args ) && count( $args ) )\n\t\t{\n\t\t\tforeach ( $args as $array )\n\t\t\t{\n\t\t\t\tif ( ! is_array( $array ) )\tcontinue;\n\t\t\t\t$extended = array_merge( $extended, $array );\n\t\t\t}\n\t\t}\n\n\t\treturn $extended;\n\t}", "function array_shift_over($array, $index) {\n\n $size = sizeof($array);\n if($index >= $size || $index < 0) {\n return $array;\n } else {\n for($i=$index;$i<$size;$i++) {\n if($i === ($size-1)) {\n unset($array[$i]);\n } else {\n $array[$i] = $array[$i+1];\n }\n }\n }\n return $array;\n}", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "public function arrayInsertBeforeKey(\n $origin = [],\n $wantedKey = '',\n $insert = []\n ) {\n $availableKeys = array_keys($origin);\n $position = array_search($wantedKey, $availableKeys);\n if ($position === false) {\n $position = count($origin);\n }\n\n $derivative = array_merge(\n array_slice($origin, 0, $position),\n $insert,\n array_slice($origin, $position)\n );\n\n return $derivative;\n }", "function ins2ary(&$ary, $element, $pos) {\n\t $ar1=array_slice($ary, 0, $pos); $ar1[]=$element;\n\t $ary=array_merge($ar1, array_slice($ary, $pos));\n\t}", "public function array_push_assoc($array, $key, $value)\n {\n $array[$key] = $value;\n return $array;\n }", "public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }", "function tmall_array_dot($array, $prepend = '')\n {\n $results = [];\n foreach ($array as $key => $value) {\n if (is_array($value) && !empty($value)) {\n $results = array_merge($results, tmall_array_dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n return $results;\n }", "public function prepend(string $key, $value)\n {\n // TODO: Implement prepend() method.\n }", "static function ensure(&$array, $value){\n\t\tif(array_search($value, $array) === false){\n\t\t\t$array[] = $value;\n\t\t}\n\t\treturn $array;\n\t}", "function array_dot($array, $prepend = '')\n {\n return Arr::dot($array, $prepend);\n }", "function array_dot($array, $prepend = '')\n {\n return Arr::dot($array, $prepend);\n }", "public function unshift($value) {\n\t\treturn $this->insert($value, 0);\n\t}", "public function prepend($region, $value)\n {\n return $this->appendOrPrepend($region, $value, 'prepend');\n }", "function array_push_assoc($array, $key, $value){\n $array[$key] = $value;\n return $array;\n }", "public static function array_insert_after($key, array &$array, $new_key, $new_value) {\n if (array_key_exists ($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n $new[$k] = $value;\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n }\n return $new;\n }\n return $array;\n }", "function array_add($array, $key, $value)\n{\n if (!isset($array[$key])) {\n $array[$key] = $value;\n }\n\n return $array;\n}", "public static function prepend($middleware)\n {\n if (is_array($middleware)) {\n foreach ($middleware as $mw) {\n static::prepend($mw);\n }\n }\n\n if (array_search($middleware, static::$middleware) === false) {\n array_unshift(static::$middleware, $middleware);\n }\n }", "public function actions_prepend($this_player, $this_robot, $target_player, $target_robot, $this_action, $this_action_token){\n\n // Prepend the new action to the array\n array_unshift($this->actions, array(\n 'this_field' => $this->battle_field,\n 'this_player' => $this_player,\n 'this_robot' => $this_robot,\n 'target_player' => $target_player,\n 'target_robot' => $target_robot,\n 'this_action' => $this_action,\n 'this_action_token' => $this_action_token\n ));\n\n // Return the resulting array\n return $this->actions;\n\n }", "function array_dot($array, $prepend = '')\n {\n return ArrayHelper::dot($array, $prepend);\n }", "public function prepend($section){\n\t\t$body = $this->toArray();\n\t\t$_section = $this->get($section);\n\t\t$temp_body = [];\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key != $section){\n\t\t\t\tif($i == 0){\n\t\t\t\t\t$temp_body[$section] = $_section;\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$this->updateFile($temp_body);\n\t}", "function array_extend($array1, $array2){\n $array1 = (is_array($array1)) ? $array1 : array();\n $array2 = (is_array($array2)) ? $array2 : array();\n foreach($array2 as $k=>$v){\n if (is_array($v) && is_associative_array($v)){\n if(!isset($array1[$k])) $array1[$k] = $v;\n else $array1[$k] = array_extend($array1[$k], $v);\n } else {\n if(is_array($v)){\n if (isset($array1[$k]) && is_array($array1[$k])) $array1[$k] = array_merge($array1[$k], $v);\n else $array1[$k] = $v;\n } else $array1[$k] = $v;\n }\n }\n return $array1;\n}", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "function array_prefix_keys(string $prefix, array $array): array\n{\n if (is_numeric_array($array)) {\n return $array;\n }\n\n $result = [];\n foreach ($array as $key => $value) {\n $result[$prefix . $key] = $value;\n }\n return $result;\n}", "public function createArrayFromAnotherArrayWhileOmittingEmptyValues($array = array()){\n\n $new_array = array();\n if(count($array) > 0){\n\n foreach($array as $key => $value){\n if(!empty($value)){\n $new_array[] = $value;\n }\n }\n\n }\n\n return $new_array;\n\n }", "function arrayReplace()\n {\n $a = func_get_args();\n // Do not make this reference,\n // it helpful if you just pass pure array without assign.\n $new = $a[0];\n if (!isArray($new)) {\n return triggerJson(\n '\\PMVC\\arrayReplace Param1 should be array type.',\n ['Array' => $new]\n );\n }\n for ($i = 1, $j = count($a); $i < $j; $i++) {\n // This is for handle empty array not empty value\n if (is_null($a[$i])) {\n continue;\n }\n if (!isArray($a[$i])) {\n $new[] = $a[$i];\n } else {\n foreach ($a[$i] as $k => $v) {\n $new[$k] = $v;\n }\n }\n }\n\n return $new;\n }", "public function prependItem($item, $key=null): CollectionInterface;", "public function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function prepend($item) {\r\n return Match::on($item)\r\n ->ListM(function($list) {\r\n return new self(array_merge($list->value(), $this->list));\r\n })\r\n ->any(function($item) {\r\n return new self(array_merge([$item], $this->list));\r\n })\r\n ->value(); \r\n }", "public function prepend($data, $namespace='default')\n {\n Type::force($data, ArrayAccess::class);\n\n if (!isset($this->addedData[$namespace])) {\n $this->addedData[$namespace] = [];\n }\n\n array_unshift($this->addedData[$namespace], $data);\n\n return $this;\n }", "public static function prependToIncludePath($path)\r\n {\r\n $paths=array();\r\n foreach (func_get_args() as $arg) {\r\n if (is_array($arg)) $paths=array_merge($paths, $arg);\r\n else $paths[]=$arg;\r\n }\r\n $paths[]=get_include_path();\r\n return self::setIncludePath($paths);\r\n }" ]
[ "0.824486", "0.8198338", "0.80102855", "0.75249577", "0.7500424", "0.7308498", "0.7224125", "0.7217231", "0.7143761", "0.7122985", "0.6857518", "0.682815", "0.67646223", "0.66396856", "0.6598507", "0.64426047", "0.64299524", "0.63584507", "0.6327717", "0.6308613", "0.62941426", "0.62461394", "0.622624", "0.621692", "0.6159515", "0.6148473", "0.6125088", "0.6080204", "0.6040827", "0.60091186", "0.6000548", "0.5965407", "0.5964446", "0.5954251", "0.59184414", "0.58951473", "0.58910143", "0.5888768", "0.5866559", "0.5845767", "0.58360267", "0.58216566", "0.58025897", "0.5791816", "0.57856476", "0.5772488", "0.57718086", "0.5724375", "0.5709109", "0.57062507", "0.5703486", "0.5695058", "0.5655209", "0.5642585", "0.56217325", "0.5617379", "0.56097895", "0.5605952", "0.5602951", "0.55925065", "0.55925065", "0.5584256", "0.55561525", "0.55299664", "0.55153084", "0.55077696", "0.54936713", "0.548721", "0.54676753", "0.54567116", "0.54401517", "0.54401517", "0.54401195", "0.5413239", "0.5409824", "0.539934", "0.53867555", "0.5381664", "0.5357319", "0.535264", "0.535264", "0.53513336", "0.5347469", "0.53373224", "0.5315326", "0.5306474", "0.5305858", "0.52940744", "0.5293693", "0.5275894", "0.5271385", "0.52614194", "0.52599204", "0.5253836", "0.5226708", "0.5222378", "0.5215868", "0.52156", "0.51923907", "0.51734126" ]
0.86719376
0
Extracts data from an array. The array can be a multidimensional array or an array of objects, and the property may thus be an array index, property name or even, with the function parameter set, a class method to call for result
Извлекает данные из массива. Массив может быть многомерным массивом или массивом объектов, и соответственно, свойство может быть индексом массива, именем свойства или даже, при настройке параметров функции, методом класса, который вызывается для получения результата.
function arrayExtract($array, $property, $keep_keys = false, $function=false) { $r = array(); foreach($array as $key => $a) { if(is_object($a)) { if($keep_keys) { if($function && method_exists($a, $property)) { $r[$key] = $a->$property(); } else { $r[$key] = @$a->$property; } } else { if($function && method_exists($a, $property)) { $r[] = $a->$property(); } else { $r[] = @$a->$property; } } } elseif(isset($a[$property])) { if($keep_keys) { $r[$key] = $a[$property]; } else { $r[] = $a[$property]; } } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function extractInArray(array $array);", "protected static function getPropertyFromArray(array $dataArray, string $property, array $subProperties = [])\n {\n\n if (isset($dataArray[$property])) {\n\n if (is_array($dataArray[$property])) {\n\n self::getPropertiesFromArray($dataArray[$property], $subProperties);\n\n } else {\n\n if (is_bool($dataArray[$property])) {\n return intval($dataArray[$property]);\n\n } else {\n return $dataArray[$property];\n }\n }\n }\n\n return null;\n }", "abstract function extract(): array;", "public function getProperties(array &$properties);", "private function extract_array($array)\n\t{\n\t\t// but extracts to member variables, and performs removal of DB escaped\n\t\t// characters \n\t\tforeach($array as $key => $value)\n\t\t{\n\t\t\t$this->$key = IOSystem::DBUnencode($value);\n\t\t}\n\t}", "function array_pluck(array $array, $field) {\n\t$final = array();\n\tforeach($array as $v) {\n\t\t$final[] = $v[$field];\n\t}\n\treturn $final;\n}", "function grabContents( $array, $field, $sub ){\n\t\n\t$value = $array[$field][$sub];\n\t\n\treturn $value;\t\n}", "public static function getValue($array, $key)\n\t{\n\t\t$keys = explode(\"->\", $key);\n\t\tforeach ($keys as $k) {\n\t\t\tif (is_array($array) && isset($array[$k])) {\n\t\t\t\t$array = $array[$k];\n\t\t\t} else if (is_object($array) && property_exists($array, $k)) {\n\t\t\t\t$array = $array->$k;\n\t\t\t} else {\n\t\t\t\t$array = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "private function & refArrayItemByPath(& $array)\n\t{\n\t\t$p = & $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (!isset($p[$kk])) {\n\t\t\t\t\t\t$p[$kk] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$p = & $p[$kk];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($p[$k])) {\n\t\t\t\t\t$p[$k] = array();\n\t\t\t\t}\n\t\t\t\t$p = & $p[$k];\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}", "public function extract(array $params);", "private function get_object_array($array){\n \n }", "function GetField($arr, $field)\n{\n $result = array();\n for ($i = 0; $i < count($arr); $i ++)\n array_push($result, $arr[$i][$field]);\n return $result;\n}", "function array_pluck($array, $value, $key = null)\n\t{\n\t\t$results = array();\n\n\t\tforeach ($array as $item)\n\t\t{\n\t\t\t$itemValue = is_object($item) ? $item->{$value} : $item[$value];\n\n\t\t\t// If the key is \"null\", we will just append the value to the array and keep\n\t\t\t// looping. Otherwise we will key the array using the value of the key we\n\t\t\t// received from the developer. Then we'll return the final array form.\n\t\t\tif (is_null($key))\n\t\t\t{\n\t\t\t\t$results[] = $itemValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$itemKey = is_object($item) ? $item->{$key} : $item[$key];\n\n\t\t\t\t$results[$itemKey] = $itemValue;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "function get_array_value($arr, $props = array()) {\n\tif ($arr == null) {\n\t\treturn null;\n\t}\n\n\tforeach($props as $prop) {\n\t\tif (array_key_exists($prop, $arr)) {\n\t\t\t$arr = $arr[$prop];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn $arr;\n}", "protected function getDataArray() {\n trace('[METHOD] '.__METHOD__);\n\n\t\t$dataArray = array();\n\n\t\tforeach (get_class_vars( __CLASS__ ) as $propertyname => $pvalue) {\n\t\t\t$getter = 'get_'.$propertyname;\n\t\t\t$dataArray[$propertyname] = $this->$getter();\n\t\t}\n\n\t\treturn $dataArray;\n\t}", "function pluck($field, array $array) {\n return array_column($array,$field);\n }", "private function extractFromAccessor($class, $property)\n {\n list($reflectionMethod, $prefix) = $this->getAccessorMethod($class, $property);\n if (null === $reflectionMethod) {\n return;\n }\n\n if ($this->supportsParameterType && $reflectionType = $reflectionMethod->getReturnType()) {\n return array($this->extractFromReflectionType($reflectionType));\n }\n\n if (in_array($prefix, array('is', 'can'))) {\n return array(new Type(Type::BUILTIN_TYPE_BOOL));\n }\n }", "public function parseGetData(array $data) {\n return $data;\n }", "abstract public function array2Data($arr);", "static function objExtractOneKey($arr, $key)\n\t{\n\t\t$new = [];\n\t\tforeach($arr as $itm)\n\t\t\t$new[] = $itm->$key;\n\t\t\n\t\treturn $new;\n\t}", "static function pluck(array $array, $value, $key = null) {\n $ret = [];\n\n foreach ($array as $item) {\n $itemValue = is_object($item) ? $item->{$value} : $item[$value];\n\n if (null === $key) {\n $ret[] = $itemValue;\n } else {\n $itemKey = is_object($item) ? $item->{$key} : $item[$key];\n $ret[$itemKey] = $itemValue;\n }\n }\n\n return $ret;\n }", "function get(array $data) {\n\t\t$values = [];\n\t\tforeach ($data as $key) {\n\t\t\t$values[$key] = $this->$key ?? null;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function __invoke() : array;", "public function __invoke() : array;", "abstract public function getArray();", "public static function getBy($array) {\n return parent::getBy($array);\n }", "protected static function getPropertiesFromArray(array $dataArray, array $propertyArray): array\n {\n $result = [];\n foreach ($propertyArray as $property => $subProperties) {\n\n // if there are no sub-properties to fetch\n if (\n (is_numeric($property))\n && (! is_array($subProperties))\n ){\n $property = $subProperties;\n unset($subProperties);\n }\n\n $result[$property] = self::getPropertyFromArray($dataArray, $property, $subProperties);\n }\n\n return $result;\n }", "private function dataConvert($array)\n {\n $result = false;\n if(count($array) && isset($array[0]) && is_array($array[0]))\n {\n $class = get_class($this);\n foreach($array as $arr)\n {\n $result[] = new $class((int) $arr[$this->primaryName]);\n }\n }\n else if(count($array))\n {\n $class = get_class($this);\n $result = new $class((int) $array[$this->primaryName]);\n }\n return $result;\n }", "private function extractFromMutator($class, $property)\n {\n list($reflectionMethod, $prefix) = $this->getMutatorMethod($class, $property);\n if (null === $reflectionMethod) {\n return;\n }\n\n $reflectionParameters = $reflectionMethod->getParameters();\n $reflectionParameter = $reflectionParameters[0];\n\n if ($this->supportsParameterType) {\n if (!$reflectionType = $reflectionParameter->getType()) {\n return;\n }\n $type = $this->extractFromReflectionType($reflectionType);\n\n // HHVM reports variadics with \"array\" but not builtin type hints\n if (!$reflectionType->isBuiltin() && Type::BUILTIN_TYPE_ARRAY === $type->getBuiltinType()) {\n return;\n }\n } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\\x7F-\\xFF][^ ]++)/', $reflectionParameter, $info)) {\n if (Type::BUILTIN_TYPE_ARRAY === $info[1]) {\n $type = new Type(Type::BUILTIN_TYPE_ARRAY, $reflectionParameter->allowsNull(), null, true);\n } elseif (Type::BUILTIN_TYPE_CALLABLE === $info[1]) {\n $type = new Type(Type::BUILTIN_TYPE_CALLABLE, $reflectionParameter->allowsNull());\n } else {\n $type = new Type(Type::BUILTIN_TYPE_OBJECT, $reflectionParameter->allowsNull(), $info[1]);\n }\n } else {\n return;\n }\n\n if (in_array($prefix, self::$arrayMutatorPrefixes)) {\n $type = new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), $type);\n }\n\n return array($type);\n }", "function offsetGet(/*. mixed .*/ $object_){}", "public function testGetReturnsValueFromArrayBySinglePath()\n {\n $array = ['a' => 1];\n $actual = $this->property->get($array, 'a');\n $this->assertEquals(1, $actual);\n }", "public function extract(array $data)\n\t{\t\t\n\t\t$result = array();\n\t\tforeach ($this->_fields as $f)\n\t\t{\n\t\t\t$result[$f] = null;\n\t\t\tif (array_key_exists($f, $data))\n\t\t\t{\n\t\t\t\t$result[$f] = $data[$f];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "private function getArrayItemByPath($array)\n\t{\n\t\t$p = $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (isset($p[$kk])) {\n\t\t\t\t\t\t$p = $p[$kk];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($p[$k])) {\n\t\t\t\t\t$p = $p[$k];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}", "public static function pluck($array, $value, $key = null)\n {\n $results = [];\n\n list($value, $key) = self::explodePluckParameters($value, $key);\n\n $func = is_object($array) ? 'object_get' : 'get';\n\n foreach ($array as $item) {\n $itemValue = self::$func($item, $value);\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key)) {\n $results[] = $itemValue;\n } else {\n $itemKey = self::$func($item, $key);\n\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "public static function extract(array $array, string $column): array\n {\n if (empty($array)) {\n return [];\n }\n\n $values = array_map(\n fn ($item) => self::getProperty($item, $column),\n $array\n );\n\n $values = array_filter(\n array_unique($values),\n fn ($item) => $item !== null\n );\n\n return array_values($values);\n }", "public static function pluck($array, $value, $key = null)\n {\n $results = array();\n\n foreach ($array as $item) {\n $itemValue = is_object($item) ? $item->{$value} : $item[$value];\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key)) {\n $results[] = $itemValue;\n } else {\n $itemKey = is_object($item) ? $item->{$key} : $item[$key];\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "function getArrayProperty($object, $name) {\r\n\r\n\r\n\t}", "private function _getValue( $arr, $field = 1 ) {\n\t\t$data\t= explode( ':', $arr );\n\t\treturn $data[$field];\n\t}", "private function pluck($a, $prop) {\r\n $out = array();\r\n for ($i = 0, $len = count($a); $i < $len; $i++) {\r\n $out[] = $a[$i][$prop];\r\n }\r\n return $out;\r\n }", "function array_pluck($array, $column) {\n\treturn array_map(function($obj) use ($column) {\n\t\treturn $obj[$column];\n\t}, $array);\n}", "function getData()\n{\n return array(\n array(\"name\"=>\"Bob\",\"age\"=>50),\n array(\"name\"=>\"Jane\",\"age\"=>41),\n array(\"name\"=>\"Sarah\",\"age\"=>30)\n );\n}", "public function offsetGet($key): mixed\n {\n if (is_array($this->_data)) {\n return $this->out($this->_data[$key], $key, 'array');\n } elseif ($this->_data instanceof \\ArrayAccess) {\n return $this->out($this->_data[$key], $key, 'array');\n } else {\n throw new \\Exception('Cannot use object of type ' . get_class($this->_data) . ' as array');\n }\n }", "function pluck(array $objects, $property) {\r\n\t$properties = array();\r\n\t\r\n\tforeach ($objects as $object) {\r\n\t\t$properties[] = $object->{$property};\r\n\t}\r\n\t\r\n\treturn $properties;\r\n}", "public function getArray($prop) {\n\n\t\t\t// Get property\n\t\t\t$val = $this->get($prop);\n\n\t\t\t// Parse as a string\n\t\t\tif (is_array($val)) {\n\t\t\t\treturn $val;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}", "public static function byArray(array $array) {}", "public static function pluck( $array, $value, $key = null )\n {\n $results = [];\n\n list( $value, $key ) = static::explodePluckParameters( $value, $key );\n\n foreach ( $array as $item ) {\n $itemValue = data_get( $item, $value );\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if ( is_null( $key ) ) {\n $results[] = $itemValue;\n } else {\n $itemKey = data_get( $item, $key );\n\n if ( is_object( $itemKey ) && method_exists( $itemKey, '__toString' ) ) {\n $itemKey = (string)$itemKey;\n }\n\n $results[ $itemKey ] = $itemValue;\n }\n }\n\n return $results;\n }", "static function build(array $array, callable $callback) {\n $ret = [];\n\n foreach ($array as $key => $value) {\n list($innerKey, $innerValue) = $callback($key, $value);\n $ret[$innerKey] = $innerValue;\n }\n\n return $ret;\n }", "abstract protected function buildPropertyMapArray(array $array, PropertyMap $propertyMap);", "protected abstract function getData(): array;", "function __get($property) {\n if(isset($this->DATA[$property])) {\n if(@$this->TYPE[$property] == 'CSV' && @is_string($this->DATA[$property]))\n $val = explode(',', @$this->DATA[$property]);\n else $val = @$this->DATA[$property];\n\n return $val;\n }\n }", "public function arrayToObject($array): static;", "private function parseobject($array)\n {\n if (is_object($array)) {\n if (get_class($array) == 'DataObject') {\n return $array;\n }\n $do = DataObject::create();\n foreach (get_object_vars($array) as $key => $obj) {\n if ($key == '__Type') {\n $do->setField('Title', $obj);\n } elseif (is_array($obj) || is_object($obj)) {\n $do->setField($key, $this->parseobject($obj));\n } else {\n $do->setField($key, $obj);\n }\n }\n return $do;\n } elseif (is_array($array)) {\n $dataList = ArrayList::create();\n foreach ($array as $key => $obj) {\n $dataList->push($this->parseobject($obj));\n }\n return $dataList;\n }\n return null;\n }", "public function extracting($arg) {\n if ($arg instanceof \\Closure) {\n return self::of($arg($this->value));\n } else if (is_array($arg)) {\n $value= [];\n foreach ($arg as $key => $extract) {\n $value[$key]= $this->extracting($extract)->value;\n }\n return self::of($value);\n } else {\n return self::of((new InstanceExtractor($this->value))->extract($arg));\n }\n }", "private static function extractFileData($file, $property = NULL) {\n\t\tinclude_once ABSPATH . \"/wp-admin/includes/plugin.php\";\n\t\t\n\t\t$data = @get_plugin_data($file);\n\t\t\n\t\tif (!is_null($property))\n\t\t\treturn @$data[$property];\n\t\t\t\n\t\treturn $data;\n\t}", "function astar( $array, $prop, $default = null ) {\n\t\treturn astra_get_prop( $array, $prop, $default );\n\t}", "public static function item($array, $name)\n {\n if (($array != null) && (strlen($name) > 0))\n {\n if (is_array($array))\n return array_key_exists($name, $array) ? $array[$name] : null;\n if (is_object($array))\n return property_exists($array, $name) ? $array->$name : null;\n }\n return null;\n }", "protected function hydrate($array){\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t$methodName = 'set'.ucfirst($key);\r\n\t\t\tif(method_exists($this, $methodName)){\r\n\t\t\t\t$this->$methodName($value);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "function element($key, $array)\n{\n\treturn $array[$key];\n}", "function fnGet(&$array, $key, $default = null, $separator = '/')\n{\n if (($sub_key_pos = strpos($key, $separator)) === false) {\n if (is_object($array)) {\n return property_exists($array, $key) ? $array->$key : $default;\n }\n return isset($array[$key]) ? $array[$key] : $default;\n } else {\n $first_key = substr($key, 0, $sub_key_pos);\n if (is_object($array)) {\n $tmp = property_exists($array, $first_key) ? $array->$first_key : null;\n } else {\n $tmp = isset($array[$first_key]) ? $array[$first_key] : null;\n }\n return fnGet($tmp, substr($key, $sub_key_pos + 1), $default, $separator);\n }\n}", "public abstract function FetchArray();", "function getArray();", "function array_get($key, $array)\n {\n return arr::get($key, $array);\n }", "function arr($array) {\n if (is_array($array)) {\n return new Arr($array);\n }\n return $array;\n}", "public function offsetGet($offset): mixed;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getFiltred(array &$data);", "public static function build($array, callable $callback)\n {\n $results = [];\n\n foreach ($array as $key => $value)\n {\n list($innerKey, $innerValue) = call_user_func($callback, $key, $value);\n\n $results[$innerKey] = $innerValue;\n }\n\n return $results;\n }", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "public static function getColumn(array $arr,$attribute){\n $column=array();\n foreach($arr as $one){\n if(is_array($one)){\n $column[]=$one[$attribute];\n }else{\n $column[]=$one->{$attribute};\n }\n }\n return $column;\n }", "public function getData() : array;", "public function getData() : array;", "function &offsetGet($offset) {\n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n\n if(is_array($this->{$property}) && isset($this->{$property}[$offset])) {\n return $this->{$property}[$offset];\n }\n\n $none = null;\n return $none;\n }", "public function get(string $key, array $array)\n {\n $keys = explode('.', $key);\n\n foreach ($keys as $ikey) {\n $array = $array[$ikey];\n }\n\n return $array;\n }", "public function offsetGet($offset)\n\t{\n\t\tif(isset(self::$arrayMap[$offset])) {\n\t\t\treturn $this->{self::$arrayMap[$offset]};\n\t\t}\n\t}", "function toArray($objects, $valueMethod, $keyMethod = null)\n{\n $results = [];\n\n foreach ($objects as $object) {\n $value = call_user_func([$object, $valueMethod]);\n if (null !== $keyMethod) {\n $key = call_user_func([$object, $keyMethod]);\n\n $results[$key] = $value;\n } else {\n $results[] = $value;\n }\n }\n\n return $results;\n}", "public function offsetGet($offset)\n {\n return $this->array[$offset];\n }", "public static function build($array, callable $callback)\n {\n $results = [];\n\n foreach ($array as $key => $value) {\n list($innerKey, $innerValue) = call_user_func($callback, $key, $value);\n\n $results[$innerKey] = $innerValue;\n }\n\n return $results;\n }", "public static function pluck($array, $value, $key = null)\n\t{\n\t\t$results = [];\n\n\t\tforeach ($array as $item)\n\t\t{\n\t\t\t$itemValue = static::dataGet($item, $value);\n\n\t\t\t// If the key is \"null\", we will just append the value to the array and keep\n\t\t\t// looping. Otherwise we will key the array using the value of the key we\n\t\t\t// received from the developer. Then we'll return the final array form.\n\t\t\tif (is_null($key))\n\t\t\t{\n\t\t\t\t$results[] = $itemValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$itemKey = static::dataGet($item, $key);\n\n\t\t\t\t$results[$itemKey] = $itemValue;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getVDefValues(array $array, $caller = NULL, $arrayKey = NULL) {\n\t\tif ($caller === NULL) {\n\t\t\t$caller = $this;\n\t\t}\n\t\tforeach($array as $key => $value) {\n\t\t\tif ($key === 'vDEF') {\n\t\t\t\t$caller->temporaryDceProperties[substr($arrayKey, 9)] = $value;\n\t\t\t}\n\t\t\telseif (is_array($value) && array_key_exists('el', $value)) {\n\t\t\t\t$propertyName = substr($key, 9);\n\t\t\t\t$values = array();\n\t\t\t\t$i = 1;\n\t\t\t\tif (is_array(current($value))) {\n\t\t\t\t\tforeach (current($value) as $entry) {\n\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t$entry = $entry['container_' . $propertyName]['el'];\n\t\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t\tforeach($entry as $k => $v) {\n\t\t\t\t\t\t\t\t\t$entry[$k] = $v['vDEF'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$values[$i++] = array('container_' . $propertyName => $entry);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$caller->temporaryDceProperties[$propertyName] = $values;\n\t\t\t} elseif (is_array($value)) {\n\t\t\t\t$this->getVDefValues($value, $caller, $key);\n\t\t\t}\n\t\t}\n\t}", "function array_pluck($array, $column) {\n return array_map(function($obj) use ($column) {\n return isset($obj[$column]) ? $obj[$column] : null;\n }, $array);\n}", "private function arrayWalk(array $array, $function)\n {\n array_walk($array, $function);\n\n return $array;\n }", "protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed\n {\n if ($propertyOrMethod === null) {\n return $element;\n }\n\n if (!is_object($element) && !is_array($element)) {\n throw new UnsupportedOperationException(sprintf(\n 'The collection type \"%s\" does not support the $propertyOrMethod parameter',\n $this->getType(),\n ));\n }\n\n if (is_array($element)) {\n return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf(\n 'Key or index \"%s\" not found in collection elements',\n $propertyOrMethod,\n ));\n }\n\n if (property_exists($element, $propertyOrMethod)) {\n return $element->$propertyOrMethod;\n }\n\n if (method_exists($element, $propertyOrMethod)) {\n return $element->{$propertyOrMethod}();\n }\n\n throw new InvalidPropertyOrMethod(sprintf(\n 'Method or property \"%s\" not defined in %s',\n $propertyOrMethod,\n $element::class,\n ));\n }", "public function offsetGet($offset)\n\t{\n\t\t$data = $this->getData();\n\t\treturn $data[$offset];\n\t}", "abstract public function getFieldData(): array;", "public function getDataByMultiKey() {\n $val = json_decode($this, true);\n for ($i = 0; $i < func_num_args(); $i++) {\n $valid = false; //assume response is not valid unless the ith argument is found\n if (isset($val[func_get_arg($i)])) {\n $val = $val[func_get_arg($i)];\n $valid = true;\n }\n }\n if ($valid) {\n return $val;\n }\n else {\n return null;\n }\n return null;\n }", "function populateFromArray(array $arr);", "function populateFromArray(array $arr);", "public function calculate(array $data);", "function getFirstElement($array){\n\n /*\n * convert object to array first\n */\n\n if(is_object($array)){\n $array = (array) $array;\n }\n\n\n /*\n * check if this array is\n * php array\n */\n\n if(is_array($array)){\n return getElement($array);\n }\n\n /*\n * if json array\n * check if json is valid\n * and decode the array\n */\n\n $array = jsonDecode($array);\n\n /*\n * return with the first element\n */\n\n return getElement($array);\n\n}", "private function readProperty($zval, $property)\n {\n if (!is_object($zval[self::VALUE])) {\n throw new NoSuchPropertyException(sprintf('Cannot read property \"%s\" from an array. Maybe you intended to write the property path as \"[%s]\" instead.', $property, $property));\n }\n\n $result = self::$resultProto;\n $object = $zval[self::VALUE];\n $access = $this->getReadAccessInfo(get_class($object), $property);\n\n if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();\n } elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]};\n\n if ($access[self::ACCESS_REF] && isset($zval[self::REF])) {\n $result[self::REF] = &$object->{$access[self::ACCESS_NAME]};\n }\n } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {\n // Needed to support \\stdClass instances. We need to explicitly\n // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if\n // a *protected* property was found on the class, property_exists()\n // returns true, consequently the following line will result in a\n // fatal error.\n\n $result[self::VALUE] = $object->$property;\n if (isset($zval[self::REF])) {\n $result[self::REF] = &$object->$property;\n }\n } elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {\n // we call the getter and hope the __call do the job\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();\n } else {\n throw new NoSuchPropertyException($access[self::ACCESS_NAME]);\n }\n\n // Objects are always passed around by reference\n if (isset($zval[self::REF]) && is_object($result[self::VALUE])) {\n $result[self::REF] = $result[self::VALUE];\n }\n\n return $result;\n }", "function pluck($col, $array)\n{\n $res = array();\n foreach ($array as $k => $row) {\n $res[$k] = $row[$col];\n }\n return $res;\n}", "public static function getColumn(array $array, $index)\n {\n $result = array();\n \n foreach ($array as $item)\n {\n if (is_array($item) && isset($item[$index]))\n {\n $result[] = $item[$index];\n }\n elseif (is_object($item) && isset($item->$index))\n {\n $result[] = $item->$index;\n }\n }\n \n return $result;\n }", "public static function getProperties(array $element) {\n $properties = [];\n foreach ($element as $key => $value) {\n if (Element::property($key)) {\n $properties[$key] = $value;\n }\n }\n return $properties;\n }", "public static function getProp($array, $propName){\n\t\tif (empty($array[\"$propName\"]))\n\t\t\treturn \"\";\n\t\telse\n\t\t\treturn trim(stripslashes($array[\"$propName\"]));\n\t}", "private function ArrayToGet($array, $switch) {\r\n if ($switch == Constans::PART_HEAD) {\r\n $this->_title = $array[Constans::ELEMENT_TITLE];\r\n $this->_keywords = \"\";\r\n foreach ($array[Constans::ELEMENT_KEYWORDS] as $value) {\r\n if ($value != end($array[Constans::ELEMENT_KEYWORDS])) {\r\n $this->_keywords .= $value . \", \";\r\n } else {\r\n $this->_keywords .= $value;\r\n }\r\n }\r\n $this->_description = $array[Constans::ELEMENT_DESCRIPTION];\r\n }\r\n }" ]
[ "0.6166735", "0.6165866", "0.6084929", "0.6055655", "0.581391", "0.5744903", "0.56974685", "0.56848854", "0.56456816", "0.56347746", "0.5617737", "0.5583763", "0.55718195", "0.55344975", "0.5528535", "0.5523481", "0.5517173", "0.54748124", "0.54574895", "0.5422146", "0.5420832", "0.5381141", "0.53599155", "0.53599155", "0.5349525", "0.5348595", "0.5329629", "0.5326211", "0.53236175", "0.53232044", "0.53191304", "0.5297912", "0.52839386", "0.52772367", "0.52601856", "0.52496284", "0.5224369", "0.5220653", "0.5209838", "0.52090186", "0.5188919", "0.51861095", "0.5150166", "0.5149416", "0.5116556", "0.5084149", "0.5079652", "0.50751543", "0.50707465", "0.5069787", "0.5065978", "0.5060975", "0.50576895", "0.5054725", "0.5052893", "0.5044521", "0.5039217", "0.5029054", "0.50238717", "0.5016446", "0.500295", "0.49964663", "0.49949956", "0.49945801", "0.49895185", "0.49867532", "0.49867532", "0.49867532", "0.49867532", "0.49832433", "0.49810484", "0.4967768", "0.4967768", "0.4964034", "0.496392", "0.496392", "0.4959962", "0.49579328", "0.49563706", "0.49551597", "0.49549332", "0.49530947", "0.49422562", "0.49396807", "0.4933922", "0.4931781", "0.49300694", "0.49233544", "0.49221426", "0.49140406", "0.49135295", "0.49135295", "0.49128053", "0.49125934", "0.48991457", "0.48915714", "0.48914605", "0.48832634", "0.4875508", "0.48731866" ]
0.7064305
0
Sort an array of objects according to a given property
Сортировать массив объектов в соответствии с заданным свойством
function propsort(&$array, $property) { uasort($array, create_function('$a,$b','return strcmp($a->'.$property.', $b->'.$property.');')); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectSorter(&$array, $props){\n if(!is_array($props)) $props = array($props => true); \n\t\t$function = '$props=unserialize(\\''.trim(serialize($props)).'\\');\n\t\t\t\tforeach($props as $prop => $ascending) { \n\t\t\t\t\tif($a->$prop != $b->$prop) { \n\t\t\t\t\t\tif($ascending==\"ASC\") return ($a->$prop > $b->$prop) ? 1 : -1; \n\t\t\t\t\t\telse return ($b->$prop > $a->$prop) ? 1 : -1; \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t\treturn -1;';\n usort($array, create_function('$a,$b', $function) );\n\t}", "public static function sort(&$array, $orderBy) {\n $new_array = array();\n foreach ($array as $key => $obj) {\n $new_array[$key] = get_object_vars($obj->getEntity());\n $obj->hash = $new_array[$key]['hash'] = spl_object_hash($obj);\n }\n\n $new_array = self::sort_array_multidim($new_array, $orderBy);\n\n $output = array();\n foreach ($new_array as $key => $value) {\n\n }\n print_r($new_array);\n }", "private function osort(&$oarray, $props)\n {\n usort(\n $oarray\n , create_function(\n '$a,$b'\n ,'if($a->' . $props . '== $b->' . $props .'){\n return 0;\n }\n else {\n return ($a->' . $props . '< $b->' . $props .') ? -1 : 1;\n }'\n )\n );\n }", "protected function _sortByArray($array) {}", "public function sortByProp($array, $propertyName)\n\t{\n\t\t$sorted = [];\n\n\t\tforeach ($array as $item)\n\t\t\t$sorted[$item[$propertyName]][] = $item;\n\n\t\tksort($sorted);\n\t\t$result = [];\n\n\t\tforeach ($sorted as $subArray) \n\t\t\tforeach ($subArray as $item)\n\t\t\t\t$result[] = $item;\n\n\t\treturn $result;\n\t}", "public function asort() {}", "function array_sort_by(&$array_initial, $col, $order = SORT_ASC){\n\n $arrAux = array();\n\n foreach ($array_initial as $key=> $row){\n $arrAux[$key] = is_object($row) ? $arrAux[$key] = $row->$col : $row[$col];\n $arrAux[$key] = strtolower($arrAux[$key]);\n }\n\n array_multisort($arrAux, $order, $array_initial);\n }", "public function mySort(array $array);", "function ldap_sort_by (&$array, $attr) {\n\t$sort_func = create_function('$a,$b', 'return strcasecmp($a[\"'.$attr.'\"], $b[\"'.$attr.'\"]);' );\n\tuasort($array, $sort_func);\n}", "public function sort();", "public static function sort_objects(array &$objects_array, $sort_by, $sort_order = \"desc\") {\n $sort_order = strtolower($sort_order);\n uasort(\n $objects_array,\n function ($a, $b) use ($sort_by, $sort_order) {\n if($a->$sort_by == $b->$sort_by) {\n return 0;\n } else {\n $comparison = $a->$sort_by > $b->$sort_by;\n if($sort_order == \"desc\") {\n return $comparison ? -1 : 1;\n } else {\n return $comparison ? 1 : -1;\n }\n }\n });\n }", "function orderHotelsByRate($array)\n{\n return collect($array)->sortByDesc('hotelRate');\n}", "function sortBy($field, &$array, $direction = 'asc')\n{\n usort($array, create_function('$a, $b', '\n $a = $a[\"' . $field . '\"];\n $b = $b[\"' . $field . '\"];\n\n if ($a == $b) return 0;\n\n $direction = strtolower(trim($direction));\n\n return ($a ' . ($direction == 'desc' ? '>' : '<') . ' $b) ? -1 : 1;\n '));\n\n return true;\n}", "public static function sort(array &$objects, $sortingProperty) {\n\t\t$keyValues = array();\n\t\tforeach ($objects as $key => $object) {\n\t\t\t$propertyGetterName = 'get' . ucfirst($sortingProperty);\n\n\t\t\tif (method_exists($object, $propertyGetterName)) {\n\t\t\t\t$value = call_user_func(array($object, $propertyGetterName));\n\t\t\t} else {\n\t\t\t\t$value = '';\n\t\t\t}\n\n\t\t\t$keyValues[$key] = $value;\n\t\t}\n\n\t\tarray_multisort($keyValues, SORT_ASC, $objects);\n\t}", "protected function sortDataArray() {}", "function array_sort($array, $sortby) {\n\n $size = sizeof($array);\n\n for($i=0;$i<$size;$i++) {\n for($j=$i+1;$j<$size;$j++) {\n $temp = array();\n if($array[$i]['priority']<$array[$j]['priority']) {\n $temp = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $temp;\n }\n }\n }\n return $array;\n}", "public static function arrSortObjsByKey($key, $order = 'DESC') {\n\treturn function($a, $b) use ($key, $order) {\n\t\t// Swap order if necessary\n\t\tif ($order == 'DESC') {\n \t \t\tlist($a, $b) = array($b, $a);\n \t\t} \n \t\t// Check data type\n \t\tif (is_numeric($a->$key)) {\n \t\t\treturn $a->$key - $b->$key; // compare numeric\n \t\t} else {\n \t\t\treturn strnatcasecmp($a->$key, $b->$key); // compare string\n \t\t}\n\t};\n}", "public static function SortArrayOfObjectsWithDateField($array,$fieldName,$order=\"ASC\"){\n usort($array, function($a, $b) use($order,$fieldName){\n\n $ad = date('Y-m-d H:i:s',strtotime($a->{$fieldName}));\n $bd = date('Y-m-d H:i:s',strtotime($b->{$fieldName}));\n if ($ad == $bd) {\n return 0;\n }\n if($order == Constants::$SortIndexDESC) {\n return $ad < $bd ? 1 : -1;\n }\n else{\n return $ad > $bd ? 1 : -1;\n }\n });\n return $array;\n }", "function sortArray( $data, $field ) {\r\n\t$field = (array) $field;\r\n\tuasort( $data, function($a, $b) use($field) {\r\n\t\t$retval = 0;\r\n\t\tforeach( $field as $fieldname ) {\r\n\t\t\tif( $retval == 0 ) $retval = strnatcmp( $a[$fieldname], $b[$fieldname] );\r\n\t\t}\r\n\t\treturn $retval;\r\n\t} );\r\n\treturn $data;\r\n}", "function aasort(&$array, $key){ // Seu array e o campo a ser ordenado\r\n\t$sorter = array();\r\n\t$ret = array();\r\n\treset($array);\r\n\tforeach($array as $ii => $va){\r\n\t\t$sorter[$ii] = $va[$key];\r\n\t}\r\n\tasort($sorter);\r\n\tforeach($sorter as $ii => $va){\r\n\t\t$ret[$ii] = $array[$ii];\r\n\t}\r\n\treturn ($ret);\r\n}", "public static function sortByProperty(array &$items, string $property, string $order = \"asc\") {\n if (!is_array($items)) {\n return false;\n }\n\n if (class_exists(\"Collator\")) {\n $collator = new Collator('en_US');\n } else {\n $collator = false;\n }\n\n return usort($items, function($a, $b) use ($property, $order, $collator) {\n if ($collator) {\n $cmp = $collator->compare($a[$property], $b[$property]);\n } else {\n $cmp = strcmp(static::seourelize($a[$property]), static::seourelize($b[$property]));\n }\n return $order === 'asc' ? $cmp : -$cmp;\n });\n }", "public function sortBy(string $key);", "function sort_results ($unsorted)\n{\n // Add a key to all objects in the array that allows for sensible\n // sorting of numeric substrings.\n foreach ($unsorted as $res) {\n $res->key = preg_replace_callback (\n '|\\d+|',\n function ($match) {\n return 'zz' . strval (strlen ($match[0])) . $match[0];\n },\n $res->meta_value\n );\n }\n\n // Sort the array according to key.\n usort (\n $unsorted,\n function ($res1, $res2) {\n return strcoll ($res1->key, $res2->key);\n }\n );\n\n return array_map (\n function ($s) {\n return $s->meta_value;\n },\n $unsorted\n );\n}", "public function by_method(&$objects, $direction='A', $sortkey_function)\n {\n // Build array of pairs ('sortkey', 'object')\n $meta_array = array();\n foreach ($objects as $obj) $meta_array[] = array('sortkey'=>$sortkey_function($obj), 'object'=>$obj);\n \n // Sort array of pairs\n if ($direction == 'D') \n {\n usort($meta_array, function($a, $b)\n { \n return ($a['sortkey']==$b['sortkey'] ? 0 : ($a['sortkey']<$b['sortkey'] ? 1 : -1)); \n } );\n }\n else \n {\n usort($meta_array, function($a, $b)\n { \n return ($a['sortkey']==$b['sortkey'] ? 0 : ($a['sortkey']<$b['sortkey'] ? -1 : 1)); \n } );\n }\n \n // Flatten array of pairs back into original array of object\n $objects = array();\n foreach ($meta_array as $meta_obj) $objects[] = $meta_obj['object'];\n }", "public function sortArray($input, $sortBy): static;", "private function sortArray($array, $sort_by) {\r\n\t\tforeach ($array as $pos => $val) {\r\n\t\t\t$tmp_array[$pos] = $val[$sort_by];\r\n\t\t}\r\n\t\tasort($tmp_array);\r\n\r\n\t\t$return_array = [];\r\n\t\tforeach ($tmp_array as $pos => $val) {\r\n\t\t\t$return_array[$pos]['title'] = $array[$pos]['title'];\r\n\t\t\t$return_array[$pos]['label'] = $array[$pos]['label'];\r\n\t\t\t$return_array[$pos]['sort'] = $array[$pos]['sort'];\r\n\t\t\t$return_array[$pos]['function'] = $array[$pos]['function'];\r\n\t\t}\r\n\t\treturn $return_array;\r\n\t}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function array_sort($array, Closure $callback)\n\t{\n\t\treturn Illuminate\\Support\\Collection::make($array)->sortBy($callback)->all();\n\t}", "public function SortObjectsByName($obj){\r\n\t\tself::Debug('Sort objects by name');\r\n\t\t$temp=Array();\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($obj);\r\n\t\twhile(++$i<$len)\r\n\t\t\t$temp[$obj[$i]->Name]=$obj[$i];\r\n\t\t$keys=array_keys($temp);\r\n\t\tsort($keys);\r\n\t\t$res=Array();\r\n\t\t$i=-1;\r\n\t\twhile(++$i<$len)\r\n\t\t\t$res[]=$temp[$keys[$i]];\r\n\t\treturn $res;\r\n\t}", "function rearrangePro_orderby(){\n\t\t$args = func_get_args();\n\t\t$data = array_shift($args);\n\t\tforeach ($args as $n => $field) {\n\t\t\tif (is_string($field)) {\n\t\t\t\t$tmp = array();\n\t\t\t\tforeach ($data as $key => $row)\n\t\t\t\t\t$tmp[$key] = $row[$field];\n\t\t\t\t$args[$n] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$args[] = &$data;\n\t\tcall_user_func_array('array_multisort', $args);\n\t\treturn array_pop($args);\n\t}", "public function asort()\n {\n }", "public static function natsortField ($array, $fieldname)\r\n\t{\r\n\t\t# Create a function which creates an array of the two values, then compares the original array with a natsorted copy\r\n\t\t$functionCode = '\r\n\t\t\t$original = array ($a[\\'' . $fieldname . '\\'], $b[\\'' . $fieldname . '\\']);\r\n\t\t\t$copy = $original;\r\n\t\t\tnatsort ($copy);\r\n\t\t\treturn ($copy === $original ? -1 : 1);\r\n\t\t';\r\n\t\t\r\n\t\t# Do the comparison\r\n\t\t$natsortFieldFunction = create_function ('$a,$b', $functionCode);\r\n\t\tuasort ($array, $natsortFieldFunction);\r\n\t\t\r\n\t\t# Return the sorted list\r\n\t\treturn $array;\r\n\t}", "function asort(array &$array, $sort_flags = null)\n {\n }", "public function sortStrategy();", "public function sortByMultipleFields(MultiSortParameters ...$param): CollectionInterface;", "function md_multisort($arr, $col, $method = SORT_ASC)\n{\n\tif(!is_array($arr) || empty($arr)) return false;\n\tif($col === null) return $arr;\n\telseif($col == 'name') $tmp = array_keys($arr);\n\telse foreach($arr as $key => $row) $tmp[$key] = @$row[$col];\n\tarray_multisort($tmp, $method, $arr);\n\treturn $arr;\n}", "public function sort(array $paths);", "function Ascending(Array $array, $field) {\n if (is_numeric($array[0][$field])) {\n usort($array, array(new MultiArraySorting($field), 'numberSort'));\n } else {\n usort($array, array(new MultiArraySorting($field), 'textSort'));\n }\n return $array;\n }", "static function sort(array $array, $method = SORT_REGULAR) {\n if (is_int($method)) {\n asort($array, $method);\n } else {\n uasort($array, $method);\n }\n\n return $array;\n }", "public function andThenAscendingBy(string $field): ExtensibleSorting;", "public function sortMeByMultipleFields(MultiSortParameters ...$param): CollectionInterface;", "function awesomeSort($a, $b)\n{\n return $a['amount'] <=> $b['amount'];\n}", "function customcert_perform_asort(&$fields) {\n if (class_exists('core_collator')) {\n core_collator::asort($fields);\n } else {\n collatorlib::asort($fields);\n }\n}", "function sort($array,$by,$type='asc') {\n\t\t$sortField=&$by;\n\t\t$multArray=&$array;\n\t\t\n\t\t$tmpKey='';\n\t\t$ResArray=array();\n\t\t$maIndex=array_keys($multArray);\n\t\t$maSize=count($multArray)-1;\n\t\tfor($i=0; $i < $maSize ; $i++) {\n\t\t\t$minElement=$i;\n\t\t\t$tempMin=$multArray[$maIndex[$i]][$sortField];\n\t\t\t$tmpKey=$maIndex[$i];\n\t\t\tfor ($j=$i+1; $j <= $maSize; $j++) {\n\t\t\t\tif ($multArray[$maIndex[$j]][$sortField] < $tempMin ) {\n\t\t\t\t\t$minElement=$j;\n\t\t\t\t\t$tmpKey=$maIndex[$j];\n\t\t\t\t\t$tempMin=$multArray[$maIndex[$j]][$sortField];\n\t\t \t}\n\t\t\t}\n\t\t\t$maIndex[$minElement]=$maIndex[$i];\n\t\t\t$maIndex[$i]=$tmpKey;\n\t\t}\n\t\tif ($type=='asc') {\n\t\t\tfor ($j=0;$j<=$maSize;$j++) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t} else {\n\t\t\tfor ($j=$maSize;$j>=0;$j--) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ResArray;\n\t}", "public static function sort($array, $callback = null)\n {\n return Collection::make($array)->sort($callback)->all();\n }", "public static function sortByObjectProperty($property, $sort = 'ASC')\n {\n $supportData = ['property' => $property, 'sort' => $sort];\n return function ($a, $b) use ($supportData) {\n $property = $supportData['property'];\n return ($supportData['sort'] == 'DESC') ?\n strcmp($b->$property, $a->$property) :\n strcmp($a->$property, $b->$property);\n };\n }", "public static function sort($array, callable $callback)\n {\n return Collection::make($array)->sortBy($callback)->all();\n }", "protected function getPropertyOrderings(array $resourceProperties)\n\t{\n\t\t$orderings = [];\n\t\tif ($this->request->hasArgument(static::$SORTING_ARGUMENT_NAME)) {\n\t\t\t$sortColumns = explode(',', $this->request->getArgument(static::$SORTING_ARGUMENT_NAME));\n\t\t\tforeach ($sortColumns as $columnName) {\n\t\t\t\t$order = QueryInterface::ORDER_ASCENDING;\n\t\t\t\tif ($columnName[0] === '-') {\n\t\t\t\t\t$order = QueryInterface::ORDER_DESCENDING;\n\t\t\t\t\t$columnName = substr($columnName, 1);\n\t\t\t\t}\n\t\t\t\tif ($this->isInPersistenceSchema($columnName, $resourceProperties)) {\n\t\t\t\t\t$orderings[$columnName] = $order;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $orderings;\n\t}", "public function sortResults(array $results, $order = 'ASC');", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public final function manualSort(){\r\n\t\t$itemid=$this->itemid;\r\n\t\t$position=$this->sortarray;\r\n\t\t$newarray=array();\r\n\t\t$max=-1;\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) continue;\r\n\t\t\t$newarray[$position[$i]]=$pmid;\r\n\t\t\tif ($max<$position[$i]) $max=$position[$i];\r\n\t\t}\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) $newarray[++$max]=$pmid;\r\n\t\t}\r\n\t\t$this->sorteddata=$newarray;\r\n\t}", "public function setSorting($arrSorting);", "public function SortMeetingObjects(\n $in_sort_fields_array = null,\n // An array of strings. The array will deliniate the sort order, by field name.\n // Array element [0] will be the highest priority, and it will descend from there.\n $in_desc = null ///< If this is set to true, the sort will be highest to lowest. Default is false.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n // Only the root can do this.\n if (null == $this->_my_root) {\n if (null != $this->_search_results) {\n if (null != $in_sort_fields_array) {\n $this->sort_array = $in_sort_fields_array;\n } else {\n $in_sort_fields_array = $this->sort_array;\n }\n \n if (null != $in_desc) {\n $this->sort_desc = $in_desc;\n } else {\n $in_desc = $this->sort_desc;\n }\n \n if (is_array($in_sort_fields_array) && count($in_sort_fields_array)) {\n // This is simply a \"pass-through\" to the object we have on hand.\n $this->_search_results->SortMeetingObjects($in_sort_fields_array, $in_desc, $this->_sort_search_by_distance);\n }\n }\n }\n }", "public function andThenDescendingBy(string $field): ExtensibleSorting;", "function sort_array($array, $key)\n {\n foreach ($array as $temp_list) {\n $sort_aux[] = ($temp_list[$key]);\n }\n array_multisort($sort_aux, SORT_ASC, $array);\n\n return $array;\n }", "function krsort(array &$array, $sort_flags = null)\n {\n }", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "function sortByItem($channel) \n{\n foreach ($channel['item'] as $item) {\n\n // Make an array of an object\n $arrayOfItems = (array) $item;\n\n // Push title properties into new array.\n $arr[] = $arrayOfItems['title'];\n\n // Make comparison, sort if true\n usort($arr, 'compare');\n }\n\n $json = json_encode($arr, JSON_PRETTY_PRINT);\n return $json;\n}", "public static function sortInnerValues(&$arr, $sortFn = 'sort') {\n foreach ($arr as $key => $item) {\n $sortFn($arr[$key]);\n }\n }", "public function sort($by)\n {\n $by = ucfirst($by);\n $array = $this->queryResult->getRecords();\n usort($array, function($a, $b) use ($by) {\n // These two ifs take care of moving empty values to the end of the\n // array instead of the beginning\n if (!isset($a->$by) || !$a->$by) {\n return 1;\n }\n\n if (!isset($b->$by) || !$b->$by) {\n return -1;\n }\n\n return strcmp($a->$by, $b->$by);\n });\n\n return new \\ArrayIterator($array);\n }", "private function sortFiles(&$array){\n if(isset($array['files'])) sort($array['files']);\n if(isset($array['images'])) sort($array['images']);\n }", "public function testSortBy() {\n\t\t$array = array(2, 5, 3, 1, 4);\n\t\t$result = _::sortBy($array);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test sorting an array with an iterator\n\t\t$result = _::sortBy($array, function($left, $right) {\n\t\t\treturn (($left == $right) ? 0 : (($left > $right) ? -1 : 1));\n\t\t});\n\t\t$this->assertEquals(5, $result[0]);\n\t\t$this->assertEquals(4, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(2, $result[3]);\n\t\t$this->assertEquals(1, $result[4]);\n\n\t\t// test sorting an object without a value function\n\t\t$arrayObj = new ArrayObject($array);\n\t\ttry {\n\t\t\t$result = _::sortBy($arrayObj);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertInstanceOf('InvalidArgumentException', $e);\n\t\t}\n\n\t\t// test sorting an object with a value function\n\t\t$result = _::sortBy($arrayObj, function($value) {\n\t\t\treturn (5 - $value);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(5, $result[0]);\n\t\t$this->assertEquals(4, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(2, $result[3]);\n\t\t$this->assertEquals(1, $result[4]);\n\t}", "public static function sortByField($array, $sort)\n {\n $old_index = null;\n $total = sizeof($array);\n\n $noIndex = true;\n\n foreach($array as $value) {\n if(isset($value[$sort['field']])) {\n $noIndex = false;\n break;\n }\n }\n\n if($noIndex) {\n throw new \\Exception('sort-field can only be set to a field that exists in the locations return of the JSON');\n }\n\n // TODO: implement this as a foreach instead of a for loop.\n for($index = 0; $index < $total; $index++) {\n $value = $array[$index];\n\n if(!isset($array[$index - 1])) {\n continue;\n }\n\n switch($sort['direction']) {\n case 'asc':\n if($array[$index - 1][$sort['field']] > $array[$index][$sort['field']]) {\n $temp = $array[$index - 1];\n $array[$index - 1] = $array[$index];\n $array[$index] = $temp;\n\n $index = -1;\n }\n break;\n case 'desc':\n if($array[$index - 1][$sort['field']] < $array[$index][$sort['field']]) {\n $temp = $array[$index - 1];\n $array[$index - 1] = $array[$index];\n $array[$index] = $temp;\n\n $index = -1;\n }\n break;\n }\n }\n\n return $array;\n }", "public function getSorting();", "function facebook_instant_articles_sort_fields(array $a, $subkey) {\n foreach ($a as $k => $v) {\n if (isset($v[$subkey])) {\n $b[$k] = $v[$subkey];\n }\n }\n asort($b);\n foreach ($b as $key => $val) {\n $c[$key] = $a[$key];\n }\n return $c;\n}", "protected function sort()\n {\n // if no comparator is passed sort the internal array\n // by its keys, else use the comparator\n if ($this->comparator == null) {\n return ksort($this->items);\n } else {\n return CollectionUtils::sort($this, $this->comparator);\n }\n }", "function arsort(array &$array, $sort_flags = null)\n {\n }", "function sorted(array $array, callable|int $func = null, int $flags = 0, bool $assoc = null, bool $key = false): array\n{\n if ($key) {\n return Arrays::sortKey($array, $func, $flags);\n }\n return Arrays::sort($array, $func, $flags, $assoc);\n}", "function fn_sort_md_array_by_value(&$array, $key)\n{\n\t//ref. http://stackoverflow.com/questions/2699086/sort-multi-dimensional-array-by-value\n $sorter=array();\n $ret=array();\n reset($array);\n foreach ($array as $ii => $va) {\n $sorter[$ii]=$va[$key];\n }\n asort($sorter);\n foreach ($sorter as $ii => $va) {\n $ret[$ii]=$array[$ii];\n }\n $array=$ret;\n}", "function sort_by_sub_element($array,$element){\n\tforeach($array as $id => $sub_array){\n\t\tif(is_object($sub_array)) $sub_array = get_object_vars($sub_array);\n\t\t$sorting_array[$id]=$sub_array[$element];\n\t}\n\tasort($sorting_array);\n\t$sorting_array = array_reverse($sorting_array, true);\n\t\n\tforeach ($sorting_array as $id=>$next_post){\n\t\t$sorted_posts[] = $array[$id];\n\t}\n\t\n\t$sorted_posts = array_reverse($sorted_posts);\n\treturn $sorted_posts;\n\t\n}", "public function sort(array $array)\n {\n sort($array);\n $count = 0;\n foreach ($array as $key => $valor)\n {\n $arrayOrderecha[$key] = $valor;\n $count ++;\n }\n //retorno del resultado a la vista\n return $arrayOrderecha;\n }", "public function getSortBy();", "public function sort(array $nodes);", "public static function sort(array &$arr)\n {\n uasort($arr, '\\undpaul\\MarioKartBundle\\Entity\\RankingRow::sortCallback');\n }", "public function sortByArray(array $sorting) {\n\t\ttx_pttools_assert::isValidUidArray($sorting, false, array('message' => 'Given sorting array is invalid'));\n\t\t$uids = $this->extractProperty('uid');\n\t\ttx_pttools_assert::isValidUidArray($uids, false, array('message' => 'Retrieved uids are invalid'));\n\t\t\n\t\t$sortingUids = $sorting;\n\t\t\n\t\tsort($sortingUids);\n\t\tsort($uids);\n\t\t\n\t\ttx_pttools_assert::isEqual($sortingUids, $uids, array('message' => 'Sorting array did not contain the same elements as the collection.'));\n\t\t\n\t\tforeach ($sorting as $key => $uid) {\n\t\t\t$this->getItemByProperty('uid', $uid)->set_sorting(pow(2, $key));\n\t\t}\n\t}", "static function sortasc_old($data, $fieldname)\n {\n $len1 = count($data);\n $len2 = $len1;\n for ($i = 0; $i < $len1; $i++)\n {\n for ($j = $i+1; $j < $len2-1; $j++)\n {\n if ($data[$i][$fieldname] > $data[$j][$fieldname])\n {\n $tmp = $data[$i];\n $data[$i] = $data[$j];\n $data[$j] = $tmp;\n }\n }\n }\n \n return $data;\n }", "static protected function _prepareSort(array $ticket)\n {\n $by = self::sortBy();\n $ticket['sort_by'] = array();\n if (is_array($by)) {\n foreach ($by as $field) {\n if (!isset($ticket[$field])) {\n $ticket['sort_by'][$field] = '';\n } else {\n $ticket['sort_by'][$field] = Horde_String::lower($ticket[$field], true, 'UTF-8');\n }\n }\n } else {\n if (!isset($ticket[$by])) {\n $ticket['sort_by'][$by] = '';\n } elseif (is_array($ticket[$by])) {\n natcasesort($ticket[$by]);\n $ticket['sort_by'][$by] = implode('', $ticket[$by]);\n } else {\n $ticket['sort_by'][$by] = Horde_String::lower($ticket[$by], true, 'UTF-8');\n }\n }\n return $ticket;\n }", "public function it_sorts_by_field_in_ascending_order(): void\n {\n $results = Client::filter([\n 'sorts' => [\n [\n 'column' => 'name',\n 'direction' => 'asc',\n ],\n ],\n ])->get();\n\n self::assertEquals($results->sortBy('name')->pluck('id'), $results->pluck('id'));\n }", "function sort ($block,$field,$dir = \"\") {\n\t\t$sort = [];\n\n\t\tforeach ($this->data as $event) {\n\t\t\t$sortval = $event->get($block,$field);\n\n\t\t\tif (is_array ($sortval))\n\t\t\t\t$sortval = $sortval[0];\n\n\t\t\t$sort[$sortval] = $event;\n\t\t}\n\n\t\t# choose sort direction\n\t\tif (strtoupper($dir) == \"DESC\")\n\t\t\tkrsort ($sort);\n\t\telse\n\t\t\tksort($sort);\n\n\t\t$this->data = $sort;\n\t}", "abstract public function prepareSort();", "function sort_array_by_array($array, $keyname_array)\n\t{\n\t$result = array();\n\tforeach($keyname_array as $key)\n\t\t{\n\t\t$result[$key] = $array[$key];\n\t\t}\n\treturn $result;\n\t}", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "protected function sort(array $data)\n {\n usort($data, function (array $a, array $b) {\n return $this->getSortOrder($a) <=> $this->getSortOrder($b);\n });\n\n return $data;\n }", "public function &getOrderBy();", "public function testSort()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEmpty($obj_query->getSorts());\n $obj_query->sort('a', 'b');\n $this->assertEquals([['a', 'b']], $obj_query->getSorts());\n $obj_query2 = $obj_query->sort('c', 'd');\n $this->assertEquals([['a', 'b'],['c', 'd']], $obj_query->getSorts());\n $this->assertSame($obj_query, $obj_query2);\n }", "function sortLowToHigh($a, $b)\n{\n return $a->price < $b->price ? -1 : 1; //Compare the prices, evalutes to true\n // return $a->price > $b->price ? 1 : -1; // Gives the same result\n}", "function _wp_object_name_sort_cb($a, $b)\n {\n }", "public function sortByProperty($property, $sort)\n {\n // Comparison variables\n $name = $property->getName();\n $type = $property->getNativeType();\n $sort = ($sort === 'asc');\n\n // Custom comparison\n usort($this->list, function(Record $a, Record $b) use ($name, $type, $sort)\n {\n $v1 = $sort ? $a->getData($name) : $b->getData($name);\n $v2 = $sort ? $b->getData($name) : $a->getData($name);\n\n // Compare as numbers\n if ($type === 'int')\n return $v1 - $v2;\n\n // Compare as strings\n return strcasecmp($v1, $v2);\n });\n }", "public function sortItems($items, $sort_by)\n {\n \n switch($sort_by)\n {\n case 'popular':\n $items = $items->sortBy(function($item){\n return $item->orders->count();\n }, null, true);\n break;\n\n case 'price-high-low':\n $items = $items->sortBy(function($item){\n return $item->itemable->discount_price;\n }, null, true);\n break;\n\n case 'recommended' :\n $items = $items->sortBy(function($item){\n return $item->is_recommended;\n }, null, true);\n break;\n\n case 'price-low-high':\n $items = $items->sortBy(function($item){\n return $item->itemable->discount_price;\n }, null, false);\n break;\n\n default:\n $items = $items->sortBy(function($item){\n return $item->itemable->weight;\n }, null, true);\n break;\n }\n\n return $items;\n }", "function sort_array_by_other_array($arr, $keys_arr, $num_field) {\n\t$new_arr = array();\n\t$left_arr = $arr;\n\t\n\tforeach($keys_arr as $key=>$value) {\n\t\tforeach($arr as $key2=>$value2) {\n\t\t\tif($value2[$num_field] == $value) {\n\t\t\t\t$new_arr[] = $value2;\n\t\t\t\tunset($left_arr[$key2]);\n\t\t\t}\t\n\t\t}\n\t}\t\n\t$new_arr = array_merge($new_arr, $left_arr);\n\treturn $new_arr;\n}", "function record_sort($records, $field, $reverse=false){\n\n $hash = array();\n \n foreach($records as $key => $record){\n $hash[$record[$field].$key] = $record;\n }\n \n ($reverse)? krsort($hash) : ksort($hash);\n \n $records = array();\n \n foreach($hash as $record){\n $records []= $record;\n }\n \n return $records;\n}", "public static function knatsort ($array)\r\n\t{\r\n\t\t$keys = array_keys ($array);\r\n\t\tnatsort ($keys);\r\n\t\t$items = array ();\r\n\t\tforeach ($keys as $key) {\r\n\t\t\t$items[$key] = $array[$key];\r\n\t\t}\r\n\t\t\r\n\t\t# Return the sorted list\r\n\t\treturn $items;\r\n\t}", "protected function _order($unsortedArray, $sortField, $sortWay = 'SORT_ASC')\n {\n $sortedArray = array();\n foreach ($unsortedArray as $uniqid => $row) {\n foreach ($this->getAttributes() as $attr) {\n if (isset($row[$attr])) {\n $sortedArray[$attr][$uniqid] = $unsortedArray[$uniqid][$attr];\n } else {\n $sortedArray[$attr][$uniqid] = null;\n }\n }\n }\n if ($sortWay) {\n array_multisort($sortedArray[$sortField], constant($sortWay), $unsortedArray);\n }\n return $unsortedArray;\n }", "function sort_array_of_arrays( $array, $sort_by_key ) {\n\n usort( $array, function ( $item1, $item2 ) use ( $sort_by_key ) {\n\n if ($item1[ $sort_by_key ] == $item2[ $sort_by_key ]) return 0;\n return $item1[ $sort_by_key ] < $item2[ $sort_by_key ] ? -1 : 1;\n\n });\n\n return $array;\n\n}", "public function doCustomSort($objects, $searchRecord)\n {\n if ($objects->count() < 2) {\n //do nothing\n } else {\n $objects = $this->makeClassGroups($objects);\n }\n\n return $objects;\n }", "function cmp_by_name($val1, $val2){\n return strcmp($val1->name, $val2->name);\n}", "function usort(/*. array[int] .*/ $a, /*. mixed .*/ $cmp_func)\n{}", "function sort(/*. array[int] .*/ $a, $sort_flags = SORT_REGULAR){}" ]
[ "0.74469507", "0.70988613", "0.69171304", "0.6845156", "0.6765783", "0.64983946", "0.64234835", "0.6415525", "0.6328104", "0.63248456", "0.6224221", "0.61687917", "0.61304015", "0.6087654", "0.602138", "0.5955248", "0.594134", "0.59401274", "0.5938257", "0.5914599", "0.5899347", "0.5898771", "0.5865456", "0.58401376", "0.5797734", "0.5795832", "0.5778795", "0.5778795", "0.5767168", "0.57532185", "0.5744263", "0.5742996", "0.57404125", "0.5719369", "0.56818813", "0.5674672", "0.5655173", "0.562446", "0.5623728", "0.56192243", "0.56021994", "0.5593194", "0.5592086", "0.5584005", "0.55575985", "0.5548725", "0.5510334", "0.548179", "0.54805166", "0.54739994", "0.54653853", "0.5450258", "0.543812", "0.5435265", "0.543094", "0.54294914", "0.5426258", "0.5415786", "0.5411414", "0.5404957", "0.54016185", "0.5398833", "0.5397146", "0.53963786", "0.5392188", "0.53908294", "0.53856814", "0.5377865", "0.53750485", "0.5374474", "0.5374041", "0.5370164", "0.53696364", "0.53544295", "0.53398895", "0.5327473", "0.5317287", "0.5316715", "0.5313906", "0.5308625", "0.5299691", "0.52819633", "0.5272149", "0.52679604", "0.52675605", "0.5254122", "0.5254061", "0.52310455", "0.52276117", "0.5222979", "0.52209157", "0.52204823", "0.5210935", "0.5210811", "0.5209782", "0.52096933", "0.5208715", "0.52076155", "0.5207301", "0.52036685" ]
0.7859561
0
Convert a number to text Works for numbers up to 20
Преобразование числа в текст. Работает для чисел до 20
function numberToText($num) { if(!is_numeric($num)){ $num = intval($num); if(!is_numeric($num)) return 'NaN'; } $numbers = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty'); return $numbers[$num]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getNumberToText(int $number): string {\n\t\tswitch($number) {\n\t\t\tcase 0:\n\t\t\t\treturn Language::out()->get0Name();\n\t\t\tcase 1:\n\t\t\t\treturn Language::out()->get1Name();\n\t\t\tcase 2:\n\t\t\t\treturn Language::out()->get2Name();\n\t\t\tcase 3:\n\t\t\t\treturn Language::out()->get3Name();\n\t\t\tcase 4:\n\t\t\t\treturn Language::out()->get4Name();\n\t\t\tcase 5:\n\t\t\t\treturn Language::out()->get5Name();\n\t\t\tcase 6:\n\t\t\t\treturn Language::out()->get6Name();\n\t\t\tcase 7:\n\t\t\t\treturn Language::out()->get7Name();\n\t\t\tcase 8:\n\t\t\t\treturn Language::out()->get8Name();\n\t\t\tcase 9:\n\t\t\t\treturn Language::out()->get9Name();\n\t\t\tdefault:\n\t\t\t\treturn (string) $number;\n\t\t}\n\t}", "function stpb_number_to_text($n){\r switch($n){\r case 1:\r $class ='one';\r break;\r case 2:\r $class ='two';\r break;\r case 3:\r $class ='three';\r break;\r case 4:\r $class ='four';\r break;\r case 5:\r $class ='five';\r break;\r case 6:\r $class ='six';\r break;\r case 7:\r $class ='seven';\r break;\r case 8:\r $class ='eight';\r break;\r case 9:\r $class ='nine';\r break;\r case 10:\r $class ='ten';\r break;\r case 10:\r $class ='eleven';\r break;\r\r default :\r $class ='twelve';\r\r }\r return $class;\r}", "function translateToWords($number) \n{\n // zero is a special case, it cause problems even with typecasting if we don't deal with it here\n $max_size = pow(10,18);\n if (!$number) return \"zero\";\n if (is_int($number) && $number < abs($max_size)) \n { \n switch ($number) \n {\n // set up some rules for converting digits to words\n case $number < 0:\n $prefix = \"negative\";\n $suffix = translateToWords(-1*$number);\n $string = $prefix . \" \" . $suffix;\n break;\n case 1:\n $string = \"one\";\n break;\n case 2:\n $string = \"two\";\n break;\n case 3:\n $string = \"three\";\n break;\n case 4: \n $string = \"four\";\n break;\n case 5:\n $string = \"five\";\n break;\n case 6:\n $string = \"six\";\n break;\n case 7:\n $string = \"seven\";\n break;\n case 8:\n $string = \"eight\";\n break;\n case 9:\n $string = \"nine\";\n break; \n case 10:\n $string = \"ten\";\n break; \n case 11:\n $string = \"eleven\";\n break; \n case 12:\n $string = \"twelve\";\n break; \n case 13:\n $string = \"thirteen\";\n break; \n // fourteen handled later\n case 15:\n $string = \"fifteen\";\n break; \n case $number < 20:\n $string = translateToWords($number%10);\n // eighteen only has one \"t\"\n if ($number == 18)\n {\n $suffix = \"een\";\n } else \n {\n $suffix = \"teen\";\n }\n $string .= $suffix;\n break; \n case 20:\n $string = \"twenty\";\n break; \n case 30:\n $string = \"thirty\";\n break; \n case 40:\n $string = \"forty\";\n break; \n case 50:\n $string = \"fifty\";\n break; \n case 60:\n $string = \"sixty\";\n break; \n case 70:\n $string = \"seventy\";\n break; \n case 80:\n $string = \"eighty\";\n break; \n case 90:\n $string = \"ninety\";\n break; \n case $number < 100:\n $prefix = translateToWords($number-$number%10);\n $suffix = translateToWords($number%10);\n $string = $prefix . \"-\" . $suffix;\n break;\n // handles all number 100 to 999\n case $number < pow(10,3): \n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,2)))) . \" hundred\";\n if ($number%pow(10,2)) $suffix = \" and \" . translateToWords($number%pow(10,2));\n $string = $prefix . $suffix;\n break;\n case $number < pow(10,6):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,3)))) . \" thousand\";\n if ($number%pow(10,3)) $suffix = translateToWords($number%pow(10,3));\n $string = $prefix . \" \" . $suffix;\n break;\n case $number < pow(10,9):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,6)))) . \" million\";\n if ($number%pow(10,6)) $suffix = translateToWords($number%pow(10,6));\n $string = $prefix . \" \" . $suffix;\n break; \n case $number < pow(10,12):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,9)))) . \" billion\";\n if ($number%pow(10,9)) $suffix = translateToWords($number%pow(10,9));\n $string = $prefix . \" \" . $suffix; \n break;\n case $number < pow(10,15):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,12)))) . \" trillion\";\n if ($number%pow(10,12)) $suffix = translateToWords($number%pow(10,12));\n $string = $prefix . \" \" . $suffix; \n break; \n // Be careful not to pass default formatted numbers in the quadrillions+ into this function\n // Default formatting is float and causes errors\n case $number < pow(10,18):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,15)))) . \" quadrillion\";\n if ($number%pow(10,15)) $suffix = translateToWords($number%pow(10,15));\n $string = $prefix . \" \" . $suffix; \n break; \n }\n } else\n {\n echo \"ERROR with - $number<br/> Number must be an integer between -\" . number_format($max_size, 0, \".\", \",\") . \" and \" . number_format($max_size, 0, \".\", \",\") . \" exclussive.\";\n }\n return $string; \n}", "function numtowords($num)\n{\n\t$ones = array(\n\t1 => \"one\",\n\t2 => \"two\",\n\t3 => \"three\",\n\t4 => \"four\",\n\t5 => \"five\",\n\t6 => \"six\",\n\t7 => \"seven\",\n\t8 => \"eight\",\n\t9 => \"nine\",\n\t10 => \"ten\",\n\t11 => \"eleven\",\n\t12 => \"twelve\",\n\t13 => \"thirteen\",\n\t14 => \"fourteen\",\n\t15 => \"fifteen\",\n\t16 => \"sixteen\",\n\t17 => \"seventeen\",\n\t18 => \"eighteen\",\n\t19 => \"nineteen\"\n\t);\n\t$tens = array(\n\t2 => \"twenty\",\n\t3 => \"thirty\",\n\t4 => \"forty\",\n\t5 => \"fifty\",\n\t6 => \"sixty\",\n\t7 => \"seventy\",\n\t8 => \"eighty\",\n\t9 => \"ninety\"\n\t);\n\t$hundreds = array(\n\t\"hundred\",\n\t\"thousand\",\n\t\"million\",\n\t\"billion\",\n\t\"trillion\",\n\t\"quadrillion\"\n\t); //limit t quadrillion\n\t$num = number_format($num,2,\".\",\",\");\n\t$num_arr = explode(\".\",$num);\n\t$wholenum = $num_arr[0];\n\t$decnum = $num_arr[1];\n\t$whole_arr = array_reverse(explode(\",\",$wholenum));\n\tkrsort($whole_arr);\n\t$rettxt = \"\";\n\tforeach($whole_arr as $key => $i)\n\t{\n\t\tif($i < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$i];\n\t\t}\n\t\telseif($i < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($i,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,1,1)];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rettxt .= $ones[substr($i,0,1)].\" \".$hundreds[0];\n\t\t\t$rettxt .= \" \".$tens[substr($i,1,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,2,1)];\n\t\t}\n\t\t\n\t\tif($key > 0)\n\t\t{\n\t\t\t$rettxt .= \" \".$hundreds[$key].\" \";\n\t\t}\n\t}\n\tif($decnum > 0)\n\t{\n\t\t$rettxt .= \" and \";\n\t\tif($decnum < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$decnum];\n\t\t}\n\t\telseif($decnum < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($decnum,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($decnum,1,1)];\n\t\t}\n\t}\n\treturn $rettxt;\n}", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "static function Number_to_Word($num)\n\t{\n\t\t$fn = array();\n\n\t\tif ($num == 0)\n\t\t\treturn self::$nums[0];\n\n\t\twhile ($num != 0) {\n\t\t\tif ($num < 0) {\n\t\t\t\t$fn[] = self::$nums['-'];\n\t\t\t\t$num = -$num;\n\t\t\t}\n\t\t\telseif ($num < 20) {\n\t\t\t\t$fn[] = self::$nums[$num];\n\t\t\t\t$num = 0;\n\t\t\t}\n\t\t\telse if ($num < 100) {\n\t\t\t\t$val = floor($num / 10) * 10;\n\t\t\t\t$fn[] = self::$nums[$val];\n\t\t\t\tif (($num -= $val) > 0)\n\t\t\t\t\t$fn[] = '-';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($num < 1000) {\n\t\t\t\t\t$num -= ($val = floor($num / 100)) * 100;\n\t\t\t\t\t$fn[] = self::$nums[$val] . ' hundred';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($num < 1000000) {\n\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000)));\n\t\t\t\t\t\t$fn[] = 'thousand';\n\t\t\t\t\t\t$num = $num % 1000;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($num < 1000000000) {\n\t\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000000)));\n\t\t\t\t\t\t\t$fn[] = 'million';\n\t\t\t\t\t\t\t$num = $num % 1000000;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttrigger_error(\"WriteNum::write :: number is bigger than maximum allowed.\", E_USER_WARNING);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn preg_replace('/ \\- /', '-', implode(' ', $fn));\n\t}", "function c_num_to_text($key) \r\n {\r\n\r\n\t\t// Example \r\n \t$data = array(\r\n \t\t0 => \"off\",\r\n \t\t1 => \"on\"\r\n \t);\r\n \t\r\n \t$result = $data[$key];\r\n \r\n \tif(is_null($result))\r\n \t{\r\n \t\treturn false;\r\n \t}\r\n \telse \r\n \t{\r\n \t\treturn $result;\t\r\n \t}\r\n\r\n\r\n }", "private function twodigits($num)\n {\n //displays from 1 to 99\n if($num<20)\n return $this->discrete[$num];\n else\n return $this->ten_digit_prefix[substr($num,0,1)].' '.$this->discrete[substr($num,1,1)];\n }", "function convert_number($number) \n{ \n if (($number < 0) || ($number > 999999999)) \n { \n echo \"Number is out of range\";\n } \n\n \t//$Gn = floor($number / 1000000); /* Millions (giga) */ \n //$number -= $Gn * 1000000; \n\n $Gn = floor($number / 100000); /* Lakhs (giga) */ \n $number -= $Gn * 100000; \n $kn = floor($number / 1000); /* Thousands (kilo) */ \n $number -= $kn * 1000; \n $Hn = floor($number / 100); /* Hundreds (hecto) */ \n $number -= $Hn * 100; \n $Dn = floor($number / 10); /* Tens (deca) */ \n $n = $number % 10; /* Ones */ \n\n $res = \"\"; \n\n /*if ($Gn) \n { \n $res .= convert_number($Gn) . \" Millions\"; \n } */\n\n\tif ($Gn) \n { \n $res .= convert_number($Gn) . \" Lakhs\"; \n } \n\n if ($kn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($kn) . \" Thousand\"; \n } \n\n if ($Hn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($Hn) . \" Hundred\"; \n } \n\n $ones = array(\"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \n \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Eleven\", \"Twelve\", \"Thirteen\", \n \"Fourteen\", \"Fifteen\", \"Sixteen\", \"Seventeen\", \"Eightteen\", \n \"Nineteen\"); \n $tens = array(\"\", \"\", \"Twenty\", \"Thirty\", \"Fourty\", \"Fifty\", \"Sixty\", \n \"Seventy\", \"Eigthy\", \"Ninety\"); \n\n if ($Dn || $n) \n { \n if (!empty($res)) \n { \n $res .= \" and \"; \n } \n\n if ($Dn < 2) \n { \n $res .= $ones[$Dn * 10 + $n]; \n } \n else \n { \n $res .= $tens[$Dn]; \n\n if ($n) \n { \n $res .= \"-\" . $ones[$n]; \n } \n } \n } \n\n if (empty($res)) \n { \n $res = \"zero\"; \n } \n\n return $res; \n}", "public function convert($number)\n {\n $number = str_replace('.', '', $number);\n if ( ! is_numeric($number)) throw new Exception(\"Please input number.\");\n $base = array('nol', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan');\n $numeric = array('1000000000000000', '1000000000000', '1000000000000', 1000000000, 1000000, 1000, 100, 10, 1);\n $unit = array('kuadriliun', 'triliun', 'biliun', 'milyar', 'juta', 'ribu', 'ratus', 'puluh', '');\n $str = null;\n $i = 0;\n if ($number == 0) {\n $str = 'nol';\n } else {\n while ($number != 0) {\n $count = (int)($number / $numeric[$i]);\n if ($count >= 10) {\n $str .= static::convert($count) . ' ' . $unit[$i] . ' ';\n } elseif ($count > 0 && $count < 10) {\n $str .= $base[$count] . ' ' . $unit[$i] . ' ';\n }\n $number -= $numeric[$i] * $count;\n $i++;\n }\n $str = preg_replace('/satu puluh (\\w+)/i', '\\1 belas', $str);\n $str = preg_replace('/satu (ribu|ratus|puluh|belas)/', 'se\\1', $str);\n $str = preg_replace('/\\s{2,}/', ' ', trim($str));\n }\n return $str;\n }", "function convertNum($num) {\n $num = (int) $num; // make sure it's an integer\n\n if ($num < 0)\n return 'negative' . convertTri(-$num, 0);\n\n if ($num == 0)\n return 'Zero';\n return convertTri($num, 0);\n}", "function th($number) {\n\treturn number_format(intval($number));\n}", "function convertToRupee($number){\r\n\t\t$no = round($number);\r\n\t\t$whole = floor($number); \r\n\t\t$point = $number - $whole; \r\n\r\n\t\t$hundred = null;\r\n\t\t$digits_1 = strlen($no);\r\n\t\t$i = 0;\r\n\t\t$str = array();\r\n\t\t$words = array('0' => '', '1' => 'One', '2' => 'Two',\r\n\t\t\t\t'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\r\n\t\t\t\t'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\r\n\t\t\t\t'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\r\n\t\t\t\t'13' => 'Thirteen', '14' => 'fourteen',\r\n\t\t\t\t'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\r\n\t\t\t\t'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',\r\n\t\t\t\t'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\r\n\t\t\t\t'60' => 'Sixty', '70' => 'Seventy',\r\n\t\t\t\t'80' => 'Eighty', '90' => 'Ninety');\r\n\t\t\t\t$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\r\n\t\twhile ($i < $digits_1) {\r\n\t\t\t$divider = ($i == 2) ? 10 : 100;\r\n\t\t\t$number = floor($no % $divider);\r\n\t\t\t$no = floor($no / $divider);\r\n\t\t\t$i += ($divider == 10) ? 1 : 2;\r\n\t\t\tif ($number) {\r\n\t\t\t\t$plural = (($counter = count($str)) && $number > 9) ? 's' : null;\r\n\t\t\t\t$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\r\n\t\t\t\t$str [] = ($number < 21) ? $words[$number] .\r\n\t\t\t\t\t\" \" . $digits[$counter] . $plural . \" \" . $hundred\r\n\t\t\t\t\t:\r\n\t\t\t\t\t$words[floor($number / 10) * 10]\r\n\t\t\t\t\t. \" \" . $words[$number % 10] . \" \"\r\n\t\t\t\t\t. $digits[$counter] . $plural . \" \" . $hundred;\r\n\t\t\t} else $str[] = null;\r\n\t\t}\r\n\t\t$str = array_reverse($str);\r\n\t\t$result = implode('', $str);\r\n\t\t$points = $this->paiseValue($point);\r\n\r\n\t\t$finalStr = '';\r\n\r\n\t\tif(!empty($result)){\r\n\t\t\t$finalStr .= $result. \" Rupees \";\r\n\t\t}\r\n\t\tif(!empty($points)){\r\n\t\t\t$finalStr .= \"and \".$points. \" Paise\";\r\n\t\t}\r\n\t\tif(!empty($finalStr)){\r\n\t\t\t$finalStr .= \" Only.\";\r\n\t\t}\r\n\r\n\t\treturn $finalStr;\r\n\t}", "public function __invoke($num) {\n if ( ($num / 10) % 10 != 1 ) {\n switch( $num % 10 ) {\n case 1: return $num . 'st';\n case 2: return $num . 'nd';\n case 3: return $num . 'rd';\n }\n }\n return $num . 'th';\n }", "function num2words($num, $c=0) {\n $ZERO = 'zero';\n $MINUS = 'minus';\n $lowName = array(\n /* zero is shown as \"\" since it is never used in combined forms */\n /* 0 .. 19 */\n \"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\",\n \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\",\n \"Eleven\", \"Twelve\", \"Thirteen\", \"Fourteen\", \"Fifteen\",\n \"Sixteen\", \"Seventeen\", \"Eighteen\", \"Nineteen\");\n \n $tys = array(\n /* 0, 10, 20, 30 ... 90 */\n \"\", \"\", \"Twenty\", \"Thirty\", \"Forty\", \"Fifty\",\n \"Sixty\", \"Seventy\", \"Eighty\", \"Ninety\");\n \n $groupName = array(\n /* We only need up to a quintillion, since a long is about 9 * 10 ^ 18 */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n \"\", \"Hundred\", \"Thousand\", \"Million\", \"Billion\",\n \"Trillion\", \"Quadrillion\", \"Quintillion\");\n \n $divisor = array(\n /* How many of this group is needed to form one of the succeeding group. */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n 100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;\n \n $num = str_replace(\",\",\"\",$num);\n $num = number_format($num,2,'.','');\n $cents = substr($num,strlen($num)-2,strlen($num)-1);\n $num = (int)$num;\n \n $s = \"\";\n \n if ( $num == 0 ) $s = $ZERO;\n $negative = ($num < 0 );\n if ( $negative ) $num = -$num;\n // Work least significant digit to most, right to left.\n // until high order part is all 0s.\n for ( $i=0; $num>0; $i++ ) {\n $remdr = (int)($num % $divisor[$i]);\n $num = $num / $divisor[$i];\n // check for 1100 .. 1999, 2100..2999, ... 5200..5999\n // but not 1000..1099, 2000..2099, ...\n // Special case written as fifty-nine hundred.\n // e.g. thousands digit is 1..5 and hundreds digit is 1..9\n // Only when no further higher order.\n if ( $i == 1 /* doing hundreds */ && 1 <= $num && $num <= 5 ){\n if ( $remdr > 0 ){\n $remdr = ($num * 10);\n $num = 0;\n } // end if\n } // end if\n if ( $remdr == 0 ){\n continue;\n }\n $t = \"\";\n if ( $remdr < 20 ){\n $t = $lowName[$remdr];\n }\n else if ( $remdr < 100 ){\n $units = (int)$remdr % 10;\n $tens = (int)$remdr / 10;\n $t = $tys [$tens];\n if ( $units != 0 ){\n $t .= \"-\" . $lowName[$units];\n }\n }else {\n $t = num2words($remdr, 0);\n }\n $s = $t.\" \".$groupName[$i].\" \".$s;\n $num = (int)$num;\n } // end for\n $s = trim($s);\n if ( $negative ){\n $s = $MINUS . \" \" . $s;\n }\n \n if ($c == 1) $s .= \" and $cents/100\";\n \n return $s;\n}", "function int_to_str($i) {\n\treturn implode('.', int_to_digits($i));\n}", "public function convert($num)\n {\n if(strlen($num)>48) \n {\n $this->error=\"Number out of bounds\";\n return $this->error;\n }\n \n //check if first \n if(substr($num,0,1)==\"-\")\n {\n $this->sentence.='minus ';\n $num=substr($num,1,strlen($num)-1);\n }\n \n if(strlen($num)<=3)\n {\n $this->sentence.=$this->decider($num);\n }\n else\n {\n $k=strrev($num);\n for($i=0;$i<strlen($k);$i=$i+3){$arro[]=strrev(substr($k,$i,3));}\n //reverse again\n $arro=array_reverse($arro);\n //print_r($arro);\n $mool=ceil(strlen($num)/3);\n if((strlen($num)%3)==0){$mool--;}\n //return $this->decider($arro[0]);\n $this->sentence.=$this->decider($arro[0]).' '.$this->mool_array[$mool];\n $mool--;\n //leave the first one and prepare string of others\n $arrlen=count($arro);\n for($i=1;$i<$arrlen;$i++)\n {\n $this->sentence.=' '.$this->decider($arro[$i]);\n if($mool!=0)\n {\n $this->sentence=' '.$this->sentence.' '.$this->mool_array[$mool];\n }\n $mool--;\n }\n }\n return ucfirst(trim($this->sentence));\n }", "public function getTextForNumber($number)\n {\n if ($this->isDivisibleByFive($number) && $this->isDivisibleByThree($number)) {\n return 'FizzBuzz';\n }\n\n if ($this->isDivisibleByThree($number)) {\n return 'Fizz';\n }\n\n if ($this->isDivisibleByFive($number)) {\n return 'Buzz';\n }\n \n return (string) $number;\n }", "public function formatNumber($number);", "function displayNumberWords($number,$preOne=\"\",$preOther=\"\",$postOne=\"\",$postOther=\"\",$decimalPlaces=0) {\r\n\r\n\tglobal $dss_numberWords;\r\n\t\r\n\tif ($number == 1) return $preOne.\" \".$dss_numberWords[$number].\" \".$postOne;\r\n\telseif ($number < 13) return $preOther.\" \".$dss_numberWords[$number].\" \".$postOther;\r\n\telse return $preOther.\" \".number_format($number,$decimalPlaces).\" \".$postOther;\r\n\t\r\n}", "function convertNum($num) {\n$num = (int) $num; // make sure it's an integer\n\nif ($num < 0)\nreturn \"negative\".convertTri(-$num, 0);\n\nif ($num == 0)\nreturn \"zero\";\n\nreturn convertTri($num, 0);\n}", "private function threedigits($num)\n { if($this->discrete[substr($num,0,1)]!=\"\" && $this->twodigits(substr($num,1,2))!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred and '.$this->twodigits(substr($num,1,2));\n else if($this->discrete[substr($num,0,1)]!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred';\n else\n return \"\";\n }", "public function changeCurrencytowords($number)\n {\n /*$number = 190908100.25;*/\n $no = round($number);\n /* if($number < $no){\n $point = round($no - $number , 2) * 100;\n }else{\n $point = round($number - $no, 2) * 100;\n }*/\n\n $hundred = null;\n $digits_1 = strlen($no);\n $i = 0;\n $str = array();\n $words = array('0' => '', '1' => 'One', '2' => 'Two',\n '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\n '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\n '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\n '13' => 'Thirteen', '14' => 'Fourteen',\n '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\n '18' => 'Eighteen', '19' => 'Nineteen', '20' => 'Twenty',\n '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\n '60' => 'Sixty', '70' => 'Seventy',\n '80' => 'Eighty', '90' => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n\n while ($i < $digits_1) {\n\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += ($divider == 10) ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null;\n $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\n $str[] = ($number < 21) ? $words[$number] .\n \" \" . $digits[$counter] . $plural . \" \" . $hundred\n :\n $words[floor($number / 10) * 10]\n . \" \" . $words[$number % 10] . \" \"\n . $digits[$counter] . $plural . \" \" . $hundred;\n } else {\n $str[] = null;\n }\n\n }\n\n $str = array_reverse($str);\n $result = implode('', $str);\n\n /*$points = ($point) ?\n \".\" . $words[$point / 10] . \" \" .\n $words[$point = $point % 10]. \" Paise\" : '';*/\n\n return $result . \"Rupees \"; //. $points\n }", "function forDecimal($num){\n global $ones,$tens;\n $str=\"\";\n $len = strlen($num);\n if($len==1){\n $num=$num*10;\n }\n $x= $num%100;\n if($x>0){\n if($x<20){\n $str = $ones[$x].' Paise';\n }else{\n $str = $ones[$x/10].$ones[$x%10].' Paise';\n }\n }\n return $str;\n }", "function wolf_share_format_number( $n = 0 ) {\n\n\t$s = array( 'K', 'M', 'G', 'T' );\n\t$out = '';\n\twhile ( $n >= 1000 && count( $s ) > 0) {\n\t\t$n = $n / 1000.0;\n\t\t$out = array_shift( $s );\n\t}\n\treturn round( $n, max( 0, 3 - strlen( (int)$n ) ) ) .\" $out\";\n}", "function convert_number($n) {\r\r\n if($n != ''){\r\r\n $n = (0+str_replace(\",\", \"\", $n));\r\r\n }\r\r\n\r\r\n //if (!is_numeric($n)) return false;\r\r\n\r\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).'T';\r\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).'B';\r\r\n elseif ($n > 1000000) return round(($n/1000000), 2).'M';\r\r\n elseif ($n > 1000) return round(($n/1000), 2).'Th';\r\r\n \r\r\n return number_format($n);\r\r\n }", "function convertNumToWord($n) {\n $arr = array(\n 0 => 'twelve',\n 1 => 'one',\n 2 => 'two', \n 3 => 'three',\n 4 => 'four',\n 5 => 'five', \n 6 => 'six',\n 7 => 'seven',\n 8 => 'eight', \n 9 => 'nine',\n 10 => 'ten',\n 11 => 'eleven',\n 12 => 'twelve',\n 13 => 'thirteen',\n 14 => 'fourteen',\n 15 => 'fifteen',\n 16 => 'sixteen',\n 17 => 'seventeen',\n 18 => 'eighteen',\n 19 => 'nineteen',\n 20 => 'twenty',\n 21 => 'twenty one',\n 22 => 'twenty two',\n 23 => 'twenty three',\n 24 => 'twenty four',\n 25 => 'twenty five',\n 26 => 'twenty six',\n 27 => 'twenty seven',\n 28 => 'twenty eight',\n 29 => 'twenty nine',\n 30 => 'thirty'\n );\n return $arr[$n];\n}", "function convert_number_to_words($number)\n\t{\n\t\t$hyphen = '-';\n\t\t$conjunction = ' and ';\n\t\t$separator = ', ';\n\t\t$negative = 'negative ';\n\t\t$decimal = ' point ';\n\t\t$dictionary = array(\n\t\t\t0 => 'zero',\n\t\t\t1 => 'one',\n\t\t\t2 => 'two',\n\t\t\t3 => 'three',\n\t\t\t4 => 'four',\n\t\t\t5 => 'five',\n\t\t\t6 => 'six',\n\t\t\t7 => 'seven',\n\t\t\t8 => 'eight',\n\t\t\t9 => 'nine',\n\t\t\t10 => 'ten',\n\t\t\t11 => 'eleven',\n\t\t\t12 => 'twelve',\n\t\t\t13 => 'thirteen',\n\t\t\t14 => 'fourteen',\n\t\t\t15 => 'fifteen',\n\t\t\t16 => 'sixteen',\n\t\t\t17 => 'seventeen',\n\t\t\t18 => 'eighteen',\n\t\t\t19 => 'nineteen',\n\t\t\t20 => 'twenty',\n\t\t\t30 => 'thirty',\n\t\t\t40 => 'fourty',\n\t\t\t50 => 'fifty',\n\t\t\t60 => 'sixty',\n\t\t\t70 => 'seventy',\n\t\t\t80 => 'eighty',\n\t\t\t90 => 'ninety',\n\t\t\t100 => 'hundred',\n\t\t\t1000 => 'thousand',\n\t\t\t1000000 => 'million',\n\t\t\t1000000000 => 'billion',\n\t\t\t1000000000000 => 'trillion',\n\t\t\t1000000000000000 => 'quadrillion',\n\t\t\t1000000000000000000 => 'quintillion'\n\t\t);\n\n\t\tif (!is_numeric($number)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {\n\t\t\t// overflow\n\t\t\ttrigger_error(\n\t\t\t\t'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,\n\t\t\t\tE_USER_WARNING\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($number < 0) {\n\t\t\treturn $negative . convert_number_to_words(abs($number));\n\t\t}\n\n\t\t$string = $fraction = null;\n\n\t\tif (strpos($number, '.') !== false) {\n\t\t\tlist($number, $fraction) = explode('.', $number);\n\t\t}\n\n\t\tswitch (true) {\n\t\t\tcase $number < 21:\n\t\t\t\t$string = $dictionary[$number];\n\t\t\t\tbreak;\n\t\t\tcase $number < 100:\n\t\t\t\t$tens = ((int) ($number / 10)) * 10;\n\t\t\t\t$units = $number % 10;\n\t\t\t\t$string = $dictionary[$tens];\n\t\t\t\tif ($units) {\n\t\t\t\t\t$string .= $hyphen . $dictionary[$units];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $number < 1000:\n\t\t\t\t$hundreds = $number / 100;\n\t\t\t\t$remainder = $number % 100;\n\t\t\t\t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $conjunction . convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$baseUnit = pow(1000, floor(log($number, 1000)));\n\t\t\t\t$numBaseUnits = (int) ($number / $baseUnit);\n\t\t\t\t$remainder = $number % $baseUnit;\n\t\t\t\t$string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $remainder < 100 ? $conjunction : $separator;\n\t\t\t\t\t$string .= convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (null !== $fraction && is_numeric($fraction)) {\n\t\t\t$string .= $decimal;\n\t\t\t$words = array();\n\t\t\tforeach (str_split((string) $fraction) as $number) {\n\t\t\t\t$words[] = $dictionary[$number];\n\t\t\t}\n\t\t\t$string .= implode(' ', $words);\n\t\t}\n\n\t\treturn $string;\n\t}", "public function convert($number)\n {\n if ($number % 15 == 0) {\n return \"FizzBuzz\";\n } elseif ($number % 3 == 0) {\n return \"Fizz\";\n } elseif ($number % 5 == 0) {\n return \"Buzz\";\n }\n \n return $number;\n }", "function nb2chiffres($nb){\n\treturn sprintf(\"%02d\", $nb);\n}", "public function nice_number($n) {\r\n $n = (0+str_replace(\",\", \"\", $n));\r\n\r\n // is this a number?\r\n if (!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).' T'; //trillion\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).' B'; //billion\r\n elseif ($n > 1000000) return round(($n/1000000), 2).' M';//million\r\n elseif ($n > 1000) return round(($n/1000), 2).' TH'; //thousand\r\n\r\n return number_format($n);\r\n}", "function numeral($number) {\r\n $test = abs($number) % 10;\r\n $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));\r\n return $number . $ext;\r\n}", "function changeNumToStr($num = 0){\n\n $str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n $arr_tmp = [];\n\n while($num > 26) {\n\n $step = $num % 26;\n $arr_tmp[] = $step;\n $num = $num/26;\n\n }\n\n $arr_tmp[] = (int)floor($num);\n $arr_tmp = array_reverse($arr_tmp);\n $res_str = '';\n foreach ($arr_tmp as $str_key) {\n $res_str .= $str[$str_key-1];\n }\n return $res_str;\n}", "function dokan_number_format( $number ) {\n $threshold = 10000;\n\n if ( $number > $threshold ) {\n return number_format( $number/1000, 0, '.', '' ) . ' K';\n }\n\n return $number;\n}", "function number_to_words($val, $lang = \"en\") {\n $f = new NumberFormatter($lang, NumberFormatter::SPELLOUT);\n return $f->format($val);\n}", "function nice_number( $n ) {\n\t$n = (0 + str_replace( ',', '', $n ) );\n\t// is this a number? (o yes, almost certain - but...)\n\tif ( ! is_numeric( $n ) ) return false;\n\t// now filter it;\n\tif ( $n > 1000000000000 ) return round( ($n / 1000000000000), 1 ) . 't';\n\telse if ( $n > 1000000000 ) return round( ($n / 1000000000), 1 ) . 'b';\n\telse if ( $n > 1000000 ) return round( ($n / 1000000), 1 ) . 'm';\n\telse if ( $n > 1000 ) return round( ($n / 1000), 1 ) . 'k';\n\treturn number_format( $n );\n}", "public static function int2str(int $i): string\n {\n return base_convert(dechex($i), 16, 36);\n }", "private function convertToWord($number)\n {\n $error_code = $this->checkParamaters($number, 'w');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $hyphen = '-';\n $conjunction = ' and ';\n $separator = ', ';\n $negative = 'negative ';\n $decimal = ' point ';\n\n if ($number < 0) {\n return $negative.$this->convertToWord(abs($number));\n }\n\n $string = $fraction = null;\n\n if (strpos($number, '.') !== false) {\n list($number, $fraction) = explode('.', $number);\n }\n\n switch (true) {\n case $number < 21:\n $string = $this->word_dictionary[$number];\n break;\n case $number < 100:\n $tens = ((int) ($number / 10)) * 10;\n $units = $number % 10;\n $string = $this->word_dictionary[$tens];\n if ($units) {\n $string .= $hyphen.$this->word_dictionary[$units];\n }\n break;\n case $number < 1000:\n $hundreds = $number / 100;\n $remainder = $number % 100;\n $string = $this->word_dictionary[$hundreds].' '.$this->word_dictionary[100];\n if ($remainder) {\n $string .= $conjunction.$this->convertToWord($remainder);\n }\n break;\n default:\n $baseUnit = pow(1000, floor(log($number, 1000)));\n $numBaseUnits = (int) ($number / $baseUnit);\n $remainder = $number % $baseUnit;\n $string = $this->convertToWord($numBaseUnits).' '.$this->word_dictionary[$baseUnit];\n if ($remainder) {\n $string .= $remainder < 100 ? $conjunction : $separator;\n $string .= $this->convertToWord($remainder);\n }\n break;\n }\n\n if (null !== $fraction && is_numeric($fraction)) {\n $string .= $decimal;\n $words = [];\n foreach (str_split((string) $fraction) as $number) {\n $words[] = $this->word_dictionary[$number];\n }\n $string .= implode(' ', $words);\n }\n\n return $string;\n }", "public function numberToLetters(int $number) : string\n {\n $number -= 1;\n for($r = \"\"; $number >= 0; $number = intval($number / 26) - 1) {\n $r = chr($number%26 + 0x41) . $r;\n }\n return $r;\n }", "function num_to_short($num)\n{\n\tif (is_float($num))\n\t\t$num = round($num);\n\t\n\tif ($num >= 1000) {\n\t\t$i = 1000;\n\t\twhile ($num >= $i) {\n\t\t\t$return = ($i/1000). \"K\";\n\t\t\t\n\t\t\tif ($num > $i)\n\t\t\t\t$return .= \"+\";\n\t\t\t\n\t\t\t$i += 1000;\n\t\t}\n\t} else\n\t\t$return = $num;\n\t\n\treturn $return;\n}", "function show_ordinal($num) \n\t{\n\t\t$the_num = (string) $num;\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\tswitch($last_digit) \n\t\t{\n\t\t\tcase \"1\":\n\t\t\t\t$the_num.=\"st\";\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$the_num.=\"nd\";\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$the_num.=\"rd\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\treturn $the_num;\n\t}", "function convertNumberToWordsForIndia($number){\n $words = array(\n '0'=> '' ,'1'=> 'one' ,'2'=> 'two' ,'3' => 'three','4' => 'four','5' => 'five',\n '6' => 'six','7' => 'seven','8' => 'eight','9' => 'nine','10' => 'ten',\n '11' => 'eleven','12' => 'twelve','13' => 'thirteen','14' => 'fouteen','15' => 'fifteen',\n '16' => 'sixteen','17' => 'seventeen','18' => 'eighteen','19' => 'nineteen','20' => 'twenty',\n '30' => 'thirty','40' => 'fourty','50' => 'fifty','60' => 'sixty','70' => 'seventy',\n '80' => 'eighty','90' => 'ninty');\n \n //First find the length of the number\n $number_length = strlen($number);\n //Initialize an empty array\n $number_array = array(0,0,0,0,0,0,0,0,0);\n $received_number_array = array();\n \n //Store all received numbers into an array\n for($i=0;$i<$number_length;$i++){\n $received_number_array[$i] = substr($number,$i,1);\n }\n //Populate the empty array with the numbers received - most critical operation\n for($i=9-$number_length,$j=0;$i<9;$i++,$j++){\n $number_array[$i] = $received_number_array[$j];\n }\n $number_to_words_string = \"\";\n //Finding out whether it is teen ? and then multiply by 10, example 17 is seventeen, so if 1 is preceeded with 7 multiply 1 by 10 and add 7 to it.\n for($i=0,$j=1;$i<9;$i++,$j++){\n //\"01,23,45,6,78\"\n //\"00,10,06,7,42\"\n //\"00,01,90,0,00\"\n if($i==0 || $i==2 || $i==4 || $i==7){\n if($number_array[$j]==0 || $number_array[$i] == \"1\"){\n $number_array[$j] = intval($number_array[$i])*10+$number_array[$j];\n $number_array[$i] = 0;\n }\n \n }\n }\n $value = \"\";\n for($i=0;$i<9;$i++){\n if($i==0 || $i==2 || $i==4 || $i==7){\n $value = $number_array[$i]*10;\n }\n else{\n $value = $number_array[$i];\n }\n if($value!=0) { $number_to_words_string.= $words[\"$value\"].\" \"; }\n if($i==1 && $value!=0){ $number_to_words_string.= \"Crores \"; }\n if($i==3 && $value!=0){ $number_to_words_string.= \"Lakhs \"; }\n if($i==5 && $value!=0){ $number_to_words_string.= \"Thousand \"; }\n if($i==6 && $value!=0){ $number_to_words_string.= \"Hundred &amp; \"; }\n }\n if($number_length>9){ $number_to_words_string = \"Sorry This does not support more than 99 Crores\"; }\n return ucfirst(strtolower($number_to_words_string).\" only.\");\n}", "function bd_nice_number($n) {\n // Strip any formatting;\n $n = (0+str_replace(\",\",\"\",$n));\n \n // Check if it's a num\n if(!is_numeric($n)) return false;\n \n // Filter through trillions, billions, and millions\n if($n>1000000000000) return round(($n/1000000000000),2).'T';\n else if($n>1000000000) return round(($n/1000000000),2).'B';\n else if($n>1000000) return round(($n/1000000),2).'M';\n \n return number_format($n);\n}", "function formatNumber($number)\n {\n $stringLength = strlen($number);\n\n if ($stringLength > 5) {\n return round($number / 1000, 2).'K';\n }\n return $number;\n }", "function modify_number($number){\n //get the part of the string after the first zero\n $num = substr($number,1,strlen($number));\n //chunk the number into groups of threes\n $num_chunked = chunk_split($num,3,' ');\n return ' (0) '.$num_chunked;\n}", "function toChinese($number) {\n $wording = str_split((string)$number);\n\n $numberArray = ['十', '一', '二', '三', '四', '五', '六', '七', '八', '九'];\n $tenNumberArray = ['十', '廿', '卅', '四', '五', '六', '七', '八', '九'];\n\n if ($number > 10) {\n return $tenNumberArray[(int)$wording[0] - 1] . $numberArray[(int)$wording[1]];\n }\n if ($number == 10) {\n return '十' . '岁';\n }\n return $numberArray[(int)$wording[0]] . '岁';\n }", "public static function formatted(int $number): string {\n if($number > 100 && $number % 100 !== 0){ \n $prepend = 'and'; \n } else {\n $prepend = ''; \n }\n return str_replace(['-',' '],'',self::format($number)).$prepend;\n }", "function convertNumber($num) {\n $count = 0;\n global $ones, $tens, $triplets;\n $ones = array(\n '',\n ' One',\n ' Two',\n ' Three',\n ' Four',\n ' Five',\n ' Six',\n ' Seven',\n ' Eight',\n ' Nine',\n ' Ten',\n ' Eleven',\n ' Twelve',\n ' Thirteen',\n ' Fourteen',\n ' Fifteen',\n ' Sixteen',\n ' Seventeen',\n ' Eighteen',\n ' Nineteen'\n );\n $tens = array(\n '',\n '',\n ' Twenty',\n ' Thirty',\n ' Forty',\n ' Fifty',\n ' Sixty',\n ' Seventy',\n ' Eighty',\n ' Ninety'\n );\n\n $triplets = array(\n '',\n ' Thousand',\n ' Million',\n ' Billion',\n ' Trillion',\n ' Quadrillion',\n ' Quintillion',\n ' Sextillion',\n ' Septillion',\n ' Octillion',\n ' Nonillion'\n );\n return convertNum($num);\n}", "public function getInWords($number)\n {\n return NumberToString::numberToString($number);\n }", "function transNumber($input) \n{\n $faRes=\"\";\n $input=\"$input\";\n $len=strlen($input);\n for ($i=0; $i<$len; $i++)\n switch($input[$i]) {\n case \"0\": $faRes.=\"۰\"; break;\n case \"1\": $faRes.=\"۱\"; break;\n case \"2\": $faRes.=\"۲\"; break;\n case \"3\": $faRes.=\"۳\"; break;\n case \"4\": $faRes.=\"۴\"; break;\n case \"5\": $faRes.=\"۵\"; break;\n case \"6\": $faRes.=\"۶\"; break;\n case \"7\": $faRes.=\"۷\"; break;\n case \"8\": $faRes.=\"۸\"; break;\n case \"9\": $faRes.=\"۹\"; break;\n default: $faRes.= $input[$i]; break;\n }\n return $faRes;\n}", "public static function format(int $number): string {\n $f = new \\NumberFormatter(\"en-GB\", \\NumberFormatter::SPELLOUT);\n return $f->format($number);\n }", "function timify($input) {return \"about \".round($input*100)/100;}", "function format_number_in_french($number)\n {\n return number_format($number, 2, ',', ' ');\n }", "public static function numberToWord($number, $isnepali = false)\n {\n if($isnepali)\n $number = self::nepaliToEnglish($number);\n $nepali = '';\n //convert the word to nepali language text\n $number = strval($number);\n //first of all, seperate it into integer and float\n $intval = intval($number);\n $floatval = 0;\n $numberofzeros = 0;\n //get value after decimal place\n if( ($position = strpos($number,'.')) !== FALSE)\n {\n //find leading zeros in floating point value\n for($j = $position+1; $j < strlen($number) ; $j++)\n if(intval($number[$j]) != 0)\n break;\n else\n $numberofzeros++;\n $floatval = intval(substr($number,$position+1,strlen($number)-$position));\n }\n if($intval >= 100)\n {\n foreach( self::$abovehundred as $denom => $word)\n {\n if($intval >= $denom)\n {\n $nepali .= self::numberToWord(intval($intval/$denom)).\" \".$word.\" \";\n $intval = $intval % $denom;\n }\n }\n }\n //if it is less than 100, then problem solved\n if($intval < 100)\n {\n if(strlen($nepali) > 0)\n {\n if($intval != 0)\n $nepali .= self::$belowhundred[$intval].' ';\n }\n else\n $nepali .= self::$belowhundred[$intval].' ';\n }\n\n\n if($floatval > 0)\n {\n $nepali .='दस्मलब ';\n for($j = 0;$j < $numberofzeros; $j++)\n $nepali .= self::$belowhundred[0].' ';\n $floatval = strval($floatval);\n for($j=0; $j < strlen($floatval); $j++)\n $nepali .= self::$belowhundred[intval($floatval[$j])].' ';\n }\n return $nepali;\n }", "public function formaRatingtNumber($number)\n {\n return number_format($number, 2, '.', '');\n }", "function coord2Text ( $coord ) {\n\t\t$signe = ($coord == abs($coord)) ? \"\" : \"-\" ;\n\t\t$coord = abs($coord);\n \n\t\t$text = $signe;\n\t\t$graus = $coord;\n\t\t$minuts = ($graus - floor($graus)) * 60;\n\t\t$segons = ($minuts - floor($minuts)) * 60;\n\t\t\n\t\t$text .= floor($graus) . \"º\" . floor($minuts) . \"'\" . floor($segons*10000)/10000 . \"''\";\n \n\t\treturn $text;\n}", "function convertTri($num, $tri) {\n global $ones, $tens, $triplets, $count;\n $test = $num;\n $count++;\n // chunk the number, ...rxyy\n // init the output string\n $str = '';\n // to display hundred & digits\n if ($count == 1) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n // To display lakh and thousands\n else if($count == 2) {\n $r = (int) ($num / 10000);\n $x = ($num / 100) % 100;\n $y = $num % 100;\n $str .= commonloop($x, '', ' Lakh ');\n $str .= commonloop($y);\n if ($str != '')\n $str .= $triplets[$tri];\n }\n // to display till hundred crore\n else if($count == 3) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n else {\n $r = (int) ($num / 1000);\n }\n // add triplet modifier only if there\n // is some output to be modified...\n // continue recursing?\n if ($r > 0)\n return convertTri($r, $tri+1) . $str;\n else\n return $str;\n}", "public static function nice_number($number){\n\t\treturn number_format($number,0,'',',');\n\t}", "public static function toWord($digits){\n $digits = str_replace(',','.',$digits);\n if(is_numeric($digits)){\n $digitsArrray = explode('.', $digits);\n\n $digits = $digitsArrray[0];\n $ret_string = \"\";\n $sub_ret_string = \"\";\n\n for($i = 10; $i>=0; $i--){\n $pw = pow(1000,$i);\n \n if((int)($digits / $pw) != 0){\n \n $str = (int)($digits / $pw);\n \n if((strlen($str) - 3) == -1){\n $sub_dig = substr($str, (strlen($str) - 2), 3);\n }else{\n $sub_dig = substr($str, (strlen($str) - 3), 3);\n }\n \n $sub_len = strlen($sub_dig);\n \n $flag = false;\n $sub_ret_string = \"\";\n for($j=0; $j<$sub_len; $j++){\n $post = ($sub_len-1) - $j;\n\n if($sub_len == 3){\n if($j == 1 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }elseif($sub_len == 2){\n if($j == 0 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }else{\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }\n $ret_string .= self::getTriolName($pw, $sub_ret_string).' ';\n }\n }\n $ret_string = self::mb_ucfirst($ret_string);\n return [$ret_string, empty($digitsArrray[1])? \"00\":$digitsArrray[1]];\n }\n return [\"0\",\"00\"];\n }", "public static function human_number( $number ) {\n\n\t\tif ( ! is_numeric( $number ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$negative = '';\n\t\tif ( abs( $number ) != $number ) {\n\t\t\t$negative = '-';\n\t\t\t$number = abs( $number );\n\t\t}\n\n\t\tif ( $number < 1000 ) {\n\t\t\treturn $negative ? -1 * $number : $number;\n\t\t}\n\n\t\t$unit = intval( log( $number, 1000 ) );\n\t\t$units = array( '', 'K', 'M', 'B', 'T', 'Q' );\n\n\t\tif ( array_key_exists( $unit, $units ) ) {\n\t\t\treturn sprintf( '%s%s%s', $negative, rtrim( number_format( $number / pow( 1000, $unit ), 1 ), '.0' ), $units[ $unit ] );\n\t\t}\n\n\t\treturn $number;\n\t}", "function num2alpha($n)\n{\n $r = '';\n\n while($n > 0)\n {\n $r = chr(($n % 26) + 0x41) . $r;\n $n = intval($n / 26);\n }\n\n return $r;\n}", "function covertirNumLetras()\r\n{\r\n\r\n\t$number = $this->monto;\r\n\r\n\t//number = number_format (number, 2);\r\n $number1=$number;\r\n\r\n\r\n //settype (number, \"integer\");\r\n $cent = strpos($number1,\".\");\r\n\r\n if($cent > 0){\r\n\t\r\n\t$centavos = substr($number1,$cent+1,2);\r\n\t\r\n }else{\r\n\r\n \t$centavos = \"00\";\r\n\t\r\n\t}\r\n\t/* \r\n\t $cent = split(\".\",$number1,7); \r\n\r\n\t\techo $cent[4];\r\n\t\texit();\r\n\r\n\t $centavos = $cent[1];\r\n\r\n\t if ($centavos == 0 || empty($centavos)){\r\n\t \t$centavos = \"00\";\r\n\t }\r\n\t*/\r\n\t/*\r\n\t \r\n\t if (number == 0 || number == \"\") \r\n\t { // if amount = 0, then forget all about conversions, \r\n\t centenas_final_string=\" cero \"; // amount is zero (cero). handle it externally, to \r\n\t // function breakdown \r\n\t } \r\n\t else \r\n\t { \r\n \r\n \r\n\r\n\t \r\n millions = ObtenerParteEntDiv(number, 1000000); // first, send the millions to the string \r\n number = mod(number, 1000000); // conversion function \r\n \r\n\t alert(millions);\r\n\t \r\n if (millions != 0)\r\n { \r\n // This condition handles the plural case \r\n if (millions == 1) \r\n { // if only 1, use 'millon' (million). if \r\n descriptor= \" millon \"; // > than 1, use 'millones' (millions) as \r\n } \r\n else \r\n { // a descriptor for this triad. \r\n descriptor = \" millones \"; \r\n } \r\n } \r\n else \r\n { \r\n descriptor = \" \"; // if 0 million then use no descriptor. \r\n } \r\n millions_final_string = string_literal_conversion(millions)+descriptor; \r\n */ \r\n\r\n\r\n $thousands = $this->ObtenerParteEntDiv($number, 1000); // now, send the thousands to the string \r\n $number = fmod($number, 1000); // conversion function. \r\n //print \"Th:\".thousands;\r\n if ($thousands != 1) \r\n { // This condition eliminates the descriptor \r\n $thousands_final_string = $this->string_literal_conversion($thousands) . \" mil \"; \r\n // descriptor = \" mil \"; // if there are no thousands on the amount \r\n } \r\n if ($thousands == 1)\r\n {\r\n $thousands_final_string = \" mil \"; \r\n }\r\n if ($thousands < 1) \r\n { \r\n $thousands_final_string = \" \"; \r\n } \r\n \r\n // this will handle numbers between 1 and 999 which \r\n // need no descriptor whatsoever. \r\n\r\n\r\n $centenas = $number; \r\n $centenas_final_string = $this->string_literal_conversion($centenas) ; \r\n \r\n\t// } //end if (number ==0) \r\n\r\n /*if (ereg(\"un\",centenas_final_string))\r\n {\r\n centenas_final_string = ereg_replace(\"\",\"o\",centenas_final_string); \r\n }*/\r\n //finally, print the output. \r\n\r\n /* Concatena los millones, miles y cientos*/\r\n\r\n\r\n $cad = $thousands_final_string.$centenas_final_string; \r\n \r\n /* Convierte la cadena a Mayúsculas*/\r\n $cad = strtoupper($cad); \r\n\r\n\r\n\r\n\t/*\r\n\t if (strlen($centavos) > 2)\r\n\t { \r\n\t if(substr($centavos.substring,2,3) >= 5){\r\n\t $centavos = substr($centavos,0,1).(parseInt(centavos.substring(1,2)).1).toString();\r\n\t }else{\r\n\t centavos = centavos.substring(0,2);\r\n\t }\r\n\t }\r\n\r\n\t*/\r\n\r\n\r\n if (strlen($centavos) == 1)\r\n {\r\n $centavos = $centavos.\"0\";\r\n }\r\n $centavos = $centavos. \"/100\"; \r\n\r\n\r\n if ($number == 1)\r\n {\r\n $moneda = \" PESO \"; \r\n }\r\n else\r\n {\r\n $moneda = \" PESOS \"; \r\n }\r\n \r\n /* Regresa el número en cadena entre paréntesis y con tipo de moneda y la fase M.N.*/\r\n\r\n return $cad.$moneda.\" \".$centavos.\" M.N.\";\r\n \r\n}", "function base_convert($number, $source, $target): string\n{\n return Base::convert($number, $source, $target);\n}", "public static function shortEncode(int $num): string {\n $codes = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $array = [];\n while ($num > 0){\n $array[] = $num % 62;\n $num = floor($num / 62);\n }\n if (count($array) < 1) $array = [0];\n foreach ($array as &$value) {\n $value = $codes[$value];\n }\n return strrev(implode('',$array));\n }", "function get_string_number($num) {\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables();\n $meta = $this->ORIGINALS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function NumToLetter($NumValue)\n\t{\n\t\treturn ( chr($NumValue + 97) );\n\t}", "function Terbilang($x)\n{\n $abil = array(\"\", \"satu\", \"dua\", \"tiga\", \"empat\", \"lima\", \"enam\", \"tujuh\", \"delapan\", \"sembilan\", \"sepuluh\", \"sebelas\");\n if ($x < 12)\n\treturn \" \" . $abil[$x];\n elseif ($x < 20)\n\treturn Terbilang($x - 10) . \"belas\";\n elseif ($x < 100)\n\treturn Terbilang($x / 10) . \" puluh\" . Terbilang($x % 10);\n elseif ($x < 200)\n\treturn \" seratus\" . Terbilang($x - 100);\n elseif ($x < 1000)\n\treturn Terbilang($x / 100) . \" ratus\" . Terbilang($x % 100);\n elseif ($x < 2000)\n\treturn \" seribu\" . Terbilang($x - 1000);\n elseif ($x < 1000000)\n\treturn Terbilang($x / 1000) . \" ribu\" . Terbilang($x % 1000);\n elseif ($x < 1000000000)\n\treturn Terbilang($x / 1000000) . \" juta\" . Terbilang($x % 1000000);\n}", "function int_to_word($n)\r\n\t{\r\n\t\treturn chr($n & 255).chr(($n >> 8) & 255);\r\n\t}", "private function calculateNumber($number)\n {\n switch ($number % 15) {\n case 3:\n case 6:\n case 9:\n return ' Fizz';\n break;\n\n case 5:\n case 10:\n return ' Buzz';\n break;\n\n case 0:\n return ' FizzBuzz';\n break;\n\n default:\n return '';\n break;\n }\n }", "function convertNumbersToFarsi($srting,$mode='html')\n\t{\n\t\tif ($mode=='html') {\n\t\t\t$num0=\"&#1776;\";\n\t\t\t$num1=\"&#1777;\";\n\t\t\t$num2=\"&#1778;\";\n\t\t\t$num3=\"&#1779;\";\n\t\t\t$num4=\"&#1780;\";\n\t\t\t$num5=\"&#1781;\";\n\t\t\t$num6=\"&#1782;\";\n\t\t\t$num7=\"&#1783;\";\n\t\t\t$num8=\"&#1784;\";\n\t\t\t$num9=\"&#1785;\";\n\t\t} elseif($mode=='plainText') {\n\t\t\t$num0=chr(hexdec('DB')).chr(hexdec('B0'));\n\t\t\t$num1=chr(hexdec('DB')).chr(hexdec('B1'));\n\t\t\t$num2=chr(hexdec('DB')).chr(hexdec('B2'));\n\t\t\t$num3=chr(hexdec('DB')).chr(hexdec('B3'));\n\t\t\t$num4=chr(hexdec('DB')).chr(hexdec('B4'));\n\t\t\t$num5=chr(hexdec('DB')).chr(hexdec('B5'));\n\t\t\t$num6=chr(hexdec('DB')).chr(hexdec('B6'));\n\t\t\t$num7=chr(hexdec('DB')).chr(hexdec('B7'));\n\t\t\t$num8=chr(hexdec('DB')).chr(hexdec('B8'));\n\t\t\t$num9=chr(hexdec('DB')).chr(hexdec('B9'));\n\t\t}\n\n\t\t$stringtemp=\"\";\n\t\t$len=strlen($srting);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif(substr($srting,$sub,1)==\"0\")$stringtemp.=$num0;\n\t\t\telseif(substr($srting,$sub,1)==\"1\")$stringtemp.=$num1;\n\t\t\telseif(substr($srting,$sub,1)==\"2\")$stringtemp.=$num2;\n\t\t\telseif(substr($srting,$sub,1)==\"3\")$stringtemp.=$num3;\n\t\t\telseif(substr($srting,$sub,1)==\"4\")$stringtemp.=$num4;\n\t\t\telseif(substr($srting,$sub,1)==\"5\")$stringtemp.=$num5;\n\t\t\telseif(substr($srting,$sub,1)==\"6\")$stringtemp.=$num6;\n\t\t\telseif(substr($srting,$sub,1)==\"7\")$stringtemp.=$num7;\n\t\t\telseif(substr($srting,$sub,1)==\"8\")$stringtemp.=$num8;\n\t\t\telseif(substr($srting,$sub,1)==\"9\")$stringtemp.=$num9;\n\t\t\telse $stringtemp.=substr($srting,$sub,1);\n\t\t}\n\t\treturn $stringtemp;\n\t}", "public function NumberToWord($number,$Currency)\r\n\t{\r\n\t\t$hyphen = '-';\r\n\t\t$conjunction = ' and ';\r\n\t\t$separator = ', ';\r\n\t\t$negative = 'negative ';\r\n\t\t$decimal = ' taka ';\r\n\t\t$paisa = ' paisa ';\r\n\t\tif($Currency==\"USD\" || $Currency==\"AUD\" || $Currency==\"EUR\")\r\n\t\t{\r\n\t\t\t$decimal = ' '.$Currency.' ';\r\n\t\t\t$paisa = ' cent ';\r\n\t\t}\r\n\t\t$dictionary = array(\r\n 0 => 'zero',\r\n 1 => 'one',\r\n 2 => 'two',\r\n 3 => 'three',\r\n 4 => 'four',\r\n 5 => 'five',\r\n 6 => 'six',\r\n 7 => 'seven',\r\n 8 => 'eight',\r\n 9 => 'nine',\r\n 10 => 'ten',\r\n 11 => 'eleven',\r\n 12 => 'twelve',\r\n 13 => 'thirteen',\r\n 14 => 'fourteen',\r\n 15 => 'fifteen',\r\n 16 => 'sixteen',\r\n 17 => 'seventeen',\r\n 18 => 'eighteen',\r\n 19 => 'nineteen',\r\n 20 => 'twenty',\r\n 30 => 'thirty',\r\n 40 => 'forty',\r\n 50 => 'fifty',\r\n 60 => 'sixty',\r\n 70 => 'seventy',\r\n 80 => 'eighty',\r\n 90 => 'ninety',\r\n 100 => 'hundred',\r\n 1000 => 'thousand',\r\n\t\t100000 => 'lac',\r\n 10000000 => 'crore'\r\n \t\t );\r\n\t\t if (!is_numeric($number))\r\n\t\t {\r\n \t\treturn false;\r\n \t\t }\r\n \r\n \t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX)\r\n\t\t {// overflow\r\n \ttrigger_error('convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, cE_USER_WARNING);\r\n \t\treturn false;\r\n \t\t }\r\n\r\n \tif ($number < 0)\r\n\t\t{\r\n \t\treturn $negative . $this->NumberToWord($number*-1,$Currency);\r\n \t}\r\n \r\n \t \t$string = $fraction = null;\r\n \r\n \tif (strpos($number, '.') !== false)\r\n\t\t{\r\n \tlist($number, $fraction) = explode('.', $number);\r\n \t\t}\r\n \r\n \tswitch (true) \r\n\t\t{\r\n \tcase $number < 21:\r\n \t$string = $dictionary[$number];\r\n \tbreak;\r\n \tcase $number < 100:\r\n \t\t$tens = ((int) ($number / 10)) * 10;\r\n \t$units = $number % 10;\r\n \t$string = $dictionary[$tens];\r\n \tif ($units)\r\n\t\t\t\t{\r\n \t$string .= $hyphen . $dictionary[$units];\r\n \t}\r\n \tbreak;\r\n \tcase $number < 1000:\r\n \t$hundreds = $number / 100;\r\n \t$remainder = $number % 100;\r\n \t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number < 100000:\r\n\t\t\t\t$thousand = $number / 1000;\r\n \t$remainder = $number % 1000;\r\n \t$string =$this->NumberToWord((int)$thousand,$Currency). ' ' . $dictionary[1000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' '.$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number < 10000000:\r\n\t\t\t\t$lac = $number / 100000;\r\n \t$remainder = $number % 100000;\r\n \t$string = $this->NumberToWord((int)$lac,$Currency). ' ' . $dictionary[100000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number > 10000000:\r\n\t\t\t\t$crore = $number / 10000000;\r\n \t$remainder = $number % 10000000;\r\n \t$string = $this->NumberToWord((int)$crore,$Currency). ' ' . $dictionary[10000000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n \tdefault:\r\n \t$baseUnit = pow(10000000, floor(log($number, 10000000)));\r\n \t$numBaseUnits = (int) ($number / $baseUnit);\r\n \t\t$remainder = $number % $baseUnit;\r\n \t$string = $this->NumberToWord($numBaseUnits,$Currency) . ' ' . $dictionary[$baseUnit];\r\n \tif ($remainder) \r\n\t\t\t\t{\r\n \t$string .= $remainder < 100 ? $conjunction : $separator;\r\n \t$string .= $this->NumberToWord($remainder,$Currency);\r\n \t\t}\r\n \t \tbreak;\r\n \t}\r\n \t\t\t\r\n\t\tif (is_numeric($fraction)) \r\n\t\t{\r\n\t\t\t$string .= $decimal;\r\n\r\n\t\t\t$words =$this->NumberToWord((int)$fraction,$Currency);\r\n\r\n\t\t\t$string .= $conjunction . $words . $paisa;\r\n\t\t}\r\n \t\treturn $string;\r\n\t}", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "public static function formatNumber($num){\r\n\t\treturn number_format($num, 0, '', '.');\r\n\t}", "function displayMontant($val) {\n if( $val < 1000 ) return $val;\n $val = $val/1000;\n if( $val < 1000 ) return \"${val} K\";\n $val = $val/1000;\n return \"${val} M\";\n}", "function getNameFromNumber( int $num ): string {\n\t\t$numeric = $num % 26;\n\t\t$letter = chr( 65 + $numeric );\n\t\t$num2 = intval( $num / 26 );\n\t\tif ( $num2 > 0 ) {\n\t\t\treturn getNameFromNumber( $num2 - 1 ) . $letter;\n\t\t} else {\n\t\t\treturn $letter;\n\t\t}\n\t}", "function real($num, $ponto = null) {\n\t\t\t\tif ($ponto) {\n\t\t\t\t\t$ponto = \".\";\n\t\t\t\t\t$ponto2 = \",\";\n\t\t\t\t} else {\n\t\t\t\t\t$ponto = \",\";\n\t\t\t\t\t$ponto2 = \".\";\n\t\t\t\t}\n\t\t\t\t$stringAtnes = explode($ponto2, $num);\n\t\t\t\t$stringAntes = strlen($stringAtnes[0]);\n\t\t\t\t$num = substr($num, 0, $stringAntes + 3);\n\t\t\t\t//$num= round($num,2);\n\t\t\t\tif ($num) {\n\t\t\t\t\t$num = str_replace(\".\", $ponto, $num);\n\t\t\t\t\tif (strstr($num, $ponto) == false) {\n\t\t\t\t\t\t$num .= $ponto . \"00\";\n\t\t\t\t\t}\n\t\t\t\t\t$check = explode($ponto, $num);\n\t\t\t\t\tif (strstr($num, $ponto) == true and strlen($check[1]) < 2) {\n\t\t\t\t\t\t$num .= \"0\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$num = \"00\" . $ponto . \"00\";\n\t\t\t\t}\n\n\t\t\t\treturn $num;\n\t\t\t}", "public function numToAlpha(int $num): string\n {\n // fixed set of 26 uppercase letters to be used for the conversion\n $letters = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n ];\n\n /**\n * decrement the number by one to account for zero based arrays,\n * get the integer value of the number divided by 26.\n * if the number is still greater than zero call the function again.\n * else return the character in the corresponding position\n */\n\n // ensuere that $num is never less than zero\n $num = $num > 0 ? $num -= 1 : 0;\n\n $i = (int) floor($num / 26);\n\n return $i > 0 ? $this->numToAlpha($i) . $letters[$num % 26] : $letters[$num % 26];\n }", "function format($number) {\r\n\t$number = bcdiv($number, 100000000, 8);\r\n\t$point = strpos($number,\".\");\r\n\tif($point != -1) {\r\n\t\t$after = substr($number,$point+1);\r\n\t\t$after = strlen($after);\r\n\t\t$after = 8-$after;\r\n\t\tfor($i=0;$i<$after;$i++) {\r\n\t\t\t$number .= \"0\";\r\n\t\t}\r\n\t} else {\r\n\t\t$number .= \".00000000\";\r\n\t}\r\n\treturn($number);\r\n}", "public function number(): string\n {\n return $this->getData('Number');\n }", "function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}", "function number_suffix($i) {\n\t\tif ($i%10 == 1 && $i%100 != 11) {\n\t\t\treturn \"st\";\n\t\t} else if ($i%10 == 2 && $i%100 != 12) {\n\t\t\treturn \"nd\";\n\t\t} else if ($i%10 == 3 && $i%100 != 13) {\n\t\t\treturn \"rd\";\n\t\t} else {\n\t\t\treturn \"th\";\n\t\t}\n\t}", "public function NumberToWord($number,$Currency)\n\t{\n\t\t$hyphen = '-';\n\t\t$conjunction = ' and ';\n\t\t$separator = ', ';\n\t\t$negative = 'negative ';\n\t\t$decimal = ' taka ';\n\t\t$paisa = ' paisa ';\n\t\tif($Currency==\"USD\" || $Currency==\"AUD\" || $Currency==\"EUR\")\n\t\t{\n\t\t\t$decimal = ' '.$Currency.' ';\n\t\t\t$paisa = ' cent ';\n\t\t}\n\t\t$dictionary = array(\n 0 => 'zero',\n 1 => 'one',\n 2 => 'two',\n 3 => 'three',\n 4 => 'four',\n 5 => 'five',\n 6 => 'six',\n 7 => 'seven',\n 8 => 'eight',\n 9 => 'nine',\n 10 => 'ten',\n 11 => 'eleven',\n 12 => 'twelve',\n 13 => 'thirteen',\n 14 => 'fourteen',\n 15 => 'fifteen',\n 16 => 'sixteen',\n 17 => 'seventeen',\n 18 => 'eighteen',\n 19 => 'nineteen',\n 20 => 'twenty',\n 30 => 'thirty',\n 40 => 'forty',\n 50 => 'fifty',\n 60 => 'sixty',\n 70 => 'seventy',\n 80 => 'eighty',\n 90 => 'ninety',\n 100 => 'hundred',\n 1000 => 'thousand',\n\t\t100000 => 'lac',\n 10000000 => 'crore'\n \t\t );\n\t\t if (!is_numeric($number))\n\t\t {\n \t\treturn false;\n \t\t }\n \n \t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX)\n\t\t {// overflow\n \ttrigger_error('convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, cE_USER_WARNING);\n \t\treturn false;\n \t\t }\n\n \tif ($number < 0)\n\t\t{\n \t\treturn $negative . $this->NumberToWord($number*-1,$Currency);\n \t}\n \n \t \t$string = $fraction = null;\n \n \tif (strpos($number, '.') !== false)\n\t\t{\n \tlist($number, $fraction) = explode('.', $number);\n \t\t}\n \n \tswitch (true) \n\t\t{\n \tcase $number < 21:\n \t$string = $dictionary[$number];\n \tbreak;\n \tcase $number < 100:\n \t\t$tens = ((int) ($number / 10)) * 10;\n \t$units = $number % 10;\n \t$string = $dictionary[$tens];\n \tif ($units)\n\t\t\t\t{\n \t$string .= ' ' . $dictionary[$units];\n \t}\n \tbreak;\n \tcase $number < 1000:\n \t$hundreds = $number / 100;\n \t$remainder = $number % 100;\n \t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number < 100000:\n\t\t\t\t$thousand = $number / 1000;\n \t$remainder = $number % 1000;\n \t$string =$this->NumberToWord((int)$thousand,$Currency). ' ' . $dictionary[1000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' '.$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number < 10000000:\n\t\t\t\t$lac = $number / 100000;\n \t$remainder = $number % 100000;\n \t$string = $this->NumberToWord((int)$lac,$Currency). ' ' . $dictionary[100000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number > 10000000:\n\t\t\t\t$crore = $number / 10000000;\n \t$remainder = $number % 10000000;\n \t$string = $this->NumberToWord((int)$crore,$Currency). ' ' . $dictionary[10000000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n \tdefault:\n \t$baseUnit = pow(10000000, floor(log($number, 10000000)));\n \t$numBaseUnits = (int) ($number / $baseUnit);\n \t\t$remainder = $number % $baseUnit;\n \t$string = $this->NumberToWord($numBaseUnits,$Currency) . ' ' . $dictionary[$baseUnit];\n \tif ($remainder) \n\t\t\t\t{\n \t$string .= $remainder < 100 ? $conjunction : $separator;\n \t$string .= $this->NumberToWord($remainder,$Currency);\n \t\t}\n \t \tbreak;\n \t}\n \t\t\t\n\t\tif (is_numeric($fraction)) \n\t\t{\n\t\t\t$string .= $decimal;\n\n\t\t\t$words =$this->NumberToWord((int)$fraction,$Currency);\n\n\t\t\t$string .= $conjunction . $words . $paisa;\n\t\t}\n \t\treturn $string;\n\t}", "function my_convert($int, $wishedlen = 9) {\n $map = array(\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23\n 'Y', 'Z');\n $map2 = array_merge(array(\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'), $map);\n //base_convert uses int chars as well, So the mapping set is 0-9 + a-q, so 15 maps to f and not to p. We correct for\n //that so that we do not have integers in the resulting code\n $start = str_split(strtoupper(base_convert($int, 10, 26)));\n $string = '';\n foreach ($start as $c) {\n $pos = array_search($c, $map2);\n $string .= $map2[$pos + 10];\n }\n\n $len = count($start);\n if ($len < $wishedlen) {\n $pad = $wishedlen - $len - 1; //Leave one position as pad number indicator\n if ($pad > 0) {\n for ($i = 1; $i <= $pad; $i++) {\n $string = $map[rand(0, 25)] . $string;\n }\n }\n $string = $map[max($pad, 0)] . \"$string\";\n } elseif ($len == $wishedlen) {\n $string = \"A$string\";\n }\n\n return $string;\n}", "function getnote($num)\n{\n\tswitch ($num) {\n\t\tcase 1 : return 'Insuffisant';\n\t\tcase 3 : return 'Suffisant';\n\t\tcase 4 : return 'Bon';\n\t\tcase 5 : return 'Tres bon';\n\t}\n}", "function prepend_one($num) {\n\n\t\tif ($num < 10) {\n\t\t\t$num = \"0\" . $num;\n\t\t}\n\t\t\n\t\treturn $num;\n }", "private function int(int $value): string\n {\n return (string) $value;\n }", "function code2utf($num){\n\tif($num<128)return chr($num);\n\tif($num<2048)return chr(($num>>6)+192).chr(($num&63)+128);\n\tif($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);\n\tif($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);\n\treturn '';\n}", "function code2utf($num)\n{\n if ($num < 128) return chr($num);\n if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);\n if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);\n if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);\n return '';\n}", "private function convertToOrdinal($number)\n {\n $error_code = $this->checkParamaters($number, 'o');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $small_number = (int) substr($number, strlen($number) - 1);\n $big_number = (int) ($number - $small_number);\n\n $string = '';\n\n // Numbers between 20 and 99.\n if ($big_number > 0 && $number > 19 && $number < 100) {\n return $this->convertToWord($big_number).' '.$this->convertToOrdinal($small_number);\n }\n\n // Numbers over 100.\n if ($number >= 100) {\n $string = $this->convertToWord(str_pad(substr($number, 0, 1), strlen($number), '0')).'th';\n\n if ($small_number > 0) {\n $string .= ' and '.$this->convertToWord($small_number);\n }\n\n return $string;\n }\n\n return $this->small_number_string[$number];\n }", "function format($val) {\r\n //setlocale(LC_MONETARY, 'en_US');\r\n return number_format(money_format('%i', $val), 2);\r\n }", "function money_format($n)\n {\n $n = (0 + str_replace(\",\", \"\", $n));\n\n // is this a number?\n if (!is_numeric($n)) return false;\n\n // now filter it;\n if ($n > 1000000000000) return round(($n / 1000000000000), 1) . ' nghìn tỷ';\n else if ($n > 1000000000) return round(($n / 1000000000), 1) . ' tỷ';\n else if ($n > 1000000) return round(($n / 1000000), 1) . ' triệu';\n else if ($n > 1000) return round(($n / 1000), 1) . ' nghìn';\n\n return number_format($n);\n }", "public function converterRomanNumber($number) : void\n {\n\n if ($number > 0 && $number < 5000)\n {\n $alphabet = [\n [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"],\n [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"],\n [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"],\n [\"\", \"M\", \"MM\", \"MMM\", \"MMMM\"]\n ];\n\n $chars = str_split($number);\n $result = \"\";\n for ($i = 0; $i < sizeof($chars); $i++)\n {\n $result = $result . $alphabet[sizeof($chars) - 1 - $i][intval($chars[$i])];\n }\n echo \"L'équivalent de \" . $number . \" en nombre romain est : \" . $result . ' ';\n }\n else\n {\n echo \"Votre nombre n'est pas compris dans la plage ]0;5000[\";\n }\n }", "function numberToLetter($num){\n switch ($num){\n case 1:\n return 'A';\n case 2:\n return 'B';\n case 3:\n return 'C';\n case 4:\n return 'D';\n case 5:\n return 'E';\n case 6:\n return 'F';\n case 7:\n return 'G';\n case 8:\n return 'H';\n case 9:\n return 'I';\n case 10:\n return 'J';\n case 11:\n return 'K';\n case 12:\n return 'L';\n case 13:\n return 'M';\n case 14:\n return 'N';\n case 15:\n return 'O';\n case 16:\n return 'P';\n case 17:\n return 'R';\n case 18:\n return 'S';\n case 19:\n return 'T';\n case 20:\n return 'U';\n case 21:\n return 'W';\n case 22:\n return 'X';\n case 23:\n return 'Q';\n case 24:\n return 'V';\n case 25:\n return 'Y';\n case 26:\n return 'Z';\n default:\n return '';\n }\n \n}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "function mswTicketNumber($num) {\n global $SETTINGS;\n $zeros = '';\n if ($SETTINGS->minTickDigits>0 && $SETTINGS->minTickDigits>strlen($num)) {\n for ($i=0; $i<$SETTINGS->minTickDigits-strlen($num); $i++) {\n $zeros .= 0;\n }\n }\n return $zeros.$num;\n}", "function rupiah($n) {\n\t\treturn number_format($n,2,',','.');\n\t}", "function EncodeNumber($value)\n{\n\t$encodedValue = \"\";\n\t$modulus = $value % NUM_LETTERS;\n\t$multiplier = $value / NUM_LETTERS;\n\t$multiplierDigits = 0;\n\t$done = false;\n\n\twhile (!$done){\n\t\t$digit = $multiplier % 10;\n\t\t$temp = chr($digit + ASCII_BIG_A);\n\t\t$temp .= $encodedValue;\n\t\t$encodedValue = $temp;\n\t\t$multiplierDigits++;\n\t\tif ($multiplier < 10)\n\t\t{\n\t\t\t$done = true;\n\t\t}\n\t\t$multiplier = $multiplier / 10;\n\t}\n\n\t$encodedValue = chr($multiplierDigits + ASCII_BIG_A) . $encodedValue;\n\t$encodedValue .= chr($modulus + ASCII_BIG_A);\n\n\treturn $encodedValue;\n}", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function number_suffix($number){\n\t\tif ( is_numeric($number)){\n\t\t\t// Get the last two digits (only once)\n\t\t\t$n = $number % 100;\n\t\t} else {\n\t\t\t// If the last two characters are numbers\n\t\t\tif ( preg_match( '/[0-9]?[0-9]$/', $number, $matches )){\n\t\t\t\t// Return the last one or two digits\n\t\t\t\t$n = array_pop($matches);\n\t\t\t} else {\n\t\t\t\t// Return the string, we can add a suffix to it\n\t\t\t\treturn $number;\n\t\t\t}\n\t\t}\n\t\t// Skip the switch for as many numbers as possible.\n\t\tif ( $n > 3 && $n < 21 )\n\t\t\treturn $number . 'th';\n\t\t// Determine the suffix for numbers ending in 1, 2 or 3, otherwise add a 'th'\n\t\tswitch ( $n % 10 ){\n\t\tcase '1': return $number . 'st';\n\t\tcase '2': return $number . 'nd';\n\t\tcase '3': return $number . 'rd';\n\t\tdefault: return $number . 'th';\n\t\t}\n\t}" ]
[ "0.71019256", "0.6986452", "0.69324136", "0.6810607", "0.67665786", "0.67665786", "0.67591923", "0.66238016", "0.6580977", "0.6480469", "0.64412045", "0.6434796", "0.64276403", "0.6380777", "0.6353703", "0.63449705", "0.6322046", "0.6321694", "0.63196915", "0.63056606", "0.627798", "0.6273399", "0.62617797", "0.62027663", "0.6193776", "0.6187428", "0.6177939", "0.6172892", "0.6159637", "0.61553967", "0.6153537", "0.61382425", "0.61186916", "0.6112156", "0.6094833", "0.60863805", "0.6076147", "0.60316646", "0.603004", "0.6027639", "0.6010983", "0.5983845", "0.59674025", "0.59558225", "0.595241", "0.5951952", "0.59424555", "0.59139663", "0.5888535", "0.5876763", "0.58250046", "0.58025146", "0.5802058", "0.5797649", "0.57949585", "0.57922626", "0.5789099", "0.57829", "0.5773175", "0.57723397", "0.5771742", "0.57674116", "0.576083", "0.57560337", "0.5754256", "0.5744055", "0.57431066", "0.5739793", "0.5730579", "0.57272196", "0.57239115", "0.57164216", "0.57107955", "0.5706846", "0.5706589", "0.569426", "0.5690722", "0.5680144", "0.56785536", "0.5678103", "0.5660868", "0.5652238", "0.5650677", "0.5635452", "0.5630296", "0.5628426", "0.5623867", "0.5622119", "0.5618369", "0.5617989", "0.560469", "0.5599645", "0.5591678", "0.5587707", "0.55871236", "0.55858374", "0.5580526", "0.557331", "0.5570754", "0.5569124" ]
0.7535265
0
Calculates the relative path between $path and $rel
Вычисляет относительный путь между $path и $rel
function relativePath($path, $rel=false) { $relpath = ''; if(!$rel) $rel = getcwd(); $apath = explode(DIRECTORY_SEPARATOR, realpath($path)); $arel = explode(DIRECTORY_SEPARATOR, realpath($rel)); while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) { array_shift($apath); array_shift($arel); } return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n $doc_root = self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] );\n\n if( substr( $dir, 0, strlen( $doc_root ) ) != $doc_root )\n return false;\n\n $return = self::normalize( substr( $dir, strlen( $doc_root ) ) . \"/$path\" );\n if( substr( $return, 0, 1 ) !== \"/\" )\n $return = \"/$return\";\n\n return $return;\n }", "public static function relpath($abs_path, $root = NULL) {\n $abs_path = self::abspath($abs_path);\n// self::logmsg('Source path: \"' . $abs_path . '\"');\n if (!isset($root)) {\n $root = $_SERVER['DOCUMENT_ROOT'];\n }\n// self::logmsg('root: \"' . $root . '\"');\n $source_rel = self::get_rel_dir($root, $abs_path);\n // self::logmsg('Relative path of source (calculated): \"' . $source_rel . '\"');\n if (preg_match('/\\.\\.\\//', $source_rel)) {\n // self::logmsg('<b>Note</b>: path is outside document root. You are allowed to, but its unusual setup. When used to calculate destination folder, the \"../\"s will be removed');\n }\n return $source_rel;\n }", "function fa_get_path( $rel_path ){\n\t$path = path_join( FA_PATH, $rel_path );\n\treturn wp_normalize_path( $path );\n}", "function rel2abs_img( $rel, $base ) {\n\t\textract( parse_url( $base ) );\n\n\t\tif ( strpos( $rel,\"//\" ) === 0 ) {\n\t\t\treturn $scheme . ':' . $rel;\n\t\t}\n\n\t\t// return if already absolute URL\n\t\tif ( parse_url( $rel, PHP_URL_SCHEME ) != '' ) {\n\t\t\treturn $rel;\n\t\t}\n\n\t\t// queries and anchors\n\t\tif ( $rel[0] == '#' || $rel[0] == '?' ) {\n\t\t\treturn $base . $rel;\n\t\t}\n\n\t\t// remove non-directory element from path\n\t\t$path = preg_replace( '#/[^/]*$#', '', $path );\n\n\t\t// destroy path if relative url points to root\n\t\tif ( $rel[0] == '/' ) {\n\t\t\t$path = '';\n\t\t}\n\n\t\t// dirty absolute URL\n\t\t$abs = $path . \"/\" . $rel;\n\n\t\t// replace '//' or '/./' or '/foo/../' with '/'\n\t\t$abs = preg_replace( \"/(\\/\\.?\\/)/\", \"/\", $abs );\n\t\t$abs = preg_replace( \"/\\/(?!\\.\\.)[^\\/]+\\/\\.\\.\\//\", \"/\", $abs );\n\n\t\t// absolute URL is ready!\n\t\treturn $abs;\n\t}", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "function adjust_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= '../';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "function resolve_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= $exploded_relative_path[$relative_path_counter2] . '/';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "private static function base_relative($path = null)\n\t{\n\t\t$test\t= self::getProtocol().$_SERVER['HTTP_HOST'].\"/\".apps::getGlobal(\"router\")->getBasePath();\n\t\treturn concat_path($test,$path);\n\t}", "function rel2abs($rel, $base) {\n if (parse_url($rel, PHP_URL_SCHEME) != '')\n return $rel;\n if ($rel[0] == '#' || $rel[0] == '?')\n return $base . $rel;\n extract(parse_url($base));\n\t\t\n\t\tif(!isset($path))\n\t\t\treturn;\n\t\t\n $path = preg_replace('#/[^/]*$#', '', $path);\n if ($rel[0] == '/')\n $path = '';\n $abs = \"$host$path/$rel\";\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {\n \n }\n $abs = str_replace(\"../\", \"\", $abs);\n return $scheme . '://' . $abs;\n }", "function getPath($relativePath);", "function get_path_relative_to($path, $relative_to) {\n return substr($path, strlen($relative_to));\n }", "protected function _relpath($path) {\r\n\t\r\n\t\t\r\n\t\t$newpath = $path;\r\n\t\t\r\n\t\t\r\n\t\tif (substr($path, 0, 1) != '/') {\r\n\t\t\t$newpath = \"/$newpath\";\r\n\t\t}\r\n\t\t\r\n\t\t$newpath = preg_replace(\"/\\/$/\", \"\", $newpath);\r\n\t\r\n\t\t$ret = ($newpath == $this->root) ? '' : substr($newpath, strlen($this->root)+1);\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "public function makeRelativePath($path, $base)\n\t{\n\t\treturn str_replace($base . '/', '', $path);\n\t}", "private function getRelativePath($base, $path) {\n\t\t$base = str_replace('\\\\', '/', $base);\n\t\t$path = str_replace('\\\\', '/', $path);\n\t\t$pos = strpos($path, $base);\n\t\tif ($pos !== false && $pos == 0) {\n\t\t\t$path = substr($path , strlen($base) + 1);\n\t\t}\n\t\treturn $path;\n\t}", "public static function relativePath( $path )\n {\n if( !empty( $path ) && is_string( $path ) )\n {\n $path = Sanitize::toPath( $path );\n $root = Server::getScriptPath();\n $levels = array(\n $root,\n dirname( $root ),\n dirname( dirname( $root ) ),\n dirname( dirname( dirname( $root ) ) )\n );\n foreach( $levels as $level )\n {\n if( empty( $level ) || $levels === \"/\" ) continue;\n $path = str_replace( $level, \"\", $path );\n }\n }\n return $path;\n }", "public function rel2abs($rel, $base){\n if (parse_url($rel, PHP_URL_SCHEME) != '')\n {return $rel;}\n if (!empty($rel[0])=='#' || !empty($rel[0])=='?')\n {return $base.$rel;}\n extract(parse_url($base));\n if (isset($path)){$path = preg_replace('#/[^/]*$#', '', $path);}\n else $path = '';\n if (!empty($rel[0]) == '/'){\n $path = '';\n }\n $abs = \"$host$path/$rel\";\n $re = array('#(/.?/)#', '#/(?!..)[^/]+/../#');\n for($n=1; $n>0;$abs=preg_replace($re,'/', $abs,-1,$n)){}\n $abs=str_replace(\"../\",\"\",$abs);\n return $scheme.'://'.$abs;\n }", "function absolute_to_relative_path($path)\n{\n $pathParts = explode(DIRECTORY_SEPARATOR, $path);\n $pathParts = array_reverse($pathParts);\n array_splice($pathParts, 5);\n $pathParts = array_reverse($pathParts);\n $returnPath = CCTVALIASPATH . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $pathParts);\n $returnPath = str_replace('\\\\', '/', $returnPath);\n return $returnPath;\n}", "public function img_path($rel_path='')\n\t{\n\t\treturn $this->add_path($rel_path);\n\t}", "function rel2abs($rel, $base)\n {\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\n\n /* queries and anchors */\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\n\n /* parse base URL and convert to local variables:\n $scheme, $host, $path */\n extract(parse_url($base));\n\n /* remove non-directory element from path */\n $path = preg_replace('#/[^/]*$#', '', $path);\n\n /* destroy path if relative url points to root */\n if ($rel[0] == '/') $path = '';\n\n /* dirty absolute URL */\n $abs = \"$host$path/$rel\";\n\n /* replace '//' or '/./' or '/foo/../' with '/' */\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\n\n /* absolute URL is ready! */\n return $scheme.'://'.$abs;\n}", "function cap_make_path_relative_to ($path, $base)\n{\n $base = rtrim ($base, '/') . '/';\n if (strncmp ($path, $base, strlen ($base)) == 0) {\n return substr ($path, strlen ($base));\n }\n return $path;\n}", "public function rel2abs($rel, $base) {\n if (parse_url($rel, PHP_URL_SCHEME) != '') {\n return $rel;\n }\n if ($rel[0] == '#' || $rel[0] == '?') {\n return $base . $rel;\n }\n extract(parse_url($base));\n $path = preg_replace('#/[^/]*$#', '', $path);\n if ($rel[0] == '/') {\n $path = '';\n }\n $abs = \"$host$path/$rel\";\n $re = array('#(/.?/)#', '#/(?!..)[^/]+/../#');\n for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {}\n $abs = str_replace('../', '', $abs);\n return $scheme . '://' . $abs;\n }", "public function calculateFullPath($start_path)\n {\n \treturn $start_path . $this->getPath() . \"/\" ;\n }", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "function rel2abs($rel, $base)\r\n{\r\n /* return if already absolute URL */\r\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\r\n\r\n /* queries and anchors */\r\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\r\n\r\n /* parse base URL and convert to local variables:\r\n $scheme, $host, $path */\r\n extract(parse_url($base));\r\n\r\n /* remove non-directory element from path */\r\n $path = preg_replace('#/[^/]*$#', '', $path);\r\n\r\n /* destroy path if relative url points to root */\r\n if ($rel[0] == '/') $path = '';\r\n\r\n /* dirty absolute URL */\r\n $abs = \"$host$path/$rel\";\r\n\r\n /* replace '//' or '/./' or '/foo/../' with '/' */\r\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\r\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\r\n\r\n /* absolute URL is ready! */\r\n return $scheme.'://'.$abs;\r\n}", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function setRelativePath($txt)\n {\n $this->_relPath = $txt;\n }", "function rel2abs($rel, $base)\n{\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\n\n /* Url begins with // */\n if($rel[0] == '/' && $rel[1] == '/'){\n return 'https:' . $rel;\n }\n\n /* queries and anchors */\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\n\n /* parse base URL and convert to local variables:\n $scheme, $host, $path */\n extract(parse_url($base));\n\n /* remove non-directory element from path */\n $path = preg_replace('#/[^/]*$#', '', $path);\n\n /* destroy path if relative url points to root */\n if ($rel[0] == '/') $path = '';\n\n /* dirty absolute URL */\n $abs = \"$host$path/$rel\";\n\n /* replace '//' or '/./' or '/foo/../' with '/' */\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\n\n /* absolute URL is ready! */\n return $scheme.'://'.$abs;\n}", "public function relativePath($fullPath, $fileName, $basePath = null);", "public static function fullPath ($relPath) {\n\t\treturn (\\realpath($relPath) ?: null);\n\t}", "function fa_get_uri( $rel_path ){\n\t$uri = is_ssl() ? str_replace('http://', 'https://', FA_URL) : FA_URL;\t\n\t$path = path_join( $uri, $rel_path );\n\treturn $path;\n}", "private static function get_relative_path($from, $to)\n {\n // some compatibility fixes for Windows paths\n $from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\n $to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\n $from = str_replace('\\\\', '/', $from);\n $to = str_replace('\\\\', '/', $to);\n\n $from = explode('/', $from);\n $to = explode('/', $to);\n $rel_path = $to;\n\n foreach ($from as $depth => $dir) {\n // find first non-matching dir\n if ($dir === $to[$depth]) {\n // ignore this directory\n array_shift($rel_path);\n } else {\n // get number of remaining dirs to $from\n $remaining = count($from) - $depth;\n if ($remaining > 1) {\n // add traversals up to first matching dir\n $pad_length = (count($rel_path) + $remaining - 1) * -1;\n $rel_path = array_pad($rel_path, $pad_length, '..');\n break;\n } else {\n $rel_path[0] = './' . $rel_path[0];\n }\n }\n }\n return implode('/', $rel_path);\n }", "protected function relativePath($path)\n {\n return preg_replace('/'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', $this['system']->path), '/').'/i', '', str_replace(DIRECTORY_SEPARATOR, '/', $path), 1).'/';\n }", "public static function absolutePath ($relPath) {\n\t\tif (Path::isAbsolute($relPath)) {\n\t\t\treturn $relPath;\n\t\t}\n\t\treturn Path::join(\\Array_hx::wrap([\n\t\t\t\\Sys::getCwd(),\n\t\t\t$relPath,\n\t\t]));\n\t}", "public static function getImageRelativePath() {\n // Get the paths to the client helper folder and php file folder as an array of tokens.\n $clientHelperFolder = explode(DIRECTORY_SEPARATOR, dirname(realpath(__FILE__)));\n $imageFolder = explode(DIRECTORY_SEPARATOR, realpath(self::getInterimImageFolder('fullpath')));\n // Find the first part of the paths that is not the same.\n for ($i = 0; $i < min(count($clientHelperFolder), count($imageFolder)); $i++) {\n if ($imageFolder[$i] !== $clientHelperFolder[$i]) {\n break;\n }\n }\n // Step back up the path to the point where the 2 paths differ.\n $path = str_repeat('../', count($clientHelperFolder) - $i);\n // Add back in the different part of the path to the client helper folder.\n for ($j = $i; $j < count($imageFolder); $j++) {\n $path .= $imageFolder[$j] . '/';\n }\n return $path;\n }", "public function resolvePath($path, $relative_to = null);", "public function getRelativePath($path)\n {\n return str_replace($this->baseDir . '/', '', $path);\n }", "public function relativePath() : string {\n $path = empty($this->path) ? '' : Path::toRelative($this->path, true);\n return $path; \n }", "public function resolvePath(string $relativePath): string;", "public function getPathRelative($modifierId = false) {\n return $this->getFolder() . $this->getFilename();\n }", "function rel2abs($rel, $base) {\n if (empty($rel)) $rel = \".\";\n if (parse_url($rel, PHP_URL_SCHEME) != \"\" || strpos($rel, \"//\") === 0) return $rel; //Return if already an absolute URL\n if ($rel[0] == \"#\" || $rel[0] == \"?\") return $base.$rel; //Queries and anchors\n extract(parse_url($base)); //Parse base URL and convert to local variables: $scheme, $host, $path\n $path = isset($path) ? preg_replace('#/[^/]*$#', \"\", $path) : \"/\"; //Remove non-directory element from path\n if ($rel[0] == '/') $path = \"\"; //Destroy path if relative url points to root\n $port = isset($port) && $port != 80 ? \":\" . $port : \"\";\n $auth = \"\";\n if (isset($user)) {\n $auth = $user;\n if (isset($pass)) {\n $auth .= \":\" . $pass;\n }\n $auth .= \"@\";\n }\n $abs = \"$auth$host$path$port/$rel\"; //Dirty absolute URL\n for ($n = 1; $n > 0; $abs = preg_replace(array(\"#(/\\.?/)#\", \"#/(?!\\.\\.)[^/]+/\\.\\./#\"), \"/\", $abs, -1, $n)) {} //Replace '//' or '/./' or '/foo/../' with '/'\n return $scheme . \"://\" . $abs; //Absolute URL is ready.\n}", "public static function get_rel_dir($from_dir, $to_dir) {\n $from_dir_parts = explode('/', str_replace( '\\\\', '/', $from_dir ));\n $to_dir_parts = explode('/', str_replace( '\\\\', '/', $to_dir ));\n $i = 0;\n while (($i < count($from_dir_parts)) && ($i < count($to_dir_parts)) && ($from_dir_parts[$i] == $to_dir_parts[$i])) {\n $i++;\n }\n $rel = \"\";\n for ($j = $i; $j < count($from_dir_parts); $j++) {\n $rel .= \"../\";\n } \n\n for ($j = $i; $j < count($to_dir_parts); $j++) {\n $rel .= $to_dir_parts[$j];\n if ($j < count($to_dir_parts)-1) {\n $rel .= '/';\n }\n }\n return $rel;\n }", "private function relativePathFix($path){\n\t\t// check if page is a generated javadoc\n\t\t$page_str = $this->doc->saveHTML();\n\t\tif(preg_match('%.*Generated by javadoc.*%', $page_str)){\n\t\t\t// if it is, fix the frame-based links so that the path isn't appended to itself infinitely\n\t\t\t$path = preg_replace('%(.*\\/).*\\.html\\?(.*\\/.*)%', \"$1$2\", $path);\n\t\t}\n\t\t$dirs = explode('/', $path);\n\t\t// check if link goes up a directory\n\t\tif($dirs[0] == '..'){\n\t\t\t$new_path = explode('/', $this->current_path);\n\t\t\tif(count($dirs) == 2){\n\t\t\t\tarray_pop($new_path);\n\t\t\t\tarray_pop($new_path);\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t} else {\n\t\t\t\t// remove slash from end of current path to ensure single slashes\n\t\t\t\tif(empty($new_path[count($new_path)-1]) || is_null($new_path[count($new_path)-1])){\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// go up directories\n\t\t\t\twhile($dirs[0] == '..'){\n\t\t\t\t\tarray_shift($dirs);\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// stick the two paths together to get new path\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t\t$new_path .= implode('/', $dirs);\n\t\t\t}\n\t\t// if link it to same dir, remove the ./\n\t\t} elseif($dirs[0] == '.'){\n\t\t\t$new_path = $this->current_path.substr($path, 2);\n\t\t// if the link starts at root, use it without modification\n\t\t} elseif(empty($dirs[0]) || is_null($dirs[0])){\n\t\t\t$new_path = $path;\n\t\t} elseif(strlen($dirs[0]) == 2){\n\t\t\t$new_path = '/'.$path;\n\t\t// default to adding the link's value to the end of the current directory\n\t\t} else {\n\t\t\t$new_path = $this->current_path.$path;\n\t\t}\n\t\t\n\t\t// if the link doesn't point to a file or query string, but has no end slash, add one\n\t\tif(count(explode('.', $new_path)) < 2 && count(explode('?', $new_path)) < 2 && substr($new_path, -1) != '/'){\n\t\t\t$new_path .= '/';\n\t\t}\n\t\treturn $new_path;\n\t}", "public static function relPathBetweenURLs($path_1,$path_2)\n\t{\n\t\tif(strpos($path_1,'innovaeditor')!==false)\n\t\t{\n\t\t\t$common=Formatter::longestCommonSubsequence($path_1,$path_2);\n\t\t\t$path_1_part=str_replace($common,'',$path_1);\n\t\t\t$path_2_part=str_replace($common,'',$path_2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$path_1_part=str_replace('../','',$path_1); //assuming innovaeditor is always in root\n\t\t\t$path_2_part=$path_2;\n\t\t}\n\t\t$path_2_part_dirs=substr_count($path_2_part,'/');\n\t\t$pref_path='';\n\t\tfor($i=$path_2_part_dirs; $i>0; $i--)\n\t\t\t$pref_path .= '../';\n\t\treturn $pref_path.$path_1_part;\n\t}", "public function realpath($path, $relative = FileSystem::NONE);", "public static function generateRelativePath($path = __DIR__, $from = 'modules')\n {\n $path = realpath($path);\n $parts = explode(DIRECTORY_SEPARATOR, $path);\n foreach ($parts as $part) {\n if ($part === $from) {\n return $path;\n }\n $path = mb_substr($path, mb_strlen($part . DIRECTORY_SEPARATOR));\n }\n\n return $path;\n }", "private function getRelativePath($from, $to)\n\t{\n\t\t\t$from = explode('/', $from);\n\t\t\t$to = explode('/', $to);\n\t\t\t$relPath = $to;\n\n\t\t\tforeach($from as $depth => $dir) {\n\t\t\t\t\t// find first non-matching dir\n\t\t\t\t\tif($dir === $to[$depth]) {\n\t\t\t\t\t\t\t// ignore this directory\n\t\t\t\t\t\t\tarray_shift($relPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// get number of remaining dirs to $from\n\t\t\t\t\t\t\t$remaining = count($from) - $depth;\n\t\t\t\t\t\t\tif($remaining > 1) {\n\t\t\t\t\t\t\t\t\t// add traversals up to first matching dir\n\t\t\t\t\t\t\t\t\t$padLength = (count($relPath) + $remaining - 1) * -1;\n\t\t\t\t\t\t\t\t\t$relPath = array_pad($relPath, $padLength, '..');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$relPath[0] = './' . $relPath[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tunset($relPath[count($relPath)-1]);\n\t\t\treturn implode('/', $relPath);\n\t}", "public function absPath(string $path): string;", "abstract protected function getPath();", "function getPath($path) {\n if (substr($path,0,4)=='EXT:') {\n $keyEndPos = strpos($path, '/', 6);\n $key = substr($path,4,$keyEndPos-4);\n $keyPath = t3lib_extMgm::siteRelpath($key);\n $newPath = $keyPath.substr($path,$keyEndPos+1);\n return $newPath;\n }\telse {\n return $path;\n }\n }", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "public function get_thumb_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_thumb_name();\n\t}", "function path_res ($path) {\r\n\tif (file_exists(DIR_RES.$path)) {\r\n\t\t$path = DIR_RES.$path;\r\n\t} else {\r\n\t\t$path = \"no file $path\";\r\n\t}\r\n\treturn $path;\r\n}", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "function getPath($path) {\n\t\tif (substr($path,0,4)=='EXT:') {\n\t\t\t$keyEndPos = strpos($path, '/', 6);\n\t\t\t$key = substr($path,4,$keyEndPos-4);\n\t\t\t$keyPath = t3lib_extMgm::siteRelpath($key);\n\t\t\t$newPath = $keyPath.substr($path,$keyEndPos+1);\n\t\treturn $newPath;\n\t\t}\telse {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function testCalculatesRelativePaths()\n {\n $common = DS . 'tmp' . DS . 'sfproject' . DS;\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'plugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'plugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'webplugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'webplugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'otherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'otherplugin' . DS . 'sub', '->calculateRelativeDir() works without going up one dir');\n\n $source = 'c:\\sfproject\\web\\myplugin';\n $target = 'd:\\symfony\\plugins\\myplugin\\web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'd:\\symfony\\plugins\\myplugin\\web', '->calculateRelativeDir() returns absolute path when no relative path possible');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'myotherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'myotherplugin' . DS . 'sub', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'motherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'motherplugin' . DS . 'sub', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n // http://trac.symfony-project.org/ticket/5488\n $source = $common . '..' . DS . 'web' . DS . 'myplugin';\n $target = $common . 'lib' . DS . 'vendor' . DS . 'symfony' . DS . 'plugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'sfproject' . DS . 'lib' . DS . 'vendor' . DS . 'symfony' . DS . 'plugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n }", "protected abstract function getPath();", "public function add_path($rel_path)\n\t{\n\t\treturn ninja::add_path($rel_path);\n\t}", "public static function getRelPath($dir, $from = NULL) {\n\t\tif (!is_string($from))\n\t\t\t$from = ABSPATH;\n\n\t\t$from = explode(DIRECTORY_SEPARATOR, rtrim(realpath($from), DIRECTORY_SEPARATOR));\n\t\t$to = explode(DIRECTORY_SEPARATOR, rtrim(realpath($dir), DIRECTORY_SEPARATOR));\n\t\t\n\t\twhile(count($from) && count($to) && ($from[0] == $to[0])) {\n\t\t\tarray_shift($from);\n\t\t\tarray_shift($to);\n\t\t}\n\t\t\n\t\treturn str_pad(\"\", count($from) * 3, '..'. DIRECTORY_SEPARATOR) . implode(DIRECTORY_SEPARATOR, $to);\n\t}", "protected function getRelativeUrl($path) {\n return $this->app->getRelativeUrl($path);\n }", "private function getRelativeUrl($source, $target)\n\t{\n\t\t$relative = '';\n\t\twhile (true)\n\t\t{\n\t\t\tif ($source === $target)\n\t\t\t\treturn $relative;\n\t\t\telse if ($source === dirname($source))\n\t\t\t\treturn $relative.substr($target, 1);\n\t\t\tif (!strncmp($source.'/', $target, strlen($source) + 1))\n\t\t\t\treturn $relative.substr($target, strlen($source) + 1);\n\n\t\t\t$source = dirname($source);\n\t\t\t$relative .= '../';\n\t\t}\n\t}", "function calcRelativeDirPath ($current_url) {\n \n // gleiche bei den Beiden Pfade die Trennzeichen an \n $curr_dir_leveled = levelingDirSeperators($current_url);\n $root_dir_leveled = levelingDirSeperators(ROOT);\n \n $curr_dir = dirname($curr_dir_leveled);\n $root_dir_end = extractLastPart($root_dir_leveled);\n \n // Teile den Aktuellen Pfad an dem Ende des Root Pfades\n $path_parts = explode($root_dir_end, $curr_dir);\n \n // Der relative Pfad ist der letzte Teil\n $rel_path = array_pop($path_parts);\n \n return $rel_path;\n}", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "function _makeAbsolutePath($path, $sourcePath, $parentPath)\n\t{\n\t\tif (!preg_match('|^[a-z]+://|i', $path)) {\n\t\t\tif (substr($path, 0, 1) == \"/\") {\n\t\t\t\t// if href is an absolute URL convert it into a relative URL\n\t\t\t\t$path = makeRelativePath($sourcePath, $path);\n\t\t\t} else \n\t\t\t\tif (substr($path, 0, 2) == \"./\") {\n\t\t\t\t\t// if href is a relative URL starting with \"./\" remove the \"./\"\n\t\t\t\t\t$path = substr($path, 2);\n\t\t\t\t}\n\t\t\t// Make absolute Path out of it\n\t\t\twhile (substr($path, 0, 3) == \"../\" && strlen($parentPath) > 0 && $parentPath != \"/\") {\n\t\t\t\t$parentPath = dirname($parentPath);\n\t\t\t\t$path = substr($path, 3);\n\t\t\t}\n\t\t\tif (substr($parentPath, -1) != \"/\") {\n\t\t\t\t$parentPath = $parentPath . \"/\";\n\t\t\t}\n\t\t\treturn $parentPath . $path;\n\t\t}\n\t\treturn $path;\n\t}", "function getRelativePath($from, $to)\r\n\t{\r\n\t\t// some compatibility fixes for Windows paths\r\n\t\t$from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\r\n\t\t$to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\r\n\t\t$from = str_replace('\\\\', '/', $from);\r\n\t\t$to = str_replace('\\\\', '/', $to);\r\n\r\n\t\t$from = explode('/', $from);\r\n\t\t$to = explode('/', $to);\r\n\t\t$relPath = $to;\r\n\r\n\t\tforeach($from as $depth => $dir) {\r\n\t\t\t// find first non-matching dir\r\n\t\t\tif($dir === $to[$depth]) {\r\n\t\t\t\t// ignore this directory\r\n\t\t\t\tarray_shift($relPath);\r\n\t\t\t} else {\r\n\t\t\t\t// get number of remaining dirs to $from\r\n\t\t\t\t$remaining = count($from) - $depth;\r\n\t\t\t\tif($remaining > 1) {\r\n\t\t\t\t\t// add traversals up to first matching dir\r\n\t\t\t\t\t$padLength = (count($relPath) + $remaining - 1) * -1;\r\n\t\t\t\t\t$relPath = array_pad($relPath, $padLength, '..');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$relPath[0] = './' . $relPath[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn implode('/', $relPath);\r\n\t}", "protected function getRelativePath(string $tag, string $src) : string\n {\n return str_repeat('../', $this->getPathLevel()) . \"assets/{$this->getAssetType($tag)}/{$this->getFileName($src)}\";\n }", "public static function relativizePath($path, $context, $throw = true)\n {\n if ($context !== substr($path, 0, strlen($context))) {\n return self::error(\"$path is not within $context\", $throw);\n }\n\n return ltrim(substr($path, strlen($context)), '/');\n }", "function _wp_relative_upload_path($path)\n {\n }", "function fn_get_url_path($path)\n{\n $dir = dirname($path);\n\n if ($dir == '.' || $dir == '/') {\n return '';\n }\n\n return (defined('WINDOWS')) ? str_replace('\\\\', '/', $dir) : $dir;\n}", "function url_to_relative($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_RELATIVE_ROOT__, $url);\n}", "protected function getFileRelativePath(string $contextId, string $id, string $path, array $meta): string\n {\n return trim($path, '/');\n }", "function dirPath () { return (\"../../\"); }", "protected function normalizeRelativePath(string $path): string\n {\n $path = str_replace('\\\\', '/', $path);\n return ltrim($path, '/');\n }", "private function getRelativePath($from, $to)\n {\n $from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\n $to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\n $from = str_replace('\\\\', '/', $from);\n $to = str_replace('\\\\', '/', $to);\n\n $from = explode('/', $from);\n $to = explode('/', $to);\n $relPath = $to;\n\n foreach ($from as $depth => $dir)\n {\n // find first non-matching dir\n if ($dir === $to[$depth])\n {\n // ignore this directory\n array_shift($relPath);\n }\n else\n {\n // get number of remaining dirs to $from\n $remaining = count($from) - $depth;\n if ($remaining > 1)\n {\n // add traversals up to first matching dir\n $padLength = (count($relPath) + $remaining - 1) * -1;\n $relPath = array_pad($relPath, $padLength, '..');\n break;\n }\n else\n {\n $relPath[0] = './' . $relPath[0];\n }\n }\n }\n return implode('/', $relPath);\n }", "function build_href( $p_path ) {\n\tglobal $t_depth;\n\n\t$t_split = explode( DIRECTORY_SEPARATOR, $p_path );\n\t$t_slice = array_slice( $t_split, $t_depth );\n\n\treturn '/' . implode( '/', array_map( 'urlencode', $t_slice ) );\n}", "public function path( $relative_path = '/' ) {\n\t\treturn plugin_dir_path( $this->main_file ) . ltrim( $relative_path, '/' );\n\t}", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "private function pathify(&$path) {\n\t\t$path = realpath($path).'/';\n\t}", "public static function makeRelative(string $path, string $basePath): string\n {\n $path = self::canonicalize($path);\n $basePath = self::canonicalize($basePath);\n\n [$root, $relativePath] = self::split($path);\n [$baseRoot, $relativeBasePath] = self::split($basePath);\n\n // If the base path is given as absolute path and the path is already\n // relative, consider it to be relative to the given absolute path\n // already\n if ('' === $root && '' !== $baseRoot) {\n // If base path is already in its root\n if ('' === $relativeBasePath) {\n $relativePath = ltrim($relativePath, './\\\\');\n }\n\n return $relativePath;\n }\n\n // If the passed path is absolute, but the base path is not, we\n // cannot generate a relative path\n if ('' !== $root && '' === $baseRoot) {\n throw new InvalidArgumentException(sprintf('The absolute path \"%s\" cannot be made relative to the relative path \"%s\". You should provide an absolute base path instead.', $path, $basePath));\n }\n\n // Fail if the roots of the two paths are different\n if ($baseRoot && $root !== $baseRoot) {\n throw new InvalidArgumentException(sprintf('The path \"%s\" cannot be made relative to \"%s\", because they have different roots (\"%s\" and \"%s\").', $path, $basePath, $root, $baseRoot));\n }\n\n if ('' === $relativeBasePath) {\n return $relativePath;\n }\n\n // Build a \"../../\" prefix with as many \"../\" parts as necessary\n $parts = explode('/', $relativePath);\n $baseParts = explode('/', $relativeBasePath);\n $dotDotPrefix = '';\n\n // Once we found a non-matching part in the prefix, we need to add\n // \"../\" parts for all remaining parts\n $match = true;\n\n foreach ($baseParts as $index => $basePart) {\n if ($match && isset($parts[$index]) && $basePart === $parts[$index]) {\n unset($parts[$index]);\n\n continue;\n }\n\n $match = false;\n $dotDotPrefix .= '../';\n }\n\n return rtrim($dotDotPrefix.implode('/', $parts), '/');\n }", "public function getRelativePath($relative_to_this_path = '')\n {\n $hold = getcwd();\n $target = $this->normalise($relative_to_this_path);\n chdir($target);\n $this->data = realpath($this->path);\n chdir($hold);\n\n return;\n }", "public function getLocalPath($path);", "protected static function standardizePath($path) {\n\t\treturn self::pathIsRelative($path) ? self::getDocumentRoot().DIRECTORY_SEPARATOR.$path : $path;\n\t}", "private static function absolutize( $path, $base ) {\n\t\tif ( ! empty( $path ) && ! \\WP_CLI\\Utils\\is_path_absolute( $path ) ) {\n\t\t\t$path = $base . DIRECTORY_SEPARATOR . $path;\n\t\t}\n\t\treturn $path;\n\t}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n $parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR));\n while (end($parts) !== false) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "public function realPath($relativeFilename) { \n // Check for absolute path \n if (realpath($relativeFilename) == $relativeFilename) return $relativeFilename; \n \n // Otherwise, treat as relative path \n $paths = explode(PATH_SEPARATOR, get_include_path()); \n foreach ($paths as $path) { \n $path = str_replace('\\\\', '/', $path); \n $path = rtrim($path, '/') . '/'; \n $fullpath = realpath($path . $relativeFilename); \n if ($fullpath) return $fullpath; \n } \n \n return false; \n }", "protected function _path($path) {\r\n\t\treturn $this->rootName.($path == $this->root ? '' : $this->separator.$this->_relpath($path));\r\n\t}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n\n // We're also normalizing path separators to whatever is normal for the\n // environment.\n\n if (phutil_is_windows()) {\n $parts = trim($path, '/\\\\');\n $parts = preg_split('([/\\\\\\\\])', $parts);\n\n // Normalize the directory separators in the path. If we find a parent\n // below, we'll overwrite this with a better resolved path.\n $path = str_replace('/', '\\\\', $path);\n } else {\n $parts = trim($path, '/');\n $parts = explode('/', $parts);\n }\n\n while ($parts) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "function fixRelativePath($path, $cwd_path)\n\t{\n\t\treturn addslashes(preg_replace(array('~^\\.([/\\\\\\]|$)~', '~[/]+~', '~[\\\\\\]+~', '~[/\\\\\\]$~'), array($cwd_path . '$1', '/', '\\\\', ''), $path));\n\t}", "function normalize_path($path, $slash_it = true) {\n\n\t$parser_mem_crc = 'normalize_path' . crc32($path.$slash_it);\n\n\t$ch = mw_var($parser_mem_crc);\n\tif ($ch != false) {\n\n\t\t$path = $ch;\n\t} else {\n\n\n\n\n\n\t\t$path_original = $path;\n\t\t$s = DIRECTORY_SEPARATOR;\n\t\t$path = preg_replace('/[\\/\\\\\\]/', $s, $path);\n\t// $path = preg_replace ( '/' . $s . '$/', '', $path ) . $s;\n\t\t$path = str_replace($s . $s, $s, $path);\n\t\tif (strval($path) == '') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR);\n\t\t} else {\n\t\t\t$path .= DIRECTORY_SEPARATOR;\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif (strval(trim($path)) == '' or strval(trim($path)) == '/') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t} else {\n\t\t\t$path = $path . DIRECTORY_SEPARATOR;\n\t\t\t$path = reduce_double_slashes($path);\n\t\t// $path = rtrim ( $path, DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR );\n\t\t}\n\n\t\tmw_var($parser_mem_crc, $path);\n\n\t}\n\n\treturn $path;\n}", "public function getRelativePath($from, $to)\n {\n $from = $this->getPathParts($from);\n $to = $this->getPathParts($to);\n\n $relPath = $to;\n foreach ($from as $depth => $dir) {\n if ($dir === $to[$depth]) {\n array_shift($relPath);\n } else {\n $remaining = count($from) - $depth;\n if ($remaining > 1) {\n $padLength = (count($relPath) + $remaining - 1) * -1;\n $relPath = array_pad($relPath, $padLength, '..');\n break;\n } else {\n $relPath[0] = './' . $relPath[0];\n }\n }\n }\n return implode('/', $relPath);\n }", "private function _getRelativeLogPath(array $path_data, $path_key, $repository_path)\n\t{\n\t\t$ret = $path_data[$path_key];\n\n\t\tif ( $path_data['kind'] == 'dir' ) {\n\t\t\t$ret .= '/';\n\t\t}\n\n\t\t$ret = str_replace($repository_path, '', $ret);\n\n\t\tif ( $ret === '' ) {\n\t\t\t$ret = '.';\n\t\t}\n\n\t\treturn $ret;\n\t}", "function path($path='') {\n return $this->base_dir . $path;\n }", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "public function resolvePath (string $source, string $target) : string\n {\n $sourceDirs = $this->toDirectoryFragments(\\dirname($source));\n $targetFileName = \\basename($target);\n\n // if relative path is absolute, just return the absolute path\n if (\"/\" === \\substr($target, 0, 1))\n {\n return $target;\n }\n\n // strip leading \"./\"\n if (\"./\" === \\substr($target, 0, 2))\n {\n $target = \\substr($target, 2);\n }\n\n $targetDirs = $this->toDirectoryFragments(\\dirname($target));\n\n // if the relative dirs are empty (it is just a file name), use the same directory\n if (empty($targetDirs))\n {\n return $this->buildFilePath($sourceDirs, $targetFileName);\n }\n\n // strip leading \"../../\" from the beginning of the relative dir and simultaneously from the end of the source dir\n while (!empty($targetDirs) && \"..\" === $targetDirs[0])\n {\n \\array_pop($sourceDirs);\n \\array_shift($targetDirs);\n }\n\n return $this->buildFilePath(\n \\array_merge($sourceDirs, $targetDirs),\n $targetFileName\n );\n }", "function rewritePath($path)\n {\n global $rewritePathList;\n $path = ltrim($path, './');\n $urlArray = explode('/', $path);\n if (isset($rewritePathList[$urlArray[0]])) {\n $urlArray[0] = $rewritePathList[$urlArray[0]];\n }\n return implode('/', $urlArray) != '' ? implode('/', $urlArray) : './';\n }", "public function getRelativePath(): string\n {\n return $this->relativePath;\n }", "public function ressourceToPath($path)\n {\n return __DIR__.'/../'.$path;\n }", "static function url2fullPath( $url )\n {\n $url = self::normalize( $url );\n\n $uri = isset( $_SERVER[ 'SCRIPT_NAME' ] )\n ? $_SERVER[ 'SCRIPT_NAME' ] : ( isset( $_SERVER[ 'PHP_SELF' ] )\n ? $_SERVER[ 'PHP_SELF' ]\n : false );\n\n $uri = self::normalize( $uri );\n\n if( substr( $url, 0, 1 ) !== \"/\" ){\n if( $uri === false ) return false;\n $url = dirname( $uri ) . \"/$url\";\n }\n\n if( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) ){\n return self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] . \"/$url\" );\n\n } else{\n if( $uri === false ) return false;\n\n if( isset( $_SERVER[ 'SCRIPT_FILENAME' ] ) ){\n $scr_filename = self::normalize( $_SERVER[ 'SCRIPT_FILENAME' ] );\n return self::normalize( substr( $scr_filename, 0, -strlen( $uri ) ) . \"/$url\" );\n }\n\n $count = count( explode( '/', $uri ) ) - 1;\n for( $i = 0, $chdir = \"\"; $i < $count; $i++ )\n $chdir .= \"../\";\n $chdir = self::normalize( $chdir );\n\n $dir = getcwd();\n if( ( $dir === false ) || !@chdir( $chdir ) )\n return false;\n $rdir = getcwd();\n chdir( $dir );\n return ( $rdir !== false ) ? self::normalize( $rdir . \"/$url\" ) : false;\n }\n }", "function getAbsolutePath() ;", "function adjustPath($path) {\r\n $isWin = (substr(PHP_OS, 0, 3) == 'WIN') ? 1 : 0;\r\n $siteDir = eZSys::siteDir();\r\n \r\n $path = str_replace('\\\\', '/', $siteDir . $path );\r\n $path = str_replace('//', '/', $path);\r\n if ($isWin) {\r\n $path = str_replace('/', '\\\\\\\\', $path);\r\n }\r\n return $path;\r\n}" ]
[ "0.6867227", "0.67079884", "0.6542726", "0.63866204", "0.63704085", "0.63596874", "0.6331498", "0.6303299", "0.6271455", "0.6261987", "0.62147766", "0.6199806", "0.6171473", "0.61463815", "0.61432534", "0.6100414", "0.6095798", "0.6082337", "0.60546166", "0.6047338", "0.6005078", "0.59764546", "0.5972317", "0.5967336", "0.5935252", "0.5893403", "0.58784956", "0.5867368", "0.58647656", "0.5826133", "0.58068615", "0.57913494", "0.57889533", "0.57723653", "0.5764473", "0.5762309", "0.5759697", "0.5739245", "0.5729354", "0.5717931", "0.571788", "0.5708618", "0.5707364", "0.57029396", "0.56632817", "0.5659809", "0.56320304", "0.5621237", "0.561395", "0.5610153", "0.560719", "0.56056386", "0.5594619", "0.55878466", "0.55491155", "0.5541384", "0.55265117", "0.5517616", "0.55002505", "0.54958045", "0.54853165", "0.5484091", "0.54744947", "0.54714286", "0.5470624", "0.54671925", "0.5446638", "0.5435019", "0.5432911", "0.54294515", "0.54196393", "0.5419519", "0.54058444", "0.5404961", "0.5387413", "0.537771", "0.5371583", "0.53528863", "0.5350632", "0.53269696", "0.5325614", "0.5322652", "0.5316374", "0.5310459", "0.53084046", "0.529622", "0.52932143", "0.5292891", "0.5289022", "0.5286242", "0.52769995", "0.527698", "0.5261593", "0.5246086", "0.52388996", "0.52378935", "0.5232968", "0.52325296", "0.5230373", "0.522635" ]
0.7656842
0
Find all directories with files that match a given pattern
Найдите все директории с файлами, соответствующими заданному шаблону
function findDirectoriesWithFiles($path, $pattern = '*') { $res = array(); if(substr($path, -1) != '/') $path = $path.'/'; foreach(glob($path.$pattern, GLOB_BRACE) as $file) { $res[] = dirname($file); } foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) { $res = array_merge($res, findDirectoriesWithFiles($file, $pattern)); } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a list of all directories in the current directory\n // directories beginning with a dot are also included\n foreach (glob(\"$dir/{.[^.]*,*}\", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){\n $arr = find($sub_dir, $pattern); // resursive call\n $files = array_merge($files, $arr); // merge array with files from subdirectory\n }\n // return all found files\n return $files;\n}", "protected function _list_files_recursively($pattern)\n\t{\n\t\t$files = glob($pattern);\n\n\t\tforeach (glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT) AS $dir)\n\t\t{\n\t\t\t$files = array_merge($files, $this->_list_files_recursively($dir.DIRECTORY_SEPARATOR.basename($pattern)));\n\t\t}\n\n\t\treturn $files;\n\t}", "function grep($path, $pattern, &$results)\n{\n // find all files in the path (incl folders)\n $items = glob($path . '/*'); // */\n\n for ($i = 0; $i < count($items); $i++)\n {\n if (is_dir($items[$i]))\n {\n $add = glob($items[$i] . '/*'); // */\n $items = array_merge($items, $add);\n }\n }\n\n // search through the files.\n $results = array();\n foreach($items as $f)\n {\n if (filetype($f) == 'file')\n {\n if (preg_match($pattern, file_get_contents($f), $matches))\n $results = array_merge($results, $matches);\n }\n }\n\n return (count($results) > 0);\n}", "function recurseFind($dir, $pattern, $depthRemaining )\n{\n\tglobal $filesep;\n\t$subFiles = array();\n\t$subDirs = array();\n\n\t$dh = opendir($dir);\n\twhile ( false != ($file = readdir($dh)) ) { \n\t\tif ( $file != '.' && $file != '..' ) {\n\n\t\t\t$fullFile = $dir . DIRECTORY_SEPARATOR . $file;\n\n\t\t\tif ( is_dir($fullFile) ) { \n\t\t\t\tarray_push($subDirs, $fullFile);\n\t\t\t} else {\n\t\t\t\tif ( preg_match($pattern, $fullFile) ) { \n\t\t\t\t\tarray_push($subFiles, $fullFile);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dh);\n\n\t// 2016-Aug-28 -- Limiting the recursion\n\tif ( $depthRemaining > 0 ) { \n\n\tforeach ( $subDirs as $subDir ) { \n\t\tforeach ( recurseFind($subDir, $pattern, $depthRemaining-- ) as $subsubFile ) {\n\t\t\tarray_push($subFiles, $subsubFile );\n\t\t}\n\t}\n\n\t}\n\n\treturn $subFiles;\n}", "function grep($directory, $pattern = null, $recurse = true) {\n static $in_recurse = false;\n static $skip_charachers;\n $reset_in_recurse = false;\n if (!$in_recurse) {\n if (!\\is_dir($directory))\n return array();\n $directory = \\realpath($directory) . \"/\";\n $skip_charachers = \\strlen($directory);\n $in_recurse = $reset_in_recurse = true;\n }\n $ret = array();\n $dirhandle = \\opendir($directory);\n while (false !== ($nodename = \\readdir($dirhandle))) {\n if ($nodename[0] == \".\")\n continue;\n $subpath = $directory . $nodename;\n if (\\is_dir($subpath)) {\n if ($recurse)\n $ret = \\array_merge($ret, grep($subpath . \"/\", $pattern));\n } else if ($pattern == null || \\preg_match($pattern, $subpath))\n $ret[] = \\substr($subpath, $skip_charachers);\n }\n \\closedir($dirhandle);\n if ($reset_in_recurse)\n $in_recurse = false;\n return $ret;\n}", "function rglob($pattern='*', $path='', $flags = 0) {\n $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n $files = glob($path.$pattern, $flags);\n\tif (!$files)\n\t\t$files = array();\n\tif (!$paths)\n\t\t$paths = array();\n\n\tforeach ($paths as $path) {\n\t\tif ( strstr($path, 'folder-not-included') )\n\t\t\tcontinue;\n\n\t\t$files = array_merge($files,rglob($pattern, $path, $flags));\n\t}\n\t\n \treturn $files;\n}", "function glob_recursive($pattern, $flags = 0)\n {\n $files = glob($pattern, $flags);\n\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));\n }\n return $files;\n }", "public function findFiles();", "function _ft_search_find_files($dir, $q){\r\n\t$output = array();\r\n\tif (ft_check_dir($dir) && $dirlink = @opendir($dir)) {\r\n\t\twhile(($file = readdir($dirlink)) !== false){\r\n\t\t\tif($file != \".\" && $file != \"..\" && ((ft_check_file($file) && ft_check_filetype($file)) || (is_dir($dir.\"/\".$file) && ft_check_dir($file)))){\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\t// Check if filename/directory name is a match.\r\n\t\t\t\tif(stristr($file, $q)) {\r\n\t\t\t\t\t$new['name'] = $file;\r\n\t\t\t\t\t$new['shortname'] = ft_get_nice_filename($file, 20);\r\n\t\t\t\t\t$new['dir'] = substr($dir, strlen(ft_get_root()));\r\n\t\t\t\t\tif (is_dir($path)) {\r\n if (ft_check_dir($path)) {\r\n \t\t\t\t\t\t$new['type'] = \"dir\";\t\t\t\t\t \r\n \t\t\t\t\t$output[] = $new;\r\n }\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $new['type'] = \"file\";\r\n \t\t\t\t\t$output[] = $new;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Check subdirs for matches.\r\n\t\t\t\tif(is_dir($path)) {\r\n\t\t\t\t\t$dirres = _ft_search_find_files($path, $q);\r\n\t\t\t\t\tif (is_array($dirres) && count($dirres) > 0) {\r\n\t\t\t\t\t\t$output = array_merge($dirres, $output);\r\n\t\t\t\t\t\tunset($dirres);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsort($output);\r\n\t\tclosedir($dirlink);\r\n\t\treturn $output;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "function get_files($directory, $pattern = false) {\n\n\t\tif(!isset($directory) OR is_dir($directory) == false ) return false;\n\t\t$returnval = array();\n\n\t\tif(false != ($handle = opendir($directory))) {\n\t\twhile (false !== ($file = readdir($handle))) {\n\n\t if ($file != \".\" && $file != \"..\") {\n\n\t\tif($pattern != false) {\n\n\t\tif(preg_match(\"$pattern\", $file) > 0 ) {\n\t\t$returnval[] = $file;\n }\n\t\t\t}else{\n\t\t\t\t$returnval[] = $file;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $returnval;\n\t}", "function _glob($pattern, $flags = 0) {\n\t\t$path = dirname($pattern);\n\t\t$filePattern = basename($pattern);\n\t\tif(is_dir($path) && ($handle = opendir($path)) !== false) {\n\t\t\t$matches = array();\n\t\t\twhile(($file = readdir($handle)) !== false) {\n\t\t\t\tif(($file[0] != '.')\n\t\t\t\t\t\t&& _fnmatch($filePattern, $file)\n\t\t\t\t\t\t&& (!($flags & GLOB_ONLYDIR) || is_dir(\"$path/$file\"))) {\n\t\t\t\t\t$matches[] = \"$path/$file\" . ($flags & GLOB_MARK ? '/' : '');\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t\tif(!($flags & GLOB_NOSORT)) {\n\t\t\t\tsort($matches);\n\t\t\t}\n\t\t\treturn $matches;\n\t\t}\n\t\treturn false;\n\t}", "function rglob($pattern='*', $flags = 0, $path='')\r\r\n\r\r\n{\r\r\n\r\r\n $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\r\r\n\r\r\n $files=glob($path.$pattern, $flags);\r\r\n\r\r\n foreach ($paths as $path) { $files=array_merge($files,rglob($pattern, $flags, $path)); }\r\r\n\r\r\n return $files;\r\r\n\r\r\n}", "function glob_recursive($path, $pattern, $flags = 0)\n {\n $files = glob($path . '/' . $pattern, $flags);\n \n foreach (glob(dirname($path).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n { \t\n $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));\n }\n \n return $files;\n }", "function system_glob_rec($directory='',$pattern='*.*')\n{\n\tsystem_ensure_path_ending($directory);\n\t$paths = system_glob($directory.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n\tif( $pattern )\n\t{\n\t\t$files = system_glob($directory.$pattern);\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\telse\n\t{\n\t\t$files = $paths;\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\treturn $files;\n}", "private function recSearchFiles($dir)\n {\n $ffs = scandir($dir);\n\n foreach ($ffs as $ff) {\n\n if ($ff != '.' && $ff != '..') {\n\n if (is_dir($dir . '/' . $ff)) {\n $this->recSearchFiles($dir . $ff . '/');\n } else if (strlen($ff) >= 5) {\n $this->searchedFiles[] = $dir . $ff;\n }\n }\n }\n }", "protected function recursiveGlob($pattern, $flags = 0)\n {\n $files = glob($pattern, $flags);\n\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n\n // Avoid scanning vendor folder.\n if ($dir === $this->root . '/vendor') {\n continue;\n }\n\n $files = array_merge($files, $this->recursiveGlob($dir . '/' . basename($pattern), $flags));\n }\n\n return $files;\n }", "function searchFiles($search, $path, $video){\n $searchFiles = scandir($path);\n foreach($searchFiles as $sFile){\n if(($sFile!=\".\")&&($sFile!=\"..\")){\n if(is_dir($path.$sFile)){\n $search = glob($path.$sFile.'/'.$video);\n if(!empty($search)){\n return $search;\n }\n }\n }\n }\n return array('did', 'not', 'work');\n}", "function searchFolder( $current_folder, $folder_to_find, &$matches )\n{\n if ( !( $handle = opendir( $current_folder ) ) ) die( \"Cannot open $current_folder.\" );\n\n while ( $entry = readdir( $handle ) ) {\n if ( is_dir( \"$current_folder/$entry\" ) ) {\n if ( $entry != \".\" && $entry != \"..\" ) {\n\n // This entry is a valid folder\n // If it matches our folder name, add it to the list of matches\n if ( $entry == $folder_to_find ) $matches[] = \"$current_folder/$entry\";\n\n // Search this folder\n searchFolder( \"$current_folder/$entry\", $folder_to_find, $matches );\n }\n }\n }\n closedir( $handle );\n}", "protected function findFilesInCacheDir($pattern)\n {\n $finder = new Finder();\n \n return $finder\n ->name($pattern)\n ->in($this->getCacheDir())\n ;\n }", "function find_all_files($dir) \n{ \n $files = array();\n foreach (glob($dir) as $file) {\n $files[] = $file;\n }\n return $files;\n}", "public static function find($args)\n {\n if (!is_array($args)) {\n $args = preg_split('/\\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);\n }\n $dir = realpath(array_shift($args));\n if (!$dir) {\n return array();\n }\n $patterns = array();\n $depth = 0;\n $do_files = $do_dirs = true;\n $args_count = count($args);\n for ($i = 0; $i < $args_count; $i++) {\n switch ($args[$i]) {\n case '-type':\n if (in_array($args[$i+1], array('d', 'f'))) {\n if ($args[$i+1] == 'd') {\n $do_files = false;\n } else {\n $do_dirs = false;\n }\n }\n $i++;\n break;\n case '-name':\n $name = preg_quote($args[$i+1], '#');\n // our magic characters ? and * have just been escaped,\n // so now we change the escaped versions to PCRE operators\n $name = strtr($name, array('\\?' => '.', '\\*' => '.*'));\n $patterns[] = '('.$name.')';\n $i++;\n break;\n case '-maxdepth':\n $depth = $args[$i+1];\n break;\n }\n }\n $path = System::_dirToStruct($dir, $depth, 0, true);\n if ($do_files && $do_dirs) {\n $files = array_merge($path['files'], $path['dirs']);\n } elseif ($do_dirs) {\n $files = $path['dirs'];\n } else {\n $files = $path['files'];\n }\n if (count($patterns)) {\n $dsq = preg_quote(DIRECTORY_SEPARATOR, '#');\n $pattern = '#(^|'.$dsq.')'.implode('|', $patterns).'($|'.$dsq.')#';\n $ret = array();\n $files_count = count($files);\n for ($i = 0; $i < $files_count; $i++) {\n // only search in the part of the file below the current directory\n $filepart = basename($files[$i]);\n if (preg_match($pattern, $filepart)) {\n $ret[] = $files[$i];\n }\n }\n return $ret;\n }\n return $files;\n }", "function scan_directory($dir, $ext = '*', $recurse = true) {\n $files = array ();\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file == '.' || $file == '..' ||\n $file == 'CVS' || preg_match('|^\\.|', $file)) {\n continue;\n }\n if (is_link($dir . '/' . $file)) {\n continue;\n }\n if (is_dir ($dir . '/' . $file)) {\n if ($recurse == true)\n $files = array_merge($files, scan_directory ($dir . '/' . $file, $ext));\n } else {\n if($ext == get_file_extension($file) || $ext == '*') {\n $files[] = $dir . '/' . $file;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}", "public static function findFiles(string $pathDir, ?string $pattern = null, bool $bReturnRelativePaths = false)\n {\n return self::_findFilesRecursive($pathDir, $pattern, $bReturnRelativePaths, '');\n }", "private function fileSearchAux($dir, $pattern, &$files) {\n $handle = opendir($dir);\n if ($handle) {\n while (($file = readdir($handle)) !== false) {\n\n if ($file == '.' || $file == '..') {\n continue;\n }\n\n $filePath = $dir == '.' ? $file : $dir . '/' . $file;\n\n if (is_link($filePath)) {\n continue;\n }\n\n if (is_file($filePath)) {\n if (preg_match($pattern, $filePath)) {\n $files[] = $filePath;\n }\n }\n\n if (is_dir($filePath) && !$this->isBlacklisted($file)) {\n $this->fileSearchAux($filePath, $pattern, $files);\n }\n }\n closedir($handle);\n }\n }", "public static function listDir($dirname, $pattern = null)\n\t{\n\t\t$files = glob($dirname . \"/*$pattern*\");\n\t\t$filenames = [];\n\n\t\tforeach ($files as $file) {\n\t\t\t$file = pathinfo($file);\n\t\t\t$filename = $file['filename'];\n\n\t\t\tif (isset($file['extension'])) {\n\t\t\t\t$extension = $file['extension'];\n\t\t\t\tarray_push($filenames, \"$filename.$extension\");\n\t\t\t} else {\n\t\t\t\tarray_push($filenames, \"$filename/\");\n\t\t\t}\n\t\t}\n\n\t\treturn $filenames;\n\t}", "public static function preg_ls ($path=\".\", $recursive=false, $pattern=\"/.*/\") {\n $rec = $recursive;\n $pat = $pattern;\n // it's going to be used repeatedly, ensure we compile it for speed.\n $pat=preg_replace(\"|(/.*/[^S]*)|s\", \"\\\\1S\", $pat);\n //Remove trailing slashes from path\n while (substr($path,-1,1)==\"/\") $path=substr($path,0,-1);\n //also, make sure that $path is a directory and repair any screwups\n if (!is_dir($path)) $path=dirname($path);\n //assert either truth or falsehoold of $rec, allow no scalars to mean truth\n if ($rec!==true) $rec=false;\n //get a directory handle\n $d=dir($path);\n //initialise the output array\n $ret=Array();\n //loop, reading until there's no more to read\n while (false!==($e=$d->read())) {\n //Ignore parent- and self-links\n if (($e==\".\")||($e==\"..\")) continue;\n //If we're working recursively and it's a directory, grab and merge\n if ($rec && is_dir($path.\"/\".$e)) {\n $ret=array_merge($ret,preg_ls($path.\"/\".$e,$rec,$pat));\n continue;\n }\n //If it don't match, exclude it\n if (!preg_match($pat,$e)) continue;\n //In all other cases, add it to the output array\n $ret[]=$path.\"/\".$e;\n }\n //finally, return the array\n return $ret;\n }", "public static function getFilesByPathAndPattern($path, $pattern) {\n\t\t$pathHandle = opendir($path);\n\t\tif ($pathHandle != false ) {\n\t\t\t$imageFiles = array();\n\t\t\twhile (false !== ($filename = readdir($pathHandle))) {\n\t\t\t\t// TODO make this configurable via TS!\n\t\t\t\tif (preg_match($pattern, $filename)) {\n\t\t\t\t\t$imageFiles[] = $filename;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $imageFiles;\n\t\t} else {\n\t\t\tthrow new Exception('Error when trying to open dir: ' . $path);\n\t\t}\n\t}", "public function handle($directory, $pattern, $recursive = false)\n {\n $existingFiles = $this->filesystem->listContents($directory, $recursive);\n $matchedPaths = [];\n foreach ($existingFiles as $file) {\n $normalizedPath = str_replace('\\\\', '/', $file['path']);\n if (preg_match($pattern, $normalizedPath) === 1) {\n $matchedPaths[] = $normalizedPath;\n }\n }\n\n return $matchedPaths;\n }", "protected function scan_files_in_directory($directory, $pattern, $depth = -1)\n {\n $directory = new \\RecursiveDirectoryIterator($directory);\n $iterator = new \\RecursiveIteratorIterator($directory);\n $iterator->setMaxDepth($depth);\n\n $regex = new \\RegexIterator($iterator, $pattern, \\RegexIterator::GET_MATCH);\n\n $files = array();\n\n foreach ($regex as $matches)\n {\n $files[] = array($matches[0]);\n }\n\n if (! count($files))\n {\n $files = array(array(''));\n }\n\n return $files;\n }", "public function test_scan_directories()\n {\n $content = array('.','..','application','.git','nbproject','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_DIRS);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\Directory', $dir);\n }\n }", "static function find_files( $dir ) {\n\t\t$found_files = array();\n\t\t$files = scandir( $dir );\n\n\t\tforeach ( $files as $value ) {\n\t\t\t// skip special dot files\n\t\t\t// and any file that starts with a . - think hidden directories like .svn or .git\n\t\t\tif ( strpos( $value, '.' ) === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// is it a file?\n\t\t\tif ( is_file( \"$dir/$value\" ) ) {\n\t\t\t\t$found_files[] = \"$dir/$value\";\n\t\t\t\tcontinue;\n\t\t\t} else { // it's a directory\n\t\t\t\tforeach ( self::find_files( \"$dir/$value\" ) as $value ) {\n\t\t\t\t\t$found_files[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $found_files;\n\t}", "public function recursiveGlobFiles($pattern, $flags = 0)\n {\n $files = $this->recursiveGlob($pattern, $flags);\n\n return array_filter($files, 'is_file');\n }", "public function recursiveGlob($pattern, $flags = 0)\n {\n // Perform the glob search.\n $files = glob($pattern, $flags);\n\n // Check if this is to be recursive.\n if (strpos($pattern, '**') !== FALSE) {\n $dirs = glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT);\n if ($dirs) {\n foreach ($dirs as $dir) {\n $files = array_merge($files, $this->recursiveGlob($dir.DIRECTORY_SEPARATOR.basename($pattern), $flags));\n }\n }\n }\n\n return $files;\n }", "static private function find_contents($dir)\n {\n $result = array();\n $root = scandir($dir);\n foreach ($root as $value) {\n if ($value === '.' || $value === '..') {\n continue;\n }\n if (is_file($dir . DIRECTORY_SEPARATOR . $value)) {\n if (! self::$ext_filter || in_array(strtolower(pathinfo($dir . DIRECTORY_SEPARATOR . $value, PATHINFO_EXTENSION)), self::$ext_filter)) {\n self::$files[] = $result[] = $dir . DIRECTORY_SEPARATOR . $value;\n }\n continue;\n }\n if (self::$recursive) {\n foreach (self::find_contents($dir . DIRECTORY_SEPARATOR . $value) as $value) {\n self::$files[] = $result[] = $value;\n }\n }\n }\n // Return required for recursive search\n return $result;\n }", "protected function streamSafeGlob(string $directory, string $filePattern): array\n {\n $filePattern = basename($filePattern);\n $files = scandir($directory);\n $found = [];\n\n foreach ($files as $filename) {\n if (in_array($filename, ['.', '..'])) {\n continue;\n }\n\n if (fnmatch($filePattern, $filename) || fnmatch($filePattern . '.ttl', $filename)) {\n $found[] = \"{$directory}/{$filename}\";\n }\n }\n\n return $found;\n }", "function RecursiveScanDir($dir, $prefix = '') {\n\t$dir = rtrim($dir, '\\\\/');\n\t$result = array();\n\tforeach (scandir($dir) as $f) {\n if (\n preg_match('`/tmp/`', \"$dir/$f\")\n || preg_match('`/fpdf.php$`', \"$dir/$f\")\n || preg_match('`/libs/pi_barcode.php$`', \"$dir/$f\")\n || preg_match('`/libs/phpmailer/`', \"$dir/$f\")\n || preg_match('`/libs/securimage/`', \"$dir/$f\")\n || preg_match('`/libs/Smarty/`', \"$dir/$f\")\n )\n continue;\n\t\tif ($f !== '.' and $f !== '..') {\n\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t$result = array_merge($result, RecursiveScanDir(\"$dir/$f\", \"$prefix$f/\"));\n\t\t\t} else {\n\t\t\t\tif ( strtolower(substr(pathinfo($f,PATHINFO_EXTENSION),0,3)) == \"php\" && pathinfo(__FILE__,PATHINFO_BASENAME ) != pathinfo($f,PATHINFO_BASENAME ) )\n\t\t\t\t\t$result[] = $prefix.$f;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "function scandir_recursive($directory, $format = null, $excludes = array()){\n $format = ($format == null) ? 'absolute' : $format;\n $paths = array();\n $stack[] = $directory;\n while($stack){\n $this_resource = array_pop($stack);\n if ($resource = scandir($this_resource)){\n $i = 0;\n while (isset($resource[$i])){\n if ($resource[$i] != '.' && $resource[$i] != '..'){\n $current = array(\n 'absolute' => \"{$this_resource}/{$resource[$i]}\",\n 'relative' => preg_replace('/' . preg_quote($directory, '/') . '/', '', \"{$this_resource}/{$resource[$i]}\")\n );\n if (is_file($current['absolute'])){\n $paths[] = $current[$format];\n } elseif (is_dir($current['absolute'])){\n $paths[] = $current[$format];\n $stack[] = $current['absolute'];\n }\n }\n $i++;\n }\n }\n }\n if (count($excludes) > 0){\n $clean = array();\n foreach($paths as $path){\n $remove = false;\n foreach($excludes as $exclude){\n $exclude = preg_quote($exclude, '/');\n $exclude = str_replace('\\*', '.*', $exclude);\n if (preg_match('/' . $exclude . '/', $path)){\n $remove = true;\n }\n }\n if (!$remove) $clean[] = $path;\n }\n $paths = $clean;\n }\n return $paths;\n}", "private function globRecursive(string $pattern, null|int $flag=0):array{\n $files = glob($pattern, $flag);\n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n {\n $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flag));\n }\n return $files;\n }", "public function loadFilePattern(string $pattern, ?string $root = null): array\n {\n $root = $root ?? Path::getDirectory($pattern);\n\n if (Str::contains($root, '*')) {\n throw new \\RuntimeException('Wildcards in folder names are not supported.');\n }\n\n $files = $this->filesystem->files($root, true);\n\n $matchingFiles = [];\n $pattern = Path::join($root, $pattern);\n foreach ($files as $file) {\n if (fnmatch($pattern, $file)) {\n $matchingFiles[] = $file;\n }\n }\n\n return collect($matchingFiles)->map(function (string $file): string {\n return $this->loadFile(\n Path::getFilename($file),\n Path::getDirectory($file)\n );\n })->toArray();\n }", "function scan_dir($dir, $type=array(),$only=FALSE, $allFiles=FALSE, $recursive=TRUE, $onlyDir=\"\", &$files){\n\t$handle = @opendir($dir);\n\tif(!$handle)\n\t\treturn false;\n\twhile ($file = @readdir ($handle))\n\t{\n\t\tif (eregi(\"^\\.{1,2}$\",$file) || $file == 'index.html')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tif(!$recursive && $dir != $dir.$file.\"/\")\n\t\t{\n\t\t\tif(is_dir($dir.$file))\n\t\t\t\tcontinue;\n\t\t}\n\t\tif(is_dir($dir.$file))\n\t\t{\n\t\t\tscan_dir($dir.$file.\"/\", $type, $only, $allFiles, $recursive, $file, $files);\n\t\t}\n\t\telse\n\t\t{\n if($only)\n\t\t\t\t$onlyDir = $dir;\n\n\t\t\t$files = buildArray($dir,$file,$onlyDir,$type,$allFiles,$files);\n\t\t}\n\t}\n\t@closedir($handle);\n\treturn $files;\n}", "private function searchFiles($dir)\n {\n $this->searchedFiles = array();\n\n $this->recSearchFiles($this->basePath . $dir);\n\n return $this->searchedFiles;\n }", "function get_php_files(string $path)\n{\n $matches = [];\n $folders = [rtrim($path, DIRECTORY_SEPARATOR)];\n\n while( $folder = array_shift($folders) )\n {\n $matches = array_merge($matches, glob($folder . DIRECTORY_SEPARATOR . '*.php', GLOB_MARK));\n $childFolders = glob($folder . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);\n $folders = array_merge($folders, $childFolders);\n }\n return $matches;\n}", "private function findFiles($directory, $extensions = array())\r\n {\r\n $directory = ROOT_DIR_NAME;\r\n\r\n if($this->check_search_directory($directory))\r\n {\r\n $search = $this->filter_search_str($this->search);\r\n $directories = array();//\"\";\r\n function glob_recursive($directory, &$directories = array(), $search)\r\n {\r\n foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder)\r\n {\r\n $directories[] = $folder;\r\n glob_recursive(\"{$folder}/*\", $directories, $search);\r\n }\r\n }\r\n @glob_recursive($directory, $directories, $search);\r\n $files = array ();\r\n foreach($directories as $directory)\r\n {\r\n $slashes = \"../\";\r\n if(strpos($directory, \"..//\") !== FALSE)\r\n {\r\n $slashes = \"..//\";\r\n }\r\n if (in_array(str_replace($slashes, \"\", $directory), $this->ignored)) continue;\r\n $this->find_all_files($directory, $extensions, $search);\r\n /*foreach($extensions as $extension)\r\n {\r\n foreach(glob(\"{$directory}/{$search}.{$extension}\") as $file)\r\n {\r\n $files[$extension][] = $file;\r\n $filename = str_replace(\"..//\", \"\", $file);\r\n $this->root_files_folders[$filename] = filemtime($file);\r\n }\r\n }*/\r\n }\r\n @arsort($this->root_files_folders);\r\n if($this->sort != 'date')\r\n {\r\n @$this->root_files_folders = $this->sort_with_name($this->root_files_folders);\r\n }\r\n }\r\n @$this->root_files_folders = array_keys($this->root_files_folders);\r\n }", "public static function findFiles($dir,$options=array())\n\t{\n\t\t$fileTypes=array();\n\t\t$exclude=array();\n\t\t$level=-1;\n\t\t$absolutePaths=true;\n\t\textract($options);\n\t\t$list=self::findFilesRecursive($dir,'',$fileTypes,$exclude,$level,$absolutePaths);\n\t\tsort($list);\n\t\treturn $list;\n\t}", "function DNUI_scan_dir($dirBase) {\r\n return array_diff(scandir($dirBase), array('..', '.'));\r\n}", "public static function globRecursive(string $pattern, null|int $flags = 0):array{\n $files = glob($pattern, $flags);\n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n { \n $files = array_merge($files, self::globRecursive($dir.'/'.basename($pattern), $flags));\n }\n return $files;\n }", "public static function doGlob($pattern, $options = 0) {\n $results = [];\n if ($options & GLOB_BRACE) {\n $patterns = static::expandFilenameBraces($pattern);\n } else {\n $patterns = [$pattern];\n }\n foreach ($patterns as $pat) {\n $out = static::doGlobForPath($pat, $options);\n if ($out === false) {\n if ($options & GLOB_ERR) {\n break;\n }\n } else {\n $results = array_merge($results, $out);\n }\n }\n if (($options & GLOB_NOSORT) === 0) {\n asort($results);\n }\n if (($options & GLOB_NOCHECK) && empty($results)) {\n $results[] = $pattern;\n }\n return $results;\n }", "function searchdir ( $path , $maxdepth = -1 , $mode = \"DIRS\" , $d = 0 ) {\n if ( substr ( $path , strlen ( $path ) - 1 ) != '/' ) { $path .= '/' ; }\n $dirlist = array () ;\n if ( $mode != \"FILES\" ) {\n $dirlist[] = $path ;\n }\n if ( $handle = opendir ( $path ) ) {\n while ( false !== ( $file = readdir ( $handle ) ) ) {\n if ( $file != '.' && $file != '..' && substr($file, 0, 1) !== '.' ) {\n $file = $path . $file ;\n if ( ! is_dir ( $file ) ) {\n if ( $mode != \"DIRS\" ) {\n $dirlist[] = $file ;\n }\n }\n elseif ( $d >=0 && ($d < $maxdepth || $maxdepth < 0) ) {\n $result = searchdir ( $file . '/' , $maxdepth , $mode , $d + 1 ) ;\n $dirlist = array_merge ( $dirlist , $result ) ;\n }\n \t\t}\n }\n closedir ( $handle ) ;\n }\n if ( $d == 0 ) { \n natcasesort ( $dirlist ) ;\n }\n return ( $dirlist ) ;\n}", "function searchDir($base_dir=\"./\",$p=\"\",$f=\"\",$allowed_depth=-1){\n\t$contents=array();\n\n\t# trim all input arguments for whitespace\n\t$base_dir=trim($base_dir);\n\t$p=trim($p);\n\t$f=trim($f);\n\n # if base dir is not given, use the this\n\tif($base_dir==\"\")$base_dir=\"./\";\n\n\t# if last character of basedir lacks a \"/\" then add one\n\tif(substr($base_dir,-1)!=\"/\")$base_dir.=\"/\";\n\n\t# remove the \"../\" and \"./\" directories, and trim all \"./\"\n\t$p=str_replace(array(\"../\",\"./\"),\"\",trim($p,\"./\"));\n\n\t# add the requested path to the base directory string\n\t$p=$base_dir.$p;\n\n\t#if p is not a directory, meaning it is a file, get the path to it\n\tif(!is_dir($p))$p=dirname($p);\n\n\t#if the last character of p is not a \"/\" then add one\n\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\n\t# if caps are set on allowed depth (allowed depth>-1) count the dirs\n\tif($allowed_depth>-1){\n\t\t$allowed_depth=count(explode(\"/\",$base_dir))+ $allowed_depth-1;\n\t\t$p=implode(\"/\",array_slice(explode(\"/\",$p),0,$allowed_depth));\n\t\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\t}\n\n\t# if f is empty, create an empty array, if not explode and store elements\n\t$filter=($f==\"\")?array():explode(\",\",strtolower($f));\n\n\t# store the files in the files array, and shut up while scanning\n\t$files=@scandir($p);\n\n\t# if there are no files after scan, return an empty array and the path\n\tif(!$files)return array(\"contents\"=>array(),\"currentPath\"=>$p);\n\n\t# iterate through all files found\n\tfor ($i=0;$i<count($files);$i++){\n\n\t\t# gather name and path of each file\n\t\t$fName=$files[$i];\n\t\t$fPath=$p.$fName;\n\n\t\t# check if the file is a directory and tag it as directory\n\t\t# each file is tagged as a folder by default\n\t\t$isDir=is_dir($fPath);\n\t\t$add=false;\n\t\t$fType=\"folder\";\n\n\t\t# if the file is a file\n\t\tif(!$isDir){\n\n\t\t\t# extract extension from filename\n\t\t\t$ft=strtolower(substr($files[$i],strrpos($files[$i],\".\")+1));\n\t\t\t$fType=$ft;\n\n\t\t\t# if there is anything in the filter that matches, add it\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(in_array($ft,$filter))$add=true;\n\t\t\t}else{\n\t\t\t\t$add=true;\n\t\t\t}\n\t\t# if the file is a folder\n\t\t}else{\n\t\t\tif($fName==\".\")continue;\n\t\t\t$add=true;\n\n\t\t\t# filter it, and discard if bad\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(!in_array($fType,$filter))$add=false;\n\t\t\t}\n\n\t\t\t# if the file is the \"..\" folder\n\t\t\tif($fName==\"..\"){\n\t\t\t\t# if we are in the base dir, no not add upper directory option\n\t\t\t\tif($p==$base_dir){\n\t\t\t\t\t$add=false;\n\t\t\t\t}else $add=true;\n\n\t\t\t\t# explode the path by path steps\n\t\t\t\t$tempar=explode(\"/\",$fPath);\n\t\t\t\t# remove last two elements, so the file references parent dir\n\t\t\t\tarray_splice($tempar,-2);\n\t\t\t\t# implode the array, to recreate the path string\n\t\t\t\t$fPath=implode(\"/\",$tempar);\n\t\t\t\t# if for some reason, this reference is shorter than basedir, deny it!\n\t\t\t\tif(strlen($fPath)<= strlen($base_dir))$fPath=\"\";\n\t\t\t}\n\t\t}\n\n\t\t# if the created fPath is non-zero, append to basedir\n\t\tif($fPath!=\"\")$fPath=substr($fPath,strlen($base_dir));\n\t\t# if approved to add, add path, name and type to contents[] array\n\t\tif($add)$contents[]=array(\"fPath\"=>$fPath,\"fName\"=>$fName,\"fType\"=>$fType);\n\t}\n\n\t# if p is shorter than base_dir, deny it! Else, cut away base_dir and use it\n\t$p=(strlen($p)<= strlen($base_dir))?$p=\"\":substr($p,strlen($base_dir));\n\t# return the final contents and its respective path\n\treturn array(\"contents\"=>$contents,\"currentPath\"=>$p);\n}", "public function test_scan_files()\n {\n $content = array('.gitignore','.htaccess','index.php','README');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_FILES);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\File', $dir);\n }\n }", "private function recurseThroughDirectory($baseDir, $lookingFor = \"/(.*)\\.php$/i\")\n {\n $results = array();\n $di = new RecursiveDirectoryIterator($baseDir);\n\n $this->output->writeLn(\"Scanning $baseDir...\");\n\n foreach (new RecursiveIteratorIterator($di) as $filename => $file) {\n if (preg_match($lookingFor, $filename)) {\n $results[] = $this->extractFrom($filename);\n }\n }\n\n return $results;\n }", "public function find_all() {\n $this->ensure_path_exists();\n $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "private function scanFolder()\n {\n return scandir($this->currentPath);\n }", "public function searchDir($type, $directory = '')\n {\n $dirs = $this->search($type, $directory, 'path');\n $files = array();\n foreach ($dirs as $dir) {\n $this->_searchDirFiles($dir, $files);\n }\n\n return $files;\n }", "function directory_mapper($path)\n{\n $maxDepth = 3;\n $minDepth = 3;\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::SELF_FIRST,\n RecursiveIteratorIterator::CATCH_GET_CHILD// Ignore \"Permission denied\"\n );\n $iterator->setMaxDepth($maxDepth);\n\n $paths = array($path);\n foreach ($iterator as $path => $dir) {\n if ($iterator->getDepth() >= $minDepth) {\n if ($dir->isDir()) {\n if (file_exists($dir . DIRECTORY_SEPARATOR . \"meta\")) {\n $paths[] = $path;\n }\n }\n }\n }\n array_shift($paths);\n return $paths;\n}", "function scan_dir($dir){\n\tif( !is_dir( $dir ) )\n\t\treturn false;\n\n\t$files=scandir($dir);\n\n\t$dirs=array();\n\tforeach($files as $file){\n\t\tif($file=='.'||$file=='..'||substr($file,0,1)=='.')\n\t\t\tcontinue;\n\t\tif(is_dir($dir.'/'.$file))\n\t\t\tarray_push($dirs,$file);\n\t}\n\n\treturn $dirs;\n}", "public static function matchPath($pattern, $str, $isCaseSensitive = true) {\n \n // When str starts with a DIRECTORY_SEPARATOR, pattern has to start with a\n // DIRECTORY_SEPARATOR.\n // When pattern starts with a DIRECTORY_SEPARATOR, str has to start with a\n // DIRECTORY_SEPARATOR.\n if (StringHelper::startsWith(DIRECTORY_SEPARATOR, $str) !==\n StringHelper::startsWith(DIRECTORY_SEPARATOR, $pattern)) {\n return false;\n }\n\n $patDirs = explode(DIRECTORY_SEPARATOR, $pattern);\n $strDirs = explode(DIRECTORY_SEPARATOR, $str);\n\n $patIdxStart = 0;\n $patIdxEnd = count($patDirs)-1;\n $strIdxStart = 0;\n $strIdxEnd = count($strDirs)-1;\n \n // up to first '**'\n while ($patIdxStart <= $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patDir = $patDirs[$patIdxStart];\n if ($patDir == \"**\") {\n break;\n }\n if (!self::match($patDir, $strDirs[$strIdxStart], $isCaseSensitive)) {\n return false;\n }\n $patIdxStart++;\n $strIdxStart++;\n }\n if ($strIdxStart > $strIdxEnd) {\n // String is exhausted\n for ($i=$patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n return true;\n } elseif ($patIdxStart > $patIdxEnd) {\n // String not exhausted, but pattern is. Failure.\n return false;\n }\n\n // up to last '**'\n while ($patIdxStart <= $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patDir = $patDirs[$patIdxEnd];\n if ($patDir == \"**\") {\n break;\n }\n if (!self::match($patDir, $strDirs[$strIdxEnd], $isCaseSensitive)) {\n return false;\n }\n $patIdxEnd--;\n $strIdxEnd--;\n }\n \n if ($strIdxStart > $strIdxEnd) {\n // String is exhausted\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n return true;\n }\n\n while ($patIdxStart != $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patIdxTmp = -1;\n for ($i = $patIdxStart+1; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] == \"**\") {\n $patIdxTmp = $i;\n break;\n }\n }\n if ($patIdxTmp == $patIdxStart+1) {\n // '**/**' situation, so skip one\n $patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n $patLength = ($patIdxTmp-$patIdxStart-1);\n $strLength = ($strIdxEnd-$strIdxStart+1);\n $foundIdx = -1;\n\n //strLoop: (start of outer loop)\n for ($i=0; $i <= $strLength - $patLength; $i++) { \n for ($j = 0; $j < $patLength; $j++) {\n $subPat = $patDirs[$patIdxStart+$j+1];\n $subStr = $strDirs[$strIdxStart+$i+$j];\n if (!self::match($subPat, $subStr, $isCaseSensitive)) {\n continue 2; // continue up two levels (to strLoop:)\n }\n } \n $foundIdx = $strIdxStart+$i; // only reached if all sub patterns matched\n break;\n }\n\n if ($foundIdx == -1) {\n return false;\n }\n\n $patIdxStart = $patIdxTmp;\n $strIdxStart = $foundIdx + $patLength;\n }\n\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n\n return true;\n }", "public function getFiles( $strRegex = '', $bRecursive = true ) {\n $rz = array(); \n $h = opendir( $this->getName() );\n $arrInner = array();\n while( $h && $pn = readdir( $h ) ) {\n if ( $pn != '.' && $pn != '..' ) {\n \n $strFull = $this->getName() . '/' . $pn;\n if ( is_dir( $strFull ) ) {\n $arrInner[] = $strFull;\n } else if ( $strRegex == '' || preg_match( $strRegex, $pn ) ) { \n $rz [] = $strFull;\n }\n }\n }\n \n if ( $h ) { closedir( $h ); }\n if ( $bRecursive ) {\n foreach ( $arrInner as $strInnerDir ) {\n $dir = new Sys_Dir( $strInnerDir );\n $arrList = $dir->getFiles( $strRegex );\n foreach ( $arrList as $strFile ) { $rz [] = $strFile; } \n }\n } \n return $rz; \n }", "protected function scanDirectory($dir, $include_tests) {\n $files = array();\n\n // In order to scan top-level directories, absolute directory paths have to\n // be used (which also improves performance, since any configured PHP\n // include_paths will not be consulted). Retain the relative originating\n // directory being scanned, so relative paths can be reconstructed below\n // (all paths are expected to be relative to $this->root).\n $dir_prefix = ($dir == '' ? '' : \"$dir/\");\n $absolute_dir = ($dir == '' ? $this->root : $this->root . \"/$dir\");\n\n if (!is_dir($absolute_dir)) {\n return $files;\n }\n // Use Unix paths regardless of platform, skip dot directories, follow\n // symlinks (to allow extensions to be linked from elsewhere), and return\n // the RecursiveDirectoryIterator instance to have access to getSubPath(),\n // since SplFileInfo does not support relative paths.\n $flags = \\FilesystemIterator::UNIX_PATHS;\n $flags |= \\FilesystemIterator::SKIP_DOTS;\n $flags |= \\FilesystemIterator::FOLLOW_SYMLINKS;\n $flags |= \\FilesystemIterator::CURRENT_AS_SELF;\n $directory_iterator = new \\RecursiveDirectoryIterator($absolute_dir, $flags);\n\n // Filter the recursive scan to discover extensions only.\n // Important: Without a RecursiveFilterIterator, RecursiveDirectoryIterator\n // would recurse into the entire filesystem directory tree without any kind\n // of limitations.\n $filter = new RecursiveExtensionFilterIterator($directory_iterator);\n $filter->acceptTests($include_tests);\n\n // The actual recursive filesystem scan is only invoked by instantiating the\n // RecursiveIteratorIterator.\n $iterator = new \\RecursiveIteratorIterator($filter,\n \\RecursiveIteratorIterator::LEAVES_ONLY,\n // Suppress filesystem errors in case a directory cannot be accessed.\n \\RecursiveIteratorIterator::CATCH_GET_CHILD\n );\n\n foreach ($iterator as $key => $fileinfo) {\n $name = $fileinfo->getBasename('.info.yml');\n\n if ($this->fileCache && $cached_extension = $this->fileCache->get($fileinfo->getPathName())) {\n $files[$cached_extension->getType()][$key] = $cached_extension;\n continue;\n }\n\n // Determine extension type from info file.\n $type = FALSE;\n $file = $fileinfo->openFile('r');\n while (!$type && !$file->eof()) {\n preg_match('@^type:\\s*(\\'|\")?(\\w+)\\1?\\s*$@', $file->fgets(), $matches);\n if (isset($matches[2])) {\n $type = $matches[2];\n }\n }\n if (empty($type)) {\n continue;\n }\n $name = $fileinfo->getBasename('.info.yml');\n $pathname = $dir_prefix . $fileinfo->getSubPathname();\n\n $filename = $name . '.' . $type;\n\n if (!file_exists(dirname($pathname) . '/' . $filename)) {\n $filename = NULL;\n }\n\n $extension = new Extension($this->root, $type, $pathname, $filename);\n\n // Track the originating directory for sorting purposes.\n $extension->subpath = $fileinfo->getSubPath();\n $extension->origin = $dir;\n\n $files[$type][$key] = $extension;\n\n if ($this->fileCache) {\n $this->fileCache->set($fileinfo->getPathName(), $extension);\n }\n }\n return $files;\n }", "public function directoryFiles($path)\n {\n $contents = [];\n\n // Scan directory\n $directoryFiles = scandir($path);\n\n foreach ($directoryFiles as $index => $filePath) {\n\n // Ommit . and ..\n if ( ! in_array($filePath, ['.', '..'])) {\n\n // Check if this is a directory\n if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) {\n\n // Rescan and get files in this directory\n $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath));\n\n } else {\n\n // Add file to contens array\n $contents[] = $path . DIRECTORY_SEPARATOR . $filePath;\n }\n }\n }\n\n return $contents;\n }", "protected function _findFiles($extensions = '') {\n\t\t$this->_files = [];\n\t\tforeach ($this->_paths as $path) {\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$Iterator = new RegexIterator(\n\t\t\t\tnew RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)),\n\t\t\t\t'/^.+\\.(' . $extensions . ')$/i',\n\t\t\t\tRegexIterator::MATCH\n\t\t\t);\n\t\t\tforeach ($Iterator as $file) {\n\t\t\t\t$excludes = ['Config'];\n\t\t\t\t//Iterator processes plugins even if not asked to\n\t\t\t\tif (empty($this->params['plugin'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Plugin', 'plugins']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->params['vendor'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Vendor', 'vendors']);\n\t\t\t\t}\n\t\t\t\tif (!empty($excludes)) {\n\t\t\t\t\t$isIllegalPluginPath = false;\n\t\t\t\t\tforeach ($excludes as $exclude) {\n\t\t\t\t\t\tif (strpos($file, $path . $exclude . DS) === 0) {\n\t\t\t\t\t\t\t$isIllegalPluginPath = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($isIllegalPluginPath) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($file->isFile()) {\n\t\t\t\t\t$this->_files[] = $file->getPathname();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function scanFiles($dir){\n $path = __DIR__ . DIRECTORY_SEPARATOR . $dir; /** Nurodomas kelias iki jsons folderio */\n $files = scandir($path); /** Nuskenuoja folderi pagal kelia($path) ir grazina esanciu failu masyva */\n\n return $files;\n}", "function searchdir ($path, $maxdepth=-1, $mode=\"FULL\", $d=0) {\n if (substr($path, strlen($path)-1) != '/') { $path .= '/' ; }\n $dirlist = array ();\n if ($mode != \"FILES\") { $dirlist[] = $path ; }\n if (($handle = opendir($path))) {\n while (false !== ($file = readdir($handle))) {\n if ($file != '.' && $file != '..' ) {\n $file = $path . $file ;\n if (!is_dir($file)) {\n if ($mode != \"DIRS\") {\n $dirlist[] = $file ; } }\n elseif ($d >=0 && ($d < $maxdepth || $maxdepth < 0)) {\n $result = $this->searchdir($file . '/', $maxdepth, $mode, $d+1);\n $dirlist = array_merge($dirlist, $result); }\n }\n } // while\n closedir($handle);\n }\n if ( $d == 0 ) {\n natcasesort($dirlist); }\n return ($dirlist) ;\n }", "public function find($path,$filters = null,$recursive = false){\n if(!$this->isDir($path)) return false;\n if(!$filters) $filters = [];\n if(!array_key_exists(File::FIND_FILTER_TYPE,$filters)) $filters[File::FIND_FILTER_TYPE] = File::FIND_TYPE_FILE;\n $files = [];\n if($dir = $this->nlist($path)) foreach($dir as $entry) if(trim(basename($entry),'.')) try{\n $info = ['dir' => $is_dir = $this->isDir($entry)];\n if($is_dir && $recursive) $files += $this->find($entry,$filters,$recursive);\n foreach($filters as $key => $value){\n if($operator = preg_match('/^(\\\\w+)(\\\\W+)$/',$key,$match) ? $match[2] : null) $key = $match[1];\n else $operator = '==';\n switch($key){\n case File::FIND_FILTER_TYPE:\n if($value == File::FIND_TYPE_ALL) break;\n if(($value & File::FIND_TYPE_DIR) && !$is_dir) continue 3;\n if(($value & File::FIND_TYPE_FILE) && $is_dir) continue 3;\n break;\n case File::FIND_FILTER_NAME:\n if(!Str::operator($info[$key] = $entry,$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_TIME:\n if($is_dir || !Str::operator($info[$key] = $this->mdtm($entry),$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_SIZE:\n if($is_dir || !Str::operator($info[$key] = $this->size($entry),$operator,\\Rsi\\Number::shorthandBytes($value))) continue 3;\n break;\n case File::FIND_FILTER_FUNC:\n if(!($info[$key] = call_user_func($value,$full,$info))) continue 3;\n break;\n }\n }\n $files[$entry] = $info;\n }\n catch(\\Exception $e){}\n return $files;\n }", "function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}", "protected function getStagedFiles($pattern)\n {\n $filter = empty($pattern) ? '' : ' | grep ' . $pattern;\n \n ob_start();\n $result = shell_exec('git diff-index --name-only --diff-filter=ACMR ' . $this->getAgainst() . $filter);\n ob_clean();\n\n $files = explode(\"\\n\", $result);\n\n $files = array_filter($files, function ($file) {\n return ! empty($file);\n });\n\n array_walk($files, function (&$file) {\n $file = $this->root . DIRECTORY_SEPARATOR . $file;\n });\n\n return $files;\n }", "function scanfiles( $path = '' ) {\n\t\t\t\n\t\t\tglobal $bwpsoptions;\n\t\t\t\n\t\t\t$tz = get_option( 'gmt_offset' ) * 60 * 60;\n\n $data = array();\n\n\t\t\tif ( $dirHandle = @opendir( ABSPATH . $path ) ) { //get the directory\n\t\t\t\n\t\t\t\twhile ( ( $item = readdir( $dirHandle ) ) !== false ) { // loop through dirs\n\t\t\t\t\t\n\t\t\t\t\tif ( $item != '.' && $item != '..' ) { //don't scan parent/etc\n\n\t\t\t\t\t\t$relname = $path . $item;\n \n\t\t\t\t\t\t$absname = ABSPATH . $relname;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->checkFile( $relname ) == true ) { //make sure the user wants this file scanned\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( filetype( $absname ) == 'dir' ) { //if directory scan it\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array_merge( $data, $this->scanfiles( $relname . '/' ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else { //is file so add to array\n\n\t\t\t\t\t\t\t\t$data[$relname] = array();\n\t\t\t\t\t\t\t\t$data[$relname]['mod_date'] = @filemtime( $absname ) + $tz;\n\t\t\t\t\t\t\t\t$data[$relname]['hash'] = @md5_file( $absname );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t@closedir( $dirHandle ); //close the directory we're working with\n \n\t\t\t} \n\t\t\t\n\t\t\treturn $data; // return the files we found in this dir\n\t\t\t\n\t\t}", "private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function searchDir($root,$path,&$data)\n\t{\n\t\t$full_path = $root.$path;\n\t\tif(is_dir($full_path))\n\t\t{\n\t\t\t$dp=dir($full_path);\n\t\t\twhile($file=$dp->read())\n\t\t\t{\n\t\t\t\tif($file!='.'&& $file!='..')\n\t\t\t\t{\n\t\t\t\t\tsearchDir($root,$path.'/'.$file,$data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$dp->close();\n\t\t}\n\t\tif(is_file($full_path))\n\t\t{\n\t\t\t$data[]=$path;\n\t\t}\n\t}", "public function findAllFiles($filename)\n {\n $pinfo = pathinfo($filename);\n $extension = $pinfo['extension'];\n $dir = $pinfo['dirname'] == '.' ? '' : $pinfo['dirname'] . '/';\n $file_relative_path_root = $dir . $pinfo['filename'];\n \n $foundFiles = [];\n \n $pattern = $file_relative_path_root . '.' . $extension . '*';\n \n foreach ($this->paths as $assetsRoot) {\n $foundFiles = array_merge($foundFiles, Rails\\Toolbox\\FileTools::searchFile($assetsRoot, $pattern));\n }\n \n return $foundFiles;\n }", "public function findSchemaFiles() {\n $return = [];\n $directory = new RecursiveDirectoryIterator('modules');\n $flattened = new RecursiveIteratorIterator($directory);\n $files = new RegexIterator($flattened, '/schema.xml$/');\n\n foreach ($files as $file) {\n $relative_path = str_replace(DRUPAL_ROOT . '/', '', $file->getRealPath());\n $return[$relative_path] = $relative_path;\n }\n return $return;\n }", "public function getDirs( $strRegex = '' ) {\n $h = opendir( $this->getName() );\n $rz = array(); // collecting result\n while( $h && $pn = readdir( $h ) ) {\n if ( substr( $pn, 0, 1 ) != '.' ) {\n \n $strFull = $this->getName() . '/' . $pn;\n // Sys_Io::out( $strFull );\n \n if ( is_dir( $strFull ) && ( $strRegex == '' || preg_match( $strRegex, $pn ) ) ) { \n $rz [] = $strFull;\n }\n }\n }\n if ( $h ) { closedir( $h ); }\n return $rz; \n }", "function get_all_directory_files($directory_path)\n{\n\n $scanned_directory = array_diff(scandir($directory_path), array('..', '.'));\n\n\n\n return custom_shuffle($scanned_directory);\n}", "public function getFilesInDirectory(string $path): Collection\n {\n return $this->getProcessedAndNewFiles()->filter(function (File $file) use ($path) {\n if ($path === '') {\n return true;\n }\n $path = \"$path/\";\n $dirName = dirname($file->getFilePathName());\n $pathPosition = strpos($file->getFilePathName(), $path);\n if ($dirName === $path || $pathPosition === 0) {\n return true;\n }\n return false;\n });\n }", "function file_list($d,$x) {\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\n return $l;\n}", "public function getDirFiles($path, $constSelector = null){\n $directoryContent = scandir($path);\n $contentCollection = [];\n foreach($directoryContent as $dirElement){\n if($this->checkFileSelector($path.$dirElement, $constSelector)){\n $contentCollection[] = $dirElement;\n }\n }\n return $contentCollection;\n }", "public function scan($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = array_diff(scandir($this->directory), array('.', '..'));\n\t\t$objects = array();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file = $this->directory . $file;\n\t\t\t\n\t\t\tif ($regex_filter) {\n\t\t\t\t$test_path = (is_dir($file)) ? $file . '/' : $file;\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$objects[] = fFilesystem::createObject($file);\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}", "function list_directories($path) {\n\tglobal $root_directory, $gmz_directories, $ignore_folders;\n if ($handle = @opendir($path)) { \n while (false !== ($filename = readdir($handle))) { \n if ($filename != '.' && $filename != '..') {\n\t\t\t\t$file_path = substr($path.'/'.$filename, strlen($root_directory)+1, strlen($path.'/'.$filename));\n\t\t\t\t$file_folder = substr($file_path, 0, -(strlen($filename)+1));\n\t\t\t\tif(is_dir($path.'/'.$filename)) {\n\t\t\t\t\tif(!in_array($file_path, $ignore_folders)) {\n\t\t\t\t\t\t$gmz_directories[] = $file_path;\n\t\t\t\t\t}\n\t\t\t\t\tlist_directories($path.'/'.$filename);\n\t\t\t\t}\n } \n } \n closedir($handle); \n } else {\n\t\tdisplay_error('Invalid Directory');\n\t}\n}", "public static function allFiles(string $pattern = '*', bool $allFiles = false) : array\n {\n return Filesystem::getRecursiveFiles($pattern, $allFiles);\n }", "public function getTemplatesByPattern($pattern)\n {\n File::resolveFilepath($pattern);\n\n $templates = array();\n foreach ($this->_scriptdir as $dir) {\n if (true === is_array(glob($dir . DIRECTORY_SEPARATOR . $pattern))) {\n $templates = array_merge($templates, glob($dir . DIRECTORY_SEPARATOR . $pattern));\n }\n }\n\n return $templates;\n }", "public function findFiles($directory = [], $filetype = [], $ignore_files = [])\r\n {\r\n $found_files = false;\r\n $filetype = is_array($filetype) ? implode('|', $filetype) : $filetype;\r\n $ignore_files = is_array($ignore_files) ? $ignore_files : [];\r\n\r\n $fs = new Filesystem();\r\n if(!$fs->exists($directory))\r\n return $found_files;\r\n $finder = new Finder();\r\n $finder = $finder->files()->ignoreUnreadableDirs()->in($directory);\r\n\r\n foreach ($finder as $file) {\r\n if( preg_match('/^.*\\.('.$filetype.')$/i', $file)) {\r\n if(!in_array(basename($file), $ignore_files))\r\n $found_files[] = $file->getRealpath();\r\n }\r\n }\r\n\r\n return $found_files;\r\n }", "function file_list($d,$x){\r\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\r\n return $l;\r\n}", "function get_files ($folder, $include_subs = FALSE) {\n\tif(substr($folder, -1) == '/') {\n\t\t$folder = substr($folder, 0, -1);\n\t}\n\n\t// Make sure a valid folder was passed\n\tif(!file_exists($folder) || !is_dir($folder) || !is_readable($folder)) {\n\t\treturn FALSE;\n\t\texit();\n\t}\n\n\t// Grab a file handle\n\t$all_files = FALSE;\n\tif($handle = opendir($folder))\t{\n\t\t$all_files = array();\n\t\t// Start looping through a folder contents\n\t\twhile ($file = @readdir ($handle)) {\n\t\t\t// Set the full path\n\t\t\t$path = $folder.'/'.$file;\n\n\t\t\t// Filter out this and parent folder\n\t\t\tif($file != '.' && $file != '..') {\n\t\t\t\t// Test for a file or a folder\n\t\t\t\tif(is_file($path)) {\n\t\t\t\t\t$all_files[] = $path;\n\t\t\t\t} elseif (is_dir($path) && $include_subs) {\n\t\t\t\t\t// Get the subfolder files\n\t\t\t\t\t$subfolder_files = get_files ($path, TRUE);\n\n\t\t\t\t\t// Anything returned\n\t\t\t\t\tif ($subfolder_files) {\n\t\t\t\t\t\t$all_files = array_merge($all_files, $subfolder_files);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cleanup\n\n\t\tclosedir($handle);\n\t}\n\t// Return the file array\n\t@sort($all_files);\n\treturn $all_files;\n}", "function my_scandirNoRecursive($dir_path){\n $array = array();\n $handle = opendir($dir_path);\n while ($entry = readdir($handle)) {\n if (($entry !== \".\") && ($entry !== \"..\")){\n if(!is_dir($entry)){\n array_push($array, $dir_path.\"/\".$entry);\n $array = preg_grep(\"/^.*\\.(png)$/i\", $array);\n sort($array);\n }\n }\n }\n return $array;\n}", "function get_files($route) {\n\tif (is_dir($route)) {\n\t\t$array_files = array();\n\t\t$files = opendir($route);\n\t\twhile ($file = readdir($files)) {\n\t\t\tif ($file != '.' && $file != '..' && !is_dir($route . '/' . $file)) {\n\t\t\t\t$extention = substr($file, -4);\n\t\t\t\t$file = substr($file, 0, -4);\n\t\t\t\tif ($file != 'index' && $extention == '.php') {\n\t\t\t\t\t$array_files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($files);\n\t\treturn $array_files;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function regexFileSearch(string $folder, string $pattern, bool $recursive = true): array\n {\n if ($recursive) {\n $directoryIterator = new \\RecursiveDirectoryIterator($folder);\n $iterator = new \\RecursiveIteratorIterator($directoryIterator);\n } else {\n $directoryIterator = new \\DirectoryIterator($folder);\n $iterator = new \\IteratorIterator($directoryIterator);\n }\n\n $regexIterator = new \\RegexIterator($iterator, $pattern, \\RegexIterator::MATCH);\n $fileList = [];\n\n foreach ($regexIterator as $file) {\n if ($file instanceof \\SplFileInfo) {\n $fileList[] = $file->getPathname();\n }\n }\n\n return $fileList;\n }", "public function scans_packs($pathname)\n\t\t{\t\t\t\n\t\t\t$last_char = substr($pathname,strlen($pathname)-1,1);\n\t\t\tif (0!=strcmp(\"\\\\\",$last_char))\n\t\t\t{\n\t\t\t\t$pathname .= \"\\\\\";\t\t\t\n\t\t\t}\n\t\t\t$pathname .= \"*\";\n\t\t\t$packs = array();\n\t\t\tforeach( glob($pathname) as $filename )\n\t\t\t{\n\t\t\t\tif(!is_dir($filename))\n\t\t\t\t{\n\t\t\t\t\tarray_push($packs,$filename);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $packs;\n\t\t}", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "protected function getFilesInDirCreateTestDirectory() {}", "function get_directories($route) {\n\tif (is_dir($route)) {\n\t\t$array_directories = array();\n\t\t$directories = opendir($route);\n\t\twhile ($directory = readdir($directories)) {\n\t\t\tif ($directory != '.' && $directory != '..' && is_dir($route . '/' . $directory)) {\n\t\t\t\t//$array_directories[] = $directory;\n\t\t\t\tarray_push($array_directories, $directory);\n\t\t\t}\n\t\t}\n\t\tclosedir($directories);\n\t\treturn $array_directories;\n\t} else {\n\t\treturn false;\n\t}\n}", "function get_all_files($some_folder,$type){\n $rs = [];\n if ($handle = opendir($some_folder)) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n $pathinfo = pathinfo($entry);\n if(!empty($pathinfo['extension'])){\n if($pathinfo['extension']==$type){\n $rs[]=$some_folder.\"/\".$entry;\n }\n }\n }\n }\n \n closedir($handle);\n }\n \n return $rs;\n }", "private function _browseDirectory($path, $startsWith = '') {\n $result = array();\n $directories = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);\n if (is_array($directories)) {\n foreach ($directories as $directory) {\n $result = array_merge(\n $result,\n $this->_browseDirectory($directory, $startsWith)\n );\n }\n }\n $files = glob($path.DIRECTORY_SEPARATOR.$startsWith.'*');\n if (is_array($files)) {\n foreach ($files as $file) {\n if (is_file($file)) {\n $result[] = substr($file, strlen($path) + 1);\n }\n }\n }\n return $result;\n }", "public function scanRecursive($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t$objects = $files;\n\t\t\n\t\t$total_files = sizeof($files);\n\t\tfor ($i=0; $i < $total_files; $i++) {\n\t\t\tif ($files[$i] instanceof fDirectory) {\n\t\t\t\tarray_splice($objects, $i+1, 0, $files[$i]->scanRecursive());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($regex_filter) {\n\t\t\t$new_objects = array();\n\t\t\tforeach ($objects as $object) {\n\t\t\t\t$test_path = ($object instanceof fDirectory) ? substr($object->getPath(), 0, -1) . '/' : $object->getPath();\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\t\n\t\t\t\t$new_objects[] = $object;\n\t\t\t}\n\t\t\t$objects = $new_objects;\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}", "function scanDir($cfg) //$view, $tdir , $subdir='', $match)\n {\n $ff = HTML_FlexyFramework::get();\n \n $subdir = $cfg['subdir'];\n $scandir = $cfg['tdir']. (empty($subdir) ? '' : '/') . $subdir;\n \n if (in_array($subdir, $cfg['skipdir'])) {\n return array();\n }\n // skip dom_templates\n \n if (!file_exists($scandir)) {\n return array();\n }\n $dh = opendir($scandir);\n if(!$dh){\n return array(); // something went wrong!?\n }\n $ret = array();\n \n while (($fn = readdir($dh)) !== false) {\n // do we care that it will try and parse the template directory??? - not really..\n // as we are only looking for php files..\n if(empty($fn) || $fn[0] == '.'){\n continue;\n }\n \n $fullpath = $scandir.(empty($scandir) ? '' : \"/\").$fn;\n // echo \"filename: $fullpath \\n\";\n \n if (is_link($fullpath)) {\n continue;\n }\n \n if(is_dir($fullpath)){\n // then recursively call self...\n $cfg['subdir'] = $subdir . (empty($subdir) ? '' : '/') . $fn;\n $children = $this->scanDir($cfg);\n if (count($children)) {\n $ret = array_merge($ret, $children);\n \n }\n continue;\n \n }\n \n if (!preg_match($cfg['match'], $fn) || !is_file($fullpath)) {\n continue;\n }\n \n \n \n $ret[] = $subdir . (empty($subdir) ? '' : '/'). $fn; /// this used to be strtolower?? why???\n\n \n \n }\n// print_r($ret);\n \n return $ret;\n \n \n \n \n }", "function bob_scandir($root_path, $bad_path, $recursive) {\n $output = array();\n if (file_exists($root_path)){\n $paths = scandir($root_path);\n if ($paths === False)\n return False;\n foreach ($paths as $path) {\n $potential_path = \"${root_path}/${path}\";\n\n // Ignore any files in the bad (admin) path or files that begin with a period.\n if ($potential_path == $bad_path or $path[0] == '.')\n continue;\n\n $output[] = $potential_path;\n $bad_folder = ''; // not sure what this is for\n if ($recursive and is_dir($potential_path)) // Recursively descend and print out files.\n $output = array_merge($output, bob_scandir($potential_path, $bad_folder, $recursive));\n }\n }\n return $output;\n}", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "function collect_files($folder, &$files) {\n $dir_content = glob(\"$folder/*\");\n foreach ($dir_content as $file) {\n if (is_dir($file) && $file != \".\" && $file != \"..\") {\n collect_files($file, $files);\n } elseif (is_file($file)) {\n $files[] .= $file;\n }\n }\n }", "function getFilesByMime($folder, $mime_types, $depth = 0, $extensions = NULL) {\n\t$found = array();\n\t\n\tif(!is_array($mime_types))\n\t\t$mime_types = array($mime_types);\n\t\n\tif($extensions) {\n\t\tif(is_array($extensions)) \n\t\t\t$extensions = implode(',', $extensions);\n\t\t\n\t\t$extensions = '.{' . $extensions . '}';\n\t}\n\t\n\tif($depth) foreach(range(1, $depth) as $i) {\n\t\t$parts[] = str_repeat('*/', $i);\n\t}\n\t\n\t$recursion = '{' . implode(',', $parts) . '}';\n\t\n\t$files = glob(\"{$folder}/{$recursion}*{$extensions}\", GLOB_BRACE);\n\t\n\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\n\tforeach($files as $path) {\n\t\tif(!is_readable($path))\n\t\t\tcontinue;\n\t\t\n\t\t$mime = finfo_file($finfo, $path);\n\t\t\n\t\tforeach($mime_types as $allowed) {\n\t\t\tif(strpos($mime, $allowed) !== FALSE) {\n\t\t\t\t$found[] = $path;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $found;\n}", "static private function scan_dir( $dir ) {\n\t\t$ignored = array( '.', '..', '.svn', '.htaccess', 'test-log.log' );\n\n\t\t$files = array();\n\t\tforeach ( scandir( $dir ) as $file ) {\n\t\t\tif ( in_array( $file, $ignored ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$files[ $file ] = filemtime( $dir . '/' . $file );\n\t\t}\n\t\tarsort( $files );\n\t\t$files = array_keys( $files );\n\n\t\treturn ( $files ) ? $files : false;\n\t}", "function getFiles(string $path): array\n{\n\tclearstatcache();\n\t$scanned_directory = array_diff(scandir($path), array('..', '.', '.DS_Store'));\n\treturn $scanned_directory;\n}" ]
[ "0.7741564", "0.6880518", "0.68499774", "0.6830415", "0.67901915", "0.675162", "0.67503697", "0.67409074", "0.6733775", "0.6703066", "0.6621217", "0.6567973", "0.65216756", "0.6448307", "0.6437987", "0.64120555", "0.6358692", "0.62945175", "0.62757033", "0.6273639", "0.6258265", "0.6215338", "0.617806", "0.6165316", "0.61635876", "0.61517215", "0.6110555", "0.6093242", "0.6082412", "0.60706925", "0.6051447", "0.6021887", "0.60005057", "0.59865856", "0.59792936", "0.59656554", "0.5963004", "0.59466374", "0.5941419", "0.5930434", "0.5918598", "0.59078157", "0.5876761", "0.5856093", "0.58541954", "0.58503884", "0.58435595", "0.5834236", "0.5830217", "0.5822961", "0.5800146", "0.579924", "0.5799173", "0.57905626", "0.57873833", "0.5777149", "0.5776956", "0.5766513", "0.57627517", "0.5758453", "0.5735165", "0.57245284", "0.57167226", "0.57090443", "0.5697639", "0.5681167", "0.56433517", "0.56391245", "0.5621113", "0.5609058", "0.5607302", "0.5607064", "0.5605089", "0.55999917", "0.5599166", "0.55948293", "0.559139", "0.55839235", "0.5582899", "0.55707204", "0.55700105", "0.55552614", "0.5554253", "0.5549194", "0.5539622", "0.5538371", "0.5527302", "0.5524073", "0.55123115", "0.5509612", "0.5509071", "0.55085015", "0.5504949", "0.5503292", "0.54942024", "0.5494128", "0.5489591", "0.54720163", "0.54653704", "0.5463032" ]
0.72798556
1
Beheerder kan hier de desbetreffende kolom verwijderen waarbij $columnId = id van de kolom
Администратор может здесь удалить соответствующую колонку, где $columnId = идентификатор колонки
function deleteByColumnId($columnId) { $this->db->where('planningKolomId', $columnId); $this->db->delete('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function withdraw($columnId, $userId)\n {\n $this->db->where('gebruikerId', $userId);\n $this->db->where('planningKolomId', $columnId);\n $this->db->delete('aanwezigheid');\n }", "private function DeleteColumn(string $Column){\n return $this->Connection->exec('ALTER TABLE '.$this->TableName.' DROP COLUMN '.$Column.';');\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function deleteMerge($row, $column) {\n\t}", "function settings_modify_matrix_column($data)\n\t{\n\t\tif ($data['matrix_action'] == 'delete')\n\t\t{\n\t\t\t// delete any relationships created by this column\n\t\t\t$this->EE->db->where('parent_col_id', $data['col_id'])\n\t\t\t ->delete('playa_relationships');\n\t\t}\n\t}", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "function delete_all($table,$column=\"id\") {\n global $_REQUEST;\n global $lang;\n\n // usun wszsytkei zaznaczone rekordy\n if (! empty($_REQUEST[$this->del])) {\n $del=$_REQUEST[$this->del];\n\n if (is_object(@$this->delete_obj)) {\n $data=$this->deleteCheck($table,$column,$del,$this->delete_obj);\n $del=$data['deleted'];\n }\n\n // lista rekordow do usuniecia\n while (list($id,) = each($del)) {\n if (! empty($id)) {\n $this->delete_one_record($id,$table,$column);\n }\n }\n } else {\n if ($this->show_empty_info==true) {\n print \"<center>\".$lang->delete_empty.\"</center>\";\n }\n }\n return;\n }", "public function deleteColumn( $iColumn )\r\n {\r\n $nColumns = $this->getNumberOfColumns();\r\n if ($iColumn > -1 && $iColumn < $nColumns) {\r\n foreach ($this->data as $iRow => $rowData) {\r\n for ($iCol = $iColumn; $iCol < $nColumns - 1; $iCol++) {\r\n $this->data[$iRow][$iCol] =\r\n $this->data[$iRow][$iCol + 1];\r\n }\r\n unset( $this->data[$iRow][$nColumns - 1] );\r\n }\r\n }\r\n }", "function deleteListM($columnname){\n $sql= \"ALTER TABLE `all_list` DROP $columnname\";\n $result= $this->db->query($sql);\n if(!$result){\n echo \"Unable to Delete Column !\";\n }else{\n echo \"Successfully Deleted !\";\n }\n }", "public function klantVerwijderen($id) {\n $conn = $this->connect();\n // SQL Query voorbereiden en variabelen binden aan de query\n $stmt = $conn->prepare(\"DELETE FROM klant WHERE id_klant = :id\");\n $stmt->bindParam(':id',$id);\n // als query is gelukt, true terugsturen, anders false terugsturen\n if($stmt->execute()){\n return true; \n }else{\n return false;\n }\n \n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_absence'][] = $strValue;\n }\n $tblAbsence = new cHrdAbsence();\n $tblAbsenceDetail = new cHrdAbsenceDetail();\n $tblAbsence->deleteMultiple($arrKeys);\n $tblAbsenceDetail->deleteMultiple($arrKeys2);\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, implode(\",\", $arrKeys2['id_absence']));\n $myDataGrid->message = $tblAbsence->strMessage;\n}", "public function deleteFromMatrix() {\n DB::statement('DELETE FROM lemma_matrix WHERE lemma1='.$this->id.' OR lemma2='.$this->id);\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function getColumnCount($columnId)\n {\n $this->db->where('planningKolomId', $columnId);\n $this->db->where('surveillant', 0);\n return $this->db->count_all_results('aanwezigheid'); \n }", "public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }", "function removeColumn($columnName) {\n foreach ($this->columns as $key => $column) {\n if ($column->columnName === $columnName) {\n //delete the column\n unset($this->columns[$key]);\n }\n }\n }", "public function removeColumn($column_id)\n {\n return $this->db->table(self::TABLE)->eq('id', $column_id)->remove();\n }", "public function dropColumn()\n\t{\n\n\t}", "public function desenfocarCamaraAlumnos1() {\n\n self::$alumnos1->desenfocar();\n\n }", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public static function removeColumn($col){\n\t\t//\t\t\tarray_slice($db_fields, $col + 1, count($db_fields) -1, true);\n\t\t\t\t\n\t}", "function del($fp_rowId)\n {\n foreach ((array)$fp_rowId as $k => $id) {\n $this->db->or_where('id', $id);\n }\n $this->db->from($this->table);\n $this->db->delete($this->table);\n //dump($this->db->last_query());\n return true;\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function newskomentar_deletedata($tbl_newskomentar, $id){\n\t$sql = mysql_query(\"DELETE * FROM $tbl_newskomentar WHERE id = '$id'\");\n\treturn $sql;\n}", "function delete_record($table, $arg, $column_id)\n{\n $ci = & get_instance();\n $db_debug = $ci->db->db_debug;\n $ci->db->db_debug = FALSE;\n $ci->db->where([$column_id => $arg]);\n $ci->db->delete($table);\n if ($ci->db->affected_rows() > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n $ci->db->db_debug = $db_debug;\n}", "public function actionDeleteColumn($id)\n {\n $model = $this->findModel($id);\n $model->deleted = 1;\n if ( $model->save() ) {\n Yii::$app->getSession()->setFlash('success', 'Quotation deleted');\n } else {\n Yii::$app->getSession()->setFlash('danger', 'Unable to delete Quotation');\n }\n\n return $this->redirect(['index']);\n }", "function cs_pb_column($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$column_element_size = '25';\n\t\t$column_text = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$column_element_size = $cs_node->column_element_size;\n\t\t\t$column_text = $cs_node->column_text;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $column_element_size?>\" item=\"column\" data=\"<?php echo element_size_data_array_index($column_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"column_element_size[]\" class=\"item\" value=\"<?php echo $column_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Column Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Column Text</label></li>\n <li class=\"to-field\">\n \t<textarea name=\"column_text[]\"><?php echo $column_text?></textarea>\n <p>Shortcodes and HTML tags allowed.</p>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"column\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "public function NombresColumnas($tabla)\r\n {\r\n\t$this->tabla=$tabla;\r\n\t$Columnas1=mysql_query(\"select * from $this->tabla\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n$reg=mysql_fetch_array($Columnas1);\t\r\n$numCols=count($reg);\r\n\r\nfor ($i=0; $i<=$numCols; $i++){\r\n\t\r\n\t\t$this->NombreCol[$i]=mysql_field_name($Columnas1,$i);\t\r\n\t\tif ($this->NombreCol[$i]==\"\"){\r\n\t\t\tunset($this->NombreCol[$i]); \r\n\t\t\t$this->NombreCol = array_values($this->NombreCol);//quito el espacio que ha quedado despues de eliminarse \r\n\t\t}else{\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n}\r\n\r\n$this->ID=$this->NombreCol[0];\r\n\r\n$numCols=count($this->NombreCol);\r\n$this->NumCols=$numCols;\r\n//print($this->NumCols);\r\n//print_r($this->NombreCol);\r\n\r\n\t\t\r\n\t}", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `layer_points` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "public function borrar_dispositivos($id_pds)\n {\n $sql = \"SELECT * FROM devices_pds WHERE status ='Alta'\n\t\t\t\tAND id_pds ='\".$id_pds.\"'\";\n $resultado = $this->db->query($sql)->result();\n\n foreach ($resultado as $device) {\n /*Insertar en el historico de tienda el estado del dispositivo*/\n $elemento = array(\n 'id_devices_pds' => $device->id_devices_pds,\n 'fecha' => date('Y-m-d H:i:s'),\n 'status' => 'Baja',\n 'motivo' => CIERRE_TIENDA\n );\n // print_r($elemento); echo \"<br>\";\n $this->insert_historico_devicesPDS($elemento);\n }\n\n $sql = \"UPDATE devices_pds SET status ='Baja' WHERE id_pds ='\".$id_pds.\"'\";\n $this->db->query($sql);\n }", "public function column_revoke($item)\n {\n }", "public function NombresColumnasEsp($tabla)\r\n {\r\n\t//echo \"Entrando a nombres \";\r\n\t$Columnas1=mysql_query(\"select * from $tabla\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n$reg=mysql_fetch_array($Columnas1);\t\r\n$numCols=count($reg);\r\n\r\nfor ($i=0; $i<=$numCols; $i++){\r\n\t\r\n\t\t$this->NombreCol[$i]=mysql_field_name($Columnas1,$i);\t\r\n\t\tif ($this->NombreCol[$i]==\"\"){\r\n\t\t\tunset($this->NombreCol[$i]); \r\n\t\t\t$this->NombreCol = array_values($this->NombreCol);//quito el espacio que ha quedado despues de eliminarse \r\n\t\t}else{\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n}\r\n\r\n$this->ID=$this->NombreCol[0];\r\n\r\n$numCols=count($this->NombreCol);\r\n$this->NumCols=$numCols;\r\n//return()\r\n//echo \"Saliendo de nombres \";\r\n//print($this->NumCols);\r\n//print_r($this->NombreCol);\r\n\r\n\t\t\r\n\t}", "abstract public function remove_column($table_name, $column_name);", "function delete_one_record($id=\"\",$table,$column=\"id\") {\n global $lang,$db;\n\n if (empty($id)) return;\n\n $query=\"SELECT $column FROM $table WHERE id=?\";\n $prepared_query=$db->PrepareQuery($query);\n if ($prepared_query) {\n $db->QuerySetText($prepared_query,1,$id);\n $result=$db->ExecuteQuery($prepared_query);\n if ($result!=0) {\n $num_rows=$db->NumberOfRows($result);\n if ($num_rows>0) {\n $column=$db->FetchResult($result,0,\"$column\");\n\n // usun produkt\n $query=\"DELETE FROM $table WHERE id=?\";\n $prepared_query=$db->PrepareQuery($query);\n if ($prepared_query) {\n $db->QuerySetText($prepared_query,1,$id);\n $result=$db->ExecuteQuery($prepared_query);\n if ($result!=0) {\n print \"&nbsp; &nbsp; $column -\".$lang->deleted.\"<br>\";\n } else die ($db->Error());\n } else die ($db->Error());\n } else {\n print $lang->delete_not_found.\" id=$id<BR>\";\n }\n } else die ($db->Error());\n } else die ($db->Error());\n\n return;\n }", "public static function eliminar($idAlumno){\r\n\t\t\t$conexion =new Conexion();\r\n\t\t\t\tif($idAlumno){\r\n\t\t\t\t\t$consulta = $conexion->prepare('DELETE FROM ' . self::TABLA .' WHERE idAlumno = :idAlumno' );\r\n\t\t\t\t\t$consulta->bindParam(':idAlumno', $idAlumno);\r\n\t\t\t\t\t$consulta->execute(); \r\n\t\t\t\t}\r\n\t\t\t$conexion = null; \r\n\t\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "function rd_user_id_column( $columns ) {\n\t$columns[ 'user_id' ] = 'ID';\n\treturn $columns;\n}", "function delColonyById($id) {\r\n\t\tpwQuery::delete('pw_colonys', 'id=:id', array($id));\r\n\t}", "public function removeColumn($columnName)\r\n {\r\n }", "public function hard_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\treturn $this->db\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->delete($this->table);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function deleteColumn($colNo = 0)\n {\n if ($colNo < 0) {\n return;\n }\n if ($colNo > $this->nCols) {\n return;\n }\n $delEntries = range($colNo, count($this->inputData), $this->nCols);\n foreach ($delEntries as $key) {\n unset($this->inputData[$key]);\n }\n // Reindex array!\n $this->inputData = array_values($this->inputData);\n // Build reduced table\n --$this->nCols;\n $this->childNodes = [];\n $this->append($this->makeTableRows());\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_evaluation'][] = $strValue;\n }\n $tblHrdEvaluationMaster = new cHrdEvaluationMaster();\n $tblHrdEvaluationDetail = new cHrdEvaluationDetail();\n $tblHrdEvaluationMaster->deleteMultiple($arrKeys);\n $tblHrdEvaluationDetail->deleteMultiple($arrKeys2);\n $myDataGrid->message = $tblHrdEvaluationDetail->strMessage;\n}", "function hapusriwayat($id) {\n\tglobal $conn;\n\tmysqli_query($conn, \"DELETE FROM pengguna_memasukkan WHERE id_pengguna='$id'\");\n\t\n\treturn mysqli_affected_rows($conn); \n}", "function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n print_r($arrKeys);\n die();\n $dataGaVendor = new cGaVendor();\n $dataGaVendor->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataGaVendor->strMessage;\n}", "public function borrar() {\n $id = $this->input->post(\"id\");\n $this->AdministradorModel->delete($this->tabla, $id);\n }", "public function desenfocarCamaraAlumnos2() {\n\n self::$alumnos2->desenfocar();\n\n }", "public function getAddEditRemoveColumnData($id)\n {\n // if ($request->ajax()) {\n // $model = Warehouse_order::with('customers_warehouse','sub_service.remarks');\n // // ->select('customers_warehouse.*','sub_service.*','sub_service.remarks.*');\n\n // return DataTables::eloquent($model)\n // ->addColumn('customers_warehouse', function (Warehouse_order $Warehouse_order) {\n // return $Warehouse_order->customers_warehouse->name;\n // })\n // ->toJson();\n // }\n\n $results = null;\n $Authorized = Auth::User()->roles;\n $userId = Auth::User()->id;\n\n foreach ($Authorized as $checkaccess) {\n # code...\n $results[] = $checkaccess->name;\n }\n \n // return redirect()->route('warehouse.static', $this->jagal_squad->session()->get('id'));\n $id_auto = 1;\n $alert_customers = Customer::with('cstatusid')->where('flag',0)->get();\n $alert_items = Item::where('flag',0)->get();\n $data_customer_transport_sys_alerts = Vendor_item_transports::with('vendors',\n 'city_show_it_origin','city_show_it_destination')->where('flag', 0)->get();\n // $warehouseTolist = Warehouse_order::with('warehouse_o_status','customers_warehouse','sub_service.remarks','sub_service.item','users')\n // ->whereIn('company_branch_id', [$company_branch_with_role_branch])\n // ->orderBy('updated_at', 'DESC')->get();\n $warehouseTolist = $this->Apiopentransaction->getOpenWarehouseWithBranchId($userId);\n \n $trashlist = Warehouse_order::with('customers_warehouse','sub_service.remarks')\n ->onlyTrashed()\n ->get();\n $prefix = Company_branchs::branchwarehouse($this->jagal_squad->session()->get('id'))->first();\n $data_item_alert_sys_allows0 = Customer_item_transports::with('customers',\n 'city_show_it_origin','city_show_it_destination')->where('flag', 0)->get();\n\n $fetch_izzy = dbcheck::where('check_is','=','api_izzy')->get();\n\n foreach ($fetch_izzy as $value) {\n # code...\n $fetchArrays[] = $value->check_is;\n } \n \n if(isset($fetchArrays) != null){\n\n $operations_api_izzy_is_true_v1 = dbcheck::where('check_is','=','api_izzy')->get();\n \n foreach ($operations_api_izzy_is_true_v1 as $operationz) {\n # code...\n $fetchArray1 = $operationz->operation;\n } \n \n $operations_api_izzy_is_true_v2 = dbcheck::where('check_is','=','api_accurate')->get();\n \n foreach ($operations_api_izzy_is_true_v2 as $operations) {\n # code...\n $fetchArray2 = $operations->operation;\n } \n \n } \n\n return $this->datatabl->render('admin.warehouse.warehouse_orderlist')\n ->with(\n [\n 'menu'=> \"Warehouse Order List\",\n 'trashlist' => $trashlist,\n 'some' => $id,\n 'apis' => $results,\n 'alert_customers'=> $alert_customers,\n 'choosen_user_with_branch' => $id,\n 'system_alert_item_customer' => $data_item_alert_sys_allows0,\n 'system_alert_item_vendor' => $data_customer_transport_sys_alerts,\n 'alert_items'=> $alert_items\n ]\n )\n ;\n \n // return DataTables::of($wareouses)\n // ->addColumn('action', function ($wareouses) {\n // return '<a href=\"#edit-'.$wareouses->id.'\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i> Edit</a>';\n // })\n // ->editColumn('id', 'ID: {{$id}}')\n // ->removeColumn('password')\n // ->make(true);\n }", "public function isVerwijderd( )\r\n {\r\n return false;\r\n }", "public function eliminar($valor=null, $columna=null){\n\n\t\t//error_reporting (0);\n\t\t$active = 0;\n\n\t\t//eleimna de la tabla los elementos, si es null nos pone id\n\t\t//$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = ':p'\";\n\t\t$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = '\".$this->id.\"'\";\n\t\t//echo $query.\"<br/>\";\n\n\t\tself::getConexion();\n\t\t//Prepara la conexión\n\t\t$res = self::$cnx->prepare($query);\n\t\t//Agregamos los parametros\n\t\t//Si el valor es diferente de nulo, loa agrega como parametro, en caso contraro de que no existiera el valor\n\t\t//simplemente le ponemos el valor del id del modelo o del registro que se haya puesto \n\t\t\n\t\t//echo \"id: \".$this->id;\n\t\t\n\t\tif(!is_null($valor)){\n $res->bindParam(\":p\",$active, $valor);\n \n }else{\n $res->bindParam(\":p\",$active,(is_null($this->id)?null:$this->id));\n \t//error_reporting (0);\n }//if\n\n\t\t//ejecutar al final \n\t\tif($res->execute()){\n\t\t\t//si ejecuta el query al final desconecta y retorna true\n\t\t\tself::getDesconectar();\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//si no ejecuta el query nos retorna false\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function delete($tableId, $columnId, $optParams = array())\n {\n $params = array('tableId' => $tableId, 'columnId' => $columnId);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }", "public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}", "public function getDeletedByColumn()\n {\n return Track::DELETED_BY;\n }", "public function deleteGalleryColumn()\n {\n $item = new \\stdClass();\n $item->id = $this->id;\n $item->gallery = '';\n return $this->db->updateObject('#__k2_items', $item, 'id');\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function afterDelete()\n {\n \\PProject::model()->updateAll([\n 'artist_id' => new \\CDbExpression('NULL')\n ], 'artist_id = :artist_id', [\n ':artist_id' => $this->id\n ]);\n }", "public function eliminarItemsVentas($id_unico){\n //echo($id_unico.\"---\");\n \n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_det_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_det_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_det_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_det', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }", "final public function delete() {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\t\n $sql_query = 'DELETE FROM fresco_costing_component_array WHERE component_id ='.$this->_component_id;\n \n $result = $mysqli->query($sql_query);\n if (!$result) {\n trigger_error('Unable to delete from database : SQL query : ' . $sql_query);\n }\n\treturn;\n }", "public function afterDeleteCommit(): void\n {\n }", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "function hapus($id){\n \tglobal $conn;\n \tmysqli_query($conn, \"DELETE FROM pengunjung WHERE id_pengunjung = $id\");\n \treturn mysqli_affected_rows($conn);\n }", "public function confirmDelete( )\r\n {\r\n throw new KVDdom_RedactieException( 'Kan het verwijderen niet bevestigen van een object dat niet verwijderd is.' );\r\n }", "public function eliminarPlanmatest($pla_id, $per_id, $bloque, $hora, $pes_usuario_modifica, $pes_estado, $pes_fecha_modificacion) {\n\n $con = \\Yii::$app->db_academico;\n\n if ($trans !== null) {\n $trans = null; // si existe la transacción entonces no se crea una\n } else {\n $trans = $con->beginTransaction(); // si no existe la transacción entonces se crea una\n }\n if (!empty($bloque) && !empty($hora)) {\n $modificar = \"pes_mat_b\" . $bloque . \"_h\" . $hora . \"_cod = null,\n pes_mod_b\" . $bloque . \"_h\" . $hora . \" = null,\n pes_mat_b\" . $bloque . \"_h\" . $hora . \"_nombre = null,\";\n }\n $este = \"UPDATE db_academico.planificacion_estudiante\t\t \n SET\n $modificar\n pes_usuario_modifica = $pes_usuario_modifica,\n pes_fecha_modificacion = $pes_fecha_modificacion \n WHERE \n pes_estado= 1 AND pla_id = $pla_id AND per_id = $per_id\";\n try {\n $comando = $con->createCommand\n (\"UPDATE \" . $con->dbname . \".planificacion_estudiante\t\t \n SET\n $modificar\n pes_usuario_modifica = :pes_usuario_modifica,\n pes_fecha_modificacion = :pes_fecha_modificacion \n WHERE \n pes_estado= :pes_estado AND pla_id = :pla_id AND per_id = :per_id\");\n $comando->bindParam(\":pla_id\", $pla_id, \\PDO::PARAM_INT);\n $comando->bindParam(\":per_id\", $per_id, \\PDO::PARAM_INT);\n $comando->bindParam(\":pes_usuario_modifica\", $pes_usuario_modifica, \\PDO::PARAM_INT);\n $comando->bindParam(\":pes_fecha_modificacion\", $pes_fecha_modificacion, \\PDO::PARAM_STR);\n $comando->bindParam(\":pes_estado\", $pes_estado, \\PDO::PARAM_STR);\n $response = $comando->execute();\n if ($trans !== null)\n $trans->commit();\n return $response;\n } catch (Exception $ex) {\n if ($trans !== null)\n $trans->rollback();\n return FALSE;\n }\n }", "public function eliminarVentas($id_unico){\n //echo($id_unico);\n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_cab_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_cab_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_cab_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_cab', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }", "public function forceDelete(User $user, KitchenExportColumn $kitchenExportColumn) {\n\t\t//\n\t}", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id_adm_userlog'][] = $strValue;\n }\n $dataUserLog = new cAdmUserLog();\n $dataUserLog->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataUserLog->strMessage;\n}", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "function supprimerTypeChambre ($connexion, $id) {\r\n\r\n $req = \"DELETE FROM TypeChambre WHERE id=?\";\r\n $stmt = $connexion -> prepare ($req);\r\n $ok = $stmt -> execute (array ($id));\r\n return $ok;\r\n\r\n }", "public function onDelete() : void\n {\n parent::onDelete();\n $this->setRef('from__company_id__to__table__companies__columns__id', null, 'products');\n }", "function yy_r37(){ $this->_retvalue = new SQL\\AlterTable\\DropColumn($this->yystack[$this->yyidx + 0]->minor); }", "public function vymaz(){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n DELETE FROM Diskusie WHERE id = \"$this->ID\";\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n }\r\n $db->close();\r\n }", "private function allColumns($newElement, $oldElement)\n {\n\n foreach (get_object_vars($newElement) as $key => $newValue){\n\n if(!property_exists($oldElement,$key)){\n $this->report->diff()->$key[$oldElement->{$this->primaryKey}] = ['null' => $newValue];\n\n continue;\n }\n\n if($newValue != $oldElement->$key)\n $this->report->diff()->$key[$oldElement->{$this->primaryKey}] = [$oldElement->$key => $newValue];\n }\n }", "public function deleteBo($id) {\n\n $this->getDb()->delete('commande', array('id' => $id));\n }", "public function hapusdata($id)\n\t{\n\t\t$this->db->where('id_015', $id);\n\t\treturn $this->db->delete('tabel_b');\n\n\t}", "function delete($table, $pk, $column = 'id')\n\t{\n\t\tif($statement = $this->query(\"DELETE FROM `$table` WHERE `$column` = ?\", $pk))\n\t\t{\n\t\t\treturn $statement->rowCount();\n\t\t}\n\t}", "public function drop_siswa_toTO($idKey)\n\t{\n\t\t$this->db->where('id',$idKey);\n\t\t$this->db->delete('tb_hakakses-to');\n\t}", "public function findDeleted($id, $columns = ['*'], $skipPresenter = false);", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "public function crudRemoveCol($columns) {\r\n $this->colsRemove = $columns;\r\n return $this;\r\n }", "public function removeColumn($aField) {\r\n foreach ($this -> mCols as $key => $col) {\r\n if ($key == $aField) {\r\n unset($this -> mCols[$key]);\r\n }\r\n }\r\n }", "public function destroy($id)\n {\n $dataColumn = $this->dataColumnRepository->findWithoutFail($id);\n\n if (empty($dataColumn)) {\n Flash::error('Data Column not found');\n\n return redirect(route('admin.dataColumns.index'));\n }\n\n $this->dataColumnRepository->delete($id);\n\n Flash::success('Data Column deleted successfully.');\n\n return redirect(route('admin.dataColumns.index'));\n }", "public function deleteFromDB($table_name,$id_column,$id_value)\n\t{\n\t\t$delete_sql = \"DELETE FROM \".$table_name.\" WHERE \".$id_column.\"=:id_value\";\n\n\t\treturn $this->performDBUpdate($delete_sql,['id_value'=>$id_value]);\n\t}", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "function BorrarMaterial($id){\n $sql=\"DELETE FROM material_entregado WHERE empleado=\".$id;\n $borrar=$this->realizarConsulta($sql);\n if ($borrar=!NULL) {\n return true;\n }else {\n return false;\n }\n }", "function kt_invoices_columns_add($columns) {\n\tunset($columns['date']);\n\t// unset($columns['package']);\n\tunset($columns['price']);\n\tunset($columns['payment_option']);\n\tunset($columns['title']);\n\t$columns['user'] \t\t= pll__('User','docdirect_core');\n\t$columns['package'] \t\t\t= pll__('Package','docdirect_core');\n\t$columns['payment_option'] \t\t= pll__('Payment Method','docdirect_core');\n\t$columns['price'] \t\t= pll__('Price','docdirect_core');\n \n\t\treturn $columns;\n}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "private function byColumns($newElement, $oldElement)\n {\n\n foreach ($this->columns as $baseColumn => $mergeColumn){\n\n if(!property_exists($oldElement,$baseColumn)){\n\n $this->report->diff()->$baseColumn[$oldElement->{$this->primaryKey}] = ['null' => $newElement->$mergeColumn];\n\n continue;\n }\n\n if($newElement->$mergeColumn != $oldElement->$baseColumn){\n\n $this->report->diff()->$baseColumn[$oldElement->{$this->primaryKey}] = [$oldElement->$baseColumn => $newElement->$mergeColumn];\n }\n\n }\n }", "public static function ver($idAlumno){\r\n\t \t$conexion = new Conexion();\r\n\t\t\t\tif($idAlumno){\r\n\t\t\t\t\t$consulta = $conexion->prepare('SELECT * FROM ' . self::TABLA.' WHERE idAlumno = :idAlumno');\r\n\t\t\t\t\t$consulta->bindParam(':idAlumno', $idAlumno); \r\n\t\t\t\t\t$consulta->execute();\r\n\t\t\t\t\t$registro = $consulta->fetch();\r\n\t\t\t\t\tif($registro){\r\n\t\t\t\t\t\treturn $registro;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t$conexion = null; \r\n\t\t}", "public static function clear($uuid, $column = null) {\n\t\tif(is_null($column) || $column == 'id') {\n\t\t\tif(static::has($uuid))\n\t\t\t\tunset(static::$cache[$uuid]);\n\t\t} else if(isset(static::$mapping[$column][$uuid]))\n\t\t\tstatic::clear(static::$mapping[$column][$uuid]);\n\t}", "public function borrarAlumnaController()\n\t\t{\n\t\t\tif(isset($_GET['idBorrar']))\n\t\t\t{\n\t\t\t\t$datosController = $_GET['idBorrar'];\n\t\t\t\t$respuesta = Datos::borrarAlumnaModel($datosController,'alumna');\n\n\t\t\t\tif($respuesta == \"success\")\n\t\t\t\t{\n\t\t\t\t\techo\"<script>\n\t\t\t\t\t\t\twindow.location = 'index.php?action=alumnas';\n\t\t\t\t\t\t</script>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function hapusjabatan($id) {\n\t\t$this->db->where('ID_JBT', $id);\n\t\t$this->db->delete('IKD.IKD_D_JABATAN_STRUKTURAL'); \t\t\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function delete($bd,$where){\nforeach ($where as $key => $value) {\n\t$campo = $key;\n\t$value_campo = $value;\n}\n$sql = \"DELETE FROM \".$bd.\"\nWHERE \".$campo.\" = \".$value_campo.\"\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute();\n$stmt = null;\nreturn $dato;\n}", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }" ]
[ "0.6653683", "0.59138584", "0.57321835", "0.57287085", "0.56800467", "0.5679142", "0.5659805", "0.5614969", "0.554716", "0.55308163", "0.5526045", "0.550642", "0.54734826", "0.5453377", "0.5448131", "0.5414671", "0.5398385", "0.539816", "0.5395479", "0.53720653", "0.53634214", "0.5325787", "0.5319517", "0.52918047", "0.5275701", "0.52704555", "0.5263389", "0.5251954", "0.52487147", "0.5236688", "0.5235484", "0.52315086", "0.52236974", "0.52217036", "0.520575", "0.5194463", "0.5193298", "0.5187103", "0.51817155", "0.5178927", "0.5176992", "0.517683", "0.5170678", "0.5168204", "0.5162454", "0.5153897", "0.51415116", "0.5139313", "0.5137587", "0.51312417", "0.5129143", "0.51201636", "0.51189053", "0.5110874", "0.51039934", "0.5099962", "0.50989395", "0.5084165", "0.50788325", "0.50748676", "0.50686574", "0.5066187", "0.5043715", "0.5042527", "0.5042427", "0.504135", "0.50378466", "0.5033911", "0.50338745", "0.5031029", "0.50286543", "0.5023404", "0.5022079", "0.5020379", "0.50168777", "0.50052136", "0.49936128", "0.49917018", "0.49888647", "0.49882212", "0.4983469", "0.49682805", "0.49680474", "0.4966796", "0.4965031", "0.49641824", "0.49632522", "0.4951493", "0.49506903", "0.4948534", "0.49452758", "0.49441895", "0.49424937", "0.4940947", "0.4937899", "0.49346823", "0.49327245", "0.49272344", "0.49250636", "0.49239692" ]
0.71187615
0
Guarda un objeto Proveedor en la base de datos.
Сохраните объект Поставщик в базе данных.
public function insert($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$authuser = Auth::user();\n\t\t$rules = array(\n\t\t\t'proveedor_tipo' => 'not_in:NA',\n\t\t\t'nombre_usuario' => 'required',\n\t\t\t'nombre' => 'required',\n\t\t\t//'direccion' => 'required',\n\t\t\t//'telefono' => 'required',\n\t\t\t//'facebook' => 'required',\n\t\t\t//'twitter' => 'required',\n\t\t\t//'otro_sns' => 'required',\n\t\t\t'longitud' => 'required|numeric',\n\t\t\t'latitud' => 'required|numeric',\n\t\t\t'introduccion' => 'required',\n\t\t\t'descripcion' => 'required',\n\t\t\t'vision' => 'required',\n\t\t\t'productos' => 'required',\n\t\t\t'imagen_intro' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_descripcion' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_vision' => 'mimes:png,gif,jpeg|max:20000',\t\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\t\t\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('vistausuario/proveedor/create')\n\t\t\t\t->withErrors($validator)->withInput();\n\t\t} else {\n\t\t\n\t\t$proveedores = new Proveedor;\n\t\t$proveedores_detalle = new ProveedorDetalle;\n\n\t\t$nombreDeUsuario = Input::get('nombre_usuario');\n\n\t\t$proveedores->id=0;\n\t\t$proveedores->proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo');\n\t\t$proveedores->nombre_usuario=Input::get('nombre_usuario');\n\t\t$proveedores->nombre=Input::get('nombre');\n\t\t$proveedores->direccion=Input::get('direccion');\n\t\t$proveedores->telefono=Input::get('telefono');\n\t\t$proveedores->facebook=Input::get('facebook');\n\t\t$proveedores->twitter=Input::get('twitter');\n\t\t$proveedores->otro_sns=Input::get('otro_sns');\n\t\t$proveedores->longitud=Input::get('longitud');\n\t\t$proveedores->latitud=Input::get('latitud');\n\t\t$proveedores->habilitar = 0;\n\t\t$proveedores->solicitar_premium= 0;\n\t\t$proveedores->usuario_id = $authuser->id;\n\t\t$proveedores->save();\n\n\t\t$idproveedor = $proveedores->id;\n\n\t\t$proveedores_detalle->id=0;\n\t\t$proveedores_detalle->proveedores_idproveedor=$idproveedor;\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo_idproveedor_tipo');\n\t\t$proveedores_detalle->introduccion=Input::get('introduccion');\n\t\t$proveedores_detalle->descripcion=Input::get('descripcion');\n\t\t$proveedores_detalle->vision=Input::get('vision');\n\t\t$proveedores_detalle->productos=Input::get('productos');\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo = Input::get('proveedor_tipo');\n\n\t\tif(!File::exists('images/proveedores/'.$nombreDeUsuario)) {\n\t\t $result = File::makeDirectory('images/proveedores/'.$nombreDeUsuario, 0777);\n\t\t}\n\n\t\t$imagen_intro = Input::file('imagen_intro');\n\t\t$file = $imagen_intro;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t\t$id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_intro=$filename.'.'.$extension;\n\t\t} else {\n\t\t $proveedores_detalle->imagen_intro = '';\n\t\t}\n\t\t\n\n\t\t$imagen_descripcion = Input::file('imagen_descripcion');\n\t\t$file = $imagen_descripcion;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_descripcion=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_descripcion='';\n\t\t}\t\n\t\t\n\n\n\t\t$imagen_vision = Input::file('imagen_vision');\n\t\t$file = $imagen_vision;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_vision=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_vision='';\n\t\t}\t\t\t\t\n\t\t\n\t\t$proveedores_detalle->save();\n\n\t\treturn Redirect::to(\"vistausuario/\")->with(array('usuarioimg'=>$authuser->imagen, 'usuarionombre'=>$authuser->nombre, 'usuarioid'=>$authuser->id));\t\t\n\t\t}\n\t}", "function Proveeedor($cedulaProveedor, $nombre, $telefono, $productos) {\n $this->cedulaProveedor = $cedulaProveedor;\n $this->nombre = $nombre;\n $this->telefono = $telefono;\n $this->productos = $productos;\n }", "public function __construct(){\r\n $this->proveedores=array();\r\n }", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function select($proveedor);", "function guardar_producto_proceso($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t//$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tprd_productos_procesos\n\t\t\t\t\t\t(id_producto, id_proceso)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_producto'].\",\".$datos['id_proceso'].\")\";\n\t \t//return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function ActualizarProveedores()\n\t\t{\n\t\t\tself::SetNames();\n\t\t\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t\t\t{\n\t\t\t\techo \"1\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$sql = \" select * from proveedores where codproveedor != ? and ritproveedor = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array($_POST[\"codproveedor\"], $_POST[\"ritproveedor\"]) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" update proveedores set \"\n\t\t\t\t.\" ritproveedor = ?, \"\n\t\t\t\t.\" nomproveedor = ?, \"\n\t\t\t\t.\" direcproveedor = ?, \"\n\t\t\t\t.\" tlfproveedor = ?, \"\n\t\t\t\t.\" emailproveedor = ?, \"\n\t\t\t\t.\" contactoproveedor = ? \"\n\t\t\t\t.\" where \"\n\t\t\t\t.\" codproveedor = ?;\n\t\t\t\t\";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t\t\t$stmt->bindParam(6, $contactoproveedor);\n\t\t\t\t$stmt->bindParam(7, $codproveedor);\n\n\t\t\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE ACTUALIZADO EXITOSAMENTE\";\n\t\t\t\techo \"</div>\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"3\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "public function store(Request $request)\n {\n \n $proveedores = new Proveedores($request->all());\n \n\n\n if($proveedores->save()){\n session()->flash('crearproveedores', \"Un Proveedor fue creado\");\n return redirect(\"proveedores\");\n }else{\n return view('proveedores.create',[\"proveedores\"=>$proveedores]);\n }\n }", "public function RegistrarProveedores()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select ritproveedor from proveedores where ritproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"ritproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into proveedores values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t$stmt->bindParam(6, $contactoproveedor);\n\n\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE REGISTRADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"3\";\n\t\texit;\n\t}\n}", "public function store(Request $request)\n {\n $validate = DB::table('tipo_proveedores')->where('tipo_proveedor_desc', $request->tipo_proveedor_desc)->exists();\n\n if($validate == true)\n {\n flash('El Tipo de Servicio '.$request->tipo_proveedor_desc.' ya existe en la base de datos')->warning();\n return redirect('/proveedor');\n }else\n\n try {\n\n $proveedor = new Tipo_Proveedor();\n $proveedor->tipo_proveedor_desc = $request->tipo_proveedor_desc;\n $proveedor->save();\n\n\n flash('El Proveedor se creo correctamente.')->success();\n return redirect('proveedor');\n\n }catch (\\Exception $e) {\n\n\n\n flash('Error al crear el Proveedor.')->error();\n flash($e->getMessage())->error();\n return redirect('proveedor');\n }\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function get_proveedor($idProveedor,$idEmpresa){\n if($idProveedor != '' || $idEmpresa != ''){\n\n $this->_query =\n \"\n select \n idproveedor,\n idempresa,\n nombre_proveedor,\n descripcion_proveedor,\n telefono01,\n telefono02,\n correo,\n celular,\n direccion,\n idestado,\n fecha_alta,\n fecha_um,\n idusuario_alta,\n idusuario_um\n from \n proveedores \n WHERE \n idproveedor = $idProveedor AND\n idempresa = '$idEmpresa' \n ORDER BY nombre_proveedor DESC \n \";\n\n $this->get_result_query();\n\n }\n\n if(count($this->_rows) == 1){\n\n foreach ($this->_rows[0] as $campo => $valor){\n $this->$campo = $valor ;\n }\n\n $this->_confirm = true ;\n $this->_message = \"Se encontro el proveedor\";\n\n }else{\n $this->_confirm = false ;\n $this->_message = \"No se encontro el proveedor\" ;\n }\n\n }", "public function delete($proveedor);", "public function store(ProveedorRequest $request){\n Proveedor::create($request->all());\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n }", "public function datos_proveedores() \n {\n return Proveedor::all();\n }", "function guardar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t$tipo = ($datos['tipo']==1) ? 1 : 4 ;\n\n\n\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_productos\n\t\t\t\t\t\t(codigo, nombre, precio, linea, costo_servicio, id_unidad_venta, id_unidad_compra,\n\t\t\t\t\t\t\ttipo_producto\n\t\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['codigo'].\"','\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t1, \".$datos['costo'].\", \".$datos['unidad_venta'].\", \".$datos['unidad_compra'].\", \".$tipo.\"\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda los campos de foodware\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_campos_foodware\n\t\t\t\t\t\t(id_producto, ganancia)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$result.\"', '\".$datos['margen_ganancia'].\"')\";\n\t\t// return $sql;\n\t\t$result_foodware =$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function store(StoreProveedorRequest $request)\n {//['nombre','estado','celular','direccion']\n $prove = new Proveedor();\n $prove->nombre = $request->input('Nombre');\n $prove->estado = 'activo';\n $prove->celular = $request->input('Telefono');\n $prove->direccion = $request->input('Direccion');\n $prove->save();\n $proveedores = Proveedor::paginate(10);\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Guardado exitoso...!')->with('pagina','proveedor');\n }", "static public function mdlIngresarProveedor($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, rfc, direccion, codpostal, ciudad, email, telefono, contacto, tel_contacto, email_contacto, ultusuario, estatus) VALUES (:nombre, :rfc, :direccion, :codpostal, :ciudad, :email, :telefono, :contacto, :tel_contacto, :email_contacto, :ultusuario, :estatus)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codpostal\", $datos[\"codpostal\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ciudad\", $datos[\"ciudad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":contacto\", $datos[\"contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tel_contacto\", $datos[\"tel_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email_contacto\", $datos[\"email_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ultusuario\", $datos[\"ultusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":estatus\", $datos[\"estatus\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function agregar_proveedor(Request $request)\n {\n if(!session('Usuario')) {\n return 'session';\n }\n if(\n empty( $request->input('proveedor_nombre') ) ||\n empty( $request->input('proveedor_rfc') ) ||\n empty( $request->input('proveedor_correo') ) ||\n empty( $request->input('proveedor_telefono') )\n ) {\n return 'empty';\n }\n\n $proveedor = new Proveedor();\n\n $proveedor->RFC = $request->input('proveedor_rfc');\n $proveedor->Nombre = $request->input('proveedor_nombre');\n $proveedor->Telefono = $request->input('proveedor_telefono');\n $proveedor->Email = $request->input('proveedor_correo');\n $proveedor->Adeudo = 0;\n $proveedor->estatus = 1;\n $proveedor->idUsuario = session('idUsuario');\n\n if(!$proveedor->save()) {\n return 'error';\n }\n return 'true';\n }", "public function store(SaveProveedorRequest $request)\n { \n Proveedor::create($request->validated());\n\n return redirect()->route('proveedores.index')->with('status', 'El proveedor ha sido guardado');\n \n\n }", "public function store(Request $request, $proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $datos = new DatosGeneralesProveedor($request->all());\n $proveedor->generales()->save($datos);\n return redirect()->route('proveedores.datosGenerales.index', ['proveedor' => $proveedor]);\n }", "public function store(Request $request){\n $validator= Validator::make($request->all(),[\n 'cedula'=>\"required|alpha_num|min:8|max:10\",\n 'nombre'=>\"required|alpha_dash\",\n 'apellido'=>\"required|alpha_dash\",\n 'telefono'=>\"required|alpha_num|min:6|max:10\",\n 'empresa'=>\"required|alpha_dash\",\n 'nit'=>\"required|alpha_num\"\n ]);\n //si existen errores en la validacion me devuelvo a la misma pagina pero con los errores encontrados\n if($validator->fails()){\n return redirect()->back()->withErrors($validator->errors());\n }else{\n //instancio un nuevo empleado\n $proveedor = new Proveedor();\n $proveedor->cedula = $request->input(\"cedula\");\n $proveedor->nombre = $request->input(\"nombre\");\n $proveedor->apellido = $request->input(\"apellido\");\n $proveedor->telefono = $request->input(\"telefono\");\n $proveedor->empresa = $request->input(\"empresa\");\n $proveedor->estado=\"1\";\n $proveedor->nit = $request->input(\"nit\");\n $proveedor->save();\n //redirecciono a la lista de empleados para verificar que el empelado si quedo guardado correctamente\n return redirect('proveedor/list')->with('exito',\"proveedor guardado con exito\");\n }\n }", "private function cambiarProveedor() {\n\n $ok = false;\n\n $em = new EntityManager($this->form->getConection());\n if ($em->getDbLink()) {\n\n // Cambiar factura\n $filtro = \"NumeroFactura='{$this->request['numeroFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update frecibidas_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $okFactura = $em->getAffectedRows();\n\n if ($okFactura) {\n \n $this->values['mensaje'][] = \"Se ha cambiado \" . $okFactura . \" factura.\";\n // Cambiar pedido/s\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update pedidos_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nPedidos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nPedidos . \" pedidos.\";\n \n // Cambiar recibos\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update recibos_proveedores set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nRecibos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nRecibos . \" recibos.\";\n \n }\n }\n\n $em->desConecta();\n unset($em);\n }", "public function store(Request $request)\n {\n $prov = new Proveedor();\n $prov->razon_social = $request->razon_social;\n $prov->nombre_contacto = $request->nombre_contacto;\n $prov->puesto_contacto = $request->puesto_contacto;\n $prov->rfc = $request->rfc;\n $prov->fecha_alta = $request->fecha_alta;\n $prov->fecha_nacimiento = $request->fecha_nacimiento;\n $prov->telefono = $request->telefono;\n $prov->celular = $request->celular;\n $prov->celular_alterno = $request->celular_alterno;\n $prov->email = $request->email;\n $prov->email_alternativo = $request->email_alternativo;\n session_start();\n \n $prov->id_domicilio = $_SESSION['domicilioId']; //ÚLTIMO ID DE TABLA DOMICILIO\n $prov->save();\n\n return redirect()->route('proveedores.index');\n }", "public function edit(ProveedoresModel $proveedor)\n {\n //\n }", "public function destroy(Proveedor $proveedor)\n {\n //\n }", "public function create(Request $request)\n {\n $proveedor = new Proveedor();\n $proveedor->Nom_Empresa = $request->input('nombre');\n $proveedor->RUC = $request->input('ruc');\n $proveedor->Direccion = $request->input('direccion');\n $proveedor->Telefono = $request->input('telef');\n $proveedor->Url = $request->input('url');\n $proveedor->Estado = 1;\n Log::info('jaaaaa'+$proveedor+'proveedor');\n $this->ProveedorRep->Guardar($proveedor);\n return redirect('/pagProveedor');\n }", "public function createNumeroDocumentoProveedor(Request $request){\n\n if($request->user()->can('add_proveedor')) {\n\n $documentoProveedor = DocumentoProveedor::create([\n 'numero' => $request->numero,\n 'tipodocumento_id' => $request->tipodocumento_id,\n 'user_id' => $request->user()->id, //no request\n 'proveedor_id' => $request->provedor_id //no request\n ]);\n if (!$request) {\n ResponseController::set_errors(true);\n ResponseController::set_messages('No has enviado inforamcion para agregar numero de documento');\n return ResponseController::response('BAD REQUEST');\n }\n\n ResponseController::set_messages('Proveedor creado');\n ResponseController::set_data(['proveedor'=>$documentoProveedor->id]);\n return ResponseController::response('OK');\n }\n ResponseController::set_errors(true);\n ResponseController::set_messages('Usuario sin permiso');\n return ResponseController::response('UNAUTHORIZED');\n\n }", "function grabar($datos)\n\t{\n\t\tif (($datos[IDPROVEEDOR]=='') && ($this->exist(\"$this->catalogo.catalogo_proveedor\",'IDPROVEEDOR',\" WHERE NOMBREFISCAL = '$datos[NOMBREFISCAL]'\" )))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reg_proveedor[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t$reg_proveedor[NOMBREFISCAL] = trim(strtoupper($datos[NOMBREFISCAL]));\n\t\t\t$reg_proveedor[NOMBRECOMERCIAL] = trim(strtoupper($datos[NOMBRECOMERCIAL]));\n\t\t\t$reg_proveedor[IDTIPODOCUMENTO] = $datos[IDTIPODOCUMENTO];\n\t\t\t$reg_proveedor[IDDOCUMENTO] = trim($datos[IDDOCUMENTO]);\n\t\t\t$reg_proveedor[EMAIL1] = trim(strtolower($datos[EMAIL1]));\n\t\t\t$reg_proveedor[EMAIL2] = trim(strtolower($datos[EMAIL2]));\n\t\t\t$reg_proveedor[EMAIL3] = trim(strtolower($datos[EMAIL3]));\n\t\t\t$reg_proveedor[ACTIVO] = $datos[ACTIVO];\n\t\t\t$reg_proveedor[INTERNO] = $datos[INTERNO];\n\n\t\t\tif ($datos[ARREVALRANKING]=='SKILL'){\n\t\t\t\t$reg_proveedor[ARREVALRANKING]=$datos[ARREVALRANKING];\n\t\t\t\t$reg_proveedor[SKILL]= $datos[SKILL];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$reg_proveedor[ARREVALRANKING]='CDE';\n\t\t\t}\n\t\t\t$reg_proveedor[EVALFIDELIDAD]=$datos[EVALFIDELIDAD];\n\t\t\t$reg_proveedor[EVALINFRAESTRUCTURA]=$datos[EVALINFRAESTRUCTURA];\n\t\t\t$reg_proveedor[IDMONEDA]=$datos[IDMONEDA];\n\t\t\t$reg_proveedor[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t\t$reg_proveedor[BRSCH] = $datos[BRSCH];\n\t\t\t$reg_proveedor[FDGRV] = $datos[FDGRV];\n\t\t\t$reg_proveedor[ZTERM] = $datos[ZTERM];\n\t\t\t$reg_proveedor[MWSKZ] = $datos[MWSKZ];\n\t\t\t$reg_proveedor[PARVO] = $datos[PARVO];\n\t\t\t$reg_proveedor[PAVIP] = $datos[PAVIP];\n\t\t\t$reg_proveedor[FECHAINICIOACTIVIDADES]= trim($datos[ANIO].'-'.$datos[MES].'-'.$datos[DIA]);\n\n\t\t\t$prov_ubigeo[CVEPAIS]= $datos[CVEPAIS];\n\t\t\t$prov_ubigeo[CVEENTIDAD1]= $datos[CVEENTIDAD1];\n\t\t\t$prov_ubigeo[CVEENTIDAD2]= $datos[CVEENTIDAD2];\n\t\t\t$prov_ubigeo[CVEENTIDAD3]= $datos[CVEENTIDAD3];\n\t\t\t$prov_ubigeo[CVEENTIDAD4]= $datos[CVEENTIDAD4];\n\t\t\t$prov_ubigeo[CVEENTIDAD5]= $datos[CVEENTIDAD5];\n\t\t\t$prov_ubigeo[CVEENTIDAD6]= $datos[CVEENTIDAD6];\n\t\t\t$prov_ubigeo[CVEENTIDAD7]= $datos[CVEENTIDAD7];\n\t\t\t$prov_ubigeo[CVETIPOVIA]= $datos[CVETIPOVIA];\n\t\t\t$prov_ubigeo[DIRECCION]= $datos[DIRECCION];\n\t\t\t$prov_ubigeo[NUMERO]= $datos[NUMERO];\n\t\t\t$prov_ubigeo[CODPOSTAL] = $datos[CODPOSTAL];\n\t\t\t$prov_ubigeo[LATITUD] = $datos[LATITUD];\n\t\t\t$prov_ubigeo[LONGITUD] = $datos[LONGITUD];\n\t\t\t$prov_ubigeo[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t\t$prov_ubigeo[REFERENCIA1]= $datos[REFERENCIA1];\n\t\t\t$prov_ubigeo[REFERENCIA2]= $datos[REFERENCIA2];\n\n\t\t\t$datos_telf[CODIGOAREA] = $datos[CODIGOAREA];\n\t\t\t$datos_telf[IDTIPOTELEFONO] = $datos[IDTIPOTELEFONO];\n\t\t\t$datos_telf[NUMEROTELEFONO] = $datos[NUMEROTELEFONO];\n\t\t\t$datos_telf[EXTENSION] = $datos[EXTENSION];\n\t\t\t$datos_telf[IDTSP] = $datos[IDTSP];\n\t\t\t$datos_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t\t$datos_telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t$this->borrar_telefono($datos[IDPROVEEDOR]); // BORRA LOS PROVEEDORES\n\n\t\t\tif ( $datos[IDPROVEEDOR]=='')\n\t\t\t{\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor);\n\t\t\t\t$datos[IDPROVEEDOR] = $this->reg_id(); //OBTIENE EL ID DEL NUEVO PROVEEDOR\n\t\t\t\t$prov_ubigeo[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$prov_horario[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo);\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_horario\",$prov_horario);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t}\n\n\t\t\tif ($datos[IDPROVEEDOR]!='')\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($datos_telf[NUMEROTELEFONO]);$i++)\n\t\t\t\t{\n\t\t\t\t\t$telf[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t\t$telf[CODIGOAREA]=$datos_telf[CODIGOAREA][$i];\n\t\t\t\t\t$telf[IDTIPOTELEFONO]=$datos_telf[IDTIPOTELEFONO][$i];\n\t\t\t\t\t$telf[NUMEROTELEFONO]=$datos_telf[NUMEROTELEFONO][$i];\n\t\t\t\t\t$telf[EXTENSION]=$datos_telf[EXTENSION][$i];\n\t\t\t\t\t$telf[IDTSP]=$datos_telf[IDTSP][$i];\n\t\t\t\t\t$telf[COMENTARIO]=$datos_telf[COMENTARIO][$i];\n\t\t\t\t\t$telf[IDUSUARIOMOD] = $datos_telf[IDUSUARIOMOD];\n\t\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_telefono\",$telf);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$datos_sociedad = $datos[IDSOCIEDAD];\n\n\n\t\t\t// GRABA LOS SERVICIOS DEL PROVEEDOR //\n\t\t\t$sql=\"delete from catalogo_proveedor_servicio where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\n\t\t\t$nueva_prioridad=1;\n\n\t\t\tforeach ($datos[CHECKSERVICIO] as $servi)\n\t\t\t{\n\t\t\t\t$servicio[IDSERVICIO] = $servi;\n\t\t\t\t$servicio[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$servicio[PRIORIDAD] = $nueva_prioridad;\n\t\t\t\t$servicio[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t\tif ($servi!='')\n\t\t\t\t{\n\t\t\t\t\t$this->insert_reg('catalogo_proveedor_servicio',$servicio);\n\t\t\t\t\t$nueva_prioridad++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GRABA LAS SOCIEDADES DEL PROVEEDOR\n\t\t\t$sql=\"delete from catalogo_proveedor_sociedad where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\t\t\tforeach ($datos[IDSOCIEDAD] as $soc)\n\t\t\t{\n\t\t\t\t$sociedad[IDSOCIEDAD] = $soc;\n\t\t\t\t$sociedad[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$sociedad[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$this->insert_reg('catalogo_proveedor_sociedad',$sociedad);\n\t\t\t}\n\t\t\treturn $datos[IDPROVEEDOR];\n\t\t}\n\t\treturn $datos[IDPROVEEDOR];\n\t}", "public function entrar()\r\n\t{\r\n\t\tView::template('default');\r\n\t\t//Login del proveedor\r\n\t\tif(Input::hasPost(\"correo\", \"clave\")){\r\n\t $auth = New Proveedor;\r\n\t if($auth->login()){\r\n\t Redirect::to(\"proveedor/\");\r\n\t }\r\n\t }\r\n\t}", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function store(CreateProveedorAPIRequest $request)\r\n {\r\n $input = $request->all();\r\n\r\n $proveedors = $this->proveedorRepository->create($input);\r\n\r\n return $this->sendResponse($proveedors->toArray(), 'Proveedor guardado exitosamente');\r\n }", "public function proveedor()\n {\n return $this->hasOne('App\\Proveedor', 'id');\n }", "public function test_registrar_un_proveedor_a_database()\n {\n\n $supplieUseCase = new SupplieUseCase(new SupplieRepository());\n\n\n $supplieEntity = new SupplieEntity(\n 'Jasinto',\n 'Lago Winnipef 401, Ciudad de México'\n );\n\n $success = $supplieUseCase->registerSupplie($supplieEntity);\n\n $this->assertEquals($success, true);\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function store(Request $request)\n {\n if (!ProveedoresModel::find($request->codigo)) {\n $proveedor = new ProveedoresModel;\n $proveedor->codigo = $request->codigo;\n $proveedor->nombre = $request->nombre;\n\n if ($proveedor->save()) {\n return redirect(route('proveedor.show', [$request->codigo])\n )->with('message', 'Proveedor creado exitosamente');;\n } else {\n dd(\"No se pudo guardar el proveedor\");\n }\n\n } else {\n return back()->withInput($request->all())->with('message', 'Ya existe este proveedor');\n }\n }", "public function createProveedores(Request $request){\n $accion = 'M01';\n $IdProvee = null; \n $CodEmp = $request->get('CodEmp'); \n $TipoDoc = $request->get('TipoDoc'); \n $NomTipDoc = $request->get('NomTipDoc'); \n $NumDoc = $request->get('NumDoc'); \n $Nombre = $request->get('Nombre'); \n $NombComercial = $request->get('NombComercial'); \n $idPais = $request->get('IdPais'); \n $idDepa = $request->get('IdDepartamento');\n $idProv = $request->get('IdProvincia');\n $idDist = $request->get('IdDistrito'); \n $DirPer = $request->get('Direccion'); \n $Telefono = $request->get('Telefono'); \n $Email = $request->get('Email'); \n $Activo = null; \n\n $proveedores = DB::select('call Man_zg_proveedores(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'\n ,array(\n $accion,\n $IdProvee,\n $CodEmp, \n $TipoDoc, \n $NomTipDoc, \n $NumDoc, \n $Nombre, \n $NombComercial, \n $idPais, \n $idDepa,\n $idProv,\n $idDist, \n $DirPer, \n $Telefono, \n $Email, \n $Activo\n \n ));\n return response()->json($request, 201);\n // return response()->json(['proveedor creado'=>$request], 201);\n }", "public function proveedor(){\n return $this->belongsTo(Proveedor::class,'idproveedor','id');\n }", "public function store(Request $request)\n {\n //\n $proveedor=Proveedores::create($request->all());\n return redirect('/proveedores');\n }", "public function datos_proveedor_especifico($id) \n {\n return Proveedor::find($id);\n }", "public function store(SaveProductRequest $request)\n { \n $product = Product::create($request->validated());\n\n if($request['usa_empaque']):\n $request->validate([\n 'fraccion' => 'required',\n 'medida_paq' => 'required',\n 'min_paq' => 'required'\n ]);\n \n $product->usa_empaque = $request['usa_empaque'];\n $product->medida_paq = $request['medida_paq'];\n $product->fraccion = $request['fraccion'];\n $product->min_paq = $request['min_paq'];\n $product->save();\n endif;\n if($request['usa_impuesto']):\n $request->validate([\n 'impuesto' => 'required'\n ]);\n \n $product->impuesto = $request['impuesto'];\n $product->save(); \n endif;\n\n //insertar los proveedores de productos\n $contador = count($request['proveedor']);\n for($i=0;$i<$contador;$i++){\n product_provider::create([\n 'product_id' => $product->id,\n 'provider_id' => $request['proveedor'][$i]\n ]);\n }\n\n return true;\n // Product::create($request->validated());\n // return true;\n }", "public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function update(StoreProveedorRequest $request, Proveedor $proveedor)\n {//['nombre','estado','celular','direccion']\n $proveedor->nombre = $request->input('Nombre');\n $proveedor->celular = $request->input('Telefono');\n $proveedor->direccion = $request->input('Direccion');\n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Actualización hecha, Satisfactoriamente...!')->with('pagina','proveedor');//llamar a la vista del provee\n }", "function insert(Profesor $profesor){\n //Se pasa un objeto usuario y se inserta, se devuelve el email del elemento con el que se ha insertado\n $parametrosSet=array();\n $parametrosSet['tel']=$profesor->getTelefono();\n $parametrosSet['nombre']=$profesor->getNombre();\n $parametrosSet['apellido']=$profesor->getApellido();\n $parametrosSet['clave']=$profesor->getClave();\n $parametrosSet['activo']=$profesor->getActivo();\n $parametrosSet['administrador']=$profesor->getAdministrador();\n $parametrosSet['email']=$profesor->getEmail();\n return $this->bd->insert($this->tabla, $parametrosSet);\n }", "public function store(Request $request)\n {\n $proveedor = new proveedor;\n $proveedor->nombreproveedor = $request->nombreproveedor;\n $proveedor->nombrecontacto = $request->nombrecontacto;\n $proveedor->direccion = $request->direccion;\n $proveedor->pais = $request->pais;\n $proveedor->ciudad = $request->ciudad;\n $proveedor->email = $request->email;\n $proveedor->telefono = $request->telefono;\n $proveedor->cargo = $request->cargo;\n $proveedor->save();\n return redirect()->route('proveedors.index');\n }", "public function update(Request $request, ProveedoresModel $proveedor)\n {\n //\n }", "public function provider()\n {\n return $this->belongsTo('App\\Provider', 'proveedor_id');\n }", "public function run()\n {\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de acopio';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de distribucion';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'clap';\n //privilegios\n $proveedor->save();\n }", "public function getProveedorEstado()\n {\n return $this->hasOne(ProveedorEstado::className(), ['id' => 'proveedor_estado']);\n }", "public function store(Request $request)\n {\n $proveedor = new Proveedor();\n\n $proveedor->cif = $request->cif;\n $proveedor->razon_social = $request->razon_social;\n\n $proveedor->save();\n\n return redirect()->route('proveedores.show', $proveedor->id);\n }", "public function store(Request $request)\n {\n $ArtProv = new ArticuloPorProveedor();\n $ArtProv->ArtiUnidad = $request->input(\"ArtiUnidad\");\n $ArtProv->ArtiCant = $request->input(\"ArtiCant\");\n $ArtProv->ArtiPrecio = $request->input(\"ArtiPrecio\");\n $ArtProv->ArtiCostoUnid = $request->input(\"ArtiCostoUnid\");\n $ArtProv->ArtiMinimo = $request->input(\"ArtiMinimo\");\n\n $ArtProv->FK_ArtCotiz = $request->input(\"FK_ArtCotiz\");\n $ArtProv->FK_ArtiActiv = $request->input(\"FK_ArtiActiv\");\n // $ArtProv->FK_AutorizedBy = $request->input(\"FK_AutorizedBy\");\n $ArtProv->FK_AutorizedBy = 1;\n $ArtProv->save();\n\n return redirect()->route('articulos-proveedor.index');\n }", "public function show(Proveedores $proveedores)\n {\n //\n }", "public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }", "public static function guardar($datos){\n $producto = new Producto($datos['producto']);\n $producto->categoria = $producto->srtCategoria($datos['categorias']);\n $producto->save();\n $producto->categorias()->attach($datos['categorias']);\n $idsDimensiones = $producto->arrDimensiones($datos);\n $articulos = $producto->arrArticulos($datos['colores'], $idsDimensiones, $producto->id);\n DB::table('articulos')->insert($articulos);\n }", "function addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 0){\n $PVE_ID = $this->gateway->maxId();\n $result = $this->gateway->addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n { return $this->updateMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n \t//return ERROR_DATO_EXISTE;\n }\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function guardar_entrega_de_producto($entrega_id, $productos_entregados){\n\n // NOTA: Lo demás son datos de actualizacion sobreescribibles.\n\n $productos_entregados = $productos_entregados;\n $query_productos = ProductoEntrega::where(\"entrega_id\" , $entrega_id);\n $productos_registrados = $query_productos->get();\n\n if(count($productos_registrados) > 0){\n $query_productos->delete();\n }\n\n foreach($productos_entregados as $producto){\n $producto = (object) $producto;\n $producto_id = $producto->id;\n $cantidad = $producto->cantidad;\n $precio = $producto->precio;\n $nombre = $producto->nombre;\n ProductoEntrega::create([\n \"cantidad\" => $cantidad,\n \"entrega_id\" => $entrega_id,\n \"producto_id\" => $producto_id,\n \"precio\" => $precio,\n \"nombre\" => $nombre,\n \"fecha_de_entrega\" => date(\"Y/m/d\")\n ]);\n }\n\n return;\n\n }", "public function getProveedorTipo()\n {\n return $this->hasOne(ProveedorTipo::className(), ['id' => 'proveedor_tipo']);\n }", "function guardar_insumo($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_producto_material\n\t\t\t\t\t\t(id_producto, cantidad, id_unidad, id_material, opcionales)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['id_receta'].\"',\".$datos['cantidad'].\",\".$datos['id_unidad'].\",\n\t\t\t\t\t\t'\".$datos['id'].\"','\".$datos['opcionales'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function ajoutProduit()\n {\n $produit = new Produit();\n\n $produit->uuid = Str::uuid();\n $produit->designation = 'Tomate';\n $produit->description = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque deleniti quisquam beatae deserunt dicta ipsam tenetur at necessitatibus in, eligendi voluptatibus doloribus earum sed error maiores nam possimus sunt assumenda?';\n $produit->prix = '1000';\n $produit->like = '21';\n $produit->pays_source = 'Burkina Faso';\n $produit->poids = '45.10';\n\n $produit->save();\n }", "public function store(Request $request)\n\t{\n\t\t\n\t\t$this->validate($request,[\n\n\t\t\t'proveedore_id' => 'required',\n\t\t\t'sede_id' => 'required'\n\n\t\t\t]);\n\n\t\ttry {\n\n\t\t\t$proveedor = Proveedore::findOrFail($request['proveedore_id']);\n\n\t\t\t$sede = Sede::findOrFail($request['sede_id']);\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\treturn Response::view('errors/404', array(), 404);\n\n\t\t}\n\n\t\ttry {\n\t\t\t\n\t\t\t$sede->proveedores()->attach($request['proveedore_id']);\n\n\t\t} catch (\\PDOException $exception) {\n\t\t\t\n\t\t\treturn Redirect::back() -> withErrors(['mesagge' => 'Ha ocurrido un error en la consulta '.$exception->getCode()]);\n\n\t\t}\n\n\t\t\\Event::fire(new Audit($sede, 'se ha vinculado con '.$proveedor->nombre));\n\t\treturn Redirect::back() ->with('mensagge', 'proveedor asociado a la sede');\n\n\t}", "public function usuarioProveedor()\n {\n \treturn $this->belongsTo('App\\Usuario', 'usuario_id', 'id');\n }", "public function store(Request $request)\n {\n $guardado = $this->proveedorModel->guardar($request->all());\n \n if ($guardado->id) {\n $this->response['code'] = 200;\n $this->response['status'] = 'ok';\n $this->response['modelData'] = [\n 'id' => $guardado->id,\n 'nombre' => $guardado->nombre\n ];\n $this->response['route']= [\n 'edit' => route('admin.catalogo.proveedor.update', ['proveedor' => $guardado->id]),\n 'destroy' => route('admin.catalogo.proveedor.destroy', ['proveedor' => $guardado->id])\n ];\n }\n return response()->json($this->response);\n }", "function existeProveedor($codigo)\n {\n \tif($this->gateway->existMco_proveedores($codigo) == 1){ \n return ERROR_DATO_EXISTE;\n }\n else\n {\n return EXITO_OPERACION_REALIZADA;\n }\n }", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "public function add(){\n if (isset($_SESSION['identity'])) {// Comprobamos que hay un usuario logueado\n $usuario_id = $_SESSION['identity']->id;// Obtenemos el ID del Usuario logueado\n $sProvincia = isset($_POST['province']) ? $_POST['province'] : false;\n $sLocalidad = isset($_POST['location']) ? $_POST['location'] : false;\n $sDireccion = isset($_POST['address']) ? $_POST['address'] : false;\n\n $stats = Utils::statsCarrito();\n $coste = $stats['total'];// Obtenemos el coste total del pedido\n\n\n if ($sProvincia && $sLocalidad && $sDireccion){\n // Guardar datos en bd\n $oPedido = new Pedido();\n $oPedido->setUsuarioId($usuario_id);\n $oPedido->setProvincia($sProvincia);\n $oPedido->setLocalidad($sLocalidad);\n $oPedido->setDireccion($sDireccion);\n $oPedido->setCoste($coste);\n\n $save = $oPedido->savePedido();// Insertamos el Pedido en BD\n\n // Guardar Linea Pedido\n $save_linea = $oPedido->save_linea();\n\n if ($save && $save_linea){// Comprobamos que La inserccion a sido correcta\n $_SESSION['pedido'] = \"complete\";\n }else{\n $_SESSION['pedido'] = \"failed\";\n }\n }else{\n $_SESSION['pedido'] = \"failed\";\n\n }\n header(\"Location:\" . base_url .'pedido/confirmado');\n }else{\n // Redirigir al Index\n header(\"Location:\" . base_url);\n }\n }", "public function __construct() {\n $this->adminProveedorModelo = new adminProveedorModelo();\n }", "function guardar_insumos_producto($objeto, $producto_sel) {\n\n\t\t// com_recetas\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\tprd_lab_conceptos_productos (id_producto, id_lab_concepto, lim_inf, lim_sup, referencia)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t(\" . $producto_sel . \", \" . $objeto['id'] . \", \" . $lim_inf . \", \" .\n\t\t\t\t\t\t\t$lim_sup . \", '\" . $referencia . \"')\";\n\n\t\t$result = $this->queryArray($sql);\n\t\treturn $result;\n\t}", "public function ProveedorPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function store(Request $request)\n {\n $p = new Produto();\n\n $p->codigo = $request->codigo;\n $p->nome = strtoupper($request->nome);\n $p->valor = str_replace(',','.',$request->valor); //caso use vírgula será substituido por ponto.\n $p->descricao = strtoupper($request->descricao);\n $p->quantidade = $request->quantidade;\n $p->user_id = auth()->user()->id;\n \n if (DB::table('produtos')->select('codigo')->where('codigo', $p->codigo)->exists()) {\n //dd($request);\n return redirect()->back()->with('alertDanger','Erro! Já existe produto cadastrado com mesmo código!');\n }else{\n $p->save();\n return redirect()->back();\n }\n }", "public function savePoblacion(){\n \n $data_insert = [\n 'poblacion' =>$this->_poblacion,\n'provincia' =>$this->_provincia,\n'ccaa' =>$this->_ccaa,\n'cod_provincia' =>$this->_cod_provincia,\n'cod_ccaa' =>$this->_cod_ccaa,\n \n ];\n return parent::save($data_insert);\n \n }", "function registrarPedido(){\n\t\t$x = $this->pdo->prepare('INSERT INTO pedido (cedulaCliente,fechaPedido) VALUES (?,?)');\n\t\t$x->execute(array($this->cedulaCliente,$this->fechaPedido));\n\t\treturn $x;\n\t}", "function set(Profesor $profesor){\n $parametrosSet=array();\n $parametrosSet['tel']=$profesor->getTelefono();\n $parametrosSet['nombre']=$profesor->getNombre();\n $parametrosSet['apellido']=$profesor->getApellido();\n $parametrosSet['clave']=$profesor->getClave();\n $parametrosSet['activo']=$profesor->getActivo();\n $parametrosSet['administrador']=$profesor->getAdministrador();\n $parametrosSet['email']=$profesor->getEmail();\n $parametrosWhere = array();\n $parametrosWhere['tel'] = $profesor->getTelefono();\n return $this->bd->update($this->tabla, $parametrosSet, $parametrosWhere);\n \n }", "public function create($proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.create', ['proveedor' => $proveedor, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "public function setProducto($pro){ $this->producto = $pro;}", "public function create_provider(Request $request)\n {\n //informacion recibida\n $dat = $request->get('dat');\n //proveedor\n $exist_provider = Provider::where('nit','=',$dat['nit'])->get();\n $exist_phone = Provider_phone::where('number','=',$dat['phone'])->get();\n //coorreo en miniculas\n $mail =mb_strtolower($dat['mail']);\n $exist_mail = Provider::where('mail','=',$mail)->get();\n\n //Verifica que el proveedor ya este registrado\n if(isset($exist_provider) && $exist_provider->count() == 0){\n\n //Verifica si el telefono ingresado ya esta registrado\n if(isset($exist_phone) && $exist_phone->count() == 0){\n\n //Verifica si el correo ya esta registrado\n if(isset($exist_mail) && $exist_mail->count() == 0){\n //almacena al proveedor\n $provider = new Provider();\n $provider->nit = $dat['nit'];\n $provider->name = $dat['name'];\n $provider->mail = $mail;\n $provider->address = $dat['address'];\n $provider->city_id = $this->buscarUbicacion($dat['city'],$dat['departament'],$dat['country']);\n $provider->save();\n //almacena el telefono\n $phone = new Provider_phone();\n $phone->number = $dat['phone'];\n $phone->provider_id = $provider->id;\n $phone->save();\n $request->session()->flash('check_msg','El proveedor se registro con éxito');\n }\n else {\n $request->session()->flash('fail_msg', 'Este correo ya se encuentra asociado a un proveedor');\n }\n }\n else {\n $request->session()->flash('fail_msg', 'Este número de télefono ya se encuentra registrado');\n }\n }else {\n $request->session()->flash('fail_msg', 'Este proveedor ya se encuentra registrado');\n }\n\n return redirect()->route('view_provider');\n }", "public function save(){\n //para insertar datos que entrarar debemos unterpolar\n\n //los numero no van entrecomillas\n \n $sql=\"INSERT INTO pedidos VALUES (NULL,{$this->getUsuario_id()},'{$this->getProvincia()}','{$this->getLocalidad()}','{$this->getDireccion()}',{$this->getCoste()},'confirm',curdate(),curtime());\";\n //ahora insertamos una consulta \n $save = $this->db->query($sql);\n \n\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n }", "public function edit(Proveedor $proveedor)\n {\n if ($proveedor->estado == 'activo') {\n $proveedor->estado = 'inactivo';\n }else{\n \n $proveedor->estado = 'activo';\n \n } \n \n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('pagina','proveedor');//llamar a la vista del provee\n }", "function alta_entrada(){\n $e = new Entrada();\n\t\t$precio=$_POST['costo_unitario'];\n\t\t$producto_id=$_POST['cproductos_id'];\n $e->usuario_id = $GLOBALS['usuarioid'];\n $e->empresas_id = $GLOBALS['empresaid'];\n $related = $e->from_array($_POST);\n //if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n $f = new Pr_factura();\n $f->get_by_id($e->pr_facturas_id);\n $e->espacios_fisicos_id = $f->espacios_fisicos_id;\n $e->lote_id = $f->lote_id;\n $e->costo_total = ($e->cantidad * $e->costo_unitario);\n\t\t$e->existencia = $e->cantidad;\n $e->cproveedores_id = $f->cproveedores_id;\n $e->fecha = date(\"Y-m-d H:i:s\");\n if ($e->id == 0)\n unset($e->id);\n if ($e->save($related)) {\n echo $e->id;\n\t\t\t$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n } else\n echo 0;\n }", "function guardar_receta($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_recetas\n\t\t\t\t\t\t(id, nombre, precio, ganancia, ids_insumos, ids_insumos_preparados, preparacion)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_receta'].\", '\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t\".$datos['margen_ganancia'].\",\n\t\t\t\t\t\t'\".$datos['ids'].\"','\".$datos['ids_preparados'].\"','\".$datos['preparacion'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda la actividad\n\t\t$fecha=date('Y-m-d H:i:s');\n\n\t\t$texto = ($datos['tipo']==1) ? 'receta' : 'insumo preparado' ;\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['accelog_idempleado'])) ?$_SESSION['accelog_idempleado'] : 0 ;\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\".$usuario.\",'Agrega \".$texto.\"', '\".$fecha.\"')\";\n\t\t$actividad=$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function obtenerProveedores()\n { \n $query = $this->db->get('proveedor'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }", "public function readProveedores(){\n $sql='SELECT idProveedor, nombreProveedor, direccion, telefono,correo FROM proveedor where estado=1 AND proveedor.estadoEliminacion=1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "function guardarPromo($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$promo = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new PromoPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->promo = $promo;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\t\t\t\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n $this->model->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$bp = new PromoPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->promo = $promo;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function ProveedoresPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function store(Request $request, Provedor $provedore)\n {\n //\n // dd($request->all());\n $crm = ProvedorCRM::create($request->all());\n return redirect()->route('provedores.crm.index',['provedore'=>$provedore]);\n }", "public function edit(Proveedor $proveedor)\n {\n\n $distritos = Distrito::all();\n $cb = Distrito::Findorfail($proveedor->distrito_id);\n $cbid = ($cb->id);\n $cbd = ($cb->distrito);\n\n return view('proveedores.edit', [\n 'proveedor' => $proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n \n }", "public function ajoutProduitEncore()\n {\n Produit::create(\n [\n 'uuid' => Str::uuid(),\n 'designation' => 'Mangue',\n 'description' => 'Mangue bien grosse et sucrée! Yaa Proprè !',\n 'prix' => 1500,\n 'like' => 63,\n 'pays_source' => 'Togo',\n 'poids' => 89.5,\n ]\n );\n }", "public function obtener_proveedores()\n {\n return $this->db->get('proveedores')->result();\n }", "public function edit($proveedor)\n { \n $proveedor = Proveedor::find($proveedor);\n $datos = $proveedor->generales;\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.edit', ['proveedor' => $proveedor, 'datos' => $datos, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "static public function mdlGuardarIngreso($tabla, $datos){\t\n\n\t\t$dbh = Conexion::conectar();\n\n\t\t$stmt = $dbh->prepare(\"INSERT INTO $tabla(idproveedor, idusuario, tipo_comprobante, serie_comprobante, num_comprobante, fecha_hora, impuesto, total_compra, divisa) VALUES (:idproveedor, :idusuario, :tipo_comprobante, :serie_comprobante, :num_comprobante, :fecha_hora, :impuesto, :total_compra, :divisa)\");\n\n\t\t$stmt->bindParam(\":idproveedor\", $datos[\"proveedor\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":idusuario\", $datos[\"idusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":fecha_hora\", $datos[\"fecha\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo_comprobante\", $datos[\"tipo_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":divisa\", $datos[\"divisa_ingreso\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":serie_comprobante\", $datos[\"serie_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":num_comprobante\", $datos[\"numero_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto_ingreso\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":total_compra\", $datos[\"total_compra\"], PDO::PARAM_INT);\n\n\t\t\n\n\t\t$stmt->execute();\n\t\t$id = $dbh->lastInsertId();\n\t\treturn $id;\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\t}", "function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public function add_data()\n {\n try\n {\n if($this->id_producto!=NULL) //Identificar si llega un ID nulo o declarado\n {\n $sql=\"UPDATE productos set proveedores_id_proveedor=?,categoria_id_Categoria=?,nom_producto=?,pre_producto=?,can_producto=? WHERE id_producto = ?\";\n \n }else{\n $sql=\"INSERT into productos Values(0,?,?,?,?,?)\";\n }\n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->proveedores_id_proveedor);\n $consulta->bindParam(2,$this->categoria_id_Categoria);\n $consulta->bindParam(3,$this->nom_producto);\n $consulta->bindParam(4,$this->pre_producto);\n $consulta->bindParam(5,$this->can_producto); \n if($this->id_producto!=null)//Se asigna el valor del ID si esta declarado\n {\n $consulta->bindParam(6,$this->id_producto); \n }\n $consulta->execute();\n $this->con=null; \n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "public function insert($producto);", "public function store(Request $request)\n {\n $codigo = $request->input(\"codigo\");\n $prod = Inventario::where('codigo',$codigo)->get()->first();\n\n if($prod <> NULL){\n $user = $prod->id;\n Session::flash('notify','El producto ya existe!!');\n return Redirect::to('/producto');\n //return (\"El producto ya existe, tiene el id: \".$user);\n }else{\n Inventario::create([\n 'proveedor_id'=>$request['proveedor_id'],\n 'producto'=>$request['producto'],\n 'stock'=>$request['stock'],\n 'precio_prov'=>$request['precio_prov'],\n 'porcentaje'=>$request['porcentaje'],\n 'precio_pub'=>$request['precio_pub'],\n 'recuerdame'=>$request['recuerdame'],\n 'status'=>$request['status'],\n 'codigo'=>$request['codigo'],\n 'path'=>$request['path'],\n 'updated_at'=> \\Carbon\\Carbon::now(),\n ]);\n Session::flash('msg','');\n return Redirect::to('/producto');\n }\n\n\n }", "public function save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }", "private function datos_proveedor()\n {\n $this->template = FALSE;\n \n header('Content-Type: application/json');\n echo json_encode( $this->proveedor->get($_REQUEST['datosproveedor']) );\n }", "public function create()\n {\n $cbd='---Seleccione Distrito---';\n $cbid=\"\";\n $distritos = Distrito::all();\n return view('proveedores.create', [\n 'proveedor' => new Proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n }" ]
[ "0.658083", "0.65154624", "0.64936125", "0.64691424", "0.642821", "0.63903636", "0.6331015", "0.6322302", "0.63174355", "0.62954617", "0.6276084", "0.6269909", "0.6252022", "0.62214845", "0.6216492", "0.62156814", "0.6195148", "0.6162741", "0.6112412", "0.61071867", "0.6095144", "0.6064976", "0.60404295", "0.60377586", "0.60038483", "0.59978014", "0.5951023", "0.5950974", "0.594984", "0.59402937", "0.5917618", "0.5917618", "0.5910806", "0.5908432", "0.5867278", "0.5865509", "0.58262676", "0.5824542", "0.58125246", "0.5809717", "0.58038485", "0.57911855", "0.5784784", "0.5780362", "0.5746082", "0.57406414", "0.57027596", "0.5684773", "0.56579477", "0.56560487", "0.5648575", "0.56402767", "0.56333953", "0.5626279", "0.56160074", "0.5586133", "0.5585878", "0.55844754", "0.55813825", "0.5549254", "0.55434996", "0.554303", "0.5541969", "0.553985", "0.55358523", "0.5521747", "0.5516308", "0.55161923", "0.55079365", "0.5507425", "0.5506216", "0.5498213", "0.5497698", "0.54900765", "0.54780734", "0.54700685", "0.5458381", "0.5458024", "0.54550284", "0.5451469", "0.5445161", "0.54370403", "0.54309666", "0.54228336", "0.5417524", "0.5412113", "0.54105747", "0.5404847", "0.54029787", "0.53888565", "0.53821254", "0.53790134", "0.5372433", "0.5368833", "0.536653", "0.5353312", "0.53512573", "0.5346953", "0.53429514", "0.5341425" ]
0.7514581
0
Elimina un objeto Proveedor en la base de datos.
Удалите объект Поставщик из базы данных.
public function delete($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Proveedor $proveedor)\n {\n //\n }", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function EliminarProveedores()\n\t\t{\n\t\t\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t\t\t$sql = \" select codproveedor from compras where codproveedor = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t\t\t\t$num = $stmt->rowCount();\n\t\t\t\tif($num == 0)\n\t\t\t\t{\n\n\t\t\t\t\t$sql = \" delete from proveedores where codproveedor = ? \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(1,$codproveedor);\n\t\t\t\t\t$codproveedor = base64_decode($_GET[\"codproveedor\"]);\n\t\t\t\t\t$stmt->execute();\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=1\");\n\t\t\t\t\texit;\n\n\t\t\t\t}else {\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=2\");\n\t\t\t\t\texit;\n\t\t\t\t} \n\n\t\t\t} else {\n\n\t\t\t\theader(\"Location: proveedores?mesage=3\");\n\t\t\t\texit;\n\t\t\t}\t\n\t\t}", "public function eliminar($objeto){\r\n\t}", "function deleteMco_proveedores($PVE_ID)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 1){\n $result = $this->gateway->deleteMco_proveedores($PVE_ID);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n {\n return ERROR_DATO_NO_EXISTE;\n }\n }", "public function destroy(Proveedor $proveedor)\n {\n $proveedor -> delete();\n return redirect()->route('proveedores.index')->with('status', 'El proveedor fue eliminado');\n }", "public function destroy(Proveedor $proveedor)\n {\n if ($proveedor->eliminar()) {\n $this->response['code'] = 200;\n $this->response['status'] = 'ok';\n $this->response['modelData'] = [\n 'id' => $proveedor->id,\n 'nombre' => $proveedor->nombre\n ];\n }\n return response()->json($this->response);\n }", "public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }", "public function destroy($id)\n {\n // Comprobamos si el establecimiento existe o no.\n $establecimiento=\\App\\Establecimiento::find($id);\n\n if (count($establecimiento)==0)\n {\n // Devolvemos error codigo http 404\n return response()->json(['error'=>'No existe el Proveedor con id '.$id], 404);\n }\n\n $productos = $establecimiento->productos;\n\n if (sizeof($productos) > 0)\n {\n //Verificar si los productos del establecimineto estan en pedidos\n for ($i=0; $i < count($productos); $i++) { \n $productos[$i]->delete();\n\n $pedidos = $productos[$i]->pedidos;\n\n if (sizeof($pedidos) > 0)\n {\n // Devolvemos un código 409 Conflict. \n return response()->json(['error'=>'Este Proveedor no puede ser eliminado porque su productos están asociados a pedidos.'], 409);\n }\n }\n }\n\n if (sizeof($productos) > 0)\n {\n //Eliminar los productos asociados al establecimiento\n for ($i=0; $i < count($productos); $i++) { \n $productos[$i]->delete();\n }\n }\n\n $usuario=\\App\\User::find($establecimiento->usuario_id);\n\n // Eliminamos la establecimiento.\n $establecimiento->delete();\n\n // Eliminamos el usuario del establecimiento.\n $usuario->delete();\n\n return response()->json(['message'=>'Se ha eliminado correctamente el Proveedor.'], 200);\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "public function delete(Propriete $propriete)\n {\n $this->em->remove($propriete);\n $this->em->flush();\n }", "public function destroy(Proveedor $proveedor)\n {\n $proveedor->delete();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Eliminación hecha, Satisfactoriamente...!')->with('pagina','proveedor');//llamar a la vista del provee\n }", "function borrar_empresa_exp($idproveedorexp){\n\t\t$sql=\"delete from catalogo_proveedor_experiencia where IDPROVEEDOREXP='$idproveedorexp'\";\n\t\t$this->query($sql);\n\n\t\treturn;\n\t}", "function borrar_telefono($idproveedor)\n\t{\n\t\t$sql=\"\n\t\tDELETE FROM catalogo_proveedor_telefono WHERE IDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$this->query($sql);\n\t\treturn;\n\t}", "public function excluirprofessor() {\n\t\t//Recupera id do aluno\n\t\tif(!$this->uri->segment(\"3\"))\n\t\t\tredirect('/administracao/painel');\n\t\telse \n\t\t\t$intID =$this->uri->segment(\"3\");\n\n\t\t/* Carrega o modelo */\n\t\t$this->load->model('professores_model');\n\n\t\t/* Chama a função excluir do modelo */\n\t\tif ($this->professores_model->delete($intID)) {\n\t\t\tlog_message('success', 'Professor excluido com sucesso!');\n\t\t\tredirect('/administracao/listaprofessores');\n\t\t} else {\n\t\t\tlog_message('error', 'Erro ao excluir o aluno!');\n\t\t}\n\t}", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function eliminar(){\n\n $sql = \"DELETE FROM PRODUCTOS WHERE ID = :delet\";\n $delete = $this->db->prepare($sql);\n $delete->execute(array(\":delet\" => \"{$this->getId()}\"));\n\n $result = false;\n\n if($delete){\n $result = true;\n }\n $delete->closeCursor();\n\n return $result;\n }", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function eliminar_procesos_produccion($producto){\n\t\t$sql = \"DELETE FROM prd_productos_procesos WHERE id_producto = \" . $producto;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function eliminarPreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->idCliente);\n return Database::executeRow($sql, $params);\n }", "public function deleteproducto()\n\t{\n\n\t\t$idpedido = $_SESSION['idPedido'];\n\t\t$idproducto = $_POST['id'];\n\n\n\t\t$this->query(\"DELETE FROM producto_has_pedido WHERE Pedido_idPedido=$idpedido and Producto_idProductos=$idproducto\");\n\t\t$this->execute();\n\t}", "public function EliminarProducto(Request $request)\n {\n $id=Crypt::decrypt($request->id);\n $Product = Producto::find($id); \n $Product->delete();\n }", "public function excluirEquipe()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM Equipe WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->equipeId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }", "public function destroy(Request $request, $id){\n $proveedor = Proveedor::findOrFail($id);\n\n $request->validate([\n 'proveedor_id' => ['required', new SePuedeEliminarProveedor($proveedor)]\n ]);\n\n DB::beginTransaction();\n try {\n $proveedor->eliminar();\n DB::commit();\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n\n } catch (\\Exception $e) {\n DB::rollBack();\n\n return response()->json([], 500);\n }\n }", "public function eliminar($con){\r\n\t\t$sql = \"DELETE FROM lineaspedidos WHERE idPedido='$this->idPedido' AND idProducto='$this->idProducto'\";\r\n\t\t// Ejecuta la consulta y devuelve el resultado\r\n\t\treturn ($con->query($sql));\r\n\t}", "function borrar_prov_serv_cost($idproveedor,$idservicio){\n\t\t$sql=\"\n\t\tDELETE FROM catalogo_proveedor_servicio_costo_negociado WHERE IDPROVEEDOR='$idproveedor' AND IDSERVICIO='$idservicio'\n\t\t\";\n\t\t$this->query($sql);\n\t\treturn;\n\t}", "public function eliminar($idproducto){\n\t\t\t$db=DB::conectar();\n\t\t\t$eliminar=$db->prepare('DELETE FROM comentarios where IDPRODUCTO=:idproducto');\n\t\t\t$eliminar->bindvalue('idproducto',$idproducto);\n\t\t\t$eliminar->execute();\n\t\t}", "public function delete(){\n return (new Database('cliente'))->delete('id = '.$this->id);\n }", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public function destroy($id)\n {\n //\n $response = new \\stdClass();\n\n $proveedores = DB::table('proveedor')->where('id', '=', $id)->first();\n if(!$proveedores){\n $response->success =false;\n $response->mensaje = 'no existe el elemento con el id = '.$id;\n return JsonResponse::create($response);\n }\n DB::table('proveedor')\n ->where('id', '=', $id)\n ->delete();\n\n $response->success = true;\n return JsonResponse::create($response);\n\n }", "public function delete_faseetapa($id_p){ \n\n $this->db->where('proy_id', $id_p);\n $this->db->delete('_proyectofaseetapacomponente');\n }", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EquipeDiscipulos WHERE discipuloId = ?\n AND equipeId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->discipuloId );\n $stm->bindParam(2, $this->equipeId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function delete()\n {\n return $this->dao->delete([\"idProducto\" => $this->idProduct]);\n }", "function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }", "public function destroy(Request $request)\n {\n //\n Proveedores::find($request->id)->delete();\n return redirect('/proveedores/');\n }", "static public function mdlEliminarProveedor($tabla, $datos){\n\n\t\t//$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET estatus=0 WHERE id = :id\");\n\n\t\t$stmt -> bindParam(\":id\", $datos, PDO::PARAM_INT);\n\n\t\tif($stmt -> execute()){\n\n\t\t\treturn \"ok\";\n\t\t\n\t\t}else{\n\n\t\t\treturn \"error\";\t\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function eliminarProyecto(Request $request)\n\n {\n $proyecto = Proyecto::find($request->get(\"idPro\"));\n $proyecto->estadosdeproyectos_id = $request->get(\"idEliminar\");\n $proyecto->resumen = $request->get('textoEliminar');\n $proyecto->save();\n\n return redirect(\"home\");\n\n }", "public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }", "public function deleting(Seguimiento $Seguimiento){\n \n }", "public function destroy(Request $request)\n {\n $mint_idProveedor = (int)$request->idProveedor;\n $proveedor = Proveedor::find($mint_idProveedor);\n $proveedor->Estado = null;\n $this->ProveedorRep->Actualizar($proveedor);\n return redirect('/pagProveedor');\n }", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "function deleteProyecto($proyecto){\n //no implementado por no requerimiento del proyecto\n }", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "public function eliminaPedido($codpedido) {\n $sql = \"SELECT elementoPedido_elementoPedido_id\n FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result = $this->bd->query($sql);\n $numfilas = $result->num_rows;\n /* Elimino las asociaciones del pedido con sus elementos */\n $sql2 = \"DELETE FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result2 = $this->bd->query($sql2);\n /* Elimino los elementos del pedido, con sus elementos de cola y asociaciones */\n for($i=0; $i<$numfilas ; $i++) {\n $row = $result->fetch_assoc();\n $cod = $row[\"elementoPedido_elementoPedido_id\"];\n $sql3 = \"DELETE FROM asociaPlato\n WHERE elementoColaCocina_elementoPedido_elementoPedido_id = $cod\";\n $sql4 = \"DELETE FROM asociaBebida\n WHERE elementoColaBar_elementoPedido_elementoPedido_id = $cod\";\n $sql5 = \"DELETE FROM elementoColaCocina\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql6 = \"DELETE FROM elementoColaBar\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql7 = \"DELETE FROM elementoPedido\n WHERE elementoPedido_id = $cod\";\n $result3 = $this->bd->query($sql3);\n $result4 = $this->bd->query($sql4);\n $result5 = $this->bd->query($sql5);\n $result6 = $this->bd->query($sql6);\n $result7 = $this->bd->query($sql7);\n }\n /* Elimino el pedido y */\n $sql8 = \"DELETE FROM facturaPedido\n WHERE pedido_pedido_id = $codpedido\";\n// $sql9 = \"DELETE FROM pedido\n// WHERE pedido_id = $codpedido\";\n\n $result8 = $this->bd->query($sql8);\n// $result9 = $this->bd->query($sql9);\n }", "public function insert($proveedor);", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "public function select($proveedor);", "public function excluir() {\n\t\t$this->__con->where('p_id', $this->p_id);\n\t\t$excluir = $this->__con->delete('produto');\n\n\t\tif ($excluir>0) {\n\n\t\t\treturn $excluir;\n\n\t\t} else {\n\t\t\tthrow new \\Exception(\"Não foi possível excluir o produto.\", 1);\n\t\t}\n\t\n\t}", "function remove() {\n\t\t$option = JRequest::getCmd('option');\n\t\t// Se obtienen los ids de los registros a borrar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a borrar\n if (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_DELETE'));\n\t\t}\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se intenta el borrado\n\t\tif ($model->delete($cids, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.DATA_DELETED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_DELETED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}", "function borrarInscrito() {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n leerClase('Estudiante');\n leerClase('Proyecto_dicta');\n $estudiante = new Estudiante($this->estudiante_id);\n $evaluacion = new Evaluacion($this->evaluacion_id);\n $protecto=$estudiante->getProyecto();\n $sql = \"select p.id as id from \" . $this->getTableName('Proyecto_dicta') . \" as p where p.proyecto_id = '$protecto->id' and p.dicta_id = '$this->dicta_id' \";\n $resultado = mysql_query($sql);\n\n $proyecto_array = mysql_fetch_array($resultado);\n $proyecto_dicta = new Proyecto_dicta($proyecto_array);\n $proyecto_dicta->delete();\n $evaluacion->delete();\n $this->delete();\n }", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "public function destroy($id)\n {\n $proveedor_id = Crypt::decrypt($id);\n\n try {\n $proveedor = Tipo_Proveedor::findOrfail($proveedor_id)->delete();\n\n flash('Los datos del tipo de proveedor han sido eliminados satisfactoriamente.')->success();\n return redirect('proveedor');\n }catch (\\Exception $e) {\n\n\n flash('Error al intentar eliminar los datos del tipo de proveedor.')->error();\n //flash($e->getMessage())->error();\n return redirect('proveedor');\n }\n }", "public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function delete($producto);", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function destroy(Request $request, $id)\n {\n //AGREGANDO LA ACCION A BITACORA\n Auth()->user()->registerBinnacle();\n\n $proveedor = proveedor::find($id);\n $proveedor->estado =0;\n $proveedor->save();\n return redirect()->route('proveedors.index');\n }", "public function delete($objet);", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}", "public function destroy($prov)\n {\n $proveedor = Proveedor::findOrFail($prov);\n $proveedor->delete();\n $proveedores = Proveedor::all();\n return view('proveedor.index')->with('proveedores', $proveedores);\n }", "public function destroy(anteproyecto $anteproyecto)\n {\n //\n }", "function eliminar($objeto){\n\t\t$sql=\"\tUPDATE\n\t\t\t\t\tcom_recetas\n\t\t\t\tSET\n\t\t\t\t\tstatus = 2\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_productos\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_producto_material\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto = \".$objeto['id'].\";\";\n\t\t// return $sql;\n\t\t$result = $this->dataTransact($sql);\n\n\t\treturn $result;\n\t}", "public function removeProducto(Request $request){\n \n $id_producto = $request['id_producto'];\n return ProductoModel::eliminarProducto($id_producto);\n }", "public function producto_delete($cod){\r\n $sql = \"DELETE FROM productos WHERE id_producto=:miCod\";\r\n\r\n $resultado=$this->db->prepare($sql);\r\n \r\n $resultado->execute(array(\":miCod\"=>$cod));\r\n }", "function borrarProducto ($nombreproducto){\r\n $enc = false;\r\n for ($i = 0; $i < count ($this->productos) && ($enc == false); $i++){\r\n if ($this->productos[$i]->getNombre() == $nomproducto){\r\n $this->productos[$i] = null;\r\n $enc = true;\r\n }\r\n }\r\n }", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "function eliminar_producto_proyecto($id){\n\t\t$conexion_bd = conectar_bd();\n\n\t\t//Prepaprar la consulta\n\t\t$dml = 'DELETE FROM `producto_proyecto` WHERE `producto_proyecto`.`id_producto` = (?)';\n\t\tif ( !($statement = $conexion_bd->prepare($dml)) ){\n\t\t\tdie(\"Error: (\" . $conexion_bd->errno . \") \" . $conexion_bd->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Unir los parametros de la funcion con los parametros de la consulta\n\t\t// El primer argumento de bind_param es el formato de cada parametro\n\t\tif (!$statement->bind_param(\"s\", $id)) {\n\t\t\tdie(\"Error en vinculación: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Ejecutar la consulta\n\t\tif (!$statement->execute()) {\n\t\t\tdie(\"Error en ejecución: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t//Desconectarse de la base de datos\n\t\t\t desconectar_bd($conexion_bd);\n\t\t\t return 1;\n \n\t}", "function Elimina($id){\r\n\t\r\n\t\t$db=dbconnect();\r\n\t\r\n\t\t/*Definición del query que permitira eliminar un registro*/\r\n\t\t$sqldel=\"DELETE FROM productos WHERE id_producto=:id\";\r\n\t\r\n\t\t/*Preparación SQL*/\r\n\t\t$querydel=$db->prepare($sqldel);\r\n\t\t\t\r\n\t\t$querydel->bindParam(':id',$id);\r\n\t\t\r\n\t\t$valaux=$querydel->execute();\r\n\t\r\n\t\treturn $valaux;\r\n\t}", "public function destroy(Prueva $prueva)\n {\n //\n }", "public function eliminar(){\n $sql = \"UPDATE especialidad SET Estado = ? WHERE Id_Especialidad = ?;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //bindeando los parametros de la consulta prepar\n $query->bindParam(1, $this->estado);\n $query->bindParam(2, $this->id_especialidad);\n //ejecutando\n $result = $query->execute();\n //retornando true si se ejecuto, false si no\n return $result;\n }", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "public function EliminarIngredientesProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" delete from productosvsingredientes where codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codproducto);\n\t\t$stmt->bindParam(2,$codingrediente);\n\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t$codingrediente = base64_decode($_GET[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ELIMINADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\n\t} else {\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR INGREDIENTES AGREGADOS, NO ERES EL ADMINISTRADOR DEL SISTEMA </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t}\n\n}", "public function destroy($id_cliente){}", "public function eliminaReserva($cod) {\n // 1ro actualizamos la existencia de los productos adicionando lo que no se ha vendido\n $modelocantidad = $this->db->query(\"SELECT p.modelo,(d.cantidad+p.existencia) as existencia FROM producto p,detalle_venta d WHERE p.modelo LIKE d.modelo AND d.cod_venta LIKE '\" . $cod . \"';\")->result_array(); //obtenemos los datos del detalle\n if (sizeof($modelocantidad) > 0) {\n //actualizamos la existencia en producto\n $this->db->update_batch('producto', $modelocantidad, 'modelo');\n if ($this->db->affected_rows() > 0) {\n //3ro eliminamos el detalle de venta de la venta\n $this->db->query(\"delete from detalle_venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n //eliminamos los datos de la venta\n $this->db->query(\"delete from venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n return \"Exito! Se ha eliminado la reserva de\"; //el nombre se muestra en jquery\n } else {\n return \"Error: No se ha eliminado la reserva de\";\n }\n } else {\n return \"Error: No se ha eliminado el Detalle de la venta de\";\n }\n } else {\n return \"Error: No se ha actualizado la existencia de productos\";\n }\n } else {\n return \"No se tiene registro del detalle de la venta de\";\n }\n }", "function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }", "public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "protected function eliminar_cliente_modelo ($codigo){\n\t\t$query=mainModel::conectar()->prepare(\"DELETE FROM cliente WHERE CuentaCodigo =:Codigo\");\n\t\t$query->bindParam(\":Codigo\",$codigo);\n\t\t$query->execute();\n\t\treturn $query;\n\t}", "public function EliminarDetallesVentasPedidosProductos()\n{\t\t\n\tself::SetNames();\n\t$sql = \" select * from detalleventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num > 1)\n\t{\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n\n\n\t\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = $row[\"preciocompra\"];\n\t\t$importeiva = $row[\"importe\"];\n\t\t$importe2iva = $row[\"importe2\"];\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($rov = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $rov;\n\t\t\t}\n\t\t$preciocompra = $rov[\"preciocompra\"];\n\t\t$importe = $rov[\"importe\"];\n\t\t$importe2 = $rov[\"importe2\"];\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" totalpago2= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t$stmt->bindParam(3, $totaliva);\n\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t$stmt->bindParam(5, $total);\n\t\t$stmt->bindParam(6, $total2);\n\t\t$stmt->bindParam(7, $codventa);\n\t\t\n\t\t$subtotalivasive= rount($importeiva,2);\n\t\t$subtotalivanove= rount($importe,2);\n $totaliva= rount($subtotalivasive*$iva,2);\n\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t$total2= rount($preciocompra,2);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\n\t\t\t\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\t?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('EL PEDIDO DE PRODUCTOS FUE ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\t\t }\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\t\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$codventa = base64_decode($_GET[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusmesa);\n\t\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t\t$statusmesa = strip_tags('0');\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('LOS PEDIDOS DE PRODUCTOS HAN SIDO ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\texit;\n\t}\n}", "function excluir($id)\n{\n $produto = Produto::find($id);\n\n // Excluindo este objeto\n $produto->delete();\n\n // Criando uma mensagem para ser enviada a view produto.pesquisar\n $mensagem = \"Produto excluído com sucesso!\";\n\n // Capturando objetos para enviar a view produto.pesquisar\n $produtos = Produto::all();\n\n // Retornando a view produto.pesquisar\n return view('produto.pesquisar')->with('mensagem', $mensagem)->with('produtos', $produtos);\n}", "public function deleteRow()\n {\n $sql = 'DELETE FROM productos\n WHERE id_producto = ?';\n $params = array($this->id);\n return Database::executeRow($sql, $params);\n }", "public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_rubro($id)\");\n }\n }", "public function destroy($id)\n {\n $prov = Proveedor::findOrFail($id);\n $domicilio = Direccion::findOrFail($prov->id_domicilio);\n $domicilio->delete();\n $prov->delete();\n\n return redirect()->route('proveedores.index'); \n }", "public static function deletaProdutoCarrinho(){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n unset($expPro[self::$posicao]);\n unset($expQuant[self::$posicao]);\n\n //VERIFICA SE TEM PRODUTOS NO CARRINHO\n if($expPro and $expQuant !== ''){\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $query = 'UPDATE carrinhos SET produto_id=:pro, quantidade=:qnt, idCliente=:idC WHERE id=:id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,self::$carrinho->idCliente);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n return true;\n }throw new \\Exception(\"Erro ao Deletar Produto\");\n\n //SE O CARRINHO ESTIVER VAZIO SERA DELETADO\n }else{\n $query = 'DELETE FROM carrinhos WHERE carrinhos.id LIKE :id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n $_SESSION['user']['carrinhoId'] = NULL;\n\n return true;\n }throw new \\Exception(\"Erro ao Deletar Carrinho\");\n }\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "function deletepanier($user, $product){\t\t// Fonction pour supprimer un produit du panier\n\n\t\tinclude(\"../../modele/modele.php\");\n\n\t\t$sql = 'SELECT * FROM detailcommande WHERE id_product= \"'.$product.'\" AND id_user= \"'.$user.'\" AND actif = 1';\n\t\t$reponse = $bdd->query($sql);\n\t\t\n\t\twhile ($donnees = $reponse->fetch())\n\t\t{\n\t\t\t$sql2 = 'DELETE FROM commande WHERE id_user = \"'.$user.'\" AND id_detailCommande = \"'.$donnees['id'].'\" AND actif = 1 ';\n\t\t\t$reponse2 = $bdd->prepare($sql2);\n\t\t\t$reponse2 ->execute();\n\t\t}\n\t\t$sql3 = 'DELETE FROM detailcommande WHERE id_product= \"'.$product.'\" AND id_user= \"'.$user.'\" AND actif = 1 ';\n\t\t$reponse3 = $bdd->prepare($sql3);\n\t\t$reponse3 ->execute();\n\n\t}", "public function EliminarDetallesVentas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\n\t\t$sql = \" select * from detalleventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql2);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t$sql = \" update productos set \"\n\t.\" existencia = ? \"\n\t.\" where \"\n\t.\" codproducto = ?;\n\t\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1, $existencia);\n\t$stmt->bindParam(2, $codproducto);\n\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$existencia = $existenciadb + $cantventa;\n\t$stmt->execute();\n\n\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$coddetalleventa);\n\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$codventa);\n\t$stmt->bindParam(2,$codproducto);\n\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\n if($num>0) {\n\n$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\t\t }\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$totaldb = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = ($pae[0][\"preciocompra\"]== \"\" ? \"0\" : $pae[0][\"preciocompra\"]);\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2si = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$preciocompra = ($roww[\"preciocompra\"]== \"\" ? \"0\" : $roww[\"preciocompra\"]);\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\t\t\nif(base64_decode($_GET[\"ivaproducto\"])==\"SI\"){\t\n\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentove);\n\t\t$stmt->bindParam(4, $totalpago);\n\t\t$stmt->bindParam(5, $devuelto);\n\t\t$stmt->bindParam(6, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t\t } else {\n\n $sql = \" update ventas set \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentove);\n\t\t$stmt->bindParam(3, $totalpago);\n\t\t$stmt->bindParam(4, $devuelto);\n\t\t$stmt->bindParam(5, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasive+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t } \n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\necho \"</div>\";\nexit;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $roww;\n\t\t\t}\n\t\t$totaldb = $roww[\"totalpago\"];\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\tif (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t//$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = rount($ingreso-$totaldb,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t$sql = \" update mesas set \"\n\t\t.\" statusmesa = ? \"\n\t\t.\" where \"\n\t\t.\" codmesa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $statusmesa);\n\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t$statusmesa = strip_tags('0');\n\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\n\techo \"</div>\";\n\texit;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR DETALLES EN VENTAS, NO ERES EL ADMINISTRADOR DEL SISTEMA</center>\";\n\techo \"</div>\";\n\texit;\n\t\t}\n\t}", "public function EliminarDetallesCompras()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\t\t$sql = \" select * from detallecompras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t$sql4 = \"select * from compras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasic = $paea[0][\"subtotalivasic\"];\n\t\t$subtotalivanoc = $paea[0][\"subtotalivanoc\"];\n\t\t$iva = $paea[0][\"ivac\"]/100;\n\t\t$descuento = $paea[0][\"descuentoc\"]/100;\n\t\t$totalivac = $paea[0][\"totalivac\"];\n\t\t$totaldescuentoc = $paea[0][\"totaldescuentoc\"];\n\n\t$sql3 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'SI'\";\n $stmt = $this->dbh->prepare($sql3);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($rowp = $stmt->fetch())\n {\n $p[] = $rowp;\n }\n $importeivasi = ($rowp[\"importe\"]== \"\" ? \"0\" : $rowp[\"importe\"]);\n\n$sql5 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'NO'\";\n $stmt = $this->dbh->prepare($sql5);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($roww = $stmt->fetch())\n {\n $pw[] = $roww;\n }\n $importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\n if(base64_decode($_GET[\"ivaproductoc\"])==\"SI\"){\t\n\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivasic = ?, \"\n\t\t\t .\" totalivac = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentoc);\n\t\t$stmt->bindParam(4, $total);\n\t\t$stmt->bindParam(5, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanoc+$totaliva,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\n\t\t\n\t\t } else {\n\t\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivanoc = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentoc);\n\t\t$stmt->bindParam(3, $total);\n\t\t$stmt->bindParam(4, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasic+$totalivac,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\t\t\n\t\t }\t\t\t\t\t\n\n\t\theader(\"Location: detallescompras?mesage=2\");\n\t\texit;\n\n\t\t}\n\t\telse\n\t\t{\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from compras where codcompra = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$codcompra = base64_decode($_GET[\"codcompra\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t\theader(\"Location: detallescompras?mesage=2\");\n\t\t\texit;\n\t\t}\n\t}\n\telse\n\t{\n\t\theader(\"Location: detallescompras?mesage=3\");\n\t\texit;\n\t}\n}", "public static function eliminar(){\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $cita = Cita::find($_POST['id']);\n $cita->eliminar();\n header('Location:' . $_SERVER['HTTP_REFERER']);\n }\n }", "public function delete($id_pedido, $id_producto) {\n $this->db->where('id_pedido', $id_pedido);\n $this->db->where('id_producto', $id_producto);\n $this->db->where('devuelto IS NULL');\n \n //Para eliminar un producto por vez\n $this->db->limit(1);\n \n $this->db->delete('productosXpedido');\n }", "public function delete()\n {\n $LedgerEntyModel = new Core_Model_Finance_Ledger_Entry;\n $purchaseRecord = $this->fetch();\n $ledgerEntryIds = unserialize($purchaseRecord['s_ledger_ids']);\n for($i = 0; $i <= sizeof($ledgerEntryIds)-1; $i += 1) {\n $result = $LedgerEntyModel->deleteById($ledgerEntryIds[$i]);\n }\n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto(\n 'purchase_id = ?', $this->_purchaseId\n );\n $result = $table->delete($where);\n \n $log = $this->getLoggerService();\n $info = 'Purchase deleted with purchas id = '. $this->_purchaseId;\n $log->info($info);\n \n return $result;\n }", "public function destroy(Profesor $profesor)\n {\n //\n }", "function delete_prodi($id_prodi)\n {\n return $this->db->delete('prodi',array('id_prodi'=>$id_prodi));\n }" ]
[ "0.7843265", "0.76307636", "0.6959245", "0.6580722", "0.64543563", "0.64077103", "0.6384368", "0.63628274", "0.6306772", "0.63024527", "0.6301882", "0.62959117", "0.62944233", "0.6255204", "0.6248938", "0.6215888", "0.61923736", "0.6191895", "0.6170335", "0.6134639", "0.61122304", "0.6105151", "0.6095243", "0.60855305", "0.6077623", "0.6045826", "0.60294265", "0.6007671", "0.6001977", "0.5939688", "0.5936277", "0.59361494", "0.5919399", "0.5916281", "0.5916174", "0.5911247", "0.5908195", "0.5907217", "0.5904915", "0.5900341", "0.5893102", "0.58883816", "0.5879937", "0.5878946", "0.5856437", "0.58526033", "0.5846266", "0.58439493", "0.5838943", "0.583683", "0.5818807", "0.58144796", "0.5805732", "0.5804226", "0.57989895", "0.57931405", "0.5787074", "0.5774144", "0.5766782", "0.5759312", "0.5757089", "0.5750991", "0.57468176", "0.5746811", "0.5742676", "0.57343477", "0.5733126", "0.5726972", "0.5722387", "0.5716721", "0.5715194", "0.57129544", "0.5706118", "0.5699784", "0.5684263", "0.5677232", "0.56736", "0.56652004", "0.5647662", "0.5647131", "0.5643045", "0.56404895", "0.56363034", "0.56287235", "0.56226987", "0.56216085", "0.56167305", "0.5615177", "0.55994993", "0.55823815", "0.55747205", "0.5574175", "0.55704373", "0.55612624", "0.5561184", "0.5560392", "0.55603194", "0.5554148", "0.55468285", "0.5546523" ]
0.8131264
0
Busca un objeto Proveedor en la base de datos.
Найдите объект Поставщик в базе данных.
public function select($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_proveedor($idProveedor,$idEmpresa){\n if($idProveedor != '' || $idEmpresa != ''){\n\n $this->_query =\n \"\n select \n idproveedor,\n idempresa,\n nombre_proveedor,\n descripcion_proveedor,\n telefono01,\n telefono02,\n correo,\n celular,\n direccion,\n idestado,\n fecha_alta,\n fecha_um,\n idusuario_alta,\n idusuario_um\n from \n proveedores \n WHERE \n idproveedor = $idProveedor AND\n idempresa = '$idEmpresa' \n ORDER BY nombre_proveedor DESC \n \";\n\n $this->get_result_query();\n\n }\n\n if(count($this->_rows) == 1){\n\n foreach ($this->_rows[0] as $campo => $valor){\n $this->$campo = $valor ;\n }\n\n $this->_confirm = true ;\n $this->_message = \"Se encontro el proveedor\";\n\n }else{\n $this->_confirm = false ;\n $this->_message = \"No se encontro el proveedor\" ;\n }\n\n }", "public function datos_proveedores() \n {\n return Proveedor::all();\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function insert($proveedor);", "public function datos_proveedor_especifico($id) \n {\n return Proveedor::find($id);\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "function Proveeedor($cedulaProveedor, $nombre, $telefono, $productos) {\n $this->cedulaProveedor = $cedulaProveedor;\n $this->nombre = $nombre;\n $this->telefono = $telefono;\n $this->productos = $productos;\n }", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function getProveedorTipo()\n {\n return $this->hasOne(ProveedorTipo::className(), ['id' => 'proveedor_tipo']);\n }", "public function proveedor()\n {\n return $this->hasOne('App\\Proveedor', 'id');\n }", "public function obtenerProveedores()\n { \n $query = $this->db->get('proveedor'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }", "public function ProveedorPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function __construct(){\r\n $this->proveedores=array();\r\n }", "public function obtener_proveedores()\n {\n return $this->db->get('proveedores')->result();\n }", "public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }", "public function show(Proveedores $proveedores)\n {\n //\n }", "public function readProveedores(){\n $sql='SELECT idProveedor, nombreProveedor, direccion, telefono,correo FROM proveedor where estado=1 AND proveedor.estadoEliminacion=1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public function ctlBuscaProveedores(){\n\n\t\t$respuesta = Datos::mdlProveedores();\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "public function usuarioProveedor()\n {\n \treturn $this->belongsTo('App\\Usuario', 'usuario_id', 'id');\n }", "public function proveedor(){\n return $this->belongsTo(Proveedor::class,'idproveedor','id');\n }", "public function getProveedorEstado()\n {\n return $this->hasOne(ProveedorEstado::className(), ['id' => 'proveedor_estado']);\n }", "public function get_detalle_proveedor($numero_compra){\n\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select c.fecha_compra,c.numero_compra, c.proveedor, c.cedula_proveedor,c.total,p.id_proveedor,p.cedula,p.razon_social,p.telefono,p.correo,p.direccion,p.fecha,p.estado\n from compras as c, proveedor as p\n where \n \n c.cedula_proveedor=p.cedula\n and\n c.numero_compra=?\n \n ;\";\n\n //echo $sql; exit();\n\n $sql=$conectar->prepare($sql);\n \n\n $sql->bindValue(1,$numero_compra);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n \n \n }", "public function ProveedoresPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function ListarProveedores()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "private function buscar_proveedor()\n {\n $this->template = FALSE;\n \n $json = array();\n foreach($this->proveedor->search($_REQUEST['buscar_proveedor']) as $pro)\n {\n $json[] = array('value' => $pro->nombre, 'data' => $pro->codproveedor);\n }\n \n header('Content-Type: application/json');\n echo json_encode( array('query' => $_REQUEST['buscar_proveedor'], 'suggestions' => $json) );\n }", "public function provider()\n {\n return $this->belongsTo('App\\Provider', 'proveedor_id');\n }", "private function datos_proveedor()\n {\n $this->template = FALSE;\n \n header('Content-Type: application/json');\n echo json_encode( $this->proveedor->get($_REQUEST['datosproveedor']) );\n }", "public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }", "static public function mdlBuscarProveedor($valor) {\r\n\r\n $sql = \"SELECT proveedores.id, proveedores.proveedor, proveedores.contacto, proveedores.direccion, proveedores.id_municipio, municipios.municipio, municipios.id_departamento, departamentos.departamento, proveedores.telefono, proveedores.email FROM proveedores LEFT JOIN municipios ON proveedores.id_municipio = municipios.id LEFT JOIN departamentos ON municipios.id_departamento = departamentos.id WHERE proveedores.proveedor LIKE '%\".$valor.\"%'\";\r\n\r\n $stmt = Conexion::conectar()->prepare($sql);\r\n\r\n $stmt -> execute();\r\n\r\n return $stmt -> fetchAll();\r\n\r\n\r\n }", "public function inventario_consultarProveedoresProducto($idProducto){\n \t\t\t\t\n \t\t$resultado = array();\t\n \t\t\t\n \t\t$query = \"SELECT \n\t\t\t\t\t\t\t PP.costo, P.nombre AS nombreProveedor, P.telefono1\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t tb_productos_proveedores AS PP\n\t\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t\t tb_proveedores AS P ON P.idProveedor = PP.idProveedor\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t PP.idProducto = '$idProducto'\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n \t\n }", "public function edit(ProveedoresModel $proveedor)\n {\n //\n }", "function listar_proveedores(){\n\t\t$sql=\"\n\tSELECT\n\t\tcp.IDPROVEEDOR IDPROV, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\tcp.BRSCH, csb.RAMO, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\tcp.ACTIVO,cp.INTERNO,\n\t\tcp.ARREVALRANKING,\n\t\tcp.CDE,\n\t\tcp.SKILL,\n\t\tcp.EVALFIDELIDAD,\n\t\tcp.EVALINFRAESTRUCTURA,\n\t\tcp.EVALSATISFACCION,\n\t\tcp.IDMONEDA,\n\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA,\n\t\tcpu.*,\n\t\tcpt.*\n\tFROM\n\t$this->catalogo.catalogo_proveedor cp\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_ubigeo cpu ON cp.IDPROVEEDOR=cpu.IDPROVEEDOR \n\t\tLEFT JOIN $this->catalogo.catalogo_sap_brsch csb ON cp.BRSCH = csb.BRSCH\t\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_telefono cpt ON cp.IDPROVEEDOR = cpt.IDPROVEEDOR AND cpt.PRIORIDAD=1\n\t\n\t\t\";\n\n\t$result =$this->query($sql);\n\treturn $result;\n\t}", "function getNitProveedor()\n {\n return $this->NitProveedor;\n }", "public function delete($proveedor);", "public function dataProveedoresInicial ($id_prod, $id_prov) {\n\n //Busqueda de todos los paises donde quiere recibir el productor para filtrar los metodos de envio\n $paises_prod = DB::select(DB::raw(\"SELECT id_pais FROM rdj_productores_paises\n WHERE id_productor=? ORDER BY id_pais\"),[$id_prod]);\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov, pa.nombre AS pais FROM \n rdj_paises pa, rdj_proveedores pr WHERE pa.id=pr.id_pais AND pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n $prov[\"pais\"] = $query[0]->pais;\n \n //Busqueda de los metodos de pago del proveedor\n $query = DB::select(\n DB::raw(\"SELECT CASE WHEN pa.tipo='c' THEN 'Cuota única' WHEN pa.tipo='p'\n THEN 'Por cuotas' END AS tipo, pa.num_cuotas AS numc, pa.porcentaje AS porc,\n pa.meses AS meses, pa.id FROM rdj_metodos_pagos pa WHERE pa.id_proveedor=?\"),\n [$prov[\"idp\"]]);\n \n //Almacenamiento de arreglo de metodos de pagos del proveedor\n $prov[\"pagos\"] = $query;\n\n //Para los metodos de envio, creamos un arreglo ya que pueden ser varios\n $prov[\"envios\"] = [];\n foreach($paises_prod as $pais) { //Para cada pais del productor buscamos si hay metodo de envio\n\n $query = DB::select(\n DB::raw(\"SELECT e.duracion, e.precio, e.id AS id_envio, p.id AS id_pais, p.nombre AS pais,\n CASE WHEN e.tipo='t' THEN 'Terrestre' WHEN e.tipo='a' THEN 'Aéreo'\n WHEN e.tipo='m' THEN 'Marítimo' END AS tipo FROM rdj_paises p,\n rdj_metodos_envios e WHERE e.id_pais=? AND e.id_proveedor=?\n AND e.id_pais=p.id ORDER BY e.id_pais\"),[$pais->id_pais, $prov[\"idp\"]]);\n\n //Agregamos al arreglo si conseguimos un metodo de envio para el pais\n //como pueden haber varios metodos de envio con el mismo pais necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $met) {\n $metodo = [];\n $metodo[\"detalles\"] = [];\n $metodo[\"id_envio\"] = $met->id_envio;\n $metodo[\"id_pais\"] = $met->id_pais;\n $metodo[\"duracion\"] = $met->duracion;\n $metodo[\"precio\"] = $met->precio;\n $metodo[\"pais\"] = $met->pais;\n $metodo[\"tipo\"] = $met->tipo;\n array_push($prov[\"envios\"],$metodo);\n }\n }\n }\n\n //Para los detalles o modificadores de los metodos de envios conseguidos\n for($i = 0; $i <= sizeof($prov[\"envios\"]) - 1; $i++) {\n //Busqueda de los detalles de un metodo de envio\n $query = DB::select(\n DB::raw(\"SELECT d.id, d.nombre AS det, d.mod_precio AS precio, d.mod_duracion AS duracion\n FROM rdj_detalles_metodos_envios d WHERE d.id_envio=? AND d.id_proveedor=?\n AND d.id_pais=?\"),[$prov[\"envios\"][$i][\"id_envio\"], $id_prov, $prov[\"envios\"][$i][\"id_pais\"]]\n );\n //Agregamos al arreglo si conseguimos un detalle de envio para el metodo\n //como pueden haber varios detalles de envio con el mismo metodo necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $det) {\n $detalle = [];\n $detalle[\"id\"] = $det->id;\n $detalle[\"det\"] = $det->det;\n $detalle[\"precio\"] = $det->precio;\n $detalle[\"duracion\"] = $det->duracion;\n array_push($prov[\"envios\"][$i][\"detalles\"],$detalle);\n }\n } \n }\n\n /* Buscamos todas las esencias del proveedor y las guardamos */\n $prov[\"esencias\"] = $query = DB::select(\n DB::raw(\"SELECT e.cas_ing_esencia AS cas, e.nombre AS ing, CASE WHEN\n e.naturaleza='n' THEN 'natural' WHEN e.naturaleza='s' THEN 'sintetica' END\n AS tipo FROM rdj_ingredientes_esencias e WHERE e.id_proveedor=? \n ORDER BY e.cas_ing_esencia\"), \n [$id_prov]);\n \n /* Buscamos todos los otros ingredientes del proveedor y los guardamos */\n $prov[\"otros\"] = $query = DB::select(\n DB::raw(\"SELECT o.cas_otro_ing AS cas, o.nombre AS ing\n FROM rdj_otros_ingredientes o WHERE o.id_proveedor=? \n ORDER BY o.cas_otro_ing\"), \n [$id_prov]);\n\n /* Proceso que elimina ingredientes contratados exclusivamente de la lista de ingredientes disponibles */\n $ingsExclusivos = DB::select(DB::raw(\"SELECT dc.cas_ing_esencia AS cas_esen, dc.cas_otro_ing AS cas_otro \n FROM rdj_contratos c, rdj_detalles_contratos dc WHERE c.fecha_apertura=dc.fecha_apertura \n AND c.id_proveedor=dc.id_proveedor AND c.id_proveedor=? AND c.exclusivo=true AND c.cancelacion=false\"),[$id_prov]);\n\n $esenFiltradas = [];\n $otrosFiltrados = [];\n\n foreach($prov[\"esencias\"] as $esen) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_esen != null && $esen->cas == $ing->cas_esen) \n $cond = true;\n }\n if($cond == false) array_push($esenFiltradas, $esen);\n }\n\n foreach($prov[\"otros\"] as $otro) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_otro != null && $otro->cas == $ing->cas_otro) \n $cond = true;\n }\n if($cond == false) array_push($otrosFiltrados, $otro);\n }\n\n $prov[\"esencias\"] = $esenFiltradas;\n $prov[\"otros\"] = $otrosFiltrados;\n \n /* Buscamos las presentaciones de cada esencia y las guardamos */\n foreach($prov[\"esencias\"] as $esen) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_presents_ings_esencias p WHERE p.cas_ing_esencia=?\n ORDER BY p.id\"),\n [$esen->cas]);\n $esen->cas = Controller::stringifyCas($esen->cas);\n $esen->pres = $query;\n }\n \n /* Buscamos las presentaciones de cada otro ing y las guardamos */\n foreach($prov[\"otros\"] as $otro) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_present_otros_ings p WHERE p.cas_otro_ing=?\n ORDER BY p.id\"),\n [$otro->cas]);\n $otro->cas = Controller::stringifyCas($otro->cas);\n $otro->pres = $query;\n }\n\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "function grabar($datos)\n\t{\n\t\tif (($datos[IDPROVEEDOR]=='') && ($this->exist(\"$this->catalogo.catalogo_proveedor\",'IDPROVEEDOR',\" WHERE NOMBREFISCAL = '$datos[NOMBREFISCAL]'\" )))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reg_proveedor[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t$reg_proveedor[NOMBREFISCAL] = trim(strtoupper($datos[NOMBREFISCAL]));\n\t\t\t$reg_proveedor[NOMBRECOMERCIAL] = trim(strtoupper($datos[NOMBRECOMERCIAL]));\n\t\t\t$reg_proveedor[IDTIPODOCUMENTO] = $datos[IDTIPODOCUMENTO];\n\t\t\t$reg_proveedor[IDDOCUMENTO] = trim($datos[IDDOCUMENTO]);\n\t\t\t$reg_proveedor[EMAIL1] = trim(strtolower($datos[EMAIL1]));\n\t\t\t$reg_proveedor[EMAIL2] = trim(strtolower($datos[EMAIL2]));\n\t\t\t$reg_proveedor[EMAIL3] = trim(strtolower($datos[EMAIL3]));\n\t\t\t$reg_proveedor[ACTIVO] = $datos[ACTIVO];\n\t\t\t$reg_proveedor[INTERNO] = $datos[INTERNO];\n\n\t\t\tif ($datos[ARREVALRANKING]=='SKILL'){\n\t\t\t\t$reg_proveedor[ARREVALRANKING]=$datos[ARREVALRANKING];\n\t\t\t\t$reg_proveedor[SKILL]= $datos[SKILL];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$reg_proveedor[ARREVALRANKING]='CDE';\n\t\t\t}\n\t\t\t$reg_proveedor[EVALFIDELIDAD]=$datos[EVALFIDELIDAD];\n\t\t\t$reg_proveedor[EVALINFRAESTRUCTURA]=$datos[EVALINFRAESTRUCTURA];\n\t\t\t$reg_proveedor[IDMONEDA]=$datos[IDMONEDA];\n\t\t\t$reg_proveedor[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t\t$reg_proveedor[BRSCH] = $datos[BRSCH];\n\t\t\t$reg_proveedor[FDGRV] = $datos[FDGRV];\n\t\t\t$reg_proveedor[ZTERM] = $datos[ZTERM];\n\t\t\t$reg_proveedor[MWSKZ] = $datos[MWSKZ];\n\t\t\t$reg_proveedor[PARVO] = $datos[PARVO];\n\t\t\t$reg_proveedor[PAVIP] = $datos[PAVIP];\n\t\t\t$reg_proveedor[FECHAINICIOACTIVIDADES]= trim($datos[ANIO].'-'.$datos[MES].'-'.$datos[DIA]);\n\n\t\t\t$prov_ubigeo[CVEPAIS]= $datos[CVEPAIS];\n\t\t\t$prov_ubigeo[CVEENTIDAD1]= $datos[CVEENTIDAD1];\n\t\t\t$prov_ubigeo[CVEENTIDAD2]= $datos[CVEENTIDAD2];\n\t\t\t$prov_ubigeo[CVEENTIDAD3]= $datos[CVEENTIDAD3];\n\t\t\t$prov_ubigeo[CVEENTIDAD4]= $datos[CVEENTIDAD4];\n\t\t\t$prov_ubigeo[CVEENTIDAD5]= $datos[CVEENTIDAD5];\n\t\t\t$prov_ubigeo[CVEENTIDAD6]= $datos[CVEENTIDAD6];\n\t\t\t$prov_ubigeo[CVEENTIDAD7]= $datos[CVEENTIDAD7];\n\t\t\t$prov_ubigeo[CVETIPOVIA]= $datos[CVETIPOVIA];\n\t\t\t$prov_ubigeo[DIRECCION]= $datos[DIRECCION];\n\t\t\t$prov_ubigeo[NUMERO]= $datos[NUMERO];\n\t\t\t$prov_ubigeo[CODPOSTAL] = $datos[CODPOSTAL];\n\t\t\t$prov_ubigeo[LATITUD] = $datos[LATITUD];\n\t\t\t$prov_ubigeo[LONGITUD] = $datos[LONGITUD];\n\t\t\t$prov_ubigeo[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t\t$prov_ubigeo[REFERENCIA1]= $datos[REFERENCIA1];\n\t\t\t$prov_ubigeo[REFERENCIA2]= $datos[REFERENCIA2];\n\n\t\t\t$datos_telf[CODIGOAREA] = $datos[CODIGOAREA];\n\t\t\t$datos_telf[IDTIPOTELEFONO] = $datos[IDTIPOTELEFONO];\n\t\t\t$datos_telf[NUMEROTELEFONO] = $datos[NUMEROTELEFONO];\n\t\t\t$datos_telf[EXTENSION] = $datos[EXTENSION];\n\t\t\t$datos_telf[IDTSP] = $datos[IDTSP];\n\t\t\t$datos_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t\t$datos_telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t$this->borrar_telefono($datos[IDPROVEEDOR]); // BORRA LOS PROVEEDORES\n\n\t\t\tif ( $datos[IDPROVEEDOR]=='')\n\t\t\t{\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor);\n\t\t\t\t$datos[IDPROVEEDOR] = $this->reg_id(); //OBTIENE EL ID DEL NUEVO PROVEEDOR\n\t\t\t\t$prov_ubigeo[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$prov_horario[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo);\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_horario\",$prov_horario);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t}\n\n\t\t\tif ($datos[IDPROVEEDOR]!='')\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($datos_telf[NUMEROTELEFONO]);$i++)\n\t\t\t\t{\n\t\t\t\t\t$telf[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t\t$telf[CODIGOAREA]=$datos_telf[CODIGOAREA][$i];\n\t\t\t\t\t$telf[IDTIPOTELEFONO]=$datos_telf[IDTIPOTELEFONO][$i];\n\t\t\t\t\t$telf[NUMEROTELEFONO]=$datos_telf[NUMEROTELEFONO][$i];\n\t\t\t\t\t$telf[EXTENSION]=$datos_telf[EXTENSION][$i];\n\t\t\t\t\t$telf[IDTSP]=$datos_telf[IDTSP][$i];\n\t\t\t\t\t$telf[COMENTARIO]=$datos_telf[COMENTARIO][$i];\n\t\t\t\t\t$telf[IDUSUARIOMOD] = $datos_telf[IDUSUARIOMOD];\n\t\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_telefono\",$telf);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$datos_sociedad = $datos[IDSOCIEDAD];\n\n\n\t\t\t// GRABA LOS SERVICIOS DEL PROVEEDOR //\n\t\t\t$sql=\"delete from catalogo_proveedor_servicio where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\n\t\t\t$nueva_prioridad=1;\n\n\t\t\tforeach ($datos[CHECKSERVICIO] as $servi)\n\t\t\t{\n\t\t\t\t$servicio[IDSERVICIO] = $servi;\n\t\t\t\t$servicio[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$servicio[PRIORIDAD] = $nueva_prioridad;\n\t\t\t\t$servicio[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t\tif ($servi!='')\n\t\t\t\t{\n\t\t\t\t\t$this->insert_reg('catalogo_proveedor_servicio',$servicio);\n\t\t\t\t\t$nueva_prioridad++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GRABA LAS SOCIEDADES DEL PROVEEDOR\n\t\t\t$sql=\"delete from catalogo_proveedor_sociedad where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\t\t\tforeach ($datos[IDSOCIEDAD] as $soc)\n\t\t\t{\n\t\t\t\t$sociedad[IDSOCIEDAD] = $soc;\n\t\t\t\t$sociedad[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$sociedad[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$this->insert_reg('catalogo_proveedor_sociedad',$sociedad);\n\t\t\t}\n\t\t\treturn $datos[IDPROVEEDOR];\n\t\t}\n\t\treturn $datos[IDPROVEEDOR];\n\t}", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function providers()\n {\n return $this->hasMany(Proveedor::class, 'idNivelEstudios');\n }", "public function destroy(Proveedor $proveedor)\n {\n //\n }", "function getByIdMco_proveedores($PVE_ID)\n {\n $data_mco_proveedores = $this->gateway->getByIdMco_proveedores($PVE_ID);\n return $data_mco_proveedores;\n }", "public function consultar_proveedor($codproveedor){\n $lugares=DB::select(\"SELECT nombre_lugar,id_lugar FROM lugar WHERE tipo_lugar='pa' order by nombre_lugar;\");\n $proveedores=DB::select(\"SELECT * FROM proveedor WHERE id_proveedor=$codproveedor\");\n return view('portal/airucab-proveedores',compact('lugares'),compact('proveedores'));\n }", "function carga_datos($idproveedor)\n\t{\n\n\t\t// carga los datos generales\n\t\t$sql=\"\n\t\tSELECT\n\t\t\tcp.IDPROVEEDOR, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\t\tcp.BRSCH, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\t\tcp.ACTIVO,cp.INTERNO,\n\t\t\tcp.ARREVALRANKING,\n\t\t\tcp.CDE,\n\t\t\tcp.SKILL,\n\t\t\tcp.EVALFIDELIDAD,\n\t\t\tcp.EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALSATISFACCION,\n\t\t\tcp.IDMONEDA,\n\t\t\tcp.OBSERVACIONES,\n\t\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA\n\t\tFROM\n\t\t$this->catalogo.catalogo_proveedor cp\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\n\t\t$result=$this->query($sql);\n\t\twhile ($reg = $result->fetch_object()) {\n\t\t\t$this->idproveedor= $reg->IDPROVEEDOR;\n\t\t\t$this->nombrefiscal= $reg->NOMBREFISCAL;\n\t\t\t$this->nombrecomercial = $reg->NOMBRECOMERCIAL;\n\t\t\t$this->idtipodocumento = $reg->IDTIPODOCUMENTO;\n\t\t\t$this->iddocumento = $reg->IDDOCUMENTO;\n\t\t\t$this->idubigeo = $reg->IDUBIGEO;\n\t\t\t$this->activo = $reg->ACTIVO;\n\t\t\t$this->interno = $reg->INTERNO;\n\t\t\t$this->arrevalranking = $reg->ARREVALRANKING;\n\t\t\t$this->cde = $reg->CDE;\n\t\t\t$this->skill = $reg->SKILL;\n\t\t\t$this->evalfidelidad = $reg->EVALFIDELIDAD;\n\t\t\t$this->evalinfraestructura = $reg->EVALINFRAESTRUCTURA;\n\t\t\t$this->evalsatisfaccion = $reg->EVALSATISFACCION;\n\t\t\t$this->moneda = new moneda();\n\t\t\t$this->moneda->carga_datos($reg->IDMONEDA);\n\t\t\t$this->observaciones = $reg->OBSERVACIONES;\n\n\t\t\t$this->email1 = $reg->EMAIL1;\n\t\t\t$this->email2 = $reg->EMAIL2;\n\t\t\t$this->email3 = $reg->EMAIL3;\n\t\t\t$this->brsch = $reg->BRSCH;\n\t\t\t$this->fdgrv = $reg->FDGRV;\n\t\t\t$this->zterm = $reg->ZTERM;\n\t\t\t$this->mwskz = $reg->MWSKZ;\n\t\t\t$this->parvo = $reg->PARVO;\n\t\t\t$this->pavip = $reg->PAVIP;\n\t\t\t$this->anio = $reg->ANIO;\n\t\t\t$this->mes = $reg->MES;\n\t\t\t$this->dia = $reg->DIA;\n\n\t\t}\n\n\t\t// carga los datos de ubigeo\n\t\t$sql=\"\n\t\tselect \n\t\t\t* \n\t\tfrom\n\t\t$this->catalogo.catalogo_proveedor_ubigeo\n\t\twhere\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg=$resul->fetch_object()) {\n\t\t\t$this->cvepais = $reg->CVEPAIS;\n\t\t\t$this->cveentidad1 = $reg->CVEENTIDAD1;\n\t\t\t$this->cveentidad2 = $reg->CVEENTIDAD2;\n\t\t\t$this->cveentidad3 = $reg->CVEENTIDAD3;\n\t\t\t$this->cveentidad4 = $reg->CVEENTIDAD4;\n\t\t\t$this->cveentidad5 = $reg->CVEENTIDAD5;\n\t\t\t$this->cveentidad6 = $reg->CVEENTIDAD6;\n\t\t\t$this->cveentidad7 = $reg->CVEENTIDAD7;\n\t\t\t$this->cvetipovia = $reg->CVETIPOVIA;\n\t\t\t$this->descripcion = $reg->DESCRIPCION;\n\t\t\t$this->direccion = $reg->DIRECCION;\n\t\t\t$this->codpostal = $reg->CODPOSTAL;\n\t\t\t$this->numero = $reg->NUMERO;\n\t\t\t$this->latitud = $reg->LATITUD;\n\t\t\t$this->longitud = $reg->LONGITUD;\n\t\t\t$this->referencia1 = $reg->REFERENCIA1;\n\t\t\t$this->referencia2 = $reg->REFERENCIA2;\n\t\t}\n\n\t\t// \t CARGA DE LOS TELEFONOS DEL PROVEEDOR //\n\t\t$sql=\"\nSELECT \n\tcpt.IDPROVEEDOR, \n\tcpt.CODIGOAREA,\n\tcpt.IDTIPOTELEFONO,\n\tcpt.NUMEROTELEFONO,\n\tcpt.EXTENSION,\n\tcpt.IDTSP,\n\tcpt.COMENTARIO,\n\tcpt.PRIORIDAD,\n\tcd.DESCRIPCION NOMBRECODIGOAREA,\n\tctsp.DESCRIPCION NOMBRETSP,\n\tctt.DESCRIPCION NOMBRETIPOTELEFONO\nFROM\n\tcatalogo_proveedor_telefono cpt\n\tLEFT JOIN catalogo_ddn cd ON cd.DDN = cpt.CODIGOAREA\n\tLEFT JOIN catalogo_tsp ctsp ON ctsp.IDTSP = cpt.IDTSP\n\tLEFT JOIN catalogo_tipotelefono\tctt ON ctt.IDTIPOTELEFONO = cpt.IDTIPOTELEFONO\nWHERE\n\tcpt.IDPROVEEDOR ='$idproveedor'\n\tORDER BY cpt.PRIORIDAD;\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\tunset($this->telefonos);\n\t\twhile ($reg = $resul->fetch_object())\n\t\t{\n\t\t\tif ($reg->NUMEROTELEFONO!='')\n\t\t\t{\n\t\t\t\t$this->telefonos[$reg->PRIORIDAD-1]= array(\n\t\t\t\t'IDTIPOTELEFONO'=>$reg->IDTIPOTELEFONO,\n\t\t\t\t'CODIGOAREA' => $reg->CODIGOAREA,\n\t\t\t\t'NUMEROTELEFONO' => strip_tags($reg->NUMEROTELEFONO),\n\t\t\t\t'EXTENSION' => $reg->EXTENSION,\n\t\t\t\t'IDTSP' => $reg->IDTSP,\n\t\t\t\t'TELF_COMENTARIO'=>$reg->COMENTARIO,\n\t\t\t\t'NOMBRECODIGOAREA'=>$reg->NOMBRECODIGOAREA,\n\t\t\t\t'NOMBRETSP'=>$reg->NOMBRETSP,\n\t\t\t\t'NOMBRETIPOTELEFONO'=>$reg->NOMBRETIPOTELEFONO\n\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// CARGA DE LOS SERVICIOS DEL PROVEEDOR //\n\t\t$sql=\"\n\t\tSELECT \n\t\t\tIDSERVICIO\n\t\tFROM\n\t\t\tcatalogo_proveedor_servicio\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->servicios[]=$reg->IDSERVICIO;\n\n\t\t}\n\n\t\t// CARGA DE SOCIEDADES DEL PROVEEDOR\n\t\t$sql=\"\n\t\tSELECT \n\t\t\tIDSOCIEDAD\n\t\tFROM\n\t\t\tcatalogo_proveedor_sociedad\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->sociedades[$reg->IDSOCIEDAD]=$reg->IDSOCIEDAD;\n\n\t\t}\n\n\t\t// CARGA DE CONTACTOS //\n\t\t$sql=\"\n\t\tSELECT * \n\t\t\tFROM $this->catalogo.catalogo_proveedor_contacto\n\t\tWHERE\t\n\t\t\tIDPROVEEDOR ='$idproveedor'\n\t\t\tORDER BY RESPONSABLE DESC\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->contactos[$reg->IDCONTACTO]=$reg->APPATERNO.' '.$reg->APMATERNO.' '.$reg->NOMBRE;\n\t\t}\n\t\treturn;\n\t}", "public function read_tienda_proveedor($idp){\r\n\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, t.telefono_usuario, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\r\n INNER JOIN no_telefonos_usuario t on p.id_usuario = t.id_usuario\r\n where p.id_proveedor=$idp\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n }", "public function BuscarComprasProveedor() \n{\n\tself::SetNames();\t\t\n\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE proveedores.codproveedor = ? GROUP BY compras.codcompra\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL PROVEEDOR SELECCIONADO</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function store(ProveedorRequest $request){\n Proveedor::create($request->all());\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n }", "function getAllMco_proveedores()\n {\n $data_mco_proveedores = $this->gateway->getAllMco_proveedores();\n return $data_mco_proveedores;\n\n }", "static public function mdlIngresarProveedor($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, rfc, direccion, codpostal, ciudad, email, telefono, contacto, tel_contacto, email_contacto, ultusuario, estatus) VALUES (:nombre, :rfc, :direccion, :codpostal, :ciudad, :email, :telefono, :contacto, :tel_contacto, :email_contacto, :ultusuario, :estatus)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codpostal\", $datos[\"codpostal\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ciudad\", $datos[\"ciudad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":contacto\", $datos[\"contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tel_contacto\", $datos[\"tel_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email_contacto\", $datos[\"email_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ultusuario\", $datos[\"ultusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":estatus\", $datos[\"estatus\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function listar_proveedor(){\n $lugares=DB::select(\"SELECT nombre_lugar,id_lugar FROM lugar WHERE tipo_lugar='pa' order by nombre_lugar;\");\n $proveedores=DB::select(\"SELECT * FROM proveedor\");\n return view('portal/airucab-proveedores',compact('lugares'),compact('proveedores'));\n }", "public function getAllProveedores() {\n $proveedores = new CActiveDataProvider('ARTICULOPROVEEDOR', array(\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n $listaProveedores = array();\n //Obtener todos los items del proveedor\n foreach ($proveedores->getData() as $data) {\n //Obtener el proveedor de cada articulo Filtrando su id a traves del ID del proveedor de cada articulo del proveedor\n $proveedorDeArticulo = new CActiveDataProvider('PROVEEDORES', array(\n 'criteria' => array(\n 'condition' => 'id=' . $data['idProveedor'],\n ),\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //Se recorre el array para procesar la salida de datos del CActiveDataProvider y hacer un GetData() para obtener una matriz de datos\n foreach ($proveedorDeArticulo->getData() as $proveedorItem) {\n //Concatenar datos extra como el Nombre del proveedor\n $listaProveedores[$data['id']] = $data['Nombre'].' - Proveedor: '.$proveedorItem['Nombre'];\n }\n }\n return $listaProveedores;\n }", "public function show(Proveedor $proveedor)\n {\n \n $datos = $proveedor->datosGeneralesProvedor;\n \n $giro='';\n if($datos->giro_id==null){\n $giro='NO DEFINIDO';\n }else{\n $giros=Giro::where('id',$datos->giro_id);\n $giro=$giros->nombre;\n }\n\n $formaContacto='';\n if($datos->forma_contacto_id==null){\n $formaContacto='NO DEFINIDO';\n }else{\n $formaContactos=FormaContacto::where('id',$datos->forma_contacto_id);\n $formaContacto=$formaContactos->nombre;\n }\n \n\n \n \n return view('proveedores.datosGenerales.view',\n ['datos' => $datos, 'proveedor' => $proveedor, 'giro' => $giro, 'formaContacto' => $formaContacto]);\n\n }", "public function ActualizarProveedores()\n\t\t{\n\t\t\tself::SetNames();\n\t\t\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t\t\t{\n\t\t\t\techo \"1\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$sql = \" select * from proveedores where codproveedor != ? and ritproveedor = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array($_POST[\"codproveedor\"], $_POST[\"ritproveedor\"]) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" update proveedores set \"\n\t\t\t\t.\" ritproveedor = ?, \"\n\t\t\t\t.\" nomproveedor = ?, \"\n\t\t\t\t.\" direcproveedor = ?, \"\n\t\t\t\t.\" tlfproveedor = ?, \"\n\t\t\t\t.\" emailproveedor = ?, \"\n\t\t\t\t.\" contactoproveedor = ? \"\n\t\t\t\t.\" where \"\n\t\t\t\t.\" codproveedor = ?;\n\t\t\t\t\";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t\t\t$stmt->bindParam(6, $contactoproveedor);\n\t\t\t\t$stmt->bindParam(7, $codproveedor);\n\n\t\t\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE ACTUALIZADO EXITOSAMENTE\";\n\t\t\t\techo \"</div>\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"3\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "function get_entradas_proveedor_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and e.cproveedores_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function obtenerProveedorAtr($id,$field){\n\t\tswitch($field){\n\t\t\tcase \"nombre\":\n\t\t\t\t$field = \"text_razonSocial\";\n\t\t\tbreak;\n\t\t}\n\t\t$connect=conectar();\n\t\t$sql = \"SELECT \".$field.\" FROM proveedores WHERE id_proveedor = '$id'\";\n\t\t$result= mysql_fetch_array(mysql_query($sql,$connect));\n\t\treturn $result[$field];\n\t}", "function lista_proveedores($ubicacion,$idfamilia,$idservicio,$interno,$activo,$texto)\n\t{\n\n\t\t$condicion =\" WHERE 1 \";\n\n\t\tif ($idfamilia!='') $condicion.= \" AND cs.IDFAMILIA ='$idfamilia'\";\n\t\tif ($activo!='') $condicion.= \" AND (cp.ACTIVO = $activo)\";\n\t\tif ($idservicio!='') $condicion.= \" AND (cps.IDSERVICIO = '$idservicio' OR cps.IDSERVICIO ='0' )\";\n\t\tif ($interno!='') $condicion.= \" AND cp.INTERNO = '$interno' \";\n\t\tif ($texto!='') $condicion.= \" AND (cp.NOMBRECOMERCIAL like '%$texto%' OR cp.NOMBREFISCAL like '%$texto%')\";\n\n\t\t/* QUERY BUSCA LOA PROVEEDORES QUE PRESTAN EL SERVICIO*/\n\n\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcp.IDPROVEEDOR\n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio cps ON cps.IDPROVEEDOR = cp.IDPROVEEDOR \n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_servicio cs ON cs.IDSERVICIO = cps.IDSERVICIO\n\t\t\t\t$condicion\n\t\t\t\t\n\t\t\tGROUP BY cps.IDPROVEEDOR\n\t\t\torder by cp.INTERNO DESC, cp.NOMBRECOMERCIAL ASC\n\t\t\";\n\n\n\t\t\t//\techo $sql;\n\t\t\t\t$res_prv= $this->query($sql);\n\t\t\t\t$lista_prov= array();\n\t\t\t\t$prov = new proveedor();\n\t\t\t\t$poli = new poligono();\n\t\t\t\t$circulo = new circulo();\n\t\t\t\t$point= array('lat'=>$ubicacion->latitud,'lng'=>$ubicacion->longitud);\n\n\t\t\t\tif ($ubicacion->cveentidad1==0){\n\t\t\t\t\twhile ($reg=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg->IDPROVEEDOR][DISTANCIA]='';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile ($reg_prv=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$prov->carga_datos($reg_prv->IDPROVEEDOR);\n\t\t\t\t\t\t$distancia= geoDistancia($ubicacion->latitud,$ubicacion->longitud,$prov->latitud,$prov->longitud,$prov->lee_parametro('UNIDAD_LONGITUD'));\n\t\t\t\t\t\t$sw=0;\n\n\t\t\t\t\t\t$condicion=\"\";\n\t\t\t\t\t\t$condicion.= \" cuf.CVEPAIS = '$ubicacion->cvepais'\";\n\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD1 in ('$ubicacion->cveentidad1','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD2 in ('$ubicacion->cveentidad2','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD3 in ('$ubicacion->cveentidad3','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD4 in ('$ubicacion->cveentidad4','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD5 in ('$ubicacion->cveentidad5','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD6 in ('$ubicacion->cveentidad6','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD7 in ('$ubicacion->cveentidad7','0'))\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion.= \" OR (\"; \n\n\t\t\t\t\t\tif ($ubicacion->cveentidad1!='0') $condicion.= \" (cuf.CVEENTIDAD1 = '$ubicacion->cveentidad1')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad2!='0') $condicion.= \" AND (cuf.CVEENTIDAD2 = '$ubicacion->cveentidad2')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad3!='0') $condicion.= \" AND (cuf.CVEENTIDAD3 = '$ubicacion->cveentidad3')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad4!='0') $condicion.= \" AND (cuf.CVEENTIDAD4 = '$ubicacion->cveentidad4')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad5!='0') $condicion.= \" AND (cuf.CVEENTIDAD5 = '$ubicacion->cveentidad5')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad6!='0') $condicion.= \" AND (cuf.CVEENTIDAD6 = '$ubicacion->cveentidad6')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad7!='0') $condicion.= \" AND (cuf.CVEENTIDAD7 = '$ubicacion->cveentidad7')\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion .= \" )\";\n\n\t\t\t\t\t\t/* QUERY BUSCA LAS UNIDADES FEDERATIVAS QUE COINCIDAN CON LA UBICACION PARA CADA PROVEEDOR*/\n\t\t\t\t\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcpsxuf.IDPROVEEDOR, cpsxuf.IDUNIDADFEDERATIVA,cpsxuf.ARRAMBITO\n\t\t\tFROM\n\t\t\t $this->catalogo.catalogo_proveedor_servicio_x_unidad_federativa cpsxuf\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_unidadfederativa cuf ON $condicion\n\t\t\tWHERE \n\t\t\t\tcpsxuf.IDUNIDADFEDERATIVA = cuf.IDUNIDADFEDERATIVA\n\t\t\t\tAND\tcpsxuf.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\tand cpsxuf.IDSERVICIO IN ('$idservicio', '0')\n\t\t\t\tORDER BY 3 DESC\n\t\t\t\";\n\t\t\t\t\t//echo $sql;\n\t\t\t$res_prv_entid= $this->query($sql);\n\t\t\twhile ($reg_prv_entid= $res_prv_entid->fetch_object())\n\t\t\t{\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][AMBITO]=\t$reg_prv_entid->ARRAMBITO;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][TIPOPOLIGONO] ='ENTIDAD';\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][ID] = $reg_prv_entid->IDUNIDADFEDERATIVA;\n\t\t\t\tif ($reg_prv_entid->ARRAMBITO=='LOC') $sw=1; // si hubo algun entidad LOC se activa el sw\n\n\t\t\t}\n\t\t\tif (($ubicacion->latitud !='' )&& ($ubicacion->longitud!=''))\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxp.IDPROVEEDOR, cpsxp.IDPOLIGONO\n\t\t\t\tFROM \n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_poligono cpsxp\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxp.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\t\t\t\t$res_prv_poli= $this->query($sql);\n\t\t\t\twhile ($reg_prv_poli = $res_prv_poli->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t// verifica si el punto esta incluido en el poligono\n\t\t\t\t\t$in = pointInPolygon($point,$poli->lee_vertices($reg_prv_poli->IDPOLIGONO));\n\t\t\t\t\tif (( $in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][AMBITO]=\t$reg_prv_poli->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][TIPOPOLIGONO] ='POLIGONO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][ID] = $reg_prv_poli->IDPOLIGONO;\n\t\t\t\t\t\tif ($reg_prv_poli->ARRAMBITO=='LOC') $sw=1; // si hubo algun poligono LOC se activa el sw\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxc.IDPROVEEDOR, cpsxc.IDCIRCULO\n\t\t\t\tFROM\n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_circulo cpsxc\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxc.IDPROVEEDOR='$res_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\n\t\t\t\t$res_prv_circ = $this->query($sql);\n\t\t\t\twhile ($reg_prv_circ = $res_prv_circ->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t$circulo->leer($reg_prv_circ->IDCIRCULO);\n\t\t\t\t\t$vertices = $circulo->verticesCircle($circulo->latitud,$circulo->longitud,$circulo->radio,$circulo->idmedida);\n\t\t\t\t\t$in= pointInPolygon($point,$vertices);\n\n\t\t\t\t\tif (($in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][AMBITO]=\t$reg_prv_circ->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][TIPOPOLIGONO] ='CIRCULO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][ID] = $reg_prv_circ->IDCIRCULO;\n\t\t\t\t\t\tif ($reg_prv_circ->ARRAMBITO=='LOC') $sw=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // fin de la busqueda por LATITUD Y LONGITUD\n\n\n\n\n\n\t\t\t\t\t} // fin del while del proveedor\n\t\t\t\t}\n\n\t\t\t\t/* LEE LAS PROPORCIONES DE LA FORMULA DEL RANKING */\n\t\t\t\t$sql=\"\n\t\t\tSELECT \t\n\t\t\t\tELEMENTO,PROPORCION \n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proporciones_ranking\n\t\t\t\";\n\t\t\t$result=$this->query($sql);\n\n\t\t\twhile($reg = $result->fetch_object())\n\t\t\t$proporcion[$reg->ELEMENTO] = $reg->PROPORCION;\n\n\n\t\t\t$max_costo_int=0;\n\t\t\t$max_costo_ext=0;\n\n\n\t\t\t/* OBTENER DATOS PARA EVALUAR EL RANKING */\n\t\t\tforeach ($lista_prov as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\tSELECT \n\t\t\tIF (cp.ARREVALRANKING='SKILL',IF (cp.SKILL>0,cp.SKILL/100,0), IF (cp.CDE>0,cp.CDE/100,0)) VALRANKING,\n\t\t\tIF (cpscn.MONTOLOCAL IS NULL,0,cpscn.MONTOLOCAL) COSTO,\n\t\t\tIF (cp.EVALSATISFACCION>0,cp.EVALSATISFACCION/100,0) EVALSATISFACCION ,\n\t\t\tcp.EVALINFRAESTRUCTURA EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALFIDELIDAD EVALFIDELIDAD,\n\t\t\tcp.INTERNO\n\t\tFROM \n\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio_costo_negociado cpscn ON cpscn.IDPROVEEDOR = cp.IDPROVEEDOR AND cpscn.IDSERVICIO = '$idservicio' AND cpscn.IDCOSTO = 1\n\t\tWHERE \n\t\t\tcp.IDPROVEEDOR = '$idproveedor' \n\t\t\";\n\t\t//\t\t\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg=$result->fetch_object())\n\t\t{\n\t\t\tif ($reg->INTERNO){\n\t\t\t\t$temp_prov_int[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_int[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_int) $max_costo_int= $reg->COSTO;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp_prov_ext[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_ext[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_ext) $max_costo_ext= $reg->COSTO;\n\t\t\t}\n\t\t}\n\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores internos */\n\n\t\t\tforeach ($temp_prov_int as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_int))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_int[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores externos */\n\t\t\tforeach ($temp_prov_ext as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_ext))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_ext[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t$temp_prov_int = ordernarArray($lista_prov_int,'RANKING',1);\n\t\t\t$temp_prov_ext = ordernarArray($lista_prov_ext,'RANKING',1);\n\n\n\t\t\tforeach ($temp_prov_int as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_int[$idproveedor][RANKING];\n\t\t\t}\n\t\t\tforeach ($temp_prov_ext as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_ext[$idproveedor][RANKING];\n\t\t\t}\n\t\t\t/* DEVUELVE EL ARRAY*/\n\t\t\treturn $lista_ordenada ;\n\n\t}", "public function edit(Proveedor $proveedor)\n {\n\n $distritos = Distrito::all();\n $cb = Distrito::Findorfail($proveedor->distrito_id);\n $cbid = ($cb->id);\n $cbd = ($cb->distrito);\n\n return view('proveedores.edit', [\n 'proveedor' => $proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n \n }", "public function read_alltiendas(){\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n\r\n }", "public function obtenerProveedorOrden($codigo_proyecto){\n\t\t$query='SELECT c.alm_proy_cod,p.alm_prov_codigo_int, p.alm_prov_nombre \n\t\t\t\tFROM alm_ord_compra_cab c INNER JOIN alm_proveedor p ON c.alm_prov_codigo=p.alm_prov_codigo_int\n\t\t\t\tWHERE c.alm_proy_cod=\"'.$codigo_proyecto.'\"\n\t\t\t\tGROUP BY p.alm_prov_codigo_int';\n\t\treturn $this->mysql->query($query);\n\t}", "public function __construct() {\n $this->adminProveedorModelo = new adminProveedorModelo();\n }", "function obtenerPedido ($cedulaCliente){\n\t\t$x = $this->pdo->prepare('SELECT * FROM pedido where cedulaCliente = ?');\n\t\t$x->execute(array($cedulaCliente));\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function existeProveedor($codigo)\n {\n \tif($this->gateway->existMco_proveedores($codigo) == 1){ \n return ERROR_DATO_EXISTE;\n }\n else\n {\n return EXITO_OPERACION_REALIZADA;\n }\n }", "public function agregar_proveedor(Request $request)\n {\n if(!session('Usuario')) {\n return 'session';\n }\n if(\n empty( $request->input('proveedor_nombre') ) ||\n empty( $request->input('proveedor_rfc') ) ||\n empty( $request->input('proveedor_correo') ) ||\n empty( $request->input('proveedor_telefono') )\n ) {\n return 'empty';\n }\n\n $proveedor = new Proveedor();\n\n $proveedor->RFC = $request->input('proveedor_rfc');\n $proveedor->Nombre = $request->input('proveedor_nombre');\n $proveedor->Telefono = $request->input('proveedor_telefono');\n $proveedor->Email = $request->input('proveedor_correo');\n $proveedor->Adeudo = 0;\n $proveedor->estatus = 1;\n $proveedor->idUsuario = session('idUsuario');\n\n if(!$proveedor->save()) {\n return 'error';\n }\n return 'true';\n }", "function consultar_proveedores(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('mantenciones_proveedores');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function createProveedores(Request $request){\n $accion = 'M01';\n $IdProvee = null; \n $CodEmp = $request->get('CodEmp'); \n $TipoDoc = $request->get('TipoDoc'); \n $NomTipDoc = $request->get('NomTipDoc'); \n $NumDoc = $request->get('NumDoc'); \n $Nombre = $request->get('Nombre'); \n $NombComercial = $request->get('NombComercial'); \n $idPais = $request->get('IdPais'); \n $idDepa = $request->get('IdDepartamento');\n $idProv = $request->get('IdProvincia');\n $idDist = $request->get('IdDistrito'); \n $DirPer = $request->get('Direccion'); \n $Telefono = $request->get('Telefono'); \n $Email = $request->get('Email'); \n $Activo = null; \n\n $proveedores = DB::select('call Man_zg_proveedores(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'\n ,array(\n $accion,\n $IdProvee,\n $CodEmp, \n $TipoDoc, \n $NomTipDoc, \n $NumDoc, \n $Nombre, \n $NombComercial, \n $idPais, \n $idDepa,\n $idProv,\n $idDist, \n $DirPer, \n $Telefono, \n $Email, \n $Activo\n \n ));\n return response()->json($request, 201);\n // return response()->json(['proveedor creado'=>$request], 201);\n }", "public function listado(){\n //return view('proveedores.listado', ['proveedores' => Proveedor::all()]);\n return Provincia::find(1)->with(['Pais'])->first(); \n }", "public function create($proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.create', ['proveedor' => $proveedor, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "private function cambiarProveedor() {\n\n $ok = false;\n\n $em = new EntityManager($this->form->getConection());\n if ($em->getDbLink()) {\n\n // Cambiar factura\n $filtro = \"NumeroFactura='{$this->request['numeroFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update frecibidas_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $okFactura = $em->getAffectedRows();\n\n if ($okFactura) {\n \n $this->values['mensaje'][] = \"Se ha cambiado \" . $okFactura . \" factura.\";\n // Cambiar pedido/s\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update pedidos_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nPedidos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nPedidos . \" pedidos.\";\n \n // Cambiar recibos\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update recibos_proveedores set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nRecibos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nRecibos . \" recibos.\";\n \n }\n }\n\n $em->desConecta();\n unset($em);\n }", "public function edit($proveedor)\n { \n $proveedor = Proveedor::find($proveedor);\n $datos = $proveedor->generales;\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.edit', ['proveedor' => $proveedor, 'datos' => $datos, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "function obtenerCliente ($cedula){\n\t\t$x = $this->pdo->prepare('SELECT * FROM cliente where cedula = ?');\n\t\t$x->execute(array($cedula));\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function store()\n\t{\n\t\t$authuser = Auth::user();\n\t\t$rules = array(\n\t\t\t'proveedor_tipo' => 'not_in:NA',\n\t\t\t'nombre_usuario' => 'required',\n\t\t\t'nombre' => 'required',\n\t\t\t//'direccion' => 'required',\n\t\t\t//'telefono' => 'required',\n\t\t\t//'facebook' => 'required',\n\t\t\t//'twitter' => 'required',\n\t\t\t//'otro_sns' => 'required',\n\t\t\t'longitud' => 'required|numeric',\n\t\t\t'latitud' => 'required|numeric',\n\t\t\t'introduccion' => 'required',\n\t\t\t'descripcion' => 'required',\n\t\t\t'vision' => 'required',\n\t\t\t'productos' => 'required',\n\t\t\t'imagen_intro' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_descripcion' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_vision' => 'mimes:png,gif,jpeg|max:20000',\t\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\t\t\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('vistausuario/proveedor/create')\n\t\t\t\t->withErrors($validator)->withInput();\n\t\t} else {\n\t\t\n\t\t$proveedores = new Proveedor;\n\t\t$proveedores_detalle = new ProveedorDetalle;\n\n\t\t$nombreDeUsuario = Input::get('nombre_usuario');\n\n\t\t$proveedores->id=0;\n\t\t$proveedores->proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo');\n\t\t$proveedores->nombre_usuario=Input::get('nombre_usuario');\n\t\t$proveedores->nombre=Input::get('nombre');\n\t\t$proveedores->direccion=Input::get('direccion');\n\t\t$proveedores->telefono=Input::get('telefono');\n\t\t$proveedores->facebook=Input::get('facebook');\n\t\t$proveedores->twitter=Input::get('twitter');\n\t\t$proveedores->otro_sns=Input::get('otro_sns');\n\t\t$proveedores->longitud=Input::get('longitud');\n\t\t$proveedores->latitud=Input::get('latitud');\n\t\t$proveedores->habilitar = 0;\n\t\t$proveedores->solicitar_premium= 0;\n\t\t$proveedores->usuario_id = $authuser->id;\n\t\t$proveedores->save();\n\n\t\t$idproveedor = $proveedores->id;\n\n\t\t$proveedores_detalle->id=0;\n\t\t$proveedores_detalle->proveedores_idproveedor=$idproveedor;\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo_idproveedor_tipo');\n\t\t$proveedores_detalle->introduccion=Input::get('introduccion');\n\t\t$proveedores_detalle->descripcion=Input::get('descripcion');\n\t\t$proveedores_detalle->vision=Input::get('vision');\n\t\t$proveedores_detalle->productos=Input::get('productos');\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo = Input::get('proveedor_tipo');\n\n\t\tif(!File::exists('images/proveedores/'.$nombreDeUsuario)) {\n\t\t $result = File::makeDirectory('images/proveedores/'.$nombreDeUsuario, 0777);\n\t\t}\n\n\t\t$imagen_intro = Input::file('imagen_intro');\n\t\t$file = $imagen_intro;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t\t$id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_intro=$filename.'.'.$extension;\n\t\t} else {\n\t\t $proveedores_detalle->imagen_intro = '';\n\t\t}\n\t\t\n\n\t\t$imagen_descripcion = Input::file('imagen_descripcion');\n\t\t$file = $imagen_descripcion;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_descripcion=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_descripcion='';\n\t\t}\t\n\t\t\n\n\n\t\t$imagen_vision = Input::file('imagen_vision');\n\t\t$file = $imagen_vision;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_vision=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_vision='';\n\t\t}\t\t\t\t\n\t\t\n\t\t$proveedores_detalle->save();\n\n\t\treturn Redirect::to(\"vistausuario/\")->with(array('usuarioimg'=>$authuser->imagen, 'usuarionombre'=>$authuser->nombre, 'usuarioid'=>$authuser->id));\t\t\n\t\t}\n\t}", "public function RegistrarProveedores()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select ritproveedor from proveedores where ritproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"ritproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into proveedores values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t$stmt->bindParam(6, $contactoproveedor);\n\n\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE REGISTRADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"3\";\n\t\texit;\n\t}\n}", "function formularioSeleccionarProveedor() {\nrequire_once \"conexionsql.php\";\nrequire_once \"formularios.php\";\n$conProveedor= \"SELECT ID_PROVEEDOR,PROVEEDOR,CONTACTOS from proveedor WHERE STATUS_ACTIVO = '1' ORDER BY PROVEEDOR ASC\";\n\t//Campo Proveedor\n\t$proveedor= new campoSeleccion(\"selProveedor\",\"formularioCampoSeleccion\",\"$_POST[selProveedor]\",\"onChange\",\"\",$conProveedor,\"--PROVEEDOR--\",\"\");\n\t$selProveedor=$proveedor->retornar();\n\necho \"<form name=\\\"frmEquipo\\\" method=\\\"post\\\" action=\\\"\\\">\";\n\techo \"<input name=\\\"funcion\\\" type=\\\"hidden\\\" value=\\\"1\\\">\";\n\n\techo \"<table class=\\\"formularioTabla\\\"align=center width=\\\"100\\\" border=\\\"0\\\">\";\n\t\techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaTitulo\\\" colspan=\\\"2\\\">ELIMINAR PROVEEDOR</td>\n \t\t\t\t</tr>\";\n\t echo \"<tr>\";\n\t\t\techo \"<tr align=center></tr>\n \t\t\t\t</tr>\n<tr align=center><td valign=top class=\\\"formularioCampoTitulo\\\" ><p align=center >PROVEEDOR<br>$selProveedor<br></tr>\";\n\t \techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaBotones\\\" colspan=\\\"2\\\"><input name=\\\"btnLimpiar\\\" type=\\\"submit\\\" value=\\\"ELIMINAR\\\">\n\t\t\t</td>\n \t\t</tr>\";\necho \"</table>\";\necho \"</form>\";\t\t\t\t\t\n}", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }", "public function setProducto($pro){ $this->producto = $pro;}", "function Mco_proveedoresManager()\n {\n $this->gateway = Application::getDataGateway(\"mco_proveedores\");\n }", "public function edit(Proveedor $proveedor)\n {\n if ($proveedor->estado == 'activo') {\n $proveedor->estado = 'inactivo';\n }else{\n \n $proveedor->estado = 'activo';\n \n } \n \n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('pagina','proveedor');//llamar a la vista del provee\n }", "public function get_reporte_proveedor()\n {\n\t\tif($this->input->post('NombreProveedor_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('NombreProveedor', $this->input->post('NombreProveedor_ajaxreporte', TRUE));\n\t\t}\n\t\tif($this->input->post('IdFiscal_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('IdFiscal', $this->input->post('IdFiscal_ajaxreporte', TRUE));\n\t\t}\n\t\tif($this->input->post('FechaRegistro_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('FechaRegistro', $this->input->post('FechaRegistro_ajaxreporte', TRUE));\n\t\t}\n\n\t\t$this->db->from(\"proveedor\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n }", "public function proveedorTraslado(){\n \treturn $this->belongsTo(ProveedorTraslado::class,'proveedor_traslado_id');\n }", "public function store(StoreProveedorRequest $request)\n {//['nombre','estado','celular','direccion']\n $prove = new Proveedor();\n $prove->nombre = $request->input('Nombre');\n $prove->estado = 'activo';\n $prove->celular = $request->input('Telefono');\n $prove->direccion = $request->input('Direccion');\n $prove->save();\n $proveedores = Proveedor::paginate(10);\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Guardado exitoso...!')->with('pagina','proveedor');\n }", "function ListaProveedores() {\n\n\t//obtiene el id del usuario\n\t$sql = \"SELECT * FROM proveedor WHERE estado = 'ACTIVO'\";\n$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Ok\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de proveedores!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}", "public function show(ProveedoresModel $proveedor)\n {\n return view('Proveedor.Proveedor', $proveedor);\n }", "public function busca_provincia()\n\t{\n\t\tif($this->input->post('pais_id'))\n\t\t{\n\t\t\techo $this->Select_Dinamico_Model->busca_provincia($this->input->post('pais_id'));\n\t\t}\n\t}", "public function mostrar()\n {\n $clientes=$this->db->get('tab_cliente'); //que es lo mismo que: SELECT * FROM tab_proveedores\n return $clientes->result();\n }", "function addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 0){\n $PVE_ID = $this->gateway->maxId();\n $result = $this->gateway->addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n { return $this->updateMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n \t//return ERROR_DATO_EXISTE;\n }\n }", "public function readall(){ //read\r\n\r\n $sql=\"select * from proveedor\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n }", "function leer_telefonos($idproveedor){\n\t\t$sql=\"\n\t\tSELECT\n\t\t\tcpt.IDPROVEEDOR,ctsp.DESCRIPCION,\n\t\t\tcpt.CODIGOAREA,\n\t\t\tcpt.NUMEROTELEFONO\n\t\tFROM\n\t\t$this->catalogo.catalogo_proveedor_telefono cpt,\n\t\t$this->catalogo.catalogo_tsp ctsp\n\t\tWHERE\n\t\t\tcpt.IDTSP = ctsp.IDTSP\n\t\t\tAND cpt.IDPROVEEDOR='$idproveedor'\n\t\t\t\";\n\t\t$result = $this->query($sql);\n\t\twhile($reg= $result->fetch_object())\n\t\t{\n\t\t\t$telef[$reg->IDTELEFONO] = array(\n\t\t\t'TSP'=>$reg->DESCRIPCION,\n\t\t\t'CODIGOAREA'=>$reg->CODIGOAREA,\n\t\t\t'NUMEROTELEFONO'=>$reg->NUMEROTELEFONO\n\t\t\t);\n\t\t}\n\t\treturn $telef;\n\t}", "function guardar_producto_proceso($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t//$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tprd_productos_procesos\n\t\t\t\t\t\t(id_producto, id_proceso)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_producto'].\",\".$datos['id_proceso'].\")\";\n\t \t//return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "public function getProveedorName($id)\n {\n //Extraer el proveedor del articulo proveedor\n $articuloProveedorProvider = new CActiveDataProvider('ARTICULOPROVEEDOR', array(\n 'criteria' => array(\n 'condition' => 'id='.$id,\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //Extraer el proveedor del articulo proveedor\n $dProvider = $articuloProveedorProvider->getData();\n $proveedoresProvider = new CActiveDataProvider('PROVEEDORES', array(\n 'criteria' => array(\n 'condition' => 'id='.$dProvider[0]['idProveedor'],\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //retornar el valor\n $return = $proveedoresProvider->getData();\n return $return[0]['Nombre'];\n }", "public function create()\n {\n $cbd='---Seleccione Distrito---';\n $cbid=\"\";\n $distritos = Distrito::all();\n return view('proveedores.create', [\n 'proveedor' => new Proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n }", "public function getPRODUTOS()\n {\n return $this->hasOne(Produto::className(), ['ID' => 'PRODUTOS_ID']);\n }", "public function buscarCep($objeto){\r\n\t\t$sql = 'SELECT * FROM cep\r\n\t\t\t\t\tINNER JOIN logradouro \tON cep.logradouroID\t= logradouro.logradouroID \r\n\t\t\t\t\tINNER JOIN cidade \t\tON cidade.cidadeId\t= logradouro.cidadeId\r\n\t\t\t\t\tINNER JOIN estado \t\tON estado.estadoId\t= cidade.estadoId\r\n\t\t\t\t\tINNER JOIN pais \t\tON pais.paisId \t\t= estado.paisId\r\n\t\t\t\tWHERE cep.cepNumero = '. $objeto -> getCepNumero();\r\n\t\t$query = mysql_query($sql);\r\n\t\t$qtde = mysql_affected_rows();\r\n\t\t\r\n\t\tif ($qtde == 1) {\r\n\t\t\twhile ($row = mysql_fetch_object($query)){\r\n\t\t\t\t// setado o resultado no objeto\r\n\t\t\t\t$objeto -> setcepId($row -> cepId);\r\n\t\t\t\t$objeto -> setCepNumero($row -> cepNumero);\r\n\t\t\t\t$objeto -> setLogradouroId($row -> logradouroId);\r\n\t\t\t\t$objeto -> setLogradouroNome($row -> logradouroNome);\r\n\t\t\t\t$objeto -> setLogradouroBairro($row -> logradouroBairro);\r\n\t\t\t\t$objeto -> setCidadeId($row -> cidadeId);\r\n\t\t\t\t$objeto -> setCidadeNome($row -> cidadeNome);\r\n\t\t\t\t$objeto -> setEstadoId($row -> estadoId);\r\n\t\t\t\t$objeto -> setEstadoNome($row -> estadoNome);\r\n\t\t\t\t$objeto -> setEstadoUf($row -> estadoUf);\r\n\t\t\t\t$objeto -> setPaisId($row -> paisId);\r\n\t\t\t\t$objeto -> setPaisNome($row -> paisNome);\r\n\t\t\t\treturn $objeto;\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public function createNumeroDocumentoProveedor(Request $request){\n\n if($request->user()->can('add_proveedor')) {\n\n $documentoProveedor = DocumentoProveedor::create([\n 'numero' => $request->numero,\n 'tipodocumento_id' => $request->tipodocumento_id,\n 'user_id' => $request->user()->id, //no request\n 'proveedor_id' => $request->provedor_id //no request\n ]);\n if (!$request) {\n ResponseController::set_errors(true);\n ResponseController::set_messages('No has enviado inforamcion para agregar numero de documento');\n return ResponseController::response('BAD REQUEST');\n }\n\n ResponseController::set_messages('Proveedor creado');\n ResponseController::set_data(['proveedor'=>$documentoProveedor->id]);\n return ResponseController::response('OK');\n }\n ResponseController::set_errors(true);\n ResponseController::set_messages('Usuario sin permiso');\n return ResponseController::response('UNAUTHORIZED');\n\n }", "public function dataProveedoresAnual ($id_prod, $id_prov, $fecha_ap_ts) {\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov FROM \n rdj_proveedores pr WHERE pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n \n\n $prov[\"fecha_ap_ts\"] = $fecha_ap_ts;\n\n $prov[\"pedidosCump\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='e'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosCump\"]) == 0) {\n $prov[\"pedidosCump\"] = 0;\n }\n else {\n $prov[\"pedidosCump\"] = $prov[\"pedidosCump\"][0]->count;\n }\n \n $prov[\"pedidosRec\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='cprov'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosRec\"]) == 0) {\n $prov[\"pedidosRec\"] = 0;\n }\n else {\n $prov[\"pedidosRec\"] = $prov[\"pedidosRec\"][0]->count;\n }\n\n $prov[\"pedidosPend\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='p'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosPend\"]) == 0) {\n $prov[\"pedidosPend\"] = 0;\n }\n else {\n $prov[\"pedidosPend\"] = $prov[\"pedidosPend\"][0]->count;\n }\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "public function pedidos($id)\r\n\t{\r\n\t\t//Carga los datos de pedidos, crear tabla de pedidos\r\n\t\t$this->pedidos = (New Pedidos)->find_by_proveedor_id($id);\r\n\t}", "public function update(Request $request, ProveedoresModel $proveedor)\n {\n //\n }", "function leer_horario($idproveedor){\n\t\t$sql=\"SELECT * FROM catalogo_proveedor_horario WHERE IDPROVEEDOR = '$idproveedor'\";\n\t\t//\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg = $result->fetch_object())\n\t\t{\n\t\t\t$this->horario = array(\n\t\t\t'HORAINICIO'=>$reg->HORAINICIO,\n\t\t\t'HORAFINAL'=>$reg->HORAFINAL,\n\t\t\t'DOMINGO'=>$reg->DOMINGO,\n\t\t\t'LUNES'=>$reg->LUNES,\n\t\t\t'MARTES'=>$reg->MARTES,\n\t\t\t'MIERCOLES'=>$reg->MIERCOLES,\n\t\t\t'JUEVES'=>$reg->JUEVES,\n\t\t\t'VIERNES'=>$reg->VIERNES,\n\t\t\t'SABADO'=>$reg->SABADO,\n\t\t\t);\n\t\t}\n\t\treturn;\n\t}" ]
[ "0.7329527", "0.72033685", "0.7023036", "0.6996642", "0.68944323", "0.6864452", "0.6864452", "0.6837825", "0.6765021", "0.6744742", "0.6634423", "0.6591746", "0.6589306", "0.6555631", "0.6538108", "0.65228534", "0.65064824", "0.64948326", "0.6491467", "0.64854574", "0.6459801", "0.6399785", "0.6399714", "0.63902706", "0.63605595", "0.6326398", "0.63260764", "0.6319836", "0.630716", "0.62775993", "0.62479854", "0.6206133", "0.6190272", "0.61856604", "0.6135541", "0.6128014", "0.60751516", "0.6064977", "0.6048757", "0.60467887", "0.60160434", "0.6012825", "0.60090446", "0.5995525", "0.59898305", "0.5975726", "0.5961262", "0.59130037", "0.5909913", "0.5898117", "0.58907753", "0.58901656", "0.5882615", "0.58745676", "0.58376974", "0.58075374", "0.5802086", "0.5797622", "0.57714796", "0.5760669", "0.5740953", "0.5730665", "0.5707226", "0.57019377", "0.56970125", "0.56961906", "0.56932414", "0.56495285", "0.5639636", "0.56393707", "0.56357133", "0.5625368", "0.56229097", "0.5619167", "0.5606155", "0.5603144", "0.55837566", "0.558043", "0.5576304", "0.5574039", "0.55706096", "0.5562659", "0.5553224", "0.5541679", "0.55371004", "0.55202556", "0.55110645", "0.55003583", "0.54979163", "0.54918325", "0.5483797", "0.5476809", "0.5473275", "0.54701304", "0.54532266", "0.5448782", "0.5446586", "0.54321766", "0.54140246", "0.5400353" ]
0.7667254
0
This function calls the parent data and returns the template to werde_deletecache_admin.tpl
Эта функция вызывает родительские данные и возвращает шаблон для werde_deletecache_admin.tpl
public function render() { parent::render(); return "werde_deletecache_admin.tpl"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_admin_template($data = null){\n\t \t\n\t \t$this->load->view('template/admin_template_v', $data);\n\t }", "function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }", "function modifyTemplate() {\n if (!$this->isAdmin()) {\n return $this->showStart();\n }\n $entity = 'Template';\n if (isset($_REQUEST['entity'])) {\n $entity = strtolower($_REQUEST['entity']);\n \n }\n $plural = $this->pluralise($entity);\n\n if (isset($_REQUEST['parent_entity']) && isset($_REQUEST['parent_id'])){\n $parent_entity = $_REQUEST['parent_entity'];\n $parent_id = $_REQUEST['parent_id'];\n $conditions = array(strtolower($parent_entity) . '_id' => $parent_id);\n $edit_addition = 'parent_entity='.$parent_entity.'&parent_id='.$parent_id;\n $add_addition = '&' . $edit_addition;\n }\n else {\n $conditions = null;\n $edit_addition = \"id=\";\n $add_addition = \"\";\n }\n\n try {\n $template_list = $this->getListFromDB(strtolower($entity . '_view'), $conditions, null);\n /* make sure unimelb templates are visible in view */\n $properties = array();\n if(count($template_list) > 0 ){\n $properties1 = array_keys(get_object_vars($template_list[0]));\n $properties = str_replace('_', ' ', $properties1);\n \n \n }\n }\n catch(Exception $e) {\n return $this->handle_errors($e);\n }\n $editurl = $this->action . \"?mode=update_item&entity=$entity&\" . $edit_addition ;\n $deleteurl = $this->action . \"?mode=delete&entity=$entity\" . $add_addition;\n $addurl = $this->action . \"?mode=add_item&entity=$entity\" . $add_addition;\n /* screen output*/\n $t = 'admin-list.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $this->error,\n\t\t\t 'entity' => $entity,\n\t\t\t 'properties' => $properties,\n\t\t\t 'columns' =>$properties1,\n\t\t\t 'item_list' => $template_list,\n\t\t\t 'addurl' => $addurl,\n\t\t\t 'editurl' => $editurl,\n\t\t\t 'action' => $deleteurl,\n\t\t\t 'plural' => $plural\n\t\t\t ));\n return $output;\n}", "public function view() {\n\t\t\tif ($_SERVER['REQUEST_METHOD'] != 'POST') {\n\t\t\t\t$this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST;\n\t\t\t\t$this->_Result['error'] = __('This page accepts posts only');\n\t\t\t\t$this->setHttpStatus($this->_Result['status']);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// _context[0] => entry id to delete\n\t\t\t// _context[1] => fieldId\n\t\t\t// _context[2] => current entry id (parent of entry id to delete)\n\t\t\tif (!is_array($this->_context) || empty($this->_context)) {\n\t\t\t\t$this->_Result['error'] = __('Parameters not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) < self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Not enough parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) > self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Too many parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry ID\n\t\t\t$rawToDeleteEntryId = MySQL::cleanValue($this->_context[0]);\n\t\t\t$toDeleteEntryId = General::intval($rawToDeleteEntryId);\n\t\t\tif ($toDeleteEntryId < 1) {\n\t\t\t\t$this->_Result['error'] = __('No entry no found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent field exists\n\t\t\t$parentFieldId = General::intval(MySQL::cleanValue($this->_context[1]));\n\t\t\tif ($parentFieldId < 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent id not valid');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$parentField = FieldManager::fetch($parentFieldId);\n\t\t\tif (!$parentField || empty($parentField)) {\n\t\t\t\t$this->_Result['error'] = __('Parent field not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry ID\n\t\t\t$rawEntryId = MySQL::cleanValue($this->_context[2]);\n\t\t\t$entryId = General::intval($rawEntryId);\n\t\t\tif ($entryId < 1) {\n\t\t\t\t$this->_Result['error'] = sprintf(\n\t\t\t\t\t__('Parent entry id `%s` not valid'),\n\t\t\t\t\t$rawEntryId\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry exists\n\t\t\t$entry = EntryManager::fetch($entryId);\n\t\t\tif ($entry == null || count($entry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($entry)) {\n\t\t\t\t$entry = $entry[0];\n\t\t\t}\n\t\t\tif ($entry->get('section_id') != $parentField->get('parent_section')) {\n\t\t\t\t$this->_Result['error'] = __('Field and entry do not belong together');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry exists\n\t\t\t$toDeleteEntry = EntryManager::fetch($toDeleteEntryId);\n\t\t\tif ($toDeleteEntry == null || count($toDeleteEntry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($toDeleteEntry)) {\n\t\t\t\t$toDeleteEntry = $toDeleteEntry[0];\n\t\t\t}\n\t\t\t\n\t\t\t// Validate entry is not linked anywhere else\n\t\t\tif (!isset($_REQUEST['no-assoc'])) {\n\t\t\t\t//$toDeleteSection = SectionManager::fetch($toDeleteEntry->get('section_id'));\n\t\t\t\t//$toDeleteAssoc = $toDeleteSection->fetchChildAssociations(false);\n\t\t\t\t$toDeleteAssoc = SectionManager::fetchChildAssociations($toDeleteEntry->get('section_id'), false);\n\t\t\t\t//var_dump($toDeleteAssoc);die;\n\t\t\t\t// TODO: find if the toDeleteEntry is linked or not.\n\t\t\t\tif (count($toDeleteAssoc) > 1) {\n\t\t\t\t\t$this->_Result['assoc'] = true;\n\t\t\t\t\t$this->_Result['error'] = __('Entry might be link elsewhere. Do you want to continue?');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Delete the entry\n\t\t\tif (!EntryManager::delete($toDeleteEntryId)) {\n\t\t\t\t$this->_Result['error'] = __('Could not delete the entry');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->_Result['entry-id'] = $entryId;\n\t\t\t$this->_Result['ok'] = true;\n\t\t}", "public function clearCacheCmd($params, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parent) {\n\t\tif ($parent->admin || is_object($parent->BE_USER) && $parent->BE_USER->getTSConfigVal('options.clearCache.pages')) {\n\t\t\tswitch ($params['cacheCmd']) {\n\t\t\t\tcase 'pages':\n\t\t\t\tcase 'all':\n\t\t\t\t\t$this->varnishCacheMgm->clearAllCache();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}", "public function ajaxClearCache() {\n $this->clearCache();\n $this->_sThisTemplate = \"suaboclearcache_popup.tpl\";\n }", "public function perform( $data = FALSE )\n {\n $this->model->action( 'options','deletePublicCache');\n }", "public function perform( $data = FALSE )\n {\n $this->model->action( 'options','deletePublicCache');\n }", "function outputReloadParentCode()\n {\n global $application;\n\n if ($this -> _ReloadParentWindow != 1)\n return '';\n\n return $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'reload-parent-js.tpl.html',\n array()\n );\n }", "public function delete()\n\t{\n\t\t/* Check permission */\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'template_delete' );\n\n\t\t/* Make sure the user confirmed the deletion */\n\t\t\\IPS\\Request::i()->confirmedDelete();\n\n\t\t$key = \\IPS\\Request::i()->t_key;\n\t\t$return = array(\n\t\t\t'template_content' => NULL,\n\t\t\t'template_id' \t => NULL\n\t\t);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\\IPS\\cms\\Templates::load( $key )->delete();\n\t\t\t\n\t\t\t/* Now reload */\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$template = \\IPS\\cms\\Templates::load( $key );\n\t\t\t\t\n\t\t\t\t$return['template_location'] = $template->location;\n\t\t\t\t$return['template_content'] = $template->content;\n\t\t\t\t$return['template_id']\t\t = $template->id;\n\t\t\t\t$return['InheritedValue'] = ( $template->user_added ) ? 'custom' : ( $template->user_edited ? 'changed' : 0 );\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch( \\OutOfRangeException $ex )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '3T285/4', 500, '' );\n\t\t}\n\n\t\t/* Clear guest page caches */\n\t\t\\IPS\\Data\\Cache::i()->clearAll();\n\n\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $return );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=cms&module=pages&controller=templates' ), 'completed' );\n\t\t}\n\t}", "public function cache_delete()\n {\n }", "function call_delete() {\n parent::call_delete();\n }", "public function cleanup() {\r\n $this->clearCache();\r\n $fields = array('id', 'description', 'locked', 'category');\r\n array_push($fields,($this->classKey == 'modTemplate' ? 'templatename' : 'name'));\r\n return $this->success('',$this->object->get($fields));\r\n }", "public function invoice_product_delete()\n {\n $data['nestedView']['pageTitle'] = 'Delete Invoice Product';\n $data['nestedView']['heading'] = \"Delete Invoice Product\";\n $data['nestedView']['cur_page'] = 'Delete Invoice Product';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_product_delete_view',$data);\n }", "public function run(){\n // only for User frontend; cache disable for admin panel\n if($this->tpl == 'menu.php'){\n $menu = Yii::$app->cache->get('menu');\n if($menu) return $menu;\n }\n\n\n// if not, get menu from DB\n// indexBy('id') - make 'key' = 'id' in Array\n// get data from DB\n $this->data = Category::find()->indexBy('id')->asArray()->all();\n// Create Menu Tree\n $this->tree = $this->getTree();\n// Create Html Template for Menu\n $this->menuHtml = $this->getMenuHtml($this->tree);\n\n// set cache, write menu to cache\n if($this->tpl == 'menu.php'){\n Yii::$app->cache->set('menu', $this->menuHtml, 60); // 60 = 1min\n }\n\n return $this->menuHtml;\n\n }", "protected function _content_template() {\n\t}", "protected function content_template() {}", "protected function content_template() {}", "public function delete()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$templateId = $this->getId();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates_data', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$this->clearCache();\n\t}", "function admin_email_template() {\n\t\t$this->layout=\"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$staticdatas = $this->EmailTemplate->find('all');\n\t\t//print_r($staticdatas);die;\n\t\t$this->set('manageClass','selected');\n\t\t$this->set(\"staticdatas\",$staticdatas);\n\t}", "protected function content_template() {\n\t}", "function generateTemplateVariableHTML($rec,$cntr) {\n global $_TABLES,$_CONF;\n\n $p = new Template($_CONF['path_layout'] . 'nexflow/admin');\n $p->set_file ('variables','template_variables.thtml');\n $p->set_file ('variable_rec','template_variable_record.thtml');\n\n $p->set_var('template_id',$rec);\n $p->set_var('cntr',$cntr);\n\n $sql = \"SELECT * FROM {$_TABLES['nftemplatevariables']} WHERE nf_templateID='{$rec}' ORDER BY id\";\n $query = DB_Query($sql);\n $numrows = DB_numrows($query);\n if ($numrows > 0) {\n $j=1;\n $p->set_var('show_vars','');\n $p->set_var('vdivid','');\n\n while ( $A = DB_fetchArray($query) ) {\n $edit_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"edit\\\",{$rec},{$cntr},{$j});'\\\">Edit</a>&nbsp;]\";\n $del_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"delete\\\",{$rec},{$cntr},{$j});'\\\">Delete</a>&nbsp;]\";\n $p->set_var('variable_name',$A['variableName']);\n $p->set_var('variable_value',$A['variableValue']);\n $p->set_var('var_id',$j);\n $p->set_var('edit_link',$edit_link);\n $p->set_var('delete_link',$del_link);\n if ($j == 1) {\n $p->parse('template_variable_records','variable_rec');\n } else {\n $p->parse('template_variable_records','variable_rec',true);\n }\n $j++;\n }\n } else {\n $p->set_var('show_vars','none');\n $p->set_var('vdivid',\"vars{$cntr}\");\n $p->set_var('template_variable_records','');\n }\n $p->parse ('output', 'variables');\n $html = $p->finish ($p->get_var('output'));\n $html = htmlentities($html);\n\n return $html;\n}", "function dispEapprvDeleteComment(){\n\t\t$comment_srl = Context::get('comment_srl');\n\n\t\t// if the comment exists, then get the comment information\n\t\tif($comment_srl)\n\t\t{\n\t\t\t$oCommentModel = getModel('comment');\n\t\t\t$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);\n\t\t}\n\t\t\n\t\t\t\t// if the comment is not granted, then back to the password input form\n\t\tif(!$oComment->isGranted())\n\t\t{\n\t\t\treturn $this->setTemplateFile('input_password_form');\n\t\t}\n\n\t\tContext::set('oComment',$oComment);\n\t\t/**\n\t\t * add JS filters\n\t\t **/\n\t\tContext::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml');\n\t\t$this->setTemplateFile('delete_comment_form');\n\t}", "protected function _content_template() {\n \n }", "public function getAccessMenu($id=0,$dev=0,$deletekey='') {\n $lang = $this->_ci->lang->language['lang'];\n $status = 1;\n $orderby = \"admin_menu_id\";\n $cachetype=2; \n $sql=null;\n $cachekey='Menu-Factory-getAccessMenu-admin_menu_id-'.$id.'-lang-'.$lang;\n $cachetime=60*60*60*1; \n if($cachetype==2){\n /* ############# 2-->cachefile Start############## */ \n $this->CI->load->driver('cache');\n $cache_is_supported=$this->_ci->cache->file->is_supported();\n if($deletekey==1){$deletekeysdata=$this->_ci->cache->file->delete($cachekey);}\n $path=$this->_ci->config->item('cache_path');\n $get_metadata=$this->_ci->cache->file->get_metadata($cachekey);\n $dataresult=$this->_ci->cache->file->get($cachekey);\n if($dataresult){\n $status_msg='form cache file';\n $cache_info=$this->_ci->cache->file->cache_info($cachekey);\n $dataall=array('message'=>'Data form filecache',\n 'status'=>TRUE, \n 'list'=>$dataresult,\n 'count'=>(int)count($dataresult),\n 'cachetime'=>(int)$cachetime,\n 'cachekey'=>$cachekey,\n 'cacheinfo'=>$cache_info); \n $message=$status_msg;\n if($dev==1){\n $data_result=array('data'=>$dataresult,'message'=>$message); \n }else{\n $data_result=$dataresult; \n }\n return $data_result;\n\n }\n elseif(!$dataresult){ \n ###########DB SQL query Start##########\n $query = $this->_ci->db->select(\"*\")->from(\"_admin_access_menu\")->where(array(\"admin_type_id\" => $id))->order_by($orderby, 'ASC')->get();\n //Check if any results were returned\n if ($query->num_rows() > 0) {\n //Create an array to store users\n $users_access = array();\n //Loop through each row returned from the query\n foreach ($query->result() as $row) {\n //Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n $users_access[] = $row;\n }\n //Return the users array\n }else{ $dataresult=null; }\n $dataresult=$users_access;\n $message='form sql module cache file';\n\n if($dev==1){\n $data_result=array('data'=>$dataresult,'message'=>$message); \n }else{\n $data_result=$users; \n }\n return $data_result;\n }\n ###########DB SQL query End ########### \n }\n else{\n $query = $this->_ci->db->select(\"*\")->from(\"_admin_access_menu\")->where(array(\"admin_type_id\" => $id))->order_by($orderby, 'ASC')->get();\n //Check if any results were returned\n if ($query->num_rows() > 0) {\n //Create an array to store users\n $users_access = array();\n //Loop through each row returned from the query\n foreach ($query->result() as $row) {\n //Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n $users_access[] = $row;\n }\n //Return the users array\n return $users_access;\n }else{return false; }\n \n }\n }", "protected function _content_template()\n {\n\n }", "public function forTemplate() {\n\t\treturn; \n\t}", "public function rebuild() {\n update_option('responsive_menu_pro_version', '2.8.9');\n\n return $this->view->render(\n 'admin/main.html.twig',\n [\n 'options' => $this->manager->all(),\n 'alert' => ['success' => 'Responsive Menu Pro Database Rebuilt Successfully.']\n ]\n );\n }", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod,$log;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"Setting_Lipe\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\t$c_id = isset($_REQUEST[\"c_id\"])? $_REQUEST[\"c_id\"] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n $log->logThis('DELETE Settting Lipe '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\t$checkList = isset($_REQUEST[\"checkList\"])? $_REQUEST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\t $username=$_COOKIE['username'];\n\t\t\t\t$actionlog=new ActionLog();\n\t\t\t\t$actionlog->insertValue($username,'Setting Lipe / Delete a lipe ','Course id: '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\tunset($clsTable);\n}", "public function hook_every_page_before_render($projectId = null){\n if(strpos($_SERVER['REQUEST_URI'],'delete_project.php') !== false && $_POST['action'] == 'delete') {\n #Button: Delete the project\n $this->setProjectSetting('email-queue', '');\n }else if(strpos($_SERVER['REQUEST_URI'],'erase_project_data.php') !== false && $_POST['action'] == 'erase_data'){\n #Button: Erase all data\n\n $this->setProjectSetting('email-repetitive-sent', '');\n $this->setProjectSetting('email-records-sent', '');\n $this->setProjectSetting('email-queue', '');\n $this->removeLogs(\"project_id = $projectId and message = 'email-repetitive-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-records-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-timestamp-sent'\");\n }else if (\n isset($_REQUEST['route'])\n && isset($_REQUEST['record'])\n && ($_REQUEST['route'] == 'DataEntryController:deleteRecord')\n && ($_REQUEST['record'] != \"\")\n ){\n #Button: Delete record\n\n $record_id = urldecode($_REQUEST['record']);\n\n #Delete email repetitive sent and the list of records before deleting all data\n $email_repetitive_sent = $this->getProjectSetting('email-repetitive-sent');\n $email_repetitive_sent = json_decode($email_repetitive_sent,true);\n $email_records_sent = $this->getProjectSetting('email-records-sent');\n\n if($email_repetitive_sent) {\n foreach ($email_repetitive_sent as $form => $form_value) {\n foreach ($form_value as $alert => $alert_value) {\n foreach ($alert_value as $record => $value) {\n #we delete the found record\n if ($record == $record_id) {\n unset($email_repetitive_sent[$form][$alert][$record]);\n }\n }\n }\n }\n $this->setProjectSetting('email-repetitive-sent', json_encode($email_repetitive_sent));\n }\n if($email_records_sent){\n foreach ($email_records_sent as $index=>$sent){\n $records = array_map('trim', explode(',', $sent));\n foreach ($records as $record){\n if($record == $record_id){\n #Delete list of records sent\n $aux = str_replace(\", \".$record_id,\"\",$email_records_sent[$index], $count);\n if($count == 0){\n $email_records_sent[$index] = str_replace($record_id,\"\",$email_records_sent[$index]);\n }else{\n $email_records_sent[$index] = $aux;\n }\n }else if($record == \"\"){\n #If there are empty values in the string we delete the commas\n $email_records_sent[$index] = str_replace(\", ,\",\",\",$email_records_sent[$index], $count);\n\n }\n }\n }\n $this->setProjectSetting('email-records-sent', $email_records_sent);\n }\n\n $this->removeLogs(\n \"project_id = $projectId and message = 'email-repetitive-sent' \n and record_id='$record_id'\"\n );\n $this->removeLogs(\"project_id = $projectId and message = 'email-records-sent' and value='$record_id'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-sent' and value='$record_id'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-timestamp-sent' and value='$record_id'\");\n\n #Delete the queued emails for that record\n $email_queue = $this->getProjectSetting('email-queue');\n $email_queue_aux = $email_queue;\n if($email_queue){\n foreach ($email_queue as $id=>$email){\n if($email['project_id'] == $projectId && $email['record'] == $record_id){\n unset($email_queue_aux[$id]);\n }\n }\n $this->setProjectSetting('email-queue', $email_queue_aux);\n }\n }\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "public function ConfirmSuperadmin($checked_ids, $item_name, $parent_id='', $edit_id='') \n {\n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-items');\t \t \n else if($item_name=='image') $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-images');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_ids, $item_name, $parent_id);\n \n if($edit_id != '')\n {\n $attributes2 = array('edit_id'=>$edit_id);\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name=='item') $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n else $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n \n $this->adminjavascript->include_admin_js = array('SuperAdminValidationJs');\n $this->admincss->including_css_func = array('PrettyPhotoCss'); \n $this->load->view(admin.'/templates/superadmin-delete',$this->data);\n }", "function ReplaceContentIndex( $data, $template_html )\n{\n $returnval = \"\";\n foreach ($data as $row) {\n //replace fields with values in template\n $content = $template_html;\n\n //haal de info op of de graphic reeds geliked is voeg de klasse toe aan de data\n if (previously_liked($row['gra_id'])) $row['liked'] = 'fas fa-heart';\n else $row['liked'] = 'far fa-heart';\n\n //zorg dat je enkel eigen werk kan verwijderen\n if (IsMe()) {\n $row['action'] = 'lib/deletefile.php';\n $row['delete'] = '<button class=\"deletebutton fa fa-trash\" name=\"deletebutton\" type=\"submit\" value=\"delete\"></button>';\n }\n\n //zorg dat je niet-inloggers geen like button of delete hebben\n if (!isset($_SESSION['use']) or !IsMe()) {\n $row['delete'] = '';\n }\n if (!isset($_SESSION['use'])) $row['permission'] = 'denied';\n\n\n\n foreach ($row as $field => $value) {\n\n //dateformat\n if ($field == 'gra_uploaddate') {\n $new_date = new DateTime($value);\n $value = $new_date->format('F d, Y');\n }\n\n $content = str_replace(\"@@$field@@\", $value, $content);\n }\n $returnval .= $content;\n }\n return $returnval;\n}", "protected function _clearDataCache() {}", "protected function content_template()\n\t{\n\t\t//\n\t}", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "public function clearPageCacheContent() {}", "public function ConfirmSuperadmin($checked_ids, $item_name, $parent_id='', $edit_id='') \n {\n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-items');\t \t \n else if($item_name=='image') $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-images');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_ids, $item_name, $parent_id);\n \n if($edit_id != '')\n {\n $attributes2 = array('edit_id'=>$edit_id);\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name=='item') $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n else $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n \n $this->adminjavascript->include_admin_js = array('SuperAdminValidationJs');\n $this->admincss->including_css_func = array('PrettyPhotoCss'); \n $this->load->view(admin.'/templates/superadmin-delete',$this->data);\n }", "function templatesrecache()\n\t{\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$justdone = intval( $this->ipsclass->input['justdone'] );\n\t\t$justdone = $justdone ? $justdone : 1;\n\t\t\n\t\t$s = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'skin_sets',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'set_skin_set_id > '.$justdone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'set_skin_set_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( 0, 1 ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\t\t );\n\t\t\n\t\tif ( $s['set_skin_set_id'] )\n\t\t{\n\t\t\t$this->ipsclass->cache_func->_rebuild_all_caches( array( $s['set_skin_set_id'] ) );\n\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}&amp;justdone={$s['set_skin_set_id']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />Rebuilt the '{$s['set_name']}' skin cache...\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->input['step']++;\n\t\t\t\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />No more skins to rebuild...\" );\n\t\t}\n\t}", "function arvan_total_purge_ajax(){\n \n \n if ( current_user_can( 'manage_options' ) ) {\n \n /**\n * Making Purge request URL\n */\n $arvan_url = Redux::get_option( $this->opt_name, 'arvan-cache-endpoint-url');\n $domain = Redux::get_option( $this->opt_name, 'arvan-domain');\n $full_url = $arvan_url . $domain . '/caching';\n \n if(empty($arvan_url)){\n wp_send_json_error(array(\"message\"=>\"Endpoint url is empty\"));\n return;\n }\n\n $full_url .= '?purge=all';\n \n $arvan_api_key = Redux::get_option( $this->opt_name, 'arvan-api-key');\n \n if(empty($arvan_api_key)){\n wp_send_json_error(array(\"message\"=>\"API Key is empty\"));\n return;\n }\n\n $response = wp_remote_get( $full_url, array(\n 'method' => 'DELETE',\n 'blocking' => true,\n 'headers' => array('Authorization' => $arvan_api_key),\n )\n );\n \n if ( is_wp_error( $response ) ) {\n\n $error_message = $response->get_error_message();\n return \"Something went wrong: $error_message\";\n\n }else{\n\n if(!isset($response['body']))\n return;\n \n $response_object = json_decode($response['body']);\n /**\n * Send a successful response to client JS\n */\n wp_send_json_success($response_object);\n \n }\n }\n\n }", "function index()\n{\n $this->load->module('site_security');\n $this->site_security->_make_sure_is_admin();\n\n $data['query'] = $this->get('date');\n \n $data['flash'] = $this->session->flashdata('delete');\n $data['headline'] = 'Blog';\n $data['view_module'] = 'blog';\n $data['view_file'] = 'manage';\n $this->load->module('templates');\n $this->templates->admin($data);\n}", "public function delete_invoice()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete';\n $data['nestedView']['heading'] = \"Invoice Delete\";\n $data['nestedView']['cur_page'] = 'Invoice Delete';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Date Change','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function potensi_desa(){\n\t\t$data['parent'] = 'master';\n $data['child'] = 'potensi_desa';\n $data['grand_child'] = '';\n $this->load->view('admin/template/header',$data);\n $this->load->view('admin/master/potensi_desa',$data);\n $this->load->view('admin/template/footer');\n\t}", "function parent_edit_view($param1 = '')\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['code'] = $param1;\n $page_data['page_name'] = 'parent_edit';\n $page_data['page_title'] = get_phrase('edit_parent');\n $this->load->view('backend/index', $page_data);\n }", "function display(){\n $cacheRowFile = sugar_cached('modules/') . $this->module_dir . '/collections/'.$this->viewtype. $this->name .'_'. count($this->count_values) . '.tpl';\n if(!$this->checkTemplate($cacheRowFile)){\n $dir = dirname($cacheRowFile);\n if(!file_exists($dir)) {\n\n mkdir_recursive($dir, null, true);\n }\n $cacheRow = $this->ss->fetch($this->findTemplate('Collection'.$this->viewtype.'Row'));\n\n file_put_contents($cacheRowFile, $cacheRow);\n }\n $this->ss->assign('cacheRowFile', $cacheRowFile); \n return $this->ss->fetch($cacheRowFile);\n }", "public function finalize() {\n\n\t\t// template debug\n\t\tif ($this->config) {\n\t\t\tif ($this->config->get('storefront_template_debug')) {\n\t\t\t\t// storefront enabling\n\t\t\t\tif (!IS_ADMIN && !isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) {\n\t\t\t\t\t$this->session->data['tmpl_debug'] = isset($this->request->get['tmpl_debug']);\n\t\t\t\t}\n\n\t\t\t\tif ((isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) && ($this->session->data['tmpl_debug'] == $this->request->get['tmpl_debug'])) {\n\n\t\t\t\t\t$block_details = $this->layout->getBlockDetails($this->instance_id);\n\t\t\t\t\t$excluded_blocks = array( 'common/head' );\n\n\t\t\t\t\tif (!empty($this->instance_id) && (string)$this->instance_id != '0' && !in_array($block_details['controller'], $excluded_blocks)) {\n\t\t\t\t\t\tif (!empty($this->parent_controller)) {\n\t\t\t\t\t\t\t//build block template file path based on primary template used\n\t\t\t\t\t\t\t//template path is based on parent block 'template_dir'\n\t\t\t\t\t\t\t$tmp_dir = $this->parent_controller->view->data['template_dir'].\"template/\";\n\t\t\t\t\t\t\t$block_tpl_file = $tmp_dir.$this->view->getTemplate();\n\t\t\t\t\t\t\t$prt_block_tpl_file = $tmp_dir.$this->parent_controller->view->getTemplate();\n\t\t\t\t\t\t\t$args = array( 'block_id' => $this->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'block_controller' => $this->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'block_tpl' => $block_tpl_file,\n\t\t\t\t\t\t\t\t\t\t\t'parent_id' => $this->parent_controller->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'parent_controller' => $this->parent_controller->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'parent_tpl' => $prt_block_tpl_file\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$debug_wrapper = $this->dispatch('common/template_debug', array( 'instance_id' => $this->instance_id, 'details' => $args ));\n\t\t\t\t\t\t\t$debug_output = $debug_wrapper->dispatchGetOutput();\n\t\t\t\t\t\t\t$output = trim($this->view->getOutput());\n\t\t\t\t\t\t\tif (!empty($output)) $output = '<span class=\"block_tmpl_wrapper\">' . $output . $debug_output . '</span>';\n\t\t\t\t\t\t\t$this->view->setOutput($output);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset($this->session->data['tmpl_debug']);\n\t\t\t}\n\t\t}\n\t\t$this->view->render();\n\t}", "public function render()\n\t{\n\t\t$template = $this->template;\n\t\t$template->setFile( __DIR__ . '/dataGrid.latte' );\n\n\t\t$template->grid = $this;\n\t\t$template->stencils = $this->stencils;\n\t\t$template->actionWidth = $this->actionWidth;\n\t\t$template->actitle = $this->actitle;\n\t\t$template->acfooter = $this->acfooter;\n\t\t$template->cmd = self::CMD;\n\t\t$template->labels = $this->labels;\n\t\t$template->columns = $this->columns;\n\t\t$template->key = $this->key;\n\t\t$template->isSorting = $this->isSorting();\n\t\t$template->isFiltering = $this->isFiltering();\n\t\t$template->isAdding = $this->isAdding();\n\t\t$template->isRemoving = $this->isRemoving();\n\t\t$template->isEditing = $this->isEditing();\n\t\t$template->hasActions = $this->hasActions();\n\t\t$template->sortable = $this->sortable;\n\t\t$template->sorting = $this->sorting;\n\t\t$template->filtering = $this->filtering;\n\t\t$template->id = $this->id;\n\t\t$template->pgbtn = $this->getPagerButtons();\n\t\t$template->currentPage = $this->getCurrentPage();\n\t\t$template->rowsPerPage = $this->getRowsPerPage();\n\t\t$template->pageCount = $this->getPageCount();\n\n\t\tif ( count( $this->dataSnippet ) ) $template->data = $this->dataSnippet;\n\t\telse $template->data = $this->getData();\n\n\t\t$template->render();\n\t}", "function displayDeleteScreen()\t{\n\t\t$pluginId=$conf['pluginId'];\n\t\t$content=\"feal : displayDeleteScreen unset content\";\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ($this->aCAuth($origArr) && $this->conf['requireLogin']) || !$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\t\t\n\t\t\t\tif (is_array($origArr))\t{\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\t$this->markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"rU['.$pluginId.']\" value=\"'.$this->recUid.'\" />';\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_DELETE_PREVIEW###', $origArr);\n\t\t\t\t\t} else {\t// Else display error, that you could not edit that particular record...\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$content='Object already deleted';\n\t\t\t\t}\n\t\t\t} else {\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content='Delete-option is not set in TypoScript';\n\t\t}\n\t\t$content=$content?$content:'No template for delete screen';\n\t\treturn $content;\n\t}", "public function clearServerCache()\n {\n return view('pilot::admin.clear.cache');\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "public function rollback_invoice_delete()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete Details';\n $data['nestedView']['heading'] = \"Invoice Delete Details\";\n $data['nestedView']['cur_page'] = 'Invoice Delete Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete','class'=>'active','url'=>SITE_URL.'delete_invoice'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'delete_invoice'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n \n \n \n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function initContent() {\n $this->initTabModuleList();\n $this->initToolbar();\n $this->initPageHeaderToolbar();\n\n if ($this->display == 'edit' || Tools::getValue('display') == 'formPlayer') {\n if (!$this->loadObject(true)) {\n return;\n }\n $this->content = $this->renderForm();\n $this->content.= $this->generateListPlayerLevels();\n $this->content.= $this->generateListPlayerHistory();\n $deletePlayers = false;\n }\n elseif (Tools::isSubmit('addCustomAction')) {\n $this->content = $this->generateFormCustomAction();\n $deletePlayers = false;\n }\n else {\n $this->content = $this->renderList();\n $deletePlayers = true;\n }\n\n // This are the real smarty variables\n $this->context->smarty->assign(\n array(\n 'content' => $this->content,\n 'tab' => 'Players',\n 'loyalty_name' => Configuration::get('krona_loyalty_name', $this->context->language->id, $this->id_shop_group, $this->id_shop),\n 'import' => Configuration::get('krona_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'dont' => Configuration::get('krona_dont_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'deletePlayers' => $deletePlayers,\n 'show_page_header_toolbar' => $this->show_page_header_toolbar,\n 'page_header_toolbar_title' => $this->page_header_toolbar_title,\n 'page_header_toolbar_btn' => $this->page_header_toolbar_btn,\n )\n );\n\n $tpl = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'genzo_krona/views/templates/admin/main.tpl');\n\n $this->context->smarty->assign(array(\n 'content' => $tpl, // This seems to be anything inbuilt. It's just chance that we both use content as an assign variable\n ));\n\n }", "function delAdminHandler() {\n global $inputs;\n $sql = \"DELETE FROM `admin` WHERE id = \" . $inputs['id'];\n execSql($sql);\n formatOutput(true, 'delete success');\n}", "public function ConfirmDelete($checked_id, $item_name, $parent_id = '', $edit_id = '') \n {\n $this->adminjavascript->include_admin_js = array('ConfirmDeleteJs');\n \n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-items');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_id, $item_name, $parent_id);\n if($edit_id != '')\n {\n $attributes2 = array('edit_id' => $edit_id);\n $this->data['attributes']['hidden'] = array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name == \"donation_image_delete\")\n {\n\t$this->data['message']=\"Are you sure want to delete this image.\";\n }\n elseif($item_name == \"remove_clone\")\n {\n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-donation');\t \t \n\t$this->data['message']=\"Are you sure want to unlink this donation from selected donation.\";\n }\n else\n {\n $this->data['message'] = \"Are you sure you want to delete selected items\";\n }\n $this->load->view(admin.'/templates/confirm-delete',$this->data);\n }", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function ConfirmDelete($checked_id, $item_name, $parent_id = '', $edit_id = '') \n {\n $this->adminjavascript->include_admin_js = array('ConfirmDeleteJs');\n \n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-items');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_id, $item_name, $parent_id);\n if($edit_id != '')\n {\n $attributes2 = array('edit_id' => $edit_id);\n $this->data['attributes']['hidden'] = array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name == \"support_image_delete\")\n {\n\t$this->data['message']=\"Are you sure want to delete this image.\";\n }\n elseif($item_name == \"remove_clone\")\n {\n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-support');\t \t \n\t$this->data['message']=\"Are you sure want to unlink this support from selected support.\";\n }\n else\n {\n $this->data['message'] = \"Are you sure you want to delete selected items\";\n }\n $this->load->view(admin.'/templates/confirm-delete',$this->data);\n }", "public function delete_builder_template($name = \"%\")\n\t\t{\n\t\t check_ajax_referer('avia_nonce_save','avia-save-nonce');\n\t\t\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : $name;\n $id = AviaStoragePost::get_custom_post('template_builder_snippets');\n\n \n $key = $this->generate_key($name);\n $result = delete_post_meta($id, $key);\n echo 'avia_template_deleted';\n die();\n\t\t}", "public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)\n {\n if(empty($template) === true)\n $template = $this->_template_file;\n \n try {\n parent::display($template, $cache_id, $compile_id, $parent);\n } catch(\\SmartyException $e) {\n $template_file = $this->_template_file;\n $error = $e->getMessage();\n \\dcms\\Log::write(\"Could not display template $template_file! ($error)\", null, 3);\n }\n }", "public function renderRowStorageMenu($entry)\n {\n\n if (false === $this->flags->s_delete)\n return '';\n\n $html = <<<CODE\n <button\n onclick=\"\\$R.del('{$this->urlStorageDelete}{$this->defAction}&objid={$entry['storage_id']}',{confirm:'Confirm to delete.'});\"\n class=\"wgt-button\"\n tabindex=\"-1\" ><i class=\"fa fa-times\" ></i></button>\nCODE;\n\n return $html;\n\n }", "protected function template() {\n\t\treturn '';\n\t}", "public function index( $args ) {\n\t\t// Get database and table.\n\t\t$db = new \\WordPress\\CMS\\DB\\Database( $this->wpdb );\n\t\t$table = $db->get_table( $args['table'] );\n\n\t\t// Give it all to the template.\n\t\t$template = $this->get_template( $table );\n\t\tif ( isset( $args['ident'] ) ) {\n\t\t\t$template->record = $table->get_record( $args['ident'] );\n\t\t\t// Check permission.\n\t\t\tif ( ! Grants::current_user_can( Grants::UPDATE, $table->get_name() ) ) {\n\t\t\t\t$template->add_notice( 'error', 'You do not have permission to update data in this table.' );\n\t\t\t}\n\t\t}\n\t\tif ( ! isset( $template->record ) || false === $template->record ) {\n\t\t\t$template->record = $table->get_default_record();\n\t\t\t// Check permission.\n\t\t\tif ( ! Grants::current_user_can( Grants::CREATE, $table->get_name() ) ) {\n\t\t\t\t$template->add_notice( 'error', 'You do not have permission to create records in this table.' );\n\t\t\t}\n\t\t\t// Add query-string values.\n\t\t\tif ( isset( $args['defaults'] ) ) {\n\t\t\t\t$template->record->set_multiple( $args['defaults'] );\n\t\t\t}\n\t\t}\n\t\t// Don't save to non-updatable views.\n\t\tif ( ! $table->is_updatable() ) {\n\t\t\t$template->add_notice( 'error', \"This table can not be updated.\" );\n\t\t}\n\n\t\t// Enable postboxes (for the history and related tables' boxen).\n\t\twp_enqueue_script( 'dashboard' );\n\n\t\t// Return to URL.\n\t\tif ( isset( $args['return_to'] ) ) {\n\t\t\t$template->return_to = $args['return_to'];\n\t\t}\n\n\t\treturn $template->render();\n\t}", "function admin_template($content=\"\",$titlebar=\"\",$titlepage=\"\",$user=\"\",$menu=\"\",$plugin=\"\"){\n \n $titlebar = ($titlebar!=\"\") ? $titlebar : \"\";\n\t$titlepage = ($titlepage!=\"\") ? $titlepage : \"\";\n $plugin\t = ($plugin!=\"\") ? $plugin : \"\";\n $menu\t = ($menu!=\"\") ? $menu : \"\";\n $content\t= ($content!=\"\") ? $content : \"\";\n\n \n$menu = '\n<div class=\"menu-bar header-sm-height\" data-pages-init=\\'horizontal-menu\\' data-hide-extra-li=\"0\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-close\" data-toggle=\"horizontal-menu\">\n </a>\n <ul>\n <li class=\" active\">\n <a href=\"home.php\">Dashboard</a>\n </li>\n <li>\n <a href=\"list_member.php\"><span class=\"title\">Members</span></a>\n </li>\n <li>\n <a href=\"javascript:;\"><span class=\"title\">Products</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"list_products.php\">List Products</a>\n </li>\n <li class=\"\">\n <a href=\"list_categories.php\">List Categories</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"list_sub_categories.php\">Sub Categories</a>\n </li>\n \n \n </ul>\n </li>\n \n <li class=\"\">\n <a href=\"list_transaction.php\">List Transaction</a>\n </li>\n \n </li>\n\t\t\t<li>\n <a href=\"javascript:;\"><span class=\"title\">Pages</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"about_us.php\">About Us</a>\n </li>\n <li class=\"\">\n <a href=\"production.php\">Production</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"buyers_guide.php\">Buyers Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"custom_guide.php\">Custom Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"payment_guide.php\">Payment Guide</a>\n </li>\n </ul>\n </li>\n\t\t\t<li>\n <a href=\"list_contact_us.php\">Incoming Contact Us</a>\n </li>\n \n </ul>\n <a href=\"#\" class=\"search-link d-flex justify-content-between align-items-center hidden-lg-up\" data-toggle=\"search\">Tap here to search <i class=\"pg-search float-right\"></i></a>\n </div>\n';\n \n \n$template = '\n<!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <meta charset=\"utf-8\" />\n <title>'.$titlebar.' Seagods Wetsuit</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no\" />\n <link rel=\"apple-touch-icon\" href=\"pages/ico/60.png\">\n <link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"pages/ico/76.png\">\n <link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"pages/ico/120.png\">\n <link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"pages/ico/152.png\">\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-touch-fullscreen\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"default\">\n <meta content=\"\" name=\"description\" />\n <meta content=\"\" name=\"author\" />\n <link href=\"assets/plugins/pace/pace-theme-flash.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/font-awesome/css/font-awesome.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/select2/css/select2.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/switchery/css/switchery.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"pages/css/pages-icons.css\" rel=\"stylesheet\" type=\"text/css\">\n <link class=\"main-stylesheet\" href=\"pages/css/pages.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/paging.css\">\n\t\n\n\t\n\n\t'.$plugin.'\n </head>\n <body class=\"fixed-header horizontal-menu horizontal-app-menu dashboard\">\n <!-- START HEADER -->\n <div class=\"header\">\n <div class=\"container\">\n <div class=\"header-inner header-md-height\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-menu\" data-toggle=\"horizontal-menu\">\n </a>\n <div class=\"\">\n <a href=\"#\" class=\"search-link hidden-md-down\" data-toggle=\"search\"></a>\n </div>\n <div class=\"d-flex align-items-center\">\n <!-- START User Info-->\n <div class=\"pull-left p-r-10 fs-14 font-heading hidden-md-down\">\n <span class=\"semi-bold\">'.$user.'</span>\n </div>\n <div class=\"dropdown pull-right sm-m-r-5\">\n <button class=\"profile-dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span >\n <img src=\"assets/img/s-logo.png\" alt=\"\" width=\"32px\" >\n </span>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right profile-dropdown\" role=\"menu\">\n <!--<a href=\"#\" class=\"dropdown-item\"><i class=\"pg-settings_small\"></i> Settings</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-outdent\"></i> Feedback</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-signals\"></i> Help</a>-->\n <a href=\"logout.php\" class=\"clearfix bg-master-lighter dropdown-item\">\n <span class=\"pull-left\">Logout</span>\n <span class=\"pull-right\"><i class=\"pg-power\"></i></span>\n </a>\n </div>\n </div>\n <!-- END User Info\n <a href=\"#\" class=\"header-icon pg pg-alt_menu btn-link m-l-10 sm-no-margin d-inline-block\" data-toggle=\"quickview\" data-toggle-element=\"#quickview\"></a>\n --></div>\n </div>\n <div class=\"header-inner justify-content-start header-lg-height title-bar\">\n <div class=\"brand inline align-self-end\">\n <img src=\"assets/img/s-logo.png\" style=\"width:35px;\" >\n </div>\n <h2 class=\"page-title align-self-end\">\n '.$titlepage.'\n </h2>\n </div>\n '.$menu.'\n </div>\n </div>\n\t\n\t<div class=\"page-container \">\n <!-- START PAGE CONTENT WRAPPER -->\n <div class=\"page-content-wrapper \">\n <!-- START PAGE CONTENT -->\n <div class=\"content sm-gutter\">\n <!-- START JUMBOTRON -->\n <div data-pages=\"parallax\">\n <div class=\" container no-padding container-fixed-lg\">\n <div class=\"inner\">\n <!-- START BREADCRUMB -->\n <ol class=\"breadcrumb\">\n <li class=\"breadcrumb-item\"><a href=\"home.php\">Home</a></li>\n <li class=\"breadcrumb-item active\">'.$titlepage.'</li>\n </ol>\n </div>\n </div>\n </div>\n\t\n '.$content.'\n\t\n\t<br><br>\n\t <div class=\" container container-fixed-lg footer\">\n <div class=\"copyright sm-text-center\">\n <p class=\"small no-margin pull-left sm-pull-reset\">\n <span class=\"hint-text\">SeaGods Administrator Page &copy; 2018 </span>\n <span class=\"font-montserrat\"></span>.\n <span class=\"hint-text\">All rights reserved. </span>\n <span class=\"sm-block\"><a href=\"#\" class=\"m-l-10 m-r-10\">Terms of use</a> <span class=\"muted\">|</span> <a href=\"#\" class=\"m-l-10\">Privacy Policy</a></span>\n </p>\n <p class=\"small no-margin pull-right sm-pull-reset\">\n Supported by <span class=\"hint-text\"> XtremeWeb Solution</span>\n </p>\n <div class=\"clearfix\"></div>\n </div>\n </div>\n <!-- END COPYRIGHT -->\n </div>\n <!-- END PAGE CONTENT WRAPPER -->\n </div>\n\t\n <!-- END PAGE CONTAINER -->\n <!--START QUICKVIEW -->\n <div id=\"quickview\" class=\"quickview-wrapper\" data-pages=\"quickview\">\n \n </div>\n \n \n <!-- END QUICKVIEW-->\n <!-- START OVERLAY -->\n <div class=\"overlay hide\" data-pages=\"search\">\n <!-- BEGIN Overlay Content !-->\n <div class=\"overlay-content has-results m-t-20\">\n <!-- BEGIN Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Logo !\n <img class=\"overlay-brand\" src=\"assets/img/logo.png\" alt=\"logo\" data-src=\"assets/img/logo.png\" data-src-retina=\"assets/img/logo_2x.png\" width=\"78\" height=\"22\">\n <!-- END Overlay Logo !-->\n <!-- BEGIN Overlay Close !-->\n <a href=\"#\" class=\"close-icon-light overlay-close text-black fs-16\">\n <i class=\"pg-close\"></i>\n </a>\n <!-- END Overlay Close !-->\n </div>\n <!-- END Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Controls !-->\n <input id=\"overlay-search\" class=\"no-border overlay-search bg-transparent\" placeholder=\"Search...\" autocomplete=\"off\" spellcheck=\"false\">\n <br>\n <div class=\"inline-block\">\n <div class=\"checkbox right\">\n <input id=\"checkboxn\" type=\"checkbox\" value=\"1\" checked=\"checked\">\n <label for=\"checkboxn\"><i class=\"fa fa-search\"></i> Search within page</label>\n </div>\n </div>\n <div class=\"inline-block m-l-10\">\n <p class=\"fs-13\">Press enter to search</p>\n </div>\n <!-- END Overlay Controls !-->\n </div>\n <!-- BEGIN Overlay Search Results, This part is for demo purpose, you can add anything you like !-->\n <div class=\"container-fluid\">\n <span>\n <strong>suggestions :</strong>\n </span>\n <span id=\"overlay-suggestions\"></span>\n <br>\n <div class=\"search-results m-t-40\">\n <p class=\"bold\">Pages Search Results</p>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n </div>\n \n </div>\n </div>\n </div>\n <!-- END Overlay Search Results !-->\n </div>\n <!-- END Overlay Content !-->\n </div>\n <!-- END OVERLAY -->\n <!-- BEGIN VENDOR JS -->\n <script src=\"assets/plugins/feather-icons/feather.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/pace/pace.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-1.11.1.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/modernizr.custom.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ui/jquery-ui.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/tether/js/tether.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/bootstrap/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-easy.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-unveil/jquery.unveil.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ios-list/jquery.ioslist.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-actual/jquery.actual.min.js\"></script>\n <script src=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/select2/js/select2.full.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/classie/classie.js\"></script>\n <script src=\"assets/plugins/switchery/js/switchery.min.js\" type=\"text/javascript\"></script>\n <!-- END VENDOR JS -->\n <!-- BEGIN CORE TEMPLATE JS -->\n <script src=\"pages/js/pages.min.js\"></script>\n <!-- END CORE TEMPLATE JS -->\n <!-- BEGIN PAGE LEVEL JS -->\n <script src=\"assets/js/scripts.js\" type=\"text/javascript\"></script>\n\t\n\t \n </body>\n</html>\n\n\n';\n\nreturn $template;\n}", "public function execute()\n {\n $resultRedirect = $this->resultRedirectFactory->create();\n $id = $this->getRequest()->getParam('id');\n if ($id) {\n $model = $this->customData;\n $model->load($id);\n try {\n $model->delete();\n $this->messageManager->addSuccessMessage(__('Data Deleted'));\n return $resultRedirect->setPath('*/*/index');\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage(__($e->getMessage()));\n return $resultRedirect->setPath('*/*/edit', ['id'=>$id]);\n }\n }\n }", "function _deleteCache() {\n require_once(\"Cache/Output.php\");\n $cache = new Cache_Output($GLOBALS[\"BX_config\"][\"popoon\"][\"cacheContainer\"], $GLOBALS[\"BX_config\"][\"popoon\"][\"cacheParams\"] );\n \n // for the time being, just flush everything...\n @$cache->flush('outputcache');\n $cache->flush('');\n }", "protected function cleanCache()\n {\n parent::cleanCache('com_projectfork');\n }", "public function cleancacheAction() {\n if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_CONTENT)) {\n try {\n $this->_helper->cache->clean();\n $this->_helper->response->success(\n $this->_helper->language->translate('The entire cache has been cleaned.')\n );\n }\n catch (Exceptions_SeotoasterException $ste) {\n $this->_helper->response->fail($ste->getMessage());\n }\n }\n }", "protected function _content_template_parent() {\n ?>\n <#\n var selector = '<?php echo $this->get_unique_selector(); ?>' + id; \n var css = settings.custom_css;\n #>\n <# if( css.length > 0 ) { #>\n <style scoped>{{ css.replace('[SELECTOR]', selector) }}</style>\n <# } #>\n <?php\n }", "public function onclick_btn_delete_static_block($e){\r\n\t\tif($this->has_admin_panel()) return $this->module_onclick_btn_delete_static_block($e);\r\n\t\treturn $this->msg->modal_no_permission($e);\r\n\t}", "public function onClearCache(Enlight_Event_EventArgs $arguments)\n {\n $arguments->getSubject()->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if (!empty($_SERVER[\"REMOTE_ADDR\"])\n && !empty($this->Config()->ipLimitation)\n && strpos($this->Config()->ipLimitation, $_SERVER[\"REMOTE_ADDR\"]) === false\n ) {\n return;\n }\n\n Shopware()->Cache()->clean();\n Shopware()->Template()->clearAllCache();\n Shopware()->Template()->clearCompiledTemplate();\n $this->clearSearchCache();\n $this->clearRewriteCache();\n $this->clearFrontendCache($arguments->getSubject()->Request());\n $this->clearProxyCache();\n $this->clearConfigCache();\n exit();\n }", "public function index()\n {\n try{\n $crud = new grocery_CRUD();\n $crud->set_theme('mybootstrap');\n $crud->unset_delete();//grid\n $crud->set_table('project');\n $crud->set_subject('Projects');\n $crud->fields('name', 'template', 'slug','status');\n $crud->required_fields('name');\n $crud->callback_before_insert(array($this,'configure_slug'));\n $crud->callback_before_update(array($this,'configure_slug'));\n $crud->unset_export();\n $crud->unset_print();\n $output = $crud->render();\n $output->title_page = $this->lang->line('admin_project_title');\n $output->main_content = $this->config->item('rpt_views') . 'admin';\n $this->load->view( $this->config->item('rpt_base_template'),$output);\n }catch(Exception $e){\n show_error($e->getMessage().' --- '.$e->getTraceAsString());\n }\n }", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "function _cache_actions_clear_panels_cache($display) {\n panels_load_include('simple', 'plugins/cache/');\n panels_simple_cache_clear_cache($display);\n\n}", "public function show($content, $name_c='', $cache_time = false){ \r\n\t\r\n\t\t//at first .. \r\n\t\t$page_is\t= ($name_c!='') ? $name_c : $content;\r\n\t\t$cache_time\t= ($cache_time !== false )? $cache_time : $this->cachetime;\r\n\r\n\t\t//global vars \r\n\t\tif (empty($this->vars) || !is_array($this->vars)){ \r\n\t\t\t$this->vars = array(); \r\n\t\t}\r\n\t\tif($this->global_vars == 'on'){\r\n\t\t\t$this->vars = array_merge($this->vars, $GLOBALS);\r\n\t\t}\r\n\r\n\t\t//check step\r\n\t if (empty($this->cachedir)) { \r\n\t \t$this->cachedir = $_ENV[\"TEMP\"]; \r\n\t } \r\n\t if (!is_writeable( $this->cachedir ) ) { \r\n\t \techo \"<i>ERROR :</i> could not be write in cach folder!\"; \r\n\t } \r\n\t\t\r\n\t\t//delete step\r\n\t $npage = $page_is . '.mytpl.php'; \r\n\t $tpage = @filemtime(\"$this->cachedir/$npage\"); \r\n\r\n\t if($tpage >= ($tpage+(3600*$cache_time))){ \r\n\t \t@unlink(\"$this->cachedir/$npage\"); \r\n\t } \r\n\r\n\t\t//including step\r\n\t if(!file_exists(\"$this->cachedir/$npage\")){\t\r\n\r\n\t\t\t\tif ($name_c == ''){\r\n\t\t\t\t\r\n\t\t\t\t\tif(!file_exists(\"$this->Tempdir$npage\")){ \r\n\t\t\t\t\t\techo \"<i>ERROR :</i> <b>$page_is</b> Template Not Found!\"; \r\n\t\t\t\t\t\texit();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tinclude(\"$this->Tempdir$npage\"); \r\n\t\t\t\t\t$pageTemp= ob_get_clean();\r\n\t\t\t\t\t\r\n\t\t\t\t}else {\r\n\t\t\t\t\t$pageTemp = $content;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($this->php_tags != 'on'){ \r\n\t\t\t\t\t//reomve any any php tags ,, so if you want php code use our code {php}\r\n\t\t\t\t\t$this->remove_php_tags($pageTemp);\r\n\t\t\t\t}\r\n\t\t\t\t//compile content\r\n\t\t\t\t$pageTemp = $this->compile($pageTemp);\t\r\n\t\t\t\t\r\n\t\t\t\t//then\r\n\t\t\t $filenum = @fopen(\"$this->cachedir/$npage\", 'w'); \r\n\t\t\t flock($filenum, LOCK_EX); \r\n\t\t\t @fwrite($filenum, $pageTemp); \r\n\t\t\t fclose($filenum); \r\n\t\t\t\t@chmod($filenum, 0666);\r\n\t } \r\n\t\t\r\n\t\t//get \r\n\t\tob_start();\r\n\t\tinclude(\"$this->cachedir/$npage\"); \r\n\t\t$pageTemp = ob_get_clean();\r\n\t\t//now prepare to print \r\n\t\treturn $pageTemp;\r\n }", "public function rollback_invoice_product_delete()\n {\n $data['nestedView']['pageTitle'] = ' Delete Invoice Product Details';\n $data['nestedView']['heading'] = \"Delete Invoice Product Details\";\n $data['nestedView']['cur_page'] = 'Delete Invoice Product Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product','class'=>'active','url'=>SITE_URL.'invoice_product_delete'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'invoice_product_delete'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n \n \n $this->load->view('rollback_invoice/rollback_invoice_product_delete_view',$data);\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "function admin_pagesBuild($data, $db) {\n\t//permission check for pages delete\n\tif (!checkPermission('delete', 'pages', $data)) {\n\t\t$data->output['abort'] = true;\n\t\t$data->output['abortMessage'] = '<h2>Insufficient User Permissions</h2>You do not have the permissions to access this area.';\n\t\treturn;\n\t}\n\n\t$data->output['delete']='';\n\n\t// Check To See If The Menu Item Exists\n\t$check = $db->prepare('getPageById', 'admin_pages');\n\t$check->execute(array(':id' => $data->action[3]));\n\t$data->output['pageItem'] = $check->fetch();\n\n\tif ($data->output['pageItem']['shortName'] == $data->settings['homepage']) {\n\t\t$data->output['rejectError']='Permission Denied';\n\t\t$data->output['rejectText']='This page is being used as the homepage. It cannot be deleted.';\n\t}\n\n\tif ($data->output['pageItem'] == FALSE || !is_numeric($data->action[3])) {\n\t\t$data->output['rejectError']='insufficient parameters';\n\t\t$data->output['rejectText']='No ID # was entered to be deleted';\n\t} else {\n\t\tif (isset($_POST['fromForm'])) {\n\t\t\tif ($_POST['fromForm']==$data->action[3] && !empty($_POST['delete'])) {\n\t\t\t\tif ($data->output['pageItem']['parent']==0) {\n\t\t\t\t\t$statement=$db->prepare('deleteReplacementByMatch', 'admin_urls');\n\t\t\t\t\t$statement->execute(array(\n\t\t\t\t\t\t\t':match' => '^'.$data->output['pageItem']['shortName'].'(/.*)?$'\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t// Fix Gap In Sort Order By Subtracting 1 From Each One Larger Than It\n\t\t\t\t$statement = $db->prepare('fixSortOrderGap', 'admin_pages');\n\t\t\t\t$statement->execute(array(\n\t\t\t\t\t\t':sortOrder' => $data->output['pageItem']['sortOrder'],\n\t\t\t\t\t\t':parent' => $data->output['pageItem']['parent']\n\t\t\t\t\t));\n\t\t\t\t//--Delete This Page--//\n\t\t\t\tcommon_deleteFromLanguageTables($data, $db, 'pages', 'id', $data->action[3], TRUE);\n\t\t\t\t//--Delete This Page's Children--//\n\t\t\t\tcommon_deleteFromLanguageTables($data, $db, 'pages', 'parent', $data->action[3], TRUE);\n\t\t\t\t$data->output['delete']='deleted';\n\t\t\t} else {\n\t\t\t\t/* from form plus not deleted must == cancelled. */\n\t\t\t\t$data->output['delete']='cancelled';\n\t\t\t}\n\t\t}\n\t}\n}", "public function run()\n {\n $cache = new Cache();\n $this->menuHtml = $cache->get($this->cacheKey);\n if( ! $this->menuHtml) {\n $this->data = \\R::getAssoc(\"SELECT * FROM {$this->table}\");\n $this->tree = $this->getTree();\n $this->menuHtml = $this->getMenuHtml($this->tree);\n\n $cache->set($this->cacheKey, $this->menuHtml, $this->cache);\n }\n $this->output();\n }", "public function execute($operation = NULL)\r\n\t{\r\n\t\tCore_Event::notify(get_class($this) . '.onBeforeExecute', $this, array($operation));\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$return = NULL;\r\n\r\n\t\t\t$Site_Controller_Template = Site_Controller_Template::instance()\r\n\t\t\t\t->templatePath(CMS_FOLDER . TMP_DIR)\r\n\t\t\t\t->chmodFile(CHMOD_FILE)\r\n\t\t\t\t//->server('http://hostcms')\r\n\t\t\t\t;\r\n\r\n\t\t\tswitch ($operation)\r\n\t\t\t{\r\n\t\t\t\tcase NULL: // Показ формы\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'chooseTemplate';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.choose_site_template'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t?><div id=\"gallery\"><?php\r\n\t\t\t\t\t$aGroups = $oXml->children();\r\n\r\n\t\t\t\t\t$iKeyGroup = 0;\r\n\t\t\t\t\t// цикл по дереву group\r\n\t\t\t\t\tforeach ($aGroups as $oGroup)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// если в группе есть шаблоны\r\n\t\t\t\t\t\tif ($oGroup->templates)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$iKeyTemplate = 0;\r\n\t\t\t\t\t\t\t// цикл по дереву template\r\n\t\t\t\t\t\t\tforeach ($oGroup->templates->template as $oTemplate)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (strlen(trim((string)$oTemplate->template_file6)) && (int)$oTemplate['id'] != 2782)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$small_width = (string)$oTemplate->template_preview['width'];\r\n\t\t\t\t\t\t\t\t\t$small_height = 200 + 40;\r\n\t\t\t\t\t\t\t\t\t// вывод информации о шаблоне\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t<div class=\"site_template_block\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"bord_img\" style=\"width: <?php echo $small_width?>px; height:<?php echo $small_height?>px;\">\r\n\r\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplate->template_full_preview)?>\" target=\"_blank\">\r\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplate->template_preview)?>\" width=\"<?php echo $small_width?>\" />\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"bottom\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input style=\"float: left\" type=\"radio\" <?php if ($iKeyTemplate == 0 && $iKeyGroup == 0) {echo 'checked=\"checked\"';} ?> name=\"template_id\" id=\"template_<?php echo (string)$oTemplate['id']?>\" value=\"<?php echo (string)$oTemplate['id']?>\" />\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t<label for=\"template_<?php echo (string)$oTemplate['id']?>\" style=\"margin-left: 5px; float: left\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<b><?php echo (string)$oTemplate->template_name?></b>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span><?php echo (string)$oGroup->group_name?></span>\r\n\t\t\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$iKeyTemplate++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$iKeyGroup++;\r\n\r\n\t\t\t\t\t\t// Для HostCMS-6 доступен только основной макет\r\n\t\t\t\t\t\t//break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div style=\"clear: both\"></div>\r\n\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'chooseTemplate':\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'chooseTemplateType';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.choose_color_scheme'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t$iTemplateId = intval(Core_Array::getPost('template_id'));\r\n\t\t\t\t\t$Templates = $oXml->xpath(\"//group/templates/template[@id='{$iTemplateId}']\");\r\n\r\n\t\t\t\t\tif (isset($Templates[0]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// у выбранного шаблона есть цветовые схемы\r\n\t\t\t\t\t\tif (count($Templates[0]->template_types->template_type) > 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<div id=\"gallery\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t// цикл по цветовым схемам\r\n\t\t\t\t\t\t\tforeach ($Templates[0]->template_types as $iKeyTemplateType => $oTemplateType)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$small_width = (string)$oTemplateType->template_type_full_preview['width'];\r\n\t\t\t\t\t\t\t\t$small_height = 200 + 40;\r\n\r\n\t\t\t\t\t\t\t\t?><div class=\"bord_img\" style=\"width: <?php echo $small_width?>px; height:<?php echo $small_height?>px;\">\r\n\r\n\t\t\t\t\t\t\t\t<a href=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplateType->template_type_full_preview)?>\">\r\n\t\t\t\t\t\t\t\t<img src=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplateType->template_type_preview)?>\"\r\n\t\t\t\t\t\t\t\twidth=\"<?php echo $small_width?>\" />\r\n\t\t\t\t\t\t\t\t</a>\r\n\r\n\t\t\t\t\t\t\t\t<div style=\"position: absolute; width: 100%; bottom: 5px;\">\r\n\t\t\t\t\t\t\t\t\t<input style=\"float: left;\" type=\"radio\" <?php echo ($iKeyTemplateType == 0) ? 'checked=\"checked\"' : ''?> name=\"template_id\" id=\"template_<?php echo (string)$oTemplateType['id']?>\" value=\"<?php echo (string)$oTemplateType['id']?>\" />\r\n\r\n\t\t\t\t\t\t\t\t\t<label for=\"template_<?php echo (string)$oTemplateType['id']?>\" style=\"margin-left: 5px; float: left\">\r\n\t\t\t\t\t\t\t\t\t\t<b><?php echo (string)$oTemplateType->template_type_name?></b>\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//break; // Если цветовой схемы нет, переходим к следующему шагу\r\n\t\t\t\tcase 'chooseTemplateType':\r\n\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'createSite';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.template_settings'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t$iTemplateId = intval(Core_Array::getPost('template_id'));\r\n\t\t\t\t\t$iTemplateTypeId = intval(Core_Array::getPost('template_type_id'));\r\n\r\n\t\t\t\t\t$Templates = $oXml->xpath(\"//group/templates/template[@id='{$iTemplateId}']\");\r\n\r\n\t\t\t\t\tif (isset($Templates[0]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Template = $Templates[0];\r\n\r\n\t\t\t\t\t\t// ссылка на макет файла\r\n\t\t\t\t\t\t$sTemplateFile = (string)$Template->template_file6;\r\n\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Core_Http = Core_Http::instance()\r\n\t\t\t\t\t\t\t\t->url($Site_Controller_Template->server . $sTemplateFile)\r\n\t\t\t\t\t\t\t\t->port(80)\r\n\t\t\t\t\t\t\t\t->timeout(30)\r\n\t\t\t\t\t\t\t\t->execute();\r\n\r\n\t\t\t\t\t\t\t$sFileContents = $Core_Http->getBody();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t\t$sFileContents = NULL;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// название архива макета\r\n\t\t\t\t\t\t$aTemplateFileUrl = explode('/', $Site_Controller_Template->server . $sTemplateFile);\r\n\t\t\t\t\t\t$sTemplateFileName = end($aTemplateFileUrl);\r\n\r\n\t\t\t\t\t\t// путь к локальному архиву макета\r\n\t\t\t\t\t\t$sTemplateFileUrl = $Site_Controller_Template->templatePath . $sTemplateFileName;\r\n\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// запись в файл данных макета\r\n\t\t\t\t\t\t\tif (Core_File::write($sTemplateFileUrl, $sFileContents))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// распаковка архива макета\r\n\t\t\t\t\t\t\t\t$Core_Tar = new Core_Tar($sTemplateFileUrl);\r\n\t\t\t\t\t\t\t\t$Core_Tar->extractModify($Site_Controller_Template->templatePath, $Site_Controller_Template->templatePath);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.write_error', $sTemplateFileUrl), 'error');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$flag = FALSE;\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Массив из файла template.xml\r\n\t\t\t\t\t\t$oTemplateContentXml = $Site_Controller_Template->loadSelectedTemplateXml();\r\n\r\n\t\t\t\t\t\tif ($oTemplateContentXml)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$aXmlFields = $oTemplateContentXml->xpath(\"fields/field\");\r\n\r\n\t\t\t\t\t\t\tif (count($aXmlFields))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t?><p><?php echo Core::_('install.template_data_information')?></p>\r\n\t\t\t\t\t\t\t\t<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" class=\"admin_table\">\r\n\t\t\t\t\t\t\t\t<tr class=\"admin_table_title\">\r\n\t\t\t\t\t\t\t\t\t<td><?php echo Core::_('install.table_field_param')?></td>\r\n\t\t\t\t\t\t\t\t\t<td><?php echo Core::_('install.table_field_value')?></td>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t\t$aFields = $Site_Controller_Template->getFields($aXmlFields);\r\n\r\n\t\t\t\t\t\t\t\tforeach ($aFields as $aFieldsValue)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$sFieldName = htmlspecialchars($aFieldsValue['Name']);\r\n\t\t\t\t\t\t\t\t\t$sFieldValue = htmlspecialchars($aFieldsValue['Value']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMacros = htmlspecialchars($aFieldsValue['Macros']);\r\n\t\t\t\t\t\t\t\t\t$sFieldExtension = htmlspecialchars($aFieldsValue['Extension']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMaxWidth = intval($aFieldsValue['MaxWidth']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMaxHeight = intval($aFieldsValue['MaxHeight']);\r\n\t\t\t\t\t\t\t\t\t$sFieldListValue = $aFieldsValue['ListValue'];\r\n\r\n\t\t\t\t\t\t\t\t\t$iFieldType = intval($aFieldsValue['Type']);\r\n\r\n\t\t\t\t\t\t\t\t\t// Название поля\r\n\t\t\t\t\t\t\t\t\t?><tr class=\"row\">\r\n\t\t\t\t\t\t\t\t\t\t<td><?php echo $sFieldName?></td>\r\n\t\t\t\t\t\t\t\t\t\t<td><?php\r\n\r\n\t\t\t\t\t\t\t\t\tswitch ($iFieldType)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tcase 0: // текст\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"50\" name=\"<?php echo $sFieldMacros?>\" value=\"<?php echo $sFieldValue?>\" />\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 1: // список\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<select name=\"<?php echo $sFieldMacros?>\">\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tif (count($sFieldListValue) > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($sFieldListValue as $option_key => $option_value)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $option_key?>\"><?php echo $option_value?></option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 2: // файл\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"file\" size=\"50\" name=\"<?php echo $sFieldMacros?>\" value=\"<?php echo $sFieldValue?>\" />\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tif (trim($sFieldExtension) != '')\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Разрешенные расширения файла\r\n\t\t\t\t\t\t\t\t\t\t\t\t?><br /><?php echo Core::_('install.allowed_extension', $sFieldExtension)?><?php\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif ($sFieldMaxWidth > 0 && $sFieldMaxHeight > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Максимальный размер файла\r\n\t\t\t\t\t\t\t\t\t\t\t\t?><br /><?php echo Core::_('install.max_file_size', $sFieldMaxWidth, $sFieldMaxHeight)?><?php\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 3: // большое текстовое поле\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<textarea name=\"<?php echo $sFieldMacros?>\" rows=\"5\" cols=\"47\"><?php echo $sFieldValue?></textarea>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t?></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?></table><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t?><p><?php echo Core::_('install.empty_settings')?></p><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_not_found', 'template.xml'), 'error');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'createSite':\r\n\t\t\t\t\t$iTemplateId = Core_Array::getPost('template_id');\r\n\t\t\t\t\t$iTemplateTypeId = Core_Array::getPost('template_type_id');\r\n\r\n\t\t\t\t\t// Копируем файлы из ./template/ в папку системы\r\n\t\t\t\t\tif (is_dir($Site_Controller_Template->templatePath . 'template'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_File::copyDir($Site_Controller_Template->templatePath . 'template', CMS_FOLDER);\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.template_files_copy_success'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.template_files_copy_error'), 'error');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (is_file($Site_Controller_Template->templatePath . 'template.php'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Замены в макете\r\n\t\t\t\t\t\t$aReplace = array();\r\n\r\n\t\t\t\t\t\t// Массив из файла template.xml\r\n\t\t\t\t\t\t$oTemplateContentXml = $Site_Controller_Template->loadSelectedTemplateXml();\r\n\r\n\t\t\t\t\t\tif ($oTemplateContentXml)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$aXmlFields = $oTemplateContentXml->xpath(\"fields/field\");\r\n\r\n\t\t\t\t\t\t\tif (count($aXmlFields))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$aFields = $Site_Controller_Template->getFields($aXmlFields);\r\n\r\n\t\t\t\t\t\t\t\t// цикл по дереву 'fields'\r\n\t\t\t\t\t\t\t\tforeach ($aFields as $aFieldsValue)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$sFieldName = $aFieldsValue['Name'];\r\n\t\t\t\t\t\t\t\t\t$sFieldMacros = $aFieldsValue['Macros'];\r\n\t\t\t\t\t\t\t\t\t$iFieldType = $aFieldsValue['Type'];\r\n\r\n\t\t\t\t\t\t\t\t\t// Файл\r\n\t\t\t\t\t\t\t\t\tif ($iFieldType == 2)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (isset($_FILES[$sFieldMacros]['tmp_name'])\r\n\t\t\t\t\t\t\t\t\t\t&& is_file($_FILES[$sFieldMacros]['tmp_name'])\r\n\t\t\t\t\t\t\t\t\t\t&& $_FILES[$sFieldMacros]['size'] > 0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$sFieldPath = $aFieldsValue['Path'];\r\n\t\t\t\t\t\t\t\t\t\t\t$sFieldExtension = $aFieldsValue['Extension'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$sExt = Core_File::getExtension($_FILES[$sFieldMacros]['name']);\r\n\t\t\t\t\t\t\t\t\t\t\t$aAllowedExt = explode(',', $sFieldExtension);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (strlen(trim($sFieldExtension)) == 0 || in_array($sExt, $aAllowedExt))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!move_uploaded_file($_FILES[$sFieldMacros]['tmp_name'], CMS_FOLDER . $sFieldPath))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_copy_error', $sFieldPath), 'error');\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_disabled_extension', $sFieldName), 'error');\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t// Остальные типы полей\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$aReplace[\"%{$sFieldMacros}%\"] = $_REQUEST[$sFieldMacros];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tinclude($Site_Controller_Template->templatePath . 'template.php');\r\n\r\n\t\t\t\t\t\tCore_Message::show(Core::_('install.template_install_success'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tCore_Message::show(Core::_('install.file_not_found', 'template.php'), 'error');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tis_dir($Site_Controller_Template->templatePath . 'template') && Core_File::deleteDir($Site_Controller_Template->templatePath . 'template');\r\n\t\t\t\t\t\tis_dir($Site_Controller_Template->templatePath . 'tmp') && Core_File::deleteDir($Site_Controller_Template->templatePath . 'tmp');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception $e){}\r\n\r\n\t\t\t\t\t$return = NULL;\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$this->_applyObjectProperty();\r\n\t\t\t\t\t$return = FALSE; // Показываем форму\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t}\r\n\r\n\t\tCore_Event::notify(get_class($this) . '.onAfterExecute', $this, array($operation));\r\n\r\n\t\treturn $return;\r\n\t}", "function cs_pb_client($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t\t$name = $_POST['action'];\n\t\t\t$counter = $_POST['counter'];\n\t\t\t$client_element_size = '50';\n\t\t\t$client_header_title = '';\n\t\t\t$client_gallery = '';\n\t\t\t$client_view = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$client_header_title = $cs_node->client_header_title;\n\t\t\t$client_gallery = $cs_node->client_gallery;\n\t\t\t$client_view = $cs_node->client_view;\n\t\t\t$client_element_size = $cs_node->client_element_size;\n\t\t\t\t$counter = $post->ID.$count_node;\n\t}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $client_element_size?>\" item=\"client\" data=\"<?php echo element_size_data_array_index($client_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"client_element_size[]\" class=\"item\" value=\"<?php echo $client_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Client's Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"client_header_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($client_header_title)?>\" />\n <p>Please enter header title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose Gallery/Album</label></li>\n <li class=\"to-field\">\n <select name=\"client_gallery[]\" class=\"dropdown\">\n \t<option value=\"0\">-- Select Gallery --</option>\n <?php\n $query = array( 'posts_per_page' => '-1', 'post_type' => 'cs_gallery', 'orderby'=>'ID', 'post_status' => 'publish' );\n $wp_query = new WP_Query($query);\n while ($wp_query->have_posts()) : $wp_query->the_post();\n ?>\n <option <?php if($post->post_name==$client_gallery)echo \"selected\";?> value=\"<?php echo $post->post_name; ?>\"><?php echo get_the_title()?></option>\n <?php\n endwhile;\n ?>\n </select>\n <p>Select gallery to show images.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Select View</label></li>\n <li class=\"to-field\">\n <select name=\"client_view[]\" class=\"dropdown\">\n <option <?php if($client_view==\"List View\")echo \"selected\";?> >List View</option>\n <option <?php if($client_view==\"Carousel View\")echo \"selected\";?> >Carousel View</option>\n </select>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"client\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public static function getTableHTML($cache){\n\n\t\t$current_time = time();\n\t\t$output = 'Refresh after: <b id=\"counter\"></b> second';\n\t\t$output .= '<table id=\"TableViewer\"><tr><th>Key</th><th>Slab</th><th>Size</th><th>Expiration Time</th><th>Expires In</th><th><a href=\"delete_all.php\">Delete ALL</a></th></tr>';\n\t\t$output .= '\n\t\t\t<script>\n\t\t\t\tcounter = Number(document.getElementById(\"refresh_rate\").value)\n\t\t\t\tdocument.getElementById(\"counter\").innerHTML = counter;\n\t\t\t\tfunction openWin(key) {\n\t\t\t\t\tvar url = \"value.php?key=\" + encodeURIComponent(key);\n\t\t\t\t\tvar clientWidth = document.documentElement.clientWidth;\n\t\t\t\t\tvar clientHeight = document.documentElement.clientHeight;\n\t\t\t\t\tmyWindow = window.open(url, \"memcache_value\" ,\"width=\" + (clientWidth - 200) + \",height=\" + (clientHeight - 100) + \",left=\" + (clientWidth/2 - (clientWidth - 200)/2) + \", top=\" + (clientHeight/2 - (clientHeight - 100)/2) + \",scrollbars=yes,resizable=yes,location=no,fullscreen=no,menubar=no,status=no,titlebar=no,toolbar=no\");\n\t\t\t\t\tmyWindow.focus();\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t</script>\n\t\t';\t\n\t\tforeach ($cache->items as $item){\n\t\t\t$item_value_piece = $item->getValuePiece();\n\t\t\tif (strlen($item_value_piece) == 500) {\n\t\t\t\t$item_value_piece = '<font class=\"html_value_piece_color\">' . $item_value_piece . '</font>...';\n\t\t\t} else {\n\t\t\t\t$item_value_piece = '<font class=\"html_value_color\">' . $item_value_piece . '</font>';\n\t\t\t}\n\n\t\t\t$output .= '<tr>';\n\n\t\t\t$output .= '<td class=\"key\"><font class=\"key_color\">' . $item->getKey() . '</font><br>' . $item_value_piece . '</td>';\n\t\t\t$output .= '<td class=\"slab\">' . $item->getSlab() . '</td>';\n\t\t\t$output .= '<td class=\"size\"><a href=\"javascript: openWin(\\'' . $item->getKey() . '\\');\" title=\"Show value...\">' . $item->getSize() . '</a></td>';\n\t\t\t$output .= '<td class=\"expiry_date\">' . $item->getFormattedTime() . '</td>';\n\t\t\t$output .= '<td class=\"expires_in\">' . $item->getFormattedTime($current_time) . '</td>';\n\t\t\t$output .= '<td class=\"delete\"><a href=\"delete.php?delete_item=' . urlencode($item->getKey()) . '\">delete</a></td>';\n\n\t\t\t$output .= '</tr>';\n\n\t\t}//foreach\n\n\t\t$output .= '</table>';\n\n\t\treturn $output;\n\n\t}", "function display_del_form() {\n global $cfg, $lang;\n \n if ($cfg['xml_lang'] == 'ja') {\n $h2_title = 'ログ削除';\n $h3_title = '全てのアクセスログを削除します。';\n $h3_msg = 'マジックワードを入力し、削除ボタンを押して下さい。';\n $h4_title = '※警告 : 使用上の注意';\n $h4_msg = 'このボタンは、テーブル内のデータを全て空にします。(空になるのはデータのみで、'.\n 'テーブルは削除されません。)<br />'.\n 'データベースを初期状態(空)に戻したい場合のみ、自己責任でご使用下さい。';\n } else {\n $h2_title = 'DELETE LOGS';\n $h3_title = 'DELETE ALL LOGS with magic words';\n $h3_msg = 'Enter the magic words and click the button.';\n $h4_title = 'WARNING : PLEASE USE THIS BUTTON WITH CARE.';\n $H4_msg = 'This button empties your log table. '.\n 'Yes, This button is very dangerous.<br />'.\n 'Please push this at your own risk.';\n }\n \n $delete_form =<<<EOD\n<h2>{$h2_title}</h2>\n<h3>{$h3_title}</h3>\n<p>{$h3_msg}</p>\n<div class=\"important\">\n<h4>{$h4_title}</h4>\n<p>{$h4_msg}</p>\n</div>\n<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">\n<p>\n{$lang['magic_words']} : \n<input tabindex=\"6\" accesskey=\"m\" type=\"text\" name=\"del\" value=\"\" />\n</p>\n<p>\n<input tabindex=\"6\" accesskey=\"d\" type=\"submit\" value=\"{$lang['del_all_logs']}\" />\n</p>\n</form>\nEOD;\n return $delete_form;\n}" ]
[ "0.62337923", "0.6058721", "0.5875817", "0.5849738", "0.5784982", "0.56534415", "0.5653009", "0.5653009", "0.56236994", "0.56135225", "0.55350953", "0.5499438", "0.54934025", "0.5467574", "0.53767633", "0.53647125", "0.53628564", "0.53628564", "0.5360391", "0.52873087", "0.5286593", "0.52720493", "0.5253926", "0.5253729", "0.525364", "0.5241037", "0.5238152", "0.5228622", "0.5221735", "0.52082956", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51973885", "0.5194459", "0.51940614", "0.51893556", "0.5168499", "0.5162667", "0.5158307", "0.5142541", "0.5134582", "0.5125442", "0.5121933", "0.51214826", "0.51185304", "0.51055485", "0.51053196", "0.5103264", "0.5100331", "0.509881", "0.5095553", "0.5095553", "0.5095553", "0.5094367", "0.50932264", "0.5092912", "0.5090355", "0.50860333", "0.5085802", "0.5077822", "0.507038", "0.5066635", "0.5065055", "0.5063174", "0.505954", "0.50568783", "0.5056756", "0.5055868", "0.5053823", "0.5052526", "0.5044976", "0.50448966", "0.5043756", "0.5039852", "0.503719", "0.50368655", "0.5033213", "0.5030007", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50262576", "0.50258994", "0.50219727", "0.5020549", "0.50198895", "0.50198895", "0.50070137", "0.5005616" ]
0.76216197
0
Get the default value from the settings configuration file, for the given setting name.
Получите значение по умолчанию из файла настроек конфигурации для заданного имени настройки.
private function getDefaultFromConfigFor($name) { list($module, $settingName) = explode('::', $name); return mconfig("$module.settings.$settingName.default", ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setting($name, $default = null) {\n $settings = get_option(sprintf('%s_settings', __CLASS__), array());\n return isset($settings[$name]) ? $settings[$name] : $default;\n }", "public function getSetting( $name, $default = null );", "protected function getSettingValue($name, $default = null)\n {\n \treturn Settings::get(strtolower($this->getKey()) . '_' . $name , $default);\n }", "function _get_setting($setting_name, $default = null)\n {\n $value = $this->getDb()->get_value('select value from mwg_setting where name=?', $setting_name); \n if ($value) return $value;\n\n $value = $this->getDb()->get_value('select value from settings where name=?', $setting_name); \n if ($value) {\n return stripslashes($value); \n } \n if ($default) {\n return $default;\n } \n return $value;\n }", "function sloodle_get_value($settings, $name, $default = null)\n {\n if (is_array($settings) && isset($settings[$name])) return $settings[$name];\n return $default;\n }", "public function get($name, $default=null) {\n\n if(isset($this->settings[$name])) {\n return $this->transformValueFromDatabase($this->settings[$name]['value'],$this->settings[$name]['type']);\n }\n\n /** @var Setting $setting */\n if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) {\n $this->addToCache($setting);\n return $this->transformValueFromDatabase($setting->getValue(),$setting->getType());\n }\n\n return $default;\n }", "public static function getSetting($setting_name)\n {\n return Settings::getSetting($setting_name);\n }", "private function getDefaultFromConfigFor($name)\n {\n return Arr::get($this->getConfigFor($name), 'default') ?: '';\n }", "public static function get($name, $default = null)\n {\n list($file_name) = explode('.', $name, 2);\n static::load($file_name);\n return \\Config::get('data::'.$name, $default);\n }", "function wpsl_get_default_setting( $setting ) {\n\n global $wpsl_default_settings;\n\n return $wpsl_default_settings[$setting];\n}", "public function get($name)\n {\n return (isset($this->settings[$name]) ? $this->settings[$name] : null);\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get($name) { \n \n if (isset($this->settings[$name])) return $this->settings[$name];\n return null;\n \n }", "public function get_default_setting($setting_name, $tool_id = 0)\n {\n return $this->get_setting(self::SETTING_TYPE_DEFAULT, $setting_name, $tool_id);\n }", "public function getSetting($name) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@name\t\t\t\tThe name of the settings key\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe value of the selected setting on success\n\t\t##\t\tFalse on failure\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_settings.value\n\t\tFROM\n\t\t\t{$this->wpdb->prefix}topspin_settings\n\t\tWHERE\n\t\t\tname = %s\nEOD;\n\t\treturn $this->wpdb->get_var($this->wpdb->prepare($sql,$name));\n\t}", "function get_default($setting_id) {\n if (isset($this->default_values[$setting_id])) {\n return $this->default_values[$setting_id];\n } else {\n return '';\n }\n }", "function get_setting($setting_id, $default_value = '') {\n //it doesn't requiers the tds_ prefix\n if (td_util::get_option('tds_' . $setting_id) == $this->get_default($setting_id)) {\n return $default_value;\n } else {\n return td_util::get_option('tds_' . $setting_id);\n }\n }", "public function getSetting($key, $default = null)\n {\n if (array_key_exists($key, $this->settings)) {\n return $this->settings[$key];\n }\n\n return $default;\n }", "public function getSetting($name, $default = null)\n {\n $settings = $this->getSettings();\n if (isset($settings[$name])) {\n if (empty($settings[$name]) && !is_null($default)) {\n return $default;\n }\n\n return $settings[$name];\n }\n\n if (!is_null($default)) {\n return $default;\n }\n\n return null;\n }", "public static function get($name, $default = null)\n {\n return isset(self::$config[$name]) ? self::$config[$name] : $default;\n }", "public function get($name)\n {\n if(array_key_exists($name, $this->settings)) {\n return $this->settings[$name];\n }\n\n return null;\n }", "function get_setting( $key, $default = '' ) {\n\t\t$this->get_settings();\n\n\t\tif ( isset( $this->settings[ $key ] ) ) {\n\t\t\treturn $this->settings[ $key ];\n\t\t}\n\n\t\treturn $default;\n\t}", "function get_defaultsetting() {\n return $this->defaultsetting;\n }", "protected function getSetting($key, $default_value = NULL) {\n $config = $this->config(static::SETTINGS);\n $setting = $config->get($key);\n\n if ($setting === NULL) {\n return $default_value;\n }\n return $setting;\n }", "public static function get_default_setting_value( $parent, $name ) {\n $fields = SUPER_Settings::fields();\n return $fields[$parent]['fields'][$name]['default'];\n }", "public static function get($name)\n {\n // Check if the setting is cached in our static array\n if (isset(self::$settings[$name])) {\n return self::$settings[$name];\n }\n\n $setting = DB::table('settings')\n ->select('value', 'serialized')\n ->where('name', $name)\n ->first();\n\n if (!$setting) {\n self::$settings[$name] = null;\n } elseif ($setting->serialized) {\n self::$settings[$name] = unserialize($setting->value);\n } else {\n self::$settings[$name] = $setting->value;\n }\n\n return self::$settings[$name];\n }", "public static function getSetting($setting_name)\n\t{\n\n\t\t//return SettingValue::where(\"setting_name\", \"=\", $setting_name)->where(\"user_id\",\"=\",Auth::user()->id)->firstOrFail();\n\n\t\t$q = \"SELECT setting_name, label, type, options, description, value, settings.id as id FROM settings \n\t\tRIGHT JOIN setting_values ON setting_values.setting_id=settings.id\n\t\tWHERE setting_name=? AND user_id=? LIMIT 1\";\n\n\t\t$result = DB::select($q,array($setting_name,Auth::user()->id));\n\n\t\tif (count($result) > 0) {\n\t\t\treturn $result[0];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getDefault($name)\n\t{\n\t\t$group = $this->getGroupFromName($name);\n\t\t$this->getDefaultGroup($group);\n\n\t\tif (isset($this->default_settings[$group][$name])) {\n\t\t\treturn $this->default_settings[$group][$name];\n\t\t}\n\n\t\treturn null;\n\t}", "function igit_config_get( $key, $default = null ) {\n\n // Return the default value if settings aren't set or the key is missing.\n if ( false === ( $settings = get_option( IGIT_SETTINGS ) ) || ! isset( $settings[$key] ) ) {\n return $default;\n };\n\n return $settings[$key];\n\n}", "public static function give($name, $default = null)\n\t{\n\t\tif ($setting = static::find($name))\n\t\t{\n\t\t\treturn $setting->value;\n\t\t}\n\n\t\treturn $default;\n\t}", "public function GetSettingValue($name)\r\n\t\t{\r\n\t\t\treturn $this->DB->GetOne(\"SELECT value FROM client_settings WHERE clientid=? AND `key`=?\",\r\n\t\t\t\tarray($this->ID, $name)\r\n\t\t\t);\r\n\t\t}", "public static function getSettings($name, $default = null)\n {\n /**\n * @var Bootstrap\n */\n $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');\n if (!($bootstrap instanceof Zend_Application_Bootstrap_BootstrapAbstract)) {\n return $default;\n }\n\n $settings = $bootstrap->getOption('settings');\n\n // return the default value if settings not found\n if (empty($settings) || !is_array($settings)) {\n return $default;\n }\n\n // lowercase all keys\n $name = strtolower($name);\n $settings = array_change_key_case($settings, CASE_LOWER);\n\n // return the default value if the specified key not found\n if (isset($settings[$name])) {\n return $settings[$name];\n }\n\n return $default;\n }", "function get_setting() {\n return get_config(NULL, $this->name);\n }", "private function get_setting($key,$default)\n\t{\n\t\t\t$sql=\"SELECT value FROM waf_settings WHERE name='\".$this->db->Q($key,1).\"'\";\n\t\t\t$result=$this->db->ROW_Q($sql);\n\t\t\tif($result==false)\n\t\t\t{\n\t\t\t\t //save default value \n\t\t\t\t\t$this->db->QUERY(\"INSERT INTO waf_settings (name,value) VALUES ('\".$this->db->Q($key,1).\"','\".$this->db->Q($default,1).\"')\");\n\t\t\t\t\treturn $default;\n\t\t\t}else{\n\t\t\t\t\treturn $result['value'];\n\t\t\t}\n\t}", "public static function get_setting($setting_name)\n\t{\n\t\tif (! isset(self::$_settings))\n\t\t{\n\t\t\t//Load the settings from DB if not already done\n\t\t\tself::get_settings();\n\t\t}\n\t\tif (array_key_exists($setting_name, self::$_settings))\n\t\t{\n\t\t\treturn self::$_settings[$setting_name];\n\t\t}\n\t\treturn null;\n\t}", "function get_setting($key, $default = null) {\r\n $settings = get_site_option( 'psts_settings' );\r\n $setting = isset($settings[$key]) ? $settings[$key] : $default;\r\n\t\treturn apply_filters( \"psts_setting_$key\", $setting, $default );\r\n\t}", "public function settings($name) {\n\t\treturn isset($this->settings[$name]) ? $this->settings[$name] : null;\n\t}", "public function get($setting, $default = '')\n {\n //Checks if $setting is string\n if (is_string($setting)) {\n //$setting is a string, checks if the given key is set in the top level of the $mergedConfig array.\n if (isset($this->mergedConfig[$setting])) {\n //The key is found, so return the value.\n return $this->mergedConfig[$setting];\n }\n } elseif (is_array($setting) && count($setting) > 0) {\n //$setting is a non-empty array. Let's drill down to find our value.\n return $this->getFromSubArray($setting, $this->mergedConfig, $default);\n }\n\n //$setting is not found in the MergedConfig array. Return the given default value.\n return $default;\n }", "public function getParameter($name, $default = null)\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n if (!isset($this->settings[$name])) {\n return $default;\n }\n \n return $this->settings[$name];\n }", "public function getConfigValue(string $name, $default = null)\n {\n if (isset($this->config[$name])) {\n return $this->config[$name];\n }\n\n return $default;\n }", "public function get_config($name, $default = null) {\n $this->load_config();\n return isset($this->config->$name) ? $this->config->$name : $default;\n }", "public function get_config($name, $default = null) {\n $this->load_config();\n return isset($this->config->$name) ? $this->config->$name : $default;\n }", "public function getDefault($name) {\n\t\tif (isset ( $this->_defaults [$name] )) {\n\t\t\treturn $this->_defaults [$name];\n\t\t}\n\t}", "protected static function get_config_setting($name, $key = null) {\n $value = Config::inst()->get(get_called_class(), $name);\n if ($key && $value && is_array($value) && array_key_exists($key, $value)) {\n return $value[$key];\n }\n return $value;\n }", "public function get(string $setting_key = '', $default_return = '');", "public function getSettingValueBySettingName($settingName)\n {\n $setting = Vip_Setting::getByNameAndCustomer($settingName, $this);\n if (!$setting) {\n return null;\n }\n return $setting->value;\n }", "public function get_setting($setting) {\n\t\treturn $this->settings[$setting] ?? null;\n\t}", "function store_setting_default($setting)\n {\n if (is_array($setting)) {\n return isset($setting['default']) ? $setting['default'] : null;\n }\n\n return $setting;\n }", "private function getConfig($key, $default = null)\n {\n return $this->config()->get(\"settings.{$key}\", $default);\n }", "public static function get(string $name, $default)\n {\n self::getInstance();\n\n $path = explode('.', $name);\n $conf = self::$config;\n\n for ($i=0; $i < count($path) - 1; $i++) {\n if (isset($conf->{$path[$i]})) {\n $conf = $conf->{$path[$i]};\n } else {\n return $default;\n }\n }\n \n $last = end($path);\n if (isset($conf->$last)) {\n return $conf->$last;\n }\n\n return $default;\n }", "public function setting($name, $group = 'settings', $default = null)\n {\n $value = Mage::getStoreConfig('trashcan/' . $group . '/' . $name);\n\n if (empty($value)) {\n $value = $default;\n }\n\n return $value;\n }", "public function findValue(string $settingName)\n {\n if ($setting = $this->findValueInstance($settingName)) {\n return $setting->getValue();\n } else {\n return null;\n }\n }", "public function getLayoutSetting($name, $default = null)\n\t{\n\t\treturn isset($this->_layoutsettings) ? $this->_layoutsettings->get($name, $default) : $default;\n\t}", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "public function __get($name): mixed {\n if (isset($this->data[$name]))\n return $this->data[$name];\n\n trigger_error(\n __(\"Requested configuration setting not found.\"),\n E_USER_NOTICE\n );\n\n return null;\n }", "private function theme_config_get($setting_name) {\n if ( VERSION >= '2.2.0.0' ) {\n return $this->config->get($this->config->get('config_theme') . substr($setting_name, 6) );\n } else { \n return $this->config->get($setting_name);\n }\n }", "public function getSettingValue()\n {\n if (array_key_exists(\"settingValue\", $this->_propDict)) {\n return $this->_propDict[\"settingValue\"];\n } else {\n return null;\n }\n }", "abstract public function findValueInstance(string $settingName): ?SettingValue;", "public function get($name, $default = null)\n {\n $names = explode('.', $name);\n /** @var Config $value */\n $value = '';\n foreach ($names as $item) {\n if ($value) {\n if (!is_object($value)) {\n return null;\n }\n $value = $value->get($item);\n } else {\n if (array_key_exists($item, $this->data)) {\n $value = $this->data[$item];\n } else {\n return $default;\n }\n }\n }\n return $value ?: $default;\n }", "public function get( $name, $default = null )\n\t{\n\t\t$name = trim( $name, '/' );\n\n\t\tif( isset( $this->negCache[ $name ] ) ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\tif( array_key_exists( $name, $this->cache ) ) {\n\t\t\treturn $this->cache[ $name ];\n\t\t}\n\n\t\tif( ( $value = $this->getValueFromArray( $this->config, explode( '/', $name ) ) ) === null ) {\n\t\t\t$value = parent::get( $name, null );\n\t\t}\n\n\t\tif( $value === null )\n\t\t{\n\t\t\t$this->negCache[ $name ] = true;\n\t\t\treturn $default;\n\t\t}\n\n\t\t$this->cache[ $name ] = $value;\n\t\treturn $value;\n\t}", "function getProperty($name, $default = '') {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n $optionValue = base_module_options::readOption($this->moduleGuid, $name, $default);\n return $optionValue;\n }", "public function getDefault()\n {\n return $this->config['config']['default'] ?? null;\n }", "function cspm_get_field_default($option_id, $default_value = ''){\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * We'll check if the default settings can be found in the array containing the \"(shared) plugin settings\".\r\n\t\t\t * If found, we'll use it. If not found, we'll use the one in [@default_value] instead. */\r\n\t\t\t \r\n\t\t\t$default = $this->cspm_setting_exists($option_id, $this->plugin_settings, $default_value);\r\n\t\t\t\r\n\t\t\treturn $default;\r\n\t\t\t\r\n\t\t}", "public function defaultSettings()\n {\n return $this->repository->get( $this->repoOptionString($this->settingsKey, $this->defaultSettingsKey), array());\n }", "public function getUnCached($name, $default=null) {\n\n /** @var Setting $setting */\n if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) {\n $this->addToCache($setting);\n return $this->transformValueFromDatabase($setting->getValue(),$setting->getType());\n }\n\n return $default;\n }", "public function getConfig($name = '', $default = null);", "public function getConfigValue(string $name, mixed $default = null): mixed\n {\n return array_get($this->getConfig(), $name, $default);\n }", "function setting($key = null, $default = null)\n {\n if (is_null($key)) {\n return app()->make('app-settings');\n }\n\n if (is_array($key)) {\n return app()->make('app-settings')->set($key);\n }\n\n return app()->make('app-settings')->get($key, value($default));\n }", "public function get(string $setting)\n {\n if (!$this->validate($setting)) {\n return false;\n }\n\n return $this->configuration->getConfigurationSetting($setting);\n }", "function get_user_setting($name, $default_value = \\false)\n {\n }", "static function Get($valueName)\n {\n if(isset(self::$settings[$valueName]))\n {\n return self::$settings[$valueName];\n }\n\n return false;\n }", "public function getFull($name) {\n\n if(isset($this->settings[$name])) {\n return $this->settings[$name];\n }\n\n /** @var Setting $setting */\n if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) {\n $this->settings[$name]=$setting->toArray();\n return $setting->toArray();\n }\n\n return null;\n }", "protected function get($name) {\n return $this->configuration->get($name);\n }", "public function __get( $name )\n {\n if ( $name === 'default' )\n {\n return $this->defaultValue;\n }\n }", "public static function get_setting( $setting_slug, $default_setting = null ) {\n\t\t\t$setting = \\Mediavine\\Settings::get_settings( $setting_slug );\n\n\t\t\tif ( isset( $setting->value ) ) {\n\t\t\t\treturn $setting->value;\n\t\t\t}\n\n\t\t\tif ( isset( $default_setting ) ) {\n\t\t\t\treturn $default_setting;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "public function configOffsetGet($name)\n {\n return $this->settings[$name];\n }", "public static function get($name)\n {\n self::loadConfiguration();\n\n return self::$configuration[$name] ?? null;\n }", "public function setting($settingPath, $default = false)\n {\n return arrayPath($this->config, $settingPath, $default);\n }", "public function getSetting() {}", "public function getSetting() {}", "function get($path=null, $default=null)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t\n\t\t\tif ($path==null) return $this->settings;\n\t\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$tmp = $this->settings;\n\t\t\tforeach($path as $pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\tif (!isset($tmp[$pointer])){\n\t\t\t\t\t\treturn $default;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = $tmp[$pointer];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $tmp;\n\t\t}", "public function get_config( $key, $default = false ) {\n\n global $id, $post;\n\n // Get the current post ID. If ajax, grab it from the $_POST variable.\n if ( defined( 'DOING_AJAX' ) && DOING_AJAX && array_key_exists( 'post_id', $_POST ) ) {\n $post_id = absint( $_POST['post_id'] );\n } else {\n $post_id = isset( $post->ID ) ? $post->ID : (int) $id;\n }\n\n // Get config\n $settings = get_post_meta( $post_id, '_eg_gallery_data', true );\n\n // Check config key exists\n if ( isset( $settings['config'][ $key ] ) ) {\n return $settings['config'][ $key ];\n } else {\n return $default ? $default : '';\n }\n\n }", "public function getOption($name)\n {\n return $this->config[$name] ?? null;\n }", "public static function getDefaultSetting($key)\n {\n $setting = self::$defaultSettings[$key];\n\n if ($setting) {\n return $setting;\n } else {\n return null;\n }\n }", "public static function getDefaultSetting($key)\n {\n $setting = self::$defaultSettings[$key];\n\n if ($setting) {\n return $setting;\n } else {\n return null;\n }\n }", "public function get( $name, $default = '' )\n\t\t{\n\t\t\tif ( isset( $this->_options[$name] ) )\n\t\t\t\treturn $this->_options[$name];\n\t\t\treturn $default;\n\t\t}", "public function getSetting($name, $format = 'Base')\n\t{\n\t\tif(isset($this->localSettings[$format][$name]))\n\t\t\treturn $this->localSettings[$format][$name];\n\n\t\tif(isset($this->localSettings['Base'][$name]))\n\t\t\treturn $this->localSettings['Base'][$name];\n\n\t\treturn self::loadSetting($name, $format, get_class($this));\n\t}", "function get_config_value($config_name)\n\t{\n\t\tglobal $db, $table_prefix;\n\t\t$sql = \"SELECT config_value\n\t\t\t\t\t\tFROM \" . CONFIG_TABLE . \"\n\t\t\t\t\t\tWHERE config_name = '\" . $config_name . \"'\n\t\t\t\t\t\tLIMIT 1\";\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\t$config_value = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $db->sql_fetchrow($result);\n\t\t\t$config_value = !empty($row['config_value']) ? $row['config_value'] : '';\n\t\t}\n\t\treturn $config_value;\n\t}", "public function getSetting( $sSettingName, $blUseModulePrefix = true )\n {\n return in_array( $sSettingName, $this->_aValidPaymorrowSettings )\n ? $this->_OxpsPaymorrowSettings_getSetting_parent( $sSettingName, true )\n : null;\n }", "public static function getDefault()\r\n {\r\n return self::get('default');\r\n }", "public static function get_default_element_setting_value($shortcodes=false, $group='', $tag='', $tab='', $name='') {\n if($shortcodes==false) $shortcodes = SUPER_Shortcodes::shortcodes();\n if(isset($shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'])){\n return $shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'];\n }else{\n return '';\n }\n }", "function stage_get_default($request, $pop = false)\n{\n return Settings::getDefault($request, $pop);\n}", "public function getConfig( $pName, $pDefault = NULL ) {\n\t\tif( empty( $this->mConfig ) ) {\n\t\t\t$this->loadConfig();\n\t\t}\n\t\treturn( empty( $this->mConfig[$pName] ) ? $pDefault : $this->mConfig[$pName] );\n\t}", "public function get_setting($name) {\n $namewithprefix = $this->info->modulename . '_' . $this->info->moduleid . '_' . $name;\n $result = null;\n foreach ($this->settings as $key => $setting) {\n if ($setting->get_name() == $namewithprefix) {\n if ($result != null) {\n throw new base_task_exception('multiple_settings_by_name_found', $namewithprefix);\n } else {\n $result = $setting;\n }\n }\n }\n if ($result) {\n return $result;\n } else {\n // Fallback to parent\n return parent::get_setting($name);\n }\n }", "function get_default_property($name)\r\n {\r\n return $this->defaultProperties[$name];\r\n }", "function get_setting($name)\n {\n }", "public static function getParam($name, $default = null)\n {\n if (static::$params === null) {\n static::$params = require(__DIR__ . '/data/config.php');\n }\n\n return static::$params[$name] ?? $default;\n }", "public static function find($name)\n {\n $desc = self::DESCRIPTIONS[$name] ?? null;\n\n if (!$desc) {\n // Setting is not defined.\n return null;\n }\n\n // Lookup the value\n return Setting::where('name', $name)->firstOrNew(['name' => $name]);\n }" ]
[ "0.78602695", "0.77412957", "0.7638977", "0.76162905", "0.7604542", "0.7297566", "0.7277362", "0.72270334", "0.7216146", "0.72081995", "0.7201563", "0.7175335", "0.7175335", "0.7175335", "0.71704745", "0.7091213", "0.7063575", "0.70430815", "0.70184755", "0.6948736", "0.692428", "0.6913602", "0.69103116", "0.6881181", "0.68293905", "0.6802864", "0.6787559", "0.6780665", "0.67673326", "0.6744669", "0.6732163", "0.6716344", "0.67161185", "0.6710115", "0.67002237", "0.6691147", "0.6668474", "0.6666035", "0.66509014", "0.6627264", "0.6620182", "0.6614883", "0.655704", "0.655704", "0.6554089", "0.6552686", "0.65516406", "0.65508676", "0.6545168", "0.65427625", "0.65156394", "0.6481445", "0.6451688", "0.6450059", "0.64402837", "0.643376", "0.64244014", "0.64124817", "0.64035946", "0.6395281", "0.6390354", "0.63855255", "0.6377167", "0.63764924", "0.63621783", "0.6346221", "0.6331733", "0.6317366", "0.62979645", "0.6278773", "0.62782466", "0.62482417", "0.6238603", "0.6234613", "0.62338823", "0.62018555", "0.6200074", "0.6182034", "0.61815417", "0.61741066", "0.61735034", "0.61735034", "0.61626583", "0.6156389", "0.61406535", "0.61378086", "0.61378086", "0.6133683", "0.61311704", "0.61309713", "0.612043", "0.61123455", "0.6105116", "0.61045295", "0.61024", "0.61010176", "0.6090549", "0.60894966", "0.60885596", "0.60804915" ]
0.7748094
1
Sets an attribute enabled/disabled. If the key did not exist before it will be created.
Устанавливает атрибут включённый/отключённый. Если ключ не существовал ранее, он будет создан.
public function setAttribute($scope, $key, $enabled);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function setAttribute($key, $value);", "public function set_attribute($key, $value) {\n\t\t$this->attributes[$key] = $value;\n\t}", "public function setAttribute($key, $value);", "public function setAttribute($key, $value);", "public function setAttribute($key, $value = null);", "public function _set($key, $value){\r\n\t\t$this->_attributes[$key] = $value;\r\n\t}", "public function setAttribute ($key, $value) {\n return parent::setAttribute(camel_case($key), $value);\n }", "public function AddAttribute($key, $value){\r\r\n\t\t$this->attributes[$key] = $value;\r\r\n\t}", "public function setAttribute($key, $value)\n {\n $this->attributes[$key] = $value;\n }", "public function setAttribute($key, $value)\n {\n if (in_array($key, $this->encryptable) === true) {\n $value = encrypt(decrypt_value($value));\n }\n\n /** @noinspection PhpUndefinedClassInspection */\n return parent::setAttribute($key, $value);\n }", "public function setAttribute($key, $value)\n {\n if (in_array($key, $this->encryptable)) {\n $value = Crypt::encrypt($value);\n }\n\n return parent::setAttribute($key, $value);\n }", "public function setAttribute($key, $value)\n {\n $isRememberTokenAttribute = $key == $this->getRememberTokenName();\n if (!$isRememberTokenAttribute)\n {\n parent::setAttribute($key, $value);\n }\n }", "public function setAttribute($key, $value)\n {\n $check = $key == $this->getRememberTokenName();\n if (!$check) {\n parent::setAttribute($key, $value);\n }\n }", "public function setAttribute($key, $value)\n {\n $isRememberTokenAttribute = $key == $this->getRememberTokenName();\n if (!$isRememberTokenAttribute)\n {\n parent::setAttribute($key, $value);\n }\n }", "public function setAttribute($key, $value)\n {\n // Before Event\n if (($_value = $this->fireEvent('model.beforeSetAttribute', [$key, $value], true)) !== null) {\n $value = $_value;\n }\n\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set on\n // the model, such as \"json_encoding\" an listing of data for storage.\n if ($this->hasSetMutator($key)) {\n $method = 'set'.Str::studly($key).'Attribute';\n // If we return the returned value of the mutator call straight away, that will disable the firing of \n // 'model.setAttribute' event, and then no third party plugins will be able to implement any kind of \n // post processing logic when an attribute is set with explicit mutators. Returning from the mutator \n // call will also break method chaining as intended by returning `$this` at the end of this method.\n $this->{$method}($value);\n }\n else {\n $this->attributes[$key] = $value;\n }\n\n // After Event\n $this->fireEvent('model.setAttribute', [$key, $value]);\n\n return $this;\n }", "public function setAttribute($key, $value)\n {\n if (!$key == $this->getRememberTokenName()) {\n parent::setAttribute($key, $value);\n }\n }", "public function __set($key, $value)\n {\n $this->attributes[$key] = $value;\n }", "public function setAttribute($key, $value)\n {\n //The type of a value used in the app may be different then how it is \n //stored in the database. Therefore, mutate it to a value to be stored\n //in the database.\n $value = $this->encodeAttributeValue($key,$value);\n\n return parent::setAttribute($key, $value);\n }", "function insert_attr($key, $value) {\n $this->other_attr[$key] = $value;\n }", "public function setAttribute($key, $value)\n {\n $isRememberTokenAttribute = $key == $this->getRememberTokenName();\n if (! $isRememberTokenAttribute) {\n parent::setAttribute($key, $value);\n }\n }", "public function setAttribute($key, $value)\n {\n $isRememberTokenAttribute = $key == $this->getRememberTokenName();\n if (!$isRememberTokenAttribute) {\n parent::setAttribute($key, $value);\n }\n }", "public function enableFlag()\n {\n $this->state->setItem(self::SAFE_ATTRIBUTE_FLAG, true);\n }", "public function setAttribute($key, $value)\n\t{\n\t\t$isRememberTokenAttribute = $key == $this->getRememberTokenName();\n\t\tif (!$isRememberTokenAttribute)\n\t\t{\n\t\t\tparent::setAttribute($key, $value);\n\t\t}\n\t}", "public function setAttributes();", "public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for\n // the set operation which simply lets the developers\n // tweak the attribute as it is set on the model.\n if ($this->hasSetMutator($key)) {\n $method = 'set' . studly_case($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n // TODO: handle dates\n\n // TODO: handle casts/datatypes\n\n $this->attributes[$key] = $value;\n }", "public function setAttribute($key, $value)\n {\n // Convert _id to ObjectID.\n if ($key == '_id' and is_string($value)) {\n $builder = $this->newBaseQueryBuilder();\n\n $value = $builder->convertKey($value);\n } elseif (str_contains($key, '.')) {\n if (in_array($key, $this->getDates()) && $value) {\n $value = $this->fromDateTime($value);\n }\n\n array_set($this->attributes, $key, $value);\n\n return;\n }\n\n parent::setAttribute($key, $value);\n }", "public function setAttribute($key, $value)\n {\n if ($value !== null && in_array($key, $this->encrypted ?? [])) {\n $value = Crypto::encrypt($value);\n }\n\n return parent::setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->attributes[$key] = $value;\n $this->attributes_updated[] = $key;\n }", "public function addAttr($key, $value): void\n {\n $this->attrs[$key] = $value;\n }", "public function setAttribute($key, $value)\n {\n $value = $this->applyMutators($key, $value);\n\n return parent::setAttribute($key, $value);\n }", "public function setAttribyteKey($value)\n {\n $this->_attribyteKey = $this->_db->prepareString($value);\n }", "public function setAttr($attribute, $value) {\n $this->attributes[$attribute] = $value;\n }", "public function __set($key, $value)\n \t{\n \t\t// If the key is a relationship, add it to the ignored attributes.\n \t\t// Ignored attributes are not stored in the database.\n \t\tif (method_exists($this, $key)) {\n \t\t\t$this->ignore[$key] = $value;\n \t\t} else {\n \t\t\t$this->attributes[$key] = $value;\n \t\t\t$this->dirty[$key] = $value;\n \t\t}\n \t}", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function __set($key, $value)\n {\n $this->setAttribute($key, $value);\n }", "public function setAttribute(string $attribute, string $value);", "public function set_attribute($name, $value)\n {\n }", "public function enable()\n\t{\n\t\t$this->disabled_at = null;\n\t\t$this->disabled_by_user_id = null;\n\t\t$this->save();\n\t}", "public function setAttribute($key, $value)\n {\n $data = $this->getDataType($key);\n\n if ($data) {\n $value = (new $data($key, $this))->set($value);\n }\n\n return parent::setAttribute($key, $value);\n }", "public function setAttribute($attribute, $value)\n {\n }", "public function add_attrib($key, $val)\n {\n $this->_attribs = array_merge(array($key => $val), $this->_attribs);\n }", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public function addCustomAttribute($key, $value = null)\n {\n $this->CUSTOMATTRIBUTES[$key] = $value;\n }", "public function set($attr, $value) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] = $value : false;\n }", "function boolean_tag_attribute($key)\r\n{\r\n return tag_attribute($key, $key);\r\n}", "public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set.\n if ($this->hasSetMutator($key)) {\n $method = 'set' . Str::studly($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n // If an attribute is listed as a \"date\", we'll convert it from a DateTime\n // instance into a form proper for storage on the database tables using\n // the connection grammar's date format. We will auto set the values.\n if ($value && in_array($key, $this->getDates())) {\n $value = $this->asDateTime($value);\n }\n\n // If an attribute is listed as media, we'll convert it to the correct\n // media object.\n if (in_array($key, $this->media)) {\n $value = new Media($value);\n }\n\n $this->attributes[$key] = $value;\n\n return $this;\n }", "public function set_attribute( $attribute_name = '', $value = null ) {\n\t\t\n\t\t$this->attributes[$attribute_name] = $value;\n\t\t\n\t}", "public function setAttribute($key, $value)\r\n\t{\r\n\t\t$this->attr[$key] = $value;\r\n\r\n\t\treturn $this;\r\n\t}", "public function setAttribute($key, $value): void\n {\n if ($this->hasCast($key)) {\n $this->attributes[$key] = $this->castAttribute($key, $value);\n } else {\n $this->attributes[$key] = $value;\n }\n }", "public function setAttribute($key, $value): void\n {\n if ($attachment = $this->getAttachment($key)) {\n $attachment->attach($value);\n }\n else {\n parent::setAttribute($key, $value);\n }\n }", "public function setAttribute($attribute, $value) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t\t'*', tx_newspaper::getTable($this), $this->condition\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->attributes[$attribute] = $value;\n\t}", "public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}", "public function setAttribute($attribute, $value) {\n #Seems a bit too straightforward, no?\n $this->attributes[$attribute] = $value;\n return true;\n }", "function set_att($key, $val) {\n\t\n\t\tswitch ($key) :\n\t\t\t\n\t\t\tcase 'method':\n\t\t\t\tif (! in_array($val, array('post', 'get'))) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'enctype':\n\t\t\t\tif (! in_array($val, array('application/x-www-form-urlencoded', 'multipart/form-data'))) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'markup':\n\t\t\t\tif (! in_array($val, array('html', 'xhtml'))) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'class':\n\t\t\tcase 'id':\n\t\t\t\tif (! $this->_check_valid_attr($val)) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'novalidate':\n\t\t\tcase 'add_honeypot':\n\t\t\t\tif (! is_bool($val)) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'add_nonce':\n\t\t\t\tif (! is_string($val) && !is_bool($val)) return false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault: \n\t\t\t\treturn false;\n\t\t\t\n\t\tendswitch;\n\t\t\n\t\t$this->form[$key] = $val;\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public function setAttributeName(?string $value): void {\n $this->getBackingStore()->set('attributeName', $value);\n }", "private function ensureKey($key, $value = null)\n {\n if (!$this->has($key)) {\n $this->attributes[$key] = new Attribute($value);\n }\n return $this;\n }", "public function attr($key, $value) {\n\t\t$this->_attrs[$key] = $value;\n\t\treturn $this;\n\t}", "public function setAttribute($key, $value)\n {\n //We want file name from file helper\n if ( $value instanceof Admin\\Core\\Helpers\\File ){\n $value = $value->filename;\n }\n\n return parent::setAttribute($key, $value);\n }", "public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set on\n // the model, such as \"json_encoding\" an listing of data for storage.\n if ($this->hasSetMutator($key)) {\n $method = 'set'.Str::studly($key).'Attribute';\n\n return $this->{$method}($value);\n }\n\n if ($this->isJsonCastable($key) && ! is_null($value)) {\n $value = $this->castAttributeAsJson($key, $value);\n }\n\n // If this attribute contains a JSON ->, we'll set the proper value in the\n // attribute's underlying array. This takes care of properly nesting an\n // attribute in the array's value in the case of deeply nested items.\n if (Str::contains($key, '->')) {\n return $this->fillJsonAttribute($key, $value);\n }\n\n $this->attributes[$key] = $value;\n\n return $this;\n }", "function attribute($key) {\n\t\t$this->load_attributes();\n\t\tif (!array_key_exists($key, $this->_attributes)) {\n\t\t\tif (isset($this->_parent)) {\n\t\t\t\t// attribute is not set, look in the parent\n\t\t\t\t// note: key not set != null value\n\t\t\t\t// the latter indicates the parent doesn't have the attribute either\n\t\t\t\t// \"child key\" overrides \"key\"\n\t\t\t\t$attr = $this->_parent->attribute(\"child $key\");\n\t\t\t\tif ($attr === NULL) {\n\t\t\t\t\t// are we allowed to inherit?\n\t\t\t\t\t$inherit = $this->_parent->attribute(\"inherit $key\");\n\t\t\t\t\tif ($inherit === NULL || $inherit) {\n\t\t\t\t\t\t$attr = $this->_parent->attribute($key);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attr = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$attr = NULL;\n\t\t\t}\n\t\t\t$this->_attributes[$key] = $attr;\n\t\t} else {\n\t\t\t$attr = $this->_attributes[$key];\n\t\t}\n\t\tif (is_null($attr)) {\n\t\t\tglobal $attribute_defaults;\n\t\t\treturn isset($attribute_defaults[$key]) ? $attribute_defaults[$key] : NULL;\n\t\t} else {\n\t\t\treturn $attr;\n\t\t}\n\t}", "public function setAttribute($key, $value)\n {\n $this->attributes[$key] = $value;\n\n return $this;\n }", "public function setAttribute($key, $value)\n {\n $this->attributes[$key] = $value;\n\n return $this;\n }", "public function setDisabledYes()\n\t{\n\t\t$this->setAttribute( \"disabled\");\n\t}", "public function setAttribute($key, $value)\n {\n if (is_string($value)) {\n $value = trim($value);\n }\n\n if (empty($value) && $value != \"0\") {\n $value = null;\n }\n\n parent::setAttribute($key, $value);\n }", "public function setAttribute($name, $value);", "public function hasAttribute($key);", "public static function addattr($key,$value,$id)\n {\n $cartt = new Cart_storage;\n $cartt->cart_id = $id;\n $cartt->key_name = $key;\n $cartt->value = $value;\n $cartt->save();\n }", "function addAttribute($name, $value) {\n $this->_attributes[$name] = $value;\n }", "public function offsetSet($key, $value)\n {\n if (is_null($key)) {\n $this->attributes[] = $value;\n } else {\n $this->attributes[$key] = $value;\n }\n }", "public function setAttribute($key, $value)\n {\n $value = $value ? $value : self::UNKNOWN;\n\n $this->attributes[$key] = $value;\n\n return $this;\n }", "protected function _setBooleanValue($key, $value) {}", "public function setAttribute($key, $value)\n {\n $key = strtolower($key);\n if ( ! is_array($value)) {\n $value = [\n 'value' => $value,\n 'doubleQuote' => true,\n 'didConvertCharset' => true, \n ];\n }\n $this->attr[$key] = $value;\n\n return $this;\n }", "public function __isset($key)\n {\n if (isset($this->attributes[$key])) {\n return true;\n }\n\n return false;\n }", "function useattrib($attribute) { atkuse(\"attribute\", $attribute); }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);}", "public function setAttribute($key, $value)\n {\n // pass arrays and untranslatable attributes to the parent method\n if (!$this->isTranslatableAttribute($key) || is_array($value) || is_null($value) || $value instanceof Collection) {\n return parent::setAttribute($key, $value);\n }\n\n // if the attribute is translatable and not already translated (=array),\n // set a translation for the current app locale\n return $this->setTranslation($key, $this->getLocale(), $value);\n }", "public function setAttribute($attribute, $value)\n {\n $this->_options[$attribute] = $value;\n return true;\n }", "public function setDisabled($disabled);", "public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }", "public function setreviewedAttribute()\n {\n $attribute_name = \"reviewed\";\n\n $this->attributes[$attribute_name] = 1;\n }", "public function setAttribute($key, $value)\n {\n if ($this->hasSetMutator($key)) {\n $method = 'set'.Str::studly($key).'Attribute';\n\n return $this->{$method}($value);\n }\n if ( $key == 'id' ) {\n $key = \"_id\";\n }\n // Convert _id to ObjectID.\n if ($key == '_id' and is_string($value)) {\n $builder = $this->newBaseQueryBuilder();\n $value = $builder->convertKey($value);\n }\n\n $this->fireModelEvent('setAttributeBefore', [$key, $value]);\n\n if(array_key_exists($key, $this->schema)) {\n if(!is_object($value)) {\n $value = new $this->schema[$key]($value, $this, null);\n }\n }\n\n if($value instanceof UTCDateTime) {\n $value = Carbon::createFromTimestampUTC($value->toDateTime()->getTimestamp());\n }\n\n if(is_array($value)) {\n $value = new Field($value, $this, null);\n }\n\n $this->attributes[$key] = $value;\n\n $this->fireModelEvent('setAttributeAfter', [$key, $value]);\n\n return $this;\n }", "public function enable() {\n\t\t$this->update(FALSE);\n\t}", "public function setAttributes($attributes){ }", "public function define_attribute($attribute,$value)\n\t\t{\n\t\t\tif(!isset($this->matchcode[$attribute]))\n\t\t\t{\n\t\t\t\terror_log(__FILE__.' name '.$attribute.' not defined in matchcode array');die();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->matchcode[$attribute][1] == 'A' || $this->matchcode[$attribute][1] == 'W')\n\t\t\t\t{\n\t\t\t\t\t$var = $this->matchcode[$attribute][0];\n\t\t\t\t\t$this->$var = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log(__FILE__.' name '.$attribute.' no write access');die();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function isDisableTypoToleranceOnAttributes(string $key, $value): bool\n {\n return is_string($key) && Str::is(self::$disableTypoToleranceOnAttributesKeys, $key);\n }", "public function offsetSet($key, $value)\n {\n $this->attributes->put($key, $value);\n }", "public function setAttribute($name, $value)\n {\n if (in_array($name, static::$fields)) {\n $this->attributes[$name] = $value;\n }\n }" ]
[ "0.6924575", "0.6823728", "0.68034005", "0.68034005", "0.65354806", "0.6435138", "0.641523", "0.63617706", "0.6349097", "0.6324979", "0.63225937", "0.63211936", "0.6284109", "0.6248734", "0.6141958", "0.61410046", "0.6135718", "0.6128029", "0.61217177", "0.60954297", "0.6087024", "0.60858804", "0.6080449", "0.59904957", "0.5972673", "0.5955908", "0.5948254", "0.5942679", "0.5927162", "0.5897789", "0.5891972", "0.58885866", "0.5834974", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5820602", "0.5799552", "0.57984406", "0.57717776", "0.5708179", "0.56972826", "0.56814134", "0.56775314", "0.56771356", "0.566179", "0.56355804", "0.56316644", "0.562944", "0.5626408", "0.5617723", "0.5611006", "0.5610685", "0.56019133", "0.5596196", "0.55902165", "0.5586823", "0.55826753", "0.5570566", "0.5564923", "0.55610704", "0.5552621", "0.55403286", "0.55403286", "0.55362254", "0.54972905", "0.5492802", "0.54898715", "0.5484245", "0.5470678", "0.5437094", "0.5433081", "0.5421974", "0.54139155", "0.54120946", "0.5403131", "0.5396201", "0.5391648", "0.5390823", "0.53849417", "0.53731155", "0.5369832", "0.5368539", "0.5356475", "0.53542113", "0.53526527", "0.5348415", "0.5347672", "0.53423905", "0.53386474", "0.5334739", "0.53314173" ]
0.74649954
0
Returns the API url of this document This can be extended by adding: 'slide/x/' to retrieve slide number x for a presentation or with 'image/' to retrieve the resized image of an image document
Возвращает URL API этого документа. Это можно расширить, добавив: 'slide/x/' для получения слайда x в презентации или 'image/' для получения масштабированного изображения документа-изображения.
public function getApiUrl() { if(in_array($this->getType(), array('presentation', 'document'))) { return SERVER_PROTOCOL .'://'. SERVER_ADDRESS .':'.SERVER_PORT . SERVER_ROOT .'/api/'. $this->getType() .'/'. $this->getId() .'/'; } else { return SERVER_PROTOCOL .'://'. SERVER_ADDRESS .':'.SERVER_PORT . SERVER_ROOT .'/api/file/'. $this->getId() .'/'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrl()\n {\n return $this->api\n . '?method='\n . $this->getMethod()\n . '&api_key='\n . $this->getApiKey()\n . '&tags='\n . $this->getTag()\n . '&per_page='\n . $this->getPerPage()\n . '&page='\n . $this->getPage()\n . '&format='\n . $this->getFormat()\n . '&photo_id='\n . $this->getPhotoId()\n . '&nojsoncallback=1';\n }", "public function getDocumentationUrl();", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "public function getDocBaseUrl() {\n\t\treturn 'https://docs.nextcloud.com';\n\t}", "public function getDocumentUrl() {\n Yii::$app->params['uploadUrl'] = Yii::$app->urlManager->baseUrl . '/web/pdf/estrategias/';\n// return a default image placeholder if your source avatar is not found\n $evidencias = isset($this->evidencias) ? $this->evidencias : null;\n return Yii::$app->params['uploadUrl'] . $evidencias;\n }", "public function url()\n {\n return route('documents.show', $this->uuid);\n }", "public function getDocumentUrl() {\n Yii::$app->params['uploadUrl'] = Yii::$app->urlManager->baseUrl . '/web/pdf/subproyectos/';\n// return a default image placeholder if your source avatar is not found\n $evidencias = isset($this->evidencias) ? $this->evidencias : null;\n return Yii::$app->params['uploadUrl'] . $evidencias;\n }", "public function GetDocUri(){\r\n\t\treturn (is_null($this->PhpUri))?$this->EndPoint:$this->DocUri;\r\n\t}", "public function getApiUrl()\n {\n return $this->fullApiUrl;\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "public function getUrl()\n {\n return $this->apiUrl;\n }", "private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }", "public function getApiUrl()\n\t{\n\t\treturn $this->api_url;\n\t}", "function get_oembed_endpoint_url($permalink = '', $format = 'json')\n {\n }", "public function getApiUrl() {\n return is_null( $this->_apiUrl ) ? self::API_URL : $this->_apiUrl;\n }", "public function getApiUrl()\n {\n return $this->api;\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "protected function urlBase()\n {\n return \"/bibs/{$this->bib->mms_id}/representations/{$this->representation_id}\";\n }", "function getApiUrl()\n {\n return $this->_props['ApiUrl'];\n }", "protected function getDefaultBaseApiUrl()\n {\n return new Uri('https://api.soundcloud.com/');\n }", "public function getApiUrl()\n {\n $defaultUrl = $this->getTestMode()\n ? $this->testApiHost\n : $this->prodApiHost;\n\n return $this->parameters->get('apiUrl', $defaultUrl);\n }", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "public function getApiUrl() \n {\n return ( $this->getSSL() ? 'https://' : 'http://' ) . $this->_api_url;\n }", "protected function getApiUrl() {\n\t\treturn $this->_apiurl;\n\t}", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "public function getUrl()\n\t{\n\t\treturn '/images/blog/' . $this->name;\n\t}", "public function getDirectUrl(): string\n {\n return $this->directUrlBase . $this->templateId . '.png?' . http_build_query($this->buildQuery());\n }", "public function get_preview_url()\n {\n }", "public function get_documentation_url() {\n\n\t\treturn 'https://docs.woocommerce.com/document/woocommerce-print-invoice-packing-list/';\n\t}", "public function getURL();", "public function getURL();", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function get_documentation_url() {\n\t\treturn 'http://docs.woocommerce.com/document/woocommerce-avatax/';\n\t}", "function api_url() {\n\t// Bail if the ID isn't set. This is intended to be an authoritative URL, so it's no help if the feed name doesn't exist.\n\tif ( ! get_id() ) {\n\t\treturn false;\n\t}\n\n\treturn JUICER_ENDPOINT . get_id();\n}", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "private function urlWrapper() {\n return $this->baseURL;\n }", "public function url();", "public function url();", "public function url();", "public function getApiUrl(): string\n {\n return $this->apiUrl;\n }", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function getApiUrl()\n {\n return $this->apiUrl;\n }", "public function getApiUrl()\n {\n return $this->apiUrl;\n }", "public function getApiUrl()\n {\n return $this->apiUrl;\n }", "public function getApiUrl()\n {\n switch ($this->getApiMode()) {\n case Carrier::MODE_PRODUCTION:\n return $this->scopeConfig->getValue(self::XML_PATH_PRODUCTION_API_URL, ScopeInterface::SCOPE_WEBSITES);\n default:\n return $this->scopeConfig->getValue(self::XML_PATH_TESTING_API_URL, ScopeInterface::SCOPE_WEBSITES);\n }\n }", "public function getURL ();", "public function getUrl() {\n\t\t$this->getRublon()->log(__METHOD__);\n\t\treturn $this->getRublon()->getAPIDomain() .\n\t\t\tself::URL_PATH_CODE .\n\t\t\turlencode($this->getUrlParamsString());\n\t}", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "public function getThumbnailUrl();", "public static function getApiUrl()\n {\n return self::$apiUrl;\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public abstract function getApiUrl($url);", "protected function getApiUrl(): string\n {\n return preg_replace($this->regexPattern,$this->currencyDate,$this->apiEndpoint);\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public abstract function getURL();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function uri();", "public function uri();", "public function uri();", "public function get_documentation_url() {\n\t\treturn 'https://docs.woocommerce.com/document/cost-of-goods-sold/';\n\t}", "public function url(): string;", "protected function getDefaultBaseApiUrl()\n {\n return new Uri('https://api.instagram.com/v1/');\n }", "protected function ___url() {\n\t\treturn $this->pagefiles->url . $this->basename;\n\t}", "public function get_url();", "protected function _getUrl()\n {\n return Router::url([\n '_name' => 'wikiPages',\n 'id' => $this->id,\n 'slug' => Inflector::slug($this->title)\n ]);\n }", "public function url(): string\n {\n return Uri::current()->setPath($this->name)->setSlash(true)->toString();\n }", "public function url() {\n return Magic::url();\n }", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "public function getApiQueryURL()\n {\n return $this->apiQuery;\n }", "public function getContentUrl();", "public function getURLDokumenta()\n {\n return $this->URLDokumenta;\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "public function getPublicUrlAttribute()\n {\n $year = $this->date->format('Y');\n $month = $this->date->format('m');\n $day = $this->date->format('d');\n\n return url(\"/noticias/{$year}/{$month}/{$day}/{$this->slug}\");\n }", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "public function getUrl()\n {\n return $this->url_format;\n }", "function generate_rapi_endpoint($api_url, $api_key, $addition = \"\", $page_limit = false, $params = \"\") {\n $qparams['q'] = $params;\n if ($page_limit) {\n $qparams['page_limit'] = $page_limit;\n }\n $qparams['apikey'] = $api_key;\n $endpoint = $api_url . $addition . '?' . http_build_query($qparams);\n return $endpoint;\n}", "public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "public function get_image_url()\n {\n }", "public function getUrl()\n {\n if (!$this->filename) {\n return null;\n }\n\n return $this->base_url . '/' . $this->filename;\n }", "private static function get_endpoint() {\n\t\treturn tvd_get_service_endpoint() . '/pdf-from-url';\n\t}", "public function getUrl()\n {\n $httpRequest = $this->httpClient->get($this->getEndpoint() . '?' . http_build_query($this->getData(), '', '&'));\n return $httpRequest->getUrl();\n }", "protected function getBaseApiUrl()\n {\n $customApiUrl = $this->configModel->get('github_frontend_api_url');\n\n if (! empty($customApiUrl)) {\n if (substr($customApiUrl, -1) !== '/') {\n return $customApiUrl.'/';\n }\n\n return $customApiUrl;\n }\n\n return self::DEFAULT_API_URL;\n }", "private function getApiUrl()\n {\n if (!empty($this->options['api-url'])) {\n return $this->options['api-url'];\n }\n if (!empty(getenv('WPC_API_URL'))) {\n return getenv('WPC_API_URL');\n }\n return '';\n }", "public function getUri();" ]
[ "0.6633188", "0.65852696", "0.6496659", "0.6393424", "0.6325681", "0.62989026", "0.6289788", "0.60982656", "0.6094479", "0.6067897", "0.6042629", "0.60171366", "0.6014391", "0.59536827", "0.5936316", "0.593505", "0.5934434", "0.5914987", "0.5914863", "0.5908345", "0.5908135", "0.5890461", "0.58661", "0.5854971", "0.58465135", "0.58437765", "0.5819006", "0.58129996", "0.58129746", "0.58058476", "0.57819635", "0.57754654", "0.5764821", "0.5764821", "0.57593185", "0.5757624", "0.57432705", "0.57289666", "0.57260585", "0.57226986", "0.57226986", "0.57226986", "0.5718005", "0.5713873", "0.5710812", "0.5710812", "0.5710812", "0.570673", "0.5705128", "0.56980234", "0.5685835", "0.56507015", "0.56286865", "0.5628296", "0.5620305", "0.5605715", "0.56040347", "0.55997074", "0.5598926", "0.5598926", "0.5598926", "0.5598926", "0.5598926", "0.5598926", "0.5598926", "0.5598926", "0.55928975", "0.55928975", "0.55928975", "0.5592708", "0.55923617", "0.5589057", "0.5586923", "0.55852604", "0.5578517", "0.55766565", "0.557463", "0.5567118", "0.55641866", "0.5551159", "0.55126673", "0.5506981", "0.5495004", "0.5492169", "0.54756147", "0.54756147", "0.54756147", "0.54737425", "0.5471703", "0.546397", "0.5456043", "0.5452624", "0.544865", "0.54387623", "0.5437165", "0.5435522", "0.54333246", "0.5429759", "0.54270744", "0.5424213" ]
0.737505
0
Returns the modification date of this document
Возвращает дату последнего изменения этого документа
public function getModificationDate() { return $this->modificationDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModificationDate()\n {\n return $this->modificationDate;\n }", "public function get_modification_date()\n {\n return $this->get_default_property(self::PROPERTY_MODIFICATION_DATE);\n }", "public function getDateModification()\n {\n return $this->dateModification;\n }", "public function getModifyDate()\n {\n return $this->modifyDate;\n }", "public function getModifiedDate()\n\t{\n\t\treturn $this->_mdate;\n\t}", "public function get_date_modified();", "public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}", "public function getModifiedDate() : \\DateTime {\n return $this->modifiedDate;\n }", "public function getModificationTime()\n {\n return $this->fileStructure->mtime;\n }", "public function getDateModified()\n {\n return $this->_DateModified;\n }", "public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }", "public function getDateModified()\n {\n return $this->dateModified;\n }", "function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "public function getLastModificationDateTime() {\n $timestamp = $this->getUpdatedAt();\n // we don't know when the module content is updated, so we \"guess\"\n if ($this->getModule() != '') {\n $timestamp->setDate(date('Y'), date('m'), date('d'));\n }\n return $timestamp;\n }", "public function getModDate() \r\n { \r\n return $this->_modDate; \r\n }", "public function getModate()\n {\n return $this->modate;\n }", "public function getModDate();", "public function getLastModificationDate()\n {\n return new \\DateTimeImmutable($this->getData('last_modification_date', 0), 'Europe/Moscow');\n }", "public function getModificationDate($asString = true) {}", "public function getDateModified(): DateTime\n {\n return $this->dateModified;\n }", "public function getModifed(): DateTime\n {\n $DateTime = new DateTime();\n $DateTime->createFromFormat('U', filemtime($this->filePath));\n return $DateTime;\n }", "public function getDateModified();", "public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}", "public function getModifiedOn(): \\DateTime\n {\n return $this->modifiedOn;\n }", "public function getModeratorUpdatedDate();", "public function getLastModify()\n\t{\n\t\treturn $this->last_modify;\n\t}", "public function getModifiedAt()\n {\n return $this->getProperty(self::MODIFIED_AT);\n }", "public function getRevisionDate()\n {\n return $this->revisionDate;\n }", "public function last_modified() {\n\t\treturn $this->timestamp;\n\t}", "public function getModificationTime() {}", "public function getModificationTime() {}", "public function getModifiedAt()\n {\n return $this->modifiedAt;\n }", "function getLastModifiedDate() {\n\t\treturn $this->data_array['last_modified_date'];\n\t}", "public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }", "public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }", "public function getModificationTime();", "public function getModifiedStamp();", "public function getFechaModificacion()\n {\n return $this->fechaModificacion;\n }", "public function getAuthorUpdatedDate();", "function get_date_mod(){\n\treturn date (\"F d Y H:i:s.\", filemtime(lastModifiedInFolder(ABSPATH . 'wp-content/')));\n}", "public function lastModification( ) {\n\n\t\treturn file_exists( $this->_path )\n\t\t\t? filemtime( $this->_path )\n\t\t\t: 0;\n\t}", "public function getLastModified()\n {\n return $this->_lastModified;\n }", "function getModificationTime() ;", "public function getLastModified()\n {\n return $this->lastModified;\n }", "public function getModifiedTime()\n\t{\n\t\treturn $this->modifiedTime; \n\n\t}", "function get_timemodified() {\n return $this->timemodified;\n }", "function getModDate() \n {\n return $this->getValueByFieldName( 'label_moddate' );\n }", "public function getPurchaseDateModified() {\n return $this->PurchaseDateModified;\n }", "public function getLastModified(){\n return $this->lastModified;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getEditDate() { return $this->tstamp; }", "public function getLast_modified() {\n\t\treturn $this->last_modified;\n\t}", "private function getTargetModificationTime() {\n if (!isset($this->targetModificationTime)) {\n $this->targetModificationTime = (int) @filemtime($this->target);\n }\n return $this->targetModificationTime;\n }", "function lastModified()\n {\n if(!empty($this->list)) {\n return strtotime($this->list->modified);\n }\n return null;\n }", "public function getLastModified()\n {\n return filemtime($this->getFileName());\n }", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}", "public function setModificationDate($date = true) {}", "public function getUpdatedDate()\n {\n return $this->updated;\n }", "public function getLastModified()\n\t{\n\t\treturn $this->last_modified;\n\t}", "function lastModified()\n {\n if (!empty($this->notice)) {\n return strtotime($this->notice->created);\n }\n\n return null;\n }", "public function getDateModified()\n {\n if (array_key_exists('datemodified', $this->data)) {\n return $this->data['datemodified'];\n }\n\n $date = null;\n\n if ($this->getType() == Reader\\Reader::TYPE_YML) {\n $dateModified = $this->xpath->evaluate('string(/yml_catalog/@date)');\n if ($dateModified) {\n $dateModifiedParsed = strtotime($dateModified);\n if ($dateModifiedParsed) {\n $date = new DateTime('@' . $dateModifiedParsed);\n } else {\n $dateStandards = [\"Y-m-d H:i\",\"Y-m-d H:i:s\"];\n foreach ($dateStandards as $standard) {\n try {\n $date = DateTime::createFromFormat($standard, $dateModified);\n break;\n } catch (\\Exception $e) {\n if ($standard === null) {\n throw new Exception(\n 'невозможно загрузить дату'\n .'допускаются форматы (\"Y-m-d H:i\",\"Y-m-d H:i:s\") :'\n . $e->getMessage(),\n 0,\n $e\n );\n }\n }\n }\n }\n }\n }\n $this->data['datemodified'] = $date;\n\n return $this->data['datemodified'];\n }", "public function getLastModifiedAudit();", "public function getUpdatedDate()\n {\n return $this->updated_date;\n }", "public function getdateModifiedAttribute()\n {\n return Carbon::parse($this->date)->translatedFormat('d M Y');\n }", "public function getDateUpdate()\n {\n return $this->dateUpdate;\n }", "public function getRevisionTime()\n {\n return $this->revisionTime;\n }", "public function getModified()\r\n {\r\n return $this->modified;\r\n }", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getUpdate_date(){\n return $this->update_date;\n }", "public function getModifiedDateTime()\n {\n if (array_key_exists(\"modifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"modifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"modifiedDateTime\"])) {\n return $this->_propDict[\"modifiedDateTime\"];\n } else {\n $this->_propDict[\"modifiedDateTime\"] = new \\DateTime($this->_propDict[\"modifiedDateTime\"]);\n return $this->_propDict[\"modifiedDateTime\"];\n }\n }\n return null;\n }", "public function getModifiedDateTime()\n {\n if (array_key_exists(\"modifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"modifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"modifiedDateTime\"])) {\n return $this->_propDict[\"modifiedDateTime\"];\n } else {\n $this->_propDict[\"modifiedDateTime\"] = new \\DateTime($this->_propDict[\"modifiedDateTime\"]);\n return $this->_propDict[\"modifiedDateTime\"];\n }\n }\n return null;\n }", "public function getModifiedDateTime()\n {\n if (array_key_exists(\"modifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"modifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"modifiedDateTime\"])) {\n return $this->_propDict[\"modifiedDateTime\"];\n } else {\n $this->_propDict[\"modifiedDateTime\"] = new \\DateTime($this->_propDict[\"modifiedDateTime\"]);\n return $this->_propDict[\"modifiedDateTime\"];\n }\n }\n return null;\n }", "public function getLastModified()\n {\n return ($this->item['mtime'] ? $this->item['mtime'] : ($this->item['ctime'] ? $this->item['ctime'] : time()));\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getDateUpdated() {\n return $this->dateUpdated;\n }", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function lastModified(){\n if( $this->modifications ){\n return end( $this->modifications );\n }\n }", "public function getLastModified() {\n\t\treturn filemtime($this->filename);\n\t}", "function stampModified() {\n\t\treturn $this->setLastModified(Core::getCurrentDate());\n\t}", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getRevdate()\n {\n return $this->revdate;\n }", "public function getModifiedTime()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filemtime($this->_path);\n\t}" ]
[ "0.82694364", "0.8055439", "0.7949888", "0.76934636", "0.76723236", "0.7653574", "0.7485886", "0.74192697", "0.7371976", "0.7322645", "0.7253996", "0.723889", "0.72357774", "0.7222352", "0.71894413", "0.71544605", "0.71401733", "0.7112384", "0.7069783", "0.70296407", "0.6928722", "0.68739074", "0.68734103", "0.68384683", "0.68333566", "0.67993325", "0.67520547", "0.6748941", "0.6747144", "0.67322576", "0.67024744", "0.6699474", "0.66696066", "0.6647985", "0.6625413", "0.6625413", "0.661863", "0.6613843", "0.6610566", "0.6572261", "0.6561428", "0.6555414", "0.65480256", "0.6544509", "0.6524579", "0.65222603", "0.65200895", "0.6475584", "0.6471934", "0.6467435", "0.6464939", "0.6464939", "0.6464939", "0.6464939", "0.6464939", "0.645497", "0.6449375", "0.6448162", "0.6443865", "0.6422954", "0.6401408", "0.6392763", "0.6386221", "0.638179", "0.6363891", "0.63468236", "0.63261247", "0.63157976", "0.63140213", "0.6270993", "0.62657225", "0.6256825", "0.6254005", "0.6254005", "0.6239671", "0.6239671", "0.6238875", "0.62365216", "0.62365216", "0.62365216", "0.6235154", "0.6214934", "0.6214934", "0.6214934", "0.6214934", "0.6214934", "0.6214934", "0.6212306", "0.6205129", "0.6201223", "0.6201223", "0.61994684", "0.61979127", "0.6197632", "0.6196742", "0.6196742", "0.6196742", "0.6196742", "0.61835283", "0.6169193" ]
0.82847404
0
Get user aliases path
Получить путь пользовательских псевдонимов
public function getUserAliasesPath() { if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath()) $this->setUserAliasesPath($this->getDefaultUserAliasesPath()); return $this->userAliasesPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function aliasPath(): string\n {\n return $this->_aliasPath;\n }", "public function hasUserAliasesPath()\n {\n return !empty($this->userAliasesPath)?:false;\n }", "public function aliases();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "public function aliases($options = ['print' => false, 'location' => null,])\n {\n $aliases = $this->session()->getUser()->getAliases();\n if (isset($options['print']) && $options['print']) {\n return $aliases;\n }\n if (is_null($location = $options['location'])) {\n $location = '~/.drush/pantheon.aliases.drushrc.php';\n }\n $config = $this->getConfig();\n $location = $config->fixDirectorySeparators(str_replace('~', $config->get('user_home'), $location));\n $config->ensureDirExists(dirname($location));\n if (file_put_contents($location, $aliases) !== false) {\n $this->log()->notice('Aliases file written to {location}.', ['location' => $location,]);\n }\n }", "public function getAlias(): string;", "function getAlias();", "public static function getMemberAliasList () {\n\t\t$Aliastext = \"(Aliases: \" . implode(', ',array_keys(self::$user_aliases)) . \")\";\n\t\treturn $Aliastext;\n\t}", "public function getAliases();", "public function pathAliasCallback() {\n $args = func_get_args();\n switch($args[0]) {\n case '/content/first-node':\n return '/node/1';\n case '/content/first-node-test':\n return '/node/1/test';\n case '/malicious-path':\n return '/admin';\n case '':\n return '<front>';\n default:\n return $args[0];\n }\n }", "public function getRealUrlAliasBase(): string;", "public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }", "public static function getAlias(): string\n {\n return static::$alias;\n }", "public function hasDefaultUserAliasesPath()\n {\n return !empty($this->getDefaultUserAliasesPath())?:false;\n }", "public function getAlias() : string;", "public function getAlias() : string {\n\t\treturn $this->alias;\n\t}", "public function path()\n {\n return $this->user->path() . $this->slug;\n }", "public function get_current_path() {\n $current_path = \\Drupal::service('path.current')->getPath();\n $result = \\Drupal::service('path_alias.manager')->getAliasByPath($current_path);\n\n return $result;\n }", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function getAlias()\n\t{\n\t\treturn $this->alias;\n\t}", "function getAlias()\r\n\t{\r\n\t\treturn( $this->alias );\r\n\t}", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "function cot_pfs_relpath($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($userid.'/');\n\t}\n\telse\n\t{\n\t\treturn('');\n\t}\n}", "public function getAliases()\n {\n return [];\n }", "public function getAliases()\n {\n return [];\n }", "public function getAlias(): Str\n {\n return $this->alias;\n }", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "public function getAliases( )\n {\n return $this->aliases;\n }", "public function getAliases()\n {\n return $this->aliases;\n }", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "public function registerDefaultAliases()\n\t{\n\t\tparent::registerDefaultAliases();\n\t\t\\Yii::$aliases['@www'] = dirname($_SERVER['SCRIPT_FILENAME']);\n\t}", "public function getAlias() {\n return $this->alias;\n }", "public function getAlias() {\n return $this->alias;\n }", "public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}", "function GetUserAlias()\n {\n $SysUser = new SysUser();\n $this->email = $SysUser->GetUserName($this->login);\n if ( empty($this->email) ) $this->email = $this->login;\n return $this->email;\n }", "function getdirections_locations_user_path($fromuid, $touid) {\n if (module_exists('location') && is_numeric($fromuid) && is_numeric($touid)) {\n return \"getdirections/locations_user/$fromuid/$touid\";\n }\n}", "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "function user_admin_url($path = '', $scheme = 'admin')\n {\n }", "public function getCurrentAlias()\n {\n return rtrim(\\Yii::$app->request->get('nodes'), '/') ?: $this->defaultAlias;\n }", "public function fullAlias()\n {\n if ($this->strFullAlias) {\n return $this->strFullAlias;\n } else {\n assert(!empty($this->strAlias)); // Alias should always be set by default\n return $this->strAlias;\n }\n }", "public function getRegistryAlias(): string;", "function alias($alias) {\r\n $db = new MySQL();\r\n $sql = \"SELECT * FROM `usuarios_usuarios` WHERE(`alias` = '\" . $alias . \"');\";\r\n $consulta = $db->sql_query($sql);\r\n $fila = $db->sql_fetchrow($consulta);\r\n $db->sql_close();\r\n return($fila['usuario']);\r\n }", "public static function getRouteAlias() {\n return implode('/', self::getRouteFragments());\n }", "public static function getPathOfAlias($alias)\n {\n\n if(isset(self::$_aliases[$alias]))\n\n return self::$_aliases[$alias];\n else if(($pos=strpos($alias,'.'))!==false)\n {\n $rootAlias=substr($alias,0,$pos);\n if(isset(self::$_aliases[$rootAlias])) {\n return self::$_aliases[$alias]=rtrim(self::$_aliases[$rootAlias].DIRECTORY_SEPARATOR.str_replace('.',DIRECTORY_SEPARATOR,substr($alias,$pos+1)),'*'.DIRECTORY_SEPARATOR);\n }\n }\n return false;\n }", "public function listCurrentDir() {\n $connConf = $this->getConnectionModel();\n $markAsAlias = false;\n $basedn = $this->getCwd();\n if(preg_match('/ALIAS=Alias of:/',$this->getCwd())) {\n $basedn = str_replace(\"ALIAS=Alias of:\",\"\",$this->getCwd());\n /**\n * This is necessary to avoid id problems in the web interface.\n * Aliased elements start with a \"*\", an 4.digit id and again, a \"*\"\n *\n */\n $result = $this->listDN($basedn);\n foreach($result as $key=>&$vals) {\n if(!is_int($key))\n continue;\n $vals[\"dn\"] = \"*\".rand(1000,9999).\"*\".$vals[\"dn\"];\n }\n return $result;\n } else return $this->listDN($basedn);\n }", "public function getPathAlias()\n {\n if (! isset($this->pathAlias)) {\n $this->pathAlias = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getPathAliasQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->pathAlias;\n }", "public function getAlias()\n {\n if (isset($this->raw->alias)) {\n return $this->raw->alias;\n }\n\n return 'default.phar';\n }", "private function getAlias($site_name) {\n/*\n $user = Session::getUser();\n $alias_string = $user->getAliases();\n eval(str_replace('<?php', '', $alias_string));\n $formatted_aliases = substr($alias_string, 0, -1);\n*/\n $sites_object = new Sites();\n $site = $sites_object->get($site_name);\n\n $environments = $site->environments->all();\n foreach ($environments as $environment) {\n $key = $site->get('name') . '.'. $environment->get('id');\n if (isset($aliases[$key])) {\n break;\n }\n try {\n $formatted_alias = \" \\$aliases['$key'] = \";\n $formatted_alias .= $this->constructAlias($environment);\n } catch (TerminusException $e) {\n continue;\n }\n }\n\n return $formatted_alias;\n }", "public function getAlias($alias);", "public function getAliases(): array\n {\n return $this->aliases;\n }", "public function alias ()\n {\n return $this->_alias;\n }", "public function testPathAliasProcessing() {\n // Add a path alias for the '/admin' system path.\n $values = [\n 'path' => '/admin/structure',\n 'alias' => '/admin-structure-alias',\n 'langcode' => 'und',\n 'status' => 1,\n ];\n\n $database = \\Drupal::database();\n $id = $database->insert('path_alias')\n ->fields($values + ['uuid' => \\Drupal::service('uuid')->generate()])\n ->execute();\n\n $revision_id = $database->insert('path_alias_revision')\n ->fields($values + ['id' => $id, 'revision_default' => 1])\n ->execute();\n\n $database->update('path_alias')\n ->fields(['revision_id' => $revision_id])\n ->condition('id', $id)\n ->execute();\n\n // Increment the schema version.\n \\Drupal::state()->set('update_test_schema_version', 8002);\n $this->runUpdates();\n\n // Check that the alias defined earlier is not used during the update\n // process.\n $this->assertSession()->linkByHrefExists('/admin/structure');\n $this->assertSession()->linkByHrefNotExists('/admin-structure-alias');\n\n $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']);\n $this->drupalLogin($account);\n\n // Go to the status report page and check that the alias is used.\n $this->drupalGet('admin/reports/status');\n $this->assertSession()->linkByHrefNotExists('/admin/structure');\n $this->assertSession()->linkByHrefExists('/admin-structure-alias');\n }", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "public function getAlias(): string\n {\n if ($this->_alias === null) {\n $this->_alias = $this->getName();\n }\n\n return $this->_alias;\n }", "public function getAliases() : array\n {\n return $this->aliases;\n }", "public function alias()\n\t{\n\t\treturn array(\n\t\t\t'action_admin_theme_get_menus' => 'action_admin_theme_post_menus',\n\t\t\t'action_admin_theme_get_menu_iframe' => 'action_admin_theme_post_menu_iframe',\n\t\t);\n\t}", "public function getAliases()\n {\n return array_values($this->aliases);\n }", "private function getAlias()\n {\n $stub = '';\n $prefix = '';\n\n if ($this->extractForce) {\n $prefix = '$dir/';\n }\n\n if ($this->web) {\n $stub .= 'Phar::webPhar(' . $this->arg($this->alias);\n\n if ($this->index) {\n $stub .= ', ' . $this->arg($prefix . $this->index, '\"');\n\n if ($this->notFound) {\n $stub .= ', ' . $this->arg($prefix . $this->notFound, '\"');\n\n if ($this->mimetypes) {\n $stub .= ', ' . var_export(\n $this->mimetypes,\n true\n );\n\n if ($this->rewrite) {\n $stub .= ', ' . $this->arg($this->rewrite);\n }\n }\n }\n }\n\n $stub .= ');';\n } else {\n $stub .= 'Phar::mapPhar(' . $this->arg($this->alias) . ');';\n }\n\n return $stub;\n }", "private function get_aliases_data( $config, $alias, $create_config_file = false ) {\n\n\t\t$global_config_path = WP_CLI::get_runner()->get_global_config_path( $create_config_file );\n\t\t$global_aliases = Spyc::YAMLLoad( $global_config_path );\n\n\t\t$project_config_path = WP_CLI::get_runner()->get_project_config_path();\n\t\t$project_aliases = Spyc::YAMLLoad( $project_config_path );\n\n\t\tif ( 'global' === $config ) {\n\t\t\t$config_path = $global_config_path;\n\t\t\t$aliases = $global_aliases;\n\t\t} elseif ( 'project' === $config ) {\n\t\t\t$config_path = $project_config_path;\n\t\t\t$aliases = $project_aliases;\n\t\t} else {\n\n\t\t\t$is_global_alias = array_key_exists( $alias, $global_aliases );\n\t\t\t$is_project_alias = array_key_exists( $alias, $project_aliases );\n\n\t\t\tif ( $is_global_alias && $is_project_alias ) {\n\t\t\t\tWP_CLI::error( \"Key '{$alias}' found in more than one path. Please pass --config param.\" );\n\t\t\t} elseif ( $is_global_alias ) {\n\t\t\t\t$config_path = $global_config_path;\n\t\t\t\t$aliases = $global_aliases;\n\t\t\t} else {\n\t\t\t\t$config_path = $project_config_path;\n\t\t\t\t$aliases = $project_aliases;\n\t\t\t}\n\t\t}\n\n\t\treturn [ $config_path, $aliases ];\n\n\t}", "private function getProfileAlias(int $formId): string\n\t{\n\t\t$settings = $this->loadFormSettings($formId);\n\n\t\treturn $settings->get('profileAlias', '');\n\t}", "public function createUserAliasesDirectory()\n {\n if(!$this->userAliasesDirectoryExist())\n return $this->createDirectory($this->getUserAliasesPath());\n return true;\n }", "function simple_example() {\n \\Drupal::service('path_alias.manager');\n}", "public function getAliasName(): string\n {\n return $this->aliasName;\n }", "public function setUserAliasesPath($path)\n {\n if(!$this->isUserAliasesPathValid($path))\n throw new InvalidArgumentException(sprintf('User aliases path: \"%s\" is invalid.',$path));\n $this->userAliasesPath=$path;\n }", "public function urlAlias()\n {\n $useURLAlias =& $GLOBALS['eZContentObjectTreeNodeUseURLAlias'];\n $ini = eZINI::instance();\n $cleanURL = '';\n \n if ( !isset( $useURLAlias ) )\n {\n $useURLAlias = $ini->variable( 'URLTranslator', 'Translation' ) == 'enabled';\n }\n \n if ( $useURLAlias )\n {\n $aliases = eZURLAliasML::fetchByAction('module', 'topic/view/'.$this->attribute('id'));\n if (count($aliases))\n {\n $cleanURL = $this->forumNode()->urlAlias().'/'.$aliases[0]->attribute('text');\n }\n else\n {\n $cleanURL = 'topic/view/'.$this->attribute('id');\n } \n }\n else\n {\n $cleanURL = 'topic/view/'.$this->attribute('id');\n }\n \n return $cleanURL;\n }", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "public function getAliasList();", "public static function getAliases()\n {\n\n return [\n\n 'createArticle' => 'newarticle'\n ];\n }", "public function getAbsolutePath();", "public function redirectPath()\n {\n $redirect = app('user.logic')->getUserInfo('admin') ? $this->redirectTo : $this->redirectToHome;\n return $redirect;\n }", "public function getAdminPath()\n {\n return $this->adminPath;\n }", "protected function privateAbsolutePath() : string {\n return $this->privateFolder['absolute'];\n }", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public static function getAlias($alias, $throwException = true)\n {\n if (strncmp($alias, '@', 1)) {\n // not an alias\n return $alias;\n }\n \n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n \n if (isset(static::$aliases[$root])) {\n if (is_string(static::$aliases[$root])) {\n return $pos === false ? static::$aliases[$root] : static::$aliases[$root] . substr($alias, $pos);\n } else {\n foreach (static::$aliases[$root] as $name => $path) {\n if (strpos($alias . '/', $name . '/') === 0) {\n return $path . substr($alias, strlen($name));\n }\n }\n }\n }\n \n if ($throwException) {\n throw new InvalidParamException(\"Invalid path alias: $alias\");\n } else {\n return false;\n }\n }", "public function getPathLocation(): string;", "function getAbsolutePath() ;", "public function aliases() \n {\n $aliases = array();\n foreach ($this->_entries as $alias => $key) {\n $aliases[] = $alias;\n }\n return $aliases;\n }", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}", "protected function getViewPath()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('/');\n }", "public static function getAliases()\n {\n\n return [\n\n 'createComment' => 'newcomment'\n\n ];\n\n\n }", "public function getEntrypointsPath(): string;", "public function path($append = '') {\n // Default path to user's profile\n $path = route('show', $this->username);\n // If an append argument is received, return the path with the append added, otherwise, return the default path.\n return $append ? \"{$path}/${append}\" : $path;\n }", "function getAliasOrName()\r\n\t{\r\n\t\tif ( !$this->alias ) {\r\n\t\t\treturn $this->name;\r\n\t\t}\r\n\t\treturn $this->alias;\r\n\t}", "public static function setAlias($alias, $path)\n {\n if (strncmp($alias, '@', 1)) {\n $alias = '@' . $alias;\n }\n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n if ($path !== null) {\n $path = strncmp($path, '@', 1) ? rtrim($path, '\\\\/') : static::getAlias($path);\n if (!isset(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [$alias => $path];\n }\n } elseif (is_string(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [\n $alias => $path,\n $root => static::$aliases[$root],\n ];\n }\n } else {\n static::$aliases[$root][$alias] = $path;\n krsort(static::$aliases[$root]);\n }\n } elseif (isset(static::$aliases[$root])) {\n if (is_array(static::$aliases[$root])) {\n unset(static::$aliases[$root][$alias]);\n } elseif ($pos === false) {\n unset(static::$aliases[$root]);\n }\n }\n }", "function cot_pfs_path($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($cfg['pfs_dir'].'/'.$userid.'/');\n\t}\n\telse\n\t{\n\t\treturn($cfg['pfs_dir'].'/');\n\t}\n}", "private function putAlias($str) {\n // i.e.: @Widgets/Foo -> app/Frontend/Widgets/Foo\n // Allow custom resolvers for specific lookups\n $path = $this->canonicalizePath($str);\n $pathParts = explode(\"/\", $path);\n foreach($pathParts as $i=>$part) {\n if(substr($part,0,1) == \"@\") {\n // A-hah! A wild alias was been encountered.\n $alias = substr($part, 1);\n if(isset($this->aliases[$alias])) {\n $pathParts[$i] = $this->aliases[$alias];\n } else {\n foreach($this->resolver as $cb) {\n $out = $cb($alias);\n if($out != null && $out != false) {\n $pathParts[$i] = $out;\n }\n }\n }\n }\n }\n return implode(DIRECTORY_SEPARATOR, $pathParts);\n }" ]
[ "0.77855396", "0.7177975", "0.6424047", "0.6238146", "0.62202626", "0.62202626", "0.62202626", "0.62202626", "0.6215509", "0.61698157", "0.613496", "0.60694", "0.6052336", "0.6040332", "0.6029832", "0.60096556", "0.6001542", "0.5995896", "0.5990391", "0.5986431", "0.5968525", "0.5959887", "0.5923102", "0.58748883", "0.58467007", "0.5841598", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.58380103", "0.5815624", "0.5812326", "0.5812326", "0.5801559", "0.57980394", "0.57907516", "0.57819295", "0.57764363", "0.5769087", "0.57574546", "0.57574546", "0.575258", "0.5736692", "0.5726441", "0.57228196", "0.57174814", "0.5707927", "0.5694614", "0.567859", "0.56483245", "0.56375915", "0.56363314", "0.56241953", "0.5610722", "0.56070876", "0.55838555", "0.55651665", "0.5564329", "0.55499214", "0.55473346", "0.5538254", "0.5527423", "0.55124027", "0.5508289", "0.5497659", "0.5474117", "0.54601264", "0.5455969", "0.5445735", "0.54450995", "0.5421132", "0.54185575", "0.54157996", "0.5409767", "0.53947973", "0.53894985", "0.53669494", "0.53583646", "0.5355116", "0.5352132", "0.5344553", "0.5344553", "0.5334888", "0.5317015", "0.5311449", "0.5308366", "0.5308181", "0.53075075", "0.5300406", "0.5291236", "0.52800596", "0.52750593", "0.52735", "0.5269271", "0.5267153" ]
0.82206804
0
Validates if user aliases path is valid
Проверяет, является ли путь пользовательских псевдонимов допустимым
public function isUserAliasesPathValid($path) { return (is_string($path) && !empty($path))?:false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUserAliasesPath()\n {\n return !empty($this->userAliasesPath)?:false;\n }", "function path_admin_form_validate($form, &$form_state) {\n $src = $form_state['values']['src'];\n $dst = $form_state['values']['dst'];\n $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0;\n // Language is only set if locale module is enabled, otherwise save for all languages.\n $language = isset($form_state['values']['language']) ? $form_state['values']['language'] : '';\n\n if (db_result(db_query(\"SELECT COUNT(dst) FROM {url_alias} WHERE pid != %d AND dst = '%s' AND language = '%s'\", $pid, $dst, $language))) {\n form_set_error('dst', t('The alias %alias is already in use in this language.', array('%alias' => $dst)));\n }\n $item = menu_get_item($src);\n if (!$item || !$item['access']) {\n form_set_error('src', t(\"The path '@link_path' is either invalid or you do not have access to it.\", array('@link_path' => $src)));\n }\n}", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function isValidAlias($alias);", "public function hasDefaultUserAliasesPath()\n {\n return !empty($this->getDefaultUserAliasesPath())?:false;\n }", "public function setUserAliasesPath($path)\n {\n if(!$this->isUserAliasesPathValid($path))\n throw new InvalidArgumentException(sprintf('User aliases path: \"%s\" is invalid.',$path));\n $this->userAliasesPath=$path;\n }", "function ambit_compass_validate_path($element, &$form_state) {\n\tmodule_load_include('inc', 'ambit', 'ambit.compass');\n $errors = ambit_compass_check_path($element['#value']);\n if ($errors) {\n form_set_error('compass][ambit_compass_path', implode('<br />', $errors));\n }\n}", "public function validateNamespace()\r\n {\r\n $this->ns = ltrim($this->ns, '\\\\');\r\n $path = Az::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\r\n if ($path === false) {\r\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\r\n }\r\n }", "private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public function validPathStrDataProvider() {}", "public function validateNamespace()\n {\n $this->ns = ltrim($this->ns, '\\\\');\n $path = Yii::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\n if ($path === false) {\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\n }\n }", "function check_alias ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['aliases'] >= 0)\n {\n if ($limit['alias_count'] >= $limit['aliases'])\n {\n return false;\n }\n }\n return true;\n}", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public function validate(DomainAliasInterface $alias) {\n $pattern = $alias->getPattern();\n\n // 1) Check for at least one dot or the use of 'localhost'.\n // Note that localhost can specify a port.\n $localhost_check = explode(':', $pattern);\n if (substr_count($pattern, '.') == 0 && $localhost_check[0] != 'localhost') {\n return $this->t('At least one dot (.) is required, except when using <em>localhost</em>.');\n }\n\n // 2) Check that the alias only has one wildcard.\n $count = substr_count($pattern, '*') + substr_count($pattern, '?');\n if ($count > 1) {\n return $this->t('You may only have one wildcard character in each alias.');\n }\n // 3) Only one colon allowed, and it must be followed by an integer.\n $count = substr_count($pattern, ':');\n if ($count > 1) {\n return $this->t('You may only have one colon \":\" character in each alias.');\n }\n elseif ($count == 1) {\n $int = substr($pattern, strpos($pattern, ':') + 1);\n if (!is_numeric($int) && $int !== '*') {\n return $this->t('A colon may only be followed by an integer indicating the proper port or the wildcard character (*).');\n }\n }\n // 4) Check that the alias doesn't contain any invalid characters.\n // Check for valid characters, unless using non-ASCII domains.\n $non_ascii = $this->configFactory->get('domain.settings')->get('allow_non_ascii');\n if (!$non_ascii) {\n $check = preg_match('/^[a-z0-9\\.\\+\\-\\*\\?:]*$/', $pattern);\n if ($check == 0) {\n return $this->t('The pattern contains invalid characters.');\n }\n }\n // 5) The alias cannot begin or end with a period.\n if (substr($pattern, 0, 1) == '.') {\n return $this->t('The pattern cannot begin with a dot.');\n }\n if (substr($pattern, -1) == '.') {\n return $this->t('The pattern cannot end with a dot.');\n }\n\n // 6) Check that the alias is not a direct match for a registered domain.\n $check = preg_match('/[a-z0-9\\.\\+\\-:]*$/', $pattern);\n if ($check == 1 && $this->domainStorage->loadByHostname($pattern)) {\n return $this->t('The pattern matches an existing domain record.');\n }\n // 7) Check that the alias is unique across all records.\n if ($alias_check = $this->aliasStorage->loadByPattern($pattern)) {\n /** @var \\Drupal\\domain_alias\\DomainAliasInterface $alias_check */\n if ($alias_check->id() != $alias->id()) {\n return $this->t('The pattern already exists.');\n }\n }\n }", "private function validate_alias_type( $aliases, $alias, $assoc_args, $grouping ) {\n\n\t\t$alias_data = $aliases[ $alias ];\n\n\t\t$group_aliases_match = preg_grep( '/^@(\\w+)/i', $alias_data );\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\tif ( ! empty( $group_aliases_match ) && ! empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'Trying to update group alias with invalid arguments.' );\n\t\t} elseif ( empty( $group_aliases_match ) && ! empty( $grouping ) ) {\n\t\t\tWP_CLI::error( 'Trying to update simple alias with invalid --grouping argument.' );\n\t\t}\n\t}", "public function validateRedirectUrlClearsInvalidUrlInSubdirectoryDataProvider() {}", "protected function validateOwner()\r\n {\r\n $value = $this->owner->getValue();\r\n $len = strlen($value);\r\n if (empty($len)) {\r\n return true;\r\n }\r\n $parts = explode('@', $value);\r\n if (count($parts) != 2) {\r\n return false;\r\n }\r\n $locallen = strlen($parts[0]);\r\n if ($locallen > 64) {\r\n return false;\r\n }\r\n $domainlen = $len - $locallen;\r\n if ($domainlen < 4 || $domainlen > 255) {\r\n return false;\r\n }\r\n foreach (explode('.', $parts[0]) as $local) {\r\n if (!preg_match('/^[A-Za-z0-9!#$%&\\'*+\\\\/=?^_`{|}~-]+$/D', $local)) {\r\n return false;\r\n }\r\n }\r\n if (!preg_match('/^([a-z0-9][a-z0-9\\-]*[a-z0-9]|[a-z0-9])(\\.([a-z0-9][a-z0-9\\-]*[a-z0-9]|[a-z0-9])){0,10}\\.([a-z]{2,}){1}$/iD', $parts[1])) {\r\n return false;\r\n }\r\n return true;\r\n }", "function is_alias_inuse($alias) {\n\tif ($alias == \"\") {\n\t\treturn false;\n\t}\n\t/* loop through firewall rules looking for alias in use */\n\tforeach (config_get_path('filter/rule', []) as $rule) {\n\t\tforeach (['source', 'destination'] as $origin) {\n\t\t\tif (array_get_path($rule, \"{$origin}/address\") == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through nat rules looking for alias in use */\n\tforeach (config_get_path('nat/rule', []) as $rule) {\n\t\tforeach (['target', 'source/address', 'destination/address'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through outbound nat rules looking for alias in use */\n\tforeach (config_get_path('nat/outbound/rule', []) as $rule) {\n\t\tforeach (['target', 'sourceport', 'dstport', 'source/network', 'destination/network'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "function is_validaliasname($name) {\n\tif (!preg_match(\"/(:word:)/\", $name))\n\treturn true;\n\telse\n\treturn false;\n}", "public function validateRedirectUrlKeepsCleanUrlInSubdirectoryDataProvider() {}", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "private function isAuthRequiredForPath($path)\n {\n\t\t$path_arr = explode('/', $path);\n\t\t$path_new = implode('/', array_slice($path_arr, 0, 3));\n\t\t\n return in_array($path_new, [\n\t\t]);\n }", "public function testPathAliasProcessing() {\n // Add a path alias for the '/admin' system path.\n $values = [\n 'path' => '/admin/structure',\n 'alias' => '/admin-structure-alias',\n 'langcode' => 'und',\n 'status' => 1,\n ];\n\n $database = \\Drupal::database();\n $id = $database->insert('path_alias')\n ->fields($values + ['uuid' => \\Drupal::service('uuid')->generate()])\n ->execute();\n\n $revision_id = $database->insert('path_alias_revision')\n ->fields($values + ['id' => $id, 'revision_default' => 1])\n ->execute();\n\n $database->update('path_alias')\n ->fields(['revision_id' => $revision_id])\n ->condition('id', $id)\n ->execute();\n\n // Increment the schema version.\n \\Drupal::state()->set('update_test_schema_version', 8002);\n $this->runUpdates();\n\n // Check that the alias defined earlier is not used during the update\n // process.\n $this->assertSession()->linkByHrefExists('/admin/structure');\n $this->assertSession()->linkByHrefNotExists('/admin-structure-alias');\n\n $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']);\n $this->drupalLogin($account);\n\n // Go to the status report page and check that the alias is used.\n $this->drupalGet('admin/reports/status');\n $this->assertSession()->linkByHrefNotExists('/admin/structure');\n $this->assertSession()->linkByHrefExists('/admin-structure-alias');\n }", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }", "public function createUserAliasesDirectory()\n {\n if(!$this->userAliasesDirectoryExist())\n return $this->createDirectory($this->getUserAliasesPath());\n return true;\n }", "public function validatePath()\n {\n $path = $this->getFullPath();\n\n return\n strpos($path, $this->chrootDir) === 0\n && (strpos($path, '..') === false || !empty($this->path));\n }", "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "public function edit_form_validate($form, &$form_state) {\n if (!preg_match('/[a-zA-Z0-9_\\$]+/', $form_state['values']['path'])) {\n form_set_error('path', t('The database name is not valid.'));\n }\n parent::edit_form_validate($form, $form_state);\n }", "public function isValidPathReturnsTrueIfPathExists() {}", "private function assertValidPath() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->path,\n '#[Route.path] must contain a non-empty string.'\n );\n }", "function shorthand_admin_settings_validate($form, &$form_state) {\n $user_id = $form_state['values']['shorthand_user_id'];\n $token = $form_state['values']['shorthand_token'];\n if (!is_numeric($user_id)) {\n form_set_error('shorthand_user_id', t('User ID must be an integer.'));\n }\n else {\n $data = sh_get_profile($user_id, $token);\n if (!isset($data->username)) {\n form_set_error('shorthand_token', t('Invalid token.'));\n }\n }\n}", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if (\\Drupal::service('file_system')->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (\\Drupal::service('file_system')->uriScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if ($this->fileSystem->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (StreamWrapperManager::getScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function validatepathAction()\r\n {\r\n $helper = Mage::helper('link');\r\n $response = array(\r\n 'status' => 'error',\r\n 'message' => 'unknown',\r\n );\r\n\r\n try {\r\n $path = $this->getRequest()->getParam('request_path');\r\n\r\n // Check against CMS pages\r\n if (Mage::getSingleton('cms/page')->checkIdentifier($path, Mage::app()->getStore()->getStoreId())) {\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a CMS page with this identifier already exists.');\r\n } else if ($this->_checkUrlRewrite($path)) { // Check against URL rewrites\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a URL rewrite with this path already exists.');\r\n } else {\r\n $response['status'] = 'success';\r\n $response['message'] = $helper->__('Request path is unique in the system.');\r\n }\r\n } catch (Exception $error) {\r\n $response['status'] = 'error';\r\n $response['message'] = $error->getMessage();\r\n }\r\n\r\n $this->getResponse()\r\n ->setHeader('Content-type', 'application/json')\r\n ->setBody(Mage::helper('core')->jsonEncode($response));\r\n }", "public function sanitizeLocalUrlValidPathsDataProvider() {}", "function sd_is_path_sane($path) {\n\tglobal $sd_error_msg;\n\n\tif (!$path) {\n\t\t$sd_error_msg = 'E:empty';\n\t\treturn $sd_error_msg;\n\t}\n\tif (false !== strpos('..', $path)) {\n\t\t$sd_error_msg = 'E:.. forbidden';\n\t\treturn $sd_error_msg;\n\t}\n\tif (!file_exists(SD_DL_ROOT . $path)) {\n\t\t$sd_error_msg = 'E:non-exist';\n\t\treturn $sd_error_msg;\n\t}\n\treturn true;\n}", "public function validPathStrInvalidCharactersDataProvider() {}", "public function testAroAliases()\n {\n $this->Acl->Aro->map = [\n 'User' => 'User/username',\n 'Role' => 'User/group_id',\n ];\n\n $this->Acl->Aro->aliases = [\n 'Role/1' => 'Role/admin',\n 'Role/24' => 'Role/accounting',\n ];\n\n $user = [\n 'User' => [\n 'username' => 'unknown_user',\n 'group_id' => '1',\n ],\n ];\n // group/1\n $this->assertSame('Role/admin', $this->Acl->Aro->resolve($user));\n // group/24\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('Role/24'));\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('24'));\n\n // check department\n $user = [\n 'User' => [\n 'username' => 'foo',\n 'group_id' => '25',\n ],\n ];\n\n $this->Acl->Aro->addRole(['Role/IT' => null]);\n $this->Acl->Aro->addAlias(['Role/25' => 'Role/IT']);\n $this->Acl->allow('Role/IT', '/rules/debugging/*');\n\n $this->assertEquals([['Role/IT']], $this->Acl->Aro->roles($user));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload'));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries'));\n // Role/default is allowed users dashboard, but not Role/IT\n $this->assertFalse($this->Acl->check($user, '/controllers/users/dashboard'));\n\n $this->assertFalse($this->Acl->check($user, '/controllers/invoices/send'));\n // wee add an more specific entry for user foo to also inherit from Role/accounting\n $this->Acl->Aro->addRole(['User/foo' => 'Role/IT, Role/accounting']);\n $this->assertTrue($this->Acl->check($user, '/controllers/invoices/send'));\n }", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function getPathAuthRequired()\n {\n }", "function fullcalendar_admin_settings_validate($form, &$form_state) {\n form_set_value($form['fullcalendar_path'], rtrim($form['fullcalendar_path']['#value'], \"/\"), $form_state);\n}", "function fn_is_valid_path($base_dir, $path)\n{\n $base_dir = rtrim($base_dir, '/') . '/';\n\n if (strpos($path, $base_dir) !== 0) {\n // relative path\n $path = fn_normalize_path($base_dir . $path);\n }\n\n if (strpos($path, $base_dir) !== 0) {\n return false;\n }\n\n return true;\n}", "function path_admin_form(&$form_state, $edit = array('src' => '', 'dst' => '', 'language' => '', 'pid' => NULL)) {\n\n $form['#alias'] = $edit;\n\n $form['src'] = array(\n '#type' => 'textfield',\n '#title' => t('Existing system path'),\n '#default_value' => $edit['src'],\n '#maxlength' => 128,\n '#size' => 45,\n '#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'),\n '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),\n '#required' => TRUE,\n );\n $form['dst'] = array(\n '#type' => 'textfield',\n '#title' => t('Path alias'),\n '#default_value' => $edit['dst'],\n '#maxlength' => 128,\n '#size' => 45,\n '#description' => t('Specify an alternative path by which this data can be accessed. For example, type \"about\" when writing an about page. Use a relative path and don\\'t add a trailing slash or the URL alias won\\'t work.'),\n '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),\n '#required' => TRUE,\n );\n // This will be a hidden value unless locale module is enabled\n $form['language'] = array(\n '#type' => 'value',\n '#value' => $edit['language']\n );\n if ($edit['pid']) {\n $form['pid'] = array('#type' => 'hidden', '#value' => $edit['pid']);\n $form['submit'] = array('#type' => 'submit', '#value' => t('Update alias'));\n }\n else {\n $form['submit'] = array('#type' => 'submit', '#value' => t('Create new alias'));\n }\n\n return $form;\n}", "public static function should_redirect_urls_provider() {\n $badurl1 = new \\moodle_url('/');\n $badparam1 = $badurl1->out();\n $badurl2 = new \\moodle_url('admin/tool/mfa/auth.php');\n $badparam2 = $badurl2->out();\n return [\n ['/', 'http://test.server', true],\n ['/admin/tool/mfa/action.php', 'http://test.server', true],\n ['/admin/tool/mfa/factor/totp/settings.php', 'http://test.server', true],\n ['/', 'http://test.server', true, ['url' => $badparam1]],\n ['/', 'http://test.server', true, ['url' => $badparam2]],\n ['/admin/tool/mfa/auth.php', 'http://test.server', false],\n ['/admin/tool/mfa/auth.php', 'http://test.server/parent/directory', false],\n ['/admin/tool/mfa/action.php', 'http://test.server/parent/directory', true],\n ['/', 'http://test.server/parent/directory', true, ['url' => $badparam1]],\n ['/', 'http://test.server/parent/directory', true, ['url' => $badparam2]],\n ['/admin/tool/securityquestions/set_responses.php', 'http://test.server', false],\n ['/admin/tool/securityquestions/set_responses.php', 'http://test.server', false, ['delete' => 1]],\n ['/admin/tool/securityquestions/randompage.php', 'http://test.server', true, ['delete' => 1]],\n ];\n }", "public function checkAndSetAlias() {}", "function user_admin_url($path = '', $scheme = 'admin')\n {\n }", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "public function valid() {\n return ( current($this->_path) !== false );\n }", "function testIsUriAliasDuplicated()\n {\n\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = null));\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = 32));//non-existant id\n }", "private function _checkValidUser()\n\t{\n\t\t$user = $this->getUser();\n\t\tif(NULL == $user->getFirstname()) return $this->redirect('/logout');\n\t\tif(NULL <> $user->getEmployerId()) return $this->redirect('/admin');\n\t}", "function alias_existente($alias) {\r\n $db = new MySQL();\r\n $existencia = $db->sql_query(\"SELECT * FROM `usuarios_usuarios` WHERE `alias`='\" . $alias . \"' ;\");\r\n $existe = $db->sql_numrows($existencia);\r\n $db->sql_close();\r\n if ($existe == 0) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }", "public static function ValidateUser()\n {\n $allowed_page = '/(login|article\\/(list|read))/';\n\n// $_SESSION['user'] not set or empty, and current view is allowed\n if ((!isset($_SESSION['user']) || empty($_SESSION['user'])) && !preg_match($allowed_page, $_GET['views'])) {\n header('Location: /login');\n }\n }", "public function getCanonicalPathCorrectlyCleansPathDataProvider() {}", "public function verifyAliases($dc)\n\t{\n\t\tif (!$dc->activeRecord)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($dc->activeRecord->alias == '')\n\t\t{\n\t\t\t$strAlias = $this->generateFolderAlias('', $dc);\n\t\t\t$this->Database->prepare(\"UPDATE tl_page SET alias=? WHERE id=?\")->execute($strAlias, $dc->id);\n\t\t}\n\t\t\n\t\t$objPage = $this->getPageDetails($dc->id);\n\t\t$objRoot = $this->Database->execute(\"SELECT * FROM tl_page WHERE id=\".(int)$objPage->rootId);\n\t\t\n\t\tif ($objRoot->subAlias)\n\t\t{\n\t\t\t$arrChildren = $this->getChildRecords($dc->id, 'tl_page', true);\n\t\t\t\n\t\t\tif (count($arrChildren))\n\t\t\t{\n\t\t\t\t$objChildren = $this->Database->execute(\"SELECT * FROM tl_page WHERE id IN (\" . implode(',', $arrChildren) . \") AND alias='' ORDER BY id=\" . implode(' DESC, id=', $arrChildren) . \" DESC\");\n\t\t\t\t\n\t\t\t\twhile( $objChildren->next() )\n\t\t\t\t{\n\t\t\t\t\t$strAlias = $this->generateFolderAlias('', (object)array('id'=>$objChildren->id, 'activeRecord'=>$objChildren));\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_page SET alias=? WHERE id=?\")->execute($strAlias, $objChildren->id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function validate(UriInterface $uri)\n {\n if (strlen($path = trim($uri->getPath(), '/')) === 0) {\n return;\n }\n\n $d = '\\\\'.$this->delimiter;\n $pathRegexp = '/^\\/?(\\w+('.$d.'\\w+)*(\\/\\w+('.$d.'\\w+)*)*\\/?)?$/su';\n\n if (!preg_match($pathRegexp, $path)) {\n throw new \\DomainException(\n \"Uri path segments are not alphanumeric with {$this->delimiter} delimiter, see path: $path\"\n );\n }\n }", "function CheckAliasError($alias, $content_id = -1)\n\t{\n\t\tglobal $gCms;\n\t\t$db = &$gCms->GetDb();\n\n\t\t$error = FALSE;\n\n\t\tif (preg_match('/^\\d+$/', $alias))\n\t\t{\n\t\t\t$error = lang('aliasnotaninteger');\n\t\t}\n\t\telse if (!preg_match('/^[\\-\\_\\w]+$/', $alias))\n\t\t{\n\t\t\t$error = lang('aliasmustbelettersandnumbers');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$params = array($alias);\n\t\t\t$query = \"SELECT content_id FROM \".cms_db_prefix().\"content WHERE content_alias = ?\";\n\t\t\tif ($content_id > -1)\n\t\t\t{\n\t\t\t\t$query .= \" AND content_id != ?\";\n\t\t\t\t$params[] = $content_id;\n\t\t\t}\n\t\t\t$row = &$db->GetRow($query, $params);\n\n\t\t\tif ($row)\n\t\t\t{\n\t\t\t\t$error = lang('aliasalreadyused');\n\t\t\t}\n\t\t}\n\n\t\treturn $error;\n\t}", "public function testIncorrectValidation()\n {\n $rule = new DenyPathRule('login');\n\n /**\n * We add query string to simulate real world\n */\n $request = new Request();\n $request->server->add([\n 'REQUEST_URI' => '/abc.html'\n ]);\n\n $validationResult = $rule->validate($request);\n\n $this->assertFalse($validationResult);\n }", "function is_ipaddroranyalias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "public function checkIfUserCanAddToAllLocations() {\n if (empty($this->request->params['pass']) || $this->request->params['pass'][0] === '') {\n return false;\n }\n\n return $this->request->params['pass'][0] === $this->userLocation; \n }", "function is_ipaddroralias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]) && is_ipaddr($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "public function validate()\n {\n return filter_var($this->getValue(), FILTER_VALIDATE_URL) !== false;\n }", "public static function check_admin_uri() {\n if (isset(Router::$segments[0]) && Router::$segments[0] == Kohana::config('njiandan.admin_uri')) {\n self::$is_admin_uri = TRUE;\n } else {\n self::$is_admin_uri = FALSE;\n }\n return self::$is_admin_uri;\n }", "public static function getAlias($alias, $throwException = true)\n {\n if (strncmp($alias, '@', 1)) {\n // not an alias\n return $alias;\n }\n \n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n \n if (isset(static::$aliases[$root])) {\n if (is_string(static::$aliases[$root])) {\n return $pos === false ? static::$aliases[$root] : static::$aliases[$root] . substr($alias, $pos);\n } else {\n foreach (static::$aliases[$root] as $name => $path) {\n if (strpos($alias . '/', $name . '/') === 0) {\n return $path . substr($alias, strlen($name));\n }\n }\n }\n }\n \n if ($throwException) {\n throw new InvalidParamException(\"Invalid path alias: $alias\");\n } else {\n return false;\n }\n }", "function validatePath($path)\n{\n $msg = \"<img src=\\\"../images/red.gif\\\" alt=\\\"\\\" title=\\\"Path is not Valid\\\"><br><font color=\\\"#ff0000\\\">Path is not Valid</font>\";\n if (is_dir($path)) {\n if (is_writable($path)) {\n $msg = \"<img src=\\\"../images/green.gif\\\" alt=\\\"\\\" title=\\\"Valid\\\">\";\n } else {\n $msg = \"<img src=\\\"../images/red.gif\\\" alt=\\\"\\\" title=\\\"Path is not Writable\\\"><br><font color=\\\"#ff0000\\\">Path is not Writable -- make sure you chmod +w this path</font>\";\n }\n }\n return $msg;\n}", "protected function isAuthorityValid()\n {\n $pos = strpos($this->getSchemeSpecificPart(), '//');\n if ('' !== $this->getScheme() && 0 !== $pos) {\n return false;\n }\n\n return !('' === $this->getHost() && 0 === $pos);\n }", "private function isValidFullPath($path)\n {\n $valid = false;\n\n // TODO: Handle network shares?\n if (1 === preg_match('/^[a-z]+:\\\\\\\\/i', $path) && is_file($path)) {\n $valid = true;\n }\n\n return $valid;\n }", "function myprefix_setting_one_slug_validate($input) {\n\treturn $input;\n}", "public function checkIsSymlink($path);", "function isAbsPath($path) {\r\n if (preg_match('|^[\\\\\\/]|', $path)) { return true; } // leading slash or backslash (for windows)\r\n if (preg_match('|^[a-zA-Z]:[\\\\\\/]|', $path)) { return true; } // windows drive\r\n if (preg_match('|^\\\\\\\\[a-zA-Z]|', $path)) { return true; } // unc path\r\n return false;\r\n}", "public function isMenuItemValidSetValidHrefAndTitleExpectTrue() {}", "private function isValidUri(): bool\n {\n return true;\n }", "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "function validateUploadPath(&$model, $fieldData) {\n $path = WWW_ROOT . 'files' .DS;\n \n if (!is_writable($path)) return false;\n \n return true;\n }", "private function allowedPath(array $path)\n {\n \n $findParam = $this->findRequestParam();\n \n $param1 = (is_array($findParam) && array_key_exists(0, $findParam)) ? $findParam[0] : '';\n \n if (!(in_array($this->findRequestPath(0), $path, true) || (in_array($param1, $path, true)))) {\n\n return false; \n \n } else {\n\n return true;\n\n }\n\n }", "function validateUri($uri);", "function ju_is_url_absolute(string $u):bool {return ju_starts_with($u, ['http', '//']);}", "protected function validateParams() {\r\n $user = $this->user;\r\n $userId = $this->userId;\r\n if ($user === NULL) {\r\n $lang = $this->getLanguage();\r\n $this->addErrorMessage($lang->getMessage('error.userNotFound', htmlspecialchars($userId)));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "private function checkURI()\n {\n // init vars\n $result = false;\n $uri = $this->getURI();\n $routesArray = $this->routes;\n\n // get existed rule for user requested uri\n foreach ($routesArray as $rulePattern => $path) {\n if (preg_match(\"~$rulePattern~i\", $uri)) {\n $result = [$rulePattern, $path];\n return $result;\n }\n }\n }", "static public function valid_url($url, $allow_user_pass=false) {\n\n if ($url == '') {\n return false;\n }\n if ($allow_user_pass !== true) {\n if (strstr($url, '@')) {\n // in the format http://user:pass@example.com or http://user@example.com\n // but could easily be somebody incorrectly entering an email address in place of a URL\n return false;\n }\n }\n if ($parts = $this->safe_parse_url($url)) {\n if (($parts['scheme'] != 'http') && ($parts['scheme'] != 'https') && ($parts['scheme'] != 'ftp') && ($parts['scheme'] != 'gopher')) {\n return false;\n } elseif (!eregi(\"^[[:alnum:]]([-.]?[0-9a-z])*\\.[a-z]{2,3}$\", $parts['host'], $regs) && !IsValidDottedIP($parts['host'])) {\n return false;\n } elseif (!eregi(\"^([[:alnum:]-]|[\\_])*$\", $parts['user'], $regs)) {\n return false;\n } elseif (!eregi(\"^([[:alnum:]-]|[\\_])*$\", $parts['pass'], $regs)) {\n return false;\n } elseif (!eregi(\"^[[:alnum:]/_\\.@~-]*$\", $parts['path'], $regs)) {\n return false;\n } elseif (!eregi(\"^[[:alnum:]?&=+:;_()%#/,\\.-]*$\", $parts['query'], $regs)) {\n return false;\n } else {\n return true;\n }\n }\n return false;\n }", "function valid_folder($path){\r\n\t$ignore = array('.', '..', '.svn', 'CVS', 'cache', 'install', 'index.html', '.htaccess', '_images');\r\n\tif (isset($path)){\r\n\t\tif (!is_file($path) && !is_link($path) && !in_array(basename($path), $ignore)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public function validate($path, $prefix = '<li>', $suffix = \"</li>\\n\")\n {\n $this->errors->errorPage($path, null, $prefix, $suffix);\n }", "public function validUser();", "function path_is_absolute($path)\n {\n }", "public function isValidPath($path)\n\t{\n\t\treturn $this->getPath() == rtrim($path,'/').'/';\n\t}", "public function getIsAbsolutePath() {}", "public function isSuggestedAgainst()\n\t{\n\t\treturn (in_array($this->login_base, array(\n\t\t\t'login',\n\t\t\t'admin',\n\t\t\t'user-login',\n\t\t)));\n\t}", "final public function check_alias(&$action) {\n\t\tif (!empty($this->alias[$action]))\n\t\t\t$action = $this->alias[$action];\n\t}", "public static function setAlias($alias, $path)\n {\n if (strncmp($alias, '@', 1)) {\n $alias = '@' . $alias;\n }\n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n if ($path !== null) {\n $path = strncmp($path, '@', 1) ? rtrim($path, '\\\\/') : static::getAlias($path);\n if (!isset(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [$alias => $path];\n }\n } elseif (is_string(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [\n $alias => $path,\n $root => static::$aliases[$root],\n ];\n }\n } else {\n static::$aliases[$root][$alias] = $path;\n krsort(static::$aliases[$root]);\n }\n } elseif (isset(static::$aliases[$root])) {\n if (is_array(static::$aliases[$root])) {\n unset(static::$aliases[$root][$alias]);\n } elseif ($pos === false) {\n unset(static::$aliases[$root]);\n }\n }\n }", "public function isValidRelative()\n {\n if ($this->scheme || $this->host || $this->userInfo || $this->port) {\n return false;\n }\n\n if ($this->path) {\n // Check path-only (no host) URI\n if (0 === strpos($this->path, '//')) {\n return false;\n }\n return true;\n }\n\n if (! ($this->query || $this->fragment)) {\n // No host, path, query or fragment - this is not a valid URI\n return false;\n }\n\n return true;\n }", "public function hasAliases(): bool\n {\n return (bool)count($this->queryParameters);\n }", "public function cli_validateArgs() {}", "function check_user_data ( &$tpl, $alias_id) {\r\n\r\n\tglobal $sql;\r\n\r\n\t$forward_url = get_punny($_POST['forward']);\r\n\r\n $ed_error = '_off_';\r\n\t$admin_login = '';\r\n\tif ($forward_url != 'no') {\r\n\t\tif (chk_url($forward_url) > 0 ) {\r\n\t\t\t$ed_error = tr(\"Incorrect forward syntax\");\r\n\t\t}\r\n\t}\r\n\r\n\tif('_off_' === $ed_error){\r\n\r\n\t\texec_query($sql,\r\n \"update domain_aliasses set url_forward=?, alias_status='\" . STATUS_TOCHANGE . \"' where alias_id=?\",\r\n array($forward_url, $alias_id));\r\n\t\tsend_request();\r\n\t\t$admin_login = $_SESSION['user_logged'];\r\n\t\twrite_log(\"$admin_login: change domain alias forward\");\r\n\r\n\t\tunset($_SESSION['edit_ID']);\r\n\t\treturn true;\r\n\r\n } else {\r\n\r\n $tpl -> assign('MESSAGE', $ed_error);\r\n\t\t$tpl -> parse('PAGE_MESSAGE', 'page_message');\r\n\t return false;\r\n\r\n }\r\n\r\n}", "public function validateRedirectUrlKeepsCleanUrlDataProvider() {}", "public function isValidUrlInvalidRessourceDataProvider() {}", "public function validate_abbreviation() {\n $errors = array();\n \n if (!is_null($this->abbreviation) && $this->abbreviation != '') {\n if (strlen($this->abbreviation) > 12) {\n $errors[] = 'Lyhenteen pituuden tulee olla enintään 12 merkkiä.';\n }\n \n $other_departments = $this->other_departments();\n\n foreach ($other_departments as $d) {\n if (strcasecmp($d->abbreviation, $this->abbreviation) == 0) {\n $errors[] = 'Olet jo lisännyt samannimisen lyhenteen.';\n }\n }\n }\n \n return $errors;\n }", "public function validate_username() {\n\n\t\tif(strtolower($this->username) == 'admin')\n\t\t\t$this->addError('username','Usuario no disponible.');\n\t}", "function check_path_segment(string $path)\n{\n $trailingslashed = trailingslashit($path);\n\n // Don't want a leading slash.\n $frontchecked = ltrim($trailingslashed, '\\\\/');\n return $frontchecked;\n}" ]
[ "0.6757073", "0.6390587", "0.6207587", "0.61845607", "0.5993335", "0.5918532", "0.5694377", "0.5662228", "0.56369156", "0.5626693", "0.56194794", "0.5601067", "0.55725414", "0.55138916", "0.54741764", "0.54674846", "0.54623014", "0.5444483", "0.54402214", "0.5398273", "0.53954685", "0.5387616", "0.53682697", "0.53665954", "0.53617644", "0.5347182", "0.52998763", "0.5296826", "0.52466", "0.5233996", "0.52254725", "0.5222776", "0.5203883", "0.51943034", "0.51943034", "0.51837826", "0.5156577", "0.5114893", "0.5084753", "0.5077164", "0.49935576", "0.4985183", "0.49814737", "0.495904", "0.49542153", "0.4950198", "0.49433643", "0.49378902", "0.4935315", "0.49226838", "0.49223042", "0.4910583", "0.49075934", "0.48951367", "0.48924446", "0.48595405", "0.48591673", "0.48591402", "0.48473164", "0.4847105", "0.48394445", "0.4836947", "0.4822757", "0.48048025", "0.48021773", "0.47967023", "0.47965434", "0.4793478", "0.47740892", "0.47722593", "0.4761322", "0.47590134", "0.4742311", "0.4735204", "0.47327524", "0.47291443", "0.47261646", "0.4699497", "0.4697579", "0.46964884", "0.4692289", "0.46901613", "0.46826777", "0.46819574", "0.46752903", "0.4670816", "0.4661448", "0.46613187", "0.46557942", "0.46555433", "0.46539247", "0.46487752", "0.46456173", "0.46438435", "0.46380886", "0.46345955", "0.4633328", "0.4632424", "0.46295938", "0.46276352" ]
0.7691198
0
Checks if user aliases path is set
Проверяет, задан ли путь пользовательских алиасов
public function hasUserAliasesPath() { return !empty($this->userAliasesPath)?:false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasDefaultUserAliasesPath()\n {\n return !empty($this->getDefaultUserAliasesPath())?:false;\n }", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function isUserAliasesPathValid($path)\n {\n return (is_string($path) && !empty($path))?:false;\n }", "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function createUserAliasesDirectory()\n {\n if(!$this->userAliasesDirectoryExist())\n return $this->createDirectory($this->getUserAliasesPath());\n return true;\n }", "function is_alias_inuse($alias) {\n\tif ($alias == \"\") {\n\t\treturn false;\n\t}\n\t/* loop through firewall rules looking for alias in use */\n\tforeach (config_get_path('filter/rule', []) as $rule) {\n\t\tforeach (['source', 'destination'] as $origin) {\n\t\t\tif (array_get_path($rule, \"{$origin}/address\") == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through nat rules looking for alias in use */\n\tforeach (config_get_path('nat/rule', []) as $rule) {\n\t\tforeach (['target', 'source/address', 'destination/address'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through outbound nat rules looking for alias in use */\n\tforeach (config_get_path('nat/outbound/rule', []) as $rule) {\n\t\tforeach (['target', 'sourceport', 'dstport', 'source/network', 'destination/network'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function checkAndSetAlias() {}", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "public function setUserAliasesPath($path)\n {\n if(!$this->isUserAliasesPathValid($path))\n throw new InvalidArgumentException(sprintf('User aliases path: \"%s\" is invalid.',$path));\n $this->userAliasesPath=$path;\n }", "public function isAlias()\n {\n return null !== $this->alias;\n }", "function check_alias ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['aliases'] >= 0)\n {\n if ($limit['alias_count'] >= $limit['aliases'])\n {\n return false;\n }\n }\n return true;\n}", "public function useAlias()\n {\n return isset($this->actual);\n }", "function is_alias($name) {\n\n\tglobal $aliastable;\n\n\treturn isset($aliastable[$name]);\n}", "function alias_existente($alias) {\r\n $db = new MySQL();\r\n $existencia = $db->sql_query(\"SELECT * FROM `usuarios_usuarios` WHERE `alias`='\" . $alias . \"' ;\");\r\n $existe = $db->sql_numrows($existencia);\r\n $db->sql_close();\r\n if ($existe == 0) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function testPathAliasProcessing() {\n // Add a path alias for the '/admin' system path.\n $values = [\n 'path' => '/admin/structure',\n 'alias' => '/admin-structure-alias',\n 'langcode' => 'und',\n 'status' => 1,\n ];\n\n $database = \\Drupal::database();\n $id = $database->insert('path_alias')\n ->fields($values + ['uuid' => \\Drupal::service('uuid')->generate()])\n ->execute();\n\n $revision_id = $database->insert('path_alias_revision')\n ->fields($values + ['id' => $id, 'revision_default' => 1])\n ->execute();\n\n $database->update('path_alias')\n ->fields(['revision_id' => $revision_id])\n ->condition('id', $id)\n ->execute();\n\n // Increment the schema version.\n \\Drupal::state()->set('update_test_schema_version', 8002);\n $this->runUpdates();\n\n // Check that the alias defined earlier is not used during the update\n // process.\n $this->assertSession()->linkByHrefExists('/admin/structure');\n $this->assertSession()->linkByHrefNotExists('/admin-structure-alias');\n\n $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']);\n $this->drupalLogin($account);\n\n // Go to the status report page and check that the alias is used.\n $this->drupalGet('admin/reports/status');\n $this->assertSession()->linkByHrefNotExists('/admin/structure');\n $this->assertSession()->linkByHrefExists('/admin-structure-alias');\n }", "public function is_alias()\n {\n return $this->is_alias;\n }", "public function hasAliases(): bool\n {\n return (bool)count($this->queryParameters);\n }", "public function isAliasAvailable()\n {\n if (!$this->isAliasPMEnabled() || !Mage::helper('customer/data')->isLoggedIn()) {\n return false;\n }\n\n $quote = $this->getQuote();\n /** @var Netresearch_OPS_Helper_Alias $aliasManager */\n $aliasManager = Mage::helper('ops/alias');\n $aliasCount = $aliasManager->getAliasesForAddresses(\n $quote->getCustomer()->getId(),\n $quote->getBillingAddress(),\n $quote->getShippingAddress(),\n $quote->getStoreId()\n )\n ->addFieldToFilter('state', Netresearch_OPS_Model_Alias_State::ACTIVE)\n ->addFieldToFilter('payment_method', $this->getMethod()->getCode())\n ->count();\n\n return $aliasCount > 0;\n }", "protected function isRealAlias($alias)\n {\n $this->initAliases();\n return isset($this->aliases[$alias]['ssh']);\n }", "public function should_link_to_wp_admin() {\n\t\t$result = false; // Calypso.\n\n\t\t$user_attribute = get_user_attribute( get_current_user_id(), 'calypso_preferences' );\n\t\tif ( ! empty( $user_attribute['linkDestination'] ) ) {\n\t\t\t$result = $user_attribute['linkDestination'];\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function check_admin_uri() {\n if (isset(Router::$segments[0]) && Router::$segments[0] == Kohana::config('njiandan.admin_uri')) {\n self::$is_admin_uri = TRUE;\n } else {\n self::$is_admin_uri = FALSE;\n }\n return self::$is_admin_uri;\n }", "public function isValidAlias($alias);", "public function isAlias(string $id)\n {\n return array_key_exists($id, $this->aliases);\n }", "public function getUserPath($path)\n\t{\n\t\tif (file_exists($this->user_theme_templates_path . $path))\n\t\t{\n\t\t\treturn $this->user_theme_templates_path . $path;\n\t\t}\n\t\telseif (file_exists($this->user_theme_assets_path . $path))\n\t\t{\n\n\t\t\treturn $this->user_theme_assets_path . $path;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function isSuggestedAgainst()\n\t{\n\t\treturn (in_array($this->login_base, array(\n\t\t\t'login',\n\t\t\t'admin',\n\t\t\t'user-login',\n\t\t)));\n\t}", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }", "function is_ipaddroranyalias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function hasAdmin() {\n\n return database::getInstance()->has(\"staff\",[\"Path[!]\" => null]);\n\n }", "function is_ipaddroralias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]) && is_ipaddr($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "public function hasTemplate($aliasOrTemplatePath);", "public function checkIfUserCanAddToAllLocations() {\n if (empty($this->request->params['pass']) || $this->request->params['pass'][0] === '') {\n return false;\n }\n\n return $this->request->params['pass'][0] === $this->userLocation; \n }", "function wlabarron_saml_is_user_in_config() {\n global $yourls_user_passwords;\n $users = array_keys($yourls_user_passwords);\n \n return in_array(YOURLS_USER, $users);\n}", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "public function aliases($options = ['print' => false, 'location' => null,])\n {\n $aliases = $this->session()->getUser()->getAliases();\n if (isset($options['print']) && $options['print']) {\n return $aliases;\n }\n if (is_null($location = $options['location'])) {\n $location = '~/.drush/pantheon.aliases.drushrc.php';\n }\n $config = $this->getConfig();\n $location = $config->fixDirectorySeparators(str_replace('~', $config->get('user_home'), $location));\n $config->ensureDirExists(dirname($location));\n if (file_put_contents($location, $aliases) !== false) {\n $this->log()->notice('Aliases file written to {location}.', ['location' => $location,]);\n }\n }", "public function registerDefaultAliases()\n\t{\n\t\tparent::registerDefaultAliases();\n\t\t\\Yii::$aliases['@www'] = dirname($_SERVER['SCRIPT_FILENAME']);\n\t}", "final public function check_alias(&$action) {\n\t\tif (!empty($this->alias[$action]))\n\t\t\t$action = $this->alias[$action];\n\t}", "public function exists($alias);", "function is_user_preference_short_url() {\n\treturn (isset($_COOKIE['doShort'])) ? true : false;\n}", "public function isSystemPath()\n {\n $parts = $this->_getPathParts();\n return (count($parts) < 3) ||\n (count($parts) == 3 && $this->containerType === FileSystem::FOLDER_TYPE_PERSONAL);\n }", "public function isAliasPMEnabled()\n {\n return Mage::getModel('ops/config')->isAliasManagerEnabled($this->getMethodCode());\n }", "public function isAliasPMEnabled()\n {\n return Mage::getModel('ops/config')->isAliasManagerEnabled($this->getMethodCode());\n }", "public function hasAlias(string $alias): bool\n {\n return isset($this->aliases[$alias]);\n }", "protected function usingRealPath()\n {\n return $this->input->hasOption('realpath') && $this->option('realpath');\n }", "public function checkDirectoryExistance()\n {\n if (!file_exists($this->event->getConfig()->router->global_router)) {\n return false;\n }\n if (!is_readable($this->event->getConfig()->router->global_router)) {\n return false;\n }\n\n return true;\n }", "public function isAbsolutePath()\n {\n if ($this->exists === false) {\n $this->is_absolute_path = null;\n return;\n }\n\n if (substr($this->path, 0, 1) == '/') {\n $this->is_absolute_path = true;\n $this->absolute_path = $this->path;\n } else {\n $this->is_absolute_path = false;\n }\n\n return;\n }", "protected function isAlias($unit, $key) {\n\n\t\t\treturn in_array($unit, $this->_aliases[$key]);\n\t\t}", "private function isAuthRequiredForPath($path)\n {\n\t\t$path_arr = explode('/', $path);\n\t\t$path_new = implode('/', array_slice($path_arr, 0, 3));\n\t\t\n return in_array($path_new, [\n\t\t]);\n }", "public function getIsAbsolutePath() {}", "public function isAlias($name)\n {\n return isset($this->aliases[$name]);\n }", "public function getPathAuthRequired()\n {\n }", "public function isExternalAuth() {\n\t\t$remoteUser = env('REMOTE_USER');\n\t\tif (empty($remoteUser)) {\n\t\t\t$remoteUser = env('REDIRECT_REMOTE_USER');\n\t\t}\n\n\t\t$result = !empty($remoteUser);\n\n\t\treturn $result;\n\t}", "final private static function _is_package_alias($package_name) {\n\t\t\n\t\t# the first character in an alias is a colon\n\t\tif(substr($package_name, 0, 1) !== ':') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function hasAlias($alias)\n {\n return in_array($alias, $this->aliases);\n }", "function is_user_option_local($key, $user_id = 0, $blog_id = 0)\n {\n }", "public function addServerAlias(string $alias): bool {}", "protected function usingRealPath()\n {\n return $this->hasOption('realpath') && $this->option('realpath');\n }", "public function isAlias( $name );", "function email_have_asociated_folders($userid) {\n\tglobal $CFG, $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\tif ( $CFG->email_marriedfolders2courses ) {\n\t\tif ( $preferences = get_record('email_preference', 'userid', $userid) ) {\n\t\t\tif ($preferences->marriedfolders2courses) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "function is_admin()\n{\n return in_array($GLOBALS['user'], $GLOBALS['admins']);\n}", "public static function setPathOfAlias($alias,$path) {\n if(empty($path)) {\n unset(self::$_aliases[$alias]);\n } else {\n self::$_aliases[$alias] = rtrim($path,'\\\\/');\n }\n }", "public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}", "public function hasAlias(string $class):bool\n {\n return isset($this->aliases[$class]);\n }", "public function isPathDefined()\n {\n if (isset($this->path)) {\n // Make sure there's no forward slashes in the front (beginning) of the path string\n return ltrim($this->path, \"/\");\n }\n return false;\n }", "public function isAliasInfoBlockEnabled()\n {\n return ($this->isAliasPMEnabled()\n && Mage::getModel('ops/config')->isAliasInfoBlockEnabled());\n }", "public function containsAlias($alias) \n {\n return isset($this->_entries[$alias]);\n }", "public function isAliasInfoBlockEnabled()\n {\n return ($this->isAliasPMEnabled()\n && Mage::getModel('ops/config')->isAliasInfoBlockEnabled());\n }", "private function should_use_absolute_route_for_auth(): bool {\n\t\treturn config( 'browser-testing.domain' ) !== null;\n\t}", "public function isAdmin($user) {\n return in_array($user, $this->config['admins']);\n }", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "function user_admin_url($path = '', $scheme = 'admin')\n {\n }", "function subsite_manager_is_superadmin($user_guid = 0){\n static $superadmin_cache;\n\n $result = false;\n\n $user_guid = sanitise_int($user_guid, false);\n\n if(empty($user_guid)){\n $user_guid = elgg_get_logged_in_user_guid();\n }\n\n if(!empty($user_guid)){\n if(!isset($superadmin_cache)){\n $superadmin_cache = array();\n }\n\n if(!isset($superadmin_cache[$user_guid])){\n $superadmin_cache[$user_guid] = false;\n\n $query = \"SELECT value\";\n $query .= \" FROM \" . get_config(\"dbprefix\") . \"private_settings\";\n $query .= \" WHERE name = 'superadmin'\";\n $query .= \" AND entity_guid = \" . $user_guid;\n\n if ($setting = get_data_row($query)) {\n if($setting->value == true){\n $superadmin_cache[$user_guid] = true;\n }\n }\n }\n\n $result = $superadmin_cache[$user_guid];\n }\n\n return $result;\n }", "public function testAroAliases()\n {\n $this->Acl->Aro->map = [\n 'User' => 'User/username',\n 'Role' => 'User/group_id',\n ];\n\n $this->Acl->Aro->aliases = [\n 'Role/1' => 'Role/admin',\n 'Role/24' => 'Role/accounting',\n ];\n\n $user = [\n 'User' => [\n 'username' => 'unknown_user',\n 'group_id' => '1',\n ],\n ];\n // group/1\n $this->assertSame('Role/admin', $this->Acl->Aro->resolve($user));\n // group/24\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('Role/24'));\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('24'));\n\n // check department\n $user = [\n 'User' => [\n 'username' => 'foo',\n 'group_id' => '25',\n ],\n ];\n\n $this->Acl->Aro->addRole(['Role/IT' => null]);\n $this->Acl->Aro->addAlias(['Role/25' => 'Role/IT']);\n $this->Acl->allow('Role/IT', '/rules/debugging/*');\n\n $this->assertEquals([['Role/IT']], $this->Acl->Aro->roles($user));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload'));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries'));\n // Role/default is allowed users dashboard, but not Role/IT\n $this->assertFalse($this->Acl->check($user, '/controllers/users/dashboard'));\n\n $this->assertFalse($this->Acl->check($user, '/controllers/invoices/send'));\n // wee add an more specific entry for user foo to also inherit from Role/accounting\n $this->Acl->Aro->addRole(['User/foo' => 'Role/IT, Role/accounting']);\n $this->assertTrue($this->Acl->check($user, '/controllers/invoices/send'));\n }", "public static function setAlias($alias, $path)\n {\n if (strncmp($alias, '@', 1)) {\n $alias = '@' . $alias;\n }\n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n if ($path !== null) {\n $path = strncmp($path, '@', 1) ? rtrim($path, '\\\\/') : static::getAlias($path);\n if (!isset(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [$alias => $path];\n }\n } elseif (is_string(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [\n $alias => $path,\n $root => static::$aliases[$root],\n ];\n }\n } else {\n static::$aliases[$root][$alias] = $path;\n krsort(static::$aliases[$root]);\n }\n } elseif (isset(static::$aliases[$root])) {\n if (is_array(static::$aliases[$root])) {\n unset(static::$aliases[$root][$alias]);\n } elseif ($pos === false) {\n unset(static::$aliases[$root]);\n }\n }\n }", "private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "protected function initAliases()\n {\n if ($this->aliases === null) {\n $this->aliases = [];\n $configurator = \\WP_CLI::get_configurator();\n foreach ($configurator->get_aliases() as $alias => $config) {\n $this->aliases[$alias] = \\WP_CLI\\Utils\\parse_ssh_url($config['ssh']);\n $this->aliases[$alias] += $config;\n if (!isset($this->aliases[$alias]['port'])) {\n $this->aliases[$alias]['port'] = self::SSH_PORT;\n }\n }\n }\n }", "function path_admin_form_validate($form, &$form_state) {\n $src = $form_state['values']['src'];\n $dst = $form_state['values']['dst'];\n $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0;\n // Language is only set if locale module is enabled, otherwise save for all languages.\n $language = isset($form_state['values']['language']) ? $form_state['values']['language'] : '';\n\n if (db_result(db_query(\"SELECT COUNT(dst) FROM {url_alias} WHERE pid != %d AND dst = '%s' AND language = '%s'\", $pid, $dst, $language))) {\n form_set_error('dst', t('The alias %alias is already in use in this language.', array('%alias' => $dst)));\n }\n $item = menu_get_item($src);\n if (!$item || !$item['access']) {\n form_set_error('src', t(\"The path '@link_path' is either invalid or you do not have access to it.\", array('@link_path' => $src)));\n }\n}", "protected function isAdminUser() {}", "public function checkIsSymlink($path);", "public function userExists( $uid ){\n\t\t$dir = OC_Config::getValue( \"datadirectory\", OC::$SERVERROOT.\"/data\" ) . '/' . $uid . \"/files\";\n\t\treturn file_exists($dir);\n\t}", "public function hasUrlPath()\n {\n return $this->url_path !== null;\n }", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "function check_user_data ( &$tpl, $alias_id) {\r\n\r\n\tglobal $sql;\r\n\r\n\t$forward_url = get_punny($_POST['forward']);\r\n\r\n $ed_error = '_off_';\r\n\t$admin_login = '';\r\n\tif ($forward_url != 'no') {\r\n\t\tif (chk_url($forward_url) > 0 ) {\r\n\t\t\t$ed_error = tr(\"Incorrect forward syntax\");\r\n\t\t}\r\n\t}\r\n\r\n\tif('_off_' === $ed_error){\r\n\r\n\t\texec_query($sql,\r\n \"update domain_aliasses set url_forward=?, alias_status='\" . STATUS_TOCHANGE . \"' where alias_id=?\",\r\n array($forward_url, $alias_id));\r\n\t\tsend_request();\r\n\t\t$admin_login = $_SESSION['user_logged'];\r\n\t\twrite_log(\"$admin_login: change domain alias forward\");\r\n\r\n\t\tunset($_SESSION['edit_ID']);\r\n\t\treturn true;\r\n\r\n } else {\r\n\r\n $tpl -> assign('MESSAGE', $ed_error);\r\n\t\t$tpl -> parse('PAGE_MESSAGE', 'page_message');\r\n\t return false;\r\n\r\n }\r\n\r\n}", "public function hasAdminDn()\n {\n return $this->admin_dn !== null;\n }", "public function sourceHasAlias($source) {\n\n $select = $this->select();\n $select->where('source = \"' . $source . '\"');\n $item = $this->fetchRow($select);\n\n return (is_numeric($item->urlAliasId) && $item->urlAliasId > 0);\n }", "function path_is_absolute($path)\n {\n }", "public static function adminsAreAlreadySet()\n {\n return Cache::rememberForever('config:has-admin', function () {\n return User::where(\"admin\", true)->exists();\n });\n }", "static function isAbsolutePath($path) {\n\t\tif (0 === strpos ( PHP_OS, 'Linux' )) {\n\t\t\treturn 0 === strpos ( $path, '/' );\n\t\t} elseif (0 === strpos ( PHP_OS, 'WIN' )) {\n\t\t\t$path = strtolower ( $path );\n\t\t\treturn ( bool ) preg_match ( '/[a-z]:(\\/|\\\\)/i', $path );\n\t\t} else {\n\t\t\tuser_error ( 'Unknown OS', E_USER_ERROR );\n\t\t}\n\t}", "function is_user_admin()\n {\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "public function isAbsolute(): bool\n\t{\n\t\treturn empty($this->host) === false;\n\t}", "public static function is_user_folder($user_id){\n\n\t}", "public function verifyAliases($dc)\n\t{\n\t\tif (!$dc->activeRecord)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($dc->activeRecord->alias == '')\n\t\t{\n\t\t\t$strAlias = $this->generateFolderAlias('', $dc);\n\t\t\t$this->Database->prepare(\"UPDATE tl_page SET alias=? WHERE id=?\")->execute($strAlias, $dc->id);\n\t\t}\n\t\t\n\t\t$objPage = $this->getPageDetails($dc->id);\n\t\t$objRoot = $this->Database->execute(\"SELECT * FROM tl_page WHERE id=\".(int)$objPage->rootId);\n\t\t\n\t\tif ($objRoot->subAlias)\n\t\t{\n\t\t\t$arrChildren = $this->getChildRecords($dc->id, 'tl_page', true);\n\t\t\t\n\t\t\tif (count($arrChildren))\n\t\t\t{\n\t\t\t\t$objChildren = $this->Database->execute(\"SELECT * FROM tl_page WHERE id IN (\" . implode(',', $arrChildren) . \") AND alias='' ORDER BY id=\" . implode(' DESC, id=', $arrChildren) . \" DESC\");\n\t\t\t\t\n\t\t\t\twhile( $objChildren->next() )\n\t\t\t\t{\n\t\t\t\t\t$strAlias = $this->generateFolderAlias('', (object)array('id'=>$objChildren->id, 'activeRecord'=>$objChildren));\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_page SET alias=? WHERE id=?\")->execute($strAlias, $objChildren->id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function verifyAccess($user){\n\t\treturn true; \n\t}", "public function isAlias($column)\n {\n $aliases = array_flip($this->aliases);\n return isset($aliases[$column]);\n }" ]
[ "0.7748395", "0.76350576", "0.7192105", "0.6353558", "0.6316176", "0.6173999", "0.60652107", "0.6031963", "0.59272915", "0.5753584", "0.5749079", "0.5713182", "0.56995", "0.56790847", "0.5655186", "0.56488967", "0.5647139", "0.5629692", "0.56181437", "0.5617994", "0.5513474", "0.5496279", "0.54612345", "0.5458701", "0.54219383", "0.5418926", "0.53901374", "0.53633106", "0.5358371", "0.5353822", "0.53374493", "0.53271294", "0.5306619", "0.53047705", "0.52704155", "0.52646124", "0.5250447", "0.5235971", "0.5229402", "0.521549", "0.5204473", "0.5193355", "0.51920784", "0.51888454", "0.51882464", "0.51882464", "0.5184068", "0.51739603", "0.51655567", "0.5162024", "0.51614535", "0.51572895", "0.51560843", "0.5152086", "0.51488644", "0.5137269", "0.51331145", "0.5132799", "0.51236963", "0.51136637", "0.5094963", "0.5092534", "0.50890964", "0.50887954", "0.5060924", "0.50597507", "0.5059638", "0.5057416", "0.50496316", "0.5043016", "0.50421697", "0.5027627", "0.50186497", "0.50061077", "0.5004189", "0.49982682", "0.49963382", "0.49963105", "0.49913016", "0.49704948", "0.49635354", "0.495539", "0.49547943", "0.49380964", "0.49380335", "0.4930901", "0.4918274", "0.49150622", "0.49142423", "0.49104297", "0.4907355", "0.49061248", "0.4905577", "0.4897827", "0.48974416", "0.48969737", "0.48967722", "0.48893985", "0.48888505", "0.48613927" ]
0.82215333
0
Checks if default user aliases path is set
Проверяет, задан ли по умолчанию путь к алиасам пользователя
public function hasDefaultUserAliasesPath() { return !empty($this->getDefaultUserAliasesPath())?:false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUserAliasesPath()\n {\n return !empty($this->userAliasesPath)?:false;\n }", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function isUserAliasesPathValid($path)\n {\n return (is_string($path) && !empty($path))?:false;\n }", "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "public function createUserAliasesDirectory()\n {\n if(!$this->userAliasesDirectoryExist())\n return $this->createDirectory($this->getUserAliasesPath());\n return true;\n }", "public function registerDefaultAliases()\n\t{\n\t\tparent::registerDefaultAliases();\n\t\t\\Yii::$aliases['@www'] = dirname($_SERVER['SCRIPT_FILENAME']);\n\t}", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "public function checkAndSetAlias() {}", "function is_alias_inuse($alias) {\n\tif ($alias == \"\") {\n\t\treturn false;\n\t}\n\t/* loop through firewall rules looking for alias in use */\n\tforeach (config_get_path('filter/rule', []) as $rule) {\n\t\tforeach (['source', 'destination'] as $origin) {\n\t\t\tif (array_get_path($rule, \"{$origin}/address\") == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through nat rules looking for alias in use */\n\tforeach (config_get_path('nat/rule', []) as $rule) {\n\t\tforeach (['target', 'source/address', 'destination/address'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t/* loop through outbound nat rules looking for alias in use */\n\tforeach (config_get_path('nat/outbound/rule', []) as $rule) {\n\t\tforeach (['target', 'sourceport', 'dstport', 'source/network', 'destination/network'] as $property) {\n\t\t\tif (array_get_path($rule, $property) == $alias) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function is_default_userpic()\n {\n $this->log('Checking for default userpic');\n return (false !== strpos($this->_connection->get(\n self::HOST . self::ACCOUNT_OVERVIEW_URL,\n null,\n self::HOST . self::ACCOUNT_URL\n ), 'no_videos_'));\n }", "public function isSuggestedAgainst()\n\t{\n\t\treturn (in_array($this->login_base, array(\n\t\t\t'login',\n\t\t\t'admin',\n\t\t\t'user-login',\n\t\t)));\n\t}", "public function useAlias()\n {\n return isset($this->actual);\n }", "public function isAlias()\n {\n return null !== $this->alias;\n }", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function should_link_to_wp_admin() {\n\t\t$result = false; // Calypso.\n\n\t\t$user_attribute = get_user_attribute( get_current_user_id(), 'calypso_preferences' );\n\t\tif ( ! empty( $user_attribute['linkDestination'] ) ) {\n\t\t\t$result = $user_attribute['linkDestination'];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function is_alias()\n {\n return $this->is_alias;\n }", "function alias_existente($alias) {\r\n $db = new MySQL();\r\n $existencia = $db->sql_query(\"SELECT * FROM `usuarios_usuarios` WHERE `alias`='\" . $alias . \"' ;\");\r\n $existe = $db->sql_numrows($existencia);\r\n $db->sql_close();\r\n if ($existe == 0) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }", "public static function check_admin_uri() {\n if (isset(Router::$segments[0]) && Router::$segments[0] == Kohana::config('njiandan.admin_uri')) {\n self::$is_admin_uri = TRUE;\n } else {\n self::$is_admin_uri = FALSE;\n }\n return self::$is_admin_uri;\n }", "public function testPathAliasProcessing() {\n // Add a path alias for the '/admin' system path.\n $values = [\n 'path' => '/admin/structure',\n 'alias' => '/admin-structure-alias',\n 'langcode' => 'und',\n 'status' => 1,\n ];\n\n $database = \\Drupal::database();\n $id = $database->insert('path_alias')\n ->fields($values + ['uuid' => \\Drupal::service('uuid')->generate()])\n ->execute();\n\n $revision_id = $database->insert('path_alias_revision')\n ->fields($values + ['id' => $id, 'revision_default' => 1])\n ->execute();\n\n $database->update('path_alias')\n ->fields(['revision_id' => $revision_id])\n ->condition('id', $id)\n ->execute();\n\n // Increment the schema version.\n \\Drupal::state()->set('update_test_schema_version', 8002);\n $this->runUpdates();\n\n // Check that the alias defined earlier is not used during the update\n // process.\n $this->assertSession()->linkByHrefExists('/admin/structure');\n $this->assertSession()->linkByHrefNotExists('/admin-structure-alias');\n\n $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']);\n $this->drupalLogin($account);\n\n // Go to the status report page and check that the alias is used.\n $this->drupalGet('admin/reports/status');\n $this->assertSession()->linkByHrefNotExists('/admin/structure');\n $this->assertSession()->linkByHrefExists('/admin-structure-alias');\n }", "function check_alias ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['aliases'] >= 0)\n {\n if ($limit['alias_count'] >= $limit['aliases'])\n {\n return false;\n }\n }\n return true;\n}", "function is_alias($name) {\n\n\tglobal $aliastable;\n\n\treturn isset($aliastable[$name]);\n}", "public static function is_in_default_dir( $path ) {\n\t\tforeach ( static::get_default_dirs() as $test ) {\n\t\t\tif ( 0 === strpos( $path, $test ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "protected function isRealAlias($alias)\n {\n $this->initAliases();\n return isset($this->aliases[$alias]['ssh']);\n }", "public function hasDefaultIndexDirectoryPath();", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "public function aliases($options = ['print' => false, 'location' => null,])\n {\n $aliases = $this->session()->getUser()->getAliases();\n if (isset($options['print']) && $options['print']) {\n return $aliases;\n }\n if (is_null($location = $options['location'])) {\n $location = '~/.drush/pantheon.aliases.drushrc.php';\n }\n $config = $this->getConfig();\n $location = $config->fixDirectorySeparators(str_replace('~', $config->get('user_home'), $location));\n $config->ensureDirExists(dirname($location));\n if (file_put_contents($location, $aliases) !== false) {\n $this->log()->notice('Aliases file written to {location}.', ['location' => $location,]);\n }\n }", "public function setUserAliasesPath($path)\n {\n if(!$this->isUserAliasesPathValid($path))\n throw new InvalidArgumentException(sprintf('User aliases path: \"%s\" is invalid.',$path));\n $this->userAliasesPath=$path;\n }", "function is_ipaddroralias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]) && is_ipaddr($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "public function getUserPath($path)\n\t{\n\t\tif (file_exists($this->user_theme_templates_path . $path))\n\t\t{\n\t\t\treturn $this->user_theme_templates_path . $path;\n\t\t}\n\t\telseif (file_exists($this->user_theme_assets_path . $path))\n\t\t{\n\n\t\t\treturn $this->user_theme_assets_path . $path;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function is_ipaddroranyalias($ipaddr) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$ipaddr]))\n\treturn true;\n\telse\n\treturn is_ipaddr($ipaddr);\n}", "protected function initAliases()\n {\n if ($this->aliases === null) {\n $this->aliases = [];\n $configurator = \\WP_CLI::get_configurator();\n foreach ($configurator->get_aliases() as $alias => $config) {\n $this->aliases[$alias] = \\WP_CLI\\Utils\\parse_ssh_url($config['ssh']);\n $this->aliases[$alias] += $config;\n if (!isset($this->aliases[$alias]['port'])) {\n $this->aliases[$alias]['port'] = self::SSH_PORT;\n }\n }\n }\n }", "function is_user_preference_short_url() {\n\treturn (isset($_COOKIE['doShort'])) ? true : false;\n}", "function is_user_option_local($key, $user_id = 0, $blog_id = 0)\n {\n }", "public function hasAliases(): bool\n {\n return (bool)count($this->queryParameters);\n }", "public function isAliasAvailable()\n {\n if (!$this->isAliasPMEnabled() || !Mage::helper('customer/data')->isLoggedIn()) {\n return false;\n }\n\n $quote = $this->getQuote();\n /** @var Netresearch_OPS_Helper_Alias $aliasManager */\n $aliasManager = Mage::helper('ops/alias');\n $aliasCount = $aliasManager->getAliasesForAddresses(\n $quote->getCustomer()->getId(),\n $quote->getBillingAddress(),\n $quote->getShippingAddress(),\n $quote->getStoreId()\n )\n ->addFieldToFilter('state', Netresearch_OPS_Model_Alias_State::ACTIVE)\n ->addFieldToFilter('payment_method', $this->getMethod()->getCode())\n ->count();\n\n return $aliasCount > 0;\n }", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function wlabarron_saml_is_user_in_config() {\n global $yourls_user_passwords;\n $users = array_keys($yourls_user_passwords);\n \n return in_array(YOURLS_USER, $users);\n}", "private function isAvatarDefault($avatar)\n {\n return strcmp($avatar, 'storage/avatars/user.png') == 0;\n }", "private function should_use_absolute_route_for_auth(): bool {\n\t\treturn config( 'browser-testing.domain' ) !== null;\n\t}", "public function hasTemplate($aliasOrTemplatePath);", "public function isAlias(string $id)\n {\n return array_key_exists($id, $this->aliases);\n }", "public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}", "function user_admin_url($path = '', $scheme = 'admin')\n {\n }", "public function checkDirectoryExistance()\n {\n if (!file_exists($this->event->getConfig()->router->global_router)) {\n return false;\n }\n if (!is_readable($this->event->getConfig()->router->global_router)) {\n return false;\n }\n\n return true;\n }", "public function hasAdmin() {\n\n return database::getInstance()->has(\"staff\",[\"Path[!]\" => null]);\n\n }", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "protected function usingRealPath()\n {\n return $this->input->hasOption('realpath') && $this->option('realpath');\n }", "public function isValidAlias($alias);", "public function pathAliasCallback() {\n $args = func_get_args();\n switch($args[0]) {\n case '/content/first-node':\n return '/node/1';\n case '/content/first-node-test':\n return '/node/1/test';\n case '/malicious-path':\n return '/admin';\n case '':\n return '<front>';\n default:\n return $args[0];\n }\n }", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "public function checkIfUserCanAddToAllLocations() {\n if (empty($this->request->params['pass']) || $this->request->params['pass'][0] === '') {\n return false;\n }\n\n return $this->request->params['pass'][0] === $this->userLocation; \n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "public function loadAliases() {\n\t\t $aliases = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n\n\t\t$aliases->alias('Purifier', 'Mews\\Purifier\\Facades\\Purifier::class');\n\t\t$aliases->alias(\"Twitter\", 'Thujohn\\Twitter\\Facades\\Twitter::class');\n\t\t$aliases->alias('DotenvEditor', 'Brotzka\\DotenvEditor\\DotenvEditorFacade');\n\n\n\t\t/*\n\t\t* Dev resources\n\t\t */\n\n\t\tif ($this->app->environment() !== \"production\") {\n\n\n\t\t}\n\n\n\t}", "protected function isAdminUser() {}", "protected function usingRealPath()\n {\n return $this->hasOption('realpath') && $this->option('realpath');\n }", "function is_site_admin($user_login = '')\n {\n }", "public function testAroAliases()\n {\n $this->Acl->Aro->map = [\n 'User' => 'User/username',\n 'Role' => 'User/group_id',\n ];\n\n $this->Acl->Aro->aliases = [\n 'Role/1' => 'Role/admin',\n 'Role/24' => 'Role/accounting',\n ];\n\n $user = [\n 'User' => [\n 'username' => 'unknown_user',\n 'group_id' => '1',\n ],\n ];\n // group/1\n $this->assertSame('Role/admin', $this->Acl->Aro->resolve($user));\n // group/24\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('Role/24'));\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('24'));\n\n // check department\n $user = [\n 'User' => [\n 'username' => 'foo',\n 'group_id' => '25',\n ],\n ];\n\n $this->Acl->Aro->addRole(['Role/IT' => null]);\n $this->Acl->Aro->addAlias(['Role/25' => 'Role/IT']);\n $this->Acl->allow('Role/IT', '/rules/debugging/*');\n\n $this->assertEquals([['Role/IT']], $this->Acl->Aro->roles($user));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload'));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries'));\n // Role/default is allowed users dashboard, but not Role/IT\n $this->assertFalse($this->Acl->check($user, '/controllers/users/dashboard'));\n\n $this->assertFalse($this->Acl->check($user, '/controllers/invoices/send'));\n // wee add an more specific entry for user foo to also inherit from Role/accounting\n $this->Acl->Aro->addRole(['User/foo' => 'Role/IT, Role/accounting']);\n $this->assertTrue($this->Acl->check($user, '/controllers/invoices/send'));\n }", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "public function isExternalAuth() {\n\t\t$remoteUser = env('REMOTE_USER');\n\t\tif (empty($remoteUser)) {\n\t\t\t$remoteUser = env('REDIRECT_REMOTE_USER');\n\t\t}\n\n\t\t$result = !empty($remoteUser);\n\n\t\treturn $result;\n\t}", "final public function check_alias(&$action) {\n\t\tif (!empty($this->alias[$action]))\n\t\t\t$action = $this->alias[$action];\n\t}", "function subsite_manager_is_superadmin($user_guid = 0){\n static $superadmin_cache;\n\n $result = false;\n\n $user_guid = sanitise_int($user_guid, false);\n\n if(empty($user_guid)){\n $user_guid = elgg_get_logged_in_user_guid();\n }\n\n if(!empty($user_guid)){\n if(!isset($superadmin_cache)){\n $superadmin_cache = array();\n }\n\n if(!isset($superadmin_cache[$user_guid])){\n $superadmin_cache[$user_guid] = false;\n\n $query = \"SELECT value\";\n $query .= \" FROM \" . get_config(\"dbprefix\") . \"private_settings\";\n $query .= \" WHERE name = 'superadmin'\";\n $query .= \" AND entity_guid = \" . $user_guid;\n\n if ($setting = get_data_row($query)) {\n if($setting->value == true){\n $superadmin_cache[$user_guid] = true;\n }\n }\n }\n\n $result = $superadmin_cache[$user_guid];\n }\n\n return $result;\n }", "protected function useUiLocal ()\n {\n return ( null === $this->defaultOptions[ 'ui-local-path' ] ) ? false : true;\n }", "public function getPathAuthRequired()\n {\n }", "function user_get_basedir($username) {\n global $_CONFIG;\n if(user_validate_name($username)) {\n return realpath($_CONFIG['UserBase']) . '/' . $username;\n } else {\n trigger_error(\"user_get_basedir(): Illegal username!\", E_USER_WARNING);\n return false;\n }\n}", "public function isAlias($name)\n {\n return isset($this->aliases[$name]);\n }", "public static function adminsAreAlreadySet()\n {\n return Cache::rememberForever('config:has-admin', function () {\n return User::where(\"admin\", true)->exists();\n });\n }", "public function hasAlias(string $alias): bool\n {\n return isset($this->aliases[$alias]);\n }", "final private static function _is_package_alias($package_name) {\n\t\t\n\t\t# the first character in an alias is a colon\n\t\tif(substr($package_name, 0, 1) !== ':') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function userImageUriIsDefault($image_uri){\n return ($image_uri === 'default/img/default_img_male.jpg' || $image_uri === 'default/img/default_img_female.jpg');\n }", "public function isAlias( $name );", "static function is_valid_login_location(){\n\t\tif (in_array($_SERVER[\"REMOTE_ADDR\"], Config::$VALID_LOCATIONS) || in_array( gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]), Config::$VALID_LOCATIONS) )\n\t\t\treturn true;\n\t\telse {\n\t\t\tif (Config::IS_TEST_ENV) {\r\n\t\t\t\treturn true;\t\t\r\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public function addServerAlias(string $alias): bool {}", "public function getAlias($default = \"Sans nom\")\t{\n\t\tif ( ! empty($this->alias)) {\n\t\t\treturn $this->alias;\n\t\t}\n\t\treturn $default;\n\t}", "public function isAliasPMEnabled()\n {\n return Mage::getModel('ops/config')->isAliasManagerEnabled($this->getMethodCode());\n }", "public function isAliasPMEnabled()\n {\n return Mage::getModel('ops/config')->isAliasManagerEnabled($this->getMethodCode());\n }", "function is_user_admin()\n {\n }", "function userCanSetDbName(){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function email_have_asociated_folders($userid) {\n\tglobal $CFG, $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\tif ( $CFG->email_marriedfolders2courses ) {\n\t\tif ( $preferences = get_record('email_preference', 'userid', $userid) ) {\n\t\t\tif ($preferences->marriedfolders2courses) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "public function registerAliases()\n\t{\n\n\t}", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }", "protected function useLocalPath ()\n {\n return ( null === $this->defaultOptions[ 'local-path' ] ) ? false : true;\n }", "public function getIsAbsolutePath() {}", "public function exists($alias);", "public function checkDefaultValues() {\n return is_file($this->STR_PROJECT_CONFIG_FILE);\n }", "public function defaultShouldUseParentPaths(): bool\n {\n return false;\n }", "public function testAutoDetectLocation()\n {\n $values = [\"on\", \"\", 1, true];\n\n foreach ($values as $value) {\n $_SERVER['HTTPS'] = $value;\n $this->assertMatchesRegularExpression(\n '/src=\"https:\\/\\/secure.gravatar.com\\/avatar\\/[a-z0-9]{32}.+\"/',\n $this->_object->gravatar(\"example@example.com\")->__toString()\n );\n }\n }", "public function isDefault()\n\t{\n\t\treturn \\IPS\\Dispatcher::i()->application->directory == 'core' and \\IPS\\Dispatcher::i()->module->key == 'members' and \\IPS\\Dispatcher::i()->controller != 'groups';\n\t}", "function GetUserAlias()\n {\n $SysUser = new SysUser();\n $this->email = $SysUser->GetUserName($this->login);\n if ( empty($this->email) ) $this->email = $this->login;\n return $this->email;\n }", "public function hasAdminDn()\n {\n return $this->admin_dn !== null;\n }", "public function getDefaultFolder() {}", "public function getDefaultFolder() {}", "private function get_aliases_data( $config, $alias, $create_config_file = false ) {\n\n\t\t$global_config_path = WP_CLI::get_runner()->get_global_config_path( $create_config_file );\n\t\t$global_aliases = Spyc::YAMLLoad( $global_config_path );\n\n\t\t$project_config_path = WP_CLI::get_runner()->get_project_config_path();\n\t\t$project_aliases = Spyc::YAMLLoad( $project_config_path );\n\n\t\tif ( 'global' === $config ) {\n\t\t\t$config_path = $global_config_path;\n\t\t\t$aliases = $global_aliases;\n\t\t} elseif ( 'project' === $config ) {\n\t\t\t$config_path = $project_config_path;\n\t\t\t$aliases = $project_aliases;\n\t\t} else {\n\n\t\t\t$is_global_alias = array_key_exists( $alias, $global_aliases );\n\t\t\t$is_project_alias = array_key_exists( $alias, $project_aliases );\n\n\t\t\tif ( $is_global_alias && $is_project_alias ) {\n\t\t\t\tWP_CLI::error( \"Key '{$alias}' found in more than one path. Please pass --config param.\" );\n\t\t\t} elseif ( $is_global_alias ) {\n\t\t\t\t$config_path = $global_config_path;\n\t\t\t\t$aliases = $global_aliases;\n\t\t\t} else {\n\t\t\t\t$config_path = $project_config_path;\n\t\t\t\t$aliases = $project_aliases;\n\t\t\t}\n\t\t}\n\n\t\treturn [ $config_path, $aliases ];\n\n\t}", "public function isAbsolutePath()\n {\n if ($this->exists === false) {\n $this->is_absolute_path = null;\n return;\n }\n\n if (substr($this->path, 0, 1) == '/') {\n $this->is_absolute_path = true;\n $this->absolute_path = $this->path;\n } else {\n $this->is_absolute_path = false;\n }\n\n return;\n }", "public function aliasPath(): string\n {\n return $this->_aliasPath;\n }", "public static function setPathOfAlias($alias,$path) {\n if(empty($path)) {\n unset(self::$_aliases[$alias]);\n } else {\n self::$_aliases[$alias] = rtrim($path,'\\\\/');\n }\n }", "public function aliases();", "protected function action_getUserMainDir() {}" ]
[ "0.7872407", "0.74766606", "0.7344577", "0.6463527", "0.64553535", "0.62074995", "0.6113392", "0.5826104", "0.5824663", "0.5708007", "0.5652674", "0.56374097", "0.55467284", "0.5519671", "0.5514894", "0.5464759", "0.54275227", "0.5419248", "0.5414231", "0.5403456", "0.5384767", "0.53738725", "0.53525156", "0.5351927", "0.5342703", "0.5310802", "0.52761036", "0.5266271", "0.5249925", "0.52477115", "0.52396923", "0.5211708", "0.52025425", "0.51729673", "0.5157956", "0.51529115", "0.5152168", "0.51473165", "0.5132891", "0.51304805", "0.51012146", "0.50963426", "0.50867337", "0.50722307", "0.50501597", "0.5005521", "0.4998575", "0.49923256", "0.49861678", "0.49698338", "0.496015", "0.49531764", "0.4942972", "0.4925343", "0.4924981", "0.49224454", "0.49189222", "0.49156037", "0.4878896", "0.4877788", "0.48740378", "0.48674178", "0.48650983", "0.4857992", "0.4846284", "0.48460048", "0.48399204", "0.4839889", "0.48320532", "0.48287764", "0.48254526", "0.48175192", "0.48153612", "0.48139852", "0.4805657", "0.48010692", "0.4797302", "0.4797302", "0.47916612", "0.47865617", "0.4784041", "0.47828937", "0.47791347", "0.4775956", "0.4773555", "0.47735134", "0.4770349", "0.4766801", "0.47630557", "0.47628507", "0.47599036", "0.4756744", "0.47560748", "0.47553656", "0.4747188", "0.4743743", "0.4742518", "0.4737681", "0.47374105", "0.47356433" ]
0.8370778
0
Get default user aliases path
Получить путь к алиасам пользователя по умолчанию
public function getDefaultUserAliasesPath() { return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "public function hasDefaultUserAliasesPath()\n {\n return !empty($this->getDefaultUserAliasesPath())?:false;\n }", "public function aliasPath(): string\n {\n return $this->_aliasPath;\n }", "public function registerDefaultAliases()\n\t{\n\t\tparent::registerDefaultAliases();\n\t\t\\Yii::$aliases['@www'] = dirname($_SERVER['SCRIPT_FILENAME']);\n\t}", "public function getRealUrlAliasBase(): string;", "public function getAlias()\n {\n if (isset($this->raw->alias)) {\n return $this->raw->alias;\n }\n\n return 'default.phar';\n }", "public function pathAliasCallback() {\n $args = func_get_args();\n switch($args[0]) {\n case '/content/first-node':\n return '/node/1';\n case '/content/first-node-test':\n return '/node/1/test';\n case '/malicious-path':\n return '/admin';\n case '':\n return '<front>';\n default:\n return $args[0];\n }\n }", "public function hasUserAliasesPath()\n {\n return !empty($this->userAliasesPath)?:false;\n }", "public function getCurrentAlias()\n {\n return rtrim(\\Yii::$app->request->get('nodes'), '/') ?: $this->defaultAlias;\n }", "protected function makeDefaultTemplatePath()\n {\n $urlRole = \\Bs\\Uri::create()->getRoleType($this->getConfig()->getAvailableUserRoleTypes());\n if (!$urlRole) $urlRole = 'public';\n return $this->getConfig()->getSitePath() . $this->getConfig()->get('template.'.$urlRole);\n }", "public function getAlias($default = \"Sans nom\")\t{\n\t\tif ( ! empty($this->alias)) {\n\t\t\treturn $this->alias;\n\t\t}\n\t\treturn $default;\n\t}", "function GetUserAlias()\n {\n $SysUser = new SysUser();\n $this->email = $SysUser->GetUserName($this->login);\n if ( empty($this->email) ) $this->email = $this->login;\n return $this->email;\n }", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias(): string;", "public static function getAlias(): string\n {\n return static::$alias;\n }", "public function fullAlias()\n {\n if ($this->strFullAlias) {\n return $this->strFullAlias;\n } else {\n assert(!empty($this->strAlias)); // Alias should always be set by default\n return $this->strAlias;\n }\n }", "function getAlias();", "public function aliases();", "public function aliases($options = ['print' => false, 'location' => null,])\n {\n $aliases = $this->session()->getUser()->getAliases();\n if (isset($options['print']) && $options['print']) {\n return $aliases;\n }\n if (is_null($location = $options['location'])) {\n $location = '~/.drush/pantheon.aliases.drushrc.php';\n }\n $config = $this->getConfig();\n $location = $config->fixDirectorySeparators(str_replace('~', $config->get('user_home'), $location));\n $config->ensureDirExists(dirname($location));\n if (file_put_contents($location, $aliases) !== false) {\n $this->log()->notice('Aliases file written to {location}.', ['location' => $location,]);\n }\n }", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}", "public function get_current_path() {\n $current_path = \\Drupal::service('path.current')->getPath();\n $result = \\Drupal::service('path_alias.manager')->getAliasByPath($current_path);\n\n return $result;\n }", "public function getRegistryAlias(): string;", "public function getAlias() : string;", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }", "function user_admin_url($path = '', $scheme = 'admin')\n {\n }", "public function getAlias() : string {\n\t\treturn $this->alias;\n\t}", "function getAlias()\r\n\t{\r\n\t\treturn( $this->alias );\r\n\t}", "protected static function getDefaultKey()\n {\n $aliases = self::getAliases();\n return reset($aliases);\n }", "public function getPathAlias()\n {\n if (! isset($this->pathAlias)) {\n $this->pathAlias = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getPathAliasQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->pathAlias;\n }", "public function getAlias()\n\t{\n\t\treturn $this->alias;\n\t}", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "public function getAlias()\n {\n return $this->alias;\n }", "function cot_pfs_relpath($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($userid.'/');\n\t}\n\telse\n\t{\n\t\treturn('');\n\t}\n}", "public function redirectPath()\n {\n $redirect = app('user.logic')->getUserInfo('admin') ? $this->redirectTo : $this->redirectToHome;\n return $redirect;\n }", "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "public function getAlias() {\n return $this->alias;\n }", "public function getAlias() {\n return $this->alias;\n }", "public function getAliases();", "protected function action_getUserMainDir() {}", "public function getAlias(): Str\n {\n return $this->alias;\n }", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "public function getAliases()\n {\n return [];\n }", "public function getAliases()\n {\n return [];\n }", "function getDefaultFolder() ;", "public function getAlias(): string\n {\n if ($this->_alias === null) {\n $this->_alias = $this->getName();\n }\n\n return $this->_alias;\n }", "public static function getMemberAliasList () {\n\t\t$Aliastext = \"(Aliases: \" . implode(', ',array_keys(self::$user_aliases)) . \")\";\n\t\treturn $Aliastext;\n\t}", "public function listCurrentDir() {\n $connConf = $this->getConnectionModel();\n $markAsAlias = false;\n $basedn = $this->getCwd();\n if(preg_match('/ALIAS=Alias of:/',$this->getCwd())) {\n $basedn = str_replace(\"ALIAS=Alias of:\",\"\",$this->getCwd());\n /**\n * This is necessary to avoid id problems in the web interface.\n * Aliased elements start with a \"*\", an 4.digit id and again, a \"*\"\n *\n */\n $result = $this->listDN($basedn);\n foreach($result as $key=>&$vals) {\n if(!is_int($key))\n continue;\n $vals[\"dn\"] = \"*\".rand(1000,9999).\"*\".$vals[\"dn\"];\n }\n return $result;\n } else return $this->listDN($basedn);\n }", "private function get_userDefaultRoute()\n\t{\n\t\treturn $this->m_userDefaultRoute;\n\t}", "public function getDefaultKeyPath()\n\t{\n\t\treturn $this->getUserHomeFolder().'/.ssh/id_rsa';\n\t}", "public function alias()\n\t{\n\t\treturn array(\n\t\t\t'action_admin_theme_get_menus' => 'action_admin_theme_post_menus',\n\t\t\t'action_admin_theme_get_menu_iframe' => 'action_admin_theme_post_menu_iframe',\n\t\t);\n\t}", "public function getDefaultFolder() {}", "public function getDefaultFolder() {}", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "function getAliasOrName()\r\n\t{\r\n\t\tif ( !$this->alias ) {\r\n\t\t\treturn $this->name;\r\n\t\t}\r\n\t\treturn $this->alias;\r\n\t}", "public function path()\n {\n return $this->user->path() . $this->slug;\n }", "private function getAlias($site_name) {\n/*\n $user = Session::getUser();\n $alias_string = $user->getAliases();\n eval(str_replace('<?php', '', $alias_string));\n $formatted_aliases = substr($alias_string, 0, -1);\n*/\n $sites_object = new Sites();\n $site = $sites_object->get($site_name);\n\n $environments = $site->environments->all();\n foreach ($environments as $environment) {\n $key = $site->get('name') . '.'. $environment->get('id');\n if (isset($aliases[$key])) {\n break;\n }\n try {\n $formatted_alias = \" \\$aliases['$key'] = \";\n $formatted_alias .= $this->constructAlias($environment);\n } catch (TerminusException $e) {\n continue;\n }\n }\n\n return $formatted_alias;\n }", "function simple_example() {\n \\Drupal::service('path_alias.manager');\n}", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "private function getProfileAlias(int $formId): string\n\t{\n\t\t$settings = $this->loadFormSettings($formId);\n\n\t\treturn $settings->get('profileAlias', '');\n\t}", "public function getDefaultDirectory(): string|null;", "protected function _getDefaultTargetPath(): string\n {\n return dirname(APP) . DS . 'templates' . DS . 'layout' . DS . 'TwitterBootstrap' . DS;\n }", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}", "function qa_path_to_root()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_root_url_relative;\n\treturn $qa_root_url_relative;\n}", "public function createUserAliasesDirectory()\n {\n if(!$this->userAliasesDirectoryExist())\n return $this->createDirectory($this->getUserAliasesPath());\n return true;\n }", "function alias($alias) {\r\n $db = new MySQL();\r\n $sql = \"SELECT * FROM `usuarios_usuarios` WHERE(`alias` = '\" . $alias . \"');\";\r\n $consulta = $db->sql_query($sql);\r\n $fila = $db->sql_fetchrow($consulta);\r\n $db->sql_close();\r\n return($fila['usuario']);\r\n }", "public static function getDefaultViewPath(): string\n {\n return Path::packageCurrent(['resources/views']);\n }", "protected function composeDefaultPath()\n {\n return ['params', $this->id];\n }", "protected function _getDefaultLandingPath()\n {\n return '/';\n }", "public static function getDefaultFolder()\n {\n return apply_filters(\n 'lf_default_views_folder',\n Loc::lolita()->baseDir() . DS . 'app' . DS . 'views' . DS\n );\n }", "public function getAlias()\n {\n return 'test';\n }", "public function getHome()\n {\n return (string) $this->file->get(self::SETTING_HOME);\n }", "protected function initAliases()\n {\n if ($this->aliases === null) {\n $this->aliases = [];\n $configurator = \\WP_CLI::get_configurator();\n foreach ($configurator->get_aliases() as $alias => $config) {\n $this->aliases[$alias] = \\WP_CLI\\Utils\\parse_ssh_url($config['ssh']);\n $this->aliases[$alias] += $config;\n if (!isset($this->aliases[$alias]['port'])) {\n $this->aliases[$alias]['port'] = self::SSH_PORT;\n }\n }\n }\n }", "public function getAliases( )\n {\n return $this->aliases;\n }", "public function getAlias($alias);", "public function alias ()\n {\n return $this->_alias;\n }", "public function getAliases()\n {\n return $this->aliases;\n }", "public function getDefaultThemeDirectory(): string\n {\n return app('config')['view.paths'][0] ?? resource_path('views');\n }", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "protected function getCurrentSectionAlias()\n {\n $url = parse_url(URL::current());\n\n $path = explode('/', $url['path']);\n\n if (isset($path[1]) && ! empty($path[1]))\n {\n return $path[1];\n }\n\n if (isset($path[0]) && ! empty($path[0]))\n {\n return $path[0];\n }\n\n return $path[0];\n }", "public function getDefaultPartialRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultPartialRootPath);\r\n }", "protected function getAdminUrl($path = null) {\n return $this->app->getAdminUrl($path);\n }", "protected function _getDefaultImage()\n {\n $path = $this->_getImageBasePath(false)\n . self::USER_DEFAULT_IMAGE;\n\n return $path;\n }", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "public function profilePicPath()\n {\n \treturn $this->defaultProfilePicPath;\n }", "public function getAdminPath()\n {\n return $this->adminPath;\n }", "function get_dashboard_url($user_id = 0, $path = '', $scheme = 'admin')\n {\n }", "public static function getAliases()\n {\n\n return [\n\n 'createArticle' => 'newarticle'\n ];\n }" ]
[ "0.79473716", "0.6796304", "0.6683898", "0.66278344", "0.6167079", "0.61451906", "0.6133794", "0.6115452", "0.6067055", "0.6021898", "0.6021716", "0.59830713", "0.5976017", "0.5976017", "0.5976017", "0.5976017", "0.5889116", "0.58445925", "0.58261657", "0.58198225", "0.5816708", "0.5812808", "0.5807717", "0.5795038", "0.57767177", "0.5749456", "0.5743564", "0.5717829", "0.57046026", "0.56942433", "0.56909066", "0.5644359", "0.56393427", "0.56062", "0.5586504", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55773103", "0.55522984", "0.55353343", "0.5530666", "0.55294085", "0.55259794", "0.55259794", "0.5483946", "0.54814255", "0.5477198", "0.54767424", "0.5475545", "0.5475545", "0.5474245", "0.54572576", "0.5456108", "0.54477644", "0.54418975", "0.54339975", "0.54232025", "0.5416474", "0.5416109", "0.5403061", "0.53861606", "0.5386023", "0.53646004", "0.5362163", "0.5359762", "0.53563374", "0.5355906", "0.5347012", "0.5338904", "0.533695", "0.53319454", "0.53296906", "0.5329157", "0.5327796", "0.53174275", "0.53129745", "0.53075343", "0.53039014", "0.530322", "0.52990746", "0.5291897", "0.5289613", "0.5287524", "0.5284368", "0.5267238", "0.5265647", "0.5261994", "0.52527565", "0.5252679", "0.5248347", "0.52379054", "0.52354", "0.52333885", "0.5229865" ]
0.8807762
0
Create user aliases directory
Создать директорию для алиасов пользователя
public function createUserAliasesDirectory() { if(!$this->userAliasesDirectoryExist()) return $this->createDirectory($this->getUserAliasesPath()); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function siteAlias($args, $assoc_args) {\n $location = $this->input()->optional(\n [\n 'key' => 'location',\n 'choices' => $assoc_args,\n 'default' => getenv('HOME') . '/.drush/onealias.aliases.drushrc.php',\n ]\n );\n if (is_dir($location)) {\n $message = 'Please provide a full path with filename,';\n $message .= ' e.g. {location}/pantheon.aliases.drushrc.php';\n $this->failure($message, compact('location'));\n }\n\n $file_exists = file_exists($location);\n\n // Create the directory if it doesn't yet exist\n $dirname = dirname($location);\n if (!is_dir($dirname)) {\n mkdir($dirname, 0700, true);\n }\n\n $site_name = $this->input()->siteName(array('args' => $assoc_args));\n\n $content = $this->getAlias($site_name);\n $handle = fopen($location, 'w+');\n fwrite($handle, $content);\n fclose($handle);\n chmod($location, 0700);\n\n $message = 'Pantheon aliases file created';\n if ($file_exists) {\n $message = 'Pantheon aliases file updated';\n }\n $this->log()->info($message);\n\n if (isset($assoc_args['print'])) {\n $aliases = str_replace(array('<?php', '?>'), '', $content);\n $this->output()->outputDump($aliases);\n }\n }", "function __createAroAlias()\n\t{\n\t $aroId = $this->Aro->getLastInsertId();\n\t\t$this->Aro->create();\n\t\t$this->Aro->id = $aroId;\n\t\tif( $this->Aro->saveField('alias', $this->data['User']['username'] ) ){\n\t\t return TRUE;\n\t\t} else {\n\t\t return FALSE;\n\t\t}\n\t}", "public function aliases($options = ['print' => false, 'location' => null,])\n {\n $aliases = $this->session()->getUser()->getAliases();\n if (isset($options['print']) && $options['print']) {\n return $aliases;\n }\n if (is_null($location = $options['location'])) {\n $location = '~/.drush/pantheon.aliases.drushrc.php';\n }\n $config = $this->getConfig();\n $location = $config->fixDirectorySeparators(str_replace('~', $config->get('user_home'), $location));\n $config->ensureDirExists(dirname($location));\n if (file_put_contents($location, $aliases) !== false) {\n $this->log()->notice('Aliases file written to {location}.', ['location' => $location,]);\n }\n }", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "function create_user_dir(){\n\t$safeUserDir=bin2hex(random_bytes(4));\n\t$oldDir=getcwd();\n\tchdir(FS_PATH);\n\tif(mkdir(\"$safeUserDir\")) {\n\tchmod(\"$safeUserDir\",0755); //owner=r,w,x group=r,x other=r,x\n\tchdir($oldDir);\n\treturn \t$safeUserDir;\n\t} else {\n\t\tchdir($oldDir);\n\t\terror_log(\"create_user_dir: Could not create user directory in \".FS_PATH,0);\n\t\treturn false;\n\t}\n}", "protected function createDirectory() {}", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function registerDefaultAliases()\n\t{\n\t\tparent::registerDefaultAliases();\n\t\t\\Yii::$aliases['@www'] = dirname($_SERVER['SCRIPT_FILENAME']);\n\t}", "function alias_make_table() {\n\n\tglobal $config, $g, $aliastable;\n\n\t$aliastable = array();\n\n\tif (is_array($config['aliases']['alias'])) {\n\t\tforeach ($config['aliases']['alias'] as $alias) {\n\t\t\tif ($alias['name'])\n\t\t\t$aliastable[$alias['name']] = $alias['address'];\n\t\t}\n\t}\n}", "public function testPathAliasProcessing() {\n // Add a path alias for the '/admin' system path.\n $values = [\n 'path' => '/admin/structure',\n 'alias' => '/admin-structure-alias',\n 'langcode' => 'und',\n 'status' => 1,\n ];\n\n $database = \\Drupal::database();\n $id = $database->insert('path_alias')\n ->fields($values + ['uuid' => \\Drupal::service('uuid')->generate()])\n ->execute();\n\n $revision_id = $database->insert('path_alias_revision')\n ->fields($values + ['id' => $id, 'revision_default' => 1])\n ->execute();\n\n $database->update('path_alias')\n ->fields(['revision_id' => $revision_id])\n ->condition('id', $id)\n ->execute();\n\n // Increment the schema version.\n \\Drupal::state()->set('update_test_schema_version', 8002);\n $this->runUpdates();\n\n // Check that the alias defined earlier is not used during the update\n // process.\n $this->assertSession()->linkByHrefExists('/admin/structure');\n $this->assertSession()->linkByHrefNotExists('/admin-structure-alias');\n\n $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']);\n $this->drupalLogin($account);\n\n // Go to the status report page and check that the alias is used.\n $this->drupalGet('admin/reports/status');\n $this->assertSession()->linkByHrefNotExists('/admin/structure');\n $this->assertSession()->linkByHrefExists('/admin-structure-alias');\n }", "private function process_aliases( $aliases, $alias, $config_path, $operation = '' ) {\n\t\t// Convert data to YAML string.\n\t\t$yaml_data = Spyc::YAMLDump( $aliases );\n\n\t\t// Add data in config file.\n\t\tif ( file_put_contents( $config_path, $yaml_data ) ) {\n\t\t\tWP_CLI::success( \"$operation '{$alias}' alias.\" );\n\t\t}\n\t}", "public function create()\n {\n $params = request()->all();\n\n request()->validate([\n 'alias' => 'bail|required|unique:aliases,alias|max:14|regex:/^[a-zA-Z0-9\\s]+$/',\n 'creator_alias_id' => 'required|numeric|min:1'\n ], [\n 'alias.unique' => \"The user name {$params['alias']} is already registered to another account.\",\n 'alias.required' => \"Please provide a valid username.\",\n 'alias.regex' => \"Invalid characters detected, please only enter letters and numbers.\"\n ]);\n\n $user = Auth::user();\n\n // We check if the alias creator has not created any alias.\n // We bail an alias child has been created by the alias.\n $alias = Alias::where('id', $params['creator_alias_id'])\n ->where('alias_child_id', '=', 0)->first();\n\n if (empty($alias)) {\n throw ValidationException::withMessages([\n 'alias' => [\"Cannot create user name {$params['alias']}. You have already created a user name\"],\n ]);\n }\n\n // Create the new alias.\n $alias = Alias::create([\n 'alias' => ucwords($params['alias']),\n 'slug' => Str::slug($params['alias'], '_'),\n 'role_id' => 8, // not sure about this.\n 'user_id' => $user->id,\n 'hours' => 0,\n ]);\n\n // Set the alias_child_id of the the creating alias.\n // An alias with more than 24 chat hours can ONLY create 1 alias.\n $creatorAlias = Alias::find($params['creator_alias_id']);\n $creatorAlias->alias_child_id = $alias->id;\n $creatorAlias->save();\n\n return $alias;\n }", "protected function initAliases()\n {\n if ($this->aliases === null) {\n $this->aliases = [];\n $configurator = \\WP_CLI::get_configurator();\n foreach ($configurator->get_aliases() as $alias => $config) {\n $this->aliases[$alias] = \\WP_CLI\\Utils\\parse_ssh_url($config['ssh']);\n $this->aliases[$alias] += $config;\n if (!isset($this->aliases[$alias]['port'])) {\n $this->aliases[$alias]['port'] = self::SSH_PORT;\n }\n }\n }\n }", "public function create_user()\n {\n $root = 0;\n foreach ($this->sysfolders as $path => $data) {\n $dispname = ($this->_PM_['core']['language'] == 'de') ? $data['de'] : $data['en'];\n if ($data['root']) {\n $root = $this->STOR->create_mailbox($dispname, 0, $data['icon'], true, true);\n if (!$root) {\n \t$this->errortext = $this->STOR->get_errors('<br />');\n \treturn false;\n }\n } else {\n $state = $this->STOR->create_folder($dispname, $root, 0, $data['icon'], true, true, $path);\n if (!$state) {\n \t$this->errortext = $this->STOR->get_errors('<br> /');\n \treturn false;\n }\n }\n }\n return true;\n }", "public function aliases();", "public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }", "private function get_aliases_data( $config, $alias, $create_config_file = false ) {\n\n\t\t$global_config_path = WP_CLI::get_runner()->get_global_config_path( $create_config_file );\n\t\t$global_aliases = Spyc::YAMLLoad( $global_config_path );\n\n\t\t$project_config_path = WP_CLI::get_runner()->get_project_config_path();\n\t\t$project_aliases = Spyc::YAMLLoad( $project_config_path );\n\n\t\tif ( 'global' === $config ) {\n\t\t\t$config_path = $global_config_path;\n\t\t\t$aliases = $global_aliases;\n\t\t} elseif ( 'project' === $config ) {\n\t\t\t$config_path = $project_config_path;\n\t\t\t$aliases = $project_aliases;\n\t\t} else {\n\n\t\t\t$is_global_alias = array_key_exists( $alias, $global_aliases );\n\t\t\t$is_project_alias = array_key_exists( $alias, $project_aliases );\n\n\t\t\tif ( $is_global_alias && $is_project_alias ) {\n\t\t\t\tWP_CLI::error( \"Key '{$alias}' found in more than one path. Please pass --config param.\" );\n\t\t\t} elseif ( $is_global_alias ) {\n\t\t\t\t$config_path = $global_config_path;\n\t\t\t\t$aliases = $global_aliases;\n\t\t\t} else {\n\t\t\t\t$config_path = $project_config_path;\n\t\t\t\t$aliases = $project_aliases;\n\t\t\t}\n\t\t}\n\n\t\treturn [ $config_path, $aliases ];\n\n\t}", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}", "function create_account($uname, $pwd) {\n $account_info = \"{$uname}:{$pwd}\\n\";\n add_item_to_file(\"users.txt\", $account_info);\n }", "public function testGetUserAlias()\n {\n $alias = $this->la->getAlias('poa32kc');\n $this->assertEquals('Pouyan Azari', $alias);\n }", "function createExportDirectory()\n\t{\n\t\tif (!@is_dir($this->getExportDirectory()))\n\t\t{\n\t\t\t$usrf_data_dir = ilUtil::getDataDir().\"/usrf_data\";\n\t\t\tilUtil::makeDir($usrf_data_dir);\n\t\t\tif(!is_writable($usrf_data_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Userfolder data directory (\".$usrf_data_dir\n\t\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t\t$export_dir = $usrf_data_dir.\"/export\";\n\t\t\tilUtil::makeDir($export_dir);\n\t\t\tif(!@is_dir($export_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Creation of Userfolder Export Directory failed.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\t\t}\n\t}", "public static function setAlias($alias, $path)\n {\n if (strncmp($alias, '@', 1)) {\n $alias = '@' . $alias;\n }\n $pos = strpos($alias, '/');\n $root = $pos === false ? $alias : substr($alias, 0, $pos);\n if ($path !== null) {\n $path = strncmp($path, '@', 1) ? rtrim($path, '\\\\/') : static::getAlias($path);\n if (!isset(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [$alias => $path];\n }\n } elseif (is_string(static::$aliases[$root])) {\n if ($pos === false) {\n static::$aliases[$root] = $path;\n } else {\n static::$aliases[$root] = [\n $alias => $path,\n $root => static::$aliases[$root],\n ];\n }\n } else {\n static::$aliases[$root][$alias] = $path;\n krsort(static::$aliases[$root]);\n }\n } elseif (isset(static::$aliases[$root])) {\n if (is_array(static::$aliases[$root])) {\n unset(static::$aliases[$root][$alias]);\n } elseif ($pos === false) {\n unset(static::$aliases[$root]);\n }\n }\n }", "protected function createSymlink()\n {\n if (!File::exists(public_path('theme'))) {\n $folder = $this->active()->get('namespace');\n\n if (File::exists(theme_path(\"{$folder}/public\"))) {\n // Delete existing symlink if present\n File::delete(public_path('theme'));\n\n // Create new theme symlink\n File::link(\n theme_path(\"{$folder}/public\"),\n public_path('theme')\n );\n }\n }\n }", "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "public function create_folder_name(){\n // create folder name\n return $this->config['prefix'].$this->user['code'];\n }", "function __autoCreateAlias($parent_id, $name){\n\t\t// generate alias from title\n\t\t$alias_from_title = $this->__convert2Alias($name);\n\t\t$alias = $alias_from_title;\n\t\t// create alias\n\t\t$number = 1;\n\t\twhile ($this->__isAliasExisted($parent_id, $alias)) {\n\t\t\t$alias = $alias_from_title . \"-\" .$number;\n\t\t\t$number++;\n\t\t}\n /*$rest = substr($alias, -1);\n if($rest == ')'){\n $alias = substr($alias, 0, -3);\n }*/\n\t\treturn $alias;\n\t}", "public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}", "protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "private function generateSymlinks()\n {\n $fs = new Filesystem();\n $uploadPath = $this->getContainer()->getParameter('contao.upload_path');\n\n // Remove the base folders in the document root\n $fs->remove($this->rootDir . '/web/' . $uploadPath);\n $fs->remove($this->rootDir . '/web/system/modules');\n $fs->remove($this->rootDir . '/web/vendor');\n\n $this->symlinkFiles($uploadPath);\n $this->symlinkModules();\n $this->symlinkThemes();\n\n // Symlink the assets and themes directory\n $this->symlink('assets', 'web/assets');\n $this->symlink('system/themes', 'web/system/themes');\n $this->symlink('app/logs', 'system/logs');\n }", "static function add_aliases(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::aliases, [\r\n\t\t\t'label' => 'Aliases',\r\n\t\t\t'type' => 'repeater',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '50',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'collapsed' => '',\r\n\t\t\t'min' => '',\r\n\t\t\t'max' => '',\r\n\t\t\t'layout' => 'row',\r\n\t\t\t'button_label' => 'Add alias'\r\n\t\t]);\r\n\t}", "public function createAlias($distinct_id, $alias) {\n $this->_events->createAlias($distinct_id, $alias);\n }", "function simple_example() {\n \\Drupal::service('path_alias.manager');\n}", "protected function createWriteAlias()\n {\n $configurator = $this->getIndexConfigurator();\n\n if (!in_array(Migratable::class, class_uses_recursive($configurator))) {\n return;\n }\n\n $payload = (new IndexPayload($configurator))\n ->set('name', $configurator->getWriteAlias())\n ->get();\n\n ElasticClient::indices()->putAlias($payload);\n\n $this->info(sprintf(\n 'The %s alias for the %s index was created!',\n $configurator->getWriteAlias(),\n $configurator->getName()\n ));\n }", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "protected function createRealTestdir() {}", "protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}", "function createAlias($dstdomain,$srcdomain){\n\n $res = $res = $this->client->request('PUT',$this->path.'/'.$dstdomain.'/aliases/'.$srcdomain,[]);\n $this->checkResponse($res,array(204, 400, 404));\n return $res;\n }", "abstract protected function formatAliases(array $aliases);", "function set_aliases($ary){\n \t$this->ary_alias = $ary;\n \t\tif($this->bolDebug == 1){echo \"FUNCTION set_aliases()<br>&nbsp; &nbsp; \\$this->ary_aliases=\"; print_r($this->ary_alias); echo $this->strDebugNewLine;}\n }", "protected function createFolder($alias, $mode = 0775)\n {\n FileHelper::createDirectory(Yii::getAlias($alias), $mode);\n }", "function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }", "public function addAliases($aliases)\n\t{\n\t\t// This could be done more quickly if I wrong my own function for array_unique, but there are so few aliases generally, I don't think it matters\n\t\t$this->setAlias(array_unique(array_merge($this->getAlias(), $aliases)));\n\t}", "public function registerAliases()\n\t{\n\n\t}", "function newsItem_CreateDirektori( \n\t \t$tanggalhariini\n\t){\n \t\t$direktoribuat = \"filemodul/news/\" . \"file_item/\" . $tanggalhariini . \"/\";\n\t\t\t mkdir( $direktoribuat,'0777',true); \n\t\t\t chmod( $direktoribuat, 0777);\n\t\treturn $direktoribuat;\n\t}", "public function testAroAliases()\n {\n $this->Acl->Aro->map = [\n 'User' => 'User/username',\n 'Role' => 'User/group_id',\n ];\n\n $this->Acl->Aro->aliases = [\n 'Role/1' => 'Role/admin',\n 'Role/24' => 'Role/accounting',\n ];\n\n $user = [\n 'User' => [\n 'username' => 'unknown_user',\n 'group_id' => '1',\n ],\n ];\n // group/1\n $this->assertSame('Role/admin', $this->Acl->Aro->resolve($user));\n // group/24\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('Role/24'));\n $this->assertSame('Role/accounting', $this->Acl->Aro->resolve('24'));\n\n // check department\n $user = [\n 'User' => [\n 'username' => 'foo',\n 'group_id' => '25',\n ],\n ];\n\n $this->Acl->Aro->addRole(['Role/IT' => null]);\n $this->Acl->Aro->addAlias(['Role/25' => 'Role/IT']);\n $this->Acl->allow('Role/IT', '/rules/debugging/*');\n\n $this->assertEquals([['Role/IT']], $this->Acl->Aro->roles($user));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload'));\n $this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries'));\n // Role/default is allowed users dashboard, but not Role/IT\n $this->assertFalse($this->Acl->check($user, '/controllers/users/dashboard'));\n\n $this->assertFalse($this->Acl->check($user, '/controllers/invoices/send'));\n // wee add an more specific entry for user foo to also inherit from Role/accounting\n $this->Acl->Aro->addRole(['User/foo' => 'Role/IT, Role/accounting']);\n $this->assertTrue($this->Acl->check($user, '/controllers/invoices/send'));\n }", "function setAlias($aliasKey, $aliasFullPath)\r\n {\r\n }", "protected function setupUsers() {\n $this->translator = $this->drupalCreateUser($this->getTranslatorPermissions(), 'translator');\n $this->editor = $this->drupalCreateUser($this->getEditorPermissions(), 'editor');\n $this->administrator = $this->drupalCreateUser($this->getAdministratorPermissions(), 'administrator');\n $this->drupalLogin($this->translator);\n }", "public static function getMemberAliasList () {\n\t\t$Aliastext = \"(Aliases: \" . implode(', ',array_keys(self::$user_aliases)) . \")\";\n\t\treturn $Aliastext;\n\t}", "function create_user($user_accounts_file, $uname, $email, $password)\r\n{\r\n\tif(false === file_exists($user_accounts_file))\r\n\t{\r\n\t\ttrigger_error(\r\n\t\t\tsprintf(\r\n\t\t\t\t'The $user_accounts_file does not exist at the specified location: %s ',\r\n\t\t\t\t$user_accounts_file\r\n\t\t\t),\r\n\t\t\tE_USER_ERROR\r\n\t\t);\r\n\t\treturn false;\r\n\t}\r\n\treturn (bool)file_put_contents(\r\n\t\t$user_accounts_file,\r\n\t\tsprintf(\r\n\t\t\t\"%s|%s|%s\\r\\n\",\r\n\t\t\t$email,\r\n\t\t\t$uname,\r\n\t\t\t$password\r\n\t\t),\r\n\t\tFILE_APPEND\r\n\t);\r\n}", "protected function _createDirs()\n {\n $dir = $this->_class_dir;\n \n if (! file_exists($dir)) {\n $this->_outln('Creating app directory.');\n mkdir($dir, 0755, true);\n } else {\n $this->_outln('App directory exists.');\n }\n \n $list = array('Layout', 'Locale', 'Public', 'View');\n \n foreach ($list as $sub) {\n if (! file_exists(\"$dir/$sub\")) {\n $this->_outln(\"Creating app $sub directory.\");\n mkdir(\"$dir/$sub\", 0755, true);\n } else {\n $this->_outln(\"App $sub directory exists.\");\n }\n }\n }", "public static function getAliases()\n {\n\n return [\n\n 'createArticle' => 'newarticle'\n ];\n }", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "protected function registerContainerAliases()\n {\n parent::registerContainerAliases();\n\n $this->aliases = array_merge(\n $this->aliases,\n [\n // Add additional aliases here\n ]\n );\n }", "public function setUserAliasesPath($path)\n {\n if(!$this->isUserAliasesPathValid($path))\n throw new InvalidArgumentException(sprintf('User aliases path: \"%s\" is invalid.',$path));\n $this->userAliasesPath=$path;\n }", "public function writeUsers()\n {\n \t// delete old keys\n \texec('rm ' . $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR . self::GITOLITE_KEY_DIR . '*.pub');\n \t\n foreach ($this->getUsers() as $user) {\n $this->writeFile(\n $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR .\n self::GITOLITE_KEY_DIR .\n $user->renderKeyFileName(),\n $user->getFirstKey()\n );\n }\n }", "public function transformUsers() {\n $saUsers = $this->kalturaUser->getAll();\n foreach ($saUsers as $key => $saUser){\n /**\n * @var $saUser KalturaUser\n */\n $dwUser = new DwUser();\n $dwUser->setId(\n $this->anonymize->anonymizeUser($saUser->getKalturaUserId())\n );\n $dwUser->setType(\n $this->typeOfUser($saUser->getKalturaUserId())\n );\n $dwUser->setCreatedAt($saUser->created_at);\n $dwUser->setUpdatedAt($saUser->updated_at);\n try{\n $dwUser->save();\n } catch (Exception $e) {\n var_dump($e->getMessage());\n die;\n }\n };\n }", "function addAlias()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $db,$user;\r\n\t// --------- CHECK ---------\r\n\tif ( !GET_INC('uid') )\r\n\t{\r\n\t\techo '请先登录';\r\n\t\treturn;\r\n\t}\r\n\t// --------- CONVERT TO INT ---------\r\n\t$id = intval(GET_INC('id'));\r\n\t$name = GET_INC('name');\r\n\t$dire = GET_INC('direction');\r\n\t$uid = intval(GET_INC('uid'));\r\n\t// --------- INSERT ---------\r\n\t$db->connDB();\r\n\t$db->query(\"INSERT INTO bus_sname VALUES ({$id},'{$name}',0,'{$dire}');\");\r\n\t$db->closeDB();\r\n\t// --------- ADD CREDIT ---------\r\n\t$user->add_credit('alias',1,$uid);\r\n}", "protected function createDirectories()\n {\n if (! is_dir(app_path('Http/Controllers/Teamwork'))) {\n mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);\n }\n if (! is_dir(app_path('Listeners/Teamwork'))) {\n mkdir(app_path('Listeners/Teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork'))) {\n mkdir(base_path('resources/views/teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/emails'))) {\n mkdir(base_path('resources/views/teamwork/emails'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/members'))) {\n mkdir(base_path('resources/views/teamwork/members'), 0755, true);\n }\n }", "private function createUserProviders($config) {}", "protected function registerAliases()\n {\n $loader = AliasLoader::getInstance();\n foreach ($this->aliases as $alias => $class) {\n $loader->alias($alias, $class);\n }\n }", "public function createAppDirectory() {\n $dir = app_path() . '/EasyApi';\n if (!file_exists($dir)) {\n mkdir($dir);\n }\n }", "function CreatePhotoAlbumDirectory($album_id){\r\n\t\t$showamerica_user_id=$this->session->userdata('showamerica_user_id');\r\n\t\t$user_home_dir=sprintf(USER_UPLOAD_HOME_PATH,$showamerica_user_id);\r\n\t\tif(!is_dir($user_home_dir)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($user_home_dir,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t//its album path created with user id\r\n\t\t$album_path=sprintf(USER_UPLOAD_PATH_ALBUMS,$showamerica_user_id);\r\n\t\tif(!is_dir($album_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tthats create album folder with user id\r\n\t\t$album_path=sprintf(USER_UPLOAD_PATH_ALBUMS.'/'.$album_id.'/',$showamerica_user_id);\r\n\t\tif(!is_dir($album_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t$album_thumbnail_path=$album_path.'/thumbnails/';\r\n\t\tif(!is_dir($album_thumbnail_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_thumbnail_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn $options=array('upload_dir'=>$album_path,'upload_url'=>base_url().$album_path,'accept_file_types' => '/^.*\\.(jpg|jpeg|png|gif)$/i',\r\n\t\t\t\t\t\t'image_versions'=>array(\r\n\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>array('upload_dir'=>$album_thumbnail_path,'upload_url'=>base_url().$album_thumbnail_path)) \t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t );\r\n\t}", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "public function createAllUsers()\n {\n $filter = '(&(&(ObjectClass=user))(samaccountname=*))';\n $attributes = ['samaccountname', 'dn', 'memberof', 'cn'];\n $result = $this->ldap->searchEntries($filter, $this->ldap_baseDn_users, Ldap::SEARCH_SCOPE_SUB, $attributes);\n\n foreach ($result as $item) {\n if (array_key_exists(\"memberof\", $item)) {\n if ($this->hasValidDepartment($item[\"memberof\"])) {\n // $item is wrapped in an array because $this->createUser unwraps single queries\n // (Which is how LDAP queries are returned by default).\n $this->createUser($item['cn'][0], array($item));\n }\n }\n }\n }", "public function buildNamespaceOnShortUrl($directory) {\n umask(0);\n $this->directory = \"$directory/usr/$this->shortUrl/\";\n\n // Create dir\n if (!file_exists($this->directory)) {\n if (!mkdir($this->directory, 0777, TRUE)) {\n return FALSE;\n }\n }\n\n return $this->directory;\n }", "public function set_user_alias($real, $alias) \n\t{\n\t\treturn $this->vpopmail_readline(sprintf(\"N %s '%s'\", $real, $alias));\n\t}", "protected function allowBeUser($hash) {\n\t\t$workingDirectory = preg_replace('#/+$#', '', $this->extensionConfiguration['workingDirectory']) . '/be/';\n\t\t\n\t\tif (!preg_match('#^/#', $workingDirectory)) {\n\t\t\t$workingDirectory = PATH_site . $workingDirectory;\n\t\t}\n\t\t\n\t\tif (!is_dir($workingDirectory)) {\n\t\t\t@mkdir($workingDirectory, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']), true);\n\t\t}\n\t\t\n\t\ttouch($workingDirectory . $hash);\n\t}", "protected function action_getUserMainDir() {}", "public function addToHosts()\n {\n $folders = ['backup', 'extract', 'zetsoft', 'zoftapp'];\n $currentdir = getcwd();\n chdir('C:/Windows/System32/drivers/etc/');\n $file = 'hosts';\n $lines = file($file);\n chmod($file, 0777);\n\n $content = \"\\n127.0.0.1\\t\\t$this->newName.uz\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->newName.uz\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n\n if ($this->domain) {\n $content = \"\\n127.0.0.1\\t\\t$this->domain\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->domain\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n }\n\n foreach ($folders as $folder) {\n $folder = $folder === \"zoftapp\" ? \"zoft\" : $folder;\n $content = \"\\n127.0.0.1\\t\\t$this->newName.$folder.uz\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->newName.$folder.uz\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n }\n\n chdir(\"$currentdir\");\n }", "protected function setupClassAliases()\n {\n $aliases = [\n 'admin.router' => \\Encore\\Admin\\Routing\\Router::class,\n ];\n\n foreach ($aliases as $key => $alias) {\n $this->app->alias($key, $alias);\n }\n }", "static function add_alias(): void {\r\n\t\tself::add_acf_inner_field(self::aliases, self::alias, [\r\n\t\t\t'label' => 'Alias',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '100',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "public static function getAliases()\n {\n\n return [\n\n 'createComment' => 'newcomment'\n\n ];\n\n\n }", "protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "function AdminUsers_install()\n\t{\n\t}", "protected function migrateAliasFiles(Drush $drush)\n {\n $newDrushDir = $drush->getHomeDir() . '/.drush/site-aliases';\n $oldFilenames = $drush->getLegacyAliasFiles();\n if (empty($oldFilenames)) {\n return;\n }\n\n /** @var \\Platformsh\\Cli\\Service\\QuestionHelper $questionHelper */\n $questionHelper = $this->getService('question_helper');\n $newDrushDirRelative = str_replace($drush->getHomeDir() . '/', '~/', $newDrushDir);\n $confirmText = \"Do you want to move your global Drush alias files from <comment>~/.drush</comment> to <comment>$newDrushDirRelative</comment>?\";\n if (!$questionHelper->confirm($confirmText)) {\n return;\n }\n\n if (!file_exists($newDrushDir) && !mkdir($newDrushDir, 0755, true)) {\n $this->stdErr->writeln(sprintf('Failed to create directory: <error>%s</error>', $newDrushDir));\n $this->stdErr->writeln('The alias files have not been moved.');\n return;\n }\n\n $success = true;\n foreach ($oldFilenames as $oldFilename) {\n $newFilename = $newDrushDir . '/' . basename($oldFilename);\n if (file_exists($newFilename)) {\n $this->stdErr->writeln(\"Failed to move file <error>$oldFilename</error>, because the destination file already exists.\");\n $success = false;\n } elseif (!rename($oldFilename, $newFilename)) {\n $this->stdErr->writeln(\"Failed to move file <error>$oldFilename</error> to <error>$newFilename</error>\");\n $success = false;\n }\n }\n\n if ($success) {\n $this->stdErr->writeln(sprintf('Global Drush alias files have been successfully moved to <info>%s</info>.', $newDrushDirRelative));\n }\n }", "protected function createSubDirectories()\n {\n // Form the full path with sub dirs for the new command\n // e.g. \"my-project/commands/my/new/Cmd.php\"\n $this->command_dir_path = $this->console->getConfig()->getBlacksmithCommandsPath() . DIRECTORY_SEPARATOR . $this->arg->getSubDirPath();\n\n if (!file_exists($this->command_dir_path)) {\n mkdir($this->command_dir_path, 0755, true);\n }\n }", "function pptConverterDirectoriesCreate($tempPath, $tempPathNewFiles, $fileName, $perms)\n{\n if (!is_dir($tempPath)) {\n mkdir($tempPath, $perms, true);\n }\n if (!is_dir($tempPathNewFiles)) {\n mkdir($tempPathNewFiles, $perms, true);\n }\n if (!is_dir($tempPathNewFiles . $fileName)) {\n mkdir($tempPathNewFiles . $fileName, $perms, true);\n }\n}", "protected function initAdminDirectory()\n {\n if (is_dir($this->installPath())) {\n $this->line('<error>' . $this->installPath() . ' directory already exists !</error> ');\n\n return;\n }\n\n $this->makeDir($this->installPath());\n\n $this->makeDir($this->installPath('Controllers'));\n\n $this->createRoutesFile();\n\n $this->createBootstrapFile();\n\n $this->createControllers();\n\n $this->line('<info>Installing huztw-admin!</info>');\n }", "public function registerAliases() : void\n {\n // AliasLoader::getInstance()->alias('Module', \\Nwidart\\Modules\\Facades\\Module::class);\n }", "function makeDir($UUID, $SUBDIR){\n #make a hash of the UUID\n $hash = md5($UUID);\n #specify the path to the directory to be made\n $dir = \"./\" . $SUBDIR . \"/\" . substr($hash,0,2) . \"/$hash\";\n # a if it already exits, return\n if(is_dir($dir)) { return $dir; }\n #otherwise, attempt to make it-\n if(!mkdir($dir,0777,true)){\n echo(\"Failed to create '$dir'. Function makeDir\\n\");\n return false;\n }\n else\n return $dir;\n}", "function addLDAPUser($user_username, $user_password, $user_email, $user_namelast, $user_namefirst,$app_auto_user_activate){\n\t\t$this->db->sql('select * from users where username=:username limit 1');\n\t\t$this->db->addParam(\":username\",$user_username);\n\t\t$this->user_result = $this->db->execute();\n\t\t\n\t\t//if the user name doesn't exist add it and mark it as LDAP\n\t\tif( $this->db->getResultCount() == 0 ){\n\t\t\t$user_password = MD5($user_password);\n\t\t\t$this->db->sql('insert into user_audit_login (username, password, email, name_last, name_first, is_activated, is_ldap )values(:username, :password, :email, :name_last, :name_first, :is_activated, :is_ldap)');\n\t\t\t$this->db->addParam(\":username\",$user_username);\n\t\t\t$this->db->addParam(\":password\",$user_password);\n\t\t\t$this->db->addParam(\":email\",$user_email );\n\t\t\t$this->db->addParam(\":name_last\",$user_namelast);\n\t\t\t$this->db->addParam(\":name_first\",$user_namefirst);\n\t\t\t$this->db->addParam(\":is_activated\",$app_auto_user_activate);\n\t\t\t$this->db->addParam(\":is_ldap\",1);\n\t\t\t$this->db->execute();\n\t\t\t\n\t\t\t/* \n\t\t\t\tToDO:\n\t\t\t\tAdd roles\n\t\t\t\tAdd enterprises\n\t\t\t\t\n\t\t\t\t$CONFIG['model_LDAP_user_activate_roles']\t= array(\"guest\");\n\t\t\t\t$CONFIG['model_LDAP_user_activate_ent']\t\t= array(\"1\");\n\t\t\t*/\n\t\t\t\n\t\t}\n\t}", "function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "private function putAlias($str) {\n // i.e.: @Widgets/Foo -> app/Frontend/Widgets/Foo\n // Allow custom resolvers for specific lookups\n $path = $this->canonicalizePath($str);\n $pathParts = explode(\"/\", $path);\n foreach($pathParts as $i=>$part) {\n if(substr($part,0,1) == \"@\") {\n // A-hah! A wild alias was been encountered.\n $alias = substr($part, 1);\n if(isset($this->aliases[$alias])) {\n $pathParts[$i] = $this->aliases[$alias];\n } else {\n foreach($this->resolver as $cb) {\n $out = $cb($alias);\n if($out != null && $out != false) {\n $pathParts[$i] = $out;\n }\n }\n }\n }\n }\n return implode(DIRECTORY_SEPARATOR, $pathParts);\n }", "public static function setPathOfAlias($alias,$path) {\n if(empty($path)) {\n unset(self::$_aliases[$alias]);\n } else {\n self::$_aliases[$alias] = rtrim($path,'\\\\/');\n }\n }", "public function generateFolderAlias($varValue, $dc)\n\t{\n\t\t$folderAlias = false;\n\t\t$autoAlias = false;\n\n\t\t// Generate an alias if there is none\n\t\tif ($varValue == '')\n\t\t{\n\t\t\t$objPage = $this->Database->executeUncached(\"SELECT * FROM tl_page WHERE id=\".$dc->id);\n\t\t\t\n\t\t\t$autoAlias = true;\n\t\t\t$varValue = standardize($objPage->title);\n\t\t}\n\n\t\tif (strpos($varValue, '/') === false)\n\t\t{\n\t\t\t$objPage = $this->getPageDetails($dc->id);\n\t\t\t$objRoot = $this->Database->execute(\"SELECT * FROM tl_page WHERE id=\".(int)$objPage->rootId);\n\n\t\t\tif ($objRoot->folderAlias)\n\t\t\t{\n\t\t\t\t$objParent = $this->Database->executeUncached(\"SELECT * FROM tl_page WHERE id=\".(int)$objPage->pid);\n\n\t\t\t\tif ($objParent->type != 'root')\n\t\t\t\t{\n\t\t\t\t\t$folderAlias = true;\n\t\t\t\t\t$varValue = $objParent->alias . '/' . $varValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$objAlias = $this->Database->prepare(\"SELECT id FROM tl_page WHERE id=? OR alias=?\")\n\t\t\t\t\t\t\t\t ->execute($dc->id, $varValue);\n\n\t\t// Check whether the page alias exists\n\t\tif ($objAlias->numRows > 1)\n\t\t{\n\t\t\t$arrDomains = array();\n\n\t\t\twhile ($objAlias->next())\n\t\t\t{\n\t\t\t\t$_pid = $objAlias->id;\n\t\t\t\t$_type = '';\n\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\t$objParentPage = $this->Database->prepare(\"SELECT * FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t->execute($_pid);\n\n\t\t\t\t\tif ($objParentPage->numRows < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$_pid = $objParentPage->pid;\n\t\t\t\t\t$_type = $objParentPage->type;\n\t\t\t\t}\n\t\t\t\twhile ($_pid > 0 && $_type != 'root');\n\n\t\t\t\tif ($objParentPage->numRows && ($objParentPage->type == 'root' || $objParentPage->pid > 0))\n\t\t\t\t{\n\t\t\t\t\t$arrDomains[] = $objParentPage->dns;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$arrDomains[] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$arrUnique = array_unique($arrDomains);\n\n\t\t\tif (count($arrDomains) != count($arrUnique))\n\t\t\t{\n\t\t\t\tif (!$autoAlias)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(sprintf($GLOBALS['TL_LANG']['ERR']['aliasExists'.($folderAlias ? 'Folder' : '')], $varValue));\n\t\t\t\t}\n\n\t\t\t\t$varValue .= '-' . $dc->id;\n\t\t\t}\n\t\t}\n\n\t\treturn $varValue;\n\t}", "function user_doctor_setup($env, $vars) {\n /** @var Doctor $doctor */\n $doctor = $vars['doctor'];\n\n $doctor->op('Creating basic roles');\n\n // Create the basic roles.\n $basic_roles = array(\n 'anonymous' => array('title' => 'Anonymous'),\n 'logged' => array('title' => 'Logged-in User'),\n 'admin' => array('title' => 'Admin'),\n );\n foreach ($basic_roles as $role => $roledata) {\n if (!is_dir($env->dir['roles'] . '/' . $role)) {\n NodeFactory::buildNode($env, $role, '_roles', $roledata);\n }\n }\n\n $doctor->op('Looking for Admin user');\n $adminuser = UserFactory::load($env, 'administrator');\n if (!($adminuser->exists)) {\n $doctor->talk('Not found! Attempting to create Admin User...');\n $password = 'pass';\n $password_repeat = 'pass_repeat';\n\n while ($password != $password_repeat) {\n $password = $doctor->ask('Please enter a password for the administrator user', TRUE);\n $password_repeat = $doctor->ask('Please repeat your password', TRUE);\n if ($password != $password_repeat) {\n $doctor->ko('The two passwords are not matching. Please try again!');\n }\n }\n UserFactory::buildUser($env, 'administrator', array(\n 'title' => 'Administrator',\n 'password' => $password,\n 'roles' => array('admin'),\n 'email' => 'admin@changeme.com',\n 'first_name' => 'John',\n 'last_name' => 'Doe',\n 'language' => LANGUAGE_NEUTRAL,\n ));\n $doctor->ok('Done!');\n }\n else {\n $doctor->ok('Found!');\n }\n}", "public function usersDirectory(): Response\n {\n $userProfileRepo = $this->getDoctrine()->getRepository(UserProfile::class);\n $usersDirectory = $userProfileRepo->findAll();\n\n return $this->render('user/usersDirectory.html.twig', [\n 'usersDirectory' => $usersDirectory\n ]);\n }", "protected function createFile($alias, $override = true)\n {\n $path = \\Yii::getAlias($alias);\n if (file_exists($path) && $override) {\n @unlink($path);\n }\n $dir = dirname($path);\n if (!file_exists($dir)) {\n $this->createFolder($dir);\n }\n touch($path);\n }", "public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }", "function createFolders(&$drive_service, &$client, &$configObj, &$UsersAFSObj) \n{\n // Recreate the user's AFS directory structure inside Box\n \n $afsFilesFolder = createFolder($drive_service, \"AFS Migration Files\", \"Home for migrated files\", \"root\", $configObj);\n $UsersAFSObj->folderList[$UsersAFSObj->afsPath] = $afsFilesFolder->getID();\n ++$UsersAFSObj->numFoldersUploaded;\n $logline = date('Y-m-d H:i:s') . \" User's AFS Path: \" . $UsersAFSObj->afsPath . \"\\n\"; \n $logline = date('Y-m-d H:i:s') . \" Our root folder ID: \" . $UsersAFSObj->folderList[$UsersAFSObj->afsPath] . \"\\n\"; \n fwrite($configObj->logFile, $logline);\n \n foreach ($UsersAFSObj->folderList as $key => $value) \n {\n\n // Avoid creating a folder for the root directory \n if (strcmp($key, $UsersAFSObj->afsPath) == 0) \n { \n continue; \n } \n\n // Make sure the folder still exists in AFS \n if (!file_exists($key)) \n { \n continue; \n } \n\n $parentFolderID = $UsersAFSObj->folderList[getParentFolder($key)];\n $logline = date('Y-m-d H:i:s') . \" Parent folder name: \" . getParentFolder($key) . \"\\n\"; \n $logline = $logline . date('Y-m-d H:i:s') . \" Parent folder ID: \" . $parentFolderID . \"\\n\"; \n fwrite($configObj->logFile, $logline);\n\n // See if the access token is about to expire\n if ($client->isAccessTokenExpired())\n {\n //Trade access token for refresh token\n if ($client->refreshToken($configObj->refreshToken) == null)\n {\n $logline = date('Y-m-d H:i:s') . \": Using refresh token, access token granted. \\n\"; \n fwrite($configObj->logFile, $logline);\n }\n else\n {\n $logline = date('Y-m-d H:i:s') . \": Unable to obtain access token. \\n\"; \n fwrite($configObj->logFile, $logline);\n }\n }\n\n //Create folder \n $logline = date('Y-m-d H:i:s') . \" The folder name: \" . getFileName($key) . \"\\n\"; \n $folder = createFolder($drive_service, getFileName($key), \"\", $parentFolderID, $configObj);\n\n if ($folder)\n {\n //If creation worked, store folder ID for the file uploads\n ++$UsersAFSObj->numFoldersUploaded;\n $UsersAFSObj->folderList[$key] = $folder->getID();\n $logline = $logline . date('Y-m-d H:i:s') . \" Success! The ID of this new folder is: \" . $folder->getID() . \"\\n\"; \n fwrite($configObj->logFile, $logline); \n }\n else\n {\n $logline = $logline . date('Y-m-d H:i:s') . \" The following folder could not be created: \" . $folder->getID() . \"\\n\"; \n fwrite($configObj->logFile, $logline); \n }\n }\n}", "public function mkDir($path);", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}", "public function buildClassAliasMapFile() {}", "public function withAliases($userAliases = [])\n {\n $defaults = [\n 'Illuminate\\Support\\Facades\\DB' => 'DB',\n 'Illuminate\\Support\\Facades\\Schema' => 'Schema',\n ];\n\n if (! static::$aliasesRegistered) {\n static::$aliasesRegistered = true;\n\n $merged = array_merge($defaults, $userAliases);\n\n foreach ($merged as $original => $alias) {\n class_alias($original, $alias);\n }\n }\n }" ]
[ "0.6056239", "0.5831992", "0.57926136", "0.574109", "0.5634124", "0.5542194", "0.5538783", "0.5360504", "0.52312535", "0.5217733", "0.52176756", "0.52167946", "0.51643777", "0.5133658", "0.51175094", "0.5107444", "0.5105338", "0.50772554", "0.5069512", "0.506409", "0.50485843", "0.5038422", "0.49982938", "0.49788305", "0.4963297", "0.4962891", "0.49472877", "0.4926632", "0.49224243", "0.49223986", "0.4914069", "0.49091452", "0.48869076", "0.48789167", "0.4867626", "0.4863111", "0.48522374", "0.48514292", "0.4834445", "0.48246765", "0.48157462", "0.4808497", "0.47884327", "0.4786105", "0.47835547", "0.47815257", "0.47744352", "0.47697175", "0.4767396", "0.47429186", "0.47375405", "0.47341815", "0.4729512", "0.47162932", "0.47156635", "0.47009844", "0.4698093", "0.4682965", "0.46829143", "0.46637613", "0.46562997", "0.46555018", "0.46457613", "0.4631048", "0.46276617", "0.4623105", "0.4616463", "0.461345", "0.4612673", "0.461103", "0.46107617", "0.45899087", "0.4587141", "0.45804486", "0.45574555", "0.45571685", "0.45547003", "0.45470116", "0.45356518", "0.45339802", "0.4529274", "0.45226568", "0.4517629", "0.45149794", "0.4513974", "0.45064244", "0.45064244", "0.44963464", "0.44767788", "0.446909", "0.4468928", "0.4468426", "0.4465155", "0.44527468", "0.4444483", "0.44386587", "0.44382074", "0.44350857", "0.44348422", "0.44214943" ]
0.7431925
0
Sets the local path to the file to be signed. This method is only an alias fo the setFileToSignFromPath() method.
Устанавливает локальный путь к файлу, который необходимо подписать. Этот метод является лишь алиасом метода setFileToSignFromPath().
public function setFileToSign($path) { $this->setFileToSignFromPath($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLocalFile($localFilePath) {\n\t\t$this->localFilePath = $localFilePath;\n\t}", "public function setFileToSignFromPath($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided file to be signed was not found\");\n }\n\n $this->fileToSignPath = $path;\n }", "public function setFileToSignFromPath($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided file to be signed was not found\");\n }\n\n $this->fileToSignPath = $path;\n }", "public function setSignatureFile($path)\n {\n $this->setSignatureFileFromPath($path);\n }", "public function setPath($file);", "public function setSourceLocalPath($path) {\n $this->sourceLocalPath = $path;\n return $this;\n }", "public function setSavePath($local, $path)\n {\n $this->save_local = $local;\n $this->save_path = $path;\n }", "public function setFileToSignFromContentRaw($contentRaw)\n {\n $tempFilePath = parent::createTempFile();\n file_put_contents($tempFilePath, $contentRaw);\n $this->fileToSignPath = $tempFilePath;\n }", "public function setFileToSignFromContentRaw($contentRaw)\n {\n $tempFilePath = parent::createTempFile();\n file_put_contents($tempFilePath, $contentRaw);\n $this->fileToSignPath = $tempFilePath;\n }", "public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}", "public function setCertificatePath($certLocalPath)\n {\n $this->contextArgs['ssl']['local_cert'] = $certLocalPath;\n }", "public function setDestinationLocalPath($path) {\n $this->destinationLocalPath = $path;\n return $this;\n }", "public function setFileToSignContent($contentRaw)\n {\n $this->setFileToSignFromContentRaw($contentRaw);\n }", "public function setFileToSignContent($contentRaw)\n {\n $this->setFileToSignFromContentRaw($contentRaw);\n }", "public function setSignatureFileFromPath($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided signature file was not found\");\n }\n $this->signatureFilePath = $path;\n }", "public static function setFile($file) {}", "public static function setSourceFilePath( $path ) {\n\n update_option( 'geb_gfe_uploaded_template', $path );\n }", "public function setFilepath(string $path)\n {\n $this->filepath = $path;\n }", "public function upload($file, $local_file);", "public function setFile($v)\r\n\t{\r\n\t\t$this->_file = $v;\r\n\t}", "public function setSignatureFileFromContentRaw($contentRaw)\n {\n $tempFilePath = parent::createTempFile();\n file_put_contents($tempFilePath, $contentRaw);\n $this->signatureFilePath = $tempFilePath;\n }", "public function setPath( $path );", "public function setFilepath($filepath);", "public function setFile($file) {}", "public function set_file($path='',$filename='') {\n\t\t$this->_init($path,$filename);\n\t}", "public function setFilePath($filePath);", "public function setSignatureFileContent($contentRaw)\n {\n $this->setSignatureFileFromContentRaw($contentRaw);\n }", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setFileKey($path, $key) {\n\t\treturn $this->keyStorage->setFileKey($path, $this->fileKeyId, $key, Encryption::ID);\n\t}", "public function setFile(string $path): void\n {\n $this->fileHandle = fopen($path, \"w\");\n \\curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, true);\n \\curl_setopt($this->connection, CURLOPT_FILE, $this->fileHandle);\n }", "public static function set_certificate_path($path)\n {\n }", "public function setPathAttribute($path) {\n\n //$this->attributes[\"path\"] asemos referencia a el atributo path\n // Carbon::now()->second es para obtener los segundos actuales\n //concadenamos luego el nombre del archivo q estamos resiviendo con $path->getClientOriginalName()\n $this->attributes[\"path\"] = Carbon::now()->second . $path->getClientOriginalName();\n\n //nombre del archivo va a ser lo mismo\n $name = Carbon::now()->second . $path->getClientOriginalName();\n\n //para subir un archivo se hace con la clase \\Storage::disk(\"local\")\n //y con el metodo put almasenamos el archivo, resive el nombre y el archivo q vamos a subir\n //en este caso entramos a la clase \\File::get() y le accinamos la ruta de nuestro archivo\n \\Storage::disk(\"local\")->put($name, \\File::get($path));\n }", "public function setFile($file)\n {\n $this->file = $file;\n }", "public function setPath(string $path): self;", "public function setPath(string $path): self;", "public function getLocalPath($path);", "public function setPath($path){ }", "public function setFile($file)\r\n {\r\n $this->file = $file;\r\n }", "public function setPath(PhingFile $path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function setFile(File $file)\n\t{\n\t\t$this->file=$file; \n\t\t$this->keyModified['file'] = 1; \n\n\t}", "public function saveLocalFile()\n {\n if (!Storage::disk('local')->exists(self::NAME_FILE_LOCAL) && $this->verificUrl()) {\n Storage::disk('local')->put(self::NAME_FILE_LOCAL, file(self::URL_UMASS_COUNTRYS));\n }\n }", "public function setPath($path)\n\t{\n\t\t/* This must be created here to prevent the directory from\n\t\t * becoming automatically converted to an absolute path. */\n\t\t$this->path = new PhingFile($path);\n\t}", "public function setFile($file){\n $this->file = $file;\n }", "public function setPath( $path )\n\t{\n\t\t$this->path = $path;\n\t\t$this->modified = true;\n\t}", "public function setPath($path = '');", "public function setPath( $path )\n {\n $this->path = us($path);\n }", "public function setFile(File $file)\n {\n $this->file = $file;\n }", "abstract public function getLocalPath(File $file);", "public function __construct($localPath)\n {\n if (!file_exists($localPath)) {\n throw new FilesystemException(sprintf(\n 'The file \"%s\" does not exist.',\n $localPath\n ));\n }\n\n $this->localPath = $localPath;\n }", "public function set_path(string $path) : self\n {\n if (!isset($this->filePath)) {\n $this->filePath = $path;\n }\n return $this;\n }", "public function setLocal($local){ }", "public function setDefaultFile($path)\r\n {\r\n $this->_default_file = trim($path,'/');\r\n }", "public static function setPath($path)\n {\n }", "public function setInputFile($path)\n {\n $this->inputFile = $path;\n\n return $this;\n }", "public function setPath(string $path): void\n {\n $this->path = (string) $path;\n }", "public function setSavePath(string $path);", "protected function setSourcePath($path)\n {\n if (empty($this->sourcePath)) {\n $this->sourcePath = $path;\n }\n }", "public function setFilesPath($newFilePath) {\n\t\t$this->uploadPath = $newFilePath;\n\t}", "public function testLocalFile()\n {\n $file = new LocalFile(__DIR__.'/test.txt');\n $this->field->saveFile($file);\n\n $path = $this->field->getUploadTo();\n $this->assertEquals(sprintf('foo/FileModel/%s', date('Y-m-d')), $path);\n $this->assertEquals('123', file_get_contents(__DIR__.'/temp/'.$path.'/test.txt'));\n }", "public function setUploadPath(string $path)\n {\n // Set path to upload. Path is automatically in public folder\n $this->upload_path = Constants::path_storage . '/Files/' . $path;\n // Check if exists\n if(!is_dir($this->upload_path)){\n // Create dir\n mkdir($this->upload_path);\n }\n // Return this object\n return $this;\n }", "public function setDefaultFile($path)\n\t{\n\t\t$this->_defaultFile=trim($path,'/');\n\t}", "public function setSourcePath($clientPath) {\n $this->clientPath = $clientPath;\n }", "public function setSourcePath($clientPath) {\n $this->clientPath = $clientPath;\n }", "public function set_path($path) {\n $this->path = $path;\n }", "public function PutFile($filename, $localPath){\n $uniquePrefix = substr(md5(microtime() . $filename), 0, 5) . \"_\";\n $prefixedFilename = $uniquePrefix . $filename;\n\n\n\n $s3 = S3Client::factory(array(\n 'credentials' => new Credentials(S3Storage::AWS_KEY, S3Storage::AWS_SECRET)\n ));\n\n try {\n $s3->putObject([\n 'Bucket' => 'shoperella-images',\n 'Key' => $prefixedFilename,\n 'Body' => fopen($localPath, 'r'),\n ]);\n } catch (\\Exception $e) {\n return \"\";\n }\n\n return \"https://s3.amazonaws.com/shoperella-images/\" . $prefixedFilename;\n }", "public function setDataFile($path)\n {\n $this->setDataFileFromPath($path);\n }", "public function setDataFile($path)\n {\n $this->setDataFileFromPath($path);\n }", "public function setFile($file)\n\t{\n\t\t$this->file = $file;\n\t\t// check if we have an old image path\n\t\tif (isset($this->image)) {\n\t\t\t// store the old name to delete after the update\n\t\t\t$this->temp = $this->image;\n\t\t\t$this->image = null;\n\t\t} else {\n\t\t\t$this->image = 'initial';\n\t\t}\n\t}", "function setPath($path)\n {\n $this->path = trim($path);\n }", "protected function setPath( string $path ) : void\n {\n $this->path = DIGITAL_BASE_PATH.$path;\n }", "public function setFilePath($var)\n {\n GPBUtil::checkString($var, True);\n $this->file_path = $var;\n\n return $this;\n }", "function setFileRef($filePath) {\n\t\t$this->filePath = $filePath;\n\t\t$this->fileContent = tsLib_CObj::fileResource($filePath);\n\t}", "public function setFile($file)\n {\n $this->file = $file;\n $this->load();\n }", "public function signed_files_dir() {\n\t\t\treturn plugin_dir_path( __FILE__ ) . CFS_SIGNED_FILES_DIR;\n\t\t}", "public function setPath($path)\n {\n if ($path == self::AUTO_DETECT) $path = $this->findSendmail();\n $this->path = $path;\n }", "public function signAndPathInput($sign, $path) \n {\n \n $this->textInput = $sign;\n $this->pathToDir = $path;\n if (substr($this->pathToDir, -1) != '/') {\n $this->pathToDir = $this->pathToDir . '/';\n }\n $this->doEditingInPhp();\n }", "public function setTemplatefile($path)\n\t{\n\t\t$this->templatefile = $path;\n\t}", "protected function setCachePath(): void\n {\n $filename = basename($this->pathFile);\n\n $this->pathCache = $this->cacheDir.'/'.$filename;\n }", "public function setDataFileFromPath($path)\n {\n $this->dataFile = FileReference::fromFile($path);\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function set( $path ) {\n\t\t$this->path = $path;\n\n\t\t$path_info = pathinfo( $this->path );\n\n\t\t$this->file = $path_info['basename'];\n\t\t$this->extension = $path_info['extension'] == 'jpg' ? 'jpeg' : $path_info['extension'];\n\t\t$this->filename = $path_info['filename'];\n\n\t\t$this->server = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];\n\n\t\t$this->url = $this->server.str_replace( $this->base_dir, '', $this->path );\n\t}", "public function setFile(?StreamInterface $value): void {\n $this->getBackingStore()->set('file', $value);\n }", "public function toFile() : Local\n {\n return new Local(new SplFileInfo($this->getPathname()));\n }", "static public function getLocalFile($path) {\n\t\treturn self::$defaultInstance->getLocalFile($path);\n\t}", "public function setPath(string $path)\n {\n $this->path = $path;\n\t}", "public function setPath($path)\r\n\t{\r\n\t\t$this->path=$path;\r\n\t}", "public function setAttachPath($path)\n {\n $this->attachPath = $path;\n }", "public function store( $remoteFileName, $local) {\r\n\t\treturn $this;\r\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "protected function setFilePath($fileName, $storagePath = '..' . DIRECTORY_SEPARATOR . 'tmp')\n {\n return storage_path('sync/' . $fileName);\n }" ]
[ "0.6857141", "0.6621907", "0.6621907", "0.64501864", "0.6100515", "0.5922541", "0.5865195", "0.5858504", "0.5858504", "0.58584785", "0.57971287", "0.5708299", "0.56873876", "0.56873876", "0.5647066", "0.556268", "0.55089843", "0.54598343", "0.5438985", "0.5376086", "0.536818", "0.5348981", "0.5313918", "0.53116953", "0.5311601", "0.5240772", "0.5234445", "0.5233663", "0.5233663", "0.5233663", "0.5233663", "0.5121169", "0.51176786", "0.510994", "0.5094871", "0.5067277", "0.5051102", "0.5051102", "0.5049796", "0.50391656", "0.50250775", "0.5024642", "0.5008093", "0.49877176", "0.49740767", "0.497183", "0.49626654", "0.4955249", "0.4954501", "0.49501443", "0.49446777", "0.49364632", "0.49231386", "0.49011096", "0.48981833", "0.489692", "0.48917788", "0.48866457", "0.48822328", "0.48781037", "0.48731777", "0.48627782", "0.48464575", "0.4842889", "0.48409376", "0.48409376", "0.4838911", "0.48380598", "0.48360243", "0.48360243", "0.48215175", "0.4819892", "0.48169768", "0.48143387", "0.48137286", "0.48096487", "0.48073816", "0.4791865", "0.47917953", "0.47798252", "0.47751075", "0.47677523", "0.47620112", "0.47620112", "0.47620112", "0.47620112", "0.47620112", "0.47620112", "0.47620112", "0.47500792", "0.47417358", "0.4736708", "0.47354195", "0.4734086", "0.47308758", "0.4726843", "0.47235346", "0.47158787", "0.47154906" ]
0.73169076
1
Sets the list of data hashes by passing a pure PHP model. If preferred, the JSON file can be provided using the method setDataHashes().
Устанавливает список хэшей данных, передавая чистую PHP-модель. Если это предпочтительнее, можно использовать метод setDataHashes() для предоставления файла JSON.
public function setDataHashes($dataHashes) { $models = array(); foreach($dataHashes as $dh) { array_push($models, $dh->toModel()); } if (!($json = json_encode($models))) { throw new \Exception("The provided data hashes was not valid"); } $tempFilePath = parent::createTempFile(); file_put_contents($tempFilePath, $json); $this->dataHashesPath = $tempFilePath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setHashAdapters($hashList);", "public static function bindData(array $hashData)\n {\n static::$hashData = $hashData;\n }", "public function testSetHash()\n {\n $validator = new File\\Md5('12345');\n $validator->setHash('12333');\n $this->assertEquals(['12333' => 'md5'], $validator->getMd5());\n\n $validator->setHash(['12321', '12121']);\n $this->assertEquals(['12321' => 'md5', '12121' => 'md5'], $validator->getMd5());\n }", "public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}", "public function setHashAdapters($hashList) {\n\t\t$this->hashAdapters = $hashList;\n\t}", "public function setT3Hashes() {}", "public function setHash($hash)\n {\n return $this->setData(self::HASH, $hash);\n }", "public function setDataHashesFromFile($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided data hashes file was not found\");\n }\n\n $this->dataHashesPath = $path;\n }", "protected function setHash(DataModel $item, &$data)\n\t{\n\t\t// Sanity check\n\t\tif (!(\n\t\t\t$item->hasField('lft') && \n\t\t\t$item->hasField('rgt') && \n\t\t\t$item->hasField('hash') && \n\t\t\t$item->hasField('slug')\n\t\t))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$slugField = $item->getFieldAlias('slug');\n\n\t\t// sha1 hash of 'null' is 'da39a3ee5e6b4b0d3255bfef95601890afd80709',\n\t\t// so avoid setting the hash if no slug has been set. Set from input first.\n\t\tif ( isset($slugField, $data) )\n\t\t{\n\t\t\t$data['hash'] = sha1( $data[$slugField] );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $slug = $item->getFieldValue($slugField) )\n\t\t{\n\t\t\t$data['hash'] = $slug;\n\n\t\t\treturn;\n\t\t}\n\t}", "public function setHash($hash)\n {\n $this->hash = $hash;\n }", "function setHash($hash) {\n $this->h = pack('H*', $hash);\n }", "private function setHashAndStatus($data) {\n\t\t$hash = sha1(json_encode($data));\n\n\t\t// hash exists in DB ?\n\t\t$sql = 'SELECT * FROM `*PREFIX*ocDashboard_usedHashs` WHERE usedHash = ? AND widget = ? AND user = ? LIMIT 1;';\n\t\t$params = Array($hash,$this->id,$this->user);\n\t\t$query = \\OCP\\DB::prepare($sql);\n\t\t$result = $query->execute($params)->fetchRow();\n\t\t\t\t\n\t\t// if not in DB, write to DB\n\t\tif(!$result) {\n\t\t\t$sql2 = 'INSERT INTO `*PREFIX*ocDashboard_usedHashs` (id,usedHash,widget,user,timestamp) VALUES (\\'\\',?,?,?,?); ';\n\t\t\t$params = Array($hash,$this->id,$this->user,time());\n\t\t\t$query2 = \\OCP\\DB::prepare($sql2);\n\t\t\t$result2 = $query2->execute($params);\n\t\t\tif($this->status < 3) {\n\t\t\t\t$this->status = 2;\n\t\t\t\tOCP\\Util::writeLog('ocDashboard',\"Could not write hash to db.\", \\OCP\\Util::WARN);\n\t\t\t}\n\t\t}\n\t}", "protected function loadHash()\n {\n $this->valueHash = $this->calculateHash();\n }", "public function testHashesSetterGetter($hashes): void\n {\n $this->component->setHashRepository($hashes);\n self::assertSame($hashes, $this->component->getHashRepository());\n }", "protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }", "protected function setAll(array $hData)\n {\n $this->hData['method'] = isset($hData['method']) ? (string)$hData['method'] : $this->hDefault['method'];\n\n if (isset($hData['baseurl']))\n {\n $this->hData['baseurl'] = $hData['baseurl'];\n }\n\n if (isset($hData['uri']))\n {\n $hUri = parse_url($hData['uri']);\n $sWebTypes = implode('|', App::WEB_TYPES);\n\n if (isset($this->hData['baseurl']) && preg_match(\"#{$this->hData['baseurl']}/(.*$)#\", $hUri['path'], $aMatch))\n {\n $this->hData['rawpath'] = $aMatch[1];\n }\n elseif (preg_match(\"#(.*?)(($sWebTypes).*$)#i\", $hUri['path'], $aMatch))\n {\n $this->hData['baseurl'] = $aMatch[1];\n $this->hData['rawpath'] = $aMatch[2];\n }\n else\n {\n $this->hData['baseurl'] = '/';\n $this->hData['rawpath'] = preg_replace(\"#^/#\", '', $hUri['path']);\n }\n }\n\n if (isset($this->hData['baseurl']) && isset($this->hData['rawpath']))\n {\n $this->processRawPath();\n\n if (isset($hUri['query']))\n {\n $hQuery = null;\n parse_str($hUri['query'], $hQuery);\n $this->processGet($hQuery);\n }\n }\n\n foreach ($hData as $sKey => $sValue)\n {\n if (in_array(strtolower($sKey), static::$aDataKeys))\n {\n $this->hData[strtolower($sKey)] = strtolower($sValue);\n }\n }\n }", "public function setHash($_hash)\n\t{\n\t\t$this->_hash = $_hash ;\n\t}", "public function updateItemHashes()\n {\n foreach ($this->getItems() as $itemHash => $item) {\n $this->updateItemHash($itemHash);\n }\n }", "private function setData()\n {\n if ($this->config->has('auth.external_concrete')) {\n $data = $this->config->get('auth.external_concrete', '');\n } else {\n // legacy support\n $data = $this->config->get('auth.external_concrete5', '');\n }\n $authUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_auth']);\n $attachUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_attach']);\n $baseUrl = $this->urlResolver->resolve(['/']);\n $path = $baseUrl->getPath();\n $path->remove('index.php');\n $name = trim((string) array_get($data, 'name', t('External concrete')));\n\n $this->set('data', $data);\n $this->set('authUrl', $authUrl);\n $this->set('attachUrl', $attachUrl);\n $this->set('baseUrl', $baseUrl);\n $this->set('assetBase', $baseUrl->setPath($path));\n $this->set('name', $name);\n $this->set('user', $this->app->make(User::class));\n }", "public function setHash($pHash) {\n\t\t$this->Hash = $pHash;\n\t}", "public function __construct($hash = array())\n {\n foreach ($hash as $key => $value) {\n $this->push($key, $value);\n }\n }", "public function set($data);", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "public function getItemHash(GetHashEvent $event): void\n {\n $data = $event->getData();\n\n if ($data instanceof IItem) {\n $hash = sprintf(\n '%s_%s',\n $data->getMetaModel()->getTableName(),\n $data->get('id')\n );\n\n $event->setHash($hash);\n }\n }", "public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }", "public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }", "protected function getDataHook(array $data): void\n {\n $this->hashes = [\n 'storages' => [\n $data['storage_place'][0]['hash'],\n $data['storage_place'][1]['hash'],\n $data['storage_place'][2]['hash'],\n ],\n 'locations' => [\n $data['sl_location'][0]['hash'],\n $data['sl_location'][1]['hash'],\n $data['sl_location'][2]['hash'],\n ],\n 'rooms' => [\n $data['sl_room'][0]['hash'],\n $data['sl_room'][1]['hash'],\n $data['sl_room'][2]['hash'],\n ],\n ];\n }", "public static function setData($data) {}", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function _clean_by_hashes($hashes = [])\n {\n }", "public function setHash(/*string*/ $value) /*: this*/ {\n $this->hash = $value;\n return $this;\n }", "public function set($filepath, $data);", "public function testAddHash()\n {\n $validator = new File\\Md5('12345');\n $validator->addHash('12344');\n $this->assertEquals(['12345' => 'md5', '12344' => 'md5'], $validator->getMd5());\n\n $validator->addHash(['12321', '12121']);\n $this->assertEquals(\n ['12345' => 'md5', '12344' => 'md5', '12321' => 'md5', '12121' => 'md5'],\n $validator->getMd5()\n );\n }", "public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }", "public function set($key, $value = null, $hash = 'request') {\n\t\t$this->_hashes[$hash][$key] = $value;\n\t}", "public function _setData($data = []){\n \t$this->dataredis\t= $data;\n \tunset($this->dataredis['clientId']);\n \tunset($this->dataredis['clientToken']);\n \t$this->dataredis\t= $this->common->arraySortByKey($this->dataredis, \"ASC\");\n \t$temp\t\t\t\t= \"\";\n \tforeach($this->dataredis as $k => $v){\n \t\tif(is_array($v)) $v = json_encode($v);\n \t\t$temp\t.= urlencode($k).\"=\".urlencode($v).\"&\";\n \t}\n \t$this->dataredis\t= substr($temp,0,strlen($temp)-1);\n \tif(strlen($this->dataredis)==0) $this->dataredis\t= \"null\";\n }", "function storeHash($hash,$data,$ident)\t{\n\t\t$insertFields = array(\n\t\t\t'hash' => $hash,\n\t\t\t'content' => $data,\n\t\t\t'ident' => $ident,\n\t\t\t'tstamp' => time()\n\t\t);\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash', 'hash=\"'.$GLOBALS['TYPO3_DB']->quoteStr($hash, 'cache_hash').'\"');\n\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_hash', $insertFields);\n\t}", "private function loadData(): void\n {\n if (null !== $this->data) {\n // Data is already loaded.\n return;\n }\n\n $json = file_get_contents($this->filePath);\n $data = (new JsonEncoder())->decode($json, JsonEncoder::FORMAT);\n\n $this->data = [];\n\n foreach ($data['quotes'] as $quote) {\n $this->data[$this->slugifier->slugify($quote['author'])][] = $quote['quote'];\n }\n }", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData(array $data);", "public function setData(array $data);", "public function setData(array $data);", "public function SET_hash($field_names_and_values) {\n\t\t//$this->scriptForceHint('UPDATE');\n\t\tif (!$field_names_and_values) throw new Exception(\"Attempting to SET an empty associative array\");\n\t\tforeach ($field_names_and_values as $field_name => $value) {\n\t\t\t$this->SET_once($field_name, $value);\n\t\t}\t\n\t}", "protected function setData(array $data)\n\t{\n\t\t$this->json_data = $data;\n\t}", "public function hashDataProvider() {}", "function set($d){\n self::$data = array();\n self::$data = array_merge(self::$data,$d);//contenue de la variable passer du model a la vue\n }", "function DataHash(){\n return($this->data);\n }", "protected function setModelData(Model $model, array $data)\n {\n return $model->fill($data);\n }", "public function setHash($hash)\n {\n $this->hash = $hash;\n return $this;\n }", "public function setHash($hash)\n {\n $this->hash = $hash;\n return $this;\n }", "public function setUseHashes($setting)\n\t{\n\t\t$this->useHashes = (bool)$setting;\n\t}", "public function setData(Array $data);", "public function setData(array $data = []);", "public function setBoxesHashAttribute($boxes)\n {\n $this->attributes['boxes_hash'] = $this->md5Boxes($boxes);\n }", "public function __construct(){\n global $config;\n $configContent=null;\n if (file_exists($config[\"usersFile\"]))\n $configContent=file_get_contents($config[\"usersFile\"]);\n if ($configContent!=null&&$configContent!=\"\") {\n $this->users = json_decode($configContent, true);\n }\n if ($this->users === null || json_last_error() !== JSON_ERROR_NONE) {\n\n $this->users=array(array(\"username\"=>$config[\"userAdmin\"],\"password\"=>generatePasswordHash($config[\"passwordAdmin\"])),array(\"username\"=>$config[\"userGuest\"],\"password\"=>generatePasswordHash($config[\"passwordGuest\"])));\n $this->save();\n }\n\n }", "function set($d){\n\t self::$data = array();\n\t self::$data = array_merge(self::$data,$d);//contenue de la variable passer du model a la vue\n }", "public function hashArray(&$content, $hashKey, $algo = 'md5') {\n\t\tif(!array_key_exists($hashKey, current($content))) {\n\t\t\tthrow new Exception('Key \\''.$hashKey.'\\' not found from '.\n\t\t\t\t$this->className.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tforeach ($content as $key => $value) {\n\t\t\t\t\t$content[$key][$hashKey] = hash($algo, $value[$hashKey]);\n\t\t\t\t}\n\t\t\n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.\n\t\t\t\t\t'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}", "public function createOrUpdate(array $data, $model=null);", "protected static function setPropertyHash($property)\n {\n DB::insert(\n \"INSERT INTO `sync_hash` (property_id, hash) VALUES (?,?)\",\n [$property['id'], md5(json_encode($property))]\n );\n }", "public function testgetHash()\n {\n $validator = new File\\Md5('12345');\n $this->assertEquals(['12345' => 'md5'], $validator->getHash());\n\n $validator = new File\\Md5(['12345', '12333', '12344']);\n $this->assertEquals(['12345' => 'md5', '12333' => 'md5', '12344' => 'md5'], $validator->getHash());\n }", "private function read_hash_file(){\n\n $file = MD5_HASHER_DIR . $this->file_check;\n\n if(is_file($file) && is_readable($file)){\n $fh = fopen(MD5_HASHER_DIR . $this->file_check, 'r');\n\n if(filesize(MD5_HASHER_DIR.$this->file_check) > 0)\n $this->md5_gen_old = (Array)json_decode(fread($fh, filesize(MD5_HASHER_DIR.$this->file_check)));\n\n fclose($fh);\n }\n }", "public static function set($array, $hash = 'method', $overwrite = true)\n {\n foreach ($array as $key => $value) {\n static::setVar($key, $value, $hash, $overwrite);\n }\n }", "public function setAllData($data)\n {\n \n foreach ($data as $key => $value) {\n $this->setData($key, $value);\n }\n \n }", "function getHash(){\r\n\r\n\t\t$hash = array();\r\n \r\n\t\t$hash['id'] = $this->id;\r\n\t\t$hash['user_id'] = $this->user_id;\r\n\t\t$hash['username'] = $this->username;\r\n\t\t$hash['gender'] = $this->gender;\r\n\t\t$hash['dob'] = $this->dob;\r\n\t\t$hash['country_id'] = $this->country_id;\r\n\t\t$hash['picture'] = $this->picture;\r\n\t\t$hash['link'] = $this->link;\r\n\t\t$hash['phone'] = $this->phone;\r\n\t\t$hash['likes'] = $this->likes;\r\n\t\t$hash['dislikes'] = $this->dislikes;\r\n\t\t$hash['hobbies'] = $this->hobbies;\r\n\t\t$hash['is_active'] = $this->is_active;\r\n\t\t$hash['created_on'] = $this->created_on;\r\n\t\t$hash['last_modified_on'] = $this->last_modified_on;\r\n\r\n\t\treturn $hash;\r\n\t}", "public function setData($data = null)\n {\n if ($data instanceof Model) {\n $data = [snake_case(class_basename($data)) => $this->convertObjectToArray($data)];\n } elseif (is_object($data)) {\n $data = $this->convertObjectToArray($data);\n } elseif (is_null($data)) {\n $data = [];\n } elseif (is_string($data)) {\n $data = [static::messageKey() => $data];\n }\n\n if (! is_array($data)) {\n $data = [static::messageKey() => json_encode($data)];\n }\n\n if (! array_key_exists(static::codeKey(), $data)) {\n $data[static::codeKey()] = $this->getCode();\n }\n\n if (! is_null($this->cleanKeys)) {\n $data = $this->cleanArray($data, $this->cleanKeys);\n }\n\n return parent::setData($data);\n }", "public function addArray($hData, $bHash = true)\n {\n if (!is_bool($bHash))\n {\n $bHash = (boolean)$bHash;\n }\n\n if (is_array($hData) && count($hData) > 0)\n {\n foreach ($hData as $sValue => $sTitle)\n {\n $sTemp = $bHash ? $sValue : $sTitle;\n $this->addOption($sTitle, $sTemp);\n }\n }\n }", "public function set_fields($data)\n\t{\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (isset($this->aliases[$key]))\n\t\t\t\t$key = $this->aliases[$key];\n\n\t\t\tif (array_key_exists($key, $this->data))\n\t\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}", "public function setData($data) { \n $this->data = $data; \n }", "public static function setData($data)\n {\n self::$rawData = $data;\n }", "public function setDataList($dataList) {\n\t\t$this->dataList = $dataList;\n\t}", "public function __construct($json)\n {\n if (array_key_exists('hash', $json)) {\n $this->hash = $json['hash'];\n }\n if (array_key_exists('ver', $json)) {\n $this->version = $json['ver'];\n }\n if (array_key_exists('prev_block', $json)) {\n $this->previous_block = $json['prev_block'];\n }\n if (array_key_exists('mrkl_root', $json)) {\n $this->merkle_root = $json['mrkl_root'];\n }\n if (array_key_exists('time', $json)) {\n $this->time = $json['time'];\n }\n if (array_key_exists('bits', $json)) {\n $this->bits = $json['bits'];\n }\n if (array_key_exists('fee', $json)) {\n $this->fee = Conversion::btcInt2Str($json['fee']);\n }\n if (array_key_exists('nonce', $json)) {\n $this->nonce = $json['nonce'];\n }\n if (array_key_exists('n_tx', $json)) {\n $this->n_tx = $json['n_tx'];\n }\n if (array_key_exists('size', $json)) {\n $this->size = $json['size'];\n }\n if (array_key_exists('block_index', $json)) {\n $this->block_index = $json['block_index'];\n }\n if (array_key_exists('main_chain', $json)) {\n $this->main_chain = $json['main_chain'];\n }\n if (array_key_exists('height', $json)) {\n $this->height = $json['height'];\n }\n if (array_key_exists('received_time', $json)) {\n $this->received_time = $json['received_time'];\n }\n if (array_key_exists('relayed_by', $json)) {\n $this->relayed_by = $json['relayed_by'];\n }\n if (array_key_exists('tx', $json)) {\n foreach ($json['tx'] as $tx) {\n $this->transactions[] = new Transaction($tx);\n }\n }\n }", "public function assign(array $data, $whiteList = null, $dataColumnMap = null): ModelInterface;", "public function __construct($hash, &$client, &$multicall, &$data)\n\t{\n\t\t$this->hash = $hash;\n\t\t$this->client = &$client;\n\t\t$this->multicall = &$multicall;\n\t\t$this->data = &$data;\n\t}", "public function setHash($hash)\n {\n $this->hash = $hash;\n\n return $this;\n }", "public function updateModelSync($model)\n {\n\t$this->query('update [tables] set [hash] = %s where [name] = %s',\n\t$model->getHash(),\n\t$model->getTableName()\n\t);\n }", "public function setHash($hash)\n\t{\n\t\t$this->hash = $hash;\n\n\t\treturn $this;\n\t}", "public function setHashIndex($value);", "public function setHash($type = 'sha1')\n {\n $this->_hashType = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type;\n }", "public function getProjectHash() {\n\t\t$hash\t= '';\n\n\t\tif( $this->_param['useHash'] ) {\n\t\t\t$string = '';\n\t\t\t$vals\t= array();\n\n\t\t\t// build an array with values only - all values except 'language_id''\n\t\t\tforeach( $this->formData as $key => $value ) {\n\t\t\t\tif( $key != 'language_id' ) {\n\t\t\t\t\t$vals[] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$string\t= implode( '|', $vals );\n\t\t\t$hash\t= $this->getHash( $string );\n\n\t\t\tif( $this->_debug == 1 ) {\n\t\t\t\t$msg = 'values for hash calculation:<br />'\n\t\t\t\t. 'values as array:<br />'\n\t\t\t\t. print_r( $vals, true )\n\t\t\t\t. '<hr />'\n\t\t\t\t. 'values as string:<br />'\n\t\t\t\t. $string\n\t\t\t\t. '<hr />'\n\t\t\t\t. 'hash value [' . $hash . ']';\n\n\t\t\t\t$this->writeLog( $msg, 5 );\n\t\t\t}\n\t\t}\n\n\t\t// add the hash value to the form datas\n\t\t$this->formData = array_merge( $this->formData, array( 'hash' => $hash ) );\n\t}", "public function setFromArray(array $data);", "public function setData($data, $key = null);", "public function set(array $models,array $options = []);", "function setHash($hash)\n {\n // \\phpseclib\\Crypt\\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.\n switch ($hash) {\n case 'md2':\n case 'md5':\n case 'sha1':\n case 'sha256':\n case 'sha384':\n case 'sha512':\n $this->hash = new Hash($hash);\n $this->hashName = $hash;\n break;\n default:\n $this->hash = new Hash('sha1');\n $this->hashName = 'sha1';\n }\n $this->hLen = $this->hash->getLength();\n }", "public function setData($data)\r\n {\r\n }", "private function getData($hash = '')\n\t{\n\t\t$this->data['step'] = $this->detectStep($hash);\n\t\t$this->data['hash'] = $this->hash;\n\n\t\t$this->data['footer_scripts'] = \"jQuery(document).ready(function($){\";\n\t\t$this->data['footer_scripts'] .= \"timber.utils.init();\";\n\t\t$this->data['footer_scripts'] .= \"timber.fpwd.init();\";\n\t\t$this->data['footer_scripts'] .= \"});\";\n\n\t\t$this->bindSubPage( $this->timber->translator->trans('Forgot Password') . \" | \" );\n\t\treturn $this->data;\n\t}", "public function update($models)\n {\n // reset keys, with php artisan scout:import \"Syscover\\...\" command get a object with objects\n // need call to values method to change object to array\n $models = $models->values();\n\n $this->setProperties($models);\n\n if (Storage::exists($this->fileRoute))\n {\n // transform json to collection\n $data = collect(json_decode(Storage::get($this->fileRoute), true));\n\n foreach ($models as $model)\n {\n $match = false;\n\n foreach ($data as $key => $item)\n {\n if (\n (isset($model['ix']) && $item['ix'] === $model->ix) ||\n (isset($model['id']) && $item['id'] === $model->id)\n )\n {\n $match = true;\n $data[$key] = $model->toSearchableArray();\n }\n }\n\n if(!$match) $data->push($model->toSearchableArray());\n }\n }\n else\n {\n $data = $models->map(function($model) {\n return $model->toSearchableArray();\n });\n }\n\n Storage::disk('local')->put($this->fileRoute, $data);\n }", "public function addNewsletterHash(\\Klikasi\\Model\\Raw\\NewsletterHash $data)\n {\n $this->_NewsletterHash[] = $data;\n $this->_setLoaded('NewsletterHashNewsletterId');\n return $this;\n }", "public static function setMany($data)\n {\n foreach ($data as $key => $value) {\n if ($key === 'translatable') {\n self::setTranslatable($value);\n } else {\n if (is_array($value))\n $value = json_encode($value);\n self::updateOrCreate(['key' => $key], ['plain_value' => $value]);\n }\n }\n }", "function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function setData($data)\n {\n $resultData = $this->hydrateIfJsonToArray($data);\n if (!empty($resultData)) {\n $this->data = $resultData;\n }\n else {\n $this->data = [];\n }\n }", "public function setData($data = array())\n {\n $this->data = (string) $data;\n\n $this->update();\n }", "public function setData($data)\n {\n return $this->set('data', $data);\n }", "public function setHashIndex($value) {\n\t\t$this->_hashIndex = $value;\n\t}", "public function testSet() {\n $data = $this->expanded;\n $match = $data;\n\n $data = Hash::set($data, 'key', 'value');\n $match['key'] = 'value';\n $this->assertEquals($match, $data);\n\n $data = Hash::set($data, 'key.key', 'value');\n $match['key'] = array('key' => 'value');\n $this->assertEquals($match, $data);\n\n $data = Hash::set($data, array(\n 'key.key.key' => 'value',\n 'true' => true,\n 'one.false' => false\n ));\n $match['key']['key'] = array('key' => 'value');\n $match['true']= true;\n $match['one']['false'] = false;\n $this->assertEquals($match, $data);\n }", "public function syncUserList()\n {\n // If no internal cache exists yet, get its value from LazyJsonMapper.\n if ($this->_userList === null) {\n $this->getUserList(); // Builds our \"_userList\" variable. Throws.\n }\n\n // Now, we need to create a new, internal LazyJsonMapper data array for\n // our object. In undefined (unmapped) properties, you are ONLY allowed\n // to store basic data types. Not objects. So we will need to convert\n // all User objects to real array data. Otherwise OTHER calls would fail\n // due to invalid internal data when we try things like `printJson()`.\n $newObjectData = [];\n foreach ($this->_userList as $k => $v) {\n $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper\n ? $v->asArray() // Throws.\n : $v; // Is already a valid value.\n }\n\n // Now give the new object data to LazyJsonMapper, which ensures that it\n // contains all of the same values as our updated cache! This replaces\n // the ENTIRE internal JSON property storage, so be aware of that!\n $this->assignObjectData($newObjectData); // Throws.\n }", "private function setMockDataConfig() {\n\n }" ]
[ "0.60793173", "0.5932761", "0.5780503", "0.5667581", "0.55507135", "0.53787905", "0.52799207", "0.52761495", "0.52423286", "0.51911", "0.5186566", "0.51639855", "0.51566255", "0.5107348", "0.5036377", "0.5009124", "0.49543658", "0.4924125", "0.49021482", "0.4868126", "0.48569578", "0.4849285", "0.48486587", "0.48486468", "0.484132", "0.484132", "0.48230958", "0.48217958", "0.48193806", "0.48102668", "0.4793345", "0.47850698", "0.4777336", "0.47666517", "0.47584498", "0.47541896", "0.47366387", "0.47314423", "0.47033036", "0.47033036", "0.47033036", "0.47033036", "0.47033036", "0.4674573", "0.4674573", "0.4674573", "0.46618897", "0.46322346", "0.46292666", "0.46187946", "0.46161437", "0.46135813", "0.4607009", "0.4607009", "0.46069482", "0.46030825", "0.46006408", "0.45980522", "0.45953012", "0.45948043", "0.45916945", "0.45849395", "0.45689747", "0.45682055", "0.45597565", "0.45591772", "0.45387438", "0.45364997", "0.45209658", "0.45136437", "0.44981864", "0.44692034", "0.4468403", "0.4465742", "0.44605204", "0.44577032", "0.44559988", "0.44533533", "0.44494817", "0.44426474", "0.44424826", "0.44390655", "0.44366446", "0.44350523", "0.44227904", "0.4420666", "0.44197416", "0.44196597", "0.44144836", "0.44127697", "0.44117516", "0.44081798", "0.44037881", "0.4400939", "0.4400462", "0.43865138", "0.43813276", "0.43745044", "0.43616122", "0.43605334" ]
0.7506159
0
returns single line of address which number is $line
возвращает одну строку адреса, номер которой равен $line
public function getLine($line);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_line() { \n\t\t$line = $this->lines[$this->cursor]; \n\t\t$this->cursor++; return $line; \n\t}", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public function get_line()\n {\n return $this->line;\n }", "public function getLine($lineNumber);", "public function getLine(int $line){\n return $this->file[$line] ?? \"\";\n }", "static function getLine($file,$line){\n\t\tif($file){\n\t\t\t$f = file($file);\n\t\t\t$code = substr($f[$line-1],0,-1);\n\t\t\treturn preg_replace('@^\\s*@','',$code);\n\t\t}\n\t}", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine() {\n return $this->line;\n }", "public function getLine() {\n return $this->parse()['line'];\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine() {\n\t\treturn $this->line;\n\t}", "public function getLineNumber();", "public function getLineNumber();", "public function getLine()\n {\n return $this->get(self::_LINE);\n }", "public function getLine()\n\t{\n\t\treturn $this->line;\n\t}", "public function _getStreet(?string $street, $line)\n {\n $street = explode(\"\\n\", (string) $street);\n if ($line == 1) {\n return $street[0];\n }\n if (isset($street[$line - 1])) {\n return $street[$line - 1];\n } else {\n return '';\n }\n }", "public function getLine()\n {\n return $this->data[2];\n }", "private function getStreetLine(int $line, object $billingAddress)\n {\n $streetLine = null;\n if (is_a($billingAddress, AddressAdapterInterface::class)) {\n $adapterMethod = 'getStreetLine' . $line;\n $streetLine = method_exists($billingAddress, $adapterMethod) ? $billingAddress->$adapterMethod() : null;\n } elseif (is_a($billingAddress, OrderAddressInterface::class)) {\n $streetLine = $billingAddress->getStreetLine($line);\n }\n return $streetLine;\n }", "public function getLineRef()\n {\n return $this->lineRef;\n }", "public function getLineId()\n {\n return $this->line_id;\n }", "public function get_line( $file, $line ) {\n\t\tif ( empty( $this->spl ) ) {\n\t\t\t$this->spl = new \\SplFileObject( $file );\n\t\t}\n\n\t\tif ( ! $this->spl->eof() ) {\n\t\t\t$this->spl->seek( $line );\n\t\t\t$contents = $this->spl->current();\n\t\t}\n\n\t\treturn $contents;\n\t}", "public function getLine():int {\n\t\t\treturn $this->line;\n\t\t}", "function getLine(){\n return $this->line;\n }", "public function getLineNr()\n {\n return $this->lineNr;\n }", "public function getLine(int $lineno): ?string\n {\n $lines = $this->getLines();\n return $lines[$lineno] ?? null;\n }", "public function getLine(): int\n {\n return $this->node->start_lineno;\n }", "public function line($line, $log_errors = TRUE)\n\t{\n\t\treturn $this->__call('line', func_get_args());\n\t}", "public function getLineId(): int\n {\n return $this->lineId;\n }", "public function getOutputLine($lineNumber);", "protected function getLineHeader($line) {\n\t\treturn Billrun_Factory::db()->logCollection()->query(array('header.stamp' => $line['log_stamp']))->cursor()->current();\n\t}", "function get_line(&$format)\n{\n\tif (mb_strlen($format) === 0)\n\t\treturn false;\n\t\n\t$pos = mb_strpos($format, \"\\r\");\t\n\tif ($pos !== false)\n\t\t$format = mb_substr($format, 0, $pos) . mb_substr($format, $pos + 1);\n\t\n\t$pos = mb_strpos($format, \"\\n\");\n\t\n\tif ($pos === false)\n\t\t$pos = mb_strlen($format);\n\t\n\t$line = mb_substr($format, 0, $pos);\n\t$format = mb_substr($format, $pos + 1);\n\treturn $line;\n}", "private function getFileLine($file, $line)\n {\n if (!array_key_exists($file, $this->fileCache)) {\n $this->fileCache[$file] = file($file);\n }\n\n return trim($this->fileCache[$file][$line]);\n }", "public function getAddressLine1(): ?string;", "public function getLine()\n\t{\n\t\treturn $this->token->line;\n\t}", "public function getLine($lineId);", "public function getLine(int $index) : string\n {\n return isset($this->lines[$index]) ? $this->lines[$index] : '';\n }", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine() {\r\n return $this->node->getLine();\r\n }", "public static function readCodeLine(string $file, int $line): ?string\n {\n $lines = @file($file);\n return $lines[$line - 1] ?? null;\n }", "private function nextLine()\n\t{\n\t\treturn array_shift($this->buffer);\n\t}", "public function line($text) { return $this->l($text); }", "public function getAddressLine3(): ?string;", "public function getAddressLine2(): ?string;", "public function getLine(): int\n\t{\n\t\treturn $this->err->getLine();\n\t}", "public function getLine(): int;", "private function getNextLine()\n {\n return fgets($this->fileDescriptor, 4096);\n }", "final function getLine();", "final public function getLine()\n {\n return 25;\n }", "public function getLineNumber()\n\t{\n\t\treturn $this->lineNumber;\n\t}", "public function getLeaderLineOffset() {}", "public function getLinea()\n {\n return $this->linea;\n }", "function findAddress($lines) {\n //Finds address by searching for finding line with a zipcode, and then concatenating the previous line with that line. This is prone to errors, however, and is only used as an example for showing how the script would work. A better method would involve leveraging existing APIs, such as Google's GeoCoding API.\n for($i = 0; $i<count($lines); $i++) {\n if(preg_match('/[0-9]{5}/', $lines[$i])) {\n return [$lines[$i-2], $lines[$i]];\n }\n }\n return \"\";\n}", "protected function getPhoneLine($number)\n {\n\n if (isset($this->phoneLines[$number])) {\n\n return $this->phoneLines[$number];\n }\n\n $phoneLine = $this->phoneLineRepo->find($number);\n\n if (!$phoneLine) {\n $phoneLine = new PhoneLine();\n $phoneLine->setNumber($number);\n $this->eManager->persist($phoneLine);\n }\n\n $this->phoneLines[$number] = $phoneLine;\n\n return $phoneLine;\n }", "public function readAtLine($index) {\r\n\t\tif ($this->exists && $index < $this->lines) {\r\n\t\t\t\r\n\t\t\t$lines = $this->readByLine ();\r\n\t\t\treturn trim ( $lines [$index] );\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getFileLink(string $file, int $line) {\n if ($fmt = $this->fileLinkFormat) {\n return \\is_string($fmt) ? strtr($fmt,\n ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);\n }\n\n return FALSE;\n }", "public function getStartLine(): int\n {\n return $this->node->getStartLine();\n }", "function getLine()\n {\n if($this->parseFile)\n {\n if(!feof($this->fid))\n {\n do\n {\n $line = trim(fgets($this->fid));\n }\n while(!feof($this->fid) && !$line);\n return $line;\n }\n return FALSE;\n }\n else\n {\n do\n {\n $line = trim($this->bibtexString[$this->currentLine]);\n $this->currentLine++;\n }\n while($this->currentLine < count($this->bibtexString) && !$line);\n return $line;\n }\n }", "public function getCalloutLine() {}", "public function getFirstLine(): ?int {\n return $this->firstLine;\n }", "public function getStartLine(): int\n {\n return $this->node->getAttribute('startLine');\n }", "public function getLineInfo() {\n return $this->get(self::LINE_INFO);\n }", "public function readByLine() {\r\n\t\tif ($this->exists) {\r\n\t\t\t\r\n\t\t\t$lines = file ( $this->filename ); // file in to an array\r\n\t\t\treturn $lines; // line 2\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getLine1()\n {\n return (string) $this->json()->line1;\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function readLine(){\n\t\t\n\t\t$line = '';\n\t\tif( ($offset = strpos($this->data, \"\\r\\n\", 0)) !== false){\n\t\t $line = substr($this->data,0,$offset);\n\t\t $this->data = substr($this->data,$offset+2);\n\t\t $this->_debug(\"line:$line\");\n\t\t $this->_debug(\"left>\\n{$this->data}\");\n\t\t ob_flush();\n\t\t}\n\t\t\n\t\treturn $line;\n\t}", "function readLine($position)\n {\n\n return isset($this->line[$position]) ? $this->line[$position] : '_';\n }", "public function startOfLine($line) \n {\n return preg_replace_callback(pmwiki_attachments::regular_expression,array($this,'replace_callback'),$line);\n }", "public function getTaxLine($lineNo)\n\t{\n\t\tif($this->getTaxLines() != null)\n\t\t{\n\t\t\tforeach($this->getTaxLines() as $taxLine)\n\t\t\t{\n\t\t\t\tif($lineNo == $taxLine->getLineNo())\n\t\t\t\t{\n\t\t\t\t\treturn $taxLine;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "static public function match($line) {\n\t\tpreg_match(self::MATCH, $line['source'], $matches);\n\t\treturn $matches;\n\t}", "function loadLine($a_row)\n\t{\n\t}", "public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}", "public function getLineaId($id){\n\t\t\t$this->db->query(\"SELECT * FROM linea WHERE cod_linea=:id\");\n\n\t\t\t$this->db->bind(':id', $id);\n\n\t\t\treturn $this->db->single();\n\t\t}", "public function setLine($var)\n {\n GPBUtil::checkInt32($var);\n $this->line = $var;\n\n return $this;\n }", "public function getLineNumber(){\n if( $this->index ){\n return substr_count($this->input, \"\\n\", 0, $this->index) + 1;\n }\n return 1;\n }", "public function getLineItemId()\n {\n return $this->lineItemId;\n }", "public function getLine(): ?int;", "public function getOriginalLineNo(): int\n {\n return intval($this->originalLineNo);\n }", "protected function _getItemIdByLine($line)\n {\n return isset($this->_productGiftPair[$line->getLineCode()])\n ? $this->_productGiftPair[$line->getLineCode()]\n : $this->_lineToLineId[$line->getLineCode()];\n }", "public function getNewLineNo(): int\n {\n return intval($this->newLineNo);\n }", "public function currentLine();", "public function getLineName(): string\n {\n return $this->lineName;\n }", "function line($line = '')\n\t{\n\t\treturn ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];\n\t}", "public function getStartLine()\n\t{\n\t\treturn $this->startLine;\n\t}", "public function getLineA();", "public function startPositionFromCenter(int $line): int\n {\n\n $start = $line - $this->getHalf();\n\n return $start < 1 ? 1 : $start;\n\n }", "public function getLine4()\n {\n return (string) $this->json()->line4;\n }" ]
[ "0.7337679", "0.7311519", "0.72788274", "0.7116505", "0.7087814", "0.69932336", "0.6954411", "0.6954411", "0.6944314", "0.6925979", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.68622935", "0.68578994", "0.68578994", "0.6829066", "0.6823132", "0.67263347", "0.6721415", "0.6659305", "0.6639396", "0.662742", "0.6598089", "0.6594455", "0.6593749", "0.65365815", "0.6530898", "0.6525464", "0.6462063", "0.6411824", "0.639964", "0.6367391", "0.6303344", "0.6295905", "0.6295188", "0.6263042", "0.6257373", "0.6222733", "0.61969256", "0.61969256", "0.61969256", "0.61969256", "0.6192461", "0.6129781", "0.6126122", "0.6120281", "0.61005545", "0.6099472", "0.6093897", "0.6032364", "0.60120153", "0.59802234", "0.5978858", "0.59470904", "0.59239864", "0.5922971", "0.58741295", "0.5867389", "0.5834073", "0.58229566", "0.58229566", "0.5819562", "0.58133566", "0.580109", "0.5787649", "0.5785021", "0.57744473", "0.57618284", "0.5733864", "0.5710518", "0.5704026", "0.5704026", "0.5704026", "0.5704026", "0.56803775", "0.56750655", "0.56739783", "0.56689626", "0.5667961", "0.566393", "0.5629735", "0.56270033", "0.5616717", "0.5604772", "0.5590936", "0.5571391", "0.5557148", "0.5547324", "0.5531795", "0.5522015", "0.55121326", "0.55114543", "0.54957324", "0.549203", "0.5467374", "0.54629296" ]
0.7488274
0
returns total number of lines that this IAddress may represent.
возвращает общее количество строк, которые может представлять этот IAddress.
public function getLinesCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function numLines() {\r\n\t\treturn $this->lines;\r\n\t}", "protected function get_line_len()\n {\n return count($this->buffer);\n }", "public function getLineCount() {}", "public function numLines()\n {\n if($this->state['numlines']) {\n return $this->state['numlines'];\n } else {\n $numRows = self::numRowsInFile($this->vars['ifn']);\n if($numRows < 100){\n $numRows = self::numRowsInFileAccurate($this->vars['ifn'],$this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $this->state['numlines'] = $numRows;\n return $this->state['numlines'];\n }\n }", "public function countLines()\n {\n\n return count($this->file_array);\n }", "public function getLineInfoListCount() {\n return $this->count(self::LINE_INFO_LIST);\n }", "public function countLines();", "public function getAmountReadLines(): int {\n\t\treturn $this->_amountReadLines;\n\t}", "public function countLines()\n {\n return count(explode(PHP_EOL, $this->text));\n }", "public function getAmountProcessedLines(): int {\n\t\treturn $this->_amountProcessedLines;\n\t}", "abstract public function getNumExecutableLines();", "protected function _getNewLineCode()\n {\n return count($this->_lines) + 1;\n }", "public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }", "public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }", "public function getNbAddresses()\n\t{\n\t\tif ( $this->nb_addresses === null ) {\n\t\t\t$this->nb_addresses = gmp_strval(gmp_pow(2, $this->getMaxPrefix() - $this->prefix));\n\t\t}\n\t\treturn $this->nb_addresses;\n\t}", "public function getNumberOfEffectiveCodeLines()\n {\n return $this->numberOfEffectiveCodeLines;\n }", "public function getLongestLineNumberLength(): int\n {\n return 0;\n }", "public function getTotalBuslineNum() {\n return $this->get(self::TOTAL_BUSLINE_NUM);\n }", "public function CountAddresses() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\treturn 0;\n\n\t\t\treturn Address::CountByPersonId($this->intId);\n\t\t}", "function nbLine($req) {\r\n $crs = $this->query($req) ;\r\n return count($crs->fetchAll()) ;\r\n }", "public function countUsed() {\n\n $result = Db::getInstance(_EPH_USE_SQL_SLAVE_)->getValue(\n (new DbQuery())\n ->select('COUNT(*)')\n ->from('address')\n ->where('`' . bqSQL(static::$definition['primary']) . '` = ' . (int) $this->id)\n );\n\n return $result;\n }", "abstract public function getNumExecutedLines();", "public function getLinesToCache()\n {\n $value = $this->_config->get('dataprocessing/general/cache_lines');\n\n if ($value === null) {\n $value = 200;\n }\n\n return (int)$value;\n }", "public function import_get_nb_of_lines($file)\n\t{\n // phpcs:enable\n return dol_count_nb_of_line($file);\n }", "public function getLineNumber(){\n if( $this->index ){\n return substr_count($this->input, \"\\n\", 0, $this->index) + 1;\n }\n return 1;\n }", "abstract protected function getLineLength(): int;", "public function getTotalLines() {\n\t\t\n\t\tif(filesize($this->logFilename) < $this->chunkSize) {\n\t\t\t$data = file($this->logFilename); \n\t\t\treturn count($data); \n\t\t}\n\t\t\n\t\tif(!$fp = fopen($this->logFilename, \"r\")) return 0;\n\t\t$totalLines = 0;\n\n\t\twhile(!feof($fp)) { \n\t\t\t$data = fread($fp, $this->chunkSize);\n\t\t\t$totalLines += substr_count($data, \"\\n\"); \n\t\t}\n\t\t\n\t\tfclose($fp); \n\t\t\n\t\treturn $totalLines;\n\t}", "public function count() {\n \n return $this->getLength();\n }", "public function getTotal(): int\n {\n if (isset($this->contents)) {\n return count($this->contents);\n }\n\n return 0;\n }", "public function hasLines(){\n return $this->_has(38);\n }", "public function count() {\n\t\treturn $this->length();\n\t}", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function length() {\n return $this->count();\n }", "public function length(){\n return sizeof($this->flights);\n }", "public function length() {\r\n return strlen($this->contents);\r\n }", "public function length()\n {\n return $this->count();\n }", "public function count()\n {\n return $this->length();\n }", "public function count() {\n return $this->length;\n }", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "public function getTotalLength() {}", "public function getTotalLength() {}", "public function total_rsegments()\n\t{\n\t\treturn count($this->rsegments);\n\t}", "public function count()\n {\n return $this->length;\n }", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function getNumberOfEntries()\n {\n return $this->numberOfEntries;\n }", "public function count()\n\t{\n\t\tif( $this->isDynamic )\n\t\t\tmwarning('unsupported with Dynamic Address Groups');\n\t\treturn count($this->members);\n\t}", "public function length()\n {\n return count($this->__data);\n }", "public function getLength() : int\n {\n return $this->b[$this->offset];\n }", "public function total_notes()\n {\n $count = 0;\n\n foreach($this->sites as $site)\n $count = $count + $site->notes->count();\n\n return $count;\n }", "public function count()\n {\n return $this->length();\n }", "function CellCount() {\n return $this->rows[$this->LastRow]->CellCount();\n }", "function amount() {\n\t\treturn sizeof($this->data);\n\t}", "public function size() {\n return n(count($this->value()));\n }", "public function size()\n {\n return sizeof($this->errorList);\n }", "function countAddedLines()\n {\n }", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function getTotalLength();", "public function getTotalLength();", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count()\n {\n return $this->length;\n }", "public function lcs() {\n $lcs = 0;\n foreach ($this->edits as $edit) {\n if ($edit->type == 'copy') {\n $lcs += sizeof($edit->orig);\n }\n }\n return $lcs;\n }", "public function count(): int\n {\n return $this->blocks->count();\n }", "public function getLineNr()\n {\n return $this->lineNr;\n }", "public static function linesCount($path)\n\t{\n\t\t$lines = 0;\n\t\tif (stripos(php_uname(), 'windows') !== false) {\n\t\t\t$handle = fopen($path, 'rb');\n\t\t\twhile (!feof($handle)) {\n\t\t\t\t$lines += substr_count(fread($handle, 8192), \"\\n\");\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t} else {\n\t\t\t$lines = intval(exec(\"wc -l '$path'\"));\n\t\t}\n\t\treturn $lines;\n\t}", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "public function getLongestLineLength(): int\n {\n return 0;\n }", "public function getMaximumLineLength() {}", "public function size() \n {\n return count($this->_entries);\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "function length() {\r\n return $this->count();\r\n }", "public function count()\n {\n return sizeof($this->getData());\n }", "function spectra_address_count ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT COUNT(*) AS `found` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"` WHERE 1\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"found\"]) || $result[\"found\"] == 0)\n\t\t{\n\t\t\treturn \"Unknown\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"found\"];\n\t\t}\n\t}", "public function count() {\n\t \treturn sizeof($this->links);\n\t}", "public function recordCount()\n {\n return sizeof($this->getRecords());\n }", "function ozh_wbsu_get_number_of_lines($file_to_read) {\n $file = new \\SplFileObject($file_to_read, 'r');\n $file->seek(PHP_INT_MAX);\n return ($file->key() + 1);\n}", "public function count() {\n return count($this->__rows__);\n }", "public function getContentsCount() {\n return $this->count(self::CONTENTS);\n }", "public function count()\n\t\t{\n\t\t\treturn count($this->source);\n\t\t}", "public function count() : int\n {\n return count($this->entries);\n }", "public function getLineTotalAmount()\n {\n return $this->lineTotalAmount;\n }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function count()\n {\n return $this->__size;\n }", "public function length()\n\t{\n\t\treturn count($this->parts);\n\t}", "protected static function get_model_lines(){\n\n\t\treturn count(file(static::$models_dir.'/'.static::$table.EXT));\n\t}", "public function getMaxLineLength()\n {\n return $this->maxLineLength;\n }", "public function getCabinetCountAttribute()\n {\n return $this->cabinets->count();\n }", "public function hasLineNumber(){\n return $this->_has(4);\n }", "public function len()\n {\n return count($this->list);\n }", "public function size(): int {\n\t\treturn $this->count();\n\t}", "public function getRowCount() {\n return $this->Read->rowCount();\n }", "public function getInvalidRowsCount()\n {\n return count($this->_invalidRows);\n }", "public function count()\n {\n return count($this->entries);\n }", "public function count()\n {\n return count($this->rules);\n }", "public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }" ]
[ "0.7453195", "0.7152699", "0.7110588", "0.69877267", "0.68574244", "0.6773752", "0.67736185", "0.6763348", "0.6701279", "0.6659539", "0.6548277", "0.6416865", "0.6284988", "0.62838316", "0.6273335", "0.6235725", "0.6219744", "0.6163236", "0.615204", "0.61324376", "0.60941696", "0.59905636", "0.59790707", "0.59705126", "0.5952018", "0.5943612", "0.5906059", "0.5903941", "0.5894316", "0.58601767", "0.58506936", "0.5822302", "0.58148223", "0.5802907", "0.5796179", "0.57920384", "0.5785464", "0.5782691", "0.5752422", "0.5745439", "0.5745196", "0.574487", "0.574426", "0.5743296", "0.57405496", "0.573749", "0.5736019", "0.57275033", "0.57232153", "0.5711732", "0.57047373", "0.5684319", "0.568355", "0.56818384", "0.56786436", "0.56705475", "0.56696355", "0.56696355", "0.5661855", "0.5661855", "0.5661855", "0.5649104", "0.5648021", "0.5645794", "0.5636427", "0.56334364", "0.56313664", "0.56313664", "0.56313664", "0.5617373", "0.56115496", "0.5609788", "0.5606588", "0.5605979", "0.5605979", "0.56010485", "0.5600776", "0.5585715", "0.5578398", "0.5577985", "0.55716807", "0.55715567", "0.5570786", "0.557069", "0.55627054", "0.55511945", "0.55419344", "0.553377", "0.55290556", "0.552448", "0.55236185", "0.55226415", "0.5511748", "0.5499001", "0.5494473", "0.5489256", "0.5485745", "0.5478005", "0.5475816", "0.5469636" ]
0.7358888
1
returns postcode of the address.
возвращает почтовый код адреса.
public function getPostcode();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function getPostcode(): string\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public static function addressPostalCode()\n {\n return new TextNode('address_postal_code');\n }", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function getPostalcode();", "public function getPostCode() {\n return $this->postcode;\n }", "public function getPostalCode();", "public function getPostalCode();", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "abstract public function postalCode();", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostCode() {\n\t\treturn self::$_postCode;\n\t}", "public function getBillingPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function getCodpostal()\r\n {\r\n return $this->codpostal;\r\n }", "public function getShippingPostcode()\n {\n return $this->getParameter('shippingPostcode');\n }", "public function getCodepostaltierce()\n {\n return $this->codepostaltierce;\n }", "public function getStreetNumber();", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function address(): string\n {\n return $this->address;\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "protected function getShippingPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? $this->checkoutSession->getLastRealOrder()->getShippingAddress()->getPostcode() : null;\n }", "public function getAddressByPostCode(string $postCode): array {\n if (!preg_match('/^\\d{3}-?\\d{4}$/', $postCode))\n return '';\n $postCode = str_replace('-', '', $postCode);\n $addresses = json_decode(file_get_contents(X_APP_PATH . 'Data/address.json'), true);\n if (!isset($addresses[$postCode]))\n return '';\n return [\n 'prefectureCode' => $addresses[$postCode][0],\n 'address' => implode(' ', array_slice($addresses[$postCode], 1))\n ];\n }", "public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getPostcodePart($part = IAddress::POSTCODE_PART_ONE);", "public function getCodigo_postal()\n {\n return $this->codigo_postal;\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getPostalCode(): ?string;", "function address() { return ($this->address); }", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode() : ?string \n {\n if ( ! $this->hasPostalCode()) {\n $this->setPostalCode($this->getDefaultPostalCode());\n }\n return $this->postalCode;\n }", "function postcode_to_district ($postcode) {\n\n\t\t$reg = array();\n\t\t$postcode = trim($postcode);\n\t\tpreg_match('/^(.+?)([0-9][a-z]{2})$/',$postcode, $reg);\n\t\n\t\t$clean_postcode = trim($reg[1]);\n\t\t$clean_postcode = strtoupper($clean_postcode);\n\n\t\treturn $clean_postcode;\n\n\t}", "function postCode($string) {\n\n\n\t\t}", "public function get_postal()\n {\n return $this->_postal;\n }", "function get_postcode_location($zip, $country){\n\n\t\t$url = \"http://geo.localsearchmaps.com/?zip={zip}&country={country}\";\n\t\t$url = str_replace('{zip}', urlencode($zip), $url);\n\t\t$url = str_replace('{country}', urlencode($country), $url);\n\t\t\n\t\t$data = safe_scrape_cached($url);\n\t\t\n\t\treturn process_emag_geocoder($data);\n\t}", "public function getEmpCodePostal() {\n return $this->empCodePostal;\n }", "public function getAddress();", "public function getAddress();", "public function getAddress() {}", "public function getPostcodeAnywhereId();", "public function getAddress()\n {\n return $this->get('address')->value;\n }", "public function getAddressId() \n {\n return $this->address_id;\n }", "public function getAddress(){\r\n\t\treturn $this->address;\r\n\t}", "public function getAddress()\r\n {\r\n return $this->address;\r\n }", "static function get_address($code){\n \t$address = DB::table('es_mx')\n\t\t ->select('id','colony','state','town','country','code','postal_code')\n ->where('postal_code','=',$code)->get()->toArray();\n\n\t return $address;\n }", "public function getAddress()\n {\n \treturn $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function zipCode(): string\n {\n return $this->getData('ZipCode');\n }", "public function getAddress() {\n //return the value address\n return $this->Address;\n }", "public function getAddressName()\n {\n return $this->_addressName;\n }", "public function getEtblCodePostal() {\n return $this->etblCodePostal;\n }", "public function getAddress() {\n return $this->address;\n }", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "function getFieldPortalAddressPostCode($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_postcode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_postcode');\n\t\t$tooltip = setToolTipNotification(\"postcode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('postcode') === 'postcode' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><input type='text' name='postcode' value='\".$value.\"' id='postcode' class='srms-field \".(get_axl_req_fields('postcode') === 'postcode' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function geocode(Address $address);", "public function getCodePostal():?int\n {\n return $this->codePostal;\n }", "public function getAddress() {\n\n return $this->address;\n\n }" ]
[ "0.80491596", "0.76735604", "0.7664224", "0.7664224", "0.7664224", "0.7544685", "0.75357187", "0.75156426", "0.74146473", "0.74019563", "0.74019563", "0.7268599", "0.7217776", "0.71228445", "0.7110134", "0.70700324", "0.70671916", "0.70545393", "0.69945693", "0.69760925", "0.6974993", "0.6974993", "0.6974993", "0.6974993", "0.6840118", "0.67593324", "0.67350656", "0.658703", "0.657781", "0.6567692", "0.654436", "0.6526148", "0.6458512", "0.6446998", "0.64109665", "0.64047736", "0.64024436", "0.6401255", "0.63943374", "0.6381299", "0.63765925", "0.63595456", "0.6341863", "0.63207555", "0.632075", "0.632075", "0.6257455", "0.62428004", "0.62219656", "0.6217888", "0.618829", "0.6182754", "0.61804444", "0.61804444", "0.6154235", "0.6149354", "0.6144196", "0.61258495", "0.6120971", "0.6112462", "0.61113584", "0.6095029", "0.6080635", "0.6079999", "0.6079999", "0.60787183", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.60700613", "0.60366136", "0.6030284", "0.60283816", "0.6023313", "0.60178554", "0.60178554", "0.6005974", "0.59993446", "0.5947047", "0.5945946" ]
0.7741459
1
returns one part of the postcode. Most commonly first part of postcode may be used independently. Also may be used to retrieve a second part.
возвращает одну часть почтового индекса. Чаще всего первую часть почтового индекса можно использовать независимо. Также её можно использовать для получения второй части.
public function getPostcodePart($part = IAddress::POSTCODE_PART_ONE);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPostcode();", "function ExtractMatchString( $Postcode )\n{\n\t$SpacePos = strpos( $Postcode, \" \" );\n\tif( $SpacePos )\n\t{\n\t\tif( substr( $Postcode, $SpacePos + 1, 1) == \" \" )\n\t\t{\n\t\t\treturn substr( $Postcode, 0, $SpacePos + 1 ) . substr( $Postcode, $SpacePos + 2\t, 1 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn substr( $Postcode, 0, $SpacePos + 2 );\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn substr( $Postcode, 0, 4 ) . \" \".substr( $Postcode, 4\t, 1 );\n\t\t#return false;\n\t}\n}", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function getPostcode(): string\n {\n return $this->postcode;\n }", "public function getPostCode() {\n return $this->postcode;\n }", "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function get($postcode);", "public function getPostalcode();", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getCodepostaltierce()\n {\n return $this->codepostaltierce;\n }", "public function getPostalCode();", "public function getPostalCode();", "public function getPostcodeAnywhereId();", "public function getPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "public function getPostalCode(): ?string;", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "abstract public function postalCode();", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "function mapit_get_location($postcode, $partial = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_location', $params);\n return $result;\n}", "public function getCodpostal()\r\n {\r\n return $this->codpostal;\r\n }", "public function getPostCode() {\n\t\treturn self::$_postCode;\n\t}", "public function getAddressByPostCode(string $postCode): array {\n if (!preg_match('/^\\d{3}-?\\d{4}$/', $postCode))\n return '';\n $postCode = str_replace('-', '', $postCode);\n $addresses = json_decode(file_get_contents(X_APP_PATH . 'Data/address.json'), true);\n if (!isset($addresses[$postCode]))\n return '';\n return [\n 'prefectureCode' => $addresses[$postCode][0],\n 'address' => implode(' ', array_slice($addresses[$postCode], 1))\n ];\n }", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "public function findByPostcode(int $postcode): ?ProvinceContract;", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getPostalCodesPart2($postal_code) {\r\n\t\t$codes = $this->StreetAddress->getPostalCodesPart2($postal_code);\r\n\t\t$return = array();\r\n\t\tforeach ($codes as $code) {\r\n\t\t\t$return[] = $code['StreetAddress']['postal_code2'];\r\n\t\t}\r\n\t\t$this->set('codes', $return);\r\n\t\t$this->set('_serialize', array('codes'));\r\n\t}", "public function first()\n {\n if ($this->getNumParts() < 1) {\n return null;\n }\n\n return $this->identifierParts[0];\n }", "public function getDepartement(){\n return substr($this->zipcode,0,2);\n }", "public function getPlate1()\n {\n return isset($this->plate1) ? $this->plate1 : null;\n }", "function get_pre($string, $offset = false) {\r\n\t\tif($offset === false) {\r\n\t\t\t$offset = strlen($string);\r\n\t\t}\r\n\t\t$pre_code = substr($string, 0, $offset);\r\n\t\t$ancestryArray = OM::getAncestryArray($pre_code, strlen($pre_code));\r\n\t\tif(sizeof($ancestryArray) > 0) {\r\n\t\t\t//print('here834954950<br>');\r\n\t\t\t$pre = substr($pre_code, 0, $ancestryArray[sizeof($ancestryArray) - 1][2] + strlen($ancestryArray[sizeof($ancestryArray) - 1][1]));\r\n\t\t\treturn $pre;\r\n\t\t} else {\r\n\t\t\t//print('here834954951<br>');\r\n\t\t\t// get the code up to the first tag\r\n\t\t\tpreg_match('/(.*?)<\\w/is', $string, $pre_first_tag_matches);\r\n\t\t\t$pre_first_tag = $pre_first_tag_matches[1];\r\n\t\t\treturn $pre_first_tag;\r\n\t\t\t//return \"\";\r\n\t\t}\r\n\t}", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getStreet1(): ?string\n {\n return $this->_street1;\n }", "private function retrieve_pt_single() {\n\t\t$replacement = null;\n\n\t\t$name = $this->determine_pt_names( 'single' );\n\t\tif ( isset( $name ) && $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getBillingPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "function get_first_paragraph($_id_post){\n\t\n\t$post = get_post($_id_post);\n\n\t$text = $post->post_content;\n\n\t$start = strpos($text, '<p>'); // Locate the first paragraph tag\n\t$end = strpos($text, '</p>', $start); // Locate the first paragraph closing tag\n\t$text = substr($text, $start, $end-$start+4); // Trim off everything after the closing paragraph tag\n\t$text = strip_shortcodes( $text ); // Remove shortcodes\n\t$text = apply_filters('the_content', $text); // remove tag html by wp\n\t$text = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $text);\t // Remove tag script\n\t$text = wpautop( $text );\t// Remove break\n\t$text = strip_tags($text);\t// Remove tags html\n\n\treturn $text ;\n\t \n}", "public function getShippingPostcode()\n {\n return $this->getParameter('shippingPostcode');\n }", "public function getPlate1CountryDesc()\n {\n return isset($this->plate1CountryDesc) ? $this->plate1CountryDesc : null;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function get_postal()\n {\n return $this->_postal;\n }", "public function getAddressLine1(): ?string;", "public function getEmpCodePostal() {\n return $this->empCodePostal;\n }", "function get_postcode_location($zip, $country){\n\n\t\t$url = \"http://geo.localsearchmaps.com/?zip={zip}&country={country}\";\n\t\t$url = str_replace('{zip}', urlencode($zip), $url);\n\t\t$url = str_replace('{country}', urlencode($country), $url);\n\t\t\n\t\t$data = safe_scrape_cached($url);\n\t\t\n\t\treturn process_emag_geocoder($data);\n\t}", "function map_postalcode($postalcode)\r\n\t{\r\n\t\t// query postalcode DB\r\n\t\t$sql = '\r\n\t\t\tSELECT PostalCode, Latitude, Longitude\r\n\t\t\tFROM canada_codes\r\n\t\t\tWHERE PostalCode LIKE \"'.$this->db->escape_like_str($postalcode).'%\"\r\n\t\t\tLIMIT 1';\r\n\r\n\t\t//TODO error handle where no results are returned\r\n\r\n $sql_query = $this->db->query($sql);\r\n\t\tif($sql_query->num_rows() > 0){\r\n\r\n foreach($sql_query->result_array() as $row){\r\n\t\t\t\t$data[] = $row;\r\n }\r\n\r\n\r\n return $data;\r\n\r\n }else{\r\n return \"No results found\";\r\n }\r\n\r\n\t}", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function part($offset)\n {\n if (! isset($this->identifierParts[$offset])) {\n return null;\n }\n\n return $this->identifierParts[$offset];\n }", "function postcode_to_district ($postcode) {\n\n\t\t$reg = array();\n\t\t$postcode = trim($postcode);\n\t\tpreg_match('/^(.+?)([0-9][a-z]{2})$/',$postcode, $reg);\n\t\n\t\t$clean_postcode = trim($reg[1]);\n\t\t$clean_postcode = strtoupper($clean_postcode);\n\n\t\treturn $clean_postcode;\n\n\t}", "public static function getMainPart(){\n return (isset(self::$gets [self::KEY_MAIN]))?\n self::$gets [self::KEY_MAIN] : '';\n }", "public function getAddress1()\n {\n return $this->getValue('nb_icontact_prospect_address_1');\n }", "public function getDynamicOrigin($postcode, $storeId = null)\n {\n\treturn Mage::getSingleton('temando/warehouse')->getCollection()->getOriginByPostcode($postcode, $storeId);\n }", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "public function getAddressLine3(): ?string;", "public function getCodeArticle1() {\n return $this->codeArticle1;\n }", "public function extract(): ?string\n {\n $this->assertShortCodesAreProvided();\n\n foreach ($this->extractors() as $extractor) {\n if ($extractor->hasMatch()) {\n return $extractor->extract();\n }\n }\n\n return null;\n }", "public function getAddressLine2(): ?string;", "public function getFirstParagraph()\n {\n return substr(\n $this->markdown_description,\n strpos(\n $this->markdown_description,\n \"<p\"\n ),\n strpos(\n $this->markdown_description,\n \"</p>\"\n )+4\n );\n\n }", "public function getStreetNumber();", "public function getExcerpt($nb = NULL)\n {\n if ($this->getResume() != NULL) return $this->getResume();\n \n $text = $this->getTexte();\n $excerpt = substr($text, 0, $nb);\n $excerpt = substr($excerpt, 0, strrpos($excerpt, \" \"));\n $etc = \"...\";\n $excerpt = $excerpt.$etc;\n return $excerpt;\n }", "function postalCode($postcode)\n {\n return (bool)preg_match('/^(H-)?\\d{4}$/', $postcode);\n }", "function getTelefone($fone){\n\t$telefone = substr($fone, 2);\n\treturn $telefone;\n}", "public function getPart($name)\n {\n if (array_key_exists($name, $this->parts)) {\n return $this->parts[$name];\n }\n }", "public static function get_first_snippet( int $post_id ) {\n\n\t\t$snippets = self::get_snippets( $post_id );\n\t\t$snippets = array_values( $snippets );\n\n\t\tif ( isset( $snippets[0] ) ) {\n\t\t\treturn $snippets[0];\n\t\t}\n\n\t\treturn new Rich_Snippet();\n\t}", "public function getAddress1()\n {\n return parent::getValue('address1');\n }", "public function getCodpostal0()\n {\n return $this->hasOne(Codpostal::className(), ['codpostal' => 'codpostal']);\n }", "private function get($part)\n {\n return $this->parts[$part];\n }", "public function first(): string;", "public function getPostNumber() :string\n {\n return $this->postNumber;\n }", "private function getPostcodeFromDB($postcode)\n {\n return $this->getDoctrine()\n ->getRepository('AppBundle:Postcode')\n ->findOneBy(['postcode' => $this->removeWhiteSpaceFromPostcode($postcode)]);\n }", "protected function getShippingPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? $this->checkoutSession->getLastRealOrder()->getShippingAddress()->getPostcode() : null;\n }", "public function getPlate1Country()\n {\n return isset($this->plate1Country) ? $this->plate1Country : null;\n }", "public function getZipCode($vzipcode) {\n\n $this->db->select('id, street, complement, district, city, state');\n $this->db->from('state_sp');\n $this->db->where('postalcode =', $vzipcode);\n $query = $this->db->get();\n\n if ($query->result()) {\n $row = $query->result()[0];\n } else {\n $row = FALSE;\n }\n\n /* print \"<pre>\";\n print_r($row);\n print \"</pre>\";\n exit(); */\n //\n return $row;\n }", "public function getCittaPartenza() {\n if (isset($_REQUEST['citta_partenza'])) {\n return $_REQUEST['citta_partenza'];\n } else\n return 0;\n }", "public function getStreetAddress1()\n {\n return $this->street_address_1;\n }", "public function getLatLngForPostcode($postCode) {\n $data = array(\n 'lat' => '',\n 'lng' => '',\n );\n $commonModel = new CommonHelper();\n $latlngResponse = $commonModel->getLatLngFromPostCode($postCode);\n if ($latlngResponse['status']) {\n $data['lat'] = $latlngResponse['data']['lat'];\n $data['lng'] = $latlngResponse['data']['lng'];\n }\n return $data;\n }", "protected function getContentPartNumber(): string\n {\n $partNumber = $this->getPartNumber();\n if (0 === \\count($this->getParts())) {\n $partNumber .= '.1';\n }\n\n return $partNumber;\n }", "public function getFirstLetter()\n {\n return $this->data['fields']['first_letter'];\n }", "public function getLatLngFromPostCode($postCode) {\n $response = array(\n 'status' => false,\n 'message' => '',\n 'data' => array(\n 'lat' => '',\n 'lng' => ''\n )\n );\n try {\n $client = new Client();\n $res = $client->request('GET', 'http://api.postcodes.io/postcodes/'.$postCode);\n if($res->getStatusCode() == '200') {\n $responseBody = json_decode($res->getBody(), true);\n if (isset($responseBody['result'])\n && isset($responseBody['result']['latitude'])) {\n $response['data']['lat'] = $responseBody['result']['latitude'];\n $response['data']['lng'] = $responseBody['result']['longitude'];\n $response['status'] = true;\n }\n } else {\n $response['message'] = $responseBody['error'];\n }\n } catch (Exception $ex) {\n $response['message'] = $ex->getMessage();\n self::event($ex->getMessage() . \"|\" . $ex->getLine(), self::POSTCODEAPI_LOG_FILE, self::DAILY);\n }\n return $response;\n }", "function tep_get_prid($uprid) {\n $pieces = explode('{', $uprid);\n\n return $pieces[0];\n }", "public function getAddressByZipCode($zip_code)\r\n\t{\r\n\t\t//echo \"Obtener direccion a partir del CP Model\"; exit;\r\n\r\n\t\t$sql = new Sql($this->dbAdapter);\r\n\t\t$select = $sql->select();\r\n\t\t$select->from(array('n' => 'neighborhood'));\r\n\t\t$select->columns(array('id_neighborhood' => 'id','colony','postal_code', 'district_id', 'state_id'));\r\n\t\r\n\t\t//$select->join(array('i_u'=>'users_details'),'users.id = i_u.id_user',array('id_user','name','surname', 'campus', 'phone', 'addres','image','pin','key_inventory'), 'Left');\r\n\t\t\r\n\t\t$select->where(array('n.postal_code' => $zip_code ));\r\n\r\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result=$execute->toArray(); \r\n\r\n\t\t//echo \"<pre>\";print_r($result);exit;\r\n\t\treturn $result;\r\n\t}", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "function getLongLat($postcode){\n\t//This function first checks the postcodesdetailed table for the long/lat\n\t//If not found, uses the Google Geocoding API to calculate and updates the postcodesdetailed table\n\t$db = new DB;\n\t//$postcode = \"DY5 2UA\";\n\t$object = new stdClass();\n\t\n\t$postcode = trim($postcode);\n\t//Check to see if postcode exists in postcodesdetailed table\n\t$postcode_a = strtoupper(str_replace(\" \",\"\",$postcode));\n\t$postcode_a = addslashes($postcode_a);\n\t$db->query(\"SELECT pdLat, pdLong FROM postcodesdetailed WHERE pdPostcode = '$postcode_a'\");\n\t$db->next_record();\n\tlist ($pdLat, $pdLong) = $db->Record;\n\t\n\tif (($pdLat != '') && ($pdLong != '')){\n\t\t$object->long = $pdLong;\n\t\t$object->lat = $pdLat;\n\t\t$object->status = \"OK\"; //Should return 'OK' if everything fine\n\t} else {\n\t\t\n\t\t$address = str_replace(\" \", \"+\", $postcode);\n\t\t$url = \"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=UK\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$response_a = json_decode($response);\t\n\t\t\n\t\t$object->long = $response_a->results[0]->geometry->location->lng;\n\t\t$object->lat = $response_a->results[0]->geometry->location->lat;\n\t\t$object->status = $response_a->status; //Should return 'OK' if everything fine\n\t\t\n\t\t//If Long & Lat, INSERT into postcodesdetailed table so that next time we won't need to use the Google API\n\t\tif ($response_a->status == 'OK'){\n\t\t\t$db->query(\"INSERT INTO postcodesdetailed SET pdPostcode='\".$postcode_a.\"', pdLat='\".$object->lat.\"', pdLong='\".$object->long.\"'\");\n\t\t}\n\t}\n\t\n\t/* Status codes\n\t\t- \"OK\" - No Errors.\n\t\t- \"ZERO_RESULTS\" - successful but returned no results. Invalid address or a latlng in a remote location.\n\t\t- \"OVER_QUERY_LIMIT\" - indicates that you are over your quota.\n\t\t- \"REQUEST_DENIED\" - request was denied, generally because of lack of a sensor parameter.\n\t\t- \"INVALID_REQUEST\" - indicates that the query (address or latlng) is missing.\n\t\t- UNKNOWN_ERROR - request could not be processed due to a server error. The request may succeed if you try again.\n\t*/\n\t//var_dump($response_a);\n\treturn $object;\n}", "function getFieldStreetAddressPostCode($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_spostcode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_spostcode');\n\t\t$tooltip = setToolTipNotification(\"spostcode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('spostcode') === 'spostcode' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='spostcode' id='spostcode' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('spostcode') === 'spostcode' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "private function getPartInstanceFromBarcode($barcode, $bl, &$errorBL = \"\")\n\t{\n\t\t$pi = null;\n\t\t$isNonSerialised = false;\n\t\t$isSerialised = false;\n\n\t\ttry {\n\t\t\t$isNonSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_TYPE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\ttry {\n\t\t\t$isSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_INSTANCE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\t//if BP\n\t\tif($isNonSerialised)\n\t\t{\n\t\t\t//check for BL\n\t\t\tif($bl==='')\n\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\n\t\t\tif(!$errorBL)\n\t\t\t{\n\t\t\t\tif($bl>\"\")\n\t\t\t\t{\n\t\t\t\t\t$warehouse = Factory::service('Warehouse')->getWarehouseByLocationBarcode($bl);\n\t\t\t\t\tif(!$warehouse instanceof Warehouse)\n\t\t\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\t\t\t\t}\n\n\t\t\t\t//get PartInstance based on BL\n\t\t\t\t$pis = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, $warehouse, false, true);\n\t\t\t\tforeach ($pis as $pi)\n\t\t\t\t{\n\t\t\t\t\t//only un-reserved parts\n\t\t\t\t\tif (!$pi->getFacilityRequest() instanceof FacilityRequest)\n\t\t\t\t\t\treturn $pi;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($isSerialised)\n\t\t{\n\t\t\t$pi = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, null, false, true);\n\t\t\tif($pi && count($pi)>0)\n\t\t\t{\n\t\t\t\treturn $pi[0];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function get_compartment(){\n $this->compartment = array_shift(Compartment::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->compartment) {\n return $this->compartment->description;\n } else {\n return \"Not specified\";\n }\n }", "public function getZipcode(): ?string\n {\n return $this->Zipcode ?? null;\n }", "public function getEtblCodePostal() {\n return $this->etblCodePostal;\n }", "function vcex_get_first_term( $post = '', $taxonomy = 'category', $terms = '' ) {\n\tif ( function_exists( 'wpex_get_first_term' ) ) {\n\t\treturn wpex_get_first_term( $post, $taxonomy, $terms );\n\t}\n}", "function get_single_region_itinerary($pid) {\n //print_r($pid); die();\n $sql = \"SELECT * FROM itinerary WHERE region_id='$pid' AND trip_id='0'\";\n $res = $this->mysqli->query($sql);\n return $res->fetch_array(MYSQLI_ASSOC);\n }", "public function getPBNO($dept){\t\n\n\t\t$response=$this->db->query(\"SELECT max(to_number(substr(FMD_PB_NO, instr(FMD_PB_NO,'-')+1))) PBNO \n\t\t\t\t\tFROM FILE_MV_DTL\n\t\t\t\t\tWHERE FMD_SENDER_DEPT = '$dept'\n\t\t\t\t\t\")->row(); \n\n if (isset($response))\n\t\treturn $response->PBNO; \n\t}", "public function getAddress1()\n {\n return $this->fv_address1;\n }", "function findByOutCode($postcode) {\n // TODO: Replace this with a PROPER incode/outcode splitter!!\n $outcode = str_replace(\" \",\"\",$postcode); // Remove space\n $outcode = substr($outcode,0,strlen($outcode)-3); // This should leave us with the postcode less the last 3 chars, the outcode\n \n $select = $this->select()\n ->from($this->_name,array('riskarea'))\n ->where('postcode = ?', $outcode)\n ->where('startdate < ?', date(\"Y-m-d\"))\n ->where('enddate > ?', date(\"Y-m-d\"));\n $row = $this->fetchRow($select);\n \n if(!empty($row))\n {\n $returnVal = $row->riskarea;\n }\n else {\n // Can't find by outcode - log a warning\n Application_Core_Logger::log(\"Can't find by outcode in table {$this->_name} (postcode = {$outcode})\", 'warning');\n $returnVal = null;\n }\n return $returnVal;\n }" ]
[ "0.65724015", "0.6407077", "0.62163806", "0.62163806", "0.62163806", "0.6196637", "0.61037743", "0.5887798", "0.56655985", "0.5664813", "0.5638105", "0.55547446", "0.5548867", "0.5503229", "0.5503229", "0.5502349", "0.54727036", "0.547207", "0.5423586", "0.5410096", "0.53800553", "0.5361851", "0.53287417", "0.53010744", "0.5290231", "0.52784574", "0.52732956", "0.527056", "0.52663803", "0.524817", "0.5224904", "0.5214046", "0.51824176", "0.51752555", "0.5150595", "0.5150595", "0.5150595", "0.5150595", "0.5140312", "0.51370734", "0.51246464", "0.5103413", "0.50906223", "0.50867945", "0.50714517", "0.50714517", "0.5058872", "0.5058741", "0.5051367", "0.50490683", "0.5045805", "0.5040878", "0.5038077", "0.5031047", "0.50258917", "0.501456", "0.50024337", "0.50016683", "0.49862257", "0.49860317", "0.4985867", "0.49757248", "0.4962201", "0.49521014", "0.4920034", "0.4905891", "0.49041247", "0.48850787", "0.48839217", "0.48792604", "0.48693818", "0.4850972", "0.48447883", "0.48355088", "0.48287502", "0.48167866", "0.48131794", "0.48116902", "0.48101747", "0.4807537", "0.48034686", "0.47815502", "0.47751418", "0.47731534", "0.4770041", "0.47584835", "0.47578394", "0.4751619", "0.4751619", "0.47447506", "0.4736525", "0.47324997", "0.47202694", "0.4713037", "0.47096202", "0.47053218", "0.47014216", "0.46990016", "0.4697116", "0.46935186" ]
0.7370118
0
returns ID of the address in the postcodeAnywhere database if it has one; null otherwise.
возвращает ID адреса в базе данных postcodeAnywhere, если он существует; null в противном случае.
public function getPostcodeAnywhereId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAddressId() \n {\n return $this->address_id;\n }", "public function getZohoAddressId();", "public function getBillingAddressId();", "public function getAddress()\n {\n $address = null;\n if ($data = $this->getLocationData()) {\n $address = Address::create();\n $address->update($data);\n $address->ID = 0; //ensure not in db\n }\n\n return $address;\n }", "public function getQuoteAddressId();", "public function getUserAddressId()\n {\n return parent::getValue('user_address_id');\n }", "public function getCodePostal():?int\n {\n return $this->codePostal;\n }", "public function findAddressById(int $id);", "protected function _fcpoGetExistingPayPalAddressId($aResponse) \n {\n list($sStreet, $sStreetNr) = $this->_fcpoSplitAddress($aResponse['add_paydata[shipping_street]']);\n\n $oOrder = $this->_oFcpoHelper->getFactoryObject('oxOrder');\n $sAddressId = $oOrder->fcpoGetAddressIdByResponse($aResponse, $sStreet, $sStreetNr);\n\n $mReturn = ($sAddressId) ? $sAddressId : false;\n\n return $mReturn;\n }", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "function createAddress( $address=null ){\n global $mysqli;\n if(!isset($address) || $address=='')\n return 0;\n $address = $mysqli->real_escape_string($address);\n $results = $mysqli->query(\"SELECT id FROM index_addresses WHERE address='{$address}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_addresses (`address`) values ('{$address}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_addresses table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_addresses table');\n }\n}", "static public function retrieve(mixed $id): ?AddressInterface;", "public function findCompanyPrimaryAddressId($companyId) {\n $response = $this->callRaynetcrmRestApi('company/' . $companyId, 'GET', array());\n\n if ($response->getStatusCode() === self::HTTP_CODE_OK) {\n return Json::decode($response->getBody())->data->addresses[0]->address->id;\n } else {\n return null;\n }\n }", "public function getPostalCode(): ?string;", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "public function getAddress() {\n\t\t//return $this->findParentRow(new Model_DbTable_Address());\n\t\tif ($this->_address) { } else {\n\t\t\tforeach ($this->_rowset->getLoadRows(new Model_DbTable_Address(), 'address') as $row) {\n\t\t\t\tif ($row->id == $this->idAddress) {\n\t\t\t\t\t$this->_address = $row;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t }\n\t return $this->_address;\n\t}", "function getLocation($zipcode) {\n global $pdo;\n $sql = \"select * \"\n . \"FROM a6_locations \"\n . \"WHERE zipcode = ? \"\n . \"LIMIT 1\";\n $query = $pdo->prepare($sql);\n $params = array($zipcode);\n $query->execute($params);\n if ($query->rowCount() > 0) {\n return $query->fetchObject();\n } else {\n return null;\n }\n }", "public function address() {\n\t\treturn $this->has_one('Address');\n\t}", "public function getIdAdresse(): ?Adresse\n {\n return $this->idAdresse;\n }", "public function getAddress(): ?PostalAddressInterface;", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalcode();", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public static function getZoneIdByAddressId($address_id){\n if(!isset($address_id) || empty($address_id)){\n return false;\n }\n if (isset(self::$_zone_ids[$address_id]))\n return self::$_zone_ids[$address_id];\n\n $db = JFactory::getDBO();\n $query = \"SELECT state.\" . $db->quoteName('zone_id') . \" AS zone_state_id, country.\" . $db->quoteName('zone_id') . \" FROM \";\n $query .= $db->quoteName('#__jeproshop_address') . \" AS address LEFT JOIN \" . $db->quoteName('#__jeproshop_country') . \" AS \";\n $query .= \"country ON country.\" . $db->quoteName('country_id') . \" = address.\" . $db->quoteName('country_id') . \" LEFT JOIN \";\n $query .= $db->quoteName('#__jeproshop_state') . \" AS state ON state.\" . $db->quoteName('state_id') . \" = address.\";\n $query .= $db->quoteName('state_id') . \" WHERE address.\" . $db->quoteName('address_id') . \" = \" .(int)$address_id;\n\n $db->setQuery($query);\n $result = $db->loadObject();\n\n self::$_zone_ids[$address_id] = (int)((int)$result['id_zone_state'] ? $result['id_zone_state'] : $result['id_zone']);\n return self::$_zone_ids[$address_id];\n }", "public static function addressExists($address_id){\n $key = 'address_exists_'.(int)$address_id;\n if (!JeproshopCache::isStored($key)){\n $db = JFactory::getDBO();\n\n $query = \"SELECT \" . $db->quoteName('address_id') . \" FROM \" . $db->quoteName('#__jeproshop_address');\n $query .= \" AS address WHERE address.\" . $db->quoteName('address_id') . \" = \" . (int)$address_id;\n\n $db->setQuery($query);\n $address_id = $db->loadResult();\n JeproshopCache::store($key, (bool)$address_id);\n }\n return Cache::retrieve($key);\n }", "public function first() {\n\t\tif (empty($this->addresses)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->addresses[0];\n\t}", "public function getPostalCode();", "public function getPostalCode();", "function oos_get_address_format_id($country_id) {\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $countriestable = $oostable['countries'];\n $address_format = $dbconn->Execute(\"SELECT address_format_id AS format_id FROM $countriestable WHERE countries_id = '\" . intval($country_id) . \"'\");\n if ($address_format->RecordCount() > 0) {\n return $address_format->fields['format_id'];\n } else {\n return '1';\n }\n }", "public function getAddress():?string\n {\n return $this->address;\n }", "public function getLocationId(): ?int\n {\n return $this->locationId;\n }", "public function getAddress(): ?string\n {\n return $this->address;\n }", "public function address() {\n\t\treturn $this->hasOne('Address');\n\t}", "public function getStreetNumber()\n {\n return isset($this->address_data['street_number']) ? $this->address_data['street_number'] : null;\n }", "function &addressTypeID( $asObject=false )\n {\n if ( $asObject )\n return new eZAddress( $this->AddressTypeID );\n else\n return $this->AddressTypeID;\n }", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '1';\n }\n }", "function get_blogaddress_by_id($blog_id)\n {\n }", "public function get_address_by_number( $number ) {\n\t\tforeach ( $this->addresses as $address ) {\n\t\t\tif ( $address->get_id() === $number ) {\n\t\t\t\treturn $address;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public static function zipcodeDetect(int $street)\n {\n $query = Core::query('zipcode-detect');\n $query->bindValue(':street', $street, PDO::PARAM_INT);\n $query->execute();\n $zipcode = $query->fetch(PDO::FETCH_NUM);\n return $zipcode[0];\n }", "public function getAddressType(): ?string\n {\n return $this->AddressType ?? null;\n }", "public function findByPostcode(int $postcode): ?ProvinceContract;", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '6';\n }\n}", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "function findPlaceId($stateName,$countryName){\n global $db;\n\n $placeQuery = \"SELECT id,statename,countryname FROM place\";\n $placeResults = $db->query($placeQuery)->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($placeResults as $result){\n if ($result[\"statename\"]==$stateName && $result[\"countryname\"]==$countryName){\n return $result[\"id\"];\n }\n }\n return null;\n}", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getAddress(): ?string\n {\n return $this->source ? $this->rebuild()->source->/** @scrutinizer ignore-call */getAddress() : null;\n }", "public function getGooglePlaceID(){\r\n\t\tif($this->placeId == null){\r\n\t\t\t$data = Place::getGoogleGeocodeData($this->getName() . \" \" . $this->getAddress() . \" \" . $this->getZipCode() . \" \" . $this->getCity());\r\n\r\n\t\t\tif(isset($data[\"results\"]) && is_array($data[\"results\"]) && count($data[\"results\"]) > 0){\r\n\t\t\t\t$result = $data[\"results\"][0];\r\n\r\n\t\t\t\tif(isset($result[\"place_id\"])){\r\n\t\t\t\t\t$this->placeId = $result[\"place_id\"];\r\n\r\n\t\t\t\t\t$mysqli = \\Database::Instance()->get();\r\n\t\t\t\t\t$stmt = $mysqli->prepare(\"UPDATE `hotspots` SET `googlePlaceId` = ? WHERE `id` = ?\");\r\n\t\t\t\t\t$stmt->bind_param(\"si\",$this->placeId,$this->id);\r\n\t\t\t\t\t$stmt->execute();\r\n\t\t\t\t\t$stmt->close();\r\n\r\n\t\t\t\t\t$this->saveToCache();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->placeId;\r\n\t}", "function address($wallet_id = null) {\n\t\tif(empty($wallet_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/address';\n\t\t\t$json = file_get_contents($url);\n\t\t\t$data = json_decode($json);\n\t\t\tif(!$data->successful) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $data->address;\n\t\t\t}\n\t\t}\n\t}", "function wd_ac_get_address( $id ) {\n global $wpdb;\n \n\n return $wpdb->get_row(\n $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wc_addresses WHERE id = %d\", $id )\n );\n}", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getPostalCode() : ?string \n {\n if ( ! $this->hasPostalCode()) {\n $this->setPostalCode($this->getDefaultPostalCode());\n }\n return $this->postalCode;\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function hasAddress() {\n return $this->_has(3);\n }", "public function getDefaultBillingAddressId()\n {\n return $this->defaultBillingAddressId;\n }", "static function get_address($code){\n \t$address = DB::table('es_mx')\n\t\t ->select('id','colony','state','town','country','code','postal_code')\n ->where('postal_code','=',$code)->get()->toArray();\n\n\t return $address;\n }", "public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }", "public function getApplicantAddressOne()\n {\n return $this->getProperty('applicant_address_one');\n }", "public static function addressPostalCode()\n {\n return new TextNode('address_postal_code');\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getAddress()\n {\n $res = $this->getEntity()->getAddress();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getAddress();\n\t\t}\n return $res;\n }", "public function get($addressId);", "public function address() {\n return $this->hasOne('Address','id','address_id');\n }", "public function fcpoGetAddressIdByResponse($aResponse, $sStreet, $sStreetNr) \n {\n $sQuery = \" SELECT\n oxid\n FROM\n oxaddress\n WHERE\n oxfname = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_firstname]'])} AND\n oxlname = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_lastname]'])} AND\n oxstreet = {$this->_oFcpoDb->quote($sStreet)} AND\n oxstreetnr = {$this->_oFcpoDb->quote($sStreetNr)} AND\n oxcity = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_city]'])} AND\n oxzip = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_zip]'])} AND\n oxcountryid = {$this->_oFcpoDb->quote($this->fcpoGetIdByCode($aResponse['add_paydata[shipping_country]']))}\";\n\n return $this->_oFcpoDb->GetOne($sQuery);\n }", "public function getAwardeeAddress()\n {\n return isset($this->awardeeAddress) ? $this->awardeeAddress : null;\n }", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "function save_address($data)\n\t{\n\t\t$data['field_data'] = serialize($data['field_data']);\n\t\t// update or insert\n\t\tif(!empty($data['id']))\n\t\t{\n\t\t\t$this->db->where('id', $data['id']);\n\t\t\t$this->db->update('merchants_address_bank', $data);\n\t\t\t//echo $this->db->last_query(); die; \n\t\t\treturn $data['id'];\n\t\t} else {\n\t\t\t$this->db->insert('merchants_address_bank', $data);\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t}", "public function getcode() {\n\t\t$this -> db -> select('id');\n\t\t$this -> db -> from('store_info');\n\t\t$this -> db -> limit(1);\n\t\t$this -> db -> order_by(\"id\", \"desc\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n $row = $query->row();\n\t\t\tif (isset($row)){\n\t\t\t\treturn $row->id;\n\t\t\t}\n }else{\n\t\t\treturn 0;\n\t\t}\n \t}", "protected function getId(string $ip_address, int $scope, int $reason): ?int\n {\n // Prepare query.\n $query = $this->wpdb->prepare(\n \"SELECT id FROM {$this->blacklist_table} WHERE scope = %d AND ip_address = %s AND reason = %d\",\n $scope,\n $ip_address,\n $reason\n );\n // Execute query.\n $result = $this->wpdb->get_var($query);\n // Return result.\n return null === $result ? $result : \\intval($result);\n }", "public function findByAddress( $address ) {\n\t\tif ( !$location = $this->getModel()->where( 'address', $address )->first() ) {\n\t\t\treturn $this->setErrorMessage( 'Address not found.' );\n\t\t}\n\n\t\treturn $location;\n\t}", "public static function id()\n {\n // can't use facades to access properties unfortunately!\n return query()->post->ID ?? null;\n }", "public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "public function getStreetNumber();", "public function postcode_exists(Leverzone $leverzone){\n global $LeverzonesDAO;\n return $LeverzonesDAO->postcode_exists($leverzone);\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function getHouseNr(): ?int\n {\n return $this->HouseNr ?? null;\n }", "public function getLocationId(): int\n {\n return $this->location->getId();\n }", "public function getCodigo_postal()\n {\n return $this->codigo_postal;\n }", "function fetch_address($addr_id=NULL ) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$addresses=NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t$where =ZERO_LENGTH_STRING;\n\n\t\t// Set up address id selection\n\t\tif ($addr_id != NULL) {\n\t\t\t$where = $where . \" addr_id = \" . $addr_id;\n\t\t}\n\t\t\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\n\t\t// SQL String\n\t\t$sqlString =\n\t\t \"SELECT *\n\t\t FROM address \" \n\t\t\t\t. $where . \n\t\t\t\t\" ORDER BY addr_id\"; \n\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$addresses[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting address id: \" . $addr_id;\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $addresses);\n}", "public function getPostcode();", "public function get($address_id){\n\t\t$SQL = 'SELECT * FROM address_information WHERE address_id = :address_id';\n\t\t$STMT = self::$_connection->prepare($SQL);\n\t\t$STMT->execute(['address_id'=>$address_id]);\n\t\t$STMT->setFetchMode(\\PDO::FETCH_CLASS,'app\\\\models\\\\Address');\n\t\treturn $STMT->fetch();//return the record\n\t}", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function select($address_id)\n {\n try {\n $SQL = \"SELECT * FROM `\".self::$table_name.\"` WHERE `address_id`='$address_id'\";\n $result = $this->app['db']->fetchAssoc($SQL);\n if (is_array($result)) {\n $address = array();\n foreach ($result as $key => $value) {\n $address[$key] = is_string($value) ? $this->app['utils']->unsanitizeText($value) : $value;\n }\n return $address;\n }\n else {\n return false;\n }\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function getPostCode() {\n return $this->postcode;\n }" ]
[ "0.68717664", "0.6842663", "0.65116405", "0.6349251", "0.63195395", "0.620886", "0.598515", "0.59767985", "0.59355646", "0.59162474", "0.59108186", "0.59092313", "0.5902166", "0.5878164", "0.58322966", "0.5831127", "0.5808772", "0.5781222", "0.57656157", "0.5747084", "0.5732657", "0.5732657", "0.5728899", "0.5694426", "0.56880695", "0.56787485", "0.56411994", "0.56359977", "0.56359977", "0.5633378", "0.5626162", "0.5622014", "0.56194615", "0.5604656", "0.56023264", "0.55918115", "0.55418336", "0.55409944", "0.5528071", "0.5513902", "0.5481768", "0.54794526", "0.54611516", "0.5456799", "0.54508287", "0.5436429", "0.5429433", "0.54092014", "0.5407579", "0.54057896", "0.54012537", "0.53963417", "0.5394381", "0.53858864", "0.53858864", "0.53858864", "0.5383505", "0.53519046", "0.53493965", "0.5334934", "0.53331155", "0.5331826", "0.5327612", "0.5326995", "0.5317527", "0.53173757", "0.53173757", "0.53173757", "0.53173757", "0.5312108", "0.5311578", "0.53057283", "0.52901065", "0.52745175", "0.5273899", "0.5273713", "0.5271764", "0.52710205", "0.526966", "0.5266902", "0.52664983", "0.52614456", "0.5250837", "0.52488506", "0.52416784", "0.52253354", "0.52253354", "0.52253354", "0.5210625", "0.5197935", "0.51947176", "0.5181266", "0.51703763", "0.5167748", "0.5161732", "0.51562905", "0.5152404", "0.5141259", "0.51368093", "0.51249224" ]
0.7239681
0
Lists all creditInfo entities.
Список всех сущностей creditInfo.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $creditInfos = $em->getRepository('AppBundle:CreditInfo')->findAll(); return $this->render('creditinfo/index.html.twig', array( 'creditInfos' => $creditInfos, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex() {\n $searchModel = new CreditSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAll()\r\n {\r\n // Query the database and return an array of contacts\r\n return $this->getEntityManager()\r\n ->createQuery(\r\n 'SELECT c FROM AppBundle:Contact c ORDER BY c.firstName, c.lastName ASC'\r\n )\r\n ->getResult();\r\n }", "public function getCredits();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n \n $accounts = $em->getRepository('NvCargaBundle:Account')->findByMaincompany($maincompany);\n $entities = $em->getRepository('NvCargaBundle:Payment')->findByAccount($accounts);\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getCurrenciesAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:Currency')->findAll();\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public function listAll()\n {\n return $this->contractor->all()->pluck('name', 'id')->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $account = $em->getRepository('AppBundle:Account')->findAll();\n\n return array(\n 'accounts' => $account,\n );\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->getUser();\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($user));\n $pobox = $user->getPobox();\n if (!$pobox) {\n throw $this->createNotFoundException('Usted no es cliente...');\n } \n $customer = $pobox->getCustomer();\n $entities = $em->getRepository('NvCargaBundle:Payment')->findByCustomer($customer);\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cardtype')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Currency::all();\n }", "public function ListarCreditos()\n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.fechaabono, SUM(abonoscreditos.montoabono) as abonototal, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.emailcliente, cajas.nrocaja\n\tFROM\n\t(ventas LEFT JOIN abonoscreditos ON ventas.codventa=abonoscreditos.codventa) LEFT JOIN clientes ON \n\tclientes.codcliente=ventas.codcliente LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.tipopagove ='CREDITO' GROUP BY ventas.codventa\";\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "private function getCompanyCredits ()\n {\n $content = Utils::getContent($this->_strUrl . \"companycredits\");\n\n // get the uls order\n $order = [];\n foreach ($content->find(\"#company_credits_content h4\") as $title) {\n $order[] = $title->attr(\"id\");\n }\n\n $ulList = $content->find(\"#company_credits_content ul\");\n\n // get the uls order\n foreach ($order as $pos => $type)\n {\n foreach ($ulList[$pos]->find(\"li\") as $company)\n {\n $a = $company->find(\"a\")[0];\n\n preg_match(\"/\\/company\\/co([0-9]+)\\?/\", $a->attr(\"href\"), $matches);\n\n if (isset($matches[1]) && !empty($matches[1]))\n {\n $basicData = [\n \"id\" => $matches[1],\n \"name\" => $a->text(),\n ];\n\n if ($type == \"distributors\")\n {\n // Hispano Foxfilms S.A.E. (2009) (Spain) (theatrical) => (2009) (Spain) (theatrical)\n $remainingText = str_replace($basicData[\"name\"], \"\", $company->text());\n\n preg_match(\"/\\(([0-9]{4})-?\\) \\(([A-Za-z0-9_.]+)\\) \\((?:theatrical|TV)\\)/\", $remainingText, $matches);\n\n if (!empty($matches)) {\n $basicData[\"year\"] = (int)$matches[1];\n $basicData[\"country\"] = $matches[2];\n $this->{$type}[] = $basicData;\n }\n } else {\n $this->{$type}[] = $basicData;\n }\n }\n }\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:ClienteCredito')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function InfGetCreditCards($inf_contact_id) {\n\t$object_type = \"CreditCard\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$object->removeRestrictedFields(); // Remove CreditCard and CVV\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'Status' => 3));\n\n $cards_array = array();\n foreach ($objects as $i => $object) {\n\t\t// Give it a userful index, ie, card_id\n\t\t$array = $object->toArray();\n $cards_array[$array['Id']] = $array;\n }\n\treturn $cards_array; // Maybe multiple cards\n}", "public function indexAction()\n {\n // to retrieve Address and BankAccount entities (fetched automatically)\n $this->view->assignMultiple([\n 'addresses' => $this->customer->getAddresses(),\n 'bankAccounts' => $this->customer->getBankAccounts(),\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getCreditos()\n {\n return $this->creditos;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CreditUnionFrontendBundle:Pricelist')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\t $user = $this->getUser();\n\t //$test = $this->getDoctrine()->getRepository(charge::class)->selectCharge($user->getId());\n\t $conv = $this->getDoctrine()->getRepository(charge::class)->findAll();\n return $this->render('charges/index.html.twig', array(\n 'charges' => $conv,\n ));\n }", "public function all()\n {\n return $this->atividadeComercialRepository->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cargaisons = $em->getRepository('AppBundle:Cargaison')->findAll();\n\n return $this->render('cargaison/index.html.twig', array(\n 'cargaisons' => $cargaisons,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $cahierdescharges = $em->getRepository('MyFOSUserBundle:Cahierdescharges')->findAll();\n\n return $this->render('cahierdescharges/index.html.twig', array(\n 'cahierdescharges' => $cahierdescharges,\n ));\n }", "public function indexAction()\n {\n return new ViewModel(array(\n 'creditcards' => $this->getCreditcardTable()->fetchAll(),\n )); \n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AcmebsceneBundle:Account')->findAll();\n\n return $this->render('AcmebsceneBundle:Account:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:Client')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n\t {\n\t $accounts = $this->Accounts->find('all');\n\t $this->set(compact('accounts'));\n\t }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppWebBundle:Catalogo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function credit_view_all(){\n\t\t$user_transactions_credit=array();\n\t\t$user_transactions_credit=$this->UserModel->getCreditPackage(array('member_id'=>$this->session->userdata('member_id'),'payment_process'=> '1'),0);\n\t\tif($_SERVER['HTTP_REFERER']!=base_url().\"account/credit_view_all\"){\n\t\t\t$this->session->set_userdata('HTTP_REFERER', $_SERVER['HTTP_REFERER']);\n\t\t\t$previous_page_url=$_SERVER['HTTP_REFERER'];\n\t\t}else{\n\t\t\t$previous_page_url=$this->session->userdata('HTTP_REFERER');\n\t\t}\n\t\t//Loads header, Invoices list and footer view.\n\t\t$this->load->view('header',array('title'=>'My Invoices','previous_page_url'=>$previous_page_url));\n\t\t$this->load->view('user/invoices_list',array('user_transactions_credit'=>$user_transactions_credit));\n\t\t$this->load->view('footer-inner-red');\n\t}", "public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteSavalizeBundle:Company')->findAll();\n\n return $this->render('SiteSavalizeBundle:Company:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function getAll()\r\n {\r\n return $this->contactManager->fetchAll(true, null, null);\r\n }", "public function Company_Info_List(){\n /*\n $user = session('USER_ID'); // 获取已登录用户\n */\n // $user = 'c4b19072a79e4a6e81f06761f1e6bd2b';\n // $where = array('USER_ID' => $user);\n // if(!empty($keywords)){\n // $where['COMPANY_NAME'] = array('like',\"%$keywords%\");\n // }\n // if (!empty($start_date)) {\n // $where['CREATE_TIME'] = array('gt',$start_date);\n // }\n // if (!empty($end_date)) {\n // $where['CREATE_TIME'] = array('lt',$end_date);\n // }\n // $count = M('a_sys_user_attr_company_info')\n // -> where($where)\n // -> count();\n\n // $Page = new \\Think\\Page($count, $pagenum);// 实例化分页类 传入总记录数和每页显示的记录数($pagenum)\n\n // $show = $Page->show();// 分页显示输出\n\n // $list = M('a_sys_user_attr_company_info as info') // 查询公司信息表\n \t\t// -> field('COMPANYINFO_ID,COMPANY_NAME,CERT,COMPANY_AUTHENTICATION,SERVICE_LEVEL,COMPANY_NUM') // 需求字段\n \t\t// -> join('a_service_level as level on info.SERVICE_ID = level.SERVICE_ID') // 两表联查\n // ->limit($Page->firstRow.','.$Page->listRows) // 分页查询\n \t\t// -> where($where) \t\t// 查询条件\n \t\t// -> select();\n\n // // var_dump($list);die;\n \n // $this -> assign('show' , $show);\n // $this -> assign('list' , $list);\n $this -> display('list');\n }", "public function index()\n {\n return Account::all();\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function fetchAll()\n {\n $query = $this->em->createQuery(\"\n SELECT\n ccb.id,\n usr.nome corretor,\n con.nome contato ,\n ccb.dataBloqueio,\n ccb.status\n FROM\n {$this->repository} ccb\n JOIN crm\\Entity\\Usuarios usr WITH ccb.corretor = usr.id\n JOIN crm\\Entity\\Contatos con WITH ccb.contato = con.id\"\n );\n $results = $query->getResult();\n if(!is_null($results)) {\n return $results;\n }\n return new ApiProblem('404', \"Recurso n�o localizado\");\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n // $all = $em->getRepository('NvCargaBundle:Bill')->findBy(['canceled'=>FALSE, 'maincompany'=> $maincompany])\n $all = $em->getRepository('NvCargaBundle:Bill')->createQueryBuilder('b')\n ->where('b.status != :status')\n ->andwhere('b.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany, 'status' => 'ANULADA'))\n ->orderBy('b.number', 'DESC')\n ->setMaxResults(500)\n ->getQuery()\n ->getResult();\n if ($type == \"MASTER\") {\n $entities = $all;\n } else {\n $entities = [];\n foreach ($all as $entity) {\n $guide = $entity->getGuides()->last();\n if ($guide->getAgency() === $agency()) {\n $entities[] = $entity;\n }\n }\n }\n return array(\n 'entities' => $entities,\n );\n\n }", "public function index()\n {\n return Contract::all();\n }", "public function listallAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\t\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $entities = $em->getRepository('NvCargaBundle:Customer')->findBy(['maincompany'=>$maincompany,'active'=>true]);\n \n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n foreach ($entity->getBaddress() as $dir ) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n// foreach ($entities as $entity) {\n// $result[$counter]['customerid'] = $entity->getId();\n// $result[$counter]['name'] = $entity->getName();\n// $result[$counter]['lastname'] = $entity->getLastname();\n// if ($entity->getPobox()) {\n// $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n// } else {\n// $result[$counter]['pobox'] = '';\n// }\n// $result[$counter]['email'] = $entity->getEmail();\n// \n// $result[$counter]['docid'] = $entity->getAdrdefault()->getDocid();\n// $result[$counter]['address'] = $entity->getAdrdefault()->getAddress();\n// $city = $entity->getAdrdefault()->getCity();\n// $result[$counter]['cityid'] = $city->getId();\n// $result[$counter]['cityname'] = $city->getName();\n// $result[$counter]['state'] = $city->getState()->getName();\n// $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n// $result[$counter]['phone'] = $entity->getAdrdefault()->getPhone();\n// $result[$counter]['mobile'] = $entity->getAdrdefault()->getMobile();\n// \n// $result[$counter]['barrio'] = $entity->getAdrdefault()->getBarrio();\n// $result[$counter]['zip'] = $entity->getAdrdefault()->getZip();\n// $result[$counter]['type'] = $entity->getType()->getName();\n// $counter++;\n// }\n return new JsonResponse($result); \n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cotisations = $em->getRepository('AppBundle:Cotisation')->findAll();\n\n return $this->render('cotisation/index.html.twig', array(\n 'cotisations' => $cotisations,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $repository = $em->getRepository('COEShopBundle:Discount');\n\n $entities = $repository->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Complaint::where('iPersonID', (integer)session()->get('customer_id'))->get();\n }", "function get_all_contacts() {\n //get all the users\n $task = Doctrine_Query::create()\n ->from('Zim_Model_User');\n $exec = $task->execute();\n $contacts = $exec->toArray();\n //return the array of contacts\n return $contacts;\n\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Currency::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\t\n\t\t$this->setActivity(\"List view\");\t\n $em = $this->getDoctrine()->getManager();\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$oRep = $em->getRepository('BoAdminBundle:Local');\n\t\t$oContractEntity=$em->getRepository('BoAdminBundle:Contracts');\n\t\t$nb_tc = $oRep->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null) $page=1;\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$aLocal = $em->getRepository('BoAdminBundle:Local')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n\t\t$this->updateAllLocal();\n\t\t//Pour la recherche des opérations en deux dates \n\t\t$oCcdate = new Ccdate();\n $Ccdateform = $this->createForm('Bo\\AdminBundle\\Form\\CcdateType', $oCcdate);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\LocalType2', new Local());\n\n return $this->render('local/index.html.twig', array(\n \t'locals' => $aLocal,\n\t\t'types'=>$oContractEntity->getContractType(),\n\t\t'fields'=>$oContractEntity->getWorkFields(),\n\t\t'campuss'=>$em->getRepository('BoAdminBundle:Campus')->findAll(),\n\t\t'ccd_form' => $Ccdateform->createView(),\n \t'form' => $form->createView(),\n\t\t'now' => new \\DateTime(),\n\t\t'page' => $page, // On transmet à la vue la page courante,\n\t\t'nb_pages' => $nb_pages, //le nombre total de pages,\n\t\t'total'=>$nb_tc, // Et le nombre total d'enregistrement.\n\t\t'pm'=>\"local\",\n\t\t'sm'=>\"local\",\n ));\n }", "public function index(){\n return MarketInfo::all();\n }", "public function getallCreditCustomers() \n\t{ \n\t $cid = $this->gasolinereceived_model->getCompanyId();\n\t\t $cid1 = $cid['0']->c_id;\n\t\t \n\t\t $this->db->where('c_id',$cid1);\n\t\t \n\t\t $this->db->order_by('date_created','DESC');\n\t\t $query = $this->db->get('credit_customer')->result();\n\t $q=$this->db->last_query($query );\n\t\t// print_r($q); die('err');\n\t return $query;\n\t \n\t}", "public function indexAction() {\n\t$em = $this->getDoctrine()->getManager();\n\n\t$entities = $em->getRepository('MagypRendicionDeCajaBundle:Comprobante')->findAll();\n\n\treturn array(\n\t 'entities' => $entities,\n\t);\n }", "public function index()\n {\n return Account::select('*')->take(30)->get();\n }", "public function indexAction()\n {\n $user = $this->getUser()->getId();\n $Cabinets = $this->getDoctrine()\n ->getRepository('AppBundle:Cabinet')\n ->findOneBy(array('user_id' => $user));\n $contacts = $this->getDoctrine()\n ->getRepository('AppBundle:Contact')\n ->findBy(array ('cabinet' => $Cabinets),array('id' => 'ASC'));;\n\n return $this->render('contact/index.html.twig', array(\n 'contacts' => $contacts,'Cabinets' => $Cabinets\n ));\n }", "public function index(Request $request)\n {\n return Account::all();\n }", "public function getAll()\n {\n return $this->_info;\n\n }", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function listContract()\n {\n return view('admin.basic.customer.list-contract', [\n 'data' => Contract::distinct('user_id')->get(['user_id', 'admin_id', 'phone', 'email']),\n 'pageTitle' => Lang::trans('label.Customer contract')\n ]);\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $countriesRepository = $em->getRepository('ShopBundle:Countries');\n\n $countryList = $countriesRepository->findBy(\n array(),\n array('country' => 'ASC')\n );\n\n return array(\n 'countryList' => $countryList,\n );\n }", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function index()\n {\n return view('admin::banking.accounts.list', [\n 'accounts' => Account::getAllByBusiness()\n ]);\n }", "public static function index()\n {\n return Comida::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CheckmanBundle:Spendings')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function all(): array\n {\n return Billingo::get('bank_accounts');\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n\n if ($type == \"MASTER\") {\n $entities = $em->getRepository('NvCargaBundle:Guide')->createQueryBuilder('g')\n ->where('g.bill IS NULL')\n ->andwhere('g.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany))\n ->orderBy('g.number', 'ASC')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n $agencies = $em->getRepository('NvCargaBundle:Agency')->findByMaincompany($maincompany);\n } else {\n $entities = $em->getRepository('NvCargaBundle:Guide')->createQueryBuilder('g')\n ->where('g.agency = :ag' )\n ->andwhere('g.bill IS NULL')\n ->setParameters(array('ag' => $agency))\n ->orderBy('g.number', 'ASC')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n $agencies = null;\n }\n return array(\n 'entities' => $entities,\n 'agencies' => $agencies,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n \n $entity = new Incapacidad();\n $form = $this->createCreateForm($entity);\n \n $entities = $em->getRepository('DGPlusbelleBundle:Incapacidad')->findAll();\n\n return array(\n 'form'=>$form->createView(),\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Entity::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:LocalBanner')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getCurrenciesAction()\n {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Shop\\Currency');\n\n $builder = $repository->createQueryBuilder('c');\n $builder->select(\n [\n 'c.id as id',\n 'c.name as name',\n 'c.currency as currency',\n 'c.symbol as symbol',\n 'c.factor as factor',\n 'c.default as default'\n ]\n );\n\n $query = $builder->getQuery();\n\n $total = Shopware()->Models()->getQueryCount($query);\n\n $data = $query->getArrayResult();\n\n $this->View()->assign(\n [\n 'success' => true,\n 'data' => $data,\n 'total' => $total\n ]\n );\n }", "public function getCredits() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->_identifier) throw new Exception(lang('error_127'));\n\t\t\n\t\t// get configs\n\t\t$config = $this->showConfigs(true);\n\t\t\n\t\t// choose database\n\t\t$database = $config['config_database'] == \"MuOnline\" ? $this->muonline : $this->memuonline;\n\t\t\n\t\t// build query\n\t\t$data = array(\n\t\t\t'identifier' => $this->_identifier\n\t\t);\n\t\t$variables = array('{TABLE}','{COLUMN}','{USER_COLUMN}');\n\t\t$values = array($config['config_table'], $config['config_credits_col'], $config['config_user_col']);\n\t\t$query = str_replace($variables, $values, \"SELECT {COLUMN} FROM {TABLE} WHERE {USER_COLUMN} = :identifier\");\n\t\t\n\t\t// add credits\n\t\t$getCredits = $database->queryFetchSingle($query, $data);\n\t\tif(!is_array($getCredits)) throw new Exception(lang('error_143'));\n\t\t\n\t\treturn $getCredits[$config['config_credits_col']];\n\t}", "public function getAllCitationsAdmin() {\n $listeCitations = array();\n $sql = \"SELECT cit_num,per_num,per_num_valide,per_num_etu,cit_libelle,cit_date,cit_valide,cit_date_valide,cit_date_depo FROM citation\";\n $requete = $this->db->prepare($sql);\n $requete->execute();\n while ($citation = $requete->fetch(PDO::FETCH_OBJ)) {\n $listeCitations[] = new Citation($citation);\n }\n $requete->closeCursor();\n return $listeCitations;\n }", "public static function list () {\n // Retrieve account resources.\n $accounts = Json::get('account', null);\n\n // If account resource is not avaiable, internal server error.\n if ($accounts == 1)\n return 1;\n\n // Return accounts.\n return $accounts;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clatesals = $em->getRepository('AppBundle:Clatesal')->findAll();\n\n return $this->render('clatesal/index.html.twig', array(\n 'clatesals' => $clatesals,\n ));\n }", "public function all()\n\t{\t\n\t\t$counts = $this->contact_model->get_conatct_counts();\n\t\t$this->load->library('pagination');\n\t\t$config['base_url'] = base_url().'/Company/index';\n\t\t$config['total_rows'] = $counts;\n\t\t$this->pagination->initialize($config);\n\t\t\n\t\t$contacts = $this->contact_model->get_all_conatct();\n\t\t\n\t\t$response = array('total' => $counts,\n\t\t\t\t\t\t'contacts' => $contacts);\n\t\techo json_encode($response);\n\t}", "public function showAllBetAction()\n {\n $em = $this->getDoctrine()->getManager();\n $bets = $em->getRepository('BetBundle:Bet')->findBy(array(),array('id' => 'DESC'),20);\n\n return $this->render('admin/showBet.html.twig', array(\n 'bets' => $bets,\n ));\n }", "public function index()\n {\n $dsGoiCredit = GoiCredit::all();\n return view('ds-goi-credit', compact('dsGoiCredit'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('EnterpriseBundle:Customer')->findAll();\n\n return $this->render('EnterpriseBundle:Default:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cuisines = $em->getRepository('MyAppAdminBundle:Cuisine')->findAll();\n\n return $this->render('cuisine/index.html.twig', array(\n 'cuisines' => $cuisines,\n ));\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n */\n $listall = $this->getUser()->getMaincompany()->getCountries();\n $countries = array();\n $count = 0;\n foreach ($listall as $country) {\n $countries[$count]['id'] = $country->getId();\n $countries[$count]['name'] = $country->getName();\n $count++;\n }\n return $this->render('NvCargaBundle:City:index.html.twig',array('countries' => $countries)); \n\n }", "public function listAllCustomers();", "public function index(Request $request, ProgramCreditFilters $filters) {\n $credits = $this->service()->repo()->list($request->user(), $filters);\n return $credits;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ComDaufinBundle:Incident')->findAll();\n\n return $this->render('ComDaufinBundle:Incident:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $caisses = $em->getRepository('AppBundle:Caisse')->findAll();\n\n return $this->render('caisse/index.html.twig', array(\n 'caisses' => $caisses,\n ));\n }", "public function index()\n {\n //\n $status = DB::table('users')\n ->join('cradits', 'users.id', '=', 'cradits.user_id')\n ->select('users.f_name', 'cradits.*')\n ->get();\n return view('admin.credit.list', compact('status'));\n }", "public function index()\n {\n \n $creditos = Credito::all()->where('estado','En gestion');\n \n\n\n return view('creditos.index', compact('creditos'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $realtyCompanies = $this->getRealtyCompanyRepository()\n ->findAllRealtyCompany()->getQuery()->getResult();\n\n return [\n 'realtyCompanies' => $realtyCompanies,\n ];\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $information = $em->getRepository('AppBundle:Information')->findAll();\n return $this->render('APIInfoBundle:information:index.html.twig', array(\n 'information' => $information,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VentesBundle:DetailsProduits')->findAll();\n\n return $this->render('VentesBundle:DetailsProduits:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n return Contatos::orderBy('id', 'DESC')->get();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SubscriptionBundle:SubscriptionBase')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function show(CreditCard $creditCard)\n {\n //\n }", "public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $centros = $em->getRepository('AppBundle:Centro')->findAll();\n\n return $this->render('centro/index.html.twig', array(\n 'centros' => $centros,\n ));\n }", "public function getAll()\n {\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n \t\n $entities = $em->getRepository('JobHubBundle:Experience')->findBy(array('candidat' => $this->getCurrentCandidat()));\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $listeCours = $em->getRepository('SvtBassemBundle:Cours')->findAll();\n\n return $this->render('SvtAdminBundle:listecours:index.html.twig', array(\n 'listeCours' => $listeCours,\n ));\n }", "public function getAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('p.*')\n ->from('Pc', 'p');\n\n $statement = $queryBuilder->execute();\n $PcData = $statement->fetchAll();\n foreach ($PcData as $computerData) {\n $PcEntityList[$computerData['id']] = new Pc($computerData['id'], $computerData['marque']);\n }\n\n return $PcEntityList;\n }", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }" ]
[ "0.6347158", "0.59950393", "0.59759474", "0.5968247", "0.5921126", "0.58915967", "0.5890987", "0.58732206", "0.5864416", "0.5832881", "0.5810455", "0.5807005", "0.58052987", "0.5767612", "0.5762164", "0.5745808", "0.5737595", "0.57221955", "0.5716083", "0.57069993", "0.5700973", "0.56854326", "0.56710213", "0.5667276", "0.56652254", "0.5663093", "0.56606895", "0.56590456", "0.5658521", "0.56513816", "0.564063", "0.56391835", "0.5632409", "0.56265104", "0.56161916", "0.5614915", "0.56054276", "0.56023085", "0.5600987", "0.5597337", "0.5597337", "0.55902493", "0.5587693", "0.5580856", "0.55736727", "0.55692405", "0.5558158", "0.55263793", "0.5524868", "0.5517893", "0.5511245", "0.5498979", "0.5498511", "0.5493183", "0.54802597", "0.5476652", "0.5472753", "0.5461443", "0.546051", "0.5457235", "0.54348195", "0.5432703", "0.5429395", "0.5428931", "0.54286987", "0.5424064", "0.5422162", "0.5415875", "0.5415523", "0.54135776", "0.5408677", "0.5402942", "0.53951734", "0.5391995", "0.5389026", "0.5383879", "0.537225", "0.5372248", "0.5372038", "0.5370919", "0.5370215", "0.5367812", "0.53613913", "0.5356151", "0.5354099", "0.5350915", "0.5349623", "0.5340839", "0.53398293", "0.53397983", "0.53237385", "0.5313035", "0.530736", "0.5305373", "0.5304237", "0.53022724", "0.5300938", "0.5296194", "0.5295713", "0.5293225" ]
0.7377111
0
Ensure that the specified table is present in the destination DB as an empty copy of the source
Убедитесь, что указанный таблица присутствует в базе данных назначения как пустая копия источника
private function ensureEmptyTargetTable($table, Connection $sourceConnection, Connection $destConnection) { // SchemaManager doesn't do enums! $destConnection->exec('DROP TABLE IF EXISTS ' . $sourceConnection->quoteIdentifier($table)); $driverName = $sourceConnection->getDriver()->getName(); if ($driverName === 'pdo_mysql') { $createSqlRow = $sourceConnection->query('SHOW CREATE TABLE ' . $sourceConnection->quoteIdentifier($table)) ->fetch(\PDO::FETCH_ASSOC); $createSql = $createSqlRow['Create Table']; } elseif ($driverName === 'pdo_sqlite') { $schemaSql = 'SELECT sql FROM sqlite_master WHERE type="table" AND tbl_name=' . $sourceConnection->quoteIdentifier($table); $createSql = $sourceConnection->query($schemaSql)->fetchColumn(); } else { throw new \RuntimeException(__METHOD__ . " not implemented for $driverName yet"); } $destConnection->exec($createSql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function empty_table($table = '')\n\t{\n\t\tif ($table === '')\n\t\t{\n\t\t\tif ( ! isset($this->qb_from[0]))\n\t\t\t{\n\t\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;\n\t\t\t}\n\n\t\t\t$table = $this->qb_from[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t$sql = $this->_delete($table);\n\t\t$this->_reset_write();\n\t\treturn $this->query($sql);\n\t}", "protected function ensureTableExists() {\n try {\n $database_schema = $this->connection->schema();\n $schema_definition = $this->schemaDefinition();\n $database_schema->createTable(static::TABLE_NAME, $schema_definition);\n }\n // If another process has already created the batch table, attempting to\n // recreate it will throw an exception. In this case just catch the\n // exception and do nothing.\n catch (DatabaseException $e) {\n }\n catch (\\Exception $e) {\n return FALSE;\n }\n return TRUE;\n }", "protected function ensureTables() {\n if (!$this->ensured) {\n if (!$this->connection->schema()->tableExists($this->mapTable)) {\n // Generate appropriate schema info for the map and message tables,\n // and map from the source field names to the map/msg field names\n $count = 1;\n $source_key_schema = array();\n $pks = array();\n foreach ($this->sourceKey as $field_schema) {\n $mapkey = 'sourceid' . $count++;\n $source_key_schema[$mapkey] = $field_schema;\n $pks[] = $mapkey;\n }\n\n $fields = $source_key_schema;\n\n // Add destination keys to map table\n // TODO: How do we discover the destination schema?\n $count = 1;\n foreach ($this->destinationKey as $field_schema) {\n // Allow dest key fields to be NULL (for IGNORED/FAILED cases)\n $field_schema['not null'] = FALSE;\n $mapkey = 'destid' . $count++;\n $fields[$mapkey] = $field_schema;\n }\n $fields['needs_update'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::STATUS_IMPORTED,\n 'description' => 'Indicates current status of the source row',\n );\n $fields['rollback_action'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::ROLLBACK_DELETE,\n 'description' => 'Flag indicating what to do for this item on rollback',\n );\n $fields['last_imported'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n 'description' => 'UNIX timestamp of the last time this row was imported',\n );\n $schema = array(\n 'description' => t('Mappings from source key to destination key'),\n 'fields' => $fields,\n 'primary key' => $pks,\n );\n $this->connection->schema()->createTable($this->mapTable, $schema);\n\n // Now for the message table\n $fields = array();\n $fields['msgid'] = array(\n 'type' => 'serial',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n );\n $fields += $source_key_schema;\n\n $fields['level'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 1,\n );\n $fields['message'] = array(\n 'type' => 'text',\n 'size' => 'medium',\n 'not null' => TRUE,\n );\n $schema = array(\n 'description' => t('Messages generated during a migration process'),\n 'fields' => $fields,\n 'primary key' => array('msgid'),\n 'indexes' => array('sourcekey' => $pks),\n );\n $this->connection->schema()->createTable($this->messageTable, $schema);\n }\n $this->ensured = TRUE;\n }\n }", "private function prepareSchema()\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($this->table)) {\n try {\n $this->dropTableIfExist($connection, $this->tableMemory);\n $connection->createCommand('CREATE TABLE ' . $connection->quoteTableName($this->tableMemory) . ' LIKE ' . $connection->quoteTableName($this->table) . ';')->execute();\n $connection->createCommand('ALTER TABLE ' . $connection->quoteTableName($this->tableMemory) . ' ENGINE=MEMORY;')->execute();\n return true;\n } catch (Exception $e) {\n $this->dropTableIfExist($connection, $this->tableMemory);\n Yii::log('Schema preparation error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n }\n } else {\n Yii::log('Nothing to copy.', 'error', 'extensions.CodMtfs.Mtfs');\n }\n return false;\n }", "private function verifyTableExists(string $table) {\n $stmt = $this->pdo->query(str_replace('%TABLENAME%', $table, self::QUERIES['verifyTableExists']));\n\n if($stmt->rowCount() === 0) {\n die('Connection established, but table \"' . $table . '\" either doesn\\'t exist or is empty');\n }\n\n $this->table = $table;\n }", "public function isMappedToExistingTable()\n {\n if (!empty($this->mapToTable)) {\n return true;\n } else {\n return false;\n }\n }", "public function testMissingTable() {\n\t\t$Article = new ArticleB(false, uniqid());\n\t\t$Article->schema();\n\t}", "public function testCheckTableExist() {\n\n\t}", "public function testValidatorForTableShouldBeExisted()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => '1',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'datasource_name' => '1',\n 'table_id' => 100,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\"選択されたテーブルIDは正しくありません。\"]);\n }", "public function create_missing_tables() {\n\n\t\t/* Create the network snippets table if it doesn't exist */\n\t\tif ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t/* Create the table if it doesn't exist */\n\t\tif ( ! self::table_exists( $this->table ) ) {\n\t\t\t$this->create_table( $this->table );\n\t\t}\n\t}", "public function ensureTableExists()\n {\n $_tableName = DB_PREFIX . \"wr360product\";\n $sqlCreateTable = <<<SQL\nCREATE TABLE IF NOT EXISTS `$_tableName` (\n `product_id` INT NOT NULL ,\n `root_path` VARCHAR(255) NULL DEFAULT NULL ,\n `config_file_url` VARCHAR(255) NULL DEFAULT NULL ,\n `wr360_enabled` TINYINT(1) NOT NULL DEFAULT '1' ,\n PRIMARY KEY (`product_id`) )\nENGINE = MyISAM\nDEFAULT CHARACTER SET = utf8;\nSQL;\n\n $this->db->query($sqlCreateTable);\n }", "public function table_check() {\n\t // check if tables exist then create if not\n\t global $wpdb;\n\t \n\t $required_tables = array (\n\t \"$wpdb->prefix\" . \"tr_ratting_data\",\n\t \"$wpdb->prefix\" . \"tr_characters\",\n\t \"$wpdb->prefix\" . \"tr_structures_income\",\n\t \"$wpdb->prefix\" . \"tr_pvp_chars_kills\",\n\t \"$wpdb->prefix\" . \"tr_users_chars\",\n\t )\n\t \n\t ;\n\t foreach ( $required_tables as $table ) {\n\t $val = $wpdb->get_var ( \"SHOW TABLES LIKE '$table'\" );\n\t if ($val == $table) {\n\t // exists//\n\t } else {\n\t // create non existing\n\t $this->create_table ( $table );\n\t }\n\t }\n\t}", "function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = null, string $null_as = null): void\n{\n error_clear_last();\n if ($null_as !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as);\n } elseif ($delimiter !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter);\n } else {\n $result = \\pg_copy_from($connection, $table_name, $rows);\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n}", "final protected\tfunction\thasTable($table)\n\t\t{\n\t\t\t$this->_table\t=\t$table;\n\t\t}", "final protected\tfunction\thasTable($table)\n\t\t{\n\t\t\t$this->_table\t=\t$table;\n\t\t}", "public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "function setDestTableName($destTableName) {\n if ($destTableName !== ($oldDestTableName = $this->destTableName)) {\n if ($this->immutable) throw self::immutableException();\n $this->destTableName = $destTableName;\n $this->destNNIdsRelation = false;\n }\n }", "function empty_facts_and_rules_table($con)\n{\n\t$result1 = mysqli_query($con,\"TRUNCATE tbl_facts\");\n\t$result2 = mysqli_query($con,\"TRUNCATE tbl_rules\");\n\tif(!($result1 && $result2))\n\t\t die(\"Tables not found\");\n}", "protected static function check_table() {\n\t\tglobal $wpdb;\n\n\t\t$storage = new WPSEO_Link_Storage();\n\t\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $storage->get_table_name() );\n\t\tif ( $wpdb->get_var( $query ) !== $storage->get_table_name() ) {\n\t\t\tself::set_inaccessible();\n\t\t\treturn false;\n\t\t}\n\n\t\tself::set_accessible();\n\t\treturn true;\n\t}", "public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }", "function empty_table($name) {\n\t\t\t$result = $this->checkup(\"\", $name);\n\t\t\tif ($result == false) {\n\t\t\t\treturn $this->error(\"could not truncate.\");\n\t\t\t}\n\n\t\t\t#if ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\tif ($this->one_query(\"TRUNCATE TABLE \".$name)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->error(\"error truncating table '$name' !\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function copyData()\n {\n $connection = Yii::app()->db;\n $transaction = $connection->beginTransaction();\n try {\n $connection->createCommand('INSERT INTO ' . $connection->quoteTableName($this->tableMemory) . ' SELECT * FROM ' . $connection->quoteTableName($this->table))->execute();\n $transaction->commit();\n return true;\n } catch (Exception $e) {\n Yii::log('Transaction error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n $transaction->rollback();\n }\n }", "public function tableExists($table) {\n if (array_key_exists($table, $this->schema) && is_writable($this->directories['data']['core']['dir'].$table)) {\n return true;\n }\n else return false;\n }", "protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }", "public static function create_missing_table( $table_name ) {\n\n\t\tif ( self::table_exists( $table_name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::create_table( $table_name );\n\t}", "function tableExists($table);", "protected function resetExistingTables()\n {\n $this->existingTables = null;\n }", "function migrateTable( $table ) {\n\n $query = \"SELECT * FROM \" . $table;\n\n $this->_externalDB->setQuery( $query );\n $object = $this->_externalDB->loadObjectList();\n\n\t\t$db =& JFactory::getDBO();\n $count = count($object);\n\n for ($i=0; $i<$count; $i++) {\n $db->insertObject($table, $object[$i]);\n\t\t\t//echo $db->errorMsg();\n }\n\n\t\t$ret = $db->getErrorNum();\n\n return $ret;\n }", "public function emptyTable($table) {\n try {\n return $this->exec(\"TRUNCATE TABLE $table\");\n } catch (Exception $exc) {\n if (DEBUG == TRUE) {\n Debug::throwException(\"Database error!\", $exc);\n }\n return 0;\n }\n }", "function empty_table( $name )\n\t{\n\t\t$result = $this->checkup( \"\", $name );\n\t\tif ($result==false) {\n\t\t\treturn $this->error( \"could not truncate.\" );\n\t\t}\n\t\t\n\t\tif ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error ( \"error truncating table '$name' !\" );\n\t\t\treturn false;\n\t\t}\n\t}", "function copyTable($table, $new_table, $data = TRUE, $link = 0) {\n $this->link = $link ? $link : $this->link;\n $r = $this->query(\"CREATE TABLE `{$new_table}` LIKE `{$table}`;\", $link);\n return ($r && $data) ? $this->query(\"INSERT INTO `{$new_table}` SELECT * FROM `{$table}`;\", $link) : $r;\n }", "function checkTableExists($table_name) {\n $sql = sprintf(\"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='%s'\", $table_name);\n\n $ret = $this->query($sql);\n // echo \"<br>\";\n // echo print_r($ret, $return=true);\n // echo \"<br>\";\n if ($ret) {\n $ary = $ret->fetchArray(SQLITE3_NUM);\n if ($ary[0] > 0) {\n return True;\n } else {\n return False;\n }\n }\n }", "function verifyTable($connection) {\n\tif(!tableExists($connection)) \n\t{\n\t\t$query = \"CREATE TABLE `\".TABLE_NAME.\"` (\n\t\t\t`id` int(11) not null auto_increment,\n\t\t\t`title` varchar(255) not null,\n\t\t\t`url` varchar(511) not null,\n\t\t\tprimary key (`id`));\";\n\n\t\tif(!mysqli_query($connection, $query)) echo(\"<p>Error creating table.</p>\");\n\t}\n}", "public function afterImport($table)\n {\n return Yii::$app->db->createCommand(\"DROP TABLE IF EXISTS $table\")->execute();\n }", "private function tableIsEmpty(){\r\n\t\tglobal $TABLEAFILIADOS;\r\n\t\t$sqlquery=\"SELECT * from `$TABLEAFILIADOS`;\";\r\n\t\t$result=mysql_query($sqlquery);\r\n\t\t$int_numRows = mysql_num_rows($result);\r\n\t\tif ($int_numRows==0){\t\t\t\r\n\t\t\treturn true;\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function testFieldsDontRerequestChanges() {\r\n\t\t$db = DB::getConn();\r\n\t\tDB::quiet();\r\n\t\t\r\n\r\n\t\t// Table will have been initially created by the $extraDataObjects setting\r\n\t\t\r\n\t\t\r\n\t\t// Verify that it doesn't need to be recreated\r\n\t\t$db->beginSchemaUpdate();\r\n\t\t$obj = new DataObjectSchemaGenerationTest_DO();\r\n\t\t$obj->requireTable();\r\n\t\t$needsUpdating = $db->doesSchemaNeedUpdating();\r\n\t\t$db->cancelSchemaUpdate();\r\n\t\t\r\n\t\t$this->assertFalse($needsUpdating);\r\n\t}", "function DB_empty_curMonth_tables()\n{\n global $connection;\n $results = $connection->query(\"TRUNCATE TABLE outcome\");\n if (!$results) {\n print (\"error=\".$connection->get_error().\"<br>\");\n return false;\n }\n $results = $connection->query(\"TRUNCATE TABLE income_and_status\");\n if (!$results) {\n print (\"error=\".$connection->get_error().\"<br>\");\n return false;\n }\n return true;\n}", "public function tableExists( $tablename );", "function tableExists($db, $table = 'settings') {\n try {\n $result = $db->query(\"SELECT 1 FROM $table LIMIT 1\"); \n } catch (Exception $e) {\n return false;\n }\n return $result == true;\n }", "private function checkOrCreateTable(){\n $this->pdo->query(\"CREATE TABLE IF NOT EXISTS k_UserDean(wp_id BIGINT UNSIGNED PRIMARY KEY, dean_id BIGINT UNSIGNED);\");\n }", "function sql_table_exists($table) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\ttry {\n\t\t$result = $sql->query(sql_select($table, '1'));\n\t} catch (Exception $e) {\n\t\treturn FALSE;\n\t}\n\treturn $result !== FALSE;\n}", "function checkTableExists($tableName)\n{\n $mdb2 =& GetMDB2();\n $SQL = \"SELECT count(*) FROM `$tableName` WHERE 1 = 0\";\n $res = $mdb2->queryOne($SQL);\n $err = mdb2ErrorCheck($res, false, false, -18);\n switch($err['code']){\n case 0:\n return true;\n break;\n case -18:\n return false;\n break;\n default:\n mdb2ErrorCheck($res);\n die(\"Error when checking table $tableName.\\n\");\n }\n}", "function empty_kb_tables($con)\n{\n\t$result1 = mysqli_query($con,\"TRUNCATE kb_table_1\");\n\t$result2 = mysqli_query($con,\"TRUNCATE kb_table_2\");\n\tif(!($result1 && $result2))\n\t\t die(\"Tables not found\");\n}", "function checkTablesIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n \n \n // Check the taxonomy table..\n if (!isset($tables[$this->prefix.\"taxonomy\"])) {\n return false; \n }\n \n // Now, iterate over the contenttypes, and create the tables if they don't exist.\n foreach ($this->config['contenttypes'] as $key => $contenttype) {\n\n $tablename = $this->prefix . makeSlug($key);\n \n if (!isset($tables[$tablename])) {\n return false; \n }\n \n // Check if all the fields are present in the DB..\n foreach($contenttype['fields'] as $field => $values) {\n if (!isset($tables[$tablename][$field])) {\n return false;\n }\n }\n \n }\n\n \n return true; \n \n }", "public function duplicateTableStructure( $table, $newTableName )\n\t{\n\t\treturn $this->query( \"CREATE TABLE `{$this->prefix}{$newTableName}` LIKE `{$this->prefix}{$table}`\" );\n\t}", "public function semiEmpty()\n\t{\n//\t\t$dfp\t= $this->_prename. \"/\".$this->_name.\".db\";\n//\t\t$ret\t= copy($dfp, $this->_prename. \"/bc/\".$this->_name.\".db\".'.bc');\n//\t\tif(!ret) return false;\n//\t\t$this->_dbh($this->_name);\n//\t\t$this->delete('');\n//\t\treturn true;\n\t}", "public function tableExists($table)\n {\n return $this->query($table);\n }", "static function check_exist($table){\n\t\t$db = JFactory::getDbo();\n\t\t$table_name = str_replace('#__', $db->getPrefix(),$table);\n\t\treturn in_array($table_name,$db->getTableList());\t\t\n\t}", "private function populateDummyTable() {}", "function pg_copy_to($connection, string $table_name, string $delimiter = null, string $null_as = null): array\n{\n error_clear_last();\n if ($null_as !== null) {\n $result = \\pg_copy_to($connection, $table_name, $delimiter, $null_as);\n } elseif ($delimiter !== null) {\n $result = \\pg_copy_to($connection, $table_name, $delimiter);\n } else {\n $result = \\pg_copy_to($connection, $table_name);\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "abstract public function tableExists($tableName);", "private function checkTable()\n\t{\n\t\t$erreur = array();\n\t\tinclude (dirname(__FILE__).'/sql/sql-install.php');\n\t\t// the array is called $sql;\n\n\t\tforeach ($sql as $key => $s)\n\t\t{\n\t\t\t// We check if the table allready exist\n\t\t\t$table_exist_sql = 'SHOW TABLES LIKE \\''._DB_PREFIX_.$key.'\\';';\n\t\t\tif (!Db::getInstance()->executeS($table_exist_sql))\n\t\t\t{\n\t\t\t\t//If the table not exist we install it\n\t\t\t\tDb::getInstance()->execute($s);\n\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t$erreur[] = $erreur_sql;\n\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t// If the table exist we verify the structure\n\t\t\t\tpreg_match_all('/`(\\w+)`/mi', $s, $matches); // We catch all the columns name of the table\n\t\t\t\t$final_columns = array_unique($matches[1]); // We erase the duplicate entry\n\t\t\t\t// We search in the array an entry who could be the name of the table\n\t\t\t\t$key_to_unset = array_search(_DB_PREFIX_.$key,$final_columns);\n\t\t\t\tif ($key_to_unset !== FALSE)\n\t\t\t\t\tunset($final_columns[(int)$key_to_unset]); // We unset it\n\t\t\t\t$final_columns = array_values($final_columns);\n\n\t\t\t\t$describe_sql = 'DESCRIBE '._DB_PREFIX_.$key;\n\t\t\t\t$existing_columns = Db::getInstance()->executeS($describe_sql);\n\t\t\t\t$existing_columns = array_column($existing_columns, 'Field');\n\t\t\t\t$nfinal_columns = count($final_columns);\n\t\t\t\tfor ($i = 0; $i < $nfinal_columns; $i++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($final_columns[$i],$existing_columns)) // If we don't find the item in existing table, we create it\n\t\t\t\t\t{\n\t\t\t\t\t\t$pattern = '/`'.(string)$final_columns[$i].'`(.+),\\n/i';\n\t\t\t\t\t\tpreg_match($pattern, $s, $columns_spec);\n\t\t\t\t\t\t$sql_append_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` ADD `'.(string)$final_columns[$i].'` '.$columns_spec[1];\n\t\t\t\t\t\tDb::getInstance()->execute($sql_append_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We check if in the existing table is there columns that need to be removed\n\t\t\t\t$nexisting_columns = count($existing_columns);\n\t\t\t\tfor ($j = 0; $j < $nexisting_columns; $j++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($existing_columns[$j],$final_columns)) // If an existing column is not in the futur table, we delete this field form the db\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_erase_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` DROP `'.(string)$existing_columns[$j].'`';\n\t\t\t\t\t\tDb::getInstance()->execute($sql_erase_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public function copy($tableId, $optParams = array())\n {\n $params = array('tableId' => $tableId);\n $params = array_merge($params, $optParams);\n return $this->call('copy', array($params), \"Google_Service_Fusiontables_Table\");\n }", "function tableExists($tablename);", "public function _table_exists($dbname,$tablename){\n \t$table_files=$this->_table_files($dbname,$tablename);\n foreach ($table_files as $file){\n if (!file_exists($file))\n return FALSE;\n }\n return TRUE;\n }", "public function tableIsPersisted($table)\n {\n return !empty($this->getColumns($table));\n }", "public function tableExists( $table )\n\t{\n\t\treturn $this->writer->tableExists( $table );\n\t}", "public function wipe($connection, $table);", "protected function _validate_insert($table = '')\n\t{\n\t\tif (count($this->qb_set) === 0)\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;\n\t\t}\n\n\t\tif ($table !== '')\n\t\t{\n\t\t\t$this->qb_from[0] = $table;\n\t\t}\n\t\telseif ( ! isset($this->qb_from[0]))\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {\n $result = true;\n $destination = _drush_policy_parse_alias($destination);\n\n if ($destination == '@prod') {\n $result = _drush_policy_override_validate($destination, 'database');\n }\n\n return $result;\n}", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "function VerifyPlayersTable($connection, $dbName) {\r\n if(!TableExists(\"players\", $connection, $dbName)) \r\n { \r\n\techo(\"Can't find players table\");\r\n}\r\n}", "function checkUserTableIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n return true; \n \n }", "function replicate($targetTable, $id = null)\n {\n if (is_null($id)) {\n $id = HTTP_Session::id();\n }\n\n // Check if table row already exists\n $query = sprintf(\"SELECT COUNT(id) FROM %s WHERE id = %s\",\n $targetTable,\n $this->db->quote(md5($id), 'text'));\n $result = $this->db->queryOne($query);\n if (MDB2::isError($result)) {\n $this->db->raiseError($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n // Insert new row into dest table\n if (0 == intval($result)) {\n $query = sprintf(\"INSERT INTO %s SELECT * FROM %s WHERE id = %s\",\n $targetTable,\n $this->options['table'],\n $this->db->quote(md5($id), 'text'));\n\n } else {\n // Update existing row\n $query = sprintf(\"UPDATE %s dst, %s src SET dst.expiry = src.expiry, dst.data = src.data WHERE dst.id = src.id AND src.id = %s\",\n $targetTable,\n $this->options['table'],\n $this->db->quote(md5($id), 'text'));\n }\n\n $result = $this->db->query($query);\n if (MDB2::isError($result)) {\n $this->db->raiseError($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n return true;\n }", "function verifyTable($database, $table)\n{\n\t$tableName = (string)$table->attributes()->name;\n\t$previousColumnName = null;\n\t\n\t//get the DB connection\n\t$testDB = gettestConnection();\n\t\n\t//get a description of the table\n\t$sql = \"DESC `$tableName`\";\n\t$desc = $testDB->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t//find the table in the XML master copy\n\tforeach ($database->{'table_structure'} as $t) {\n\t\tif ($tableName == $t->attributes()->name) {\n\t\t\t$masterTable = $t;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t//set master values\n\t$masterColumns = $masterTable->field;\n\t$masterKeys\t = $masterTable->key;\n\t$masterOptions = $masterTable->options;\n\t\n\t//verify columns are in sync using local vs master. Drop extra local columns. \n\tforeach ($desc as $column) {\n\t\t\n\t\t$cName = $column['Field'];\n\t\t$found = false;\n\t\t\n\t\t//find the master column desc\n\t\tforeach ($masterColumns as $c) {\n\t\t\tif ($cName == (string)$c->attributes()->Field) {\n\t\t\t\t\n\t\t\t\t$doesMatch = true;\n\t\t\t\t$found = true;\n\n\t\t\t\tif (trim($column['Field']) != trim((string)$c->attributes()->Field)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Type']) != trim((string)$c->attributes()->Type)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Null']) != trim((string)$c->attributes()->Null)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Key']) != trim((string)$c->attributes()->Key)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Default']) != trim((string)$c->attributes()->Default)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Extra']) != trim((string)$c->attributes()->Extra)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there are differences, call function to alter table\n\t\t\t\tif (!$doesMatch) {\n\t\t\t\t\talterColumn($tableName, $column, $c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if we didn't find the column, drop it\n\t\tif (!$found) {\n\t\t\t$sql = \"ALTER TABLE `$tableName` DROP `$cName`\";\n\t\t\t$testDB->exec($sql);\n\t\t}\n\t}\n\t\n\t//verify columns are in sync using master vs local in case columns don't exist locally. Add missing columns.\n\t$previousColumnName = null;\n\tforeach ($masterColumns as $c) {\n\t\n\t\t$found = false;\n\t\n\t\t//find the master column desc\n\t\tforeach ($desc as $column) {\n\t\t\t$cName = $column['Field'];\n\t\t\tif ($cName == (string)$c->attributes()->Field) {\n\t\n\t\t\t\t$found = true;\n\t\t\t\t\n\t\t\t\t//we already synced up existing columns, so no need to check again. This\n\t\t\t\t//is only to find missing local columns.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if we didn't find the column, add it\n\t\tif (!$found) {\n\t\t\taddColumn($tableName, (string)$c->attributes()->Field, $c, $previousColumnName);\n\t\t}\n\t\t\n\t\t//track the previous column for alters\n\t\t$previousColumnName = (string)$c->attributes()->Field;\n\t\n\t}\t\n\t\n\t//verify the keys are in sync\n\t$sql = \"SHOW INDEXES FROM `$tableName`;\";\n\t$indexes = $testDB->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t//compare master to local, and add any missing keys\n\tforeach ($masterKeys as $key) {\n\t\t\n\t\t$kName = (string)$key->attributes()->Key_name;\n\t\t$cName = (string)$key->attributes()->Column_name;\n\t\t$found = false;\n\t\t\n\t\tforeach ($indexes as $index) {\n\t\t\t\n\t\t\tif ($index['Key_name'] == $kName) {\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$found) {\n\t\t\t//add the index\n\t\t\tif ($kName == 'PRIMARY') {\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD PRIMARY KEY ( `\".$key['Column_name'].\"` )\";\n\t\t\t} elseif (preg_match('/-FK/i', $kName) ||\n\t\t\t\tpreg_match('/FK_/i', $kName)) {\n\t\t\t\t//add the key\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD KEY `$kName` ( `$cName` ) \";\n\t\t\t\t$testDB->exec($sql);\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD CONSTRAINT `$kName` FOREIGN KEY ( `$cName` ) REFERENCES `\".strtolower($cName).\"` (`$cName`) ON DELETE NO ACTION ON UPDATE CASCADE\";\n\t\t\t}else {\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD UNIQUE `$kName` ( `\".$key['Column_name'].\"` ) \";\n\t\t\t}\n\t\t\t\n\t\t\t$testDB->exec($sql);\n\t\t}\n\t\n\t}\n}", "private function createIfNotExists()\n {\n $table = new Table('schema_migration');\n if ($this->info->isTableExists($table)) {\n return;\n }\n $primaryKey = new PrimaryKey(array('version'));\n $primaryKey->disableAutoIncrement();\n\n $table->addConstraint($primaryKey);\n $table\n ->addColumn(new BigIntegerColumn('version'))\n ->addColumn(new DateTimeColumn('created_at', array('nullable' => false, 'default' => 'now()')));\n $this->manipulation->create($table);\n }", "public function cleanCopy();", "function Ensuretable()\n {\n $result = mysqli_query(\"SHOW COLUMNS FROM $this->tablename\"); \n if(!$result || mysqli_num_rows($result) <= 0)\n {\n return $this->CreateTable();\n }\n return true;\n }", "public function dropIfExists(string $table)\n {\n $this->build(tap($this->createBlueprint($table), function (Blueprint $blueprint) {\n $blueprint->dropIfExists();\n }));\n }", "public function checkIfTableExists($tableName, OutputInterface $o)\n {\n $db = new db;\n\n \n try\n\t {\n $db->limit(1)->get($tableName);\n }\n\tcatch(\\Shadowapp\\Sys\\Exceptions\\Db\\WrongQueryException $e)\n\t{\n $o->writeln(\" \\033[41m Table \".$tableName.\" does not exists \\033[0m \"); \n\t}\n }", "function tep_db_table_exists($table, $link = 'db_link') {\n $result = tep_db_query(\"show table status from `\" . DB_DATABASE . \"`\");\n while ($list_tables = tep_db_fetch_array($result)) {\n if ($list_tables['Name'] == $table) {\n return true;\n }\n }\n return false;\n }", "function checkTableExist( $conn, $table_name )\n {\n return mysqli_query( $conn, 'select 1 from ' . $table_name );\n }", "public function isCopyQueueEmpty() {}", "private function createDummyTable() {}", "private function verify ()\n {\n // test if Database exists\n try {\n $db = $this->getDefaultAdapter();\n } catch (Exception $e) {\n throw new Zend_Exception($e->getMessage());\n }\n \n // test if table exists\n try {\n $result = $db->describeTable($this->_name);\n \n if (empty($result)) {\n $this->createTable();\n $this->insertRows();\n }\n } catch (Exception $e) {\n $this->createTable();\n $this->insertRows();\n }\n }", "public static function copyIfNone($from, $to)\n\t{\n\t\tif (self::exists($to)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tself::copy($from, $to);\n\t}", "private function check_head($table, $head)\n {\n $checked_head = $table->columns->filter(function($column) use($head) {\n return !array_key_exists($column->name, $head ? $head : []);\n });\n\n if (!$checked_head->isEmpty())\n throw new RowsImportException(['head' => $checked_head]);\n\n }", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "public function ensureTable($table, $relationship = NULL) {\n return $table;\n }", "public function dropTableIfExists(string $table)\n {\n echo \" > dropping $table if it exists ...\";\n $time = microtime(true);\n $this->db->createCommand()\n ->dropTableIfExists($table)\n ->execute();\n echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . \"s)\\n\";\n }", "function testTableExist()\n{\n\tglobal $db,$conf,$langs;\n\t\n\t$checktable = $db->query(\"SHOW TABLES LIKE '\".MAIN_DB_PREFIX.\"materiels'\");\n\tif (($checktable)&&($db->num_rows($checktable)<=0))\n\t{\n\t\t$db->query(\"CREATE TABLE \".MAIN_DB_PREFIX.\"materiels (rowid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,ref VARCHAR(50) NOT NULL,socid INT(6),marque VARCHAR(50),model VARCHAR(50),noserie VARCHAR(50),options TEXT,note_public TEXT,date_achat DATE,garantie INT(1))\");\n\t}\n}", "public function testValidatorForRequiredForEmpty()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => '',\n 'table_id' => null,\n 'starting_row_number' => null,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\n \"datasource_name\" => [\"データソース名は必ず指定してください。\"],\n \"starting_row_number\" => [\"開始行は必ず指定してください。\"],\n \"table_id\" => [\"テーブルIDは必ず指定してください。\"],\n ]);\n }", "function getDestTableName() {\n return $this->destTableName;\n }", "private function redirectsTable()\n\t{\n\t\t$table_installed = get_option('replace_media_redirects_table_installed');\n\t\tif ( $table_installed ) return;\n\n\t\tglobal $wpdb;\n\t\t$tablename = $wpdb->prefix . 'replace_media_redirects';\n\t\tif ( $wpdb->get_var('SHOW TABLES LIKE \"' . $tablename . '\"') != $tablename ) :\n\t\t\t$sql = 'CREATE TABLE ' . $tablename . '(\n\t\t\t\tid INTEGER(10) UNSIGNED AUTO_INCREMENT,\n\t\t\t\ttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\tattachment_id INTEGER(10),\n\t\t\t\tsource MEDIUMTEXT,\n\t\t\t\tdestination MEDIUMTEXT,\n\t\t\t\tuser_id INTEGER(10),\n\t\t\t\tPRIMARY KEY (id) ) \n\t\t\t\tCHARACTER SET utf8;';\n\t\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\tdbDelta($sql);\n\t\t\tupdate_option('replace_media_redirects_table_installed', true);\n\t\tendif;\n\t}", "public function testSaveDataTableNoDataTable() {\r\n $this->setExpectedException('Exception', 'No data table given.');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', null);\r\n\t}", "public function testInitializeNoTables() {\n $sink = new Sink;\n $result = $sink->initialize();\n $this->assertEquals(0, count($result));\n }", "public function isMigratingUp();", "public function checkForTable( $table );", "protected function excludeTable() {\n\t\t$this\n\t\t\t\t// check if table parameter is set and in session\n\t\t\t->checkTableAccess()\n\t\t\t\t// mark table as excluded\n\t\t\t->removeTableFromExtConf('tablesExclude')\n\t\t\t->addTableToExtConf('tablesExclude');\n\t\techo 'ok-excluded';\n\t\texit;\n\t}", "public function checkDatabaseStructure( );", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public function wp_clean_sql()\n\t{\n\t\t$bdd = Bdd::getInstance();\n\n\t\t$sql = $bdd->dbh->prepare(\"SHOW TABLES LIKE '\".$this->_table_prefix.\"%'\");\n\t\t$sql->execute();\n\t\t$tables = $sql->fetchAll();\n\n\t\tforeach ($tables as $table)\t{\n\t\t\t$table_name = $table[0];\n\n\t\t\t// To rename the table\n\t\t\t$sql1 = $bdd->dbh->prepare(\"DROP TABLE `{$table_name}`\");\n\t\t\t$sql1->execute();\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function table_exists($table){\n\t\t$table = strtolower($table);\n\t\t$num = $this->fetch_one(\"select count(*) from information_schema.tables where table_schema = 'public' and table_name='$table'\");\n\t\treturn $num[0];\n\t}", "public function initialized()\n {\n return $this->connection->getSchemaManager()->tablesExist([self::SNAPSHOTS_TABLE]);\n }", "private function compareTables($table, $tableMemory)\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($table) && $connection->schema->getTable($tableMemory)) {\n $tableColumns = $connection->schema->getTable($table)->columns;\n $tableMemoryColumns = $connection->schema->getTable($tableMemory)->columns;\n if (count($tableColumns) !== count($tableMemoryColumns)) {\n return false;\n }\n foreach (array_keys($tableColumns) as $key) {\n if (get_object_vars($tableColumns[$key]) !== get_object_vars($tableMemoryColumns[$key])) {\n return false;\n }\n }\n $sourceCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($table))->queryScalar();\n $destinationCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($tableMemory))->queryScalar();\n if ($sourceCount !== $destinationCount) {\n return false;\n }\n } elseif ($connection->schema->getTable($table) === null || $connection->schema->getTable($tableMemory) === null) {\n return false;\n }\n return true;\n }", "public function fullDrop($table)\n\t{\n//\t\tif(is_object($this->_dbh))\t$this->_dbh->closeConnection();\n//\t\treturn unlink($this->_prename. \"/\".$this->_name.\".db\");\n\t}", "function emptyIndexTable(){\n\t\t$this->ecmDBhandle->truncateTable($this->dfs_db-> table_name);\n\t}", "function Sql_Table_Drop($table=\"\")\n {\n if ($this->Sql_Table_Exists($table)>0)\n {\n $this->QueryDB\n (\n $this->Sql_Table_Drop_Query($table)\n );\n $this->AddMsg(\"Table \".$table.\" has been dropped\");\n }\n }" ]
[ "0.5905646", "0.5847931", "0.58424616", "0.57968694", "0.56508213", "0.56473243", "0.5598984", "0.55865467", "0.5556654", "0.5514695", "0.5490318", "0.5481813", "0.540932", "0.54080635", "0.54080635", "0.5397256", "0.5388375", "0.5372643", "0.53482544", "0.5347975", "0.534673", "0.53421044", "0.5326011", "0.53251433", "0.5313063", "0.53122413", "0.5310533", "0.5293625", "0.5289729", "0.52603114", "0.5235959", "0.52079535", "0.5192995", "0.519199", "0.5184135", "0.5180167", "0.5177473", "0.51647854", "0.5156924", "0.5147861", "0.51458144", "0.5137006", "0.51319474", "0.51113075", "0.5107997", "0.5101327", "0.5100151", "0.50990593", "0.5087829", "0.5084639", "0.50703406", "0.50570387", "0.5051739", "0.50479394", "0.50447387", "0.5034044", "0.5031712", "0.50272495", "0.50015354", "0.49967548", "0.49960488", "0.49934563", "0.49871805", "0.49832046", "0.4982392", "0.4980966", "0.49732402", "0.49618685", "0.49539053", "0.49529058", "0.49514255", "0.494976", "0.49456587", "0.49424303", "0.49406743", "0.49378157", "0.49353108", "0.4934052", "0.49337173", "0.49294505", "0.49246112", "0.49245712", "0.49228114", "0.49184114", "0.49116036", "0.49048445", "0.49041134", "0.48984015", "0.48927048", "0.48925635", "0.489052", "0.48893216", "0.4879112", "0.487888", "0.48775822", "0.48758736", "0.4875834", "0.4872734", "0.48682562", "0.48671523" ]
0.7553517
0
Check if "height" has been set
Проверьте, было ли задано значение "height"
public function hasHeight() : bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasHeight()\n {\n return $this->height !== null;\n }", "public function hasImageHeight()\n {\n return $this->image_height !== null;\n }", "public function isAutoHeight() {\n\t\tif ($this->_height==0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setHeight($height)\n {\n if(is_numeric($height) && $height > 0)\n {\n $this->height = (int)$height;\n \n return true;\n }\n \n return false;\n }", "public function setHeight($height) {}", "function set_height($height) {\n $this->height = $height;\n }", "public function setHeight($height);", "public function setHeight($height);", "protected function checkHeight(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_Height) && $this->_Height !== null && $this->_Height !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_Height} is not a valid value for Height\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "function getHeight() {\n\t\t}", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function testHeightWithInteger()\n {\n $this->box->setHeight(300);\n static::assertEquals(300, $this->box->getHeight());\n }", "public function isManualHeightMode()\n {\n return ($this->HeightMode == self::HEIGHT_MANUAL);\n }", "function getHeight();", "public function getDefaultHeight() : ?float;", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "final public function get_height()\n {\n return $this->height;\n }", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }", "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function checkMaxHeight()\n {\n if (!isset($this->maxHeight)) {\n return true;\n }\n if (false !== $dimension = getimagesize($this->mediaTmpName)) {\n if ($dimension[1] > $this->maxHeight) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_HEIGHT_TO_LARGE, $this->maxHeight, $dimension[1]));\n return false;\n }\n } else {\n trigger_error(sprintf(\\XoopsLocale::EF_IMAGE_SIZE_NOT_FETCHED, $this->mediaTmpName), E_USER_WARNING);\n }\n return true;\n }", "protected function height() {\n return $this->height;\n }", "#[@fromDia(xpath= 'dia:attribute[@name=\"height\"]/dia:real/@val', value= 'real')]\n public function setHeight($height) {\n $this->setReal('height', $height);\n }", "public function getFrameHeight() {}", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "public function height() : int;", "public function setHeight($height) {\n\t\t$height = (int) $height;\n\t\t$this->height = (($height > 0) && ($height <= self::MAX_HEIGHT)) ? $height : self::DEFAULT_HEIGHT;\n\t}", "public function setHeight($height)\r\n {\r\n if (is_numeric($height))\r\n {\r\n $this->height = (int)$height;\r\n }\r\n }", "public function hasWidth()\n {\n return $this->width !== null;\n }", "public function setHeight($height)\n\t{\n\t\tif (preg_match ( '/^\\d+$/', $height ))\n\t\t{\n\t\t\tif ($height > 0)\n\t\t\t{\n\t\t\t\t$this->_height = $height;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be greater than zero.');\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be an integer.');\n\t\t}\n\t}", "public function hasSizes() {\n if (!empty($this->cropBox['width'])) {\n return TRUE;\n }\n\n if (!empty($this->cropBox['height'])) {\n return TRUE;\n }\n\n return FALSE;\n }", "public function testHeightWithNumericString()\n {\n $this->box->setHeight('300');\n static::assertEquals(300, $this->box->getHeight());\n }", "public function testHeightWithFloat()\n {\n $this->box->setHeight(300.10);\n static::assertEquals(300, $this->box->getHeight());\n }", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function getHeight() : ?float ;", "public function getHeight()\n {\n return $this->height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "public function hasCollisionHeightM()\n {\n return $this->collision_height_m !== null;\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function setHeight($height = 40)\n {\n $this->height = $height;\n $this->setAttributes(\"Height\");\n }", "public function setHeight($height)\n {\n $this->height = (int) $height;\n }", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getHeight()\n {\n return $this->data->height;\n }", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getTextHeight() {}", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function testHeightenWithZeroHeight()\n {\n $this->box->setWidth(0);\n static::setExpectedExceptionRegExp('InvalidArgumentException');\n $this->box->heighten(20);\n }", "public function setHeight($height) {\n $this->h = $height;\n }", "public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }", "public function hasSize() {\n return $this->_has(2);\n }", "public function testSetMaxDimensionsNotNumericHeight() {\n $this->assertFalse($this->up->setMaxDimensions(640, \"world\"));\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "public function setHeight($height) {\n\t\t$this->_height=$height;\n\t\t$this->_autoHeight=$height;\n\t}", "function height($h) {\r\n\t\treturn ((!empty($h)) ? ' height:'.$h. 'px;' : '');\r\n\t}", "private function getPlotHeight() {\n\t\treturn $this->plotHeight;\n\t}", "protected function update_size($width = \\false, $height = \\false)\n {\n }", "public function setHeight($value)\n {\n $this->height = (int) $value;\n\n if ($this->height < 1) {\n throw new \\RuntimeException('Height must be greater than 0: ' . $this->height);\n }\n }", "public function get_image_height()\n {\n }", "public function testSetHeightProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setHeight($value);\n $this->assertEquals($value, $product->getHeight());\n }", "public function getHeight() {\n\t\treturn $this->_height;\n\t}" ]
[ "0.79277056", "0.7188172", "0.7042197", "0.69540477", "0.69267553", "0.6717599", "0.67155147", "0.67155147", "0.6697209", "0.6588197", "0.6493271", "0.6438556", "0.6433856", "0.6419823", "0.6398155", "0.6343338", "0.63297224", "0.62741965", "0.62739795", "0.62729853", "0.62729853", "0.62729853", "0.62729853", "0.62729853", "0.6272496", "0.62608916", "0.6246483", "0.6245865", "0.6243967", "0.62245077", "0.62236315", "0.62236315", "0.6203089", "0.6203089", "0.6203089", "0.6203089", "0.6203089", "0.6197136", "0.6175905", "0.6152071", "0.61259556", "0.6086309", "0.6086309", "0.6086309", "0.6086309", "0.6067782", "0.60607046", "0.6059273", "0.6029829", "0.6027363", "0.60218316", "0.601892", "0.6016738", "0.6010795", "0.60024506", "0.5991593", "0.5989534", "0.598656", "0.598656", "0.598553", "0.59736174", "0.5964985", "0.5964357", "0.59568423", "0.59564227", "0.59442157", "0.5943172", "0.59318316", "0.59288436", "0.5922183", "0.5922183", "0.5922183", "0.5918573", "0.590161", "0.58946675", "0.5888514", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5878623", "0.5867618", "0.586678", "0.58572525", "0.5840509", "0.5833864", "0.58243966", "0.5821984", "0.57967395", "0.5790262", "0.5786838", "0.57788944", "0.5774611", "0.57689" ]
0.7917462
1
Get a default "height" value, if any is available
Получить значение по умолчанию "height", если оно доступно
public function getDefaultHeight() : ?float;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "final public function get_height()\n {\n return $this->height;\n }", "function getHeight() {\n\t\t$myHeight = $this->getElementText(DOMIT_RSS_ELEMENT_HEIGHT);\n\n\t\tif ($myHeight == '') {\n\t\t\t$myHeight = '31';\n\t\t}\n\t\telse if (intval($myHeight) > 400) {\n\t $myHeight = '400';\n\t\t}\n\n\t\treturn $myHeight;\n\t}", "public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function getStyleHeight()\n\t{\n\t\tif (!$this->getBox()->isForMeasurement()) {\n\t\t\treturn '0';\n\t\t}\n\t\t$height = $this->getBox()->getStyle()->getRules('height');\n\t\tif ('auto' === $height) {\n\t\t\treturn null;\n\t\t}\n\t\t$percentPos = strpos($height, '%');\n\t\tif (false !== $percentPos) {\n\t\t\t$widthInPercent = substr($height, 0, $percentPos);\n\t\t\t$closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();\n\t\t\tif (null !== $closestBoxDimensions->getHeight()) {\n\t\t\t\t$parentHeight = $closestBoxDimensions->getInnerHeight();\n\t\t\t\tif ($parentHeight) {\n\t\t\t\t\treturn Math::percent($widthInPercent, $parentHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn $height;\n\t\t}\n\t\treturn null;\n\t}", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "protected function height() {\n return $this->height;\n }", "public function getHeight() : ?float ;", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->data->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n\t\t}", "public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function height() : int;", "public function getHeightN()\n {\n if (! isset($this->heightN)) {\n $this->heightN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightN;\n }", "public function getHeight()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->h);\n }", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getHeight() { return 0; }", "function getHeight();", "public function getHeight(): int\n {\n return $this->height;\n }", "public function height($manipulation_name = '')\n\t{\n\t\treturn $this->row_field('height');\n\t}", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "public function getHeightS()\n {\n if (! isset($this->heightS)) {\n $this->heightS = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightS;\n }", "public function getHeight() {\n\t\treturn $this->_height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function getHeightO()\n {\n if (! isset($this->heightO)) {\n $this->heightO = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightOQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightO;\n }", "public function height() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$height = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$height = $dims['height'];\n\t\t\t}\n\n\t\t\treturn $height;\n\t\t});\n\t}", "public function getPixelHeight()\n {\n return isset($this->pixel_height) ? $this->pixel_height : null;\n }", "public function getHeightT()\n {\n if (! isset($this->heightT)) {\n $this->heightT = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightTQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightT;\n }", "public function getHeightM()\n {\n if (! isset($this->heightM)) {\n $this->heightM = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightM;\n }", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "public function getPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"pixel_height\");\n }", "public function getHeight(): int\n {\n $height = getenv('LINES');\n if (false !== $height) {\n return (int) trim($height);\n }\n\n if (null === self::$height) {\n self::initDimensions();\n }\n\n return self::$height ?: 50;\n }", "public function getTextHeight() {}", "public function getHeightZ()\n {\n if (! isset($this->heightZ)) {\n $this->heightZ = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightZQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightZ;\n }", "public function getHeight()\n {\n if (!isset($this->height)) {\n $this->height = ps_get_value($this->document->resource, \"imageheight\", $this->id);\n }\n\n return $this->height;\n }", "function iver_select_set_default_logo_height_for_header_types() {\n\t\t$logo_height_meta = iver_select_filter_px( iver_select_options()->getOptionValue( 'logo_area_height' ) );\n\t\t$logo_height = !empty($logo_height_meta) ? intval( $logo_height_meta ) : 74;\n\t\t\n\t\treturn apply_filters('iver_select_set_default_logo_height_value_for_header_types', $logo_height);\n\t}", "function height($h) {\r\n\t\treturn ((!empty($h)) ? ' height:'.$h. 'px;' : '');\r\n\t}", "public function getHeight(): int\n {\n return (int) $this->height;\n }", "public function getPreviewPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"preview_pixel_height\");\n }", "public function getFrameHeight() {}", "public function get_image_height()\n {\n }", "public function getHeightQ()\n {\n if (! isset($this->heightQ)) {\n $this->heightQ = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightQQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightQ;\n }", "function pxlz_edgtf_set_default_logo_height_for_header_types() {\n $logo_height_meta = pxlz_edgtf_filter_px(pxlz_edgtf_options()->getOptionValue('logo_area_height'));\n $logo_height = !empty($logo_height_meta) ? intval($logo_height_meta) : 70;\n\n return apply_filters('pxlz_edgtf_set_default_logo_height_value_for_header_types', $logo_height);\n }", "function wpex_header_logo_img_height() {\n\t$height = apply_filters( 'logo_height', wpex_get_mod( 'logo_height' ) );\n\treturn $height ? intval( $height ) : ''; // can't be 0\n}", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "public function getHeightC()\n {\n if (! isset($this->heightC)) {\n $this->heightC = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightCQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightC;\n }", "function iver_select_set_default_menu_height_for_header_types() {\n\t\t$menu_height_meta = iver_select_filter_px( iver_select_options()->getOptionValue( 'menu_area_height' ) );\n\t\t$menu_height = !empty($menu_height_meta) ? intval( $menu_height_meta ) : 74;\n\t\t\n\t\treturn apply_filters('iver_select_set_default_menu_height_value_for_header_types', $menu_height);\n\t}", "function spectra_block_height ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT MAX(`height`) as `height` FROM `\".$GLOBALS[\"tables\"][\"block\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\treturn $result[\"height\"];\n\t}", "public function getHeightSq()\n {\n if (! isset($this->heightSq)) {\n $this->heightSq = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSqQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightSq;\n }", "function pxlz_edgtf_set_default_menu_height_for_header_types() {\n $menu_height_meta = pxlz_edgtf_filter_px(pxlz_edgtf_options()->getOptionValue('menu_area_height'));\n $menu_height = !empty($menu_height_meta) ? intval($menu_height_meta) : 70;\n\n return apply_filters('pxlz_edgtf_set_default_menu_height_value_for_header_types', $menu_height);\n }", "public function getXHeight() {}", "public function getMaxHeight()\n {\n return $this->_maxHeight;\n }", "public function testSetBarcodeHeightDefault()\n {\n $this -> printer -> setBarcodeHeight();\n $this -> checkOutput(\"\\x1b@\\x1dh\\x08\");\n }", "public function getXHeight() {}", "public function getHeight() {\n return $this->h;\n }" ]
[ "0.7458024", "0.71031207", "0.7059774", "0.69578683", "0.6941431", "0.69215465", "0.69151694", "0.68585867", "0.6852155", "0.6851212", "0.68489146", "0.68489146", "0.6848284", "0.68094987", "0.6799212", "0.6799121", "0.6799121", "0.6799121", "0.6799121", "0.6799121", "0.67986935", "0.6751598", "0.6751598", "0.6751598", "0.6744383", "0.6724125", "0.670683", "0.66799605", "0.66637063", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66217387", "0.66217387", "0.66217387", "0.66217387", "0.66217387", "0.65812397", "0.65770364", "0.65603286", "0.6555769", "0.65521103", "0.65518916", "0.6550399", "0.65367454", "0.65303713", "0.65235144", "0.65204656", "0.6505687", "0.65003777", "0.6499704", "0.6493124", "0.6482031", "0.6476264", "0.6476264", "0.6476264", "0.6462818", "0.6462017", "0.6462017", "0.6462017", "0.6462017", "0.6459596", "0.64480066", "0.6441704", "0.6439773", "0.64258397", "0.64213616", "0.6406937", "0.6406221", "0.63809836", "0.63630944", "0.63416684", "0.6297085", "0.6294309", "0.627356", "0.62548125", "0.62471944", "0.6240943", "0.6234241", "0.62333524", "0.6219109", "0.62122643", "0.62122643", "0.6211205", "0.6199246", "0.6197991", "0.6194984", "0.618342", "0.6165001", "0.61646414", "0.61627877", "0.61625713", "0.61404073" ]
0.83512485
0
Get Products by criteria.
Получить продукты по критериям.
public function getProducts($criteria = []) { if (!$criteria instanceof ElementCriteriaModel) { $criteria = craft()->elements->getCriteria('DigitalProducts_Product', $criteria); } return $criteria->find(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }", "public function getBy(array $criteria);", "protected function products()\n {\n return Product::enabled()->withImages()\n ->where('title', 'like', \"%{$this->query}%\")\n ->orWhere('description', 'like', \"%{$this->query}%\")\n ->orderBy('updated_at', 'desc')\n ->get();\n }", "public function getMatchingProduct($request);", "public function getProducts($params, $request);", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function getProducts($columns=null, $conditions=null){\n return $this->productsRepository->getProducts($columns, $conditions);\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function getProducts(){\n\t\t$user = Auth::user();\n\t\tif($user->hasRole('admin')){\n\t\t\t$products = Product::all();\n\t\t}\n\t\telse if($user->hasRole('distributor') || $user->hasRole('sub_distributor')){\n\t\t\t$products = Product::where('days', '!=', 0)->get();\n\t\t}\n\t\treturn $products;\n\t}", "public function getSpecific()\n {\n $qb = $this->em->createQueryBuilder();\n $results = $qb->select('p')\n ->from('Plugin\\DoctrineExample\\Entity\\Product', 'p')\n ->orderBy('p.title', 'ASC')->getQuery()->execute();\n return $results;\n }", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function findBy($criteria);", "public function findBy($criteria);", "public function getProducts($conditionsQuery=\"1\"){\n $products=Db::query(\"SELECT * FROM \".PRODUCT_TABLE_NAME.\" WHERE id IN ( SELECT product_id FROM \".CATEGORY_PRODUCT_TABLE_NAME.\" WHERE category_id='$this->categoryId') AND $conditionsQuery\");\n\n if($products=$products->fetchAll(PDO::FETCH_NAMED)){\n return $products;\n }else{\n return false;\n }\n }", "public static function getProducts($options = array()) {\n $perPage = isset($options['perPage']) ? $options['perPage'] : config('app.paging');\n \n $obj = static::with(['ratingArr'])->where('status', '=', 'active')->orderBy('id')->paginate($perPage);\n return $obj;\n }", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function products($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'products', $_query);\r\n }", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public static function doSelect(Criteria $criteria, PropelPDO $con = null)\n {\n return GsGeneriekeProductenPeer::populateObjects(GsGeneriekeProductenPeer::doSelectStmt($criteria, $con));\n }", "public function getCriteria();", "public function findProduct(Request $request)\n {\n $user = auth()->user();\n $limite = 3;\n if ($request->limit) {\n $limite = 10;\n }\n $product = '%'.$request->product.'%';\n $products = DB::select('SELECT products.name,products.id,\n products.code,products.price\n FROM products\n INNER JOIN users ON users.id = products.created_by_id\n WHERE products.name LIKE ? OR products.code LIKE ? AND users.organization_id = ? LIMIT ?',\n [$product,$product,$user->organization_id,$limite]);\n if ($request->limit) {\n $returnHTML = view('product.searchedDataModal',['products'=> $products])->render();\n } else {\n $returnHTML = view('product.searchedData',['products'=> $products])->render();\n }\n return response()->json(array('success' => true, 'html'=>$returnHTML));\n }", "public function getMatchingProductForId($request);", "public function get_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product.product_id', 'product_category.name as category_name', 'product.product_category_id','product_category.url_slug as product_category_url_slug', 'product.product_type_id','product_sizes.size_id as size_id','product_sizes.price as menu_price','sizes.sizes as size'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->join('product_sizes', 'product_sizes.product_id = product.product_id','left');\n $this->db->join('sizes', 'product_sizes.size_id = sizes.id','left');\n \n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n return $this->db->get()->result_array();\n }", "public function ProductSearch() {\n\t\t\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$seller_id\t\t\t=\t$search_data['seller_id'];\n\t\t\n\t\t$querydata \t\t= \t$this->_objectManager->create('Webkul\\Marketplace\\Model\\Product')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t\t['eq' => $seller_id]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'status',\n\t\t\t\t\t\t\t\t\t['eq' =>1]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->addFieldToSelect('mageproduct_id')\n\t\t\t\t\t\t\t\t->setOrder('mageproduct_id');\n\t\t\t//return \t$querydata->getData();\t\t\t\t\n\t\t\t$collection = $this->_productCollectionFactory->create()->addAttributeToSelect(\n '*'\n );\n\t\t$collection->addAttributeToFilter('entity_id', array('in' => $querydata->getData()));\n\t\t$collection->addAttributeToFilter('name', array('like' => '%'.$search_term.'%'));\n\t\t\t\n\t\treturn $collection->getData();\n\t\t\t\n }", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function getProduct();", "function get_product_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//where clause\n\t\t$this->db->select('rt_products.*, count(rt_touches.type_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_touches', 'rt_products.id = rt_touches.type_id');\n \t\t$this->db->where('rt_touches.type_name','product');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_touches.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['cat_id'] )) {\n\t\t\tif ($conds['cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.cat_id', $conds['cat_id'] );\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\tif ($conds['sub_cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['sub_cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.sub_cat_id', $conds['sub_cat_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n \t\t\n\t\tif ( isset( $conds['search_term'] ) || isset( $conds['date'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_touches.type_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_touches.added_date', \"desc\");\n \t\t\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n \t\t//print_r($this->db->last_query());die;\n\n\t}", "function getProducts($name, $categoryID, $salePriceMin, $salePriceMax, $basePriceMin, $basePriceMax)\n{\n global $conn;\n \n $sql = \"SELECT * FROM product WHERE 1=1 \";\n \n if (!empty($name))\n {\n $sql .= \" AND Name LIKE :productName\";\n $namedParameters[\":productName\"] = \"%\" . $name . \"%\";\n }\n \n if (!empty($categoryID))\n {\n $sql .= \" AND CategoryId = :categoryId\";\n $namedParameters[\":categoryId\"] = $categoryID;\n }\n \n if (!empty($salePriceMin) AND !empty($salePriceMax))\n {\n $sql .= \" AND SalePrice >= :salePriceMin AND SalePrice <= :salePriceMax \";\n $namedParameters[\":salePriceMin\"] = $salePriceMin;\n $namedParameters[\":salePriceMax\"] = $salePriceMax;\n }\n \n if (!empty($basePriceMin) AND !empty($basePriceMax))\n {\n $sql .= \" AND BasePrice >= :basePriceMin AND BasePrice <= :basePriceMax\";\n $namedParameters[\":basePriceMin\"] = $basePriceMin;\n $namedParameters[\":basePriceMax\"] = $basePriceMax;\n }\n \n $sql .= \" ORDER BY Name\";\n \n $stmt = $conn->prepare($sql);\n $stmt->execute($namedParameters);\n $records = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $records;\n}", "public function getActualActionProducts()\n {\n $actionGroupIds = $this->getActionGroupIds();\n $actionCategoriesIds = $this->getActionCategoryIds();\n $actionProductIds = $this->getActionProductIds();\n\n $query = Product::find()\n ->andWhere(['{{%sales_products}}.enabled' => true])\n ->orderBy(['{{%sales_products}}.title' => SORT_ASC]);\n\n if ($this->has_products) {\n // $query->andWhere(['{{%sales_products}}.is_show_in_catalog' => true]);\n } else {\n $dummyCategory = Category::findOne(['name' => Category::DUMMY_PLAN_CATEGORY_NAME]);\n $actionCategoriesIds[] = $dummyCategory->id;\n }\n\n if ($actionGroupIds) {\n $query->andWhere(['IN', 'group_id', $actionGroupIds]);\n }\n\n if ($actionCategoriesIds) {\n $query->andWhere(['IN', 'category_id', $actionCategoriesIds]);\n }\n\n if ($actionProductIds) {\n $query->andWhere(['IN', 'id', $actionProductIds]);\n }\n\n return $query;\n }", "public function getProducts()\n {\n\n $categories = ProductCategory::all();\n\n $products = Product::paginate(10);\n return $products;\n }", "public function index()\n {\n $request = request();\n $category_id = $request->input('category_id');\n $keyword = $request->input('q');\n\n $products = Product::when($category_id, function($query, $category_id) {\n return $query->where('category_id', $category_id);\n })\n ->when($keyword, function($query, $keyword) {\n return $query->where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('description', 'LIKE', \"%$keyword%\");\n })\n ->with('category')\n ->paginate();\n\n return $products;\n }", "protected function getProductCollection()\r\n {\r\n $searchCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToSelect('*')\r\n ->addAttributeToFilter('status', 1)\r\n ->addAttributeToFilter('visibility', 4);\r\n $searchCollection->getSelect()->limit($this->getProductsCount());\r\n $searchCollection->getSelect()->where(\"'\" . date('Y-m-d') . \"' BETWEEN special_from_date AND special_to_date\");\r\n $searchCollection->getSelect()->orWhere(\"'\" . date('Y-m-d') . \"' >= special_from_date\");\r\n// echo $searchCollection->getSelect()->__toString();\r\n return $searchCollection->load();\r\n }", "public function getAll()\n {\n if (Auth::user()->id_role == 1) \n {\n $company_id = GetSession::getCompanyId();\n }elseif(Auth::user()->id_role == 2)\n {\n $company_id = Auth::user()->id_company;\n }\n \n return Product::where('id_company', $company_id)->orderBy('created_at','desc')->get();\n }", "public abstract function getCriteriaWhere($criteria);", "function allproducts_get()\n\t{\n\t\t$is_exists=$this->user_model->get_joins('products',array('is_product'=>'Y'),'',array('catg_id','child_id','prod_detail','description','size','unit','mrp'));\n\t\t//print_r($is_exists);exit('u');\n\t\tif(!empty($is_exists))\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$is_exists));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>'No Product Found'),REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public abstract function getCriteriaFrom($criteria);", "public static function select_products_by_options($data)\n {\n \n $query = new Query;\n $products = $query->select(['core_products.*','core_product_images.*'])\n ->from('core_products')\n ->innerJoin('core_product_images', 'core_product_images.product_id=core_products.product_id');\n \n \n //if product type is set i.e., hire, sale or both\n if(isset($_REQUEST['product_type']) && @$_REQUEST['product_type'] != '')\n {\n if($_REQUEST['product_type'] != '')\n {\n $product_type= $_REQUEST['product_type'];\n if($product_type == 'hire') \n $products = $products->where(['core_products.product_type' => [0,2]]);\n else if($product_type == 'sale') \n $products = $products->where(['core_products.product_type' => [1,2]]);\n else if($product_type == 'both') \n $products = $products->where(['core_products.product_type' => [2]]);\n }\n \n }\n //default product type is hire if product type not set to anything\n else\n {\n \n $products = $products->where(\"core_products.product_type = 0\");\n }\n //if user selects the category\n if(isset($_REQUEST['category']))\n {\n \n if($_REQUEST['category'] != '')\n {\n $category_id = $_REQUEST['category'];\n $products = $products->andWhere(\"core_products.category_id = $category_id\");\n }\n }\n //if user selects sub category\n if(isset($_REQUEST['sub_category_id']) && @$_REQUEST['sub_category_id'] != '')\n {\n \n if($_REQUEST['sub_category_id'] != '')\n {\n $sub_category_id = $_REQUEST['sub_category_id'];\n $products = $products->andWhere(\"core_products.sub_category_id = $sub_category_id\");\n }\n }\n //if user sets current location\n if(@$_REQUEST['current_location'] != '')\n {\n \n $products = $products->andFilterWhere(['LIKE', 'core_products.current_location', $_REQUEST['current_location']]);\n }\n //if user sets price type\n if(@$_REQUEST['price_type'] != '')\n {\n $price_type =$_REQUEST['price_type'];\n $products = $products->andWhere(\"core_products.price_type = $price_type\");\n }\n //if user sets capacity range\n if(@$_REQUEST['capacity'] != '')\n {\n \n $capacity =$_REQUEST['capacity'];\n //if user selects between\n if (strpos($capacity, 'and') !== false) {\n $products = $products->andWhere(\"rtrim(substring_index(core_products.capacity, ' ', 1)) between $capacity\");\n }\n //if user selects morethan\n else if (strpos($capacity, '>') !== false) {\n $products = $products->andWhere(\"rtrim(substring_index(core_products.capacity, ' ', 1)) $capacity\");\n }\n }\n \n $products = $products->orderBy([\"core_products.product_id\" => SORT_DESC])\n ->andWhere(\"core_products.product_status = 1\")\n ->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->groupBy(['core_products.product_id'])\n ->all();\n return $products;\n }", "public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function findBy(array $criteria);", "public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }", "public function myProducts(){\n return Product::where('seller_id', auth()->user()->id)\n ->orderBy('name')\n ->orderBy('created_at')\n -> get() ?? response()->json(['message'=>__('messages.productsNotFound')], 404);\n }", "public function getCartProductsByHotelIds() {\n\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $hotel_id = func_get_arg(1);\n\n try {\n $select = $this->select()\n ->from(array('act' => 'addtocart'), array('act.id', 'act.product_id', 'act.user_id', 'act.hotel_id', 'act.quantity', 'act.cost', 'act.hotel_id'))\n ->setIntegrityCheck(FALSE)\n ->joinLeft(array('p' => 'products'), 'act.product_id=p.product_id', array('p.name', 'p.imagelink', 'p.cost AS product_cost'))\n ->joinLeft(array('hd' => 'hotel_details'), 'act.hotel_id=hd.id', array())\n ->where('act.user_id = ?', $user_id)\n ->where('act.hotel_id = ?', $hotel_id)\n ->where('p.prod_status = ?', 1)\n ->where('hd.hotel_status = ?', 1);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n return $result;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function showProducts()\n {\n /** @var ProductFinder $productFinder */\n $productFinder = PersistenceFactory::createFinder(Product::class);\n /** @var array $products */\n\n $criteria = isset($this->request->getGet()['criteria']) ? $this->request->getGet()['criteria'] : 'title';\n $order = isset($this->request->getGet()['order']) ? $this->request->getGet()['order'] : '';\n $search = isset($this->request->getGet()['search']) ? $this->request->getGet()['search'] : null;\n $products = $productFinder->findBy($criteria, $order, $search);\n $renderer = new HomePageRenderer();\n $renderer->render($products);\n }", "public function get_products() {\n $product_ids = array();\n\n\t\tforeach ( $this->get_conditions() as $condition ) {\n\t\t\tif ( isset( $condition['product_ids'] ) && is_array( $condition['product_ids'] ) ) {\n\t\t\t\t$product_ids = array_merge( $product_ids, $condition['product_ids'] );\n\t\t\t}\n\t\t}\n\n\t\t$products = array();\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t\tif ( $product ) {\n\t\t\t\t$products[$product_id] = wp_kses_post( $product->get_formatted_name() );\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n }", "abstract public function findBy($criteria);", "function products_from_request($page, $page_count){\n\tglobal $con;\n\t\n\t$args = [];\n\t$arg_types = \"\";\n\t$query = \"\n\t\tSELECT *\n\t\tFROM `products`\n\t\tINNER JOIN `categories`\n\t\t\tON `categories`.category_id = `products`.product_category\n\t\tINNER JOIN manufacturers\n\t\t\tON `manufacturers`.manufacturer_id = `products`.product_manufacturer\";\n\t\n\t// Now the dynamic part of our query, filtering logic\n\t\n\t$has_w = false;\n\t\n\t// view only products of a certain category.\n\tif(!empty($_GET['c'])){\n\t\t$args [] = &$_GET['c'];\n\t\t$query .= \" WHERE category_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// view only products of a certain manufacturer\n\tif(!empty($_GET['m'])) {\n\t\t$args [] = &$_GET['m'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" manufacturer_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// where the name of the product is...\n\tif(!empty($_GET['n'])) {\n\t\t$query_name = \"%\" . $_GET['n'] . \"%\";\n\t\t$args [] = &$query_name;\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_name LIKE ? \";\n\t\t$arg_types .= \"s\";\n\t\t$has_w = true;\n\t}\n\t\n\t// price range...\n\tif(!empty($_GET['p-min'])) {\n\t\t$args [] = &$_GET['p-min'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price >= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\tif(!empty($_GET['p-max']) ) {\n\t\t$args [] = &$_GET['p-max'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price <= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\t// ordering\n\t\n\tif(isset($_GET['o'])){\n\t\t$order = intval($_GET['o']);\n\t} else {\n\t\t$order = 1;\n\t}\n\t\n\tswitch($order){\n\t\tcase 1:\n\t\t\t$query .= \" ORDER BY product_name ASC \";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$query .= \" ORDER BY product_price DESC \";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$query .= \" ORDER BY product_price ASC \";\n\t\t\tbreak;\n\t}\n\t\n\t\n\t// now we want to limit number of rows we're getting.\n\t$from = ($page - 1) * 20;\n\t$query .= \" LIMIT $from, 20 \";\n\t\n\t\n\t// Now put the query together...\n\tif(count($args) > 0){\n\t\t// the input data types string is the first argument to the bind_param \n\t\t// method, so we have to prepend it at the start of the args array\n\t\tarray_unshift($args, $arg_types);\n\t\t\n\t\t$prep = $con->prepare($query);\n\t\t\n\t\t// since the bind_param is a vararg function, we need to use some\n\t\t// funky shit... i.e., we need to be able to call the function by \n\t\t// passing an array of our arguments.\n\t\tcall_user_func_array(array($prep,'bind_param'), $args);\n\t\t\n\t\t$prep->execute();\n\t\t$result = $prep->get_result();\n\t\t$prep->close();\n\t\t\n\t} else {\n\t\t$result = $con->query($query);\n\t}\n\treturn $result;\n\t\n}", "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "public function getBywhere($condition)\n {\n return $this->productRepository->getBywhere($condition);\n }", "public static function findby($where)\n {\n // obtiene todos los identificadores de productos que cumplan la \n // condicion\n $ids = \\database\\DAOFactory::getDAO(\"product\")->select([\"idProducto\"], $where);\n if (!$ids) return array();\n\n // genera un array de objetos Product creandolos con los \n // identificadores anteriores y llamando a fill() para recuperar todos \n // sus datos\n $found = array();\n foreach ($ids as $id) {\n $product = new Product($id[\"idProducto\"]);\n if (!$product->fill()) break;\n $found[ ] = $product;\n }\n\n return $found;\n }", "public function getCartProductsByLoggedIds() {\n\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n try {\n $select = $this->select()\n ->from(array('act' => 'addtocart'), array('act.id', 'act.product_id', 'act.user_id', 'act.hotel_id', 'act.quantity', 'act.cost', 'act.hotel_id'))\n ->setIntegrityCheck(FALSE)\n ->joinLeft(array('p' => 'products'), 'act.product_id=p.product_id', array('p.name', 'p.imagelink', 'p.cost AS product_cost'))\n ->joinLeft(array('hd' => 'hotel_details'), 'act.hotel_id=hd.id')\n ->where('act.user_id = ?', $user_id)\n ->where('hd.hotel_status = ?', 1)\n ->where('p.prod_status = ?', 1);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n return $result;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }", "public function getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "public function get($filters = array())\n {\n if (isset($filters['id']))\n {\n\n $result = $this->database->product_get_by_id($filters['id']);\n \n }\n else if (isset($filters['cat_id']) || isset($filters['p.cat_id']))\n {\n $result = $this->database->product_get_by_category($filters);\n }\n else if (isset($filters['token']))\n {\n $result = $this->database->get_product_by_download_token($filters['token']);\n }\n else if (isset($filters['cart']))\n {\n $result = $this->database->get_cart_products();\n }\n else\n {\n $result = $this->database->product_get_all($filters);\n }\n \n return $result;\n }", "public function searchProfessionals($pCriteria){\n\t\t// \t-> get();\n\n\t// \t return $this -> professional -> join('pros_specs', 'professionals.ID', '=', 'pros_specs.professionalID')\n\t// \t\t -> join('specializations', 'specializations.ID', '=', 'pros_specs.specializationID')\n\t// \t\t-> join('pros_creativefields', 'professionals.ID', '=', 'pros_creativefields.ProfessionalID')\n\t// \t\t-> join('creativefields', 'pros_creativefields.CreativeFieldID', '=', 'creativefields.ID')\n\t// \t\t-> join('pros_platforms', 'professionals.ID', '=', 'pros_platforms.ProfessionalID')\n\t// \t\t-> join('platforms', 'platforms.ID', '=', 'pros_platforms.PlatformID')\n\t// \t\t-> join('cities', 'professionals.CityID', '=', 'Cities.ID')\n\t// \t\t-> where('CompanyName', 'LIKE', '%' . $pCriteria['pCompanyName'] . '%')\n\t// \t\t-> whereIn('specializations.ID', $pCriteria['pSpecializations'])\n\t// \t\t-> whereIn('creativefields.ID', $pCriteria['pCreativeFields'])\n\t// \t\t-> whereIn('platforms.ID', $pCriteria['pPlatforms'])\n\t// \t\t-> whereIn('cities.ID', $pCriteria['pCities']) \n\t// \t\t-> groupBy('professionals.ID')\n\t// \t\t-> distinct() -> get();\n\t// }\n\n\t\t$searchQuery = $this -> professional -> queryJoiningTables();\n\n\t\tif(!is_null($pCriteria['pCompanyName'])){\n\t\t\t$searchQuery = $searchQuery -> queryCompanyName($pCriteria['pCompanyName']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pSpecializations'])){\n\t\t\t$searchQuery = $searchQuery -> querySpecializations($pCriteria['pSpecializations']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pCreativeFields'])){\n\t\t\t$searchQuery = $searchQuery -> queryCreativeFields($pCriteria['pCreativeFields']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pPlatforms'])){\n\t\t\t$searchQuery = $searchQuery -> queryPlatforms($pCriteria['pPlatforms']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pCities'])){\n\t\t\t$searchQuery = $searchQuery -> queryCities($pCriteria['pCities']);\n\t\t}\n\n\n\n\t\treturn $searchQuery -> groupBy('professionals.ID') \n\t\t\t-> distinct() -> get(array('Professionals.*'));\n\t}", "function query() {\n $q = new EntityFieldQuery();\n $q->entityCondition('entity_type', 'commerce_product');\n $q->fieldCondition($this->options['flag_field'], 'value', 1);\n $results = $q->execute();\n\n $product_ids = array();\n foreach (reset($results) as $product) {\n $product_ids[] = (int)$product->product_id;\n }\n // Get the allowed products from the current user.\n $user_product_ids = array();\n $user = user_load($GLOBALS['user']->uid);\n if ($user->uid > 0) {\n // Fetch the ids from the current user.\n $products = field_get_items('user', $user, $this->options['user_authorized_products_field']);\n foreach ($products as $product) {\n $user_product_ids[] = (int)$product['target_id'];\n }\n }\n $exclude_ids = array_diff($product_ids, $user_product_ids);\n if (count($exclude_ids) > 0) {\n $this->query->add_where(2, $this->options['node_products_table'] . '.' . $this->options['node_products_column'], $exclude_ids, 'NOT IN');\n }\n }", "public function getProductFilter(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n $result = [];\n \n // Collection/products with last filter group removed\n $prevCollection = $this->getPreviousCollection($searchCriteria);\n $prevProducts = $prevCollection->getItems();\n \n // Get the last filter option\n $lastFilter = $this->filterHelper->getLastFilter($searchCriteria);\n \n // Build product collection with search criteria\n $collection = $this->productHelper->buildCollection($searchCriteria);\n $collection->load();\n $collection->addCategoryIds()->addMinimalPrice();\n $products = $collection->getItems();\n \n // Loop through the list of defined filters\n foreach ($this->filterableList AS $filter) \n {\n $attribute = new Attribute();\n $attribute->setHandle($filter->handle);\n $attribute->setName($filter->name);\n if (isset($filter->condition)) $attribute->setCondition($filter->condition);\n \n switch($filter->type) {\n case 'category':\n $parent = $this->getParentFilter($filter);\n $attribute->setField('category_id');\n $attribute->setType('list');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseCategoryFilter($filter, $products, $parent, $this->productHelper->getFiltersByField($searchCriteria, 'category_id')));\n break;\n \n case 'attribute':\n $attribute->setField($filter->id);\n $attribute->setType('list');\n $attribute->setLogicalAnd($filter->logicalAnd ?? false);\n $isLast = $this->filterBehaviour == 'multiple' && $filter->handle == $lastFilter->getField();\n $attributeProducts = $isLast ? $prevProducts : $products;\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseAttributeFilter($filter, $attributeProducts), $isLast);\n break;\n \n case 'price':\n $attribute->setField('price');\n $attribute->setType('slider');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parsePriceFilter($collection));\n break;\n }\n \n // No values? Then lets not show this attribute\n if (count($attribute->getValues()) == 0) continue;\n \n $result[$filter->handle] = $attribute;\n }\n \n return $result;\n }", "public function getProductCollection()\n {\n $this->_basketProducts = $this->_getCartProductIds();\n $products = $this->_complementaryEngine->sendQuery($this->_basketProducts);\n\n if ($products['rules']) {\n return $this->_getPredictedProducts($products['rules']);\n }\n\n return false;\n }", "public function getProductsList($params){\n\t\ttry {\t\n\t\t\tif(trim($params['start'])==''){ $start = 0; }else{ $start = $params['start'];}\n\t\t\t\n\t\t\t$query = \"select\n\t\t\t\t\tsp.product_id, sp.attributes_group_id, sp.merchant_id, sp.product_sku, sp.product_title, sp.product_small_description,\n\t\t\t\t\t(SELECT product_image FROM store_products_images spi\n\t\t\t\t\twhere spi.product_thumbnail=1 AND spi.statusid=1 AND spi.product_id=sp.product_id) AS product_image,\n\t\t\t\t\t\n\t\t\t\t\t(select spp.product_discount\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_discount_details,\n\t\t\t\t\t\n\t\t\t\t\t(select spp.product_price\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_price,\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t(select if(spp.product_discount_type='Amount' , (spp.product_price-spp.product_discount), (spp.product_price-(spp.product_price*product_discount)/100))\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_price_details\n\n\t\t\t\t\tfrom store_products sp\n\t\t\t\t\tLEFT JOIN store_products_categories spc ON (sp.product_id=spc.product_id)\n\t\t\t\t\twhere\n\t\t\t\t\tsp.statusid=1 \n\t\t\t\t\tAND spc.category_id = \".$params['id'].\" AND sp.statusid=1\n\t\t\t\t\tGROUP BY sp.product_id\n\t\t\t\t\tORDER BY \".$params['orderby'].\" \".$params['ordertype'].\" LIMIT \".$start.\", \".$params['limit'].\"\";\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function getProducts()\n\t{\n\t\t$context = 'product' . $type;\n\n\t\t$q = 'SELECT a.*, (SELECT b.path FROM #__gazebos_gallery AS b WHERE b.product_id = a.id ' .\n\t\t\t' ORDER BY b.ordering ASC LIMIT 1) AS image FROM #__gazebos_products AS a' .\n\t\t\t' WHERE a.state = 1 AND a.type_id = ' . $this->item->id;\n\n\t\t$filter_material = $this->getState($context . 'filter.material');\n\t\tif (is_array($filter_material) && !empty($filter_material) && !empty($filter_material[0]))\n\t\t{\n\t\t\t$q .= ' AND a.material_id IN (' . implode(',', $filter_material) . ')';\n\t\t}\n\n\t\t$filter_shape = $this->getState($context . 'filter.shape');\n\t\tif (is_array($filter_shape) && !empty($filter_shape) && !empty($filter_shape[0]))\n\t\t{\n\t\t\t$q .= ' AND a.shape_id IN (' . implode(',', $filter_shape) . ')';\n\t\t}\n\n\t\t$filter_style = $this->getState($context . 'filter.style');\n\t\tif (is_array($filter_style) && !empty($filter_style) && !empty($filter_style[0]))\n\t\t{\n\t\t\t$q .= ' AND a.style_id IN (' . implode(',', $filter_style) . ')';\n\t\t}\n\n\t\t$results = $this->getDbo()->setQuery($q)->loadObjectList('id');\n\n\t\tif ($results !== null)\n\t\t{\n\t\t\tforeach ($results as $product)\n\t\t\t{\n\t\t\t\t$Itemid = GazebosHelper::getProductTypeMenuItem($type);\n\t\t\t\t$product->link = JRoute::_('index.php?option=com_gazebos&view=product&id=' . $product->id . '&Itemid=' . $Itemid);\n\n\t\t\t\tif (!empty($product->image))\n\t\t\t\t{\n\t\t\t\t\t$product->image = EEHtml::asset(\"products/{$product->id}/thumbs/199x160_{$product->image}\", 'com_gazebos');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function search($params)\n {\n $maxPerPage = isset($params['limit']) && in_array($params['limit'], [12, 24, 36]) ? $params['limit'] : 12; // Products per page\n $currentPage = isset($params['p']) ? $params['p'] : 1;\n\n // Build search query\n $boolQuery = new \\Elastica\\Query\\BoolQuery();\n $this->applyQuery($boolQuery, $params);\n $this->applyCategory($boolQuery, $params);\n $this->applyStatus($boolQuery);\n $this->applyPrice($boolQuery, $params);\n $this->applyAttributes($boolQuery, $params);\n $this->applyUser($boolQuery, $params);\n\n $query = new \\Elastica\\Query($boolQuery);\n $this->applyLocation($query, $params);\n $this->applySortAndOrder($query, $params);\n\n $results = $this->finder->findPaginated($query);\n $results->setMaxPerPage($maxPerPage);\n $results->setCurrentPage($currentPage);\n\n return $results;\n }", "public function getProductById(int $id);", "public function getProducts($params) {\n $productJsonResult = array();\n\n # execute product list query\n try {\n $dbQuery = \"\n SELECT `P`.`product_index`, \n `P`.`product_group` as `product_group_index`,\n `PG`.`product_group_name` as `product_group_name`, \n `PG`.`product_group_priority` as `product_group_priority`,\n `P`.`product_name`, `P`.`product_status`,\n `P`.`product_owner` as `product_owner_index`,\n `UG`.`user_group_name` as `product_owner_name`,\n `P`.`product_rent` as `product_rent_index`,\n `R`.`rent_user` as `product_rent_user_index`,\n `U`.`user_name` as `product_rent_user_name`,\n `U`.`user_id` as `product_rent_user_id`,\n `R`.`rent_status` as `product_rent_status`,\n `R`.`rent_time_start` as `product_rent_start`,\n `R`.`rent_time_end` as `product_rent_end`,\n `R`.`rent_time_return` as `product_rent_return`,\n `P`.`product_barcode`, `P`.`product_created`\n FROM `Products` AS `P`\n LEFT OUTER JOIN `UserGroup` AS `UG` ON (`P`.`product_owner` = `UG`.`user_group_index`) \n LEFT OUTER JOIN `ProductGroup` AS `PG` ON (`P`.`product_group` = `PG`.`product_group_index`) \n LEFT OUTER JOIN `Rents` AS `R` ON (`P`.`product_rent` = `R`.`rent_index`) \n LEFT OUTER JOIN `Users` AS `U` ON (`R`.`rent_user` = `U`.`user_index`)\n WHERE 1=1\";\n if (isset($params[Product::PRODUCT_INDEX])) {\n $dbQuery .= \" AND `product_index` = \".$params[Product::PRODUCT_INDEX];\n }\n if (isset($params[Product::PRODUCT_BARCODE])) {\n $dbQuery .= \" AND `product_barcode` = \".$params[Product::PRODUCT_BARCODE];\n }\n if (isset($params[Product::PRODUCT_GROUP])) {\n $dbQuery .= \" AND `product_group` = \".$params[Product::PRODUCT_GROUP];\n }\n $db = DatabaseManager::getInstance()->getConnection();\n $dbStatement = $db->prepare($dbQuery);\n # database query not ready\n if (!$dbStatement) {\n printOutput(-2, \"DB QUERY FAILURE : \".$db->error);\n exit();\n }\n $dbStatement->execute();\n if ($dbStatement->errno != 0) {\n # product list query error\n printOutput(-4, \"PRODUCT LIST FAILURE : \".$dbStatement->error);\n exit();\n }\n $productData = array();\n $dbStatement->bind_result($productData[Product::PRODUCT_INDEX], $productData[ProductGroup::PRODUCT_GROUP_INDEX], $productData[ProductGroup::PRODUCT_GROUP_NAME], $productData[ProductGroup::PRODUCT_GROUP_PRIORITY], $productData[Product::PRODUCT_NAME], $productData[Product::PRODUCT_STATUS], $productData[UserGroup::USER_GROUP_INDEX], $productData[UserGroup::USER_GROUP_NAME],\n $productData[Product::PRODUCT_RENT], $productData[Rent::RENT_USER], $productData[User::USER_NAME], $productData[User::USER_ID], $productData[Rent::RENT_STATUS], $productData[Rent::RENT_TIME_START], $productData[Rent::RENT_TIME_END], $productData[Rent::RENT_TIME_RETURN], $productData[Product::PRODUCT_BARCODE], $productData[Product::PRODUCT_CREATED]);\n while($dbStatement->fetch()) {\n $productJsonObject = array();\n $productJsonObject[\"product_index\"] = $productData[Product::PRODUCT_INDEX];\n $productJsonObject[\"product_group_index\"] = $productData[ProductGroup::PRODUCT_GROUP_INDEX];\n if (isset($productData[ProductGroup::PRODUCT_GROUP_NAME])) {\n $productJsonObject[\"product_group_name\"] = $productData[ProductGroup::PRODUCT_GROUP_NAME];\n } else {\n $productJsonObject[\"product_group_name\"] = \"\";\n }\n if (isset($productData[ProductGroup::PRODUCT_GROUP_PRIORITY])) {\n $productJsonObject[\"product_group_priority\"] = $productData[ProductGroup::PRODUCT_GROUP_PRIORITY];\n } else {\n $productJsonObject[\"product_group_priority\"] = 0;\n }\n $productJsonObject[\"product_name\"] = $productData[Product::PRODUCT_NAME];\n $productJsonObject[\"product_status\"] = $productData[Product::PRODUCT_STATUS];\n $productJsonObject[\"product_owner_index\"] = $productData[UserGroup::USER_GROUP_INDEX];\n if (isset($productData[UserGroup::USER_GROUP_NAME])) {\n $productJsonObject[\"product_owner_name\"] = $productData[UserGroup::USER_GROUP_NAME];\n } else {\n $productJsonObject[\"product_owner_name\"] = \"\";\n }\n $productJsonObject[\"product_rent_index\"] = $productData[Product::PRODUCT_RENT];\n if (isset($productData[Rent::RENT_USER])) {\n $productJsonObject[\"product_rent_user_index\"] = $productData[Rent::RENT_USER];\n }\n if (isset($productData[User::USER_NAME])) {\n $productJsonObject[\"product_rent_user_name\"] = $productData[User::USER_NAME];\n }\n if (isset($productData[User::USER_ID])) {\n $productJsonObject[\"product_rent_user_id\"] = $productData[User::USER_ID];\n }\n if (isset($productData[Rent::RENT_STATUS])) {\n $productJsonObject[\"product_rent_status\"] = $productData[Rent::RENT_STATUS];\n }\n if (isset($productData[Rent::RENT_TIME_START])) {\n $productJsonObject[\"product_rent_time_start\"] = $productData[Rent::RENT_TIME_START];\n }\n if (isset($productData[Rent::RENT_TIME_END])) {\n $productJsonObject[\"product_rent_time_end\"] = $productData[Rent::RENT_TIME_END];\n }\n if (isset($productData[Rent::RENT_TIME_RETURN])) {\n $productJsonObject[\"product_rent_time_return\"] = $productData[Rent::RENT_TIME_RETURN];\n }\n $productJsonObject[\"product_barcode\"] = $productData[Product::PRODUCT_BARCODE];\n $productJsonObject[\"product_created\"] = $productData[Product::PRODUCT_CREATED];\n array_push($productJsonResult, $productJsonObject);\n }\n $dbStatement->close();\n } catch(Exception $e) {\n # product list query error\n printOutput(-2, \"DB QUERY FAILURE : \".$db->error);\n exit();\n }\n\n return $productJsonResult;\n }", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "public function getAllProducts()\n {\n return $this->productRepository->all();\n }", "public function getProducts()\n {\n foreach ($this->productIds as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new ProductModel())->load($id);\n }\n }", "public function getProducts()\n {\n $query = $this->db->query(\"SELECT * FROM products ORDER BY name ASC \");\n if($query->num_rows() > 0)\n {\n return $query->result();\n }\n else\n {\n return null;\n }\n }", "function get_product_like( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_products.*'); \n\t\t$this->db->from('rt_products');\n\t\t$this->db->join('rt_likes', 'rt_likes.product_id = rt_products.id');\n\n\t\tif(isset($conds['user_id'])) {\n\n\t\t\tif ($conds['user_id'] != \"\" || $conds['user_id'] != 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\t\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\treturn $this->db->get();\n\t\t\n \t}", "protected function getAllProducts()\r\n {\r\n \r\n // Enter the query into the Data Access Layer\r\n $sql = \"SELECT * from tbl_products\";\r\n \r\n // Make a connection anjd run the query on the SQL statement\r\n $results = $this->connect->query($sql);\r\n \r\n // Get the number of rows that were returned\r\n $numRows = $results->num_rows;\r\n \r\n // Return results only of the number of rows is greater than zero\r\n if ($numRows > 0) {\r\n // Pass the results of the query to the next class\r\n return $results;\r\n } else {\r\n echo \"Could not find products\";\r\n }\r\n }", "public function listMatchingProducts($request);", "public function showCertainAction()\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$query = $em->createQuery(\n \t'SELECT p, c\n \tFROM JasonFirstBundle:Product p\n \tJOIN p.category c\n \tWHERE p.price >= :price\n \tORDER BY p.price ASC'\n\t\t)->setParameter('price', '0.01');\n\t\t//->setMaxResults(10);\n\n\t\ttry {\n\t\t $products = $query->getResult();\n\t\t} catch (\\Doctrine\\Orm\\NoResultException $e) {\n\t\t $products = null;\n\t\t}\n\n\t\treturn $this->render(\n\t \t'JasonFirstBundle:Default:showAll.html.twig',\n\t \tarray('products' => $products,\n\t \t)\n\t );\n\t}", "public function getSearchData()\n\t{\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$area_id\t\t\t=\t$search_data['area_id'];\n\t\t$city_id\t\t\t=\t$search_data['city_id'];\n\t\t$page_number\t\t=\t$search_data['page_number'];\n\t\t\n\t\t$products = $this->_productCollectionFactory->create()->addAttributeToSelect(\n\t\t\t'*'\n\t\t)->addFieldToFilter(\n\t\t\t'name',\n\t\t\t['like' => '%'.$search_term.'%']\n\t\t)-> addAttributeToFilter('visibility', array('in' => array(4) )\n\t\t)-> addAttributeToFilter('status', array('in' => array(1) ))\n\t\t->addCategoryIds()->setPageSize(10)\n ->setCurPage($page_number);\n\t\t\n\t\t\n\t\t$products->getSelect()\n\t\t\t\t->join(array(\"marketplace_product\" => 'marketplace_product'),\"`marketplace_product`.`mageproduct_id` = `e`.`entity_id`\",array(\"seller_id\" => \"seller_id\"))\n\t\t\t\t->join(array(\"marketplace_userdata\" => 'marketplace_userdata'),\"`marketplace_userdata`.`seller_id` = `marketplace_product`.`seller_id` AND (FIND_IN_SET('\".$area_id.\"', `area_id`)) AND (FIND_IN_SET('\".$city_id.\"', `region_id`)) \",array(\"shop_url\", \"logo_pic\")); \n\t\t\n\t\t\n\t\t$all_response \t=\tarray();\n\t\t$all_response['data'] \t=\tarray();\n\t\t$categories \t=\tarray();\n\t\t$seller_data \t=\tarray();\n\t\t$priceHelper \t= \t$this->_objectManager->create('Magento\\Framework\\Pricing\\Helper\\Data'); // Instance of Pricing Helper\n\t\t$StockState \t= \t$this->_objectManager->get('\\Magento\\CatalogInventory\\Api\\StockStateInterface');\n\t\t$store \t\t\t\t= \t$this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore();\n\t\tforeach($products as $product_data){\n\t\t\tif(!isset($all_response['data'][$product_data->getSellerId()])){\t\t\t\n\t\t\t\t$all_response['data'][$product_data->getSellerId()]['seller']\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=> ucfirst($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'shop_url'=> ($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'logo'=> $product_data->getLogoPic(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t\t}\n\t\t\t$categories\t\t\t=\t$product_data->getCategoryIds();\n\t\t\t$formattedPrice \t= \t$priceHelper->currency($product_data->getPrice(), true, false);\n\t\t\t\n\t\t\t$product_quantity\t=\t$StockState->getStockQty($product_data->getId(), $product_data->getStore()->getWebsiteId());\n\t\t\t$collectioncat \t\t= \t$this->_categoryCollectionFactory->create();\n\t\t\t$collectioncat->addAttributeToSelect(array('name'), 'inner');\n\t\t\t$collectioncat->addAttributeToFilter('entity_id', array('in' => $categories));\n\t\t\t$collectioncat->addAttributeToFilter('level', array('gt' => 1));\n\t\t\t$collectioncat->addIsActiveFilter();\n\t\t\t$productImageUrl \t= \t$store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product/';\n\t\t\t\n\t\t\t$shortdescription\t=\t$product_data->getShortDescription();\n\t\t\tif($shortdescription==null){\n\t\t\t\t$shortdescription\t=\t\"\";\n\t\t\t}\n\t\t\tif($product_data->getTypeId()!=\"simple\"){\n\t\t\t\t$price\t\t\t=\t0;\n\t\t\t\t$product_price\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t\t$_children = $product_data->getTypeInstance()->getUsedProducts($product_data);\n\t\t\t\tforeach ($_children as $child){\n\t\t\t\t\t$productPrice = $child->getPrice();\n\t\t\t\t\t$price = $price ? min($price, $productPrice) : $productPrice;\n\t\t\t\t}\n\t\t\t\t$special_price\t=\t$product_data->getFinalPrice(); \n\t\t\t\tif($price <= $product_data->getFinalPrice()){\n\t\t\t\t\t$special_price\t=\tnull; \n\t\t\t\t}\n\t\t\t\t$formattedPrice\t\t\t=\t$price; \n\t\t\t\t$product_price\t\t\t=\t$product_data->getProductPrice();\n\t\t\t\t$product_special_price\t=\t$product_data->getProductSpecialPrice();\n\t\t\t}else{\n\t\t\t\t$formattedPrice\t\t\t=\t$product_data->getPrice(); \n\t\t\t\t$special_price\t\t\t=\t$product_data->getFinalPrice(); \n\t\t\t\t$product_price\t\t\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t}\n\t\t\tif($formattedPrice == $special_price ){\n\t\t\t\t$special_price\t\t\t=\tnull; \n\t\t\t}\n\t\t\t$formattedPrice\t\t\t\t=\tnumber_format($formattedPrice, 2);\n\t\t\tif($special_price !=null){\n\t\t\t\t$special_price\t\t\t\t=\tnumber_format($special_price, 2);\n\t\t\t}\n\t\t\t$all_response['data'][$product_data->getSellerId()]['products'][]\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$product_data->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$product_data->getName(),\n\t\t\t\t\t\t\t\t\t\t\t\t'sku'=>$product_data->getSku(),\n\t\t\t\t\t\t\t\t\t\t\t\t'short_description'=>$shortdescription,\n\t\t\t\t\t\t\t\t\t\t\t\t'price'=>$formattedPrice,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_price'=>$product_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_special_price'=>$product_special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'special_price'=>$special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'image'=>ltrim($product_data->getImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'small_image'=>ltrim($product_data->getSmallImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>ltrim($product_data->getThumbnail(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'quantity'=>$product_quantity,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_data'=>$product_data->getData(),\n\t\t\t\t\t\t\t\t\t\t\t\t'productImageUrl'=>$productImageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t'categories'=>$collectioncat->getData(),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$all_response['data'][$product_data->getSellerId()]['categories']\t=\t$collectioncat->getData();\n\t\t}\n\t\t\n\t\t\n\t\t$search_data \t=\t[['page_number'=>$page_number,'total_count'=>$products->getSize()]];\n\t\tif(!empty($all_response['data'])){\n\t\t\tforeach($all_response['data'] as $serller_id=>$seller_data){\n\t\t\t\t$customer_data \t\t\t\t\t= \t$this->_objectManager->create('Magento\\Customer\\Model\\Customer')->load($serller_id);\n\t\t\t\t$seller_data['seller']['name']\t=\ttrim($customer_data->getData('firstname').\" \".$customer_data->getData('lastname'));\n\t\t\t\t$search_data[]\t=\t[\n\t\t\t\t\t\t\t\t\t\t'seller_data'=>$seller_data['seller'],\n\t\t\t\t\t\t\t\t\t\t'products'=>$seller_data['products'],\n\t\t\t\t\t\t\t\t\t\t'categories'=>$seller_data['categories']\n\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $search_data;\n\t}", "public function readProducts() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $traderId = $this->getTraderID($auth);\r\n $sql = \"SELECT * FROM product WHERE traderid = '{$traderId}'\";\r\n $products = Product::find_by_sql($sql);\r\n if ($products) {\r\n return $products;\r\n } else {\r\n throw new RestEception(400, \"no products found\");\r\n }\r\n }", "public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "function getProduct()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`products`\";\n //echo $sql;exit();\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $products = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $product = new ProductEntity();\n $product->setIdProduct($data->id);\n $product->setName($data->name);\n $product->setDomaine_realise($data->domaine_realise);\n $product->setTache_realisee($data->tache_realisee);\n $product->setImage($data->image);\n $product->setCreatedAt($data->createdat);\n\n $products[] = $product;\n }\n\n if ($products) {\n return $products;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null);", "public function getProducts($options = array())\n {\n $return = $this->getListe(\"products\", $options);\n return $return;\n }", "function find_all_products()\n\t{\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\n\t\t$limit \t\t\t\t= (int)$this->results_per_page.' OFFSET '. (int)$this->calculate_record_offset();\n\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->search_results = array();\n\t\t\t\n\t\t\treturn $this->search_results;\n\t\t}\n\t\t\t\t\n\t\t//Perform a keyword weighted search query to find the most relavent results\n\t\t$sql = 'SELECT product.id, product.name, product.description, product.url_name, image.filename AS image_filename, sum(product_keyword.frequency) AS frequency ' .\n\t\t\t\t'FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'\tINNER JOIN image ON product.image_id = image.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY \n\t\t\t\t\tproduct.id,\n\t\t\t\t\tproduct.name,\n \t\t\t\t\tproduct.description,\n \t\t\t\t\tproduct.url_name ' . \n\t\t\t\t'ORDER BY frequency DESC, product.name, product.id ' .\n\t\t\t\t'LIMIT ' . $limit;\n\t\t\n\t\t$this->search_results = $this->_db->query_as_array($sql);\n\t\t\t\t\t\n\t\treturn $this->search_results;\t\t\n\t}", "private function load($id = null) {\n\n if (!is_null($id)) {\n\n return $this->search->getProduct($id);\n\n }\n\n return $this->search->getProducts($this->filters);\n\n }", "function searchProduct($type,$input)\n {\n $products;\n switch($type)\n {\n case 0:\n $products=Product::search($input);\n break;\n case 1:\n $products=Product::searchByName($input);\n break;\n case 2:\n $products=Product::searchByGroup($input);\n break;\n case 3:\n $products=Product::searchBySupplier($input);\n break;\n case 4:\n $products=Product::searchByTag($input);\n break;\n case 5: $products=Product::searchByDescription($input);\n break;\n default:\n break;\n }\n if(!empty($products))\n {\n return $products;\n }else {\n return false;\n }\n }", "public function all_products()\n\t{\n\t\t$this->db->where('product_status = 1');\n\t\t$query = $this->db->get('product');\n\t\t\n\t\treturn $query;\n\t}", "public function getByCriteria() {\n $ret = array();\n $sql = \"SELECT DISTINCT C.courseID FROM Course C INNER JOIN Section S ON C.courseID=S.courseID WHERE S.sessionYear = :sessionYear AND S.sessionCode = :sessionCode AND S.term = :term\";\n $params = array(':sessionCode' => $this->code, ':sessionYear' => $this->year, ':term' => $this->term);\n foreach($this->filters as $name => $val) {\n $sql .= ' AND '.$name.'=:'.$name;\n $params[':'.$name] = $val;\n }\n $stmt = $this->conn->prepare($sql);\n $stmt->execute($params);\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $ret[] = new Course($row['courseID'], $this->head);\n echo $row['courseID'];\n }\n return $ret;\n return (!empty($ret)) ? $ret : false;\n }", "public function filterProducts(Request $request) {\n\t\t$genre_id = $request->genreId;\n\t\t$author_id = $request->authorId;\n\n\t\t$filtered_products = Product::where('author_id', $author_id)\n\t\t ->where('genre_id', $genre_id)\n\t\t ->orderBy('created_at', 'desc')\n\t\t ->with('image')\n\t\t\t\t\t\t\t\t\t ->where( 'amount', '>', 0 )\n\t\t\t\t\t\t\t\t\t ->get();\n\t\treturn $filtered_products;\n\t}", "function getProductsbySearch($Search){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `name` LIKE ? OR \n\t\t\t\t\t\t\t\t\t`description` LIKE ? OR\n\t\t\t\t\t\t\t\t\t`large_description` LIKE ? AND `stock`>0\");\n\t\t$Search = '%'.$Search.'%';\n\t\t$Search = str_replace(\" \", \"%\", $Search);\n\t\t$sth \t-> execute(array($Search, $Search, $Search));\n\n\t\treturn \t$sth;\n\t}", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "public function getCategoryProductWithFilter($categoryId , $filters = []) {\n\n $prefix = config('database.connections.mysql.prefix');\n\n $sql = \"Select p.id\n FROM {$prefix}products as p \n INNER JOIN {$prefix}category_product as cp on p.id = cp.product_id \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"INNER JOIN {$prefix}product_property_integer_values as ppiv ON p.id = ppiv.product_id \";\n }\n\n }\n }\n\n if('attribute' == $type) {\n\n\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n $sql .= \"INNER JOIN {$prefix}product_attribute_integer_values as paiv ON p.id = paiv.product_id \";\n }\n }\n }\n\n $sql .= \"WHERE cp.category_id = ? \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"AND ppiv.property_id = {$property->id} AND ppiv.value={$value}\";\n }\n\n }\n }\n }\n\n foreach ($filters as $type => $filterArray) {\n if('attribute' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n\n $sql .= \"AND paiv.attribute_id = {$attribute->id} AND paiv.value={$value}\";\n\n\n }\n }\n }\n\n $products = DB::select($sql, [$categoryId]);\n\n $collect = Collection::make([]);\n\n foreach ($products as $productArray) {\n\n $product = $this->findProductById($productArray->id);\n\n if($product->type == \"VARIABLE_PRODUCT\") {\n $collect->push(($product->getVariableMainProduct()));\n } else {\n $collect->push($this->findProductById($productArray->id));\n }\n }\n\n return $collect;\n\n /**\n * FROM avored_products as p\n *\n *\n *\n *\n * where ppiv.property_id = 1 AND\n */\n\n }", "private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }", "public function getItems()\n\t{\n\t\t// Connect db\n\t\t\t$db\t\t\t\t\t\t\t\t\t= $this->getDbo();\n\t\t\t$query\t\t\t\t\t\t\t\t= $db->getQuery(true);\n\t\t\t$user\t\t\t\t \t\t\t\t= & JFactory::getUser();\n\n\t\t$query->select('tm.*');\n\t\t$query->from('#__jereverseauction_products AS tm');\n\t\t$query->where('tm.user_id = '.$user->id);\n\t\t$db->setQuery($query);\n\t\t$product\t\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\tif ($error = $db->getErrorMsg()) {\n\t\t\tthrow new Exception($error);\n\t\t}\n\t\tif( empty($user->id) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PLEASE_LOGIN'));\n\t\t}else if( empty($product) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_FOUND'));\n\t\t} else {\n\t\t\t$query->where('tm.published = 1 || tm.published = 0');\n\t\t\t$query->order('tm.id');\n\n\t\t\t// Join over the categories.\n\t\t\t$query->select( 'cat.title AS category_title' );\n\t\t\t$query->join( 'LEFT', '#__categories AS cat ON cat.id = tm.catid' );\n\n\t\t\t$query->select( 'com.id as comm_id' );\n\t\t\t$query->join( 'LEFT', '#__jereverseauction_commission AS com ON com.prod_id = tm.id' );\n\n\t\t\t$products\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\t\tif( empty( $products )) {\n\t\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_PUBLISHED'));\n\t\t\t}\n\n\t\t\t$this->_total\t\t\t\t\t\t= count($products);\n\n\t\t\tif ($this->getState('limit') > 0) {\n\t\t\t\t$this->_data\t\t\t\t\t= array_splice($products, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t} else {\n\t\t\t\t$this->_data\t\t\t\t\t= $products;\n\t\t\t}\n\n\t\t\treturn $this->_data;\n\t\t}\n\t}", "function get_products() {\n\t\tApp::Import('model', 'Product');\n\t\t$this->Product = &new Product;\n\n\t\t$products = $this->Product->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"Product.short_description != ''\",\n\t\t\t\t'Availability.cart_allowed' => true,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'TaxClass' => array(\n\t\t\t\t\t'fields' => array('id', 'value')\n\t\t\t\t),\n\t\t\t\t'Image' => array(\n\t\t\t\t\t'conditions' => array('Image.is_main' => '1'),\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'Manufacturer' => array(\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'CategoriesProduct' => array(\n\t\t\t\t\t'Category' => array(\n\t\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Availability' => array(\n\t\t\t\t\t'fields' => array('id', 'cart_allowed')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Product.id',\n\t\t\t\t'Product.name',\n\t\t\t\t'Product.short_description',\n\t\t\t\t'Product.url',\n\t\t\t\t'Product.retail_price_with_dph',\n\t\t\t\t'Product.ean',\n\t\t\t\t'Product.zbozi_name',\n\t\t\t\t'Product.heureka_name',\n\t\t\t\t'Product.discount_common',\n\t\t\t\t'Product.zbozi_cpc',\n\t\t\t\t'Product.heureka_cpc'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$products = array_filter($products, array('ExportsController', 'empty_category'));\n\t\t\n\t\tforeach ($products as $i => $product) {\n\t\t\t$products[$i]['Product']['retail_price_with_dph'] = $this->Product->assign_discount_price($products[$i]);\n\t\t\t$products[$i]['Product']['name'] = str_replace('&times;', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('&times;', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getActiveCartProducts();", "function get_purchased_product_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//$this->custom_conds();\n\t\t//where clause\n\t\t$this->db->select('rt_products.*, count(rt_transactions_counts.product_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_transactions_counts', 'rt_products.id = rt_transactions_counts.product_id');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['cat_id'] )) {\n\t\t\tif ($conds['cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.cat_id', $conds['cat_id'] );\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\tif ($conds['sub_cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['sub_cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.sub_cat_id', $conds['sub_cat_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif ( isset( $conds['search_term'] ) || isset( $conds['date'] ) ) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\t\t\t\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t}\n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_transactions_counts.product_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_transactions_counts.added_date',\"desc\");\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n \t\t //print_r($this->db->last_query());die;\n\n\t}", "public function get_featured_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product_category.name as category_name', 'product.product_category_id', 'product.product_type_id', 'product_category.url_slug as product_category_url_slug'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->order_by('product_category.name');\n $this->db->order_by('product.name');\n\n return $this->db->get()->result_array();\n }", "public function readProductos(){\n $sql='SELECT idProducto, foto, nombre, precio, cantidad, nombreProveedor, producto.estado from producto, proveedor where proveedor.idProveedor=producto.idProveedor and producto.estadoEliminacion= 1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }" ]
[ "0.69840455", "0.6899192", "0.68462396", "0.6755407", "0.64861655", "0.64771706", "0.64566725", "0.64454293", "0.6435958", "0.64082193", "0.6389446", "0.63621557", "0.635936", "0.635936", "0.634835", "0.6339017", "0.6320012", "0.628246", "0.6265285", "0.626525", "0.6254374", "0.62366825", "0.6225268", "0.62247837", "0.6208329", "0.619911", "0.6184802", "0.61792856", "0.6178653", "0.6171265", "0.61643296", "0.6155627", "0.6142551", "0.61197567", "0.6114645", "0.6111113", "0.61034894", "0.6075774", "0.6075706", "0.60658514", "0.605182", "0.60493225", "0.6048306", "0.60442543", "0.6036445", "0.60337645", "0.60329086", "0.6021985", "0.6020952", "0.60170937", "0.60127157", "0.60109437", "0.6008372", "0.5998198", "0.5988714", "0.5982087", "0.5978525", "0.5976928", "0.5973948", "0.5971024", "0.59689814", "0.59655386", "0.59588414", "0.5956999", "0.595568", "0.5951686", "0.5948038", "0.5947058", "0.5928734", "0.5925842", "0.5923886", "0.59234923", "0.5913727", "0.5913457", "0.5911612", "0.5893751", "0.58919364", "0.5887702", "0.5887088", "0.58824", "0.58813107", "0.5878576", "0.5877549", "0.5876747", "0.58731663", "0.5867708", "0.5864685", "0.585272", "0.58512807", "0.5851021", "0.58285993", "0.5823415", "0.5817021", "0.5814997", "0.5814521", "0.5800758", "0.57958335", "0.57925045", "0.5791134", "0.57880867" ]
0.70282626
0
Creates a form to delete a SvCfgCalzadaCarril entity.
Создает форму для удаления сущности SvCfgCalzadaCarril.
private function createDeleteForm(SvCfgCalzadaCarril $svCfgCalzadaCarril) { return $this->createFormBuilder() ->setAction($this->generateUrl('svcfgcalzadacarril_delete', array('id' => $svCfgCalzadaCarril->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Contabilizar $contabilizar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contabilizar_delete', array('id' => $contabilizar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Caisse $caisse)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caisse_delete', array('id' => $caisse->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Etat_civil $etat_civil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('etat_civil_delete', array('id' => $etat_civil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cancion $cancion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cancion_delete', array('id' => $cancion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(EcoCardiogramaTransesofagico $ecoCardiogramaTransesofagico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ecocardiogramatransesofagico_delete', array('id' => $ecoCardiogramaTransesofagico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cargaison $cargaison)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cargaison_delete', array('id' => $cargaison->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Feuil $feuil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('feuil_delete', array('id' => $feuil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm1($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('calendarcategories_delete', array('id' => $id)))\n ->setMethod('DELETE')\n /* ->add('submit', 'submit', array('label' => 'Delete')) */\n ->getForm()\n ;\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Cahierdescharges $cahierdescharge) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cahierdescharges_delete', array('id' => $cahierdescharge->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Clasificaciontg $clasificaciontg)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clasificaciontg_delete', array('id' => $clasificaciontg->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Centro $centro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('centro_delete', array('id' => $centro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ActividadAcademica $actividadAcademica)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('delete_actividadacademica', array('actividadAcademica' => $actividadAcademica->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Complect $complect)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_complect_delete', array('id' => $complect->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cours $listeCour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('listecours_delete', array('id' => $listeCour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CfgTipoAlerta $cfgTipoAlertum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cfgtipoalerta_delete', array('id' => $cfgTipoAlertum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(TblCursosDocentes $tblCursosDocente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblcursosdocentes_delete', array('id' => $tblCursosDocente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Caso $caso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caso_delete', array('id' => $caso->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }", "private function createDeleteForm(Sous_categorie $sous_categorie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sous_categorie_delete', array('id' => $sous_categorie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm(Clatesal $clatesal)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clatesal_delete', array(\n\n 'clasificacion' => $clatesal->getClasificacion()->getId(),\n 'categoria'=>$clatesal->getCategoria()->getId(),\n 'tiempoDedicacion'=>$clatesal->getTiempoDedicacion()->getId(),\n\n )))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Categorie_Produit $categorie_Produit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('categorie_produit_delete', array('id' => $categorie_Produit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "protected function createComponentDeleteRate()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteRateSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Fratura $fratura)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fratura_delete', array('id' => $fratura->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(FroFacTransferencia $froFacTransferencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frofactransferencia_delete', array('id' => $froFacTransferencium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('periododeinscricao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('member_intrestconfig_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function genDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'ct_del_form', 'style' => 'display:none')))\n ->setAction($this->generateUrl('morus_fas_contacts_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(CargoSubDivisao $vaga)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pessoal_gerenciar_vagas_delete', array('id' => $vaga->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n { \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aulas_aula_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(AdminPensionadoInstitucion $adminPensionadoInstitucion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configurable_pensionados_instituciones_delete', array('id' => $adminPensionadoInstitucion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Reactif $reactif)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reactif_delete', array('numreact' => $reactif->getNumreact())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Facture $facture)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('facture_delete', array('id' => $facture->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Estadosciviles $estadoscivile)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estadosciviles_delete', array('idEstadocivil' => $estadoscivile->getIdestadocivil())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('finanzascategoria_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dzialy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Usuń Dział' , 'attr' => array('class' => 'btn btn-danger' , 'icon' => 'times fa-fw')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pifeclassique_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Tipoanuncio $tipoanuncio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoanuncio_delete', array('id' => $tipoanuncio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Atletas $atleta) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('atletas_delete', array('id' => $atleta->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cuisine $cuisine)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cuisine_delete', array('id' => $cuisine->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(FormulaireSecours $formulaireSecour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('formulairesecours_delete', array('id' => $formulaireSecour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Funcionario $funcionario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionario_delete', array('id' => $funcionario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientecredito_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('adtiposcomision_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(CMS $cM)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cms_delete', array('id' => $cM->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SvCfgSenialTipo $svCfgSenialTipo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('svcfgsenialtipo_delete', array('id' => $svCfgSenialTipo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function createComponentDeleteForm($val){\n\t\t$form = new \\Nette\\Application\\UI\\Form();\n\t\t$url = $this->link('pages:delete');\n\t\t$form->setAction($url);\n\t\t$form->addHidden('id', $val->id);\n\t\t$form->addSubmit('submit', 'Smazat');\n\t\t$form->onSubmit[] = callback($this, 'deleteFormSubmitted');\n\t\treturn $form;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('envase_ingreso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private\n function createAnnonceeDeleteForm(Annonce $annonce)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annoncee_delete', array('id' => $annonce->getAnnonceId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Annonce_appart $annonce_appart) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annonce_appart_delete', array('id' => $annonce_appart->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(MsvTalonario $msvTalonario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('msvtalonario_delete', array('id' => $msvTalonario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(PsychEvalFreq $psychEvalFreq)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_freq_delete', array('id' => $psychEvalFreq->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ConfiguracaoBancoHoras $ponto)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ponto_configuracao_banco_horas_delete', array('id' => $ponto->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CvCdoComparendo $cvCdoComparendo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cvcdocomparendo_delete', array('id' => $cvCdoComparendo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoasignar_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR ASIGNACION'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admtipoaporte_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Eliminar','attr'=>array('class'=>'btn btn-danger')))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Procedencia $procedencia)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('procedencia_delete', array('id' => $procedencia->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medicamentossuministrados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipuscentre_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Ficha $ficha)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ficha_delete', array('id' => $ficha->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ClasseMatiere $classeMatiere)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('class_mat_delete', array('id' => $classeMatiere->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Historique $historique)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('historique_delete', array('id' => $historique->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_servicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Justicia $justicium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('justicia_delete', array('id' => $justicium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sucursal_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cosecha_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm(Dependencia $dependencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dependencia_delete', array('id' => $dependencium->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_categoriaport_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_partner_category_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit',\n array(\n 'label' => 'Supprimer',\n 'attr' => array('class' => 'btn btn-danger')\n ))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('client_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sifdainformeordentrabajo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar informe'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Fita $fitum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cadastro_fita_delete', array('id' => $fitum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Scenaristes $scenariste)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('scenaristes_delete', array('id' => $scenariste->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acteur $acteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acteur_delete_homepage', array('id' => $acteur->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cole_deletar', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Deces $dece)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('deces_delete', array('id' => $dece->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(NomDpa $nomdpa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dpa_delete', array('id' => $nomdpa->getIddpa())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createComptesDeleteForm(Compte $compte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('comptes_delete', array('id' => $compte->getCompteId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('boncommandeligne_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_sesionventatratamiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }" ]
[ "0.7063467", "0.69667834", "0.67409843", "0.6692823", "0.66592586", "0.6619199", "0.6614296", "0.6583932", "0.6559359", "0.6527039", "0.65194976", "0.6517043", "0.65096676", "0.64998555", "0.6472747", "0.64585733", "0.64558613", "0.64399177", "0.6433952", "0.64223593", "0.641798", "0.6404937", "0.639871", "0.63863975", "0.6382619", "0.63664633", "0.6361736", "0.6352224", "0.63419145", "0.633277", "0.63273466", "0.6320472", "0.6314375", "0.6298022", "0.6290372", "0.6287964", "0.6282523", "0.62709165", "0.626111", "0.62545556", "0.62505215", "0.6248761", "0.62470186", "0.624687", "0.6224642", "0.6222601", "0.6215987", "0.62114364", "0.6202226", "0.6201774", "0.61996406", "0.6199385", "0.6192462", "0.6190087", "0.6178716", "0.6172917", "0.61728495", "0.6163689", "0.616037", "0.6156842", "0.615529", "0.61498594", "0.61469585", "0.61458987", "0.61456156", "0.6134379", "0.6133387", "0.613142", "0.6129542", "0.6126109", "0.61160207", "0.61135304", "0.6112911", "0.61123276", "0.6106726", "0.6103005", "0.6101336", "0.6100103", "0.60967875", "0.60944474", "0.6093172", "0.6093059", "0.60876197", "0.6076684", "0.607487", "0.60705674", "0.606984", "0.6067685", "0.6063024", "0.6058336", "0.6057948", "0.6057222", "0.60463", "0.6039015", "0.6038858", "0.6038534", "0.6038311", "0.6035907", "0.60358906", "0.6032077" ]
0.79635614
0
Get the default editing service.
Получить стандартный сервис редактирования.
public function get() { $editing_service = new DefaultPlaceEditingService( $this->commandBus, $this->uuidGenerator, $this->placeJsonLdRepository, $this->placeCommandFactory, $this->placeRepository ); if ($this->config->get('publication_date')) { $publicationDate = \DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', (string) $this->config->get('publication_date') . ' 00:00:00' ); $editing_service = $editing_service->withFixedPublicationDateForNewOffers($publicationDate); } return $editing_service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getService ()\n {\n if (null === $this->_service) {\n $this->setService('Default_Service_Spirit');\n }\n return $this->_service;\n }", "protected function getRouting_ResourcesLocator_DefaultService()\n {\n return $this->services['routing.resources_locator.default'] = new \\phpbb\\routing\\resources_locator\\default_resources_locator('./../', 'production', ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n }", "public function get_service() {\n\n\t\treturn $this->provider_instance;\n\t}", "protected function getA2lixTranslationForm_Default_Service_TranslationService()\n {\n return $this->services['a2lix_translation_form.default.service.translation'] = new \\A2lix\\TranslationFormBundle\\TranslationForm\\TranslationForm($this->get('form.registry'), $this->get('doctrine'));\n }", "function get_default_page_to_edit()\n {\n }", "protected function getVictoireBlog_ArticleSettings_Form_TypeService()\n {\n return $this->services['victoire_blog.article_settings.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\ArticleSettingsType($this->get('doctrine.orm.default_entity_manager'));\n }", "protected function getSwiftmailer_Mailer_DefaultService()\n {\n return $this->services['swiftmailer.mailer.default'] = new \\Swift_Mailer($this->get('swiftmailer.mailer.default.transport'));\n }", "protected function getA2lixTranslationForm_Default_Type_TranslatedentityService()\n {\n $this->services['a2lix_translation_form.default.type.translatedentity'] = $instance = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslatedEntityType();\n\n $instance->setRequest(NULL);\n\n return $instance;\n }", "public function getContentService(){\n if(null === $this->contentService)\n $this->contentService = $this->getServiceLocator()->get('content_service');\n return $this->contentService;\n }", "public function getSlideService(){\n if(null === $this->slideService)\n $this->slideService = $this->getServiceLocator()->get('slide_service');\n return $this->slideService;\n }", "protected function getWorkspaceService() {}", "protected function getWorkspaceService() {}", "protected function getEditModule() {}", "public function service()\r\n {\r\n return $this->service;\r\n }", "public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }", "public function service() {\n return $this->service;\n }", "public function getServiceLocator()\n {\n if (empty($this->serviceLocator)) {\n $class = $this->defaultServiceLocator;\n $this->serviceLocator = new $class();\n }\n\n return $this->serviceLocator;\n }", "public function getUpdateForm()\n {\n return new UpdateBlogFormService;\n }", "public function getEditingThemeId()\n {\n $theme = \\Phpfox::model('layout_theme')\n ->select()\n ->where('is_editing=?', 1)\n ->first();\n\n if (!empty($theme)) {\n return $theme->getId();\n }\n\n return 'default';\n }", "public function getEdit()\n\t{\n\t}", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function service()\n {\n return $this->service;\n }", "protected function service()\n {\n return new Service();\n }", "protected function getA2lixTranslationForm_Default_Type_TranslationsformsService()\n {\n return $this->services['a2lix_translation_form.default.type.translationsforms'] = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslationsFormsType($this->get('a2lix_translation_form.default.service.translation'), $this->get('a2lix_translation_form.default.listener.translationsforms'), $this->get('a2lix_translation_form.default.service.parameter_locale_provider'));\n }", "public function getService()\n {\n return null;\n }", "abstract function get_crud_service();", "public function getService()\n {\n if (!$this->service) {\n /** @var \\OAuth\\ServiceFactory $serviceFactory */\n $serviceFactory = $this->app->make('oauth/factory/service');\n $this->service = $this->factory->createService($serviceFactory);\n }\n\n return $this->service;\n }", "protected function getVictoireCore_AdminMenuService()\n {\n return $this->services['victoire_core.admin_menu'] = $this->get('victoire_core.admin_menu_builder')->getMenu();\n }", "public function getdefaultPersonInEditor()\n {\n return $this->defaultpersonineditor;\n }", "public function getEditObject()\n {\n $soxId = $this->getEditObjectId();\n if ($this->_oEditObject === null && isset($soxId) && $soxId != '-1') {\n $this->_oEditObject = oxNew('oxOrder');\n $this->_oEditObject->load($soxId);\n }\n\n return $this->_oEditObject;\n }", "public function getAddOnManagerService() {\n\t\treturn $this->get('sly-service-addon-manager');\n\t}", "protected function getDoctrine_Orm_DefaultEntityListenerResolverService()\n {\n return $this->services['doctrine.orm.default_entity_listener_resolver'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Mapping\\ContainerAwareEntityListenerResolver($this);\n }", "protected function getDoctrine_Orm_DefaultEntityListenerResolverService()\n {\n return $this->services['doctrine.orm.default_entity_listener_resolver'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Mapping\\ContainerAwareEntityListenerResolver($this);\n }", "protected function getTranslator_DefaultService()\n {\n $this->services['translator.default'] = $instance = new \\Victoire\\Bundle\\I18nBundle\\Translation\\Translator($this, ${($_ = isset($this->services['translator.selector']) ? $this->services['translator.selector'] : $this->getTranslator_SelectorService()) && false ?: '_'}, array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), 'translation.loader.mo' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini'), 'translation.loader.json' => array(0 => 'json')), array('cache_dir' => (__DIR__.'/translations'), 'debug' => false, 'resource_files' => array('sr_Latn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.sr_Latn.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sr_Latn.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sr_Latn.yml')), 'pl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.pl.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.pl.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pl.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pl.yml')), 'he' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.he.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.he.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.he.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.he.yml')), 'ro' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ro.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ro.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ro.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ro.yml')), 'et' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.et.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.et.yml')), 'fa' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fa.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.fa.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fa.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fa.yml')), 'ar' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ar.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ar.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ar.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ar.yml')), 'cy' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf')), 'gl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.gl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.gl.xlf')), 'th' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.th.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.th.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.th.yml')), 'ru' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ru.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ru.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ru.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ru.yml')), 'sv' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.sv.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sv.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sv.yml')), 'da' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.da.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.da.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.da.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.da.yml')), 'fi' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fi.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fi.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fi.yml')), 'lb' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lb.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.lb.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lb.yml')), 'zh_CN' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.zh_CN.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.zh_CN.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.zh_CN.yml')), 'nl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.nl.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.nl.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nl.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nl.yml')), 'fr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fr.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.fr.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.fr.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fr.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fr.yml'), 6 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/messages.fr.xliff'), 7 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/victoire.fr.xliff'), 8 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessEntityBundle/Resources/translations/victoire.fr.xliff'), 9 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/messages.fr.xliff'), 10 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/victoire.fr.xliff'), 11 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CoreBundle/Resources/translations/victoire.fr.xliff'), 12 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CriteriaBundle/Resources/translations/victoire.fr.xliff'), 13 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/FormBundle/Resources/translations/victoire.fr.xliff'), 14 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/I18nBundle/Resources/translations/victoire.fr.xliff'), 15 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/messages.fr.xliff'), 16 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/victoire.fr.xliff'), 17 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Resources/translations/messages.fr.xliff'), 18 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Resources/translations/victoire.fr.xliff'), 19 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SeoBundle/Resources/translations/victoire.fr.xliff'), 20 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SitemapBundle/Resources/translations/victoire.fr.xliff'), 21 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Resources/translations/victoire.fr.xliff'), 22 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Resources/translations/messages.fr.xlf'), 23 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Resources/translations/victoire.fr.xliff'), 24 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/WidgetBundle/Resources/translations/victoire.fr.xliff')), 'mn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.mn.xlf')), 'af' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.af.yml')), 'hr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.hr.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hr.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hr.yml')), 'tr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.tr.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.tr.yml')), 'az' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.az.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.az.xlf')), 'no' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.no.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.no.xlf')), 'hy' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hy.xlf')), 'sq' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf')), 'zh_TW' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf')), 'en' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.en.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.en.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.en.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.en.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.en.yml'), 6 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/messages.en.xliff'), 7 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/victoire.en.xliff'), 8 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessEntityBundle/Resources/translations/victoire.en.xliff'), 9 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/messages.en.xliff'), 10 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/victoire.en.xliff'), 11 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CoreBundle/Resources/translations/victoire.en.xliff'), 12 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CriteriaBundle/Resources/translations/victoire.en.xliff'), 13 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/FormBundle/Resources/translations/victoire.en.xliff'), 14 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/I18nBundle/Resources/translations/victoire.en.xliff'), 15 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/messages.en.xliff'), 16 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/victoire.en.xliff'), 17 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Resources/translations/victoire.en.xliff'), 18 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SeoBundle/Resources/translations/victoire.en.xliff'), 19 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SitemapBundle/Resources/translations/victoire.en.xliff'), 20 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Resources/translations/victoire.en.xliff'), 21 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Resources/translations/victoire.en.xliff'), 22 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/WidgetBundle/Resources/translations/victoire.en.xliff')), 'lv' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lv.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lv.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lv.yml')), 'pt' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt.xlf'), 2 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.pt.xliff'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt.yml')), 'ca' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ca.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ca.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ca.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ca.yml')), 'lt' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lt.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.lt.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lt.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lt.yml')), 'id' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.id.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.id.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.id.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.id.yml')), 'eu' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.eu.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eu.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eu.yml')), 'bg' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.bg.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.bg.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bg.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bg.yml')), 'ja' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ja.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ja.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ja.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ja.yml')), 'sr_Cyrl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.sr_Cyrl.xlf')), 'nn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf')), 'sl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.sl.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sl.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sl.yml')), 'uk' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.uk.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.uk.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.uk.yml')), 'cs' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.cs.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.cs.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.cs.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.cs.yml')), 'el' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.el.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.el.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.el.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.el.yml')), 'vi' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.vi.xlf'), 2 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.vi.yml'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.vi.yml')), 'de' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.de.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.de.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.de.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.de.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.de.yml')), 'it' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.it.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.it.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.it.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.it.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.it.yml')), 'sk' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sk.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.sk.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sk.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sk.yml')), 'hu' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hu.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.hu.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hu.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hu.yml')), 'es' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.es.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.es.xlf'), 3 => ($this->targetDirs[3].'/vendor/troopers/alertify-bundle/Troopers/AlertifyBundle/Resources/translations/alertify.es.xliff'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.es.yml'), 5 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.es.yml'), 6 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/victoire.es.xliff'), 7 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BlogBundle/Resources/translations/messages.es.xliff'), 8 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessEntityBundle/Resources/translations/victoire.es.xliff'), 9 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/victoire.es.xliff'), 10 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/BusinessPageBundle/Resources/translations/messages.es.xliff'), 11 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CoreBundle/Resources/translations/victoire.es.xliff'), 12 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/CriteriaBundle/Resources/translations/victoire.es.xliff'), 13 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/FormBundle/Resources/translations/victoire.es.xliff'), 14 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/I18nBundle/Resources/translations/victoire.es.xliff'), 15 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/victoire.es.xliff'), 16 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/MediaBundle/Resources/translations/messages.es.xliff'), 17 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/PageBundle/Resources/translations/victoire.es.xliff'), 18 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SeoBundle/Resources/translations/victoire.es.xliff'), 19 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/SitemapBundle/Resources/translations/victoire.es.xliff'), 20 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/TemplateBundle/Resources/translations/victoire.es.xliff'), 21 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/UserBundle/Resources/translations/victoire.es.xliff'), 22 => ($this->targetDirs[3].'/vendor/victoire/victoire/Bundle/WidgetBundle/Resources/translations/victoire.es.xliff')), 'pt_BR' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.pt_BR.xlf'), 3 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt_BR.yml'), 4 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt_BR.yml')), 'pt_PT' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.pt_PT.xlf')), 'ua' => array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Resources/translations/security.ua.xlf')), 'ky' => array(0 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ky.yml'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ky.yml')), 'eo' => array(0 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eo.yml'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eo.yml')), 'nb' => array(0 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nb.yml'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nb.yml')))), array());\n\n $instance->setConfigCacheFactory($this->get('config_cache_factory'));\n $instance->setFallbackLocales(array(0 => 'en'));\n\n return $instance;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }", "protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }", "protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }", "public function edit($id, Request $request)\n {\n $services = Services::where('id', $id)->first();\n\n \n }", "public function getEditForm();", "public function editViewName() {\n return ContentServiceProvider::NAME.\"::admin.edit\";\n }", "protected function getVictoireBlog_Article_Form_TypeService()\n {\n return $this->services['victoire_blog.article.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\ArticleType($this->get('doctrine.orm.default_entity_manager'));\n }", "function get_default_link_to_edit()\n {\n }", "protected function getTranslator_DefaultService()\n {\n $this->services['translator.default'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\Translator(new \\Symfony\\Component\\DependencyInjection\\ServiceLocator(array('translation.loader.csv' => function () {\n return ${($_ = isset($this->services['translation.loader.csv']) ? $this->services['translation.loader.csv'] : $this->services['translation.loader.csv'] = new \\Symfony\\Component\\Translation\\Loader\\CsvFileLoader()) && false ?: '_'};\n }, 'translation.loader.dat' => function () {\n return ${($_ = isset($this->services['translation.loader.dat']) ? $this->services['translation.loader.dat'] : $this->services['translation.loader.dat'] = new \\Symfony\\Component\\Translation\\Loader\\IcuDatFileLoader()) && false ?: '_'};\n }, 'translation.loader.ini' => function () {\n return ${($_ = isset($this->services['translation.loader.ini']) ? $this->services['translation.loader.ini'] : $this->services['translation.loader.ini'] = new \\Symfony\\Component\\Translation\\Loader\\IniFileLoader()) && false ?: '_'};\n }, 'translation.loader.json' => function () {\n return ${($_ = isset($this->services['translation.loader.json']) ? $this->services['translation.loader.json'] : $this->services['translation.loader.json'] = new \\Symfony\\Component\\Translation\\Loader\\JsonFileLoader()) && false ?: '_'};\n }, 'translation.loader.mo' => function () {\n return ${($_ = isset($this->services['translation.loader.mo']) ? $this->services['translation.loader.mo'] : $this->services['translation.loader.mo'] = new \\Symfony\\Component\\Translation\\Loader\\MoFileLoader()) && false ?: '_'};\n }, 'translation.loader.php' => function () {\n return ${($_ = isset($this->services['translation.loader.php']) ? $this->services['translation.loader.php'] : $this->services['translation.loader.php'] = new \\Symfony\\Component\\Translation\\Loader\\PhpFileLoader()) && false ?: '_'};\n }, 'translation.loader.po' => function () {\n return ${($_ = isset($this->services['translation.loader.po']) ? $this->services['translation.loader.po'] : $this->services['translation.loader.po'] = new \\Symfony\\Component\\Translation\\Loader\\PoFileLoader()) && false ?: '_'};\n }, 'translation.loader.qt' => function () {\n return ${($_ = isset($this->services['translation.loader.qt']) ? $this->services['translation.loader.qt'] : $this->services['translation.loader.qt'] = new \\Symfony\\Component\\Translation\\Loader\\QtFileLoader()) && false ?: '_'};\n }, 'translation.loader.res' => function () {\n return ${($_ = isset($this->services['translation.loader.res']) ? $this->services['translation.loader.res'] : $this->services['translation.loader.res'] = new \\Symfony\\Component\\Translation\\Loader\\IcuResFileLoader()) && false ?: '_'};\n }, 'translation.loader.xliff' => function () {\n return ${($_ = isset($this->services['translation.loader.xliff']) ? $this->services['translation.loader.xliff'] : $this->services['translation.loader.xliff'] = new \\Symfony\\Component\\Translation\\Loader\\XliffFileLoader()) && false ?: '_'};\n }, 'translation.loader.yml' => function () {\n return ${($_ = isset($this->services['translation.loader.yml']) ? $this->services['translation.loader.yml'] : $this->services['translation.loader.yml'] = new \\Symfony\\Component\\Translation\\Loader\\YamlFileLoader()) && false ?: '_'};\n })), new \\Symfony\\Component\\Translation\\Formatter\\MessageFormatter(new \\Symfony\\Component\\Translation\\MessageSelector()), 'en', array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yaml', 1 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), 'translation.loader.mo' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini'), 'translation.loader.json' => array(0 => 'json')), array('cache_dir' => ($this->targetDirs[0].'/translations'), 'debug' => true, 'resource_files' => array('af' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.af.xlf')), 'ar' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.ar.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.ar.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ar.xlf')), 'az' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.az.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.az.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.az.xlf')), 'bg' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.bg.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.bg.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.bg.xlf')), 'ca' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.ca.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.ca.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ca.xlf')), 'cs' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.cs.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.cs.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.cs.xlf')), 'cy' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.cy.xlf')), 'da' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.da.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.da.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.da.xlf')), 'de' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.de.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.de.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.de.xlf')), 'el' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.el.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.el.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.el.xlf')), 'en' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.en.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.en.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.en.xlf')), 'es' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.es.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.es.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.es.xlf')), 'et' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.et.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.et.xlf')), 'eu' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.eu.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.eu.xlf')), 'fa' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.fa.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.fa.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.fa.xlf')), 'fi' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.fi.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.fi.xlf')), 'fr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.fr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.fr.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.fr.xlf')), 'gl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.gl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.gl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.gl.xlf')), 'he' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.he.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.he.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.he.xlf')), 'hr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.hr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.hr.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.hr.xlf')), 'hu' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.hu.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.hu.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.hu.xlf')), 'hy' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.hy.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.hy.xlf')), 'id' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.id.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.id.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.id.xlf')), 'it' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.it.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.it.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.it.xlf')), 'ja' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.ja.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.ja.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ja.xlf')), 'lb' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.lb.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.lb.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.lb.xlf')), 'lt' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.lt.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.lt.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.lt.xlf')), 'lv' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.lv.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.lv.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.lv.xlf')), 'mn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.mn.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.mn.xlf')), 'nb' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.nb.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.nb.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.nb.xlf')), 'nl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.nl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.nl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.nl.xlf')), 'nn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.nn.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.nn.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.nn.xlf')), 'no' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.no.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.no.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.no.xlf')), 'pl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.pl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.pl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.pl.xlf')), 'pt' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.pt.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.pt.xlf')), 'pt_BR' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.pt_BR.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.pt_BR.xlf')), 'ro' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.ro.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.ro.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ro.xlf')), 'ru' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.ru.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.ru.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ru.xlf')), 'sk' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sk.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.sk.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.sk.xlf')), 'sl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.sl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.sl.xlf')), 'sq' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sq.xlf')), 'sr_Cyrl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.sr_Cyrl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.sr_Cyrl.xlf')), 'sr_Latn' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.sr_Latn.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.sr_Latn.xlf')), 'sv' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.sv.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.sv.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.sv.xlf')), 'th' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.th.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.th.xlf')), 'tl' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.tl.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.tl.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.tl.xlf')), 'tr' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.tr.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.tr.xlf')), 'uk' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.uk.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.uk.xlf')), 'vi' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.vi.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.vi.xlf')), 'zh_CN' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf'), 1 => ($this->targetDirs[3].'/vendor/symfony/form/Resources/translations/validators.zh_CN.xlf'), 2 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.zh_CN.xlf')), 'zh_TW' => array(0 => ($this->targetDirs[3].'/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf')), 'pt_PT' => array(0 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.pt_PT.xlf')), 'ua' => array(0 => ($this->targetDirs[3].'/vendor/symfony/security/Core/Resources/translations/security.ua.xlf')))));\n\n $instance->setConfigCacheFactory(${($_ = isset($this->services['config_cache_factory']) ? $this->services['config_cache_factory'] : $this->getConfigCacheFactoryService()) && false ?: '_'});\n $instance->setFallbackLocales(array(0 => 'en'));\n\n return $instance;\n }", "public function getAppService()\n {\n return $this->getController()->getServiceLocator()->get('Application\\Service\\Service');\n }", "protected function getKitAdmin(): LightKitAdminService\n {\n return $this->getContainer()->get('kit_admin');\n }", "public function getEditor();", "public function getService()\n\t{\n\t\treturn $this->_service;\n\t}", "public function getService()\n {\n return $this->_service;\n }", "protected function getService()\n {\n return $this->service;\n }", "protected function getService()\n {\n return $this->service;\n }", "protected function getVictoireBlog_Article_Container_Form_TypeService()\n {\n return $this->services['victoire_blog.article.container.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\ArticleTemplateType($this->get('doctrine.orm.default_entity_manager'));\n }", "protected function getSwiftmailer_Mailer_Default_TransportService()\n {\n return $this->services['swiftmailer.mailer.default.transport'] = new \\Swift_Transport_SpoolTransport(${($_ = isset($this->services['swiftmailer.mailer.default.transport.eventdispatcher']) ? $this->services['swiftmailer.mailer.default.transport.eventdispatcher'] : $this->getSwiftmailer_Mailer_Default_Transport_EventdispatcherService()) && false ?: '_'}, $this->get('swiftmailer.mailer.default.spool'));\n }", "public function getService()\n\t{\n\t\treturn $this->service;\n\t}", "protected function getHandler()\n {\n static $soap;\n\n if (empty($soap)) {\n $soap = new ECommerceServices(\n new Request(),\n $this->getApplication()->getKernel()->getContainer()->get('Logger'),\n new EventDispatcher()\n );\n }\n\n return $soap;\n }", "protected function getWidgetService()\n {\n if (!$this->widgetService) {\n $this->widgetService = new WidgetService(\n $this->container->get('shopware.emotion_component_installer'),\n $this->container->get('models')\n );\n }\n return $this->widgetService;\n }", "protected function getA2lixTranslationForm_Default_Type_TranslationsService()\n {\n return $this->services['a2lix_translation_form.default.type.translations'] = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslationsType($this->get('a2lix_translation_form.default.listener.translations'), $this->get('a2lix_translation_form.default.service.parameter_locale_provider'));\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getPreset() : ServiceInterface;", "public function getService() {\n return $this->service;\n }", "protected function getTemplating_LocatorService()\n {\n return $this->services['templating.locator'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator($this->get('file_locator'), __DIR__);\n }", "public function getLoginService()\r\n\t{\r\n\t\treturn $this->loginService = new LoginService();\r\n\t}", "function get_default_post_to_edit($post_type = 'post', $create_in_db = \\false)\n {\n }", "public function edit($ID, Request $request)\n {\n $coutService = $this->RechercherCoutService($ID,$request);\n return $coutService;\n }", "protected function getStageService() {}", "public function getService()\r\n\t{\r\n\t\t$this->_service = $this->getClient()->objectStoreService('cloudFiles', $this->region);\r\n\t\treturn $this->_service;\r\n\t}", "protected function getVictoireBlog_BlogSettings_Form_TypeService()\n {\n return $this->services['victoire_blog.blog_settings.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\BlogSettingsType(array(0 => 'fr', 1 => 'en'), $this->get('request_stack'), $this->get('security.authorization_checker'));\n }", "public static function i(): ServicesFactory\n {\n return parent::getInstance();\n }", "function getService() {\n return $this->service;\n }", "protected function getSwiftmailer_Mailer_Default_Transport_RealService()\n {\n $a = new \\Swift_Transport_Esmtp_AuthHandler(array(0 => new \\Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \\Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \\Swift_Transport_Esmtp_Auth_PlainAuthenticator()));\n $a->setUsername(NULL);\n $a->setPassword(NULL);\n $a->setAuthMode(NULL);\n\n $this->services['swiftmailer.mailer.default.transport.real'] = $instance = new \\Swift_Transport_EsmtpTransport(new \\Swift_Transport_StreamBuffer(new \\Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => $a), ${($_ = isset($this->services['swiftmailer.mailer.default.transport.eventdispatcher']) ? $this->services['swiftmailer.mailer.default.transport.eventdispatcher'] : $this->getSwiftmailer_Mailer_Default_Transport_EventdispatcherService()) && false ?: '_'});\n\n $instance->setHost('127.0.0.1');\n $instance->setPort(25);\n $instance->setEncryption(NULL);\n $instance->setTimeout(30);\n $instance->setSourceIp(NULL);\n (new \\Symfony\\Bundle\\SwiftmailerBundle\\DependencyInjection\\SmtpTransportConfigurator(NULL, ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'}))->configure($instance);\n\n return $instance;\n }", "public function editAction()\n {\n return $this->editor($isEditAction=true);\n }", "private function getRessourceService()\n {\n if (!$this->ressourceService) {\n $this->ressourceService = $this->getServiceManager()->get('playgroundcms_ressource_service');\n }\n\n return $this->ressourceService;\n }", "public function getCreateForm()\n {\n return new CreateBlogFormService;\n }", "public function getArticleTypeService() {\n\t\treturn $this->get('sly-service-articletype');\n\t}", "public function edit(Services $services)\n {\n //\n }", "public function edit(Services $services)\n {\n //\n }", "public function edit(Services $services)\n {\n //\n }", "public function getAddOnPackageService() {\n\t\treturn $this->get('sly-service-package-addon');\n\t}", "public function get_service($index = FALSE, $settings = FALSE)\n\t{\t\t\n\t\treturn parent::get_object($index, $settings);\n\t}", "public function edit()\n {\n return $this->get();\n }", "protected function getVictoire_WidgetFilter_Blog_Set_Default_Values_Form_ListenerService()\n {\n return $this->services['victoire.widget_filter.blog.set.default.values.form.listener'] = new \\Victoire\\Bundle\\BlogBundle\\Listener\\ArticleFilterDefaultValuesListener($this->get('doctrine.orm.default_entity_manager'));\n }", "public function getService() : ?ServiceOTP\n {\n return $this->service;\n }", "public function edit()\r\n {\r\n return null;\r\n }", "public function edit($id)\n {\n if (Gate::denies('service.update',ServiceType::findOrFail($id))) {\n session()->flash('warning', 'You do not have permission to edit a service');\n return redirect()->back();\n }\n $serviceType = ServiceType::findOrFail($id);\n return view('pages.settings.services-type.edit', compact('serviceType'));\n }", "public function edit(Service $Service)\n {\n\n return view('pagesystem.Service.edit', compact('Service'));\n }", "protected function getLiipImagine_Cache_Resolver_DefaultService()\n {\n return $this->services['liip_imagine.cache.resolver.default'] = new \\Liip\\ImagineBundle\\Imagine\\Cache\\Resolver\\WebPathResolver($this->get('filesystem'), ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'}, ($this->targetDirs[3].'/app/../web'), 'media/cache');\n }", "public static function getMainInstance(): ServiceProvider\n {\n return self::getInstance(-1);\n }", "public static function getExtensionService(): ExtensionService\n {\n return ObjectManageable::createObject(ExtensionService::class);\n }", "public function getCustomizationService();", "protected function getVictoireWidget_WidgetStyleTypeService()\n {\n return $this->services['victoire_widget.widget_style_type'] = new \\Victoire\\Bundle\\WidgetBundle\\Form\\WidgetStyleType($this->get('kernel'), $this->get('file_locator'));\n }", "protected function getA2lixTranslationForm_Default_Type_TranslationslocalesselectorService()\n {\n return $this->services['a2lix_translation_form.default.type.translationslocalesselector'] = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslationsLocalesSelectorType($this->get('a2lix_translation_form.default.service.parameter_locale_provider'));\n }" ]
[ "0.6098191", "0.60196674", "0.5873266", "0.58377963", "0.5827025", "0.55958503", "0.5575934", "0.55286473", "0.55135185", "0.5478375", "0.54738855", "0.54738855", "0.5472626", "0.545844", "0.54470694", "0.5445974", "0.5443236", "0.54409003", "0.54353774", "0.5422558", "0.54094696", "0.53951323", "0.53951323", "0.53951323", "0.53951323", "0.5395039", "0.53878796", "0.53774905", "0.5375372", "0.5371965", "0.5365025", "0.5352636", "0.5352565", "0.53519225", "0.53462666", "0.5331671", "0.5331671", "0.53261703", "0.5309207", "0.5304688", "0.5304688", "0.5303508", "0.53000945", "0.5299932", "0.5281193", "0.5273298", "0.52706766", "0.5254341", "0.52463603", "0.52383304", "0.52361125", "0.5231027", "0.52236724", "0.52236724", "0.520944", "0.52066755", "0.5198413", "0.51927614", "0.5190706", "0.51827854", "0.5182535", "0.5182535", "0.5182535", "0.5182535", "0.5182535", "0.5182535", "0.5182535", "0.51820034", "0.51743245", "0.5168707", "0.51663226", "0.51589006", "0.5154423", "0.5153851", "0.51497996", "0.5148235", "0.5134024", "0.51320904", "0.51296794", "0.5128286", "0.5117361", "0.5112528", "0.5108373", "0.5106187", "0.5106187", "0.5106187", "0.5105485", "0.5103857", "0.51026756", "0.510089", "0.5100686", "0.50914854", "0.5091041", "0.5076997", "0.5069853", "0.5065754", "0.5059914", "0.50462914", "0.5044695", "0.504142" ]
0.7202705
0
Get all templates from DB
Получить все шаблоны из БД
public function getTemplatesFromDB();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 't.tmpl_id AS value, t.tmpl_name AS text' );\n\t\t\t$query->from( '#__zbrochure_templates AS t' );\n\t\t\t$query->where( 't.tmpl_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_templates = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_templates;\n\t\n\t}", "function getTemplates() {\n\n // Lets load the data if it doesn't already exist\n if (empty($this->_data)) {\n\n // constructs the query\n $query = ' SELECT * '\n . ' FROM #__templateck';\n\n // retrieves the data\n $this->_data = $this->_getList($query);\n }\n\n return $this->_data;\n }", "function ListTemplates()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $Config;\r\n\t\t\t\r\n\t\t\t$sql = \"select * from templates order by TemplateDisplayName asc\" ; \r\n\t\t\treturn $this->get_results($sql);\t\t\r\n\t }", "public function index() {\n $templates = Template::all();\n return $templates;\n }", "public function getAllSMSTemplates()\n {\n $selectTempsql = 'SELECT temp_id, temp_name FROM ' . _DB_PREFIX_ . 'onehop_sms_templates';\n $selectTempsql .= ' WHERE 1 Order By temp_name ASC';\n $templateRes = Db::getInstance()->ExecuteS($selectTempsql);\n return $templateRes;\n }", "public function getAllTemplates() {\n $pages = Templates::templates()->get();\n\n return response()->json($pages);\n }", "public function get_templates()\n {\n $template = new MailTemplate();\n return $template->findAll();\n }", "public function getAllSlideTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:SlideTemplate')\n ->findAll();\n }", "function getAllPageTemplates() {\n global $wpdb;\n return $wpdb->get_col(\"SELECT DISTINCT meta_value FROM wp_postmeta WHERE meta_key = '_wp_page_template'\"); \n }", "function customcert_get_templates() {\n global $DB;\n\n return $DB->get_records_menu('customcert_template', array(), 'name ASC', 'id, name');\n}", "public function getTemplates()\n {\n return $this->hasMany(Template::className(), ['atk_id' => 'id']);\n }", "public function getTemplates()\n {\n $finder = Finder::create()\n ->files()\n ->name('*.sql')\n ->in($this->rootDir.'/../templates')\n ;\n\n $templates = [];\n\n /** @var SplFileInfo $file */\n foreach ($finder as $file) {\n $templates[] = $file->getRelativePathname();\n }\n\n return $templates;\n }", "protected function getTemplates()\r\n\t{\r\n\t\t$templates = array();\r\n\t\tforeach ($this->getProjectDao()->getAllModelTemplates() as $template)\r\n\t\t\t$templates[$template->ID] = $template->Template;\r\n\t\treturn $templates;\r\n\t}", "public function fetchAll()\n {\n $templateTypeTable = new Api_Model_DbTable_TemplateType();\n\n $rowset = $templateTypeTable->fetchAll(null, 'name');\n\n $templateTypes = new Set();\n foreach ($rowset as $row) {\n $templateType = Type::factory($row);\n\n $templateTypes->addItem($templateType);\n }\n\n return $templateTypes;\n }", "public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}", "function templates()\n {\n return [];\n }", "public function getTemplates() {\n $pages = Templates::templates()->paginate(Templates::getPageSize());\n\n return response()->json($pages);\n }", "function fetch_templates( $module_id = false ) // fetch templates for module or all or global\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id', $module_id );\n\t\t}\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}", "public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }", "private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "public function getCreatedTemplates ()\n {\n // Get all the templates\n $table = DB::select('select id_template, name_template, created_at, icon from ezz_templates');\n return response()->json([\n 'templates' => $table\n ], 200);\n }", "public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}", "public function getAllScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findAll();\n }", "public function getTemplates0()\n {\n return $this->hasMany(Template::className(), ['background_id' => 'id']);\n }", "function getPrintTemplates(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_templates\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupPrintTemplates'], $aParams);\r\n\t\t$sListPrintTemplateId = \"\";\r\n\t\t$aListPrintTemplateName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintTemplateId == \"\"){\r\n\t\t\t\t$sListPrintTemplateId = $aLigne[\"printtemplate_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintTemplateId .= \"|\".$aLigne[\"printtemplate_id\"];\r\n\t\t\t}\r\n $aListPrintTemplateName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_templates'] = $sListPrintTemplateId;\r\n $this->aFields['print_templates_label'] = implode(',', $aListPrintTemplateName);\r\n }\r\n }", "public function allEmailTemplateForDataTable()\n {\n return $this->emailTemplateRepository->getAllEmailTemplateForDataTable();\n }", "public function selectgetTemplate()\n {\n $queryString=\"SELECT * FROM Templates WHERE Active ='1' \";\n $this->result = @$this->dbConnection->query($queryString);\n\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "function getAllTemplates($active=null, $account){\n\t\tglobal $db;\n\t\tif($active != null){\n\t\t\t$statement = $db->prepare('SELECT ID, msg, DATE_FORMAT(created, \"%Y-%m-%e\") AS created, active FROM msg_template WHERE active=:active AND accountID=:account ORDER BY ID DESC');\n\t\t\t$statement->execute(array(':active'=>$active, ':account'=>$account));\n\t\t}else{\n\t\t\t$statement = $db->prepare('SELECT ID, msg, DATE_FORMAT(created, \"%Y-%m-%e\") AS created, active FROM msg_template WHERE accountID=:account ORDER BY ID DESC');\n\t\t\t$statement->execute(array(':account'=>$account));\n\t\t}\n\t\treturn $statement->fetchAll(PDO::FETCH_ASSOC);\n\t}", "static function getAllSettingsTemplates($a_type)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->query(\"SELECT * FROM adm_settings_template \".\r\n\t\t\t\" WHERE type = \".$ilDB->quote($a_type, \"text\").\r\n\t\t\t\" ORDER BY title\");\r\n\r\n\t\t$settings_template = array();\r\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\t$settings_template[] = $rec;\r\n\t\t}\r\n\r\n\t\treturn $settings_template;\r\n\t}", "function GetTemplates($userid=0)\n\t{\n\t\t$this->GetDb();\n\n\t\t$qry = \"SELECT templateid, name, ownerid FROM \" \n\t\t . SENDSTUDIO_TABLEPREFIX \n\t\t . \"templates\";\n\t\t\n\t\tif ($userid) {\n\t\t\t$qry .= \" AS t, \" . SENDSTUDIO_TABLEPREFIX \n\t\t\t . \" usergroups_access AS a \"\n\t\t\t . \" WHERE \"\n\t\t\t . \" a.resourceid = t.templateid AND \" \n\t\t\t . \" a.resourcetype = 'templates' \";\n\t\t\t$qry .= \" OR t.ownerid='\" . $this->Db->Quote($userid) . \"'\";\n\t\t} else {\n\t\t\tif (!$this->TemplateAdmin()) {\n\t\t\t\t$qry .= \" WHERE ownerid='\" . $this->Db->Quote($this->userid) . \"'\";\n\t\t\t\t\n\t\t\t\tif (!empty($this->access['templates'])) {\n\t\t\t\t\t$qry .= \" OR templateid IN (\" . implode(',', $this->access['templates']) . \")\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qry .= \" OR isglobal='1'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$qry .= \" ORDER BY LOWER(name) ASC\";\n\n\t\t$templates = array();\n\t\t$result = $this->Db->Query($qry);\n\t\t\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$templates[$row['templateid']] = $row['name'];\n\t\t}\n\n\t\treturn $templates;\n\t}", "public function getTemplates4()\n {\n return $this->hasMany(Template::className(), ['name_id' => 'id']);\n }", "public function getTemplates5()\n {\n return $this->hasMany(Template::className(), ['type_id' => 'id']);\n }", "public function get()\n {\n return $this->templates;\n }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public static function getTemplatesUsed()\n {\n return static::$allTemplates;\n }", "public function getShowTemplates();", "function get_all_templates () {\n global $dbconnect;\n $query = \"SELECT * FROM emails ORDER BY email_id ASC;\";\n $result = mysql_query($query, $dbconnect);\n confirm_query($result);\n return $result;\n}", "function GetDocumentTemplates()\n\t{\n\t\t$result = $this->sendRequest(\"GetDocumentTemplates\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getTemplates1()\n {\n return $this->hasMany(Template::className(), ['cost_id' => 'id']);\n }", "public function getTemplates()\n {\n $templates = SSViewer::get_templates_by_class(static::class, '', __CLASS__);\n // Prefer any custom template\n if ($this->getTemplate()) {\n array_unshift($templates, $this->getTemplate());\n }\n return $templates;\n }", "public function index()\n\t{\n\t $this->authorize('index', 'Template');\n\n\t $templates = $this->templateLoader->loadAll();\n\n\t $perPage = $this->request->get('per_page', 10);\n\t $page = $this->request->get('page', 1);\n\n\t if ($this->request->has('query')) {\n\t $templates = $templates->filter(function($template) {\n\t return str_contains(strtolower($template['name']), $this->request->get('query'));\n });\n }\n\n if ($orderBy = $this->request->get('order_by', 'updated_at')) {\n $desc = $this->request->get('order_dir', 'desc') === 'desc';\n $templates = $templates->sortBy($orderBy, SORT_REGULAR, $desc);\n }\n\n\t $pagination = new LengthAwarePaginator(\n\t $templates->slice($perPage * ($page - 1), $perPage)->values(),\n count($templates),\n $perPage,\n $page\n );\n\n\t return $this->success(['pagination' => $pagination]);\n\t}", "public function getTemplates3()\n {\n return $this->hasMany(Template::className(), ['health_id' => 'id']);\n }", "public function get_post_templates()\n {\n }", "public function getMailTemplates()\n {\n $arrTemplates = array();\n $objTemplates = Database::getInstance()->execute(\"SELECT id,name,category FROM tl_mail_templates ORDER BY category, name\");\n\n while( $objTemplates->next() )\n {\n if ($objTemplates->category == '')\n {\n $arrTemplates[$objTemplates->id] = $objTemplates->name;\n }\n else\n {\n $arrTemplates[$objTemplates->category][$objTemplates->id] = $objTemplates->name;\n }\n }\n\n return $arrTemplates;\n }", "public function getAllForDropDownList()\n {\n $items = (new Query())\n ->select('emails_templates.id, emails_templates.name')\n ->from(['emails_templates' => 'emails_templates'])\n ->orderBy(['emails_templates.name' => SORT_ASC])\n ->all();\n\n return ArrayHelper::map($items, 'id', 'name');\n }", "public function loadTemplates() {\n // Get database hooks.\n $doctrine = $this->container->get('doctrine');\n $slideTemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:SlideTemplate');\n $screenemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:ScreenTemplate');\n $entityManager = $doctrine->getManager();\n\n // Get parameters.\n $path = $this->container->get('kernel')->getRootDir() . '/../web/';\n $serverAddress = $this->container->getParameter('absolute_path_to_server');\n\n // Locate templates in /web/bundles/\n $templates = $this->findTemplates($path . 'bundles/');\n\n foreach ($templates['slides'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadSlideTemplate($config, $slideTemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n foreach ($templates['screens'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadScreenTemplate($config, $screenemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n // Get all templates from the database, and push update to screens.\n $existingTemplates = $screenemplateRepository->findAll();\n $middlewareService = $this->container->get('os2display.middleware.communication');\n foreach ($existingTemplates as $template) {\n foreach ($template->getScreens() as $screen) {\n $middlewareService->pushScreenUpdate($screen);\n }\n }\n }", "function getTemplates($use_defintion, $template_id = null) {\n\t\t$conditions = array();\n\t\t$find_type = $template_id? 'first' : 'all';\n\t\tswitch($use_defintion) {\n\t\t\tcase 'template edition':\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'OR' => array(\n\t\t\t\t\t\tarray('Template.owner' => 'user', 'Template.owning_entity_id' => AppController::getInstance()->Session->read('Auth.User.id')),\n\t\t\t\t\t\tarray('Template.owner' => 'bank', 'Template.owning_entity_id' => AppController::getInstance()->Session->read('Auth.User.group_id')),\n\t\t\t\t\t\tarray('Template.owner' => 'all')),\t\t\t\n\t\t\t\t\t// Both active and inactive template\n\t\t\t\t\t'Template.flag_system' => false);\n\t\t\t\tif(AppController::getInstance()->Session->read('Auth.User.group_id') == '1') unset($conditions['OR']);\t// Admin can work on all templates\n\t\t\t\tif($template_id) $conditions['Template.id'] = $template_id;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'template use':\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'OR' => array(\n\t\t\t\t\t\tarray('Template.visibility' => 'user', 'Template.visible_entity_id' => AppController::getInstance()->Session->read('Auth.User.id')),\n\t\t\t\t\t\tarray('Template.visibility' => 'bank', 'Template.visible_entity_id' => AppController::getInstance()->Session->read('Auth.User.group_id')),\n\t\t\t\t\t\tarray('Template.visibility' => 'all'),\n\t\t\t\t\t\tarray('Template.flag_system' => true)),\n\t\t\t\t\t'Template.flag_active' => 1);\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tAppController::getInstance()->redirect('/Pages/err_plugin_system_error?method='.__METHOD__.',line='.__LINE__, null, true);\t\n\t\t}\n\t\t\n\t\t$templates = $this->find($find_type, array('conditions' => $conditions));\n\t\tif($templates && $find_type == 'first') {\n\t\t\t$templates['Template']['allow_properties_edition'] = ((AppController::getInstance()->Session->read('Auth.User.group_id') == 1) || (AppController::getInstance()->Session->read('Auth.User.id') == $templates['Template']['created_by']));\n\t\t}\n\t\treturn $templates;\n\t}", "function get_template_data($conditions_array=array(),$rows_per_page=10,$start=0)\n\t{\n\t\t$rows=array();\n\t\t$this->db->order_by('id');\n\t\t$result=$this->db->get_where('red_diy_templates',$conditions_array,$rows_per_page,$start);\n\t\tforeach($result->result_array() as $row)\n\t\t{\n\t\t\t$rows[]=$row;\n\t\t}\n\t\treturn $rows;\n\t}", "public function get_templates($data)\n {\n $res = $this->service->getApi()->getAllTemplates();\n return $res;\n }", "function admin_get_idtemplates()\n{\n global $app;\n\n $idtemplates = $app->bbs->idTemplates();\n $idtypes = $app->calibre->idTypes();\n $ids2add = [];\n foreach ($idtypes as $idtype) {\n if (empty($idtemplates)) {\n array_push($ids2add, $idtype['type']);\n } else {\n $found = false;\n foreach ($idtemplates as $idtemplate) {\n if ($idtype['type'] === $idtemplate->name) {\n $found = true;\n break;\n }\n }\n if (!$found) {\n array_push($ids2add, $idtype['type']);\n }\n }\n }\n foreach ($ids2add as $id2add) {\n $ni = new IdUrlTemplate();\n $ni->name = $id2add;\n $ni->val = '';\n $ni->label = '';\n array_push($idtemplates, $ni);\n }\n $app->getLog()->debug('admin_get_idtemplates ' . var_export($idtemplates, true));\n $app->render('admin_idtemplates.html', [\n 'page' => mkPage(getMessageString('admin_idtemplates'), 0, 2),\n 'templates' => $idtemplates,\n 'isadmin' => is_admin()]);\n}", "public function actionIndex()\n {\n $accountId = $this->getAccountId();\n return MessageTemplate::findAll(['accountId' => $accountId]);\n }", "public static function get_templates($conn, $from = 0, $max = 20, $search = '') \n {\n Ossim_db::check_connection($conn);\n \n $list = array();\n \n $num_rows = 0;\n \n // Filter if am i proadmin\n $perms_where = '';\n $users_allowed = array();\n \n if (self::is_pro() && Acl::am_i_proadmin()) \n {\n if (is_array($_SESSION['_user_vision']['users_to_assign'])) \n {\n foreach ($_SESSION['_user_vision']['users_to_assign'] as $user => $perm) \n {\n if ($perm && $user != self::get_session_user())\n { \n $users_allowed[] = $user; \n }\n }\n }\n \n if (count($users_allowed) > 0) \n {\n $perms_where = \"WHERE (id NOT IN (SELECT DISTINCT template_id FROM users) OR id IN (SELECT DISTINCT template_id FROM users WHERE login IN ('\".implode(\"', '\", $users_allowed).\"')))\";\n } \n else \n {\n $perms_where = \"WHERE id NOT IN (SELECT DISTINCT template_id FROM users)\";\n }\n }\n \n //Search filter\n if($search != '' && preg_match('/where/i', $perms_where)) \n {\n $search = preg_replace('/where/i', 'AND', $search);\n }\n \n $query = \"SELECT SQL_CALC_FOUND_ROWS HEX(id) as id, name FROM acl_templates $perms_where $search LIMIT $from, $max\";\n \n $rs = $conn->Execute($query);\n \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n {\n $total = $conn->Execute('SELECT FOUND_ROWS() AS counter');\n \n if (!$total->EOF) \n {\n $num_rows = $total->fields['counter'];\n }\n \n while (!$rs->EOF) \n {\n // Get users assigned\n $users = array();\n $query = 'SELECT login FROM users WHERE template_id = UNHEX(?)';\n \n $rs_2 = $conn->Execute($query, array($rs->fields['id']));\n \n if (!$rs_2) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n {\n while (!$rs_2->EOF) \n {\n $users[] = $rs_2->fields['login'];\n \n $rs_2->MoveNext();\n }\n }\n \n // Get sections allowed\n $total = $conn->Execute(\"SELECT count(*) AS total FROM acl_perm WHERE type = 'MENU' AND description != '' AND enabled = 1\");\n \n $conf = $GLOBALS['CONF'];\n $av_features = ($conf->get_conf('advanced_features') == 1) ? TRUE : FALSE;\n \n \n // av_features = 1 Enable advanced features\n // 50 = Analysis -> Detection -> Anomalies\n // 80 = Configuration -> Network Discovery\n \n if (!$total->EOF)\n {\n $total_perms = $total->fields['total'];\n $total_perms = ($av_features == TRUE) ? $total_perms : $total_perms-2;\n }\n \n $total_perms = ($total_perms < 1) ? 1 : $total_perms;\n \n $total = $conn->Execute(\"SELECT count(*) AS num FROM acl_templates_perms WHERE ac_templates_id = UNHEX(?)\", array($rs->fields['id']));\n \n if (!$total->EOF) \n {\n $count_perms = $total->fields['num'];\n $count_perms = ($count_perms > $total_perms) ? $total_perms : $count_perms;\n }\n \n $perc = round($count_perms * 100 / $total_perms);\n \n $list[] = array(\n \"id\" => $rs->fields['id'],\n \"name\" => $rs->fields['name'],\n \"users\" => implode(', ', $users),\n \"percent\" => $perc\n );\n \n $rs->MoveNext();\n }\n }\n \n return array($list, $num_rows);\n }", "function scanPmanTemplates()\n {\n $tp = DB_DAtaObject::Factory('core_template');\n \n foreach ($this->modules() as $m){\n //var_dump($m);\n // templates...\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m/templates\",\n 'subdir' => '',\n 'match' => '/\\.(html|txt|abw)$/',\n 'skipdir' => array('images','css','js'),\n \n ));\n // print_r($ar);\n \n foreach($ar as $pg) {\n \n $temp = $tp->syncTemplatePage(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m/templates\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n }\n // should clean up old templates..\n // php files..\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m\",\n 'subdir' => '',\n 'match' => '/\\.(php)$/',\n 'skipdir' => array('templates'),\n \n ));\n \n \n foreach($ar as $pg) {\n \n $temp = $tp->syncPhpGetText(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n \n }\n \n \n \n \n \n //$tp->syncTemplatePage($pg);\n }\n $del = DB_DataObject::factory('core_template');\n $del->whereAddIn('!id', $ids, 'int');\n $del->whereAddIn('view_name', $this->modules(), 'string');\n $del->whereAddIn('filetype' , array( 'php', 'html' ), 'string');\n $delids = $del->fetchAll('id');\n if ($delids) {\n DB_DataObject::factory('core_template')->query(\n 'update core_template set is_deleted = 1 where id in('. implode(',', $delids). ')'\n );\n }\n \n }", "public function getTemplates2()\n {\n return $this->hasMany(Template::className(), ['description_id' => 'id']);\n }", "public static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}", "public function actionIndex()\n {\n $model = (new Templates())->getFirstRecordModel();\n $searchModel = new Templates();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $dataProvider->pagination->pageSize = 20;\n\n return $this->render('index', [\n 'firstRecord' => $model,\n 'existRecord' => (new ExistRecordModel())->getExistRecordModel(Templates::class),\n 'disabledAttribute' => true,\n 'dataProvider' => $dataProvider,\n 'filteredColumns' => [],\n 'searchModel' => $searchModel,\n ]);\n }", "public function retrieveMessageTemplates()\n {\n return $this->start()->uri(\"/api/message/template\")\n ->get()\n ->go();\n }", "function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }", "public function allTemplates(int $user_id) {\n $query = $this->db->select('sta_quiztemplate.id AS qtid,pathname,dbname,dbpropname,qoname')\n ->from('sta_quiz')->join('sta_quiztemplate','sta_quiztemplate.id=sta_quiz.templid')\n ->where('sta_quiz.valid',1)->where('sta_quiz.userid',$user_id)->where('sta_quiz.end IS NOT NULL')\n ->group_by('sta_quiztemplate.id')->order_by('pathname')->get();\n return $query->result();\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "protected function readTemplatePacks() {\n\t\tif ($this->items) {\n\t\t\t$sql = \"SELECT\t\tpack.*, COUNT(template.templateID) AS templates\n\t\t\t\tFROM\t\twcf\".WCF_N.\"_template_pack pack\n\t\t\t\tLEFT JOIN\twcf\".WCF_N.\"_template template\n\t\t\t\tON\t\t(template.templatePackID = pack.templatePackID)\n\t\t\t\tGROUP BY\tpack.templatePackID\n\t\t\t\tORDER BY\t\".($this->sortField != 'templates' ? 'pack.' : '').$this->sortField.\" \".$this->sortOrder;\n\t\t\t$result = WCF::getDB()->sendQuery($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$this->templatePacks[] = $row;\n\t\t\t}\n\t\t}\n\t}", "public function getTemplates($context = null);", "function getFormTemplates(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "public static function msgTemplatesList(){\n $accessToken = WxApi::accessToken();\n $offset = 0;\n $count = 5;\n $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=' . $accessToken;\n $postFields = json_encode(array(\n // \"access_token\" => $accessToken,\n \"offset\" => 0,\n \"count\" => 5,\n ));\n $api = curl_init();\n curl_setopt($api, CURLOPT_URL, $url);\n curl_setopt($api, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($api, CURLOPT_HEADER, false);\n curl_setopt($api, CURLOPT_POST, true);\n curl_setopt($api, CURLOPT_POSTFIELDS, $postFields);\n $listObj = curl_exec($api);\n curl_close($api);\n $listObj = json_decode($listObj);\n if($listObj->errcode != 0){\n return NULL;\n }else{\n return $listObj->list;\n // return json_encode($listObj->list);\n }\n }", "public function allPages()\n {\n $this->get('/', function(Request $request, Response $response) {\n $templates = [];\n foreach(new DirectoryIterator($this->basePath . '/src/views/') as $fileInfo) {\n if ($fileInfo->isFile() && strtolower($fileInfo->getExtension()) === 'twig') {\n $baseName = $fileInfo->getBasename('.twig');\n\n $templates[$baseName] = [\n 'name' => $baseName,\n 'has_data' => file_exists($this->basePath . '/src/data/' . $baseName . '.php'),\n ];\n }\n }\n ksort($templates);\n\n return $this->view->render($response, 'app_pages.twig', ['templates' => $templates, 'css_url' => $cssUrl]);\n })->setName('templates.list');\n\n return $this;\n }", "public function getAll(){\n \n // 1. Establece la conexion con la base de datos y trae todos los generos\n $query = $this->getDb()->prepare(\" SELECT * FROM genero\");\n $query-> execute(); \n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function GetTemplatesFromDB(GetTemplatesFromDB $parameters)\n {\n return $this->__soapCall('GetTemplatesFromDB', array($parameters));\n }", "function campaignTemplates() {\n $params = array();\n return $this->callServer(\"campaignTemplates\", $params);\n }", "private function stmtTemplate()\n\t{\n\t\tif($this->stmt_template == NULL) {\n\t\t\t$sql = \"SELECT ustd.id, ustds.width, ustds.height,\n\t\t\t\t\tustds.design_height,\n\t\t\t\t\tIF(ustds.height=0,0,1) AS fixed\n\t\t\t\t\tFROM user_site_template_div ustd\n\t\t\t\t\tJOIN user_site_template_div_size ustds\n\t\t\t\t\tON ustd.id = ustds.div_id\n\t\t\t\t\tAND ustds.site_id = :site_id\n\t\t\t\t\tJOIN user_site_template ust\n\t\t\t\t\tON ustd.template_id = ust.id\n\t\t\t\t\tAND ust.site_id = :site_id\n\t\t\t\t\tWHERE ustd.site_id = :site_id\n\t\t\t\t\tAND ustd.template_id = :template_id\n\t\t\t\t\tAND ustd.parent_id = :parent_id\n\t\t\t\t\tORDER BY ustd.sort_order ASC\";\n\t\t\treturn $this->_db->prepare($sql);\n\t\t} else {\n\t\t\treturn $this->stmt_template;\n\t\t}\n\t}", "public function getTemplates($setId) {\n $select = $this->getDatabase()\n ->select()\n ->from(self::TEMPLATES_TABLE)\n ->where('statisticSetId = ?', $setId);\n\n $data = $select->fetchAll();\n\n $result = array();\n foreach ($data as $item) {\n $result[] = (int)$item['statisticTemplateId'];\n }\n\n return $result;\n }", "public function get_all()\n {\n return $this->findAll();\n // return $this->db->table('settings')->get();\n // return $this->builder->get();\n }", "public static function getTemplate(string $ip)\n {\n return DB::select(\"SELECT id, hotel, data, scheduled, schedule_start_time, schedule_end_time FROM `templates` WHERE hotel IN (SELECT id from hotels WHERE id IN (SELECT hotel FROM nas WHERE nasname = :ip)) AND `activated`='yes' AND `deleted_at` IS NULL \",\n ['ip' => $ip]);\n }", "public function getAllDocumentTemplates($limit, $offset) {\n $query = Doctrine_Query::create()\n ->select('dtt.*, count(dts.id) AS number, dtv.id as document_template_id')\n ->from('DocumentTemplate dtt')\n ->leftJoin('dtt.DocumentTemplateVersion dtv')\n ->leftJoin('dtv.DocumentTemplateSlot dts')\n ->where('dtt.deleted_at IS NULL')\n ->andWhere('dtv.active_version = ?', 1);\n if($limit != -1 AND $offset != -1) {\n $query->limit($limit)\n ->offset($offset);\n }\n return $query->groupBy('dtt.id')\n ->orderBy('dtt.id desc')\n ->execute();\n }", "public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "protected function getTemplatesRequest(){\n\t\t\n\t\t//If the user is logged in\n\t\tif($this->getModel()->checkLogin(true))\n\t\t{\n\t\t\t// Set the state and tell plugins.\n\t\t\t$this->setState('GETTING_TEMPLATES_LIST');\n\t\t\t$this->notifyObservers();\n\t\t\t\n\t\t\t//Gets template data\n\t\t\t$data = $this->getModel()->getFeaturedTemplates();\n\t\t\t\n\t\t\t//Show data\n\t\t\t$this->getView()->showInstallableTemplates($data);\n\t\t}\n\t}", "function bmlt_fetch_templates ()\n {\n global $g_server;\n \n $ret = null;\n \n $retData = array();\n $retLongData = array();\n \n try // Catch any thrown exceptions.\n {\n $sql = \"SELECT * FROM `\".$g_server->GetMeetingTableName_obj().\"_data` WHERE `meetingid_bigint` = 0\";\n $row_result = c_comdef_dbsingleton::preparedQuery ( $sql, array() );\n \n if ( is_array ( $row_result ) && count ( $row_result ) > 0 )\n {\n foreach ( $row_result as $row )\n {\n $retData[$row['key']]['field_prompt'] = $row['field_prompt'];\n $retData[$row['key']]['lang_enum'] = $row['lang_enum'];\n $retData[$row['key']]['visibility'] = $row['visibility'];\n $retData[$row['key']]['data_string'] = $row['data_string'];\n $retData[$row['key']]['data_bigint'] = $row['data_bigint'];\n $retData[$row['key']]['data_double'] = $row['data_double'];\n }\n }\n \n $sql = \"SELECT * FROM `\".$g_server->GetMeetingTableName_obj().\"_longdata` WHERE `meetingid_bigint` = 0\";\n $row_result = c_comdef_dbsingleton::preparedQuery ( $sql, array() );\n \n if ( is_array ( $row_result ) && count ( $row_result ) > 0 )\n {\n foreach ( $row_result as $row )\n {\n $retLongData[$row['key']]['field_prompt'] = $row['field_prompt'];\n $retLongData[$row['key']]['lang_enum'] = $row['lang_enum'];\n $retLongData[$row['key']]['visibility'] = $row['visibility'];\n if ( array_key_exists ( $row, 'data_longtext' ) )\n {\n $retLongData[$row['key']]['data_longtext'] = $row['data_longtext'];\n }\n elseif ( array_key_exists ( $row, 'data_blob' ) )\n {\n $retLongData[$row['key']]['data_blob'] = $row['data_blob'];\n }\n }\n }\n }\n catch ( Exception $e )\n {\n die ( '<pre>'.htmlspecialchars ( print_r ( $e, true ) ).'</pre>' );\n }\n \n if ( is_array ( $retData ) && count ( $retData ) )\n {\n $ret['data'] = $retData;\n }\n \n if ( is_array ( $retLongData ) && count ( $retLongData ) )\n {\n $ret['longdata'] = $retLongData;\n }\n \n return $ret;\n }", "public function index()\n {\n $templates = $this->templates->paginate('name');\n\n return view('templates.index', compact('templates'));\n }", "static public function listTemplates($type)\n {\n $templates = array();\n\n $_templates = Horde::loadConfiguration('templates.php', '_templates', 'whups');\n foreach ($_templates as $name => $info) {\n if ($info['type'] == $type) {\n $templates[$name] = $info['name'];\n }\n }\n\n return $templates;\n }", "public function allPosts($template)\n {\n $req = [\n \"data\" => [\n 'ID AS \"{{ id }}\"',\n 'title AS \"{{ title }}\"',\n 'content AS \"{{ content }}\"',\n 'SUBSTR(content,1 , 1000) AS \"{{ content }}\"',\n 'DATE_FORMAT(published, \\'%d/%m/%Y\\') AS \"{{ published }}\"',\n 'DATE_FORMAT(modified, \\'%d/%m/%Y\\') AS \"{{ modified }}\"'\n ],\n \"from\" => \"posts\"\n ];\n\n\n $data = Model::select($req);\n $count = count($data[\"data\"]);\n for ($i = 0; $i < $count; $i++) {\n global $prefixeFront;\n $data[\"data\"][$i][\"{{ url }}\"] = $prefixeFront . \"chapitre/\" . $data[\"data\"][$i][\"{{ id }}\"];\n }\n $html = View::makeLoopHtml($data[\"data\"], $template);\n\n return $html;\n }", "public function viewProvider()\n {\n $config = $this->getMartyConfig();\n $templateDir = $config['templateDir'];\n $templates = [];\n $it = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($templateDir));\n /** @var \\SplFileInfo $file */\n foreach ($it as $file) {\n if ($file->isFile() && $file->getExtension() == 'tpl') {\n $templateName = substr($file->getPathname(), strlen($templateDir) + 1);\n $templateId = str_replace(['/', '.tpl'], ['.', ''], $templateName);\n $templates[$templateId] = [$templateName];\n }\n }\n\n return $templates;\n }", "public static function getAll()\n {\n try {\n $db = static::getDB();\n $stmt = $db->query('SELECT id, title, content FROM posts ORDER BY created_at');\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n \n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "static function getTemplates($id) {\n return EmailmarketingTemplates::includedInCampaign($id);\n }", "public function get_custom_templates()\n {\n }", "public function get_all ();", "public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}", "public function allDatabaseEntrysForTablePagesAction() {\r\n\t\ttry {\r\n\t\t\t$searchPhrase = (string) $this->getModuleData('tx_extracache_manager_searchPhraseForTablePages');\r\n\t\t\t$sqlWhere = $this->createSqlWhereClauseForDbRecords($searchPhrase, array('tstamp','crdate','starttime','endtime')) . Tx_Extracache_System_Persistence_Typo3DbBackend::getSqlWherePartForPagesWithCacheCleanerStrategy();\r\n\t\t\t$this->getView()->assign ( 'allDatabaseEntrysForTablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->query ( '(tx_extracache_cleanerstrategies!=\\'\\' OR tx_extracache_events!=\\'\\') AND '.$sqlWhere ) );\r\n\t\t\treturn $this->getView()->render ( 'allDatabaseEntrysForTablePages' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\r\n\t}", "public function getTemplate() {}", "public function get_available_templates($contextid) {\n\n $fs = get_file_storage();\n $files = $fs->get_area_files($contextid, 'mod_surveypro', SURVEYPRO_TEMPLATEFILEAREA, 0, 'sortorder', false);\n if (empty($files)) {\n return array();\n }\n\n $templates = array();\n foreach ($files as $file) {\n $templates[] = $file;\n }\n\n return $templates;\n }", "public function getTemplatesList($hint, $uacc_uid=''){\r\n\r\n\t\t$list = array();\r\n\r\n\t\tif($uacc_uid != '')\r\n\t\t\t$query = $this->db->select(\"template_id,name,html_body\")->like(\"name\", $hint)->where(array(\"created_by\"=>$uacc_uid,\"deleted\"=>0))->order_by(\"name\", \"asc\")->get(\"sc_templates\");\r\n\t\telse\r\n\t\t\t$query = $this->db->select(\"template_id,name,html_body\")->like(\"name\", $hint)->where(array(\"deleted\"=>0))->order_by(\"name\", \"asc\")->get(\"sc_templates\");\r\n\r\n\t if ($query->num_rows() > 0){\r\n\t\t\tforeach($query->result() as $row){\r\n\r\n\t\t\t\t$list[] = array(\"name\"=>$row->name, \"label\"=>$row->name, \"id\"=>$row->template_id);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $list;\r\n\t}" ]
[ "0.8262818", "0.7802904", "0.7788046", "0.7597968", "0.73624873", "0.7150043", "0.70923656", "0.7080438", "0.70491445", "0.7039374", "0.70229", "0.70114887", "0.7009191", "0.69464266", "0.6906768", "0.68943524", "0.6741189", "0.6728478", "0.67074895", "0.6686109", "0.66610825", "0.6650865", "0.66347086", "0.6626556", "0.6615125", "0.65892076", "0.657038", "0.65014386", "0.64879924", "0.64879924", "0.6432394", "0.64304817", "0.6411471", "0.6394144", "0.6345815", "0.63443786", "0.63142836", "0.6309844", "0.6297995", "0.6275031", "0.62663305", "0.62635446", "0.62438685", "0.6227862", "0.6161491", "0.6153295", "0.61451983", "0.61347115", "0.6132331", "0.61320275", "0.61271405", "0.6124512", "0.61092794", "0.6089298", "0.60779977", "0.6056364", "0.60402423", "0.6026066", "0.5993994", "0.59916276", "0.5990031", "0.5978052", "0.5966466", "0.5959011", "0.5959011", "0.5959011", "0.5959011", "0.5959011", "0.5959011", "0.5953253", "0.594905", "0.5937973", "0.59174424", "0.5904248", "0.58944756", "0.58812577", "0.58775854", "0.5848494", "0.58477664", "0.5838287", "0.5834936", "0.58320504", "0.58277273", "0.58272225", "0.5818077", "0.581552", "0.58115363", "0.5806931", "0.5805699", "0.5801188", "0.5798205", "0.57936877", "0.5792226", "0.5784402", "0.57836246", "0.57743967", "0.57720107", "0.5769766", "0.576585", "0.57577866" ]
0.8624964
0
Copy images to storage
Копирование изображений в хранилище
public function copyImages();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function copyImages()\n {\n $media = [\n 'slider-woman-on-the-beach.jpg'\n ];\n\n $this->mediaMigration->copyMediaFiles($media, self::MIGRATION_MODULE, 'scandiweb/slider/s/l');\n }", "private function copyToStorage(Image $image) {\n \t$attrs = $image->attributesToArray();\n\t $this->command->info(\"Copying '{$attrs['path']}' to public folder\");\n \t$filePath = dirname(__FILE__).\"/Images/{$attrs['path']}\";\n \tStorage::put(\"public/images/{$attrs['id']}/{$attrs['path']}\", file_get_contents($filePath));\n }", "protected function copyImagesDirectory()\n\t{\n\t\t$params = $this->getParams();\n\n\t\tif ($params->path != '') {\n\t\t\t$date = JFactory::getDate()->toFormat('%Y%m%d');\n\n\t\t\t$src = JPATH_SITE.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images-backup-'.$date;\n\t\t\tJFolder::move($src, $dest);\n\n\t\t\t$src = $params->path.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images';\n\t\t\tJFolder::copy($src, $dest);\n\t\t}\n\t}", "public function archiveImages() {\n try {\n $destination = storage_path('archive/images/' . date('Y') . '/' . date('m') . '/' . date('d'));\n $directory = storage_path('video/images');\n $this->filesystem->copyDirectory($directory, $destination);\n\n } catch (\\Exception $e) {\n throw new ArchiveException('Error archive images: ' . $e->getTraceAsString());\n }\n }", "function storeImages()\n {\n }", "public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "private function generate()\n {\n $originalImages = Storage::files(env('PHOTO_PATH'));\n\n foreach ($originalImages as $originalImage) {\n $pieces = explode('/', $originalImage);\n\n $exp = explode('.', end($pieces));\n\n $extension = end($exp);\n\n array_pop($exp);\n\n $imageId = implode('.', $exp);\n\n $photos = [];\n\n foreach ($this->dimensions as $key => $dimension) {\n $fileName = env('PHOTO_PATH_RESIZE') . \"{$imageId}_{$key}.$extension\";\n\n if (! Storage::exists($fileName)) {\n $img = Image::make(Storage::get($originalImage));\n $img->resize($dimension['width'], $dimension['height']);\n\n Storage::put($fileName, (string)$img->encode(), 'public');\n\n if (Storage::exists($fileName)) {\n $photos[$key] = asset(Storage::url($fileName));\n }\n }\n }\n\n /**\n * Save on Storage\n */\n if (count($photos)) {\n $photo = new Photo();\n $photo->name = $imageId;\n $photo->photos = $photos;\n $photo->photos = $photos;\n $photo->save();\n }\n }\n }", "protected function combineImages() {}", "function movesiteimages()\n\t{\n\t\n\t\tglobal $option, $mainframe;\n\n\t\t//we'll need access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\n\t\t// define where the images are and where we want to put them\n\n\t\t$searchpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$destpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_cirriculum\". DS . \"tmp\" ;\n\n\t\t//read all the image files and put them in an array.\n\t\t$img_files = JFolder::files($searchpath, '.*');\n\n\t\t//Now we need some stuff from the JFile:: class to move all files into the new folder\n\t\tforeach ($img_files as $file) {\n\t\t\tJFile::move($searchpath. DS . $file, $destpath . DS. $file);\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'All images have moved into the site folder' );\n\t\n\t}", "protected function importLayoutImages_processCopiedImages(){\n\t\t\n\t\t\n\t\tforeach($this->arrImportImages as $key=>$arrImage){\n\t\t\t\n\t\t\t//get image ID\n\t\t\t$imageID = $this->insertAttachmentByImage($arrImage);\n\t\t\tif(empty($imageID))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t//update image id\n\t\t\t$arrImage[\"imageid\"] = $imageID;\n\t\t\t$this->arrImportImages[$key] = $arrImage;\n\t\t}\n\t\t\n\t}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}", "public function uploadImage($images)\n {\n foreach ($images as $image) {\n $extension = $image->getClientOriginalExtension();\n $file = $image->move('storage/', uniqid('img_') . '.' . $extension);\n $image = new ClinicImage(['path' => $file->getPathname()]);\n $this->images()->save($image);\n }\n }", "public function saveImage(Request $request){\n $x = explode('/', __DIR__);\n $path = [];\n for($i = 0; $i < count($x); $i++){\n if($x[$i] != 'app')\n array_push($path, $x[$i]);\n else\n break;\n }\n array_push($path, 'public', 'images', 'temp'. $request->ip(). '.jpg');\n $path = implode('/', $path);\n if(!file_exists($path)){\n fopen($path, 'w');\n }\n copy($request->image, $path);\n return response()->json(['code' => 200, 'message' => 'success', 'response' => $path])->header('Cache-control', 'no-cache');\n\n }", "public function processImages()\n \t{\n $this->save();\n if (! $this->errorMessage)\n \t\t parent::uploadImages('image', 'RecipeImage', \"recipeID\");\n \n \t}", "function upload_image2($images) {\n\n $image_urls = array();\n\n foreach ($images as $image) {\n $src_url = $image['src'];\n $dst_url = $image['dst'];\n $type = $image['image_type'];\n\n if($stored_url = upload_image($dst_url, $src_url)) {\n $image_urls[$type] = $stored_url;\n }\n }\n return $image_urls;\n}", "public static function PutImagesOnAnother($srcContainer,$srcImages,$dest,$alpha=false)\r\n {\r\n if(!is_array($srcImages)||empty($srcImages)|| $srcContainer=='' || $dest=='')\r\n return \"Check PutImagesOnAnother Function arguments\";\r\n // we will get the image type from extension. no hard work\r\n $ext=FileExtension($srcContainer);\r\n $background=Graphics::CreateImage($srcContainer); //this will be used as background \r\n if($background===-1)\r\n return \"<br> Image extension not supported ($ext).\";\r\n $containerWidth=ImageSX($background);\r\n $containerHeight=ImageSY($background);\r\n $container=ImageCreateTrueColor($containerWidth,$containerHeight); \r\n if($container===false)\r\n return \"<br> Image processing error on server.\";\r\n $black=ImageColorAllocate($container,255,255,255);\r\n imagefill($container,0,0,$black);\r\n ImageCopy($container,$background,0,0,0,0,$containerWidth,$containerHeight);\r\n\r\n imagealphablending($container,$alpha);\r\n $error='';\r\n foreach($srcImages as $aSrcImg)\r\n {\r\n if(!file_exists($aSrcImg['src']))\r\n {\r\n $error.=\"<br> image not found\".$aSrcImg['src'];\r\n continue;\r\n }\r\n\r\n $content=Graphics::CreateImage($aSrcImg['src']);\r\n if($content===-1)\r\n {\r\n $error.=\"<br> Image extension not supported ($ext).\".$aSrcImg['src'];\r\n continue;\r\n }\r\n if(!$content)\r\n {\r\n $error.=\"<br> Image processing error on server.\".$aSrcImg['src'];\r\n continue;\r\n }\r\n //all is well\r\n //x,y top of the img src to put on\r\n $x=0; //where to put?\r\n $y=0;\r\n $contentWidth=ImageSX($content);\r\n $contentHeight=ImageSY($content);\r\n //calculating position of top-left\r\n if(isset($aSrcImg['isCenter']) && $aSrcImg['isCenter']==true)\r\n {\r\n $x=Floor($containerWidth/2);\r\n $y=Floor($containerHeight/2);\r\n }\r\n else //do with x, y\r\n { \r\n if(isset($aSrcImg['x']))\r\n $x=$aSrcImg['x'];\r\n if(isset($aSrcImg['y']))\r\n $y=$aSrcImg['y'];\r\n }\r\n imagealphablending($content,$alpha); \r\n ImageCopy($container,$content,$x,$y,0,0,$contentWidth,$contentHeight);\r\n //ImageCopyMerge($container,$content,$x,$y,0,0,$contentWidth,$contentHeight,100);\r\n ImageDestroy($content);\r\n }\r\n if(Graphics::SaveImage($container,$dest,$ext))\r\n $error.=\"<br> Image Saved at $dest\";\r\n else $error.=\"<br> Image was not saved\";\r\n if($error=='')\r\n return true;\r\n return $error;\r\n\r\n\r\n }", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function run()\n {\n Image::truncate();\n $data = [];\n for ($i = 1; $i <= 13; $i++) {\n $data[] = ['media_id' => 'pd-cover-' . $i . '.jpg'];\n $data[] = ['media_id' => 'pd-info-' . $i . '.jpg'];\n }\n\n Image::insert($data);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'img' => 'required',\n ]);\n $file = $request->file('img');\n // $file = $request->file('img')->store('public/files');\n $img = Image::make($file)->fit(1096,1096);\n \n // paste another image \n $frame = Frame::latest()->value('frame');\n\n $theFrame = Storage::get($frame);\n \n $img->insert($theFrame);\n return $img->response('jpg');\n \n \n }", "public function run()\n {\n // Laptops\n for ($i = 1; $i <= 2000; $i++) {\n Image::create([\n 'product_id' => $i,\n 'file' => '1 - Copy (' . $i . ').jpg',\n ]);\n }\n\n }", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function copyFiles($destination);", "private function copyResources()\n {\n $sResourcesDirectory = $this->getViewRootDirectory();\n $sResourcesDirectory = substr($sResourcesDirectory, 0, strrpos($sResourcesDirectory, 'View'));\n $sResourcesDirectory .= 'Resources' . DIRECTORY_SEPARATOR;\n\n // copy css\n foreach (glob($sResourcesDirectory . 'css/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n\n // copy js\n foreach (glob($sResourcesDirectory . 'js/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n }", "public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}", "protected function _copyTempProductImages($tempImages) {\n\n $tempPath = config('front.temp_path');\n $productPath = config('front.product_path') . store()->id . '/';\n $images = [];\n\n if (count($tempImages)) {\n\n foreach ($tempImages as $k => $image) {\n\n $imageSize = [];\n\n if (check_file($tempPath . $image) && count($this->_productImgSizes)) {\n\n foreach ($this->_productImgSizes as $size) {\n\n $nameBySize = str_replace(_const('TOBEREPLACED'), \"_{$size}\", $image);\n if (copy($tempPath . $nameBySize, $productPath . $nameBySize)) {\n $imageSize[$size] = $nameBySize;\n }\n\n delete_file($tempPath . $nameBySize);\n }\n\n delete_file($tempPath . $image);\n }\n\n if (count($imageSize)) {\n $images[$k] = $imageSize;\n }\n }\n }\n\n return new Collection($images);\n }", "public function copy_image($image_id=null, $foreign_key=null) {\n\t // test function\n\t $this->Image->image_clone($image_id, $foreign_key);\n\t exit;\n }", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "private static function purgeImages() {\n self::purgeFiles(self::getInterimImageFolder(), self::$interim_image_expiry);\n }", "public function createImage()\n {\n $name = basename($this->absoluteUrl);\n if ($this->fileExists($this->absoluteUrl) && !in_array($name, $this->notAllowedNames)) {\n $mime = @exif_imagetype($this->absoluteUrl);\n if ($mime == IMAGETYPE_JPEG || $mime == IMAGETYPE_PNG || $mime == IMAGETYPE_GIF) {\n if (!file_exists($this->imageDirectory)) {\n mkdir($this->imageDirectory, 0700);\n }\n\n copy($this->absoluteUrl, $this->imageDirectory . DIRECTORY_SEPARATOR . $name);\n }\n }\n }", "public function test_images_are_stored_in_remote_storage_service()\n {\n $image_file = UploadedFile::fake()->image('selfie.png');\n \n $image_storage = $this->app->make(ImageStoreService::class);\n\n $response = $image_storage->store($image_file);\n\n $this->assertArrayHasKey('status', $response->json());\n $this->assertEquals('success', $response->json()['status']);\n $this->assertArrayHasKey('message', $response->json());\n $this->assertEquals('Image saved successfully.', $response->json()['message']);\n $this->assertArrayHasKey('url', $response->json());\n }", "private function fetchImages() {\n\t\ttry {\n\t\t\t\n\t\t\t$images = $this->getParam('fetcher',true);\n\t\t\t$images = explode(chr(13), $images);\n\t\t\tif (sizeof($images > 0)) {\n\n\t\t\t\tif (sizeof($images)==1 && $images[0]=='') {\n\t\t\t\t\tthrow new VCDInvalidInputException('Invalid input!');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check if the screenshots folder already exist\n\t\t\t\t$destFolder = VCDDB_BASE.DIRECTORY_SEPARATOR.ALBUMS.$this->itemObj->getID().DIRECTORY_SEPARATOR;\n\t\t\t\tif (!$this->itemObj->hasScreenshots()) {\n\t\t\t\t\tif (!fs_is_dir($destFolder)) {\n\t\t\t\t\t\tfs_mkdir($destFolder, 0755);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($images as $image) {\n\t\t\t\t\tVCDUtils::grabImage(trim($image), false, $destFolder);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!MovieServices::getScreenshots($this->itemObj->getID())) {\n\t\t\t\t\tMovieServices::markVcdWithScreenshots($this->itemObj->getID());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tVCDException::display($ex,true);\n\t\t}\n\t}", "public function fileStore($data)\n {\n $url = array();\n foreach ($data as $img) {\n $image = $img;\n $imageName = $image->getClientOriginalName();\n $image->move(storage_path('products/images'), $imageName);\n array_push($imageName,$url);\n // $imageUpload = new ImageUpload();\n // $imageUpload->filename = $imageName;\n // $imageUpload->save();\n }\n\n return $url;\n }", "public static function putImages($model, $images, $path, $type, $quantity)\n {\n $images = (array) $images;\n $number = $model->media()->get()->count();\n $difference = null;\n $limitedImgs = null;\n\n if($number < $quantity)\n {\n $difference = $quantity - $number;\n // dd($images);\n $limitedImgs = array_slice($images,0,$difference);\n\n foreach ($limitedImgs as $key => $image) \n {\n $img = Image::make($image->getRealPath());\n\n $img->resize(800, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $image_name = $key. '-' .time().'.'.$image->getClientOriginalExtension();\n\n /*\n ** check if directory exists\n ** if not, create it\n */\n $directory = public_path('/uploads/'. $path);\n if (!file_exists($directory)) \n {\n File::makeDirectory($directory, $mode = 0777, true, true); \n }\n if($directory)\n {\n /*\n ** Save image\n */\n $img->save(public_path('/uploads/'. $path . '/' .$image_name));\n }\n\n $model->media()->create([\n 'id' => (string) Uuid::generate(4),\n 'media_key' => $type,\n 'media_value' => $image_name,\n ]);\n }\n\n // $cover = $model->media()->where('image_key', 'cover')->first();\n\n // if(!$cover)\n // {\n // $model->media()->first()->update(['image_key' => 'cover']);\n // }\n \n }\n else{\n \\Session::flash('msg', trans('session.you_uploaded_max_img_number'));\n return back();\n }\n \n }", "public function storeImages(Request $request){\n $request->validate([\n 'file' => 'required|image|max:5120',\n 'producto' => 'required|exists:productos,id',\n ]);\n\n $images = $request->file('file')->store('public/imagenes');\n\n $url = Storage::url($images);\n $producto = $request->producto;\n\n Image::create([\n 'url' => $url,\n 'producto_id' => $producto\n ]);\n }", "function migrate_multisite_files_copy($source, $dest) \n{ \n\tglobal $files_copied;\n\t\n if (is_file($source)) { \n \t\n \t$dest_dir;\n \tif (is_dir($dest)) {\n\t \t$dest_dir = $dest;\n \t}\n \telse {\n\t \t$dest_dir = dirname($dest);\n \t}\n\n \t// ensure destination exists\n if (!file_exists($dest_dir)) { \n wp_mkdir_p($dest_dir); \n } \n \n //echo \"copy $source -> $dest<br />\";\n copy($source, $dest);\n $files_copied++;\n \n } elseif(is_dir($source)) { \n \n \t// if source is a directory, create corresponding \n \t// directory structure at destination location\n if ($dest[strlen($dest)-1]=='/') { \n if ('/' != $source[strlen($source)-1]) { \n $dest=path_join($dest , basename($source)); \n } \n }\n \n $dirHandle=opendir($source); \n while($file=readdir($dirHandle)) \n { \n if($file!=\".\" && $file!=\"..\") \n { \n \t// recursively copy each file\n $new_dest = path_join($dest , $file);\n $new_source = path_join($source , $file);\n \n //echo \"$new_source -> $new_dest<br />\"; \n migrate_multisite_files_copy($new_source, $new_dest); \n } \n } \n closedir($dirHandle); \n } \n}", "function import_osimages(){\n\t\techo $this->Azure->importOSImages();\n\t}", "public function run()\n {\n //\n DB::table('images')->insert([\n 'image_id' => '000117ade10eed8a3640b44a22de45ae',\n 'storage' => 'filesystem',\n 'image_name' => 'product-224.jpg',\n 'ident' => '/dd/6f/a8/3b64f08b8ffd0d91bcc34ad946f6d8972d2c435a.jpg',\n 'url' => 'public/images/dd/6f/a8/3b64f08b8ffd0d91bcc34ad946f6d8972d2c435a.jpg',\n 'l_ident' => '/2b/93/18/1e822e4dabd72328af949c7f8de4144b38296b44.jpg',\n 'l_url' => 'public/images/2b/93/18/1e822e4dabd72328af949c7f8de4144b38296b44.jpg',\n 'm_ident' => '/f5/5b/c0/c342e554895cf5983c744691a7cc6da1c61e0950.jpg',\n 'm_url' => 'public/images/f5/5b/c0/c342e554895cf5983c744691a7cc6da1c61e0950.jpg',\n 's_ident' => '/8d/93/c4/30bd17d4f0b91c5286eebbc6f4996610688af861.jpg',\n 's_url' => 'public/images/8d/93/c4/30bd17d4f0b91c5286eebbc6f4996610688af861.jpg',\n 'width' => 1204,\n 'height' => 800,\n 'watermark' => 1,\n 'last_modified' =>1442456037\n ]);\n }", "public function UploadPhotos(UploadRequest $request, $id)\n {\n\n $school = School::findOrFail($id);\n\n //Store image directory to the database\n foreach ($request->photos as $photo) {\n $imageName = $photo->getClientOriginalName();\n\n //remove non numbers characters\n $newname = preg_replace('~\\D~', '', $imageName);\n\n $newimagename = $newname . '.' .\"jpg\";\n \n\n\n //save image ImageData to DB\n // $newimagename = $photo->store('school_photos/'.$school->center_number.'/', $newimagename );\n SchoolPhoto::create([\n 'school_id' => $school->id,\n 'filename' => $newname\n ]);\n\n\n //Save the Image to Public Folder\n $photo->move(\n base_path() . '/public/school_photos/'.$school->center_number.'/', $newimagename\n );\n }\n\n\n\n}", "function merge_images($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n $result = imagecreatetruecolor($src_w, $src_h);\n imagecopy($result, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n imagecopy($result, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n imagecopymerge($dst_im, $result, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n}", "public function uploadImages($journal)\n {\n\n $img_nr = 0;\n foreach ($journal['images'] as $image_url => $image) {\n\n $date = $journal['date'];\n $ext = pathinfo($image_url, PATHINFO_EXTENSION);\n // had to add .jpg since the client will add the extension automatically for some unknown reason\n $source_path = $image['large'].'.jpg';\n $dropbox_path = \"/$date/\".$date . '-'. ++$img_nr . '-childcare.' . $ext;\n\n $this->client->upload($source_path, $dropbox_path, ['autorename' => true]);\n\n }\n \n }", "private function makeImages($key, $file_name) {\n\t\t$uri = $this->download($key, $file_name);\n\t\t$this->makeThumbnail($uri, $file_name);\n\t\t$this->makeFull($uri, $file_name);\n\t\t//Delete original File.\n\t\t\\File::delete($uri);\n\t\t//Add to total of imported items.\n\t\t$this->s3->total++;\n\t}", "function save_image_local_dir($image_url){\n $day = date('d');\n $month_m = date('M');\n $year = date('Y');\n $pathname = 'snippet-images/'.$year.'/'.$month_m.'/'.$month_m.'-'.$day;\n $ext = get_file_extension($image_url);\n if(!is_dir($pathname)){\n mkdir($pathname);\n }\n $rand_num = md5(mt_rand());\n $rand = md5($image_url);\n \n @$raw_image = file_get_contents($image_url);\n $path = $pathname. '/' .$rand_num .'.'. $ext;\n $dest = $pathname. '/'. $rand . '.'.$ext;\n \n if($raw_image)\n {\n file_put_contents($path,$raw_image);\n $file = check_and_compress($path,$dest);\n $image_address = \"snippets/\".$file;\n return $image_address;\n }\n else\n {\n return $image_url;\n }\n }", "public function copyOtherFiles(): void;", "function imageMaint() {\n\t\n //$path = realpath(APPPATH).'/libraries/IMagick_Image.php';\n//require_once($path);\n////$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/';\n//$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/LL9138TR_frisbeeRed/';\n//$util = new ImageUtil();\n////$util->imageToDir($path2);\n////$util->cleanUp($path2);\n//$util->removeDir($path2);\n//print $util->log();\n//exit;\n }", "function copy_image_resize_to_folder($source_file, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_file);\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n \n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_file);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_file);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_file);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n \n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "private function prepareFileData() {\n // If the images should not be saved, stop.\n if (!$this->postSaveImagesAsMedia) return;\n\n $postImageSelectors = $this->bot->getSetting(SettingKey::POST_IMAGE_SELECTORS);\n\n // If the user wants to save all images inside the post content, manually add \"img\" selector to the post image\n // selectors.\n if($this->postSaveAllImagesInContent) {\n if(!$postImageSelectors) $postImageSelectors = [];\n\n $postImageSelectors[] = [\n SettingInnerKey::SELECTOR => \"img\",\n SettingInnerKey::ATTRIBUTE => \"src\"\n ];\n }\n\n // Get all content combined\n $allContent = $this->getAllContent();\n\n // If there is no content, we cannot find any images. So, stop.\n if(empty($allContent)) return;\n\n $combinedContent = \"\";\n foreach($allContent as $content) {\n $combinedContent .= $content[\"data\"];\n }\n\n // Create a crawler for the combined content and search for URLs\n $sourceCrawler = $this->bot->createDummyCrawler($combinedContent);\n\n // Prepare the image data\n $this->attachmentMediaFiles = array_merge(\n $this->attachmentMediaFiles,\n $this->prepareFileDataWithSelectors($sourceCrawler, $postImageSelectors)\n );\n }", "function do_export_images()\n\t{\n\t\t$skin_dir = $this->ipsclass->input['skin_dirs'];\n\n\t\tif ( ! @file_exists( CACHE_PATH.'style_images/'.$skin_dir ) )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"Невозможно найти выбранную директорию, проверьте настройки и попробуйте еще раз\";\n\t\t\t$this->show_export_page();\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get xml mah-do-dah\n\t\t//-----------------------------------------\n\n\t\trequire_once( KERNEL_PATH.'class_xml.php' );\n\n\t\t$xml = new class_xml();\n\n\t\trequire_once( KERNEL_PATH.'class_xmlarchive.php' );\n\n\t\t$xmlarchive = new class_xmlarchive( KERNEL_PATH );\n\n\t\t$xmlarchive->strip_path = CACHE_PATH.'style_images/'.$skin_dir;\n\n\t\t$xmlarchive->xml_add_directory( CACHE_PATH.'style_images/'.$skin_dir );\n\n\t\t$xmlarchive->xml_create_archive();\n\n\t\t$contents = $xmlarchive->xml_get_contents();\n\n\t\t$this->ipsclass->admin->show_download( $contents, 'ipb_images-'.$skin_dir.'.xml' );\n\t}", "public function run()\n {\n DB::table('images')->insert([\n [\n \"img\"=> \"/storage/img/ubuntu.svg\",\n ],\n [\n \"img\"=> \"/storage/img/windows.jpg\",\n ],\n [\n \"img\"=> \"/storage/img/android.png\",\n ],\n\n ]);\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "public function resetExtensionCopyStorage() {}", "public function run()\n {\n foreach ($this->getImages() as $image) {\n Image::create($image);\n }\n }", "function my_merge_image ($first_img_path, $second_img_path){\n $width = 1024;\n $height = 512;\n\n //Create new img from file with true color\n $first_img_path = imagecreatefrompng($first_img_path);\n $im = imagecreatetruecolor($width, $height);\n\n // copy and resize part of an img from the path and \"paste\" them side by side\n imagecopyresampled($im, $first_img_path, 0, 0, 0, 0, 1024, 1024, 1024, 1024);\n $second_img_path = imagecreatefrompng($second_img_path);\n imagecopyresampled($im, $second_img_path, 512, 0, 0, 0, 1024, 1024, 1024, 1024);\n\n //save png img from the given img ($im)\n //imagepng($im, \"final_img.png\");\n}", "private function assetPublisher() {\n $assetOrigin = $this->getDir().$this->getPathConfig().'/assets';\n if ($this->fs->exists($assetOrigin)) {\n $assetDest = $this->getPublicPath($this->getPathConfig());\n $this->fs->copyDirectory($assetOrigin,$assetDest);\n }\n }", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }", "public function saveImageForProduct($images)\n {\n $productModel = Mage::getModel('catalog/product');\n $eanField = Mage::getStoreConfig('stockbase_options/login/stockbase_ean_field');\n $accessToken = Mage::getStoreConfig('stockbase_options/token/access');\n $tempFolder = Mage::getBaseDir('media') . DS . 'tmp';\n $io = new Varien_Io_File();\n $addedProducts = array();\n\n foreach ($images as $image) {\n $product = $productModel->loadByAttribute($eanField, $image->EAN);\n $io->checkAndCreateFolder($tempFolder);\n $filePath = $tempFolder . Mage::getSingleton('core/url')->parseUrl($image->{'Url'})->getPath();\n\n // Continue looping, if we dont have product, we have nothing.\n if (!$product) {\n continue;\n }\n\n $client = new Varien_Http_Client($image->{'Url'});\n $client->setMethod(Varien_Http_Client::GET);\n $client->setHeaders('Authentication', $accessToken);\n $protectedImage = $client->request()->getBody();\n\n if ($io->isWriteable($tempFolder)) {\n $io->write($filePath, $protectedImage);\n }\n\n // Verify written file exsist\n if ($io->fileExists($filePath)) {\n if ($product->getMediaGallery() == null) {\n $product->setMediaGallery(array('images' => array(), 'values' => array()));\n }\n $product->addImageToMediaGallery(\n $filePath,\n array('image', 'small_image', 'thumbnail'),\n false,\n false\n );\n $product->{'save'}();\n }\n }\n\n return true;\n }", "public function store(Request $request)\n {\n /* $path =&gt;*/ public_path().'\\public';\n $file = $request->file('file');\necho 3434;\n foreach ($file as $f) {\n $filename = str_random(200) .'.' . $f->getClientOriginalExtension() ?: 'png';\n $img = ImageInt::make($f);\n $img->resize(600,600)->save(/*$path .*/ $filename);\n Image::create(['title' => $request->title, 'img' => $filename]);\n }\n\n return redirect()->route('images.index');\n }", "private function imageStorage($image) {\n // $imgName = time() . '.' . $image->getClientOriginalExtension();\n $imgName = time() . '.' . 'jpg'; //temporary solution\n $localStoragePath = public_path('images');\n\n $img = Image::make($image);\n //treats the image and save it on the right path\n $img->encode('jpg', 75)->resize(500, 500)->save($localStoragePath . '/' . $imgName);\n\n //gets the path to save it\n if(env('APP_ENV') == 'local') {\n $path = public_path('images');\n } else {\n //path to url\n $path = env('APP_URL') . '/images';\n //AWS S3 save\n Storage::disk('s3')->put($imgName, $img);\n\n return Storage::disk('s3')->url($imgName);\n\n }\n\n return $path . '/' . $imgName;\n }", "protected function _moveToImageDir()\n\t{\n\t\t$path = $this->getFilePath();\n\t\t$this->_uploadedFile->moveTo($path);\n\t\tchmod($path, 0644);\n\t}", "private function _saveUploadedImage($id)\n {\n $uploads = $this->request->getUploadedFiles();\n $images = array();\n\n foreach ($uploads as $file) {\n $uniqueName = $file->getKey() . '-' . $id;\n $key = 'events/' . $uniqueName;\n\n switch ($file->getRealType()) {\n case 'image/jpeg':\n $image = imagecreatefromjpeg($file->getRealPath());\n break;\n case 'image/png':\n $image = imagecreatefrompng($file->getRealPath());\n break;\n default:\n $image = null;\n }\n\n if ($image) {\n $tmp = tempnam(null, null);\n imagejpeg($image, $tmp, 75);\n imagedestroy($image);\n\n $client = S3Client::factory(array(\n 'key' => $this->config->amazon->AWSAccessKeyId,\n 'secret' => $this->config->amazon->AWSSecretKey,\n 'region' => 'us-west-2'\n ));\n $bucket = 'findmyrice';\n\n $result = $client->putObject(array(\n 'Bucket' => $bucket,\n 'Key' => $key,\n 'ACL'=> 'public-read',\n 'SourceFile' => $tmp,\n 'ContentType' => 'image/jpeg'\n ));\n\n unlink($tmp);\n\n if ($result) {\n $images[$file->getKey()] = $result['ObjectURL'];\n }\n }\n }\n return $images;\n }", "public function run()\n {\n $imageArray = array(\n 'cover/default.png', 'cover/avengers-infinity-war.jpg', 'cover/coco.jpg',\n 'cover/deadpool-2.jpg', 'cover/fantastic-beasts.jpg', 'cover/oceans-.jpg',\n 'cover/the-greatest-showman.jpg', 'cover/incredibles-2.jpg', 'cover/ant-man-and-the-wasp.jpg'\n );\n foreach($imageArray as $i){\n $image = new Image();\n $image->path = $i;\n $image->save();\n }\n }", "protected function moveImages(Request $request)\n {\n $posterFilename = $this->getPosterFilename($request);\n $posterFilepath = public_path('img') . DIRECTORY_SEPARATOR . 'posters'\n . DIRECTORY_SEPARATOR . $posterFilename;\n\n // If posterUrl is present then the image needs to be downloaded from the URL\n if(!empty($request->posterUrl)) {\n file_put_contents($posterFilepath, file_get_contents($request->posterUrl));\n // Resize the image with ImageMagick\n exec(\"convert $posterFilepath -resize 230x345\\! $posterFilepath\");\n }\n\n // If no posterUrl, then the uploaded image needs to be stored\n if(empty($request->posterUrl)) {\n $request->poster->storeAs('posters', $posterFilename, 'images');\n }\n\n $this->setPermissions($posterFilepath);\n\n /*\n * Handle jumbotron image, if any.\n */\n if($request->hasFile('jumbotron')) {\n $jumbotronFilename = $this->getJumbotronFilename($request);\n\n $request->jumbotron->storeAs('jumbotron', $jumbotronFilename, 'images');\n\n $this->setPermissions(\n public_path('img') . DIRECTORY_SEPARATOR . 'jumbotron'\n . DIRECTORY_SEPARATOR . $jumbotronFilename\n );\n }\n }", "public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }", "public function setImage() {\n\t\t$target_dir = UPROOT;\n\t\t$target_name = basename($_FILES['image']['name']);\n\t\t$tmp_name = $_FILES['image']['tmp_name'];\n\t\t$target_file = UPROOT . \"\\\\public\" . \"\\\\img\\\\\" . $target_name;\n\t\t//just in case file already exist ill append time and date\n\t\t$timeStamp = date(\"Y-m-d_H:i:s\");\n\t\t//checking if file with the same name already exists\n\t\t$append = $this->clean($timeStamp);\n\t\tif (file_exists($target_file)) {\n\t\t\t//renaming the new file by exploding it\n\t\t\t$fileName = explode('.', $target_name);\n\t\t\t$target_name = $fileName[0] . '.' . $append . '.' . $fileName[1];\n\t\t\t//reassign the folder path\n\t\t\t$target_file = UPROOT . \"\\\\public\" . \"\\\\img\\\\\" . $target_name;\n\n\t\t}\n\t\t$imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));\n\t\t$check = getimagesize($tmp_name);\n\t\t$size = $_FILES[\"image\"][\"size\"];\n\t\t$img = [\n\t\t\t'name' => $target_name,\n\t\t\t'fileType' => $imageFileType,\n\t\t\t'tmp_name' => $tmp_name,\n\t\t\t'target_file' => $target_file,\n\t\t\t'check' => $check,\n\t\t\t'size' => $size,\n\t\t];\n\t\treturn $img;\n\t}", "public function run()\n {\n DB::table('images')->insert([\n [\n //'id' => 1,\n 'camera_id' => 1 ,\n 'storage_id' => 1,\n 'data' => 'Image 1',\n 'significance' => 75,\n 'resolution' => '1600 x 1200'\n ],\n [\n //'id' => 2,\n 'camera_id' => 2 ,\n 'storage_id' => 2,\n 'data' => 'Image 2',\n 'significance' => 55,\n 'resolution' => '3840 x 2160'\n ],\n [\n //'id' => 1,\n 'camera_id' => 3 ,\n 'storage_id' => 6,\n 'data' => 'Image 3',\n 'significance' => 60,\n 'resolution' => '4096 x 2160'\n ],\n [\n //'id' => 2,\n 'camera_id' => 4 ,\n 'storage_id' => 3,\n 'data' => 'Image 4',\n 'significance' => 32,\n 'resolution' => '1280 x 720'\n ]\n ]);\n }", "private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }", "public function store(Request $request)\n {\n $files = $request->file('images');\nforeach ($files as $image) {\n // if ($image) {\n $imageName = rand(11111, 99999) . '.' . $image-> getClientOriginalExtension();\n $image->move(public_path('multipic'), $imageName);\n // return $imageName;\n\n Multipics::insert([\n 'image'=>$imageName,\n // 'created_at'=>Carbon::now(),\n\n ]);\n \n\n\n}\n return back()->with('success','Images created successfully!');\n \n // }\n}", "function saveImage($idPublicacion, $instancia) {\r\n require_once 'class/funciones.php';\r\n \r\n // 01 session de imagenes\r\n $dataSession['productos'] = (isset($_SESSION['productos']) && count($_SESSION['productos']) > 0) ? $_SESSION['productos'] : false;\r\n \r\n // 02 recorrido de estas ('productos')\r\n $dataInsert = array();\r\n if(isset($dataSession['productos']) && count($dataSession['productos']) > 0 && $dataSession['productos'] != false) {\r\n foreach ($dataSession['productos'] as $array) {\r\n $targetFile = realpath(__DIR__ .\"/images/productos/\") .'/'. $array['img_tmp']['name'];\r\n \r\n if (!copy($array['img_tmp']['path'], $targetFile)) { echo \"failed to copy image\"; exit; }\r\n \r\n $dataInsert['publicacionID'] = $idPublicacion;\r\n $dataInsert['nombre'] = $array['img_tmp']['name'];\r\n $dataInsert['fecha_registro'] = date(\"Y-m-d h:i:s\");\r\n $dataInsert['estado'] = 1;\r\n \r\n $instancia->insertImagesByPublicacion($dataInsert);\r\n // 02.1 crear thumbnail\r\n $updir = realpath(__DIR__ .\"/images/productos/\") . \"/\";\r\n $dirLocation = realpath(__DIR__ .\"/images/productos/thumb\") . \"/\"; \r\n $extension = getFileExtension($array['img_tmp']['name']);\r\n $id = str_replace($extension, '', $array['img_tmp']['name']);\r\n makeThumbnails($updir, $extension, $id, $dirLocation);\r\n \r\n }\r\n }\r\n // 03 limpiar imagenes en session\r\n if (isset($_SESSION['productos'])) { unset($_SESSION['productos']); } \r\n}", "private function storeImages(&$model, $request)\n {\n if ($request->file('preview_picture')) {\n $imageName = $model->id . '_prev_' . time() . '.' . $request->file('preview_picture')->getClientOriginalExtension();\n $request->file('preview_picture')->move(base_path() . '/public/uploads/', $imageName);\n $model->preview_picture = $imageName;\n $model->save();\n }\n if ($request->file('detail_picture')) {\n $imageName = $model->id . '_detail_' . time() . '.' . $request->file('detail_picture')->getClientOriginalExtension();\n $request->file('detail_picture')->move(base_path() . '/public/uploads/', $imageName);\n $model->detail_picture = $imageName;\n $model->save();\n }\n }", "function mob_images() {\n\tupdate_option( 'thumbnail_size_w', 360 );\n\tupdate_option( 'thumbnail_size_h', 220 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\n\tupdate_option( 'medium_size_w', 654 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_crop', 0 );\n\n\tupdate_option( 'medium_large_size_w', 0 );\n\tupdate_option( 'medium_large_size_h', 0 );\n\n\tupdate_option( 'large_size_w', 850 );\n\tupdate_option( 'large_size_h', 400 );\n\tupdate_option( 'large_crop', 1 );\n\n\tadd_image_size( 'archive-blog', 360, 170, true );\t\n}", "public function store(Request $request)\n {\n // 取得create資料,存取圖片\n // $fileName = Storage::disk('public')->put('/images/product', $request->file('img'));\n // dd($request->file('imgs')[0]);\n // for ($a = 1; $a <= 3; $a++) {\n // 取得create資料,存取圖片\n // $fileName2 = Storage::disk('public')->put('/images/product', $request->file('imgs')[$a]);\n // 將create的資料放進 $product\n // $product = Product::create($request->all());\n // 將檔案路徑換掉\n // /storage/ --> ?\n // $product->imgs = '/storage/' . $fileName2;\n // 儲存\n\n // $product->save();\n // }\n\n // 一張圖片 (自己)\n // 取得create資料,存取圖片\n // $fileName = Storage::disk('public')->put('/images/product', $request->file('img'));\n // 將create的資料放進 $product\n // $product = Product::create($request->all());\n // 將檔案路徑換掉\n // /storage/ --> ?\n // $product->img = '/storage/' . $fileName;\n // 儲存\n\n // $product->save();\n\n // 22222一張圖片\n\n // 在 Product Model裡面撈出 create 所有的資料\n $product = Product::create($request->all());\n // 判斷是否有圖片\n if ($request->hasFile('img')) {\n // (將檔案存在 public裡面的storage\n // 裡面的/images/product資料夾裡面,取得create資料,存取圖片)\n $fileName = Storage::disk('public')->put('/images/product', $request->file('img'));\n // 將圖片路徑換掉\n $product->img = Storage::url($fileName);\n $product->save();\n }\n // else {\n // $product->img = '';\n // $product->save();\n // }\n\n // 多張圖片 (array資料)\n if ($request->hasFile('imgs')) {\n\n foreach ($request->imgs as $img) {\n\n $filePath = Storage::disk('public')->put('/images/product', $img);\n // 在表格裡面儲存資料\n ProductImg::create([\n 'product_id' => $product->id,\n 'url' => Storage::url($filePath),\n ]);\n $product->save();\n }\n }\n // else {\n // $product->img = '';\n // $product->save();\n // }\n\n\n return redirect('/admin/product');\n }", "public function storeProjectMainImage($project){\n if(request()->has('image')){\n $project->update(['image'=>request()->image->store('uploads', 'public')]);\n $image = Image::make(public_path('storage/'. $project->image))->fit(700,700);\n $image->save();\n }\n }", "protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }", "protected function sync()\n {\n $this->image =& $this->temp;\n unset($this->temp);\n }", "function mergeImages($files) {\n global $TMPFILES;\n global $MIN_IMAGE_WIDTH, $TMP_PATH; // from config\n $res = array();\n $TMPFILES []= $TMP_PATH . '/' . substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 16);\n $res['tmpFileName'] = end($TMPFILES);\n\n // load images\n $width = 2147483647;\n foreach ($files as $key => &$file) {\n $imgData = loadImage($file['tmpFileName']);\n if (empty($imgData)) {\n throw new Exception(\"Bad image.\");\n }\n $file = array_merge($file, $imgData);\n $file['width'] = $file['imageInfo'][0];\n $file['height'] = $file['imageInfo'][1];\n if ($width > $file['width']) {\n $width = $file['width'];\n }\n }\n if ($width < $MIN_IMAGE_WIDTH) {\n $width = $MIN_IMAGE_WIDTH;\n }\n $height = 0;\n foreach ($files as $key => &$file) {\n $file['newWidth'] = $width;\n if ($file['width']) {\n $file['newHeight'] = ($width / $file['width']) * $file['height'];\n $height += $file['newHeight'];\n }\n }\n $height += count($files) - 1;\n $dstImage = imagecreatetruecolor($width, $height);\n imagefill($dstImage, 0, 0, 0xFFFFFF);\n $hgh=0;\n foreach ($files as $key => &$file) {\n imagecopyresampled($dstImage, $file['image'], 0, $hgh, 0, 0, $width, $file['newHeight'], $file['width'], $file['height']);\n $hgh += $file['newHeight'] + 1;\n imagedestroy($file['image']);\n deleteFile($file['tmpFileName']);\n }\n\n imagepng($dstImage, $res['tmpFileName']);\n $res['contentType'] = 'image/png';\n $res['hash'] = hash_file('sha256', $res['tmpFileName']);\n $res['srcPathInfo'] = pathinfo(basename($src));\n $res['ext'] = 'png';\n $res['imgType'] = 3;\n imagedestroy($dstImage);\n return $res;\n}", "function addimages($companyname, $imageName, $imageTmpName)\n{\n //connecting to database\n include ('dbconnect.php');\n\n //initailazing the variable\n $directory = \"images/\";\n \n //inbuilt function to move uploaded images to the dirctory\n $result = move_uploaded_file($imageTmpName, $directory.$imageName);\n\n if ($result)\n { \n //query to insert names of images into images table\n $query = \"INSERT INTO images (images, companyid) \n VALUES('$imageName',(SELECT id FROM company WHERE companyname = '$companyname'))\";\n mysqli_query($conn, $query);\n }\n}", "function store_images($source_id, $type) {\n\t\t$image = File::where('type', $type)->where('source_id', $source_id)->first();\n\n\t\tif ($image) {\n\t\t\treturn $image->image_name;\n\t\t}\n\t\treturn getEmptyStoreImage();\n\t}", "public function saveImagePublicFolder($imageBase64) {\n $data = explode(',', $imageBase64);\n $imageData = $data[1];\n $generate_recommended_file_name_data = 'temporary://temp_file.jpg';\n $generate_recommended_file_name = \\Drupal::service('file_system')->realpath($generate_recommended_file_name_data);\n $bin = base64_decode($imageData);\n // Load GD resource from binary data\n $im = imageCreateFromString($bin);\n if (!$im) {\n die('Base64 value is not a valid image');\n }\n // Specify the location where you want to save the image\n $img_file = \\Drupal::service('file_system')->realpath('temporary://' . rand() . '.png');\n imagepng($im, $img_file, 0);\n $cmd = \"convert $img_file $generate_recommended_file_name\";\n exec($cmd, $op);\n sleep(5);\n $fileContent = file_get_contents($generate_recommended_file_name);\n $directory = \"public://\";\n $destination = $directory . 'temp_file.jpg';\n \\Drupal::service('file_system')->prepareDirectory($directory, \\Drupal\\Core\\File\\FileSystemInterface::CREATE_DIRECTORY);\n try {\n $file = file_save_data($fileContent, $destination, FILE_EXISTS_RENAME);\n $destdir = \\Drupal::service('stream_wrapper_manager')->getViaUri('temporary://')->getUri();\n $file_name = $file->getFilename();\n $file_path = $destdir . '/' . $file_name;\n if ($file = file_copy($file, $file_path, FILE_EXISTS_REPLACE)) {\n $url = drupal_realpath($file_path);\n $config = \\Drupal::config('s3fs.settings')->get();\n $s3 = s3fsService::getAmazonS3Client($config);\n $key = 's3fs-public/social_media/' . $file_name;\n $result = $s3->putObject(['Bucket' => $config['bucket'], 'Key' => $key, 'SourceFile' => $url, 'ACL' => 'public-read', ]);\n unlink($url);\n return $s3->getObjectUrl($config['bucket'], $key);\n } else {\n die(\"Could not copy \" . $file_path . \" in \" . $destdir);\n }\n }\n catch(Exception $e) {\n echo 'Message: ' . $e->getMessage();\n }\n }", "public function storeLocalSource($localCopy, $destination)\n\t{\n\t\t$maxCachedImageSize = $this->getCachedCloudImageSize();\n\n\t\t// Resize if constrained by maxCachedImageSizes setting\n\t\tif ($maxCachedImageSize > 0 && ImageHelper::isImageManipulatable($localCopy))\n\t\t{\n\n\t\t\t$image = craft()->images->loadImage($localCopy);\n\n\t\t\tif ($image instanceof Image)\n\t\t\t{\n\t\t\t\t$image->setQuality(100);\n\t\t\t}\n\n\t\t\t$image->scaleToFit($maxCachedImageSize, $maxCachedImageSize)->saveAs($destination);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($localCopy != $destination)\n\t\t\t{\n\t\t\t\tIOHelper::copyFile($localCopy, $destination);\n\t\t\t}\n\t\t}\n\t}", "function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}", "function saveImage()\n\t{\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t/* store a interlaced gif image */\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagegif($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t/* store a progressive jpeg image (with default quality value)*/\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagejpeg($this->ImageStream, $this->sFileLocation, $this->jpegquality);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t/* store a png image */\n\t\t\t\timagepng($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\n\t\t\t\tif (!file_exists($this->sFileLocation)) {\n\t\t\t\t\t$this->printError('file not stored');\n\t\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n $date = new DateTime('now');\n\n DB::table('images')->insert([\n 'product_id' => 1,\n 'src' => 'product1.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 2,\n 'src' => 'product2.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 3,\n 'src' => 'product3.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 4,\n 'src' => 'product4.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 5,\n 'src' => 'product5.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 6,\n 'src' => 'product6.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 7,\n 'src' => 'product7.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 8,\n 'src' => 'product8.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 9,\n 'src' => 'product9.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n DB::table('images')->insert([\n 'product_id' => 10,\n 'src' => 'product10.jpg',\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n }", "protected function scaleImages() {}", "function copyAndResize($imgReal_full_path, $imgTarget_name, $imgTarget_dir, $resize = array())\r\n {\r\n $ext = $this->getExtension($imgReal_full_path);\r\n $source_img = $imgReal_full_path;\r\n #$target_img = $imgTarget_dir . $imgTarget_name . $ext;\r\n $target_img = $imgTarget_dir . '/' . $imgTarget_name .'.'. $ext;\r\n \r\n //create dir\r\n $this->createDir($imgTarget_dir.'/');\r\n \r\n //copy real image\r\n copy($source_img, $target_img) or die('Failed to copy :'.$source_img.'--to--'.$target_img);\r\n //copy resized image\r\n $ret_dirresize = $ret_urlresize = array();\r\n foreach($resize as $key=>$size)\r\n {\r\n $crop = strpos($key, \":\") ? $key : '';\r\n $ret_dirresize[$size] = $this->resize_image($target_img, $crop, $size, false);\r\n //$ret_urlresize[$size] = str_replace(MEDIA_DIR, \"http://klimg.com/merdeka.com/cms/\", $ret_dirresize[$size]);\r\n }\r\n\t\t\t\r\n\t\t\t#harus di unremark ulang\r\n //$sourcefile = array_merge($ret_dirresize, array($target_img));\r\n //$this->send_to_server($sourcefile);\r\n \r\n $return = array(\r\n #'nama' => $target_imgName, \r\n 'nama' => $imgTarget_name .'.'. $ext,\r\n 'type' => $ext, \r\n #'path' => $target_dir, \r\n 'path' => $imgTarget_dir.'/',\r\n 'url_resize'=> $ret_urlresize,\r\n 'dir_resize'=> $ret_dirresize,\r\n //'sourcefile'=> $sourcefile,\r\n\t\t\t\t'sourcefile'=> '',\r\n 'source_img'=> $source_img,\r\n 'target_img'=> $target_img\r\n );\r\n \r\n return $return;\r\n }", "public function copyResized() {\n\t\t\n\t\t$output = array();\n\t\t\n\t\t$options = array_merge(\n\t\t\tarray(\n\t\t\t\t'url' => '',\n\t\t\t\t'filename' => '',\n\t\t\t\t'width' => false,\n\t\t\t\t'height' => false,\n\t\t\t\t'crop' => false\n\t\t\t),\n\t\t\t$_POST\n\t\t);\n\t\t\n\t\t$width = $options['width'];\n\t\t$height = $options['height'];\n\t\t\n\t\tif (!((is_numeric($width) || is_bool($width)) && (is_numeric($height) || is_bool($height)))) {\n\t\t\t$output['error'] = Text::get('error_file_size');\n\t\t\treturn $output;\n\t\t}\n\t\t\n\t\tif ($options['filename']) {\n\t\t\n\t\t\t// Get parent directory.\n\t\t\tif ($options['url']) {\n\t\t\t\t$Page = $this->Automad->getPage($options['url']);\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_PAGES . $Page->path;\n\t\t\t} else {\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_SHARED . '/';\n\t\t\t}\n\t\t\n\t\t\t$file = $directory . $options['filename'];\n\t\t\n\t\t\tCore\\Debug::log($file, 'file');\n\t\t\tCore\\Debug::log($options, 'options');\n\t\t\t\t\n\t\t\tif (file_exists($file)) {\n\t\t\t\t\n\t\t\t\tif (is_writable($directory)) {\n\t\t\t\t\t\n\t\t\t\t\t$img = new Core\\Image(\n\t\t\t\t\t\t$file, \n\t\t\t\t\t\t$width, \n\t\t\t\t\t\t$height,\n\t\t\t\t\t\tboolval($options['crop'])\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$cachedFile = AM_BASE_DIR . $img->file;\n\t\t\t\t\t$resizedFile = preg_replace('/(\\.\\w{3,4})$/', '-' . floor($img->width) . 'x' . floor($img->height) . '$1', $file);\n\t\t\t\t\t\n\t\t\t\t\tif (!$output['error'] = FileSystem::renameMedia($cachedFile, $resizedFile)) {\n\t\t\t\t\t\t$output['success'] = Text::get('success_created') . ' \"' . basename($resizedFile) . '\"';\n\t\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . ' \"' . $directory . '\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$output['error'] = Text::get('error_file_not_found');\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function store_avatar($image, $path)\n{\n // Get directory\n $path = check_directory($path);\n\n // Store avatar\n $image_path = Str::random(8) . '-' . $image->getClientOriginalName();\n\n // Create intervention image\n $img = Image::make($image->getRealPath());\n\n // Generate thumbnail\n $img->fit('150', '150')->stream();\n\n // Store thumbnail to disk\n Storage::put($path . '/' . $image_path, $img);\n\n // Return path to image\n return $path . '/' . $image_path;\n}", "function insertUrlImages($image_name){\r\n\t\t\r\n\t}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->met_image_name = @iconv(\"utf-8\",\"GBK\",$this->met_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->met_image_name){\n $this->met_image_name = strtolower(trim($this->met_image_name));\n $met_image_type = $this->get_type($this->met_image_name);\n $met_image = $this->createImage($met_image_type,$this->met_image_name);\n $met_image_w=ImageSX($met_image);\n $met_image_h=ImageSY($met_image);\n $temp_met_image = $this->getPos($src_image_w,$src_image_h,$this->met_image_pos,$met_image);\n $met_image_x = $temp_met_image[\"dest_x\"];\n $met_image_y = $temp_met_image[\"dest_y\"];\n\t if($this->get_type($this->met_image_name)=='png'){imagecopy($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h);}\n\t else{imagecopymerge($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h,$this->met_image_transition);}\n}\nif ($this->met_text){\n $temp_met_text = $this->getPos($src_image_w,$src_image_h,$this->met_text_pos);\n $met_text_x = $temp_met_text[\"dest_x\"];\n $met_text_y = $temp_met_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->met_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $met_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $met_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->met_text_size, $this->met_text_angle, $met_text_x, $met_text_y, $met_text_color,$this->met_text_font, $this->met_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "public function store(Request $request)\n {\n $photos = $request->file('file');\n\n if (!is_array($photos)) {\n $photos = [$photos];\n }\n\n if (!is_dir($this->photos_path)) {\n mkdir($this->photos_path, 0777);\n }\n\n for ($i = 0; $i < count($photos); $i++) {\n $photo = $photos[$i];\n $name = sha1(date('YmdHis') . Str::random(30));\n $save_name = $name . '.' . $photo->getClientOriginalExtension();\n $resize_name = $name . Str::random(2) . '.' . $photo->getClientOriginalExtension();\n\n $resized_image = InterventionImage::make($photo)\n ->encode('jpg', 75)\n ->resize(1000, 750)\n ->crop(1000, 750);\n // ->save($this->photos_path . '/' . $resize_name);\n\n Storage::disk('s3')->put($resize_name,file_get_contents($photo), 'public');\n //$photo->move($this->photos_path, $save_name);\n\n $upload = new Image();\n $upload->file = $save_name;\n $upload->resizedfilename = $resize_name;\n $upload->originalfilename = basename($photo->getClientOriginalName());\n $upload->property_id = $request->input('propertyadd_id');\n $upload->save();\n }\n\n return Response()->json([\n 'message' => 'Image Enrégistrer avec sucès'\n ], 200);\n\n }", "public function upload()\n {\n\n if (null == $this->fichier)\n {\n return;\n }\n\n if ($this->oldFichier)\n {\n // suppression de l'ancienne image\n if (file_exists($this->getUploadRootDir() . '/' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $this->oldFichier);\n }\n\n\n // suppression des anciens thumbnails\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n if (file_exists($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier);\n }\n\n }\n }\n\n //$date = new \\DateTime('now');\n\n //$nameImage = $date->format('YmdHis') . '-' . $this->fichier->getClientOriginalName();\n //$extension = $this->fichier->guessExtension();\n //$nameImage = str_replace(' ', '-', $this->alt) . uniqid();\n\n // move (param 1 chemin vers dossier, param 2 nom image)\n\n //$this->name = $nameImage . \".\" . $extension;\n\n $this->fichier->move(\n $this->getUploadRootDir(),\n $this->name\n //$nameImage . \".\" . $extension\n );\n\n //$imagine = new \\Imagine\\Gd\\Imagine();\n\n /*$imagine\n ->open($this->getAbsolutePath())\n ->thumbnail(new \\Imagine\\Image\\Box(350, 160))\n ->save(\n $this->getUploadRootDir().'/' .\n $nameImage . '-thumb-small.' . $extension);*/\n\n $imagine = new \\Imagine\\Gd\\Imagine();\n $imagineOpen = $imagine->open($this->getAbsolutePath());\n\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n $size = new \\Imagine\\Image\\Box($thumbnail[0], $thumbnail[1]);\n $mode = \\Imagine\\Image\\ImageInterface::THUMBNAIL_INSET;\n \n $imagineOpen->thumbnail($size, $mode)\n ->save($this->getUploadRootDir() . '/' . $key . '-' . $this->name);\n }\n }", "private function download()\n {\n $response = $this->httpClient->request('GET', env('PHOTO_ENDPOINT'));\n $content = json_decode($response->getBody()->getContents());\n\n if (! json_last_error() and property_exists($content, 'images')) {\n\n $requests = function ($images) {\n foreach ($images as $image) {\n yield new \\GuzzleHttp\\Psr7\\Request('GET', $image->url);\n }\n };\n\n $pool = new Pool($this->httpClient, $requests($content->images), [\n 'concurrency' => count($content->images),\n 'fulfilled' => function ($response, $index) use ($content) {\n $exp = explode('/', $content->images[$index]->url);\n\n $imageId = end($exp);\n\n $fileName = env('PHOTO_PATH') . $imageId;\n\n if (! Storage::exists($fileName)) {\n Storage::put($fileName, $response->getBody()->getContents(), 'public');\n }\n },\n 'rejected' => function ($reason, $index) {\n die('fail');\n },\n ]);\n\n $promise = $pool->promise();\n $promise->wait();\n }\n }", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "public function store(Request $request)\n {\n\n $image = time().'.'.$request->img->extension();\n\n $request->img->move(public_path('images'), $image);\n\n\n Image::create([\n 'title'=>$request['title'],\n 'desc'=>$request['desc'],\n 'img'=>$image,\n\n\n ]);\n\n return redirect()->route('image.index')->with('success','successfully done');\n\n }", "function copy_sprites_to_new_dir($base_token, $count_string, $new_sprite_path, $exclude_sprites = array(), $delete_existing = true, $silent_mode = false, $short_mode = false){\n global $migration_kind, $migration_kind_singular, $migration_limit;\n $kind = $migration_kind_singular;\n $kind_plural = $migration_kind;\n if (!$short_mode){\n ob_echo('----------', $silent_mode);\n ob_echo('Processing '.$kind.' sprites for \"'.$base_token.'\" '.$count_string, $silent_mode);\n }\n ob_flush();\n if (!strstr($new_sprite_path, MMRPG_CONFIG_ROOTDIR)){ $new_sprite_path = MMRPG_CONFIG_ROOTDIR.ltrim($new_sprite_path, '/'); }\n $base_sprite_path = MMRPG_CONFIG_ROOTDIR.'images/'.$kind_plural.'/'.$base_token.'/';\n //ob_echo('-- $base_sprite_path = '.clean_path($base_sprite_path), $silent_mode);\n if (!file_exists($base_sprite_path)){\n $base_sprite_path = MMRPG_CONFIG_ROOTDIR.'images/xxx_'.$kind_plural.'/'.$base_token.'/';\n //ob_echo('-- $base_sprite_path(2) = '.clean_path($base_sprite_path), $silent_mode);\n }\n if (!file_exists($base_sprite_path)){\n ob_echo('- '.clean_path($base_sprite_path).' does not exist', $silent_mode);\n return false;\n }\n //ob_echo('-- $new_sprite_path = '.clean_path($new_sprite_path), $silent_mode);\n if ($delete_existing && file_exists($new_sprite_path)){ deleteDir($new_sprite_path); }\n if (!file_exists($new_sprite_path)){ mkdir($new_sprite_path); }\n ob_echo('- copy '.clean_path($base_sprite_path).'* to '.clean_path($new_sprite_path), $silent_mode);\n recurseCopy($base_sprite_path, $new_sprite_path, $exclude_sprites);\n $global_image_directories_copied = $kind.'_image_directories_copied';\n global $$global_image_directories_copied;\n ${$global_image_directories_copied}[] = basename($base_sprite_path);\n return true;\n}", "public function move_photo(){\n move_uploaded_file($this->tmp_path, '/home/a1031316/public_html/uploaded_images/'.$this->name);\n\n }", "private function intern_save ($targetPath = null)\n\t{\n\t\tif ($this->newImage == null) $this->newImage = $this->srcImage;\n\n\t\tif ($targetPath == null) $targetPath = $this->srcPath;\n\t\telse\n\t\t{\n\t\t\tif (Pathfinder::isAbsolute($targetPath)) $targetPath = $targetPath;\n\t\t\t$targetPath = $this->dataRootPath . $this->getRelativePath($targetPath);\n\t\t}\n\n\t\t// create folders if necessary\n\t\t$this->setUpFolder($targetPath);\n\t\t// remove file from folder with same name\n\t\t$this->intern_removePrevious($targetPath);\n\n\t\t// save\n\t\tswitch($this->srcInfo['extension']) {\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\timagejpeg ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\timagepng ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\timagegif ( $this->newImage, $targetPath);\n\t\t}\n\t\t$this->intern_end();\n\t}", "public function getExtensionCopyStorage() {}", "public function run()\n\t{\n\t\t\\DB::table('images')->delete();\n \n\t\t\\DB::table('images')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'path' => 'assets/images/banners/1401991576banner02.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'path' => 'assets/images/banners/1402586478worktraq.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 3,\n\t\t\t\t'path' => 'assets/images/banners/1401978378static-digital-slide.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 4,\n\t\t\t\t'path' => 'assets/images/banners/1401980310acuity.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 5,\n\t\t\t\t'path' => 'assets/images/banners/1401901794banner04.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 6,\n\t\t\t\t'path' => 'assets/images/banners/13953319071369452126busines-cards.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 7,\n\t\t\t\t'path' => 'assets/images/banners/1395332049slide-banner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 8,\n\t\t\t\t'path' => 'assets/images/banners/1401901816banner01.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 9,\n\t\t\t\t'path' => 'assets/images/banners/1411145938angieslide.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t9 => \n\t\t\tarray (\n\t\t\t\t'id' => 10,\n\t\t\t\t'path' => 'assets/images/banners/1411681755jenni--fall-promo.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t10 => \n\t\t\tarray (\n\t\t\t\t'id' => 11,\n\t\t\t\t'path' => 'assets/images/banners/1433172660sandwich-sale.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t11 => \n\t\t\tarray (\n\t\t\t\t'id' => 12,\n\t\t\t\t'path' => 'assets/images/banners/1420656888adhesivevinyl.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t12 => \n\t\t\tarray (\n\t\t\t\t'id' => 13,\n\t\t\t\t'path' => 'assets/images/banners/1420657264canvas-wrap.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t13 => \n\t\t\tarray (\n\t\t\t\t'id' => 14,\n\t\t\t\t'path' => 'assets/images/banners/1421083269onset-quality-carousel2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t14 => \n\t\t\tarray (\n\t\t\t\t'id' => 15,\n\t\t\t\t'path' => 'assets/images/banners/1421683568valentines-carouself-1200x500.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t15 => \n\t\t\tarray (\n\t\t\t\t'id' => 16,\n\t\t\t\t'path' => 'assets/images/banners/1423773484home-carousel-sp.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t16 => \n\t\t\tarray (\n\t\t\t\t'id' => 17,\n\t\t\t\t'path' => 'assets/images/banners/1423773234ic-home-banner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t17 => \n\t\t\tarray (\n\t\t\t\t'id' => 18,\n\t\t\t\t'path' => 'assets/images/banners/1427899984angie-promo-main-banner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t18 => \n\t\t\tarray (\n\t\t\t\t'id' => 19,\n\t\t\t\t'path' => 'assets/images/banners/1430492093banner-sale-carouself.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t19 => \n\t\t\tarray (\n\t\t\t\t'id' => 20,\n\t\t\t\t'path' => 'assets/images/products/1379344825tabletstand.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t20 => \n\t\t\tarray (\n\t\t\t\t'id' => 21,\n\t\t\t\t'path' => 'assets/images/products/1378502923ipadstand.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t21 => \n\t\t\tarray (\n\t\t\t\t'id' => 22,\n\t\t\t\t'path' => 'assets/images/products/1370031466SMARTDiditalSignage.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t22 => \n\t\t\tarray (\n\t\t\t\t'id' => 23,\n\t\t\t\t'path' => 'assets/images/products/1381258679smartmobile.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t23 => \n\t\t\tarray (\n\t\t\t\t'id' => 24,\n\t\t\t\t'path' => 'assets/images/products/1384883620Angie.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t24 => \n\t\t\tarray (\n\t\t\t\t'id' => 25,\n\t\t\t\t'path' => 'assets/images/products/1384887953IRIS.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t25 => \n\t\t\tarray (\n\t\t\t\t'id' => 26,\n\t\t\t\t'path' => 'assets/images/products/1384887989Kimmi.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t26 => \n\t\t\tarray (\n\t\t\t\t'id' => 27,\n\t\t\t\t'path' => 'assets/images/products/1384888013Jenni.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t27 => \n\t\t\tarray (\n\t\t\t\t'id' => 28,\n\t\t\t\t'path' => 'assets/images/products/1384888037Lily.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t28 => \n\t\t\tarray (\n\t\t\t\t'id' => 29,\n\t\t\t\t'path' => 'assets/images/products/1384888065Tia.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t29 => \n\t\t\tarray (\n\t\t\t\t'id' => 30,\n\t\t\t\t'path' => 'assets/images/products/1422053600pop-up-med.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t30 => \n\t\t\tarray (\n\t\t\t\t'id' => 31,\n\t\t\t\t'path' => 'assets/images/products/1379620194backdrops.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t31 => \n\t\t\tarray (\n\t\t\t\t'id' => 32,\n\t\t\t\t'path' => 'assets/images/products/1381958621saddle.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t32 => \n\t\t\tarray (\n\t\t\t\t'id' => 33,\n\t\t\t\t'path' => 'assets/images/products/1381958923vinyl.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t33 => \n\t\t\tarray (\n\t\t\t\t'id' => 34,\n\t\t\t\t'path' => 'assets/images/products/1422980759boxes-laid-assorted.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t34 => \n\t\t\tarray (\n\t\t\t\t'id' => 35,\n\t\t\t\t'path' => 'assets/images/products/1378392446meshbanner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t35 => \n\t\t\tarray (\n\t\t\t\t'id' => 36,\n\t\t\t\t'path' => 'assets/images/products/1381944971tricohomesthumb.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t36 => \n\t\t\tarray (\n\t\t\t\t'id' => 37,\n\t\t\t\t'path' => 'assets/images/products/1422055979alloy-box-monochrome.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t37 => \n\t\t\tarray (\n\t\t\t\t'id' => 38,\n\t\t\t\t'path' => 'assets/images/products/1381959272canvasthumb.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t38 => \n\t\t\tarray (\n\t\t\t\t'id' => 39,\n\t\t\t\t'path' => 'assets/images/products/1377802135backlits01.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t39 => \n\t\t\tarray (\n\t\t\t\t'id' => 40,\n\t\t\t\t'path' => 'assets/images/products/1378332362walldecal.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t40 => \n\t\t\tarray (\n\t\t\t\t'id' => 41,\n\t\t\t\t'path' => 'assets/images/products/1378335092wallmural2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t41 => \n\t\t\tarray (\n\t\t\t\t'id' => 42,\n\t\t\t\t'path' => 'assets/images/products/1422056436DSC_0072.JPG',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t42 => \n\t\t\tarray (\n\t\t\t\t'id' => 43,\n\t\t\t\t'path' => 'assets/images/products/1378393437outdoorsigns.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t43 => \n\t\t\tarray (\n\t\t\t\t'id' => 44,\n\t\t\t\t'path' => 'assets/images/products/1382543666sandwichboard.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t44 => \n\t\t\tarray (\n\t\t\t\t'id' => 45,\n\t\t\t\t'path' => 'assets/images/products/1422054441vehicle-decals.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t45 => \n\t\t\tarray (\n\t\t\t\t'id' => 46,\n\t\t\t\t'path' => 'assets/images/products/1378394234pavement1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t46 => \n\t\t\tarray (\n\t\t\t\t'id' => 47,\n\t\t\t\t'path' => 'assets/images/products/1381958638brochure.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t47 => \n\t\t\tarray (\n\t\t\t\t'id' => 48,\n\t\t\t\t'path' => 'assets/images/products/1380049145standard_postcard.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t48 => \n\t\t\tarray (\n\t\t\t\t'id' => 49,\n\t\t\t\t'path' => 'assets/images/products/1380663462wallcalendars1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t49 => \n\t\t\tarray (\n\t\t\t\t'id' => 50,\n\t\t\t\t'path' => 'assets/images/products/1378497834postercalendars.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t50 => \n\t\t\tarray (\n\t\t\t\t'id' => 51,\n\t\t\t\t'path' => 'assets/images/products/1381959074albihomesthumb.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t51 => \n\t\t\tarray (\n\t\t\t\t'id' => 52,\n\t\t\t\t'path' => 'assets/images/products/1378495237cut-business-card.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t52 => \n\t\t\tarray (\n\t\t\t\t'id' => 53,\n\t\t\t\t'path' => 'assets/images/products/1381958595standardcards.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t53 => \n\t\t\tarray (\n\t\t\t\t'id' => 54,\n\t\t\t\t'path' => 'assets/images/products/1381958657flatinvitation.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t54 => \n\t\t\tarray (\n\t\t\t\t'id' => 55,\n\t\t\t\t'path' => 'assets/images/products/1381958677foldedinvitation.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t55 => \n\t\t\tarray (\n\t\t\t\t'id' => 56,\n\t\t\t\t'path' => 'assets/images/products/1381958700foldedpostcards.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t56 => \n\t\t\tarray (\n\t\t\t\t'id' => 57,\n\t\t\t\t'path' => 'assets/images/products/1386883344calendar.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t57 => \n\t\t\tarray (\n\t\t\t\t'id' => 58,\n\t\t\t\t'path' => 'assets/images/products/1381179335tentcardsbanner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t58 => \n\t\t\tarray (\n\t\t\t\t'id' => 59,\n\t\t\t\t'path' => 'assets/images/products/1381180701walldecal.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t59 => \n\t\t\tarray (\n\t\t\t\t'id' => 60,\n\t\t\t\t'path' => 'assets/images/products/1421192420mimi-thumb.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t60 => \n\t\t\tarray (\n\t\t\t\t'id' => 61,\n\t\t\t\t'path' => 'assets/images/products/1426867856corner-view.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t61 => \n\t\t\tarray (\n\t\t\t\t'id' => 62,\n\t\t\t\t'path' => 'assets/images/products/1422989976product-carousel1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t62 => \n\t\t\tarray (\n\t\t\t\t'id' => 63,\n\t\t\t\t'path' => 'assets/images/products/1381957380flatinvitation.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t63 => \n\t\t\tarray (\n\t\t\t\t'id' => 64,\n\t\t\t\t'path' => 'assets/images/products/1381957703foldedinvitation.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t64 => \n\t\t\tarray (\n\t\t\t\t'id' => 65,\n\t\t\t\t'path' => 'assets/images/products/1381944377tricohomes.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t65 => \n\t\t\tarray (\n\t\t\t\t'id' => 66,\n\t\t\t\t'path' => 'assets/images/products/13830800441381944399cellbridge.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t66 => \n\t\t\tarray (\n\t\t\t\t'id' => 67,\n\t\t\t\t'path' => 'assets/images/products/1411598984wall-decal-Tommy-gun.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t67 => \n\t\t\tarray (\n\t\t\t\t'id' => 68,\n\t\t\t\t'path' => 'assets/images/products/1422050039pop-up.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t68 => \n\t\t\tarray (\n\t\t\t\t'id' => 69,\n\t\t\t\t'path' => 'assets/images/products/13830804401381875730rogersinsurance-edited.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t69 => \n\t\t\tarray (\n\t\t\t\t'id' => 70,\n\t\t\t\t'path' => 'assets/images/products/13868907646353905923_ee101bc15d-edited2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t70 => \n\t\t\tarray (\n\t\t\t\t'id' => 71,\n\t\t\t\t'path' => 'assets/images/products/1386885885bmo.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t71 => \n\t\t\tarray (\n\t\t\t\t'id' => 72,\n\t\t\t\t'path' => 'assets/images/products/1381429895wallmural-2 750 x 430.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t72 => \n\t\t\tarray (\n\t\t\t\t'id' => 73,\n\t\t\t\t'path' => 'assets/images/products/1430501001vinyl-banner-large.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t73 => \n\t\t\tarray (\n\t\t\t\t'id' => 74,\n\t\t\t\t'path' => 'assets/images/products/1382561893awardwindows.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t74 => \n\t\t\tarray (\n\t\t\t\t'id' => 75,\n\t\t\t\t'path' => 'assets/images/products/1381428990die-cut.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t75 => \n\t\t\tarray (\n\t\t\t\t'id' => 76,\n\t\t\t\t'path' => 'assets/images/products/1381956537brochure.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t76 => \n\t\t\tarray (\n\t\t\t\t'id' => 77,\n\t\t\t\t'path' => 'assets/images/products/1422055884alloy-box-paintings.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t77 => \n\t\t\tarray (\n\t\t\t\t'id' => 78,\n\t\t\t\t'path' => 'assets/images/products/13844485861381952538albihomes.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t78 => \n\t\t\tarray (\n\t\t\t\t'id' => 79,\n\t\t\t\t'path' => 'assets/images/products/1380234083smartmobiledev1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t79 => \n\t\t\tarray (\n\t\t\t\t'id' => 80,\n\t\t\t\t'path' => 'assets/images/products/1421191769mim-base.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t80 => \n\t\t\tarray (\n\t\t\t\t'id' => 81,\n\t\t\t\t'path' => 'assets/images/products/1430501384olympic-banner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t81 => \n\t\t\tarray (\n\t\t\t\t'id' => 82,\n\t\t\t\t'path' => 'assets/images/products/13847927331382561676waterscape-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t82 => \n\t\t\tarray (\n\t\t\t\t'id' => 83,\n\t\t\t\t'path' => 'assets/images/products/13847928771382561640universitysign-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t83 => \n\t\t\tarray (\n\t\t\t\t'id' => 84,\n\t\t\t\t'path' => 'assets/images/products/1382561567sandwichboard1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t84 => \n\t\t\tarray (\n\t\t\t\t'id' => 85,\n\t\t\t\t'path' => 'assets/images/products/1382561535santespa.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t85 => \n\t\t\tarray (\n\t\t\t\t'id' => 86,\n\t\t\t\t'path' => 'assets/images/products/13844503931381429654draft-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t86 => \n\t\t\tarray (\n\t\t\t\t'id' => 87,\n\t\t\t\t'path' => 'assets/images/products/13844500971381958186foldedpostcards-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t87 => \n\t\t\tarray (\n\t\t\t\t'id' => 88,\n\t\t\t\t'path' => 'assets/images/products/13844491201381428744milan-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t88 => \n\t\t\tarray (\n\t\t\t\t'id' => 89,\n\t\t\t\t'path' => 'assets/images/products/1383689286angie-web-2.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t89 => \n\t\t\tarray (\n\t\t\t\t'id' => 90,\n\t\t\t\t'path' => 'assets/images/products/1383677308iris-web.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t90 => \n\t\t\tarray (\n\t\t\t\t'id' => 91,\n\t\t\t\t'path' => 'assets/images/products/1383609470kimmi-web.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t91 => \n\t\t\tarray (\n\t\t\t\t'id' => 92,\n\t\t\t\t'path' => 'assets/images/products/1411576316webpage-jenni2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t92 => \n\t\t\tarray (\n\t\t\t\t'id' => 93,\n\t\t\t\t'path' => 'assets/images/products/1383688018tia-web.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t93 => \n\t\t\tarray (\n\t\t\t\t'id' => 94,\n\t\t\t\t'path' => 'assets/images/products/1383688136lily-web.png',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t94 => \n\t\t\tarray (\n\t\t\t\t'id' => 95,\n\t\t\t\t'path' => 'assets/images/products/1381956362saddle1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t95 => \n\t\t\tarray (\n\t\t\t\t'id' => 96,\n\t\t\t\t'path' => 'assets/images/products/1386886548856547329e440f3eff1f77193833d4f4-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t96 => \n\t\t\tarray (\n\t\t\t\t'id' => 97,\n\t\t\t\t'path' => 'assets/images/products/1381429371illumina.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t97 => \n\t\t\tarray (\n\t\t\t\t'id' => 98,\n\t\t\t\t'path' => 'assets/images/products/1381952877olympicpark.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t98 => \n\t\t\tarray (\n\t\t\t\t'id' => 99,\n\t\t\t\t'path' => 'assets/images/products/1381429237tentcards.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t99 => \n\t\t\tarray (\n\t\t\t\t'id' => 100,\n\t\t\t\t'path' => 'assets/images/products/1386691576calendar.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t100 => \n\t\t\tarray (\n\t\t\t\t'id' => 101,\n\t\t\t\t'path' => 'assets/images/products/1379535395tabletstand.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t101 => \n\t\t\tarray (\n\t\t\t\t'id' => 102,\n\t\t\t\t'path' => 'assets/images/products/1381429093postercalendar.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t102 => \n\t\t\tarray (\n\t\t\t\t'id' => 103,\n\t\t\t\t'path' => 'assets/images/products/1381429054wallcalendar.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t103 => \n\t\t\tarray (\n\t\t\t\t'id' => 104,\n\t\t\t\t'path' => 'assets/images/products/1381956957standardcard.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t104 => \n\t\t\tarray (\n\t\t\t\t'id' => 105,\n\t\t\t\t'path' => 'assets/images/products/1386887756Untitled-3.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t105 => \n\t\t\tarray (\n\t\t\t\t'id' => 106,\n\t\t\t\t'path' => 'assets/images/products/1381428933meshbanner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t106 => \n\t\t\tarray (\n\t\t\t\t'id' => 107,\n\t\t\t\t'path' => 'assets/images/products/1386707800canvaswrap.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t107 => \n\t\t\tarray (\n\t\t\t\t'id' => 108,\n\t\t\t\t'path' => 'assets/images/products/1381953048albihomes.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t108 => \n\t\t\tarray (\n\t\t\t\t'id' => 109,\n\t\t\t\t'path' => 'assets/images/products/1386977236background.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t109 => \n\t\t\tarray (\n\t\t\t\t'id' => 110,\n\t\t\t\t'path' => 'assets/images/products/13843577351381419905menu-panel.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t110 => \n\t\t\tarray (\n\t\t\t\t'id' => 111,\n\t\t\t\t'path' => 'assets/images/products/1412633646jenni--fall-promo.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t111 => \n\t\t\tarray (\n\t\t\t\t'id' => 112,\n\t\t\t\t'path' => 'assets/images/products/13844498461382562037worleyparsons-edited2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t112 => \n\t\t\tarray (\n\t\t\t\t'id' => 113,\n\t\t\t\t'path' => 'assets/images/products/13833437981382562189van-houtte-menu.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t113 => \n\t\t\tarray (\n\t\t\t\t'id' => 114,\n\t\t\t\t'path' => 'assets/images/products/1382562231westech.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t114 => \n\t\t\tarray (\n\t\t\t\t'id' => 115,\n\t\t\t\t'path' => 'assets/images/products/1382627057vehiclegraphics.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t115 => \n\t\t\tarray (\n\t\t\t\t'id' => 116,\n\t\t\t\t'path' => 'assets/images/products/1382631001douglashomes.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t116 => \n\t\t\tarray (\n\t\t\t\t'id' => 117,\n\t\t\t\t'path' => 'assets/images/products/1382971735mortgagestogo.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t117 => \n\t\t\tarray (\n\t\t\t\t'id' => 118,\n\t\t\t\t'path' => 'assets/images/products/1384293069ALLOY-BOX.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t118 => \n\t\t\tarray (\n\t\t\t\t'id' => 119,\n\t\t\t\t'path' => 'assets/images/products/1384451680Untitled-2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t119 => \n\t\t\tarray (\n\t\t\t\t'id' => 120,\n\t\t\t\t'path' => 'assets/images/products/1384797984kimmi.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t120 => \n\t\t\tarray (\n\t\t\t\t'id' => 121,\n\t\t\t\t'path' => 'assets/images/products/13844548598a28653a167a5975d0327f5101dda10c-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t121 => \n\t\t\tarray (\n\t\t\t\t'id' => 122,\n\t\t\t\t'path' => 'assets/images/products/1384456721LILY.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t122 => \n\t\t\tarray (\n\t\t\t\t'id' => 123,\n\t\t\t\t'path' => 'assets/images/products/1384539764c606985530a891409d94dc55d6973a7b-edited.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t123 => \n\t\t\tarray (\n\t\t\t\t'id' => 124,\n\t\t\t\t'path' => 'assets/images/products/1384545795picture.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t124 => \n\t\t\tarray (\n\t\t\t\t'id' => 125,\n\t\t\t\t'path' => 'assets/images/products/1384548119toyota.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t125 => \n\t\t\tarray (\n\t\t\t\t'id' => 126,\n\t\t\t\t'path' => 'assets/images/products/1386697641MilanDisplay.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t126 => \n\t\t\tarray (\n\t\t\t\t'id' => 127,\n\t\t\t\t'path' => 'assets/images/products/1386887231floordecal.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t127 => \n\t\t\tarray (\n\t\t\t\t'id' => 128,\n\t\t\t\t'path' => 'assets/images/products/1426869817hbl-3d-mockup-web.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t128 => \n\t\t\tarray (\n\t\t\t\t'id' => 129,\n\t\t\t\t'path' => 'assets/images/products/1426869669gloss-matter-web.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t129 => \n\t\t\tarray (\n\t\t\t\t'id' => 130,\n\t\t\t\t'path' => 'assets/images/products/1426869782corner-view.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t130 => \n\t\t\tarray (\n\t\t\t\t'id' => 131,\n\t\t\t\t'path' => 'assets/images/products/1422054814urban-systems.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t131 => \n\t\t\tarray (\n\t\t\t\t'id' => 132,\n\t\t\t\t'path' => 'assets/images/products/1422055947alloy-box-monochrome.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t132 => \n\t\t\tarray (\n\t\t\t\t'id' => 133,\n\t\t\t\t'path' => 'assets/images/products/1422980918boxes-pile-assorted.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t133 => \n\t\t\tarray (\n\t\t\t\t'id' => 134,\n\t\t\t\t'path' => 'assets/images/products/1422980964boxes-laid-assorted.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t134 => \n\t\t\tarray (\n\t\t\t\t'id' => 135,\n\t\t\t\t'path' => 'assets/images/products/1422990440product-carousel2.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t135 => \n\t\t\tarray (\n\t\t\t\t'id' => 136,\n\t\t\t\t'path' => 'assets/images/products/1422990557product-carousel1.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t136 => \n\t\t\tarray (\n\t\t\t\t'id' => 137,\n\t\t\t\t'path' => 'assets/images/products/1422990578smart-plaque-edge.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t137 => \n\t\t\tarray (\n\t\t\t\t'id' => 138,\n\t\t\t\t'path' => 'assets/images/products/1423266030triangles-dont-bind-yourself-web.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t138 => \n\t\t\tarray (\n\t\t\t\t'id' => 139,\n\t\t\t\t'path' => 'assets/images/products/1423266291style-web.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t139 => \n\t\t\tarray (\n\t\t\t\t'id' => 140,\n\t\t\t\t'path' => 'assets/images/products/1423684661flat.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t140 => \n\t\t\tarray (\n\t\t\t\t'id' => 141,\n\t\t\t\t'path' => 'assets/images/products/1423761301carousel-small.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t141 => \n\t\t\tarray (\n\t\t\t\t'id' => 142,\n\t\t\t\t'path' => 'assets/images/products/1423773867bodyshop.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t142 => \n\t\t\tarray (\n\t\t\t\t'id' => 143,\n\t\t\t\t'path' => 'assets/images/products/1423784688swimming-sign.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t143 => \n\t\t\tarray (\n\t\t\t\t'id' => 144,\n\t\t\t\t'path' => 'assets/images/products/1431711231mesh-product-banner.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t144 => \n\t\t\tarray (\n\t\t\t\t'id' => 145,\n\t\t\t\t'path' => 'assets/images/products/1431722773vinyl-banner-wscr.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t145 => \n\t\t\tarray (\n\t\t\t\t'id' => 146,\n\t\t\t\t'path' => 'assets/images/products/1435162103floor-tubs.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t146 => \n\t\t\tarray (\n\t\t\t\t'id' => 147,\n\t\t\t\t'path' => 'assets/images/products/1435162844window-hours.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t147 => \n\t\t\tarray (\n\t\t\t\t'id' => 148,\n\t\t\t\t'path' => 'assets/images/products/1435163036window-toyota.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t148 => \n\t\t\tarray (\n\t\t\t\t'id' => 149,\n\t\t\t\t'path' => 'assets/images/products/1435163251wall-graphic.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t149 => \n\t\t\tarray (\n\t\t\t\t'id' => 150,\n\t\t\t\t'path' => 'assets/images/products/1435163359wall-brick-tommys.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t150 => \n\t\t\tarray (\n\t\t\t\t'id' => 151,\n\t\t\t\t'path' => 'assets/images/products/1435163430window-etch-wide.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t151 => \n\t\t\tarray (\n\t\t\t\t'id' => 152,\n\t\t\t\t'path' => 'assets/images/products/1435262171window-privacy-perforated.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t152 => \n\t\t\tarray (\n\t\t\t\t'id' => 153,\n\t\t\t\t'path' => 'assets/images/products/1435262657window-privacy-slats.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t153 => \n\t\t\tarray (\n\t\t\t\t'id' => 154,\n\t\t\t\t'path' => 'assets/images/banners/banner607-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t154 => \n\t\t\tarray (\n\t\t\t\t'id' => 155,\n\t\t\t\t'path' => 'assets/images/banners/banner507-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t155 => \n\t\t\tarray (\n\t\t\t\t'id' => 156,\n\t\t\t\t'path' => 'assets/images/banners/banner407-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t156 => \n\t\t\tarray (\n\t\t\t\t'id' => 157,\n\t\t\t\t'path' => 'assets/images/banners/banner307-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t157 => \n\t\t\tarray (\n\t\t\t\t'id' => 158,\n\t\t\t\t'path' => 'assets/images/banners/banner207-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t158 => \n\t\t\tarray (\n\t\t\t\t'id' => 159,\n\t\t\t\t'path' => 'assets/images/banners/banner107-07-15.09-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t159 => \n\t\t\tarray (\n\t\t\t\t'id' => 160,\n\t\t\t\t'path' => 'assets/images/product-options/lustre-print10-07-15.14-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t\t160 => \n\t\t\tarray (\n\t\t\t\t'id' => 161,\n\t\t\t\t'path' => 'assets/images/product-offers/about-us-5.23-07-15.jpg',\n\t\t\t\t'store' => 'local',\n\t\t\t\t'file_id' => NULL,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t));\n\t}" ]
[ "0.74411803", "0.7068767", "0.6778374", "0.6717099", "0.6654278", "0.6540883", "0.63669074", "0.6115651", "0.59764445", "0.59682953", "0.58841497", "0.5808245", "0.58032787", "0.5763859", "0.5722151", "0.57065827", "0.56740564", "0.55958104", "0.55422777", "0.55406654", "0.55352354", "0.55340946", "0.5523544", "0.5512501", "0.5499868", "0.54940134", "0.54931664", "0.54701453", "0.5465405", "0.5462297", "0.54589236", "0.54548466", "0.5447361", "0.54359585", "0.5433372", "0.54322386", "0.5421597", "0.54142", "0.53803635", "0.5368525", "0.53683794", "0.53678215", "0.5355107", "0.5351304", "0.5343185", "0.5342396", "0.53398466", "0.5333844", "0.53231376", "0.5314128", "0.5298475", "0.52977014", "0.52954805", "0.5288707", "0.52862984", "0.5283064", "0.5282288", "0.52799517", "0.52725714", "0.52712184", "0.5270334", "0.5262594", "0.52609724", "0.52457845", "0.52414614", "0.52406603", "0.5235798", "0.52352047", "0.52307457", "0.52269113", "0.52248305", "0.5219549", "0.5202075", "0.5199817", "0.51808923", "0.5177981", "0.51764226", "0.5170464", "0.5165627", "0.51638263", "0.5162452", "0.5161261", "0.51607686", "0.5160328", "0.51547754", "0.5153072", "0.5152906", "0.5150578", "0.5149877", "0.5149237", "0.5148862", "0.51485056", "0.5146427", "0.5136742", "0.5131722", "0.51275396", "0.51200074", "0.51172245", "0.511271", "0.5111169" ]
0.822315
0
Get validation rules for updating a template
Получить правила валидации для обновления шаблона
public function getValidationRulesUpdate(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateRules()\n {\n return [\n \"id\" => \"required\"\n ];\n }", "public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}", "abstract protected function getValidationRules();", "public function getValidationUpdateRules(): array\n {\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "private function getRules()\n {\n return array(\n 'name' => new Pattern\\Name,\n 'height' => new Pattern\\Height,\n 'lat' => array(\n 'required' => true,\n 'rules' => array('Latitude')\n ),\n 'lng' => array(\n 'required' => true,\n 'rules' => array('Longitude')\n ),\n 'api_key' => array(\n 'required' => true,\n 'rules' => array(\n 'NotEmpty' => array(\n 'message' => 'Google API key can not be empty'\n )\n )\n ),\n 'style' => array(\n 'required' => false,\n 'rules' => array('Json')\n )\n );\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "protected function updateValidations()\n {\n switch (Input::get('form')) {\n\n case 'user-basic':\n $rules = [\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'description' => 'nullable|max:1200',\n ];\n break;\n case 'user-update':\n $rules = [\n 'username' => 'required|max:18|alpha_num',\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'email' => 'required|email|max:100',\n 'status' => 'required|integer',\n 'description' => 'nullable|max:1200',\n 'roles' => 'nullable|array',\n ];\n break;\n case 'password-update':\n $rules = [\n 'old_password' => 'required|alpha_dash|max:18',\n 'password' => 'required|alpha_dash|confirmed|different:old_password|max:18',\n 'password_confirmation' => 'required|alpha_dash|max:18',\n ];\n break;\n case 'avatar-update':\n $rules = [\n 'avatar' => 'required|image|max:1024',\n ];\n break;\n default:\n $rules = [];\n }\n return $rules;\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "private function updateRules()\n {\n return [\n 'data.type' => 'required|in:events',\n 'data.attributes.name' => 'max:30|min:5',\n 'data.attributes.description' => 'min:1|max:255',\n 'data.attributes.date' => 'date',\n 'data.relationships.users' => 'required_with:data.relationships',\n 'data.relationships.users.data.*.type' => 'required_with:data.relationships|in:users',\n 'data.relationships.users.data.*.id' => 'required_with:data.relationships|numeric'\n ];\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public static function validationRulesNew()\n {\n return [\n 'name' => 'required|unique:faucets,name|min:5',\n 'url' => 'required|unique:faucets,url',\n 'interval_minutes' => 'required|integer',\n 'min_payout' => 'required|numeric',\n 'max_payout' => 'required|numeric',\n 'faucet_payment_processors[]' => 'each:exists,faucet_payment_processors, id',\n 'has_ref_program' => 'required|boolean',\n 'ref_payout_percent' => 'required|numeric|min:0',\n 'comments' => 'string',\n 'is_paused' => 'required|boolean',\n 'meta_title' => 'string|max:70',\n 'meta_description' => 'string|max:160',\n 'meta_keywords' => 'string|max:255'\n ];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n $rules = [];\n $rules[ 'color' ] = 'required';\n $rules[ 'number' ] = 'required';\n $rules[ 'transmission' ] = 'required|numeric|gt:0';\n $rules[ 'model' ] = 'required|numeric|gt:0';\n $rules[ 'rent_price_per_day' ] = 'required';\n $rules[ 'year' ] = 'required';\n\n $data = $this->validationData();\n \n $method = $this->method();//POST || PUT\n\n //update -> PUT \n if ( $method === \"PUT\" )\n {\n if ( isset( $data[ 'fileuploader-list-file' ] ) && !empty( $data[ 'fileuploader-list-file' ] ) )\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n }\n } else\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n $rules[ 'fileuploader-list-file' ] = 'required';\n }\n\n return $rules;\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "abstract public function getValidationRules(): array;", "public function getValidationRules()\n {\n return [];\n }", "public function updateRules(): array\n {\n return [\n 'Universidad' => 'required|string|min:2|max:20',\n 'carrera' => 'required|string|min:2|max:50',\n ];\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "public function getUpdateValidators()\n {\n $validators = $this->getCreateValidators();\n $validators['author_type_id'] = new sfValidatorDoctrineChoice(array(\n 'model' => Doctrine_Core::getTable('Deadline')->getRelation('AuthorType')->getAlias(),\n 'required' => false,\n ));\n $validators['subreddit_id'] = new sfValidatorDoctrineChoice(array(\n 'model' => Doctrine_Core::getTable('Deadline')->getRelation('Subreddit')->getAlias(),\n 'required' => false,\n ));\n return $validators;\n }", "public function getValidationCreateRules(): array\n {\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n $id = $this->route()->parameter('widget');\n\n $rules = [\n //'reference' => 'required|min:2|unique:widgets',\n 'module_id' => 'required|numeric',\n 'placement' => 'required',\n 'order_column' => 'required',\n 'order_column_type' => 'required',\n 'type' => 'required',\n 'select_type' => 'required',\n 'number_for_latest' => 'numeric|nullable',\n // 'order' => 'nullable|numeric',\n 'is_active' => 'required|boolean'\n ];\n\n if (request()->method() == 'POST') {\n $rules['reference'] = 'required|min:2|unique:' . (new Widget())->getTable() . ',reference';\n } else {\n // $rules['reference'] = 'required|min:2|unique:' . (new Widget())->getTable() . ',reference,' . $id . ',id';\n }\n\n foreach (config('translatable.locales') as $k => $locale) {\n $rules[$locale . '.name'] = 'required|min:3';\n // $rules[$locale . '.description'] = 'nullable|min:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $dynamic_rules = [\n 'company_name' => 'required|string|min:1|max:255',\n 'company_email' => 'nullable|email|max:400',\n 'company_website' => 'nullable|url|max:200',\n 'company_logo_upload' => 'nullable|image',\n ];\n\n if ($this->routeIs(\"*.update\")) {\n return array_merge($dynamic_rules, [\n 'company_name' => 'filled|string|min:1|max:255',\n ]);\n }\n\n return $dynamic_rules;\n }", "public static function getUpdateRules($id) \n {\n $_rules = self::$rules;\n $_rules['email'] = 'email|required|unique:users,email,'.(int)$id;\n\n return $_rules;\n }", "public function get_validation_rules() {\n\t\t$field = $this->field;\n\t\t$id = self::get_property( 'element_id', $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$rules = '';\n\n\t\tif ( $is_required && $post_image_enabled ) {\n\t\t\t$rules .= '\"' . $this->get_id( $field ) . '-post-image\": {';\n\t\t\tif ( $is_required ) {\n\t\t\t\t$rules .= '\"required\": true,';\n\t\t\t}\n\t\t\t$rules .= '},';\n\t\t}\n\t\t$category_list = forminator_post_categories( $post_type );\n\t\tif( ! empty( $category_list ) ) {\n\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\tif ( $is_required && $post_category_enabled ) {\n\t\t\t\t\t$rules .= '\"' . $this->get_id( $field ) . '-' . $category['value'] . '[]\": {';\n\t\t\t\t\tif ( $is_required ) {\n\t\t\t\t\t\t$rules .= '\"required\": true,';\n\t\t\t\t\t}\n\t\t\t\t\t$rules .= '},';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'forminator_field_postdata_validation_rules', $rules, $id, $field );\n\t}", "private function validationRules()\n {\n return [\n 'newPassword' => [\n new PasswordRule($this->newPasswordConfirmation),\n ],\n 'currentPassword' => [\n 'required',\n new PasswordCheckRule($this->user),\n ],\n ];\n }", "public function getRules() {\n return [\n 'complex_id' => 'required|exists:complexes,id',\n 'name' => 'required',\n 'description' => 'required',\n 'price' => 'required',\n 'price_type' => 'required',\n 'price_unit' => 'required',\n ];\n }", "public function rules()\n\t{\n\t\tif($projects = $this->projects){\n\n\t\t\t// Validate on updating\n\t\t}\n\n\t\treturn $this->rules;\n\t}", "public function getRules()\n {\n return [\n 'title' => ['requiredFill', 'trim', 'htmlSpecialChars', 'len100'],\n 'content' => ['requiredFill', 'htmlSpecialChars'],\n 'categoryId' => ['requiredFill', 'isInteger'],\n ];\n }", "public function rules()\n {\n $rules = [\n // 'status' => 'required',\n ];\n\n $languages = Language::where('status', 1)->sorted()->get();\n foreach ($languages as $language) {\n $rules[$language->locale. '.title'] = 'required';\n $rules[$language->locale. '.description'] = 'required';\n }\n\n if ($this->isMethod('PATCH')) {\n $rules['photo'] = 'image';\n }\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'user_type' => 'required|string',\n ];\n if ($this->method() == 'PUT') {\n $rules['email'] = 'required|string|email|max:255|unique:users,email,' . $this->route()->parameter('user');\n $rules['password'] = 'sometimes|string|' .config('rules.password');\n } else {\n $rules['email'] = 'required|string|email|max:255|unique:users';\n $rules['password'] = 'required|string|' .config('rules.password');\n }\n\n return $rules;\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function validationRules()\n {\n return [];\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n $rules = [\n 'enabled' => 'required',\n 'order' => 'required|numeric',\n 'last_modified_by' => 'required'\n ];\n\n\n if ($this->isMethod('PUT')) {\n $region = $this->segment(4) ? Region::find($this->segment(4)) : NULL;\n\n if ($region) {\n $rules['region_name'] = ['required', 'max:60', 'min:2', Rule::unique('regions')->ignore($region->id)];\n }\n } else {\n $rules['region_name'] = 'required|unique:regions|max:60|min:2';\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if ($this->input(\"_method\") == \"PUT\")\n return [\n \"first_name\" => \"required|min:5\",\n \"last_name\" => \"required|min:5\",\n \"update_email\" => \"required|email|sometimes:unique:users\",\n \"password\" => \"sometimes|required|min:8\",\n \"password_verify\" => \"sometimes|required|same:password\"\n ];\n\n return [\n \"first_name\" => \"required|min:4\",\n \"last_name\" => \"required|min:4\",\n \"email\" => \"required|email|unique:users\",\n \"password\" => \"sometimes|required|min:8\",\n \"password_verify\" => \"sometimes|required|same:password\"\n ];\n\n }", "public function rules()\n {\n $rules = [\n 'title' => 'required|min:3',\n 'description' => 'required|min: 2',\n 'price' => 'required|numeric',\n 'img' => 'required',\n 'category_id' => 'required'\n ];\n\n if($this->route()->named('products.update')){\n $rules['img'] = '';\n }\n\n return $rules;\n }", "public function rules()\n {\n $method = $this->method();\n switch ($method){\n case 'PUT':\n case 'PATCH':\n $rule_thumb_img = 'url';\n break;\n default:\n $rule_thumb_img = 'required|url';\n }\n return [\n 'title' => 'required|min:6|max:255',\n 'category_id' => 'array',\n 'category_id.*' => 'numeric',\n 'thumb_img' => $rule_thumb_img,\n 'published' => 'required|numeric'\n ];\n }", "public function rules()\n {\n $new_user = $this->route()->getName() != \"admin-users.update\";\n\n return [\n 'name' => 'required|max:50|min:2',\n 'email' => 'required' . ($new_user ? '|unique:users' : ''),\n 'password' => ($new_user ? 'required|' : '') . 'min:2'\n ];\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $rule = [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'birthday' =>'required|before:today',\n 'email' => 'required|regex:/(.+)@(.+)\\.(.+)/i|email|unique:customers',\n 'phone' =>'required|regex:/(0)[0-9]/|digits_between:10,15',\n ];\n \n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n \n $rule['email'] = 'required|regex:/(.+)@(.+)\\.(.+)/i|unique:customers,email,'.$this->customer['id'];\n }\n\n return $rule;\n \n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function getRules()\n {\n // Set the validation rules.\n $rules = [\n 'party_id' => 'integer|required|exists:pgsql.core.parties,id',\n 'bank_id' => 'integer|required|exists:pgsql.core.banks,id',\n 'currency_id' => 'integer|required|exists:pgsql.core.currencies,id',\n 'first_name' => 'string|required|max:50',\n 'last_name' => 'string|required|max:50',\n 'last_name' => 'string|nullable|max:255',\n 'type' => 'string|nullable|in:savings,current',\n 'class' => 'string|nullable|in:personal,business',\n ];\n\n // Add the account number check if it's a new record.\n if (!$this->exists) {\n $rules['account_number'] = 'string|required|max:100|unique:pgsql.core.bank_accounts,account_number,NULL,id,bank_id,' . $this->bank_id;\n }\n\n return $rules;\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'email' => 'required|unique:users',\n 'password' => 'required|min:8',\n ];\n\n if ($this->method() === 'PUT') {\n $rules['email'] = 'required|unique:users,id,'.$this->id;\n $rules['password'] = 'min:8';\n }\n\n return $rules;\n }", "public function validation_rules() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn $class::_object()->validates;\r\n }", "public function rules()\n {\n $id = $this->route($this->table);\n\n $condThumb = 'bail|required|max:1024';\n $condTitle = \"bail|required|between:5,150|unique:$this->table,title\";\n\n //rules for edit\n if (!empty($id)) {\n $condThumb = 'bail|max:1024';\n $condTitle .= \",$id\";\n }\n\n return [\n 'title' => $condTitle,\n 'tag' => 'bail|required',\n 'meta_description' => 'bail|required',\n 'content' => 'bail|required|min:5',\n 'status' => 'bail|in:0,1',\n 'is_highlight' => 'bail|in:0,1',\n 'thumbnail' => $condThumb,\n ];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->request->get('action') == 'edit') {\n $valid = array(\n\n 'expensive_for' => 'required|',\n 'budget_category_id' => 'required|',\n 'budget_subcategory_id' => 'required|',\n 'expensive_quantity' => 'required|',\n 'expensive_rate' => 'required|',\n 'specifications' => 'required|',\n );\n } else {\n $valid = array(\n 'expensive_for' => 'required|',\n 'budget_category_id' => 'required|',\n 'budget_subcategory_id' => 'required|',\n 'expensive_quantity' => 'required|',\n 'expensive_rate' => 'required|',\n 'specifications' => 'required|',\n );\n }\n return $valid;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required|min:6|confirmed',\n ];\n\n $method = $this->method();\n $route = $this->route(static::$PARAM_ID);\n if ($route) {\n $user_id = $route->id;\n switch ($method) {\n case 'PUT':\n $rules['email'] = \"{$rules['email']},$user_id\";\n break;\n case 'PATCH': {\n $rules['name'] = 'sometimes|max:255';\n $rules['email'] = \"{$rules['email']},$user_id\";\n $rules['password'] = 'sometimes|min:6|confirmed';\n break;\n }\n default: {\n break;\n }\n }\n }\n\n return $rules;\n }", "public function rules() {\n $input = \\Input::get();\n $rules['font_size'] = 'required|integer|between:12,24';\n $rules['font_weight'] = (isset($input['font_weight'])) ? 'integer|between:100,700' : '';\n $rules['font_color'] = (isset($input['font_color'])) ? ['regex:/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/'] : '';\n return $rules;\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\r\n {\r\n switch ($this->method()) {\r\n case 'PUT':\r\n case 'PATCH':\r\n {\r\n return [\r\n 'post_code' =>['required'],\r\n 'building_name_no' => ['required',],\r\n 'street' => ['required',],\r\n 'town' => ['required',],\r\n 'first_name' => 'required',\r\n 'last_name' => 'required|regex:/^[a-zA-Z]+$/u|max:255',\r\n 'email' => 'required|email|unique:users',\r\n 'password' => ['required',],\r\n 'phone_number' => 'required',\r\n\r\n ];\r\n }\r\n default:\r\n break;\r\n }\r\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules() {\n\t\t$action_method = $this->route()->getActionMethod();\n\t\t$rules = [\n\t\t\t'name' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'file_category_id' => 'required',\n\t\t];\n\n\t\tif ( $action_method === 'store' ) {\n\t\t\t$rules['file_upload'] = 'required';\n\t\t}\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n $rules = [\n 'first_name' => 'required|string|between:3,255',\n 'last_name' => 'required|string|between:3,255',\n 'avatar' => 'sometimes|mimes:png,jpg,jpeg|max:1024',\n 'email' => 'not_present',\n 'type' => 'not_present',\n 'status' => 'not_present',\n 'branches' => 'not_present',\n 'is_main_admin' => 'not_present',\n ];\n\n if ($this->has('current_password') && $this->current_password) {\n $rules['current_password'] = 'required|pass_check';\n $rules['new_password'] = 'required|alpha_num_pwd|confirmed';\n $rules['new_password_confirmation'] = 'required';\n }\n\n return $rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "protected function updateValidation()\n {\n return [\n 'todo_name' => ['required', 'string'],\n 'todo_description' => ['required', 'string']\n ];\n }", "public function rules()\n\t{\n\t\t$rules = [\n\t\t\t'price' => 'required',\n\t\t\t'currency' => 'required',\n\t\t\t'name' => 'required|min:10|max:120',\n\t\t\t'content' => 'required|min:10',\n\t\t\t'gearbox' => 'required',\n\t\t\t'year' => 'required|min:2',\n\t\t\t'colour' => 'required|min:2',\n\t\t\t/*'g-recaptcha-response' => 'required|recaptcha',*/\n\t\t];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules()\n {\n $id = $this->request->get('id');\n\n if($this->request->get('statusChange')){\n return [];\n }\n return [\n 'title' => 'required|max:75',\n 'url' => 'max:100|unique:pages,url,'.$id,\n 'meta_title' => 'max:75',\n 'meta_keywords' => 'max:250',\n 'meta_description' => 'max:200',\n ];\n }", "public function getRules()\n\t{\n\t\t$rules['org_id']\t= ['required', 'integer', 'exists:'. app()->make(\\App\\Org::class)->getTable() . ',id'];\n\t\t$rules['name']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t$rules['code']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t// $rules['group']\t\t\t\t\t= ['required', 'string', 'in:'.implode(',', SELF::GROUP)];\n\t\t$rules['group']\t\t\t\t\t= ['required', 'string'];\n\t\t$rules['description']\t\t\t= ['nullable', 'string'];\n\t\t$rules['threshold']\t\t\t\t= ['nullable', 'numeric', 'min:0'];\n\t\t$rules['unit']\t\t\t\t\t= ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "private function getValidation() {\n return [\n 'title' => 'required|min:4|max:50',\n 'poster' => 'required|max:255',\n 'price' => 'required',\n 'start_date' => 'required',\n ];\n }", "public function validationRules() {\n\t\treturn [\t \n\t\t\t'nom'=>'required',\n\t\t\t'enonce'=>'required',\n\t\t\t'sur'=>'required'\n\t];\t\n\t}", "public function getValidationRulesJs()\n {\n $rules = $this->Model->validationRulesJS;\n // Hook Filter modifyValidationRulesJS\n $rules = $this->doFilter(\"modifyValidationRulesJS\", $rules);\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n $arrRule = [\n 'timestamp' => 'required'\n ];\n\n if($this->is('api/timestamp/customize')){\n $arrRule = [\n 'customize.timezone' => 'required|timezone',\n 'customize.format' => 'required'\n ];\n }\n return $arrRule;\n\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "protected static function getEditQuestionRules()\n {\n return parent::getEditQuestionRules();\n }", "public function rules(): array\n {\n $rules = new ValidationRules();\n\n return [\n 'title' => \"required|min:{$rules->string_min}|max:{$rules->string_max}\",\n 'description' => \"max:{$rules->string_max}\",\n 'division_id' => 'required|exists:divisions,id',\n 'emails' => 'required',\n 'tags' => 'required',\n 'short_content' => \"required|min:{$rules->string_min}\",\n 'full_content' => \"required|min:{$rules->string_min}\",\n 'position' => \"integer|min:{$rules->position_min}|max:{$rules->position_max}\"\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n {\n $validate = [\n 'current_password' => [\n 'required',\n new MatchOldPassword\n ],\n 'new_password' => [\n 'required',\n 'min:6'\n ],\n 're_new_password' => [\n 'required',\n 'same:new_password'\n ],\n ];\n\n return $validate;\n }", "public function rules()\n {\n switch(Route::currentRouteName()) {\n case 'permission.store':\n return [\n 'txt_permission_name' => 'required|min:2|unique:t_kms_permission,c_permission_name',\n 'txt_permission_display' => 'required|min:2',\n 'txt_permission_description' => 'required',\n ];\n case 'permission.update':\n return [\n 'txt_permission_name' => 'required|min:2|unique:t_kms_permission,c_permission_name,'.$this->get('txt_permission_id').',c_permission_id',\n 'txt_permission_display' => 'required|min:2',\n 'txt_permission_description' => 'required',\n ];\n default:break;\n }\n }", "public function rules()\n {\n $request = Request::all();\n switch ($this->method()) {\n case 'POST': //create\n if (Request::has('id')) { //更新\n return [\n 'title' => 'bail|required|string|max:30',\n 'api' => 'nullable|unique:auth_rules,api,' . $request['id'] . '|string|max:200',\n 'pid' => 'required|array',\n ];\n } else {\n return [\n 'title' => 'bail|required|string|max:30',\n 'api' => 'nullable|unique:auth_rules|string|max:200',\n 'pid' => 'required|array',\n ];\n }\n case 'GET':\n default:\n {\n return [];\n }\n }\n }", "public static function getFormValidationRules(): array {\n return [\n 'title' => ['required', 'string', 'max:' . AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'min:' . AppConstants::STRINGS_MINIMUM_LENGTH],\n 'startDate' => ['required', 'date', 'after_or_equal:today'],\n 'endDate' => ['required', 'date', 'after_or_equal:startDate'],\n 'price' => ['required', 'numeric', 'max:' . AppConstants::INTEGER_MAXIMUM_VALUE],\n // 'major_id' => ['required', 'exists:majors,id'],\n 'city_id' => ['required', 'exists:cities,id'],\n 'cityExistImportance' => ['required', 'in:' . implode(\",\", CompanyTask::CITY_EXIST_IMPORTANCE)],\n// 'major' => ['nullable', 'string', 'max:' . AppConstants::STRINGS_MAXIMUM_LENGTH, 'min:' . AppConstants::STRINGS_MINIMUM_LENGTH],\n 'price' => ['required', 'numeric', 'gte:50'],\n 'pricePaymentType' => ['required', 'in:' . implode(\",\", CompanyTask::PRICE_PAYMENT_TYPE)],\n 'type' => ['required', 'in:' . implode(\",\", CompanyTask::TYPE)],\n // 'workHoursCount' => ['required_if:type,==,part_time' . ((request()->all('workHoursCount') !== null) ? \", 'numeric', 'gte:1', 'lte:24'\" : \"\")],\n 'workHoursFrom' => ['required_if:type,==,part_time' . ((request()->all('workHoursFrom') !== null) ? \", 'date_format:H:i:s a'\" : \"\")],\n 'workHoursTo' => ['required_if:type,==,part_time' . ((request()->all('workHoursTo') !== null) ? \", 'date_format:H:i:s a', 'after:workHoursFrom'\" : \"\")],\n 'workDaysCount' => ['required_if:type,==,part_time' . ((request()->all('workDaysCount') !== null) ? ', in:' . implode(',', range(1, 5)) : '')],\n 'location' => ['required_if:type,==,part_time' . ((request()->all('location') !== null) ? ', string' : '')],\n 'requiredNumberOfUsers' => ['nullable', 'numeric', 'gte:1', 'max:' . AppConstants::SMALL_INTEGER_MAXIMUM_VALUE],\n 'briefDescription' => ['required', 'string', 'max:' . AppConstants::TEXT_MAXIMUM_LENGTH, 'min:' . AppConstants::STRINGS_MINIMUM_LENGTH],\n 'fullDescription' => ['required', 'string', 'max:' . AppConstants::TEXT_MAXIMUM_LENGTH, 'min:' . AppConstants::STRINGS_MINIMUM_LENGTH],\n 'language' => ['required', 'array', 'min:1', 'in:' . implode(\",\", CompanyTask::LANGUAGE)],\n// 'language.*' => ['required', 'string', 'in:' . implode(\",\", CompanyTask::LANGUAGE)],\n 'willTakeCertificate' => ['required', 'in:' . implode(\",\", array_keys(\\App\\AppConstants::getYesNoOptions()))],\n 'majors' => 'required|array|min:1',\n 'majors.*' => 'exists:majors,id',\n ];\n }", "public function rules()\n {\n $locale = defaultLanguage();\n $rules = [];\n $state = State::where('country_id', $this->country)->get()->toArray();\n\n $rules['institution.'.$locale.'.title'] = 'required';\n $rules['institution.'.$locale.'.description'] = 'required';\n $rules['type_id'] = 'required';\n $rules['country_id'] = 'required';\n $rules['city_id'] = 'required';\n $rules['national_ranking'] = 'required';\n $rules['global_ranking'] = 'required';\n $rules['youtube_url'] = 'required|url';\n $rules['image_name'] = 'required';\n\n if ($state) {\n $rules['state_id'] = 'required';\n }\n return $rules;\n }", "public function rules()\n {\n $flowRepository = new FlowRepository();\n if ($this->has('step_run_id') && intval($this->step_run_id)) {\n //通过 预提交\n $this->step = $flowRepository->getCurrentStep($this->step_run_id);\n } else {\n //发起 预提交\n $this->step = $flowRepository->getFlowFirstStep($this->flow_id);\n }\n\n $basicRules = [\n 'flow_id'=>[\n Rule::exists('flows','id')->where('is_active',1)\n ],\n 'step_run_id' => [\n Rule::exists('step_run', 'id')->where('flow_id', $this->flow_id)\n ],\n 'form_data' => [\n 'present',\n 'array',\n ],\n ];\n $fieldsRules = app('validation')->makeStepFormValidationRules($this->step,$this);\n return array_collapse([$basicRules, $fieldsRules]);\n }", "private function getValidationRules(): array\n {\n return [\n 'year_month' => new Assert\\DateTime(\n [\n 'format' => 'Y-m',\n 'message' => 'Unexpected $yearMonth value. `Y-m` format is expected.',\n ]\n ),\n 'months_count' => new Assert\\Range(\n [\n 'min' => 1,\n 'max' => 12,\n 'minMessage' => 'Months count must be at least {{ limit }}',\n 'maxMessage' => 'Months count must not be greater than {{ limit }}',\n ]\n ),\n ];\n }", "protected function validationRules(): array\n {\n return [\n 'publicId' => 'required',\n 'paymentType' => 'required|numeric|between:1,8',\n 'payments' => 'required'\n ];\n }", "public static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'author' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'price' => FILTER_VALIDATE_FLOAT,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]\n ];\n }", "public function rules()\n {\n $states = implode(',', config('constants.listState'));\n\n $rules = [\n 'name' => 'required',\n 'cpf' => 'required|min:14|max:14',\n 'rg' => 'required_if:state,SP',\n 'birth_date' => 'required|date|after_or_equal:'.now()->addYears(-123)->format(\"Y-m-d\"),\n 'phone' => 'required|min:14|max:15',\n 'state' => 'required|in:' . $states\n ];\n\n if(request()->get('state') == 'BA') {\n $rules['birth_date'] = 'required|date|before_or_equal:'.now()->subYears(18)->format(\"Y-m-d\").'|after_or_equal:'.now()->addYears(-123)->format(\"Y-m-d\");\n }\n\n return $rules;\n }", "public function rules() {\n return array_merge(parent::rules(),\n ['feedback_contents_template' => 'required|validFeedbackContentWithoutObservations']\n );\n }", "public function rules()\n {\n switch ($this->method()) {\n // Hander Post \n case 'POST':\n return [\n 'name'=>'required',\n 'email'=>'required|email|unique:user,email',\n 'password'=>'required',\n 'Ag_password'=>'same:password',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'image'=>'image|mimes:jpeg,png,gif|max:7000',\n 'birth_day'=>'date|before:today'\n ];\n break;\n // Hander Put \n case 'PUT':\n return [\n 'email'=>'required|email|unique:user,email,'.$this->id,\n 'name'=>'required',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'birth_day'=>'date|before:today',\n 'repPassword'=>'same:newPassword',\n 'oldPassword'=> new checkPasswordUpdate()\n ];\n break;\n }\n }", "public function rules()\r\n {\r\n \r\n $validation = [\r\n \"name\" => \"required|min:4|max:50\",\r\n \"email\" => \"required|email|unique:users,email\",\r\n \"password\" =>\r\n 'required|confirmed|min:8',\r\n \"phone\" => 'required|min:10|numeric',\r\n \"qualification\" => \"required\",\r\n \"blood_group\" => \"required\",\r\n\r\n ];\r\n\r\n if ($this->isMethod(\"put\")) {\r\n $validation = [\r\n \"name\" => \"required|alpha_num|min:4|max:50\",\r\n \"password\" =>\r\n 'nullable|confirmed|min:8',\r\n 'phone' => 'required|min:10|numeric', \r\n \"qualification\" => \"required\",\r\n \"blood_group\" => \"required\", \r\n ];\r\n }\r\n\r\n return $validation;\r\n }", "public function rules()\n {\n\t\t$item = $this->route('id');\n\t\treturn [\n\t\t\t'name' => ['required'],\n\t\t\t'description' => ['required', 'max:255'],\n\t\t\t'stock' => ['required', 'integer', 'min:0'],\n ];\n }" ]
[ "0.73560274", "0.7029944", "0.6998964", "0.69760776", "0.695345", "0.67695546", "0.67648745", "0.6729979", "0.6683829", "0.66539997", "0.6649985", "0.66413826", "0.66347283", "0.6589461", "0.6586514", "0.65696627", "0.65399384", "0.6539754", "0.65358686", "0.65288645", "0.6527938", "0.6526238", "0.6508364", "0.64971584", "0.6475383", "0.6465412", "0.64476067", "0.6440161", "0.6436494", "0.6422712", "0.6413915", "0.6407132", "0.64053965", "0.63826066", "0.63815457", "0.6375738", "0.6374749", "0.6370659", "0.6367219", "0.6364382", "0.6363148", "0.63520235", "0.6346199", "0.63372624", "0.63350916", "0.63326454", "0.63253623", "0.63216937", "0.6305124", "0.63039774", "0.629625", "0.6280018", "0.62780935", "0.6272014", "0.62644285", "0.626161", "0.626131", "0.6258355", "0.6257456", "0.6256023", "0.6251966", "0.62498295", "0.6231229", "0.62124264", "0.6202128", "0.62001055", "0.6196864", "0.61889875", "0.61844707", "0.61828655", "0.61822426", "0.6180629", "0.6178665", "0.61727446", "0.61698234", "0.61673677", "0.61642087", "0.6159404", "0.6158701", "0.61585563", "0.61544394", "0.61543626", "0.6146788", "0.6146105", "0.6141742", "0.6137905", "0.61336935", "0.6131015", "0.6130065", "0.61300254", "0.6127338", "0.61264056", "0.61211133", "0.6120598", "0.61200243", "0.61160576", "0.6114171", "0.6113835", "0.6107589", "0.6105849" ]
0.73301095
1
End Action controllers for generating enlistment report Start Action controllers for generating attendance report generate_voc_program_attendance_report function. commit 10/11/2018
Конечные действия контроллеров для генерации отчета о зачислении Начальные действия контроллеров для генерации отчета о посещаемости generate_voc_program_attendance_report функция. commit 10/11/2018
public function generate_voc_program_attendance_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar')); // get inputs $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program'])); $students = $this->admin_model->getStudentsBasicInfo($condition,'a'); $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']); $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); redirect('attendance_report'); } $this->session->set_flashdata('danger', 'Invalid input.'); redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }", "public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }", "public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }", "function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }", "public function generate()\n {\n $reportType = Input::get('report_type');\n $from = Input::get('from');\n $to = Input::get('to');\n $disciplineId = Input::get('discipline');\n $info = explode(',', Input::get('info'));\n $id = $info[1];\n $type = $info[0];\n $license = array_key_exists(2, $info) ? $info[2] : '0';\n\n $from = empty($from) ? null : date('Y-m-d', strtotime($from));\n $to = empty($to) ? null : date('Y-m-d', strtotime($to));\n \n if (! $reportType) {\n Flash::danger('Please select a <strong>Report Type</strong>.');\n return Redirect::route('reports.index')->withInput();\n }\n\n if (empty($from)) {\n Flash::danger('Please enter a <strong>From Date</strong> to generate report.');\n return Redirect::route('reports.index')->withInput();\n }\n\n // all route params\n $routeParams = [$disciplineId, $type, $id, $license, $from, $to];\n\n switch ($reportType) {\n case 'site_summary':\n return Redirect::route('reports.site_summary', $routeParams);\n break;\n\n case 'scheduled_exams':\n return Redirect::route('reports.scheduled_exams', $routeParams);\n break;\n\n case 'retake_summary':\n return Redirect::route('reports.retake_summary', $routeParams);\n break;\n\n case 'skills_detail':\n return Redirect::route('reports.skills_detail', $routeParams);\n break;\n\n case 'knowledge_detail':\n return Redirect::route('reports.knowledge_detail', $routeParams);\n break;\n\n case 'pass_fail':\n // if admin / agency / staff show a page to select facility and instructor\n /*if(Auth::user()->ability(['Admin', 'Staff', 'Agency'], []))\n {\n return Redirect::route('reports.select_facility', [$from, $to]);\n }*/\n\n // Otherwise just show the regular pass/fail report\n return Redirect::route('reports.pass_fail', $routeParams);\n break;\n\n default:\n Flash::warning('This report type is not yet supported.', 'Warning');\n return Redirect::route('reports.index');\n\n }\n }", "function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}", "public function attendance(){\n\t\t\t$data['title'] = 'Students Attendences Course name '; \n\n\t\t\t$course_code = $_GET['course_code'];\n\t\t\t\n\t\t\t$ids = $this->register_model->ids($course_code);\n\n\t\t\t$course_id;\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t\t$course_id = $id['id'];\n\t\t\t\t\t$data['course_name'] = $id['course_name'];\n\t\t\t}\t\t\t\n\t\t\t$data['courses'] = $this->register_model->get_attendance($course_id);\n\n\t\t\t$this->load->view('admin/header1');\n\t\t\t$this->load->view('admin/attendance', $data);\n\t\t\t$this->load->view('admin/footer');\n\t\t}", "public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')\n {\n $attendance = new Attendance();\n $courseInfo = CourseManager::get_course_information($course_id);\n $attendance->set_course_id($courseInfo['code']);\n $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;\n $data_array = array();\n $data_array['attendance_id'] = $attendance_id;\n $data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);\n\n $filter_type = 'today';\n\n if (!empty($_REQUEST['filter'])) {\n $filter_type = $_REQUEST['filter'];\n }\n\n $my_calendar_id = null;\n if (is_numeric($filter_type)) {\n $my_calendar_id = $filter_type;\n $filter_type = 'calendar_id';\n }\n\n $data_array['attendant_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n $filter_type,\n $my_calendar_id,\n $groupId\n );\n\n if (api_is_allowed_to_edit(null, true) || api_is_drh()) {\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, 0, $groupId);\n } else {\n if (!empty($student_id)) {\n $user_id = intval($student_id);\n } else {\n $user_id = api_get_user_id();\n }\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id, $groupId);\n $data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id, $groupId);\n $data_array['user_id'] = $user_id;\n }\n\n $data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);\n\n // Set headers pdf.\n $courseCategory = CourseManager::get_course_category($courseInfo['category_code']);\n $teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);\n $teacherName = null;\n foreach ($teacherInfo as $teacherData) {\n if ($teacherName != null) {\n $teacherName = $teacherName.\" / \";\n }\n $teacherName .= api_get_person_name($teacherData['firstname'], $teacherData['lastname']);\n }\n\n // Get data table\n $data_table = array();\n $head_table = array('#', get_lang('Name'));\n foreach ($data_array['attendant_calendar'] as $class_day) {\n $head_table[] =\n api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR).' '.\n api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);\n }\n $data_table[] = $head_table;\n $data_attendant_calendar = $data_array['attendant_calendar'];\n $data_users_presence = $data_array['users_presence'];\n $count = 1;\n\n if (!empty($data_array['users_in_course'])) {\n foreach ($data_array['users_in_course'] as $user) {\n $cols = 1;\n $result = array();\n $result['count'] = $count;\n $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);\n foreach ($data_array['attendant_calendar'] as $class_day) {\n if ($class_day['done_attendance'] == 1) {\n if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {\n $result[$class_day['id']] = get_lang('UserAttendedSymbol');\n } else {\n $result[$class_day['id']] = '<span style=\"color:red\">'.get_lang('UserNotAttendedSymbol').'</span>';\n }\n } else {\n $result[$class_day['id']] = ' ';\n }\n $cols++;\n }\n $count++;\n $data_table[] = $result;\n }\n }\n $max_cols_per_page = 12; //10 dates + 2 name and number\n $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10\n $rows = count($data_table);\n\n if ($cols > $max_cols_per_page) {\n $number_tables = round(($cols-2)/$max_dates_per_page);\n $headers = $data_table[0];\n $all = array();\n $tables = array();\n $changed = 1;\n\n for ($i= 0; $i <= $rows; $i++) {\n $row = isset($data_table[$i]) ? $data_table[$i] : null;\n $key = 1;\n $max_dates_per_page = 10;\n $item = isset($data_table[$i]) ? $data_table[$i] : null;\n $count_j = 0;\n\n if (!empty($item)) {\n foreach ($item as $value) {\n if ($count_j >= $max_dates_per_page) {\n $key++;\n $max_dates_per_page = $max_dates_per_page_original*$key;\n //magic hack\n $tables[$key][$i][] = $tables[1][$i][0];\n $tables[$key][$i][] = $tables[1][$i][1];\n }\n $tables[$key][$i][] = $value;\n $count_j++;\n }\n }\n }\n\n $content = null;\n if (!empty($tables)) {\n foreach ($tables as $sub_table) {\n $content .= Export::convert_array_to_html($sub_table).'<br /><br />';\n }\n }\n } else {\n $content = Export::convert_array_to_html(\n $data_table,\n array('header_attributes' => array('align' => 'center'))\n );\n }\n\n $params = array(\n 'filename' => get_lang('Attendance').'-'.api_get_local_time(),\n 'pdf_title' => $courseInfo['title'],\n 'course_code' => $courseInfo['code'],\n 'add_signatures' => true,\n 'orientation' => 'landscape',\n 'pdf_teachers' => $teacherName,\n 'pdf_course_category' => $courseCategory['name'],\n 'format' => 'A4-L',\n 'orientation' => 'L'\n );\n\n Export::export_html_to_pdf($content, $params);\n exit;\n }", "function report() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n $resultData = $this->webservicemodel->getReportData($getData);\n if ($resultData) {\n $exportData = array();\n foreach ($resultData as $record) {\n $total_due = $record[\"costo_base\"] + $record[\"importo_tasse_volo\"] + $record[\"importo_aeroporto_aggiuntivo\"] + $record[\"supplementi\"];\n $balance = round(( $total_due - $record[\"pagamenti\"]), 2);\n\n $exportRecord = array(\n 'Accompagnatore' => $record['accompagnatore'],\n 'Collaboratore' => $record['collaboratore'],\n 'Prodotto' => $record['prodotto'],\n 'Codice Prodotto' => $record['codice_prodotto'],\n 'Passeggero' => $record['passeggero'],\n 'Tipologia Passeggero' => $record['tipologia_passeggero'],\n 'Total Due' => $total_due,\n 'Balance' => $balance\n );\n array_push($exportData, $exportRecord);\n }\n $this->load->library('export');\n $this->export->to_excel($exportData, 'webservicereport');\n } else\n redirect('webservice');\n }\n else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n// $data['report_data'] = $this->webservicemodel->getReportData($getData);\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n\n $data['tipologia_passeggero'] = $this->webservicemodel->getDistinctDataByField('tipologia_passeggero');\n $data['glf'] = $this->webservicemodel->getDistinctDataByField('glf');\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n $data['codice_prodotto'] = $this->webservicemodel->getDistinctDataByField('codice_prodotto');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course AND Exam_Remark IS NULL\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course AND Exam_Remark IS NULL\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "public function feVisitReportAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$comment\t= isset($params['comment'])?$params['comment']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$fe_report = array(); \n\n\t\t\t\t\t$fe_report['comment'] = $comment;\n\n\t\t\t\t\t$fe_report['farmer_code'] = $farmer_code;\n\t\t\t\t\t$fe_report['farmer_id'] = $farmerID;\n\t\t\t\t\t$fe_report['fe_code'] = $LoginID;\n\t\t\t\t\t$fe_report['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$fe_report['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_fevisit_report', $fe_report);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Fe report Detail Inserted successfully.', 'fe_report_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "public function actionReport()\n\t{\n\t\t$model = new AutoChores();\n\t\t$results = array();\n\t\t$errors = array();\n\t\t$isPrint = 0;\n\t\t//exit;\n\t\tif(isset($_REQUEST['go'])){\n\t\t if(!isset($_REQUEST['go']))\n \t\t $isPrint = 1;\n\t\t\tif(empty($_REQUEST['from_date'])){\n\t\t\t\t$errors[\"from_date\"] = \"Invalid From Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['to_date'])){\n\t\t\t\t$errors[\"to_date\"] = \"Invalid To Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['farm'])){\n\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}else {\n\t\t\t\t$qtxt =\"SELECT farm_herd FROM herd_setup WHERE farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t$res =$command->queryColumn();\n\n\t\t\t\tif($_REQUEST['farm'] != 'A' && (!isset($res[0]) || $res[0] != $_REQUEST['farm']))\n\t\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}\n\t\t\tif(count($errors) == 0) {\n\t\t\t\t$results1 = $this->dateRange($_REQUEST['from_date'], $_REQUEST['to_date'],'+1 day','m/d/Y');\n\t\t\t\tforeach ($results1 as $result) {\n\t\t\t\t\t$qtxt = \"SELECT * FROM chores WHERE date = '\".$result.\"' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res =$command->queryAll();\n\t\t\t\t\t//$results[$result] = $res;\n\n\t\t\t\t\t//D\n\t\t\t\t\t$qtxt = \"SELECT * FROM auto_chores WHERE generated_by = 'D' AND disabled = 'N' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND (farm_herd = '\".$_REQUEST['farm'].\"' OR generated_by = 'A') \";\n\n\t\t\t\t\t$qtxt1 = \" ADDDATE(date_asof, days_after) = '\".$result.\"' \";\n\t\t\t\t\t$qtxt2 = \" ADDDATE(date_asof, (days_after+(times_occur*days_between))) = '\".$result.\"' AND times_occur >= 2\";\n\t\t\t\t\t$qtxt .= \" AND ((\".$qtxt1.\") OR (\".$qtxt2.\")) \";\n\n\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res1 =$command->queryAll();\n\t\t\t\t\t$results[$result] = array_merge($res,$res1);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$model->addErrors($errors);\n\t\t\t}\n\t\t}\n\n\n\t\t$this->render('report',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'results'=>$results,\n\t\t 'isPrint'=>$isPrint,\n\n\t\t));\n\t}", "public function actionOutputIndex()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t\n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n\t\t// var_dump($result);exit;\n $arr = [];\n $ic = 1; \n foreach($result as $r) {\n\t\t\t$r['signtime1'] = $r[\"signtime1\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime1\"];\n\t\t\t$r['signtime2'] = $r[\"signtime2\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime2\"];\n\t\t\t\n\t\t\t\n\t\t\t$r['signstatus'] = $r['signstatus_valid']?:$r['signstatus'];\n\t\t\t$r['latetime'] = $r['latetime']-$r['latetime_valid'];\n\t\t\t$r['overtime'] = $r['overtime_valid'];\n $arr[] = $r;\n }\n\t\t$header = [\n 'id' => 'ID',\n 'personnel_id' => '员工ID',\n 'employeeid' => '工号',\n 'username' => '员工姓名',\n 'signdate' => '签到日期',\n 'dayofweek' => '星期几',\n 'signtime1' => '上班签到',\n 'signtime2' => '下班签到',\n 'timediff' => '工作时长',\n 'signstatus' => '签到状态',\n 'latetime' => '迟到分钟',\n 'overtime' => '加班时长',\n 'memo' => '备注',\n ];\n\t\t$columns = array_keys($header);\n\t\t\n\t\t \n \\moonland\\phpexcel\\Excel::export([\n\t\t\t'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤报表' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤报表' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤报表' => $header, \n\t\t\t],\n ]);\n }", "public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}", "public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }", "public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function index(){\t\n\t\t// set the page title\n\t\t$this->set('title_for_layout', 'Approve Waive Off Request- HRIS - BigOffice');\n\t\t\n\t\t// get employee list\t\t\n\t\t$emp_list = $this->HrAttWaive->get_team($this->Session->read('USER.Login.id'),'L');\n\t\t$format_list = $this->Functions->format_dropdown($emp_list, 'u','id','first_name', 'last_name');\t\t\n\t\t$this->set('empList', $format_list);\n\t\t\n\t\n\t\t// when the form is submitted for search\n\t\tif($this->request->is('post')){\n\t\t\t$url_vars = $this->Functions->create_url(array('keyword','emp_id','from','to'),'HrAttWaive'); \n\t\t\t$this->redirect('/hrattwaive/?'.$url_vars);\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\tif($this->params->query['keyword'] != ''){\n\t\t\t$keyCond = array(\"MATCH (reason) AGAINST ('\".$this->params->query['keyword'].\"' IN BOOLEAN MODE)\"); \n\t\t}\n\t\tif($this->params->query['emp_id'] != ''){\n\t\t\t$empCond = array('HrAttWaive.app_users_id' => $this->params->query['emp_id']); \n\t\t}\n\t\t// for date search\n\t\tif($this->params->query['from'] != '' || $this->params->query['to'] != ''){\n\t\t\t$from = $this->Functions->format_date_save($this->params->query['from']);\n\t\t\t$to = $this->Functions->format_date_save($this->params->query['to']);\t\t\t\n\t\t\t$dateCond = array('HrAttWaive.created_date between ? and ?' => array($from, $to)); \n\t\t}\n\t\t\n\t\t\n\t\t// fetch the attendance data\t\t\n\t\t$this->paginate = array('fields' => array('id', 'created_date',\t\"date_format(HrAttWaive.date, '%Y-%m') as month\",\n\t\t\"date_format(HrAttWaive.date, '%M, %Y') as month_display\", 'HrEmployee.first_name', 'HrEmployee.last_name','status','approve_date', 'HrEmployee.id', 'count(*) no_req'),\n\t\t'limit' => 10,'conditions' => array($keyCond, \n\t\t$empCond, $dateCond, 'is_draft' => 'N'), 'group' => array('HrEmployee.id',\"date_format(HrAttWaive.date, '%Y-%m')\"),\n\t\t'order' => array('HrAttWaive.created_date' => 'desc'));\n\t\t$data = $this->paginate('HrAttWaive');\n\t\t\n\t\t$this->set('att_data', $data);\n\t\t\n\t\t\n\t\n\t\tif(empty($data)){\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no waive-off request to approve', 'default', array('class' => 'alert alert'));\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function invoice_audit_trail_export_PDF() {\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $query = $this->reportsModel->get_invoice_audit_trail($tenant_id, NULL, NULL, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $this->load->helper('pdf_reports_helper');\n return invoice_audit_trail_report_PDF($query, $tenant_details);\n }", "public function makeReport()\n {\n }", "function admin_export_patients($id=NULL) // template for new classes\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['home_clinic'] = $_SESSION['location_id'];\r\n\t\t$data['title'] = \"Export Patients\";\r\n\t\t$data['form_purpose'] = \t\"new_export\";\r\n $data['now_id'] = time();\r\n\t\t$data['unsynched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic']);\r\n\t\t$data['synched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic'],TRUE);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_emr_wap\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_wap\";\r\n $new_body = \"ehr/emr_newpage_wap\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_export_patients_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n }", "public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }", "public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "function action_report($low, $high) {\n\n $range_l = '';\n $range_h = '';\n\n if(strcmp($low, '1000-01-01 00:00:00') == 0) {\n $range_l = \"site's beginning\";\n } else {\n $range_l = $low;\n }\n\n if(strcmp($high, '9999-12-31 23:59:59') == 0) {\n $range_h = \"now\";\n } else {\n $range_h = $high;\n }\n\n $freq_patient = user_freq($low, $high, \"Patient\");\n $freq_nurse = user_freq($low, $high, \"Nurse\");\n $freq_doctor = user_freq($low, $high, \"Doctor\");\n $freq_admin = user_freq($low, $high, \"Admin\");\n\n $total_patient = total_action_user($low, $high, \"Patient\");\n $total_nurse = total_action_user($low, $high, \"Nurse\");\n $total_doctor = total_action_user($low, $high, \"Doctor\");\n $total_admin = total_action_user($low, $high, \"Admin\");\n\n $freq_login = action_freq($low, $high, \"Logged In\");\n $freq_logout = action_freq($low, $high, \"Logged Out\");\n $freq_newuser = action_freq($low, $high, \"Created New User\");\n $freq_modrec = action_freq($low, $high, \"Modified Record\");\n $freq_apmt = action_freq($low, $high, \"Scheduled Appointment\");\n $freq_prescript = action_freq($low, $high, \"Prescription Written\");\n\n $total_login = total_action_action($low, $high, \"Logged In\");\n $total_logout = total_action_action($low, $high, \"Logged Out\");\n $total_newuser = total_action_action($low, $high, \"Created New User\");\n $total_modrec = total_action_action($low, $high, \"Modified Record\");\n $total_apmt = total_action_action($low, $high, \"Scheduled Appointment\");\n $total_prescript = total_action_action($low, $high, \"Prescription Written\");\n\n echo \"<h2>Activity report for interval from \".$range_l.\" to \".$range_h.\"</h2><br>\";\n \n echo \"<h3>Average Daily Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$freq_patient.\"</center></td><td><center>\".$freq_nurse.\"</center></td><td><center>\".$freq_doctor.\"</center></td><td><center>\".$freq_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Total number of Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$total_patient.\"</center></td><td><center>\".$total_nurse.\"</center></td><td><center>\".$total_doctor.\"</center></td><td><center>\".$total_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Average Daily Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$freq_login.\" </td><td>Logouts: \".$freq_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$freq_newuser.\" </td><td>Records Modified: \".$freq_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$freq_apmt.\"</td><td>Prescriptions Written: \".$freq_prescript.\"</td></tr></table>\";\n\n echo \"<h3>Total number of Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$total_login.\" </td><td>Logouts: \".$total_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$total_newuser.\" </td><td>Records Modified: \".$total_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$total_apmt.\"</td><td>Prescriptions Written: \".$total_prescript.\"</td></tr></table>\";\n\n\n }", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "public function actionOutputStatistical()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->statistictalSearch(Yii::$app->request->queryParams);\n\t\t \n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n $arr = []; \n foreach($result as $r) {\n $arr[] = $r;\n }\n\t\t$header = [\n 'year' => '年', \n 'month' => '月', \n 'personnel_id' => '员工ID', \n 'username' => '员工姓名', \n 'overtime' => '当月加班时长(计算)', \n 'overtime_valid' => '当月加班时长(有效)', \n ];\n\t\t$columns = array_keys($header);\n \\moonland\\phpexcel\\Excel::export([\n 'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤统计' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤统计' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤统计' => $header, \n\t\t\t],\n ]);\n }", "public function basicreport()\n\t{\n\t\t\n\t\t$disp_msg = $this->session->flashdata('disp_msg');\n\t\t\n\t\t\n\t\t$search_filters = array();\n\t\t$search_results = array();\n\t\t\n\t\t$search_query = \"SELECT * FROM postpatch_schedule WHERE 1=1 \";\n\t\t\n\t\tif (!empty($_POST)) {\n\t\t\tif(!empty($_POST['dpa_flexinet_id']) && count($_POST['dpa_flexinet_id'])>0) {\n\t\t\t\t$dpavals = implode(\"' , '\", $_POST['dpa_flexinet_id']);\n\t\t\t\t$search_query .= \" AND dpa_flexinet IN ('\".$dpavals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['verificationstatus']) && count($_POST['verificationstatus'])>0) {\n\t\t\t\t$verfstatusvals = implode(\"' , '\", $_POST['verificationstatus']);\n\t\t\t\t$search_query .= \" AND verificationstatus IN ('\".$verfstatusvals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['scheduledate']) && count($_POST['scheduledate'])>0) {\n\t\t\t\t$scdvals = implode(\"' , '\", $_POST['scheduledate']);\n\t\t\t\t$search_query .= \" AND scheduledate IN ('\".$scdvals.\"') \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search_query_res = $this->commonclass->execute_rawquery($search_query);\n\t\t$search_results = $search_query_res->result_array();\n\t\t\n\t\t$dpa_emps = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(dpa_flexinet) as dpa_flexinet ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($dpa_emps)>0) {\n\t\t\tforeach($dpa_emps as $onedpa) {\n\t\t\t\t$search_filters['dpa'][] = $onedpa['dpa_flexinet'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$verf_status_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(verificationstatus) as verificationstatus ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($verf_status_res)>0) {\n\t\t\tforeach($verf_status_res as $oneverif) {\n\t\t\t\t$search_filters['verf_status'][] = $oneverif['verificationstatus'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$scheduledate_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(scheduledate) as scheduledate ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($scheduledate_res)>0) {\n\t\t\tforeach($scheduledate_res as $oneverif1) {\n\t\t\t\t$search_filters['scheduledates'][$oneverif1['scheduledate']] = ($oneverif1['scheduledate'] != \"0000-00-00\") ? $this->commonclass->dateformat1($oneverif1['scheduledate']) : \"00/00/0000\";\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t## ____________ Data sending to the template starts ____________ ##\n\t\t$data['disp_msg'] = $disp_msg; # display messages\n\t\t$data['search_filters'] = $search_filters; # search_filters\n\t\t$data['search_results'] = $search_results; # search_filters\n\t\t//$data['postpatch_uploads'] = $postpatch_uploads; # postpatch_schedule\n\t\t\n\t\t## ____________ Data sending to the template ends here ____________ ##\n\t\t\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/header', $data); # html view page\n\t\t$this->load->view('admin/report1-page', $data); # html view page\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/footer', $data); # html view page\n\t}", "public function reportDatewiseClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function generateAttendance($args, $request) {\r\n\t\t$meetingId = isset($args[0]) ? $args[0]: 0;\r\n\t\t$this->validate($meetingId, MINUTES_STATUS_ATTENDANCE);\r\n\t\t$this->setupTemplate(true, $meetingId);\r\n\t\t$meeting =& $this->meeting;\r\n\r\n\t\t$journal =& Request::getJournal();\r\n\t\timport('classes.meeting.form.AttendanceForm');\r\n\t\t$attendanceForm = new AttendanceForm($meetingId, $journal->getId());\r\n\t\t$submitted = Request::getUserVar(\"submitAttendance\") != null ? true : false;\r\n\r\n\t\tif($submitted) {\r\n\t\t\t$attendanceForm->readInputData();\r\n\t\t\tif($attendanceForm->validate()) {\r\n\t\t\t\t$attendanceForm->execute();\r\n\t\t\t\t$attendanceForm->savePdf();\r\n\t\t\t\tRequest::redirect(null, null, 'manageMinutes', $meetingId);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ($attendanceForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$attendanceForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$attendanceForm->initData();\r\n\t\t\t\t}\r\n\t\t\t\t$attendanceForm->display();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$attendanceForm->display();\r\n\t\t}\r\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "public function crystal_report_view()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/crystal_report',$this->data);\n\t}", "function sendExport() {\n\tglobal $orgcode;\n\tglobal $filename;\n\tglobal $firstdate;\n\tglobal $lastdate;\n\t$headers = [\n\t\t\"ORGCODE\",\t//0\n\t\t\"PARTICIP\",\n\t\t\"ENROLL\",\n\t\t\"PAYER\",\n\t\t\"STATE\",\n\t\t\"GLUCTEST\",\t//5\n\t\t\"GDM\",\n\t\t\"RISKTEST\",\n\t\t\"AGE\",\n\t\t\"ETHNIC\",\n\t\t\"AIAN\",\t\t//10\n\t\t\"ASIAN\",\n\t\t\"BLACK\",\n\t\t\"NHOPI\",\n\t\t\"WHITE\",\n\t\t\"SEX\",\t\t//15\n\t\t\"HEIGHT\",\n\t\t\"EDU\",\n\t\t\"DMODE\",\n\t\t\"SESSID\",\n\t\t\"SESSTYPE\",\t//20\n\t\t\"DATE\",\n\t\t\"WEIGHT\",\n\t\t\"PA\"\n\t];\n\t\n\t$data = [$headers];\n\t$noncompliant = [$headers];\n\t$today = new DateTime(\"NOW\");\n\t\n\t// get all participant data\n\t$records = \\REDCap::getData(PROJECT_ID);\n\t$project = new \\Project(PROJECT_ID);\n\t\n\t// get year value for when these records were created or first logged update\n\t$recordCreationDates = [];\n\t$sql = \"SELECT pk, ts FROM redcap_log_event WHERE project_id=\" . PROJECT_ID . \" and pk in (\" . implode(array_keys($records), \", \") . \") and (description=\\\"Create record\\\" OR description=\\\"Update record\\\") ORDER BY pk ASC, ts ASC\";\n\t$query = db_query($sql);\n\twhile ($row = db_fetch_assoc($query)) {\n\t\tif (!isset($recordCreationDates[$row['pk']])) {\n\t\t\t$recordCreationDates[$row['pk']] = substr($row['ts'], 2, 2);\n\t\t}\n\t}\n\t\n\t// regex for getting labels for project fields (like state, sess_type, etc)\n\t$labelPattern = \"/(\\d+),?\\s?(.+?)(?=\\x{005c}\\x{006E}|$)/\";\n\t\n\tforeach ($records as $rid => $record) {\n\t\t$eid = array_keys($record)[0];\n\t\t\n\t\t// skip if orgcode set and not match\n\t\tif (isset($orgcode) and $orgcode != $record[$eid]['orgcode']) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// skip if have diabietes\n\t\tif ($record[$eid]['have_diabetes'] == 1 or $record[$eid]['enter_roster'] == 0) continue;\n\t\t\n\t\t$line = array_fill(0, 23, null);\n\t\t$line[0] = $record[$eid]['orgcode'];\n\t\t\n\t\t// determine participant ID\n\t\t$participantID = $recordCreationDates[$rid];\n\t\tpreg_match_all($labelPattern, $project->metadata['participant_id_group']['element_enum'], $matches);\n\t\t$participantID .= trim($matches[2][$record[$eid]['participant_id_group'] - 1]);\n\t\t$participantID .= $record[$eid]['participant_id_group'];\n\t\tpreg_match_all(\"/\\d+/\", $record[$eid]['participant_employee_id'], $matches);\n\t\t$participantID .= $matches[0][0];\n\t\t\n\t\t$line[1] = $participantID;\n\t\t$line[2] = $record[$eid]['program_referral'] === null ? 10 : $record[$eid]['program_referral'];\n\t\t$line[3] = $record[$eid]['payer'] === null ? 9 : $record[$eid]['payer'];\n\t\tpreg_match_all($labelPattern, $project->metadata['state']['element_enum'], $matches);\n\t\tpreg_match(\"/- ([A-Z]{2})(?:\\s|$)/\", $matches[2][$record[$eid]['state'] - 1], $matches);\n\t\t$line[4] = $matches[1];\n\t\t$line[5] = $record[$eid]['gluctest'] == 1 ? 1 : 2;\n\t\t$line[6] = $record[$eid]['gdm'] == 1 ? 1 : 2;\n\t\t$line[7] = $record[$eid]['risktest'] == 1 ? 1 : 2;\n\t\t$dob = new DateTime($record[$eid]['dob']);\n\t\t$line[8] = $dob->diff($today)->format('%y');\n\t\t$line[9] = $record[$eid]['ethnicity'] == null ? 9 : $record[$eid]['ethnicity'];\n\t\t$line[10] = $record[$eid]['race'][1] == 1 ? 1 : 2;\n\t\t$line[11] = $record[$eid]['race'][2] == 1 ? 1 : 2;\n\t\t$line[12] = $record[$eid]['race'][3] == 1 ? 1 : 2;\n\t\t$line[13] = $record[$eid]['race'][4] == 1 ? 1 : 2;\n\t\t$line[14] = $record[$eid]['race'][5] == 1 ? 1 : 2;\n\t\t$line[15] = $record[$eid]['sex'] == null ? 9 : $record[$eid]['sex'];\n\t\tpreg_match_all($labelPattern, $project->metadata['height']['element_enum'], $matches);\n\t\tpreg_match_all(\"/[0-9]{1,2}/\", $matches[2][$record[$eid]['height'] - 1], $matches);\n\t\t$line[16] = @((int) $matches[0][0] * 12 + (int) $matches[0][1]);\n\t\t$line[17] = $record[$eid]['education'] == null ? 9 : $record[$eid]['education'];\n\t\t\n\t\t$instanceSum = 0;\n\t\tforeach ($record['repeat_instances'][$eid]['sessionscoaching_log'] as $i => $instance) {\n\t\t\t// only add data that's within last 6 months!\n\t\t\t$sess_date = $instance[\"sess_actual_date\"];\n\t\t\tif (empty($sess_date)) {\n\t\t\t\t$sess_date = $instance[\"sess_scheduled_date\"];\n\t\t\t}\n\t\t\t\n\t\t\t$thisdate = strtotime($sess_date);\n\t\t\tif (empty($sess_date) or (!empty($firstdate) and $firstdate > $thisdate) or (!empty($lastdate) and $lastdate < $thisdate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$instanceSum++;\n\t\t\t$line_copy = $line;\n\t\t\t$line_copy[18] = $instance['sess_mode'];\n\t\t\t$line_copy[19] = $instance['sess_id'];\n\t\t\tif ($instance[\"sess_month\"] >= 7) {\n\t\t\t\t$line_copy[19] = 99;\n\t\t\t\t$line_copy[20] = \"CM\";\n\t\t\t}\n\t\t\tif ($instance[\"sess_month\"] >= 7)\n\t\t\t\t$line_copy[20] = \"OM\";\n\t\t\tpreg_match_all($labelPattern, $project->metadata['sess_type']['element_enum'], $matches);\n\t\t\tpreg_match_all(\"/\\(([A-Z]|[A-Z][A-Z])\\)/\", $matches[2][$instance['sess_type'] - 1], $matches);\n\t\t\t$line_copy[20] = $matches[1][0];\n\t\t\t$line_copy[21] = $sess_date == null ? null : date(\"m/d/Y\", strtotime($sess_date));\n\t\t\t$line_copy[22] = $instance['sess_weight'];\n\t\t\t$line_copy[23] = $instance['sess_pa'];\n\t\t\t\n\t\t\t$session_attended = false;\n\t\t\tif ($instance[\"sess_attended\"] or $instance['sess_weight'] or $instance['sess_pa'])\n\t\t\t\t$session_attended = true;\n\t\t\t\n\t\t\tvalidateLine($line_copy, $session_attended);\n\t\t\t\n\t\t\t// if session is marked as attended but weight and/or pa values not included, use 999\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[22]))\n\t\t\t\t$line_copy[22] = 999;\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[23]))\n\t\t\t\t$line_copy[23] = 999;\n\t\t\t\n\t\t\t// if error messages were appended...\n\t\t\tif (isset($line_copy[24]) and isset($_GET['noncompliant'])) {\n\t\t\t\t$noncompliant[] = $line_copy;\n\t\t\t}\n\t\t\t\n\t\t\t// no errors and no non-compliant param\n\t\t\tif (!isset($line_copy[24]) and !isset($_GET['noncompliant'])) {\n\t\t\t\t$data[] = $line_copy;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send participant records with no session data to noncompliant set\n\t\tif ($instanceSum == 0)\n\t\t\t$noncompliant[] = $line;\n\t}\n\t\n\theader('Content-Type: text/csv');\n\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t$fp = fopen('php://output', 'wb');\n\t\n\t// non-compliance report\n\tif (isset($_GET['noncompliant'])) {\n\t\t$data = $noncompliant;\n\t}\n\t\n\tforeach ($data as $line) {\n\t\tfputcsv($fp, $line, ',');\n\t}\n\tfclose($fp);\n}", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n $cur = $this->input->post('ccurrency');\n $start = $this->input->post('start');\n $end = $this->input->post('end');\n\n $data['currency'] = $cur;\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n // Property Details\n $data['company'] = $this->properti['name'];\n\n $result = null;\n foreach ($this->model->report($cur,$start,$end)->result() as $res) {\n $result[] = array (\"id\"=>$res->id, \"no\"=>$res->no, \"notes\"=>$res->notes, \"dates\"=>tglin($res->dates), \n \"currency\"=>$res->currency, \"from\"=>$this->get_acc($res->from), \"to\"=>$this->get_acc($res->to), \n \"posted\"=>$res->approved, \"amount\"=>$res->amount);\n }\n $data['result'] = $result; $this->output = $data;\n }else { $this->reject_token(); }\n $this->response('content');\n }", "public function index(\\Silex\\Application $app, Request $request)\n {\n $cat = $request->get('cat');\n $idioma = $request->get('idioma');\n $start = $request->get('start');\n $end = $request->get('end');\n\t\t$reportname = $request->get('reportname');\n\n $yr = empty( $request->get('yr') ) ? date(\"Y\") : $request->get('yr');\n\n $app['yr'] = $yr;\n\n $sqlmode = $app['orm.em']->getConnection()->prepare('SET sql_mode=0');\n $sqlmode->execute();\n\n $report = array();\n /*************************************/\n if ($start != 'default' and $end != 'default') {\n if ($idioma=='pr') {\n $usuarios = $app['orm.em']->getConnection()->prepare(\"SELECT * FROM importuserpr WHERE Categoria='\".$cat.\"' AND Fecha BETWEEN '\".$start.\"' AND '\".$end.\"' GROUP BY Nome\");\n $usuarios->execute();\n $report = $usuarios->fetchAll();\n } else {\n $usuarios = $app['orm.em']->getConnection()->prepare(\"SELECT * FROM importuser WHERE Categoria='\".$cat.\"' AND Fecha BETWEEN '\".$start.\"' AND '\".$end.\"' GROUP BY Nombre \");\n $usuarios->execute();\n $report = $usuarios->fetchAll();\n }\n }\n /*************************************/\n return $app['twig']->render('reportcat.html.twig', array(\n 'cat'=>$cat,\n 'idioma'=>$idioma,\n 'start'=>$start,\n 'end'=>$end,\n 'report' => $report, \n\t\t\t 'reportname' => $reportname\n ));\n }", "public function reportPeriodicStudentAbsentListView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $date_form = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($date_form));\n $date_to = trim($request->to); \n $date_too = trim($request->to);\n $to = date (\"Y-m-d\", strtotime($date_to));\n $sorting_type = trim($request->sorting_type);\n $attendent_days = trim($request->attendent_days);\n\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n // total day caluclation\n $date1 = date_create($from);\n $date2 = date_create($to);\n //difference between two dates\n $diff = date_diff($date1,$date2);\n $total_day = $diff->format(\"%a\")+1;\n if($sorting_type == '1'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }elseif($sorting_type == '2'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('count','ASC')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }elseif($sorting_type == '3'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('count','ASC')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }\n\n foreach($result as $value) {\n //do something\n $attentdent_id[] = $value->studentId;\n}\n$absent_result = DB::table('students')\n ->join('student', 'students.id', '=', 'student.studentID')\n ->select('student.*', 'students.studentName','students.studentMobile','students.studentImage','student.registration')\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereNotIn('student.studentID',$attentdent_id)\n ->orderBy('student.roll','asc')\n ->get();\n\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n return view('view_report.reportPeriodicStudentAbsentListView')->with('result',$result)->with('count_holiday',$count_holiday)->with('total_day',$total_day)->with('from',$from)->with('to',$to)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('shift',$shift)->with('dept',$dept)->with('semister',$semister)->with('section',$section)->with('date_form',$date_form)->with('date_to',$date_to)->with('absent_result',$absent_result)->with('attendent_days',$attendent_days)->with('sorting_type',$sorting_type); \n\n }", "public function report($typeId = null, $reportDate = null, $numOfDays = null, $classId = null, $sectionId = null)\n\t{\t\t\t\n\t\t$year = substr($reportDate, 0, 4);\n\t\t$month = substr($reportDate, 5, 7);\t\t\n\n\t\t$classData = $this->model_classes->fetchClassData($classId);\n\t\t$sectionData = $this->model_section->fetchSectionByClassSection($classId, $sectionId);\n\n\t\t\t// student\t\t\t\n\t\t\t$div = '<div class=\"well\">\n\t\t\t\t<center>\n\t\t\t\t\t<h4> Ngành học: '.$classData['class_name'].'<br> Lớp học : '.$sectionData['section_name'].'<h4>\n\t\t\t\t\t<h4> Năm : '.$year.' - Month :'.$month.'<h4>\t\t\n\t\t\t\t\t<small>\t\n\t\t\t\t\t\t1 : Tiết 1-2 ( 7h00-8h45) <br />\t\t\t\t\n\t\t\t\t\t\t2 : Tiết 3-4 (9h-10h45) <br />\n\t\t\t\t\t\t3 : Tiết 5-6 (13h - 14h45)<br />\n\t\t\t\t\t\t4 : Tiết 7-8 (15h-16h45)<br />\n\t\t\t\t\t\t\t5 : Tiết 9-10 (17h00 - 18h45)<br />\n\t\t\t\t\t</small>\n\t\t\t\t</center>\n\t\t\t</div>\n\n\t\t\t<div style=\"overflow-x:auto;\">\t\t\t\n\t\t\t<table class=\"table table-bordered\" style=\"width:100%;\">\t\t\t\n\t\t\t\t<tbody style=\"width:100%;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"width:25%;\">Môn học</td>\n\t\t\t\t\t\t';\t\t\n\t\t\t\t\t\t// loop for days\n\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t<td style=\"width:10%;\">'.$i.'</td>';\t\n\t\t\t\t\t\t} // /for\n\t\t\t\t\t$div .= '</tr>';\n\t\t\t\t\t\t\n\t\t\t\t\t$subjectInfo = $this->model_subject->fetchSubjectDataByClass($classId);\n\n\t\t\t\t\tforeach ($subjectInfo as $key => $value) {\n\t\t\t\t\t\t$subjectName = $value['name'];\n\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$subjectName.'</td>';\n\n\t\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t\t// $attendanceData = $this->model_attendance->getAttendance($i, $reportDate, $value['student_id'], $typeId, $classId, $sectionId);\n\t\t\t\t\t\t\t\t$scheduleData = $this->model_schedule->getAttendance($i, $reportDate, $value['subject_id'], $sectionId);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$div .= '<td>';\n\t\t\t\t\t\t\t\tforeach ($scheduleData as $scheduleKey => $scheduleValue) {\n\n\t\t\t\t\t\t\t\t\tif($scheduleValue['schedule_type'] == 1) {\n\t\t\t\t\t\t\t\t\t\t// Có mặt\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-success\">1</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 2) {\n\t\t\t\t\t\t\t\t\t\t// Vắng\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-primary\">2</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 3) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">3</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 4) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">4</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Không xác định\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-danger\">5</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$div .= $scheduleStatus;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t\t</td>';\t\n\t\t\t\t\t\t\t\t} // /for\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t$div .= '</tr>';\t\t\n\t\t\t\t\t} // /foreach\n\t\t\t\t$div .= '</tbody>\n\t\t\t\t</table>\n\t\t\t<div>';\t\t\t\n\t\t\techo $div;\n\t\t\n\n\t\t\n\t}", "public function report() {\n $data = [];\n if ($this->input->post('submit')) {\n $report_data['from_date'] = $this->input->post('form_from_date');\n $report_data['to_date'] = $this->input->post('form_to_date');\n if ($this->input->post('form_summarized')) {\n $data['summarized_report'] = $this->account_model->getSummarizedReport($report_data);\n } else {\n $data['report'] = $this->account_model->getReport($report_data);\n }\n } else {\n if ($this->session->has_userdata('financialyear')) {\n $data['financialyear'] = $this->session->userdata('financialyear');\n }\n }\n $this->view('report', $data);\n }", "public function actionGeneratorall() {\n //$sql = \"select hoscode from chospital_amp where already = 1\";\n $sql = \"select hoscode from chospital_amp where already = 1\";\n $hosData = $this->query_all_db2($sql);\n\n //find cumulative table from mas_mapp_main table with comment value 2\n $sql = \"select * from mas_mapp_main\";\n $cuTable = $this->query_all_db2($sql);\n\n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $sql = \"truncate $table\";\n $this->exec_sql($sql, 2);\n }\n\n foreach ($hosData as $hData) {\n $db_name = 'jhcisdb_' . $hData['hoscode'];\n $db = 'db' . $hData['hoscode'];\n \n $sql = \"call create_f43_table()\";\n $this->exec_sql_db($sql, $db);\n \n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $DATE_START = $cData['DATESTART'];\n $DATE_END = $cData['DATEEND'];\n $mapp_sql = trim($cData['MAPP_QUERY']);\n\n if ($table == 'f43_dental') {\n $sql = \"call cal_table_dental_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else if($table == 'f43_appointment'){\n $sql = \"call cal_table_appointment_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else {\n //generate data from jhcis version to f43 version\n $sql = \"call cal_table_tmp_newver1(\\\"\" . $table . \"\\\",\\\"(\" . $mapp_sql . \")\\\",\\\"\" . $DATE_START . \"\\\",\\\"\" . $DATE_END . \"\\\")\";\n $this->exec_sql_db($sql, $db);\n }\n\n //insert f43 from jhcis database to 43f_generate database\n $sql = \"call replace_into_table('$db_name','$table')\";\n $this->exec_sql($sql, 2);\n\n //drop f43 table in jhcis database\n //$sql = \"call cal_table_tmp_drop('$table','$db_name')\";\n //$this->exec_sql($sql, 2);\n }\n }\n\n return 'All';\n }", "function glReport() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n if ($_POST['type'] == \"pdf\") {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $data['report_table_data'] = $glExportReportData['report_table_data'];\n\n $pdfFileName = \"Webservice_Report\";\n $reportHTML = $this->load->view(\"webservice_report_view\", $data, TRUE);\n downloadhtmltopdf($reportHTML, $pdfFileName);\n } else {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $report_data = $glExportReportData['report_table_data'];\n $grand_total = $passeggero_start = $passeggero_si_start = 0;\n $exportData = array();\n $prev_codice_prodotto = '';\n foreach ($report_data as $rdata) {\n $passeggero_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_start;\n $passeggero_si_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_si_start;\n\n if ($rdata['codice_prodotto'] != 'Total') {\n if ($rdata['pax'] > 1 && ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' )) {\n $passeggero_arr = $this->webservicemodel->getPasseggero($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n for ($i = 0; $i < $rdata['pax']; $i++) {\n $pax = 1;\n $total = $rdata['amount_per_pax'] * $pax;\n $grand_total = $grand_total + $total;\n $pass = isset($passeggero[$passeggero_start])?$passeggero[$passeggero_start]:'';\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $pass,\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $pax,\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $total\n );\n $passeggero_start++;\n }\n } else if ($rdata['type'] == 'GLF') {\n $passeggero_arr = $this->webservicemodel->getPasseggeroSi($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $passeggero[$passeggero_si_start],\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n $passeggero_si_start++;\n } else {\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' ) ? $rdata['passeggero'] : \"\",\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n }\n }\n $prev_codice_prodotto = $rdata['codice_prodotto'];\n }\n if (!empty($exportData)) {\n // Empty row before total\n $exportData[] = array(\n 'Collaboratore' => '',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => ''\n );\n\n $exportData[] = array(\n 'Collaboratore' => 'Total',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => $grand_total\n );\n }\n\n $this->load->library('export');\n $this->export->exportUsingPhpExcel($exportData, 'webserviceglreport');\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n\n $glReportData = $this->_getGlReportData($data['collaboratore'], $data['accompagnatore']);\n $data['reportData'] = $glReportData['report_data'];\n $data['report_table_data'] = $glReportData['report_table_data'];\n $data['report_analysis_data'] = $glReportData['report_analysis_data'];\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n\t\t\t\t\t\t//echo \"<pre>\";print_r($data);die;\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }", "public function achievementsReport() {\n if (userLogedIn()) {\n if(check_access('achievementsReport')){\n $fromDate = date(\"Y-m-d\", strtotime(\"first day of this month\"));\n if (isset($_POST['fromDate'])) {\n $date = explode('/', $this->input->post('repDate'));\n $day = $date[1];\n $month = $date[0];\n $year = $date[2];\n $fromDate = $year . '-' . $month . '-' . $day;\n }\n $data['get_target'] = $this->admin_model->get_target($fromDate);\n \n $date = explode('-', $fromDate);\n $day = $date[2];\n $month = $date[1];\n $year = $date[0];\n $fromDate = $month . '/' . $day . '/' . $year;\n $data['fromDate'] = $fromDate;\n \n $this->load->view(\"admin/achievementsReport\", $data);\n \n }\n \n \n else{\n $url=$this->router->fetch_class().'/'.$this->router->fetch_method(); \n // echo $url;\n myLoader('No Access', 'home/login');\n }\n } else {\n $this->load->view('admin/login');\n }\n }", "public static function exportGiudeReport()\n {\n /**\n * TODO\n */\n }", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "public function actionIndex()\n { \n $mac=get_client_mac(get_client_ip());\n $employeeModel=Employee::findIdentityByMacAddress($mac);\n \n if($employeeModel!=null){\n if ($employeeModel->Active==0){\n print_r (\"InActive Employee.. Contact Admin\");\n return;\n }\n $model = new AttendanceIn();\n date_default_timezone_set('Asia/Calcutta');\n $model=AttendanceIn::findIdentityByUniqueKeys($employeeModel->id,date(\"Y-m-d\"));\n $month_off=MonthOff::find()->select([\"Dates\"])->where(['BranchId'=>$employeeModel->Branch])->andWhere(['Month'=>date('m')])->andWhere(['Year'=>date(\"Y\")])->all();\n if($month_off)\n $month_off=array_map('intval',explode(',',$month_off[0]['Dates'],-1));\n if($model==null){\n $model= new AttendanceIn();\n $model->EmployeeId=$employeeModel->id;\n $model->Date=date(\"Y-m-d\");\n $model->Time=date(\"H:i:s\");\n $timeSlotModel=TimeSlots::findOne(['id'=>$employeeModel->TimeSlot]);\n if(strcmp($model->Time,$timeSlotModel->Grace)<0){\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n \n }\n else if (strcmp($model->Time,$timeSlotModel->Grace)>0 && strcmp($model->Time,$timeSlotModel->DeadOut)<0){\n if($employeeModel->DeadOutCount>=$timeSlotModel->MaxDeadOutCount)\n $model->FirstHalf=\"A\";\n else{\n $employeeModel->DeadOutCount+=1;\n $employeeModel->save();\n $model->Remark=$employeeModel->DeadOutCount.\" Late Count\";\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n }\n }\n else{\n $model->FirstHalf=\"A\";\n }\n if($model->validate() && $model->save()){\n return $this->renderPartial('attendance-in-success', [\n 'employeeModel'=>$employeeModel,\n 'model'=>$model,\n ]);\n }\n else{\n print_r(\"Error Occured\");\n return;\n }\n }\n return AttendanceInController::actionOut();\n\n }\n else{\n print_r(\"<h1><p style='color:red;background-color:pink;border-color:#c3e6cb;'>No Such Device/Employee Registered</p></h1>\");\n return;\n }\n \n }", "function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}", "public function actionGenerateAllocations()\n {\n $res=ReportQueryManager::updateQuesSummary();\n\n if($res):\n $res1 = AllocationManager::updateCurrentAllocations();\n \n if (\\Yii::$app->request->isAjax):\n if($res1):\n $message = 'Allocations has been successfully inserted.';\n else:\n $message = 'Something went wrong with updates. Please confirm whether the data has not been updated for the year before';\n endif;\n $response = Yii::$app->response;\n // $response->format = \\yii\\web\\Response::FORMAT_JSON; -- only used if text out put is reqd\n $response->data = $message;\n $response->statusCode = 200;\n return $this->renderPartial('alloc-sum-status',['response'=>$response]);\n else:\n throw new BadRequestHttpException;\n endif;\n\n else:\n throw new \\yii\\web\\ServerErrorHttpException('The summary creation was unsuccessful. Hence no allocations generated');\n endif;\n }", "abstract public function buildReport();", "public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }", "public function reportDatewiseAttendentView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $date_form = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($date_form));\n $date_to = trim($request->to); \n $to = date (\"Y-m-d\", strtotime($date_to));\n $result = DB::table('student')->where('year',$year)->where('shift_id',$shift)->where('dept_id', $dept )->where('semister_id',$semister)->where('section_id',$section)->orderBy('roll','asc')->get();\n // count holiday\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n // total day caluclation\n $date1 = date_create($from);\n $date2 = date_create($to);\n //difference between two dates\n $diff = date_diff($date1,$date2);\n $total_day = $diff->format(\"%a\")+1;\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n return view('report.reportDatewiseAttendentView')->with('result',$result)->with('count_holiday',$count_holiday)->with('total_day',$total_day)->with('from',$from)->with('to',$to)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('shift',$shift)->with('dept',$dept)->with('semister',$semister)->with('section',$section)->with('date_form',$date_form)->with('date_to',$date_to); \n\n }", "public function Attendance(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\t$data = $this->GetDataForCashier(\"Attendance\");\t\t\t\n\t\t\t$data['experts'] = $this->GetExperts();\t\n\t\t\t$data['attendance_today']=$this->CashierModel->CalculateAttendance();\t\t\t\n\t\t\n\t\t\t$data['sidebar_collapsed'] = \"true\";\n\t\t\t// $this->PrettyPrintArray($data);\n\t\t\t// exit;\n\t\t\t$this->load->view('cashier/cashier_attendance_view', $data);\t\n\t\t}\n\t\telse{\n\t\t\t$data['title'] = \"Login\";\n\t\t\t$this->load->view('cashier/cashier_login_view',$data);\n\t\t}\n\t\t\n\n\t}", "public function prepare_report($emp, $month, $year){\n\n // echo $emp.' '.$month.' '.$year;\n\t\t$start = date('Y-m-d', strtotime(\"$year-$month-01\")); \n\t $end = date('Y-m-t', strtotime($start));\n\t\t$data['attendance'] = calculate_attendance($emp,$start,$end);\n\t\t\n\t\t//array_walk($data['attendance'], function(&$key, $b) { ucwords(str_replace('_', ' ', $key)) }); \n\t\t$data['at_labels'] = json_encode(['Present','Absent','Half Day','Uninformed Leave','Sandwich Leave','Late Login']); \n\t\t$data['at_values'] = json_encode(array_values($data['attendance'])); \n\t\t\n\t\t$project_data = Project::join('project_assignation','projects.id','project_assignation.project_id')\n\t\t\t\t\t\t\t\t->join('users','project_assignation.employee_id','users.id')\n\t\t\t\t\t\t\t\t->join('eods','eods.user_id','users.id')\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t ->select('projects.project_name','projects.id', DB::Raw('SUM(eods.today_hours) as pr_time'))\n\n\t\t\t\t\t\t\t\t->where('users.id', $emp)\n\t\t\t\t\t\t\t\t->whereMonth('eods.date', $month)\t\n\t\t\t\t\t\t\t\t->whereYear('eods.date', $year)\t \t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->whereRaw('eods.project_id = projects.id')\n\t\t\t\t\t\t\t\t->groupBy('projects.project_name','projects.id')\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t->get(); \n\n\n\t \n\t\t\n\t\t\t$sum = array_sum(array_column($project_data->toArray(),'pr_time')); \n\n\t\t\t$data['projects'] = $project_data;\n\t\t\tforeach($project_data as $project){\n\t\t\t\t$labels[] = $project->project_name;\n\t\t\t\t$cdata[] = number_format(($project->pr_time*100) / $sum, 2); \n\t\t\t\t//$sdata[] = array('label'=> $project->project_name,'data'=>number_format(($project->pr_time*100) / $sum, 2),'backgroundColor'=>'green','borderColor'=>'red') ;\n\t\t\t\t$sdata[] = array('label'=>$project->project_name,'y'=>number_format(($project->pr_time*100) / $sum, 2));\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!empty($labels) && !empty($cdata)){\n\t\t $data['labels'] = json_encode($labels);\n\t\t $data['cdata'] = json_encode($cdata);\n\t\t $data['sdata'] = json_encode($sdata); \n\t\t\t} \n\t\t\t//print_r($data['sdata']);\n\n\t\t return $data; \n\t}", "public function show_report_service()\n { \n $this->load->model(\"swm/frontend/M_swm_attend\", \"msa\");\n $rs_service_data = $this->msa->get_time_us_attend(getNowDate(),getNowDate());//startDate, endDate, startAge, endAge, state\n $data['rs_service_data'] = $rs_service_data->result();\n $this->output(\"swm/frontend/v_report_service\", $data, true);\n }", "public function hrEmpLeaveReport(Request $request, $type=null){\n $data['post_data'] = $request->all();\n //$userInfo = $this->getEmployeeInfo( null,3883);\n if ($type == 'pdf' && $request->users !=''){\n //$userInfo = $this->getEmployeeInfo( null, $request->users);\n\n $year = $request->year?$request->year:date(\"Y\");\n\n $data['user_id'] = $request->users;\n $data['year'] = $year;\n $data['leave_policys'] = self::getLeavePolicy($year,$request->users);\n\n $data['report_title'] = 'Leave Report - '. $year;\n $data['filename'] = 'leave_report_pdf';\n $data['orientation'] = \"P\";\n $data['branch_address'] = getUserInfoFromId(Auth::user()->id)->address;\n $data['signatures']=['Prepared by','Checked by','Approved by'];\n $view='HR.leave_report.leave_report_pdf';\n PdfHelper::exportPdf($view,$data);\n }else if(!empty($data['post_data'])){\n $data['emp_info'] = employeeInfo($request->users);\n $data['leave_summery'] = $this->getEmployeeLeaveInfo($request->users,'');\n }\n\n return view('HR.leave_report.leave_report', $data);\n\n }", "public function Generate_Report()\n\t{\n\t\t//\n\t\t// criteria start_date YYYYMMDD\n\t\t// criteria end_date YYYYMMDD\n\t\t// company_id\n\t\t//\n\t\ttry\n\t\t{\n\t\t\t$this->search_query = new Transaction_History_Report_Query($this->server);\n\n\t\t\t$data = new stdClass();\n\n\t\t\t// Save the report criteria\n\t\t\t$data->search_criteria = array(\n\t\t\t 'specific_date_MM' => $this->request->specific_date_month,\n\t\t\t 'specific_date_DD' => $this->request->specific_date_day,\n\t\t\t 'specific_date_YYYY' => $this->request->specific_date_year,\n\t\t\t 'company_id' => $this->request->company_id,\n\t\t\t 'loan_type' => $this->request->loan_type\n\t\t\t);\n\n\t\t\t$_SESSION['reports']['transaction_history']['report_data'] = new stdClass();\n\t\t\t$_SESSION['reports']['transaction_history']['report_data']->search_criteria = $data->search_criteria;\n\t\t\t$_SESSION['reports']['transaction_history']['url_data'] = array('name' => 'Transaction History', 'link' => '/?module=reporting&mode=transaction_history');\n\n\t\t\t// Start date\n\t\t\t$start_date_YYYY = $this->request->specific_date_year;\n\t\t\t$start_date_MM\t = $this->request->specific_date_month;\n\t\t\t$start_date_DD\t = $this->request->specific_date_day;\n\t\t\tif(!checkdate($start_date_MM, $start_date_DD, $start_date_YYYY))\n\t\t\t{\n\t\t\t\t//return with no data\n\t\t\t\t$data->search_message = \"Start Date invalid or not specified.\";\n\t\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$start_date_YYYYMMDD = 10000 * $start_date_YYYY\t+ 100 * $start_date_MM + $start_date_DD;\n\n\t\t\t$data->search_results = $this->search_query->Fetch_Transaction_History_Data( $start_date_YYYYMMDD,\n\t\t\t\t $this->request->loan_type,\n\t\t\t\t $this->request->company_id);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$data->search_message = \"Unable to execute report. Reporting server may be unavailable.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// we need to prevent client from displaying too large of a result set, otherwise\n\t\t// the PHP memory limit could be exceeded;\n\t\tif(!empty($data->search_results) && count($data->search_results) > $this->max_display_rows)\n\t\t{\n\t\t\t$data->search_message = \"Your report would have more than \" . $this->max_display_rows . \" lines to display. Please narrow the date range.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Sort if necessary\n\t\t$data = $this->Sort_Data($data);\n\n\t\tECash::getTransport()->Add_Levels(\"report_results\");\n\t\tECash::getTransport()->Set_Data($data);\n\t\t$_SESSION['reports']['transaction_history']['report_data'] = $data;\n\t}", "public function index(Request $request)\n {\n switch ($request->action) {\n case \"attendance\":\n $roleName = \"admin\";\n\n $resultUser = User::whereHas('roles', function ($query) use ($roleName) {\n $query->where('name', '!=', $roleName);\n })->get();\n\n $resultAttendance = Attendance::all();\n\n // return view('employee.report', compact('resultUser', 'resultAttendance'));\n\n $pdf = PDF::loadView('employee.report', compact('resultUser', 'resultAttendance'));\n return $pdf->stream(date('d-M-Y') . '_laporan-absensi.pdf');\n break;\n\n case \"finance\":\n // code\n break;\n\n case \"item\":\n // code\n break;\n\n case \"transaction\":\n // code\n break;\n\n default:\n return redirect()->route('dashboard');\n break;\n }\n }", "public function reportMonthlyAttendentView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $month = trim($request->month);\n // get student\n $result = DB::table('student')->where('year',$year)->where('shift_id',$shift)->where('dept_id', $dept )->where('semister_id',$semister)->where('section_id',$section)->orderBy('roll','asc')->get();\n // get holiday\n $from = $year.'-'.$month.'-01';\n $to = $year.'-'.$month.'-31';\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n $month_total_day =cal_days_in_month(CAL_GREGORIAN,$month,$year);\n \n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n\n return view('report.reportMonthlyAttendentView')->with('result',$result)->with('count_holiday',$count_holiday)->with('month_total_day',$month_total_day)->with('from',$from)->with('to',$to)->with('month',$month)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('section',$section)->with('semister',$semister)->with('dept',$dept)->with('shift',$shift); \n }", "public function infectionReport(){\n\n\t \t$ageRanges = array('0-5'=>'Under 5 years', \n\t \t\t\t\t\t'5-14'=>'5 years and over but under 14 years', \n\t \t\t\t\t\t'14-120'=>'14 years and above');\t//\tAge ranges - will definitely change in configurations\n\t\t$gender = array(Patient::MALE, Patient::FEMALE); \t//\tArray for gender - male/female\n\t\t$ranges = array('Low', 'Normal', 'High');\n\t\t$accredited = array();\n\n\t\t//\tFetch form filters\n\t\t$date = date('Y-m-d');\n\t\t$from = Input::get('start');\n\t\tif(!$from) $from = date('Y-m-01');\n\t\t$to = Input::get('end');\n\t\tif(!$to) $to = $date;\n\t\t\n\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\n\t\t$testCategory = Input::get('test_category');\n\n\t\t$infectionData = Test::getInfectionData($from, $toPlusOne, $testCategory);\t// array for counts data for each test type and age range\n\t\t\n\t\treturn View::make('reports.infection.index')\n\t\t\t\t\t->with('gender', $gender)\n\t\t\t\t\t->with('ageRanges', $ageRanges)\n\t\t\t\t\t->with('ranges', $ranges)\n\t\t\t\t\t->with('infectionData', $infectionData)\n\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t->withInput(Input::all());\n\t}", "public function Get_Special_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=special&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT DISTINCT `course_id` FROM `course_hire_special_instructor` WHERE `status` = '1' AND `semester_id` = \".$semester_id;\n $result_course = $this->DB->Query($sql);\n if($result_course)\n {\n for($i=0;$i<count($result_course);$i++)\n {\n if(!in_array($result_course[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`cv` FROM `course_hire_special_instructor` ci ,`special_instructor` si \";\n $sql.= \"WHERE ci.`instructor_id` = si.`instructor_id` AND ci.`course_id` = '\".$result_course[$i]['course_id'].\"' AND ci.`status` = '1' AND ci.`semester_id` = \".$semester_id;\n $result_instructor = $this->DB->Query($sql);\n $data = array();\n $data['id'] = $result_course[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['special'] = array();\n if($result_instructor)\n {\n for($j=0;$j<count($result_instructor);$j++)\n {\n $instructor['id'] = $result_instructor[$j]['instructor_id'];\n $instructor['name'] = $result_instructor[$j]['prefix'].' '.$result_instructor[$j]['firstname'].' '.$result_instructor[$j]['lastname'];\n $instructor['cv'] = $this->PERSON->Get_CV($instructor['id']);\n $instructor['pdf'] = $this->VIEW_URL.\"?course=\".$data['id'].\"&id=\".$instructor['id'].\"&type=complete&info=special&semester=\".$semester.\"&year=\".$year;\n array_push($data['special'],$instructor);\n }\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n }", "function generate_report_modelwise($id, $field, $from, $to) {\n switch ($field) {\n case 'tl':\n $fieldName = 'Team_Lead';\n break;\n case 'dse':\n $fieldName = 'DSE';\n break;\n case 'asm':\n $fieldName = 'ASM_SM';\n break;\n case '6':\n $fieldName = 'Team_Lead';\n break;\n case '7':\n $fieldName = 'DSE';\n break;\n case '5':\n $fieldName = 'ASM_SM';\n break;\n }\n $empID = $id;\n $this->db->where('Inv_Dt >=', $from);\n $data = $this->db->get_where('rtl_daily_rep', array($fieldName => $id))->result_array();\n $countArr = array();\n\n foreach ($data as $k => $d) {\n if ($d['Model'] != 'Total_Target') {\n $id = $d['Model'];\n $countVar = 0;\n foreach ($data as $key => $var) {\n if ($id == $var['Model']) {\n $countVar++;\n }\n\n $countArr[strtoupper((string) $d['Model'])]['achieved'] = $countVar;\n $countArr[strtoupper((string) $d['Model'])]['target'] = 0;\n }\n }\n }\n\n $select = array(\n 'target_table_id',\n 'target_table_emp_id',\n 'employe_table_employe_name',\n 'target_table_product',\n 'target_table_product_qty',\n 'target_table_exp_date'\n );\n $toNxt = new DateTime($to);\n $toNxt->modify('+1 day');\n $to = date_format($toNxt,\"Y-m-d\");\n $col = 'target_table_emp_id';\n $Where = (\"DATE (target_table_create) BETWEEN '$from' AND '$to' AND $col = $empID\");\n $this->db->where('target_table_target_level',$field);\n if($field == 6)\n $data['tl'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 7)\n $data['dse'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 5)\n $data['asm'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n\n switch ($field) {\n case 'tl':\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'dse':\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'asm':\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n break;\n case 6:\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 7:\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 5:\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n }\n\n\n\n return $countArr;\n }", "public function actionInquiryReport()\n {\n $s_date='';\n $e_date='';\n $export = Yii::$app->request->get('export');\n $search = Yii::$app->request->get('search');\n if(isset($export) && !isset($search)) {\n $this->InquiryExport();\n }\n else{\n if (isset(Yii::$app->request->queryParams['BookingSearch']['start_date']))\n $s_date = Yii::$app->request->queryParams['BookingSearch']['start_date'];\n if (isset(Yii::$app->request->queryParams['BookingSearch']['end_date']))\n $e_date = Yii::$app->request->queryParams['BookingSearch']['end_date'];\n if($s_date=='')\n $s_date = date(\"M-d-Y\");\n if($e_date=='')\n $e_date = date(\"M-d-Y\");\n $searchModel = new RecordInquirySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('inquiry_index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 's_date' => $s_date,\n 'e_date' => $e_date,\n ]);\n }\n\n }", "public function paynow1($scheduleid){\n //die(var_dump($this->usertype));\n $user_details = $this->pay_mdl->get_user_details($this->usertype, $this->user_id);\n \n $excep_param = array(\n 'usertype' => $user_details['usertype'],\n 'colid'=> $user_details['colid'],\n 'deptid' => $user_details['deptid'],\n 'progid' => ($user_details['usertype'] == 'applicant')? $user_details['prog1'] : $user_details['progid'],\n 'type' => ($user_details['usertype'] == 'applicant')? $user_details['type'] : \"\",\n 'coi'=>($user_details['usertype'] == 'applicant')? $user_details['coi'] : \"\",\n 'stid' => $user_details['stid'],\n 'level' => ($user_details['usertype'] == 'student')? $user_details['level'] : \"\",\n );\n $excep = $this->pay_mdl->get_user_exceptions($excep_param, $scheduleid)['rs'];\n \n //set pay history parameter\n $pay_hist_param = array(\n \"scheduleid\" => $scheduleid,\n \"userid\" => $user_details['userid'],\n \"status\" => \"'APPROVED'\"\n );\n $my_pay_hist = $this->pay_mdl->gets('my_pay_history', $pay_hist_param );\n \n $data['my_paying'] = '';\n \n \n switch ($this->usertype) {\n case 'applicant':\n \n\n break;\n case 'student':\n $hist_perc = array();\n $tot = 0;\n $total_paid = 0;\n\n\n // Set User session parameters\n if(!$this->main->get('level')){\n\n $student_details = $this->pay_mdl->gets('student_details', $this->main->item('user_id'));\n\n $this->main->set('level', $student_details['level'] );\n $this->main->set('colid', $student_details['colid'] );\n $this->main->set('deptid', $student_details['deptid'] );\n $this->main->set('progid', $student_details['progid'] );\n $this->main->set('usertype', $student_details['usertype']);\n }\n\n\n //set pay history parameter\n $pay_hist_param = array(\n \"scheduleid\" => $scheduleid,\n \"userid\" => $this->main->item('user_id'),\n \"status\" => \"'APPROVED'\"\n );\n $my_pay_hist = $this->pay_mdl->gets('my_pay_history', $pay_hist_param );\n\n\n\n // get the total sum of last payment and percentage \n if(!empty($my_pay_hist)){\n\n foreach($my_pay_hist as $key => $val){\n\n $hist_perc[$key] = $my_pay_hist[$key]['percentage'];\n\n $tot = $tot + $my_pay_hist[$key]['percentage'];\n $total_paid = $total_paid + $my_pay_hist[$key]['amt'];\n } \n }\n\n // Get pay schedule base on the session_parameters\n $session_param = array( \n \"scheduleid\" => $scheduleid,\n \"level\" => $this->main->get('level'),\n \"colid\" => $this->main->get('colid'),\n \"deptid\" => $this->main->get('deptid'),\n \"progid\" => $this->main->get('progid'),\n \"usertype\" => $this->main->get('usertype')\n );\n\n\n\n $schedule = $this->pay_mdl->gets('pay_schedule', $session_param);\n\n //var_dump($schedule);\n\n /*\n * check if schedule have exceptions\n */\n if($schedule['exceptions'] == 'Yes'){\n\n $excep = $this->pay_mdl->gets('my_pay_exception', $session_param);\n\n if(is_array($excep) && !empty($excep)){\n\n foreach($excep as $key => $value){\n\n if($excep[$key]['unittype'] == 'programme'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break;\n\n }elseif($excep[$key]['unittype'] == 'department'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break;\n\n }elseif($excep[$key]['unittype'] == 'college'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break; \n } \n\n }\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => $to_pay[0]['exceptionid'],\n \"session_name\" => $to_pay[0]['sesname'],\n \"paying_amount\" => $to_pay[0]['ex_amount'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"session_id\" => $this->main->item('cur_session'),\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"adm_status\" => $to_pay[0]['admstatus'],\n \"level\" => $to_pay[0]['level'],\n \"payer_type\" => $to_pay[0]['payertype'],\n \"total_percent_paid\" => $tot,\n \"total_paid\" => $total_paid,\n \"revenue_head\" => $schedule['revhead']\n );\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n\n }else{\n\n $to_pay = array();\n array_push($to_pay, $schedule);\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => NULL,\n \"session_name\" => $to_pay[0]['sesname'],\n \"paying_amount\" => $to_pay[0]['amount'],\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"session_id\" => $this->main->item('cur_session'),\n \"adm_status\" => NULL,\n \"level\" => NULL,\n \"payer_type\" => NULL,\n \"total_percent_paid\" => $tot,\n \"revenue_head\" => $schedule['revhead']\n );\n\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n\n } // End of Exception is not Empty\n\n }else{\n\n $to_pay = array();\n array_push($to_pay, $schedule);\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => NULL,\n \"session_name\" => $to_pay[0]['sesname'],\n \"session_id\" => $this->main->item('cur_session'),\n \"paying_amount\" => $to_pay[0]['amount'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"adm_status\" => NULL,\n \"level\" => NULL,\n \"payer_type\" => NULL,\n \"total_percent_paid\" => $tot,\n \"revenue_head\" => $schedule['revhead']\n );\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n }//End of schedule Has Exception Check\n\n $data['my_paying'] = $my_paying;\n\n break;\n\n default:\n break;\n } \n \n \n \n \n \n \n \n $page_name = 'paynow';\n \n //build view page for pay Now \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n \n \n \n }", "public function index()\n\t{\n \t\t$action = $this->request->getData('action');\n\t\t$userID = $this->request->getData('personID');\n\t\t$deptcode = $this->request->getData('deptcode');\n\t\t$acyear = $this->request->getData('acyear');\n \t\n \t\tif (!empty($action) && in_array($action,['report','noreport'])) {\n \t \t\treturn $this->$action($userID,$deptcode,$acyear);\n \t}\n \telseif (!empty($action) && in_array($action,['admin'])) {//$this->Flash->success('USER: ' . print_r($user,true));\n return $this->$action($userID);\n }\n elseif (!empty($action) && in_array($action,['user_admin'])) {\n return $this->$action($userID);\n }\n elseif (!empty($action) && in_array($action,['save_user'])) {\n $data = $this->request->getData();\n return $this->$action($data);\n }\n elseif (!empty($action) && in_array($action,['delete_user'])) {\n $data = $this->request->getData();\n return $this->$action($data);\n\t\t}\n\t\telseif (!empty($action) && in_array($action, ['download_report'])) {\n return $this->$action();\n }\n elseif(!empty($action) && in_array($action, ['edit_user'])) {\n $user_id = $this->request->getData('user_id');\n return $this->$action($user_id);\n }\n elseif(!empty($action) && in_array($action, ['add_user'])) {\n return $this->$action();\n\t\t}\n\t\telseif (!empty($action) && in_array($action,['department_admin'])) {\n return $this->$action($userID);\n\t\t}\n elseif (!empty($action) && in_array($action,['save_department'])) {\n $data = $this->request->getData();\n return $this->$action($data);\n }\n elseif (!empty($action) && in_array($action,['delete_department'])) {\n $data = $this->request->getData();\n return $this->$action($data);\n }\n elseif(!empty($action) && in_array($action, ['edit_department'])) {\n $dept_code = $this->request->getData('dept_code');\n return $this->$action($dept_code);\n }\n elseif(!empty($action) && in_array($action, ['add_department'])) {\n return $this->$action();\n }\n elseif(!empty($action) && in_array($action, ['download_report'])) {\n return $this->$action();\n }\n\n \t\t// Otherwise continue\n\t\t$user = $this->getOxfordUserAndValidate();\n\t\t$user['is_admin'] = $this->check_secure();\n\t\tif ($this->request->is(['post','put'])) {\n\t\t\t$user = $this->HarassmentUsers->patchEntity($user, $this->request->getData());\n\t\t\t$this->Flash->success('USER: ' . print_r($user,true));\n \n if (!empty($user->action)) {\n //return $this->redirect([ '?' => [ 'a'=>($user->action == 'report'?'report':'noreport'), 'u'=>$user->userID, 'd'=>$user->deptcode, 'y'=>$user->acyear ] ]);\n $action = $user->action;\n \t if (!empty($action) && in_array($action,['report','noreport'])) {\n\t\t\t\t\treturn $this->$action($user->userID, $user->deptcode, $user->acyear);\n\t\t\t\t}\n /*\n if ($user->action == 'report') {\n return $this->redirect([ 'action' => 'report', $user->userID, $user->deptcode, $user->acyear ]);\n } else {\n return $this->redirect([ 'action' => 'noreport', $user->userID, $user->deptcode, $user->acyear ]);\n }\n //*/\n }\n\t\t}\n\t}", "public function actionAttendanceInView()\n {\n $no_days=new Query;\n $no_days->select('Days')->from('months')->where(['id'=>Yii::$app->request->queryParams['AttendanceInSearch'][\"Month\"]]);\n $_no_days = $no_days->all();\n $start=Yii::$app->request->queryParams['AttendanceInSearch'][\"Year\"].\"-\".add_zero(Yii::$app->request->queryParams['AttendanceInSearch'][\"Month\"]).\"-\".\"01\";\n $end=Yii::$app->request->queryParams['AttendanceInSearch'][\"Year\"].\"-\".add_zero(Yii::$app->request->queryParams['AttendanceInSearch'][\"Month\"]).\"-\".\"31\";\n \n $present_days=AttendanceIn::find()->where(['EmployeeId'=>Yii::$app->request->queryParams['AttendanceInSearch'][\"EmployeeId\"]])->andWhere(['and','Date>='.'\"'.$start.'\"','Date<='.'\"'.$end.'\"'])->all();\n $pst_days=[];\n foreach ($present_days as $pd) {\n $pst_days[$pd[\"Date\"]]=['InTime'=>$pd[\"Time\"],'OutTime'=>$pd[\"OutTime\"],\"Resolved\"=>(ChangeRequest::findOne(['RaisedEmpCode'=>Yii::$app->request->queryParams['AttendanceInSearch'][\"EmployeeId\"],'Date'=>$pd[\"Date\"]])[\"Resolved\"]),\"Attendance\"=>$pd['FirstHalf'].\"-\".$pd['SecondHalf'],\"Remark\"=>$pd['Remark']];\n \n }\n/* $attendance_criteria=[];\n foreach(TimeSlots::find()->all() as $ac){\n $attendance_criteria[$ac['id']]=['InTime'=>$ac['InTime'],'OutTime'=>$ac['OutTime'],'Grace'=>$ac['Grace'],'DeadOut'=>$ac['DeadOut'],'MaxDeadOutCount'=>$ac['MaxDeadOutCount']];\n }*/\n $leave_record=[];\n foreach(LeaveRequest::find()->where(['RaisedEmpId'=>Yii::$app->request->queryParams['AttendanceInSearch'][\"EmployeeId\"]])->andWhere(['and','Date>='.'\"'.$start.'\"','Date<='.'\"'.$end.'\"'])->all() as $lq){\n $leave_record[$lq['Date']]=$lq['Resolved'];\n }\n $month_off=MonthOff::find()->select([\"Dates\"])->where(['BranchId'=>Employee::findOne(['id'=>Yii::$app->request->queryParams['AttendanceInSearch'][\"EmployeeId\"]])->Branch])->andWhere(['Month'=>add_zero(Yii::$app->request->queryParams['AttendanceInSearch'][\"Month\"])])->andWhere(['Year'=>add_zero(Yii::$app->request->queryParams['AttendanceInSearch'][\"Year\"])])->all();\n if($month_off)\n $month_off=array_map('intval',explode(',',$month_off[0]['Dates'],-1));\n else\n $month_off=[];\n $searchModel = new AttendanceInSearch();\n return $this->render('attendance-in-view', [\n 'searchModel' => $searchModel,\n 'no_days'=>(int)$_no_days[0][\"Days\"],\n 'present_days'=>$pst_days,\n 'leave_record'=>$leave_record,\n 'month_off'=>$month_off,\n ]);\n }", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n\n $vendor = $this->input->post('cvendor');\n $cur = $this->input->post('ccurrency');\n \n $start = $this->input->post('start');\n $end = $this->input->post('end');\n $acc = $this->input->post('cacc');\n\n $data['currency'] = strtoupper($cur);\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n// $data['purchase_returns'] = $this->model->report($cur,$vendor,$start,$end,$acc)->result();\n \n $reports = null;\n foreach ($this->model->report($cur,$vendor,$start,$end,$acc)->result() as $res) {\n $reports[] = array (\"id\"=>$res->id, \n \"date\"=> tglin($res->dates),\n \"no\"=> \"PR-00\".$res->no,\n \"account\"=>floatval($res->price),\n \"vendor\"=>$res->prefix.' '.$res->name,\n \"amount\"=>floatval($res->total-$res->tax),\n \"tax\"=>floatval($res->tax),\n \"cost\"=>floatval($res->costs),\n \"balance\"=>floatval($res->total-$res->costs),\n \"status\"=> $this->xstatus($res->status)\n ); \n }\n \n $total = $this->model->total($cur,$vendor,$start,$end,$acc);\n $data['total'] = floatval($total['total'] - $total['tax']);\n $data['tax'] = floatval($total['tax']);\n $data['costs'] = floatval($total['costs']);\n $data['balance'] = floatval($total['total'] + $total['costs']);\n $data['items'] = $reports;\n \n $this->output = $data;\n \n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response('content');\n \n }", "private function reportIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u','groups','group','g');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\");\n\n if( !is_numeric($request['flag_type']) )\n throw_error_msg(\"flag type not provided\"); \n \n $type = strtolower($request['type']);\n $id = $request['id'];\n switch($type)\n {\n case 'v':\n case 'video':\n case 'videos':\n default:\n {\n global $cbvideo; \n $cbvideo->action->report_it($id);\n }\n break;\n\n case 'g':\n case 'group':\n case 'groups':\n {\n global $cbgroup;\n $cbgroup->action->report_it($id);\n }\n break;\n\n case 'u':\n case 'user':\n case 'users':\n {\n global $userquery;\n $userquery->action->report_it($id);\n }\n break;\n\n case 'p':\n case 'photo':\n case 'photos':\n {\n global $cbphoto;\n $cbphoto->action->report_it($id);\n }\n break;\n\n case \"cl\":\n case \"collection\":\n case \"collections\":\n {\n global $cbcollection;\n $cbcollection->action->report_it($id);\n }\n break;\n\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $msg = msg_list();\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $msg[0]);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "public function dailyLog()\n\t{\n\t\t$from = Input::get('start');\n\t\t$to = Input::get('end');\n\t\t$pendingOrAll = Input::get('pending_or_all');\n\t\t$error = '';\n\t\t$accredited = array();\n\t\t//\tCheck radiobutton for pending/all tests is checked and assign the 'true' value\n\t\tif (Input::get('tests') === '1') {\n\t\t $pending='true';\n\t\t}\n\t\t$date = date('Y-m-d');\n\t\tif(!$to){\n\t\t\t$to=$date;\n\t\t}\n\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\t\t$records = Input::get('records');\n\t\t$testCategory = Input::get('section_id');\n\t\t$testType = Input::get('test_type');\n\t\t$labSections = TestCategory::lists('name', 'id');\n\t\tif($testCategory)\n\t\t\t$testTypes = TestCategory::find($testCategory)->testTypes->lists('name', 'id');\n\t\telse\n\t\t\t$testTypes = array(\"\"=>\"\");\n\t\t\n\t\tif($records=='patients'){\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$visits = Visit::whereBetween('created_at', array($from, $toPlusOne))->get();\n\t\t\t\t}\n\t\t\t\tif (count($visits) == 0) {\n\t\t\t\t \tSession::flash('message', trans('messages.no-match'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$visits = Visit::where('created_at', 'LIKE', $date.'%')->orderBy('patient_id')->get();\n\t\t\t}\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_visits_log_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportPatientLog')\n\t\t\t\t\t\t\t\t->with('visits', $visits)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn View::make('reports.daily.patient')\n\t\t\t\t\t\t\t\t->with('visits', $visits)\n\t\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t\t//Begin specimen rejections\n\t\telse if($records=='rejections')\n\t\t{\n\t\t\t$specimens = Specimen::where('specimen_status_id', '=', Specimen::REJECTED);\n\t\t\t/*Filter by test category*/\n\t\t\tif($testCategory&&!$testType){\n\t\t\t\t$specimens = $specimens->join('tests', 'specimens.id', '=', 'tests.specimen_id')\n\t\t\t\t\t\t\t\t\t ->join('test_types', 'tests.test_type_id', '=', 'test_types.id')\n\t\t\t\t\t\t\t\t\t ->where('test_types.test_category_id', '=', $testCategory);\n\t\t\t}\n\t\t\t/*Filter by test type*/\n\t\t\tif($testCategory&&$testType){\n\t\t\t\t$specimens = $specimens->join('tests', 'specimens.id', '=', 'tests.specimen_id')\n\t\t\t\t \t\t\t\t\t ->where('tests.test_type_id', '=', $testType);\n\t\t\t}\n\n\t\t\t/*Filter by date*/\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$specimens = $specimens->whereBetween('time_rejected', \n\t\t\t\t\t\tarray($from, $toPlusOne))->get(array('specimens.*'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$specimens = $specimens->where('time_rejected', 'LIKE', $date.'%')->orderBy('id')\n\t\t\t\t\t\t\t\t\t\t->get(array('specimens.*'));\n\t\t\t}\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_rejected_specimen_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportSpecimenLog')\n\t\t\t\t\t\t\t\t->with('specimens', $specimens)\n\t\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn View::make('reports.daily.specimen')\n\t\t\t\t\t\t\t->with('labSections', $labSections)\n\t\t\t\t\t\t\t->with('testTypes', $testTypes)\n\t\t\t\t\t\t\t->with('specimens', $specimens)\n\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t\t//Begin test records\n\t\telse\n\t\t{\n\t\t\t$tests = Test::whereNotIn('test_status_id', [Test::NOT_RECEIVED]);\n\t\t\t\n\t\t\t/*Filter by test category*/\n\t\t\tif($testCategory&&!$testType){\n\t\t\t\t$tests = $tests->join('test_types', 'tests.test_type_id', '=', 'test_types.id')\n\t\t\t\t\t\t\t ->where('test_types.test_category_id', '=', $testCategory);\n\t\t\t}\n\t\t\t/*Filter by test type*/\n\t\t\tif($testType){\n\t\t\t\t$tests = $tests->where('test_type_id', '=', $testType);\n\t\t\t}\n\t\t\t/*Filter by all tests*/\n\t\t\tif($pendingOrAll=='pending'){\n\t\t\t\t$tests = $tests->whereIn('test_status_id', [Test::PENDING, Test::STARTED]);\n\t\t\t}\n\t\t\telse if($pendingOrAll=='all'){\n\t\t\t\t$tests = $tests->whereIn('test_status_id', \n\t\t\t\t\t[Test::PENDING, Test::STARTED, Test::COMPLETED, Test::VERIFIED]);\n\t\t\t}\n\t\t\t//For Complete tests and the default.\n\t\t\telse{\n\t\t\t\t$tests = $tests->whereIn('test_status_id', [Test::COMPLETED, Test::VERIFIED]);\n\t\t\t}\n\t\t\t/*Get collection of tests*/\n\t\t\t/*Filter by date*/\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tests = $tests->whereBetween('time_created', array($from, $toPlusOne))->get(array('tests.*'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tests = $tests->where('time_created', 'LIKE', $date.'%')->get(array('tests.*'));\n\t\t\t}\n\t\t\t\t\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_test_records_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportTestLog')\n\t\t\t\t\t\t\t\t->with('tests', $tests)\n\t\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t\t->with('pendingOrAll', $pendingOrAll)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn View::make('reports.daily.test')\n\t\t\t\t\t\t\t->with('labSections', $labSections)\n\t\t\t\t\t\t\t->with('testTypes', $testTypes)\n\t\t\t\t\t\t\t->with('tests', $tests)\n\t\t\t\t\t\t\t->with('counts', $tests->count())\n\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t->with('pendingOrAll', $pendingOrAll)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t}", "public function tms_report_count() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['pStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayTextCount = \"Total Paid Trainees : \";\n $export_url = '?pStatus=1';\n } else if ($_POST['pStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayTextCount = \"Total Unpaid Trainees : \";\n $export_url = '?payStatus=2';\n }\n \n $year = $_POST['yVal'];\n $month = $_POST['mVal'];\n \n $training_score1 = $_POST['tStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['pStatus'] == '1') {\n $data_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $paidVal1 = $this->calculate_paid($data_res);\n $count=count($data_res);\n $displayTextCount = 'Total Amount Received : ';\n } else if ($_POST['pStatus'] == '2') {\n $data_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $amount_due = $data_res[0]->total_amount_due;\n $paidVal1 = $amount_due;\n $count=$data_res[0]->count;\n $displayTextCount = 'Total Amount Pending : ';\n } else if ($_POST['pStatus'] == '3'){\n $payment_status2 = \"PAID','PARTPAID\";\n $payment_status1 = \"NOTPAID','PARTPAID\";\n $data1_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status1, $year, $month, $training_score);\n $data2_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status2, $year, $month, $training_score);\n $amount_due = $data1_res[0]->total_amount_due;\n $paid_amout = $this->calculate_paid($data2_res);\n $count = ($data1_res[0]->count)+count($data2_res);\n $displayTextCount = \"Total Paid + Unpaid Amount : \";\n \n $paidVal1 =$amount_due + $paid_amout;\n \n }\n \n }\n \n $data['text1'] = 'Total Trainee: '.$count;\n $data['amount1'] = $displayTextCount.$paidVal1;\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "public function vbd_report_other_datewise()\n\t\t{\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/nav');\n\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t$this->load->view('reports/vbd_report_other_datewise',$data);\t\t\n\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "public function reportMonthlyAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function admin_export_new_patientsdone($id=NULL) // template for new classes\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n\t\t$data['title'] = \"Exported New Patients\";\r\n $data['now_id'] = time();\r\n $export_when = $data['now_id'];\r\n $export_by = $_SESSION['staff_id'];\r\n $data['baseurl'] = base_url();\r\n\r\n $data['exploded_baseurl'] = explode('/', $data['baseurl'], 4);\r\n $data['app_folder'] = substr($data['exploded_baseurl'][3], 0, -1);\r\n $data['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'];\r\n if(substr($data['DOCUMENT_ROOT'],-1) === \"/\"){\r\n // Do nothing\r\n } else {\r\n // Add a slash\r\n $data['DOCUMENT_ROOT'] = $data['DOCUMENT_ROOT'].'/';\r\n }\r\n $data['app_path'] = $data['DOCUMENT_ROOT'].$data['app_folder'];\r\n $data['export_path'] = $data['app_path'].\"-uploads/exports_patient\";\r\n \r\n $version_file_path = $data['app_path'].\"/app_thirra/version.txt\";\r\n $handle = fopen($version_file_path, \"r\");\r\n $app_version = fread($handle, filesize($version_file_path));\r\n fclose($handle);\r\n\r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['form_purpose'] = $_POST['form_purpose'];\r\n $data['num_rows'] = $_POST['num_rows'];\r\n\t\t\t$xmlstr = \"<?xml version='1.0'?>\";\r\n\t\t\t$xmlstr .= \"\\n<THIRRA_export_patients>\";\r\n $xmlstr .= \"\\n\\t<export_info>\";\r\n $xmlstr .= \"\\n\\t\\t<export_by>$export_by</export_by>\";\r\n $xmlstr .= \"\\n\\t\\t<export_when>$export_when</export_when>\";\r\n $xmlstr .= \"\\n\\t\\t<thirra_version>$app_version</thirra_version>\";\r\n $xmlstr .= \"\\n\\t</export_info>\";\r\n\t\t\t$selected\t\t=\t1;\r\n\t\t\tfor($i=1; $i<=$data['num_rows']; $i++){\r\n\t\t\t\t// Only retrieve if selected by user\r\n\t\t\t\tif(isset($_POST['s'.$i])){\r\n\t\t\t\t\t$data['unsynched_list'][$selected]['number']\t= $i;\r\n\t\t\t\t\t$data['unsynched_list'][$selected]['value']\t= $_POST['s'.$i];\r\n\t\t\t\t\t$data['unsynched_list'][$selected]['patient_info'] \r\n\t\t\t\t\t\t= $this->memr_rdb->get_patient_details($data['unsynched_list'][$selected]['value']);\r\n\t\t\t\t\t$patient_id \t= $data['unsynched_list'][$selected]['patient_info']['patient_id'];\r\n\t\t\t\t\t$patient_name \t= $data['unsynched_list'][$selected]['patient_info']['patient_name'];\r\n\t\t\t\t\t$name_first \t= $data['unsynched_list'][$selected]['patient_info']['name_first'];\r\n\t\t\t\t\t$name_alias \t= $data['unsynched_list'][$selected]['patient_info']['name_alias'];\r\n\t\t\t\t\t$gender \t\t= $data['unsynched_list'][$selected]['patient_info']['gender'];\r\n\t\t\t\t\t$ic_no \t\t\t= $data['unsynched_list'][$selected]['patient_info']['ic_no'];\r\n\t\t\t\t\t$ic_other_type = $data['unsynched_list'][$selected]['patient_info']['ic_other_type'];\r\n\t\t\t\t\t$ic_other_no \t= $data['unsynched_list'][$selected]['patient_info']['ic_other_no'];\r\n\t\t\t\t\t$nationality \t= $data['unsynched_list'][$selected]['patient_info']['nationality'];\r\n\t\t\t\t\t$birth_date \t= $data['unsynched_list'][$selected]['patient_info']['birth_date'];\r\n\t\t\t\t\t$clinic_reference_number = $data['unsynched_list'][$selected]['patient_info']['clinic_reference_number'];\r\n\t\t\t\t\t$pns_pat_id \t= $data['unsynched_list'][$selected]['patient_info']['pns_pat_id'];\r\n\t\t\t\t\t$nhfa_no \t\t= $data['unsynched_list'][$selected]['patient_info']['nhfa_no'];\r\n\t\t\t\t\t$ethnicity \t\t= $data['unsynched_list'][$selected]['patient_info']['ethnicity'];\r\n\t\t\t\t\t$religion \t\t= $data['unsynched_list'][$selected]['patient_info']['religion'];\r\n\t\t\t\t\t$marital_status = $data['unsynched_list'][$selected]['patient_info']['marital_status'];\r\n\t\t\t\t\t$patient_type \t= $data['unsynched_list'][$selected]['patient_info']['patient_type'];\r\n\t\t\t\t\t$blood_group \t= $data['unsynched_list'][$selected]['patient_info']['blood_group'];\r\n\t\t\t\t\t$blood_rhesus \t= $data['unsynched_list'][$selected]['patient_info']['blood_rhesus'];\r\n\t\t\t\t\t$demise_date \t= $data['unsynched_list'][$selected]['patient_info']['demise_date'];\r\n\t\t\t\t\t$demise_time \t= $data['unsynched_list'][$selected]['patient_info']['demise_time'];\r\n\t\t\t\t\t$demise_cause \t= $data['unsynched_list'][$selected]['patient_info']['demise_cause'];\r\n\t\t\t\t\t$clinic_home \t= $data['unsynched_list'][$selected]['patient_info']['clinic_home'];\r\n\t\t\t\t\t$clinic_registered = $data['unsynched_list'][$selected]['patient_info']['clinic_registered'];\r\n\t\t\t\t\t$status = $data['unsynched_list'][$selected]['patient_info']['status'];\r\n\t\t\t\t\t$contact_id \t= $data['unsynched_list'][$selected]['patient_info']['contact_id'];\r\n\t\t\t\t\t$start_date \t= $data['unsynched_list'][$selected]['patient_info']['start_date'];\r\n\t\t\t\t\t$patient_address = $data['unsynched_list'][$selected]['patient_info']['patient_address'];\r\n\t\t\t\t\t$patient_address2 = $data['unsynched_list'][$selected]['patient_info']['patient_address2'];\r\n\t\t\t\t\t$patient_address3 = $data['unsynched_list'][$selected]['patient_info']['patient_address3'];\r\n\t\t\t\t\t$patient_town \t= $data['unsynched_list'][$selected]['patient_info']['patient_town'];\r\n\t\t\t\t\t$patient_postcode = $data['unsynched_list'][$selected]['patient_info']['patient_postcode'];\r\n\t\t\t\t\t$patient_state \t= $data['unsynched_list'][$selected]['patient_info']['patient_state'];\r\n\t\t\t\t\t$patient_country = $data['unsynched_list'][$selected]['patient_info']['patient_country'];\r\n\t\t\t\t\t$tel_home \t\t= $data['unsynched_list'][$selected]['patient_info']['tel_home'];\r\n\t\t\t\t\t$tel_office \t= $data['unsynched_list'][$selected]['patient_info']['tel_office'];\r\n\t\t\t\t\t$tel_mobile \t= $data['unsynched_list'][$selected]['patient_info']['tel_mobile'];\r\n\t\t\t\t\t$fax_no \t\t= $data['unsynched_list'][$selected]['patient_info']['fax_no'];\r\n\t\t\t\t\t$email \t\t\t= $data['unsynched_list'][$selected]['patient_info']['email'];\r\n\t\t\t\t\t$addr_village_id \t= $data['unsynched_list'][$selected]['patient_info']['addr_village_id'];\r\n\t\t\t\t\t$addr_area_id \t= $data['unsynched_list'][$selected]['patient_info']['addr_area_id'];\r\n\t\t\t\t\t$staff_id \t\t= $data['unsynched_list'][$selected]['patient_info']['staff_id'];\r\n\t\t\t\t\t$synch_out \t\t= $data['unsynched_list'][$selected]['patient_info']['synch_out'];\r\n\t\t\t\t\t$synch_remarks \t\t= $data['unsynched_list'][$selected]['patient_info']['synch_remarks'];\r\n\t\t\t\t\t$xmlstr .= \"\\n<patient_info patient_id='$patient_id'>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_id>$patient_id</patient_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_name>$patient_name</patient_name>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<name_first>$name_first</name_first>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<name_alias>$name_alias</name_alias>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<gender>$gender</gender>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<ic_no>$ic_no</ic_no>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<ic_other_type>$ic_other_type</ic_other_type>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<ic_other_no>$ic_other_no</ic_other_no>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<nationality>$nationality</nationality>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<birth_date>$birth_date</birth_date>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<clinic_reference_number>$clinic_reference_number</clinic_reference_number>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<pns_pat_id>$pns_pat_id</pns_pat_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<nhfa_no>$nhfa_no</nhfa_no>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<ethnicity>$ethnicity</ethnicity>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<religion>$religion</religion>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<marital_status>$marital_status</marital_status>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_type>$patient_type</patient_type>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<blood_group>$blood_group</blood_group>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<blood_rhesus>$blood_rhesus</blood_rhesus>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<demise_date>$demise_date</demise_date>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<demise_time>$demise_time</demise_time>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<demise_cause>$demise_cause</demise_cause>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<clinic_home>$clinic_home</clinic_home>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<clinic_registered>$clinic_registered</clinic_registered>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<status>$status</status>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<contact_id>$contact_id</contact_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<start_date>$start_date</start_date>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_address>$patient_address</patient_address>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_address2>$patient_address2</patient_address2>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_address3>$patient_address3</patient_address3>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_town>$patient_town</patient_town>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_postcode>$patient_postcode</patient_postcode>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_state>$patient_state</patient_state>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<patient_country>$patient_country</patient_country>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<tel_home>$tel_home</tel_home>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<tel_office>$tel_office</tel_office>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<tel_mobile>$tel_mobile</tel_mobile>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<fax_no>$fax_no</fax_no>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<email>$email</email>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<addr_village_id>$addr_village_id</addr_village_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<addr_area_id>$addr_area_id</addr_area_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<staff_id>$staff_id</staff_id>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<synch_out>$synch_out</synch_out>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n\\t<synch_remarks>$synch_remarks</synch_remarks>\";\r\n\t\t\t\t\t$xmlstr .= \"\\n</patient_info>\";\r\n\t\t\t\t\t$selected++;\r\n\t\t\t\t} //endif(isset($_POST['s'.$i]))\r\n\t\t\t} //endfor($i=1; $i<=$data['num_rows']; $i++)\r\n\t\t} //endif(count($_POST))\r\n\t\t$data['file_exported']\t\t=\t\"patient_demo-\".date(\"Ymd_Hi\",$data['now_id']).\".xml\";\r\n\t\t$data['xmlstr']\t\t\t\t=\t$xmlstr;\r\n\t\t$xmlstr .= \"\\n</THIRRA_export_patients>\";\r\n\t\t$xml = new SimpleXMLElement($xmlstr);\r\n\r\n\t\t//echo $xml->asXML();\r\n\t\t$write = $xml->asXML($data['export_path'].\"/\".$data['file_exported']);\r\n\r\n\t\t//echo $xml->patient_info[1]->patient_name;\r\n\t\t// ========\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_emr_wap\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_wap\";\r\n $new_body = \"ehr/emr_newpage_wap\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_export_new_patientsdone_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n }", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "function GenerarReporteOficinas(){\t//consultar estudiantes registrados por municipio\t\n\n\t\t\t$html=\"\";\n\t\t\t$strsql=\"SELECT pasantias.departamento.estado, pasantias.oficina.nombre_oficina, pasantias.departamento.descripcion FROM pasantias.oficina , pasantias.departamento WHERE\n\n \t\t\t\t\toficina.id_departamento = departamento.id_departamento\";\t \n\t\t\t\t \n\t\t\t$rs=pg_query($strsql);\n\t\t\t$num=0;\n\t\t\t$num=pg_num_rows($rs);\n\t\t\n\n\n\t\t\t$html=$html.'<div align=\"center\">\n\t\t\t<h2>Reporte De Especialidades</h2>\n\t\t\t<h3>Total de registros: &nbsp; <i>'.$num.'</i></h3>\n\t\t\t\n\t\t\t<br><br>\n\t\t\t';\n\t\t\t/*$html=$html.'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n\t\t\t<table style=\"border-spacing: 2px;\" align=\"center\" >\n\t\t\t<tr align=\"center\" bgcolor=\"#011137\" border=\"1\" style=\"color: #000000;\">\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Id</font></td>\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Nombre</font></td>\n\t\t\t\t\n\t\t\t\t</tr>';*/\n\n\n\t\t\t\t$html=$html.'<div align=\"center\">\t\t\t\n\t\t\t<table border=\"0\" bordercolor=\"#0000CC\" bordercolordark=\"#FF0000\">';\t\n\t\t\t$html=$html.'<tr bgcolor=\"#0B3861\">\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> N&oacute;mbre Oficina </b></font></td>\n\t\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Descripción </b></font></td>\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Estado </b></font></td>\n\t\t\t</tr>';\n\n\t\t\t\n\t\t\t\t\n\t\t\t\twhile ($row = pg_fetch_array($rs)){\n\n\t\t\t\t\n\t\t\t\tif($i%2==0){\n\t\t\t\t\t$html= $html.'<tr bgcolor=\"#58ACFA\">';\n\t\t\t\t}else{\n\t\t\t\t\t$html=$html.'<tr>';\n\t\t\t\t}\n\t\t\t\t$html = $html.'<td>';\n\t\t\t\t$html = $html. $row[\"nombre_oficina\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"descripcion\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"estado\"];\n\t\t\t\t$html = $html.'</td></tr>';\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\t\t\t$html=$html.'</table></div>';\t\t\t\n \t\t return ($html);\n\t\t}", "function GenerarReporteOficinas(){\t//consultar estudiantes registrados por municipio\t\n\n\t\t\t$html=\"\";\n\t\t\t$strsql=\"SELECT pasantias.departamento.estado, pasantias.oficina.nombre_oficina, pasantias.departamento.descripcion FROM pasantias.oficina , pasantias.departamento WHERE\n\n \t\t\t\t\toficina.id_departamento = departamento.id_departamento\";\t \n\t\t\t\t \n\t\t\t$rs=pg_query($strsql);\n\t\t\t$num=0;\n\t\t\t$num=pg_num_rows($rs);\n\t\t\n\n\n\t\t\t$html=$html.'<div align=\"center\">\n\t\t\t<h2>Reporte De Especialidades</h2>\n\t\t\t<h3>Total de registros: &nbsp; <i>'.$num.'</i></h3>\n\t\t\t\n\t\t\t<br><br>\n\t\t\t';\n\t\t\t/*$html=$html.'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n\t\t\t<table style=\"border-spacing: 2px;\" align=\"center\" >\n\t\t\t<tr align=\"center\" bgcolor=\"#011137\" border=\"1\" style=\"color: #000000;\">\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Id</font></td>\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Nombre</font></td>\n\t\t\t\t\n\t\t\t\t</tr>';*/\n\n\n\t\t\t\t$html=$html.'<div align=\"center\">\t\t\t\n\t\t\t<table border=\"0\" bordercolor=\"#0000CC\" bordercolordark=\"#FF0000\">';\t\n\t\t\t$html=$html.'<tr bgcolor=\"#0B3861\">\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> N&oacute;mbre Oficina </b></font></td>\n\t\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Descripción </b></font></td>\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Estado </b></font></td>\n\t\t\t</tr>';\n\n\t\t\t\n\t\t\t\t\n\t\t\t\twhile ($row = pg_fetch_array($rs)){\n\n\t\t\t\t\n\t\t\t\tif($i%2==0){\n\t\t\t\t\t$html= $html.'<tr bgcolor=\"#58ACFA\">';\n\t\t\t\t}else{\n\t\t\t\t\t$html=$html.'<tr>';\n\t\t\t\t}\n\t\t\t\t$html = $html.'<td>';\n\t\t\t\t$html = $html. $row[\"nombre_oficina\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"descripcion\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"estado\"];\n\t\t\t\t$html = $html.'</td></tr>';\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\t\t\t$html=$html.'</table></div>';\t\t\t\n \t\t return ($html);\n\t\t}", "public function invoice_audit_trail_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n //Build required values to display invoice audit report in table format\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_invoice_audit_trail($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n\n //EXPORT PART\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Inv Dt.', 'Inv Type', 'Taxcode', 'Discount', 'Subsidy', 'GST', 'Net Amt.', 'Prev. Inv. Number', 'Next Inv. Number');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $paid_arr = array('PAID' => 'Paid', 'PARTPAID' => 'Part Paid', 'NOTPAID' => 'Not Paid');\n $paid_sty_arr = array('PAID' => 'color:green;', 'PARTPAID' => 'color:red;', 'NOTPAID' => 'color:red;');\n if ($tabledata[$i]->enrolment_mode == 'SELF') {\n $taxcode = $tabledata[$i]->tax_code;\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n $status = $paid_arr[$tabledata[$i]->payment_status];\n } else {\n // Modified by dummy for internal staff enroll on 01 Dec 2014.\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name;\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name;\n }\n $status = ($tabledata[$i]->payment_status > 0) ? 'Part Paid/Not Paid' : 'Paid';\n }\n $inv_type1 = $tabledata[$i]->inv_type1 . ' (' . $name . ')';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = $inv_type1;\n $excel_data[$i][] = $this->mask_format($taxcode);\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_discnt, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_subsdy, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_gst, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '') . ' SGD';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = $tabledata[$i]->regen_inv_id;\n }\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n $excel_filename = 'invlice_audit_list.xls';\n $excel_sheetname = 'Invoice Audit Trail';\n $excel_main_heading = 'Accounting Reports - Invoice Audit Trail' . $period;\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function finalreportcreate() {\n $supervisaornames = DB::select(\"SELECT name,id \n\t\t FROM panelmembers\n\t\t WHERE id = any (SELECT supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* Get all group ids */\n $groupids = DB::select(\"SELECT groupID \n\t\t FROM research_groups\");\n\n /* Get all student actual id acording to the auto generated id */\n $studentid = DB::select(\"SELECT id,regId \n\t\t FROM students\n\t\t WHERE id = any (SELECT studentId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* filtering projects according to the groups */\n $students = DB::select(\"SELECT id,title,studentId,supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved' and groupID = any (SELECT groupID \n\t\t FROM research_groups)\");\n\n $los = DB::table('settings')->first();\n\n return view('supevaluation.finalreportevaluation', compact('students', 'supervisaornames', 'studentid', 'groupids', 'los'));\n }", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "public function actionCollectorReport() {\n /*Get result using model method*/\n $result = [\n ['a', 'b', 'c',],\n [1, 2, 3,],\n ];\n\n $fileName = 'debtorList' . date('Y-m-d');\n $this->createCSV($result, $fileName);\n\n //$subscribers = Subscriber::getSubscribers('collector');\n //$this->actionSendReport($fileName, $subscribers);\n\n }", "public function reportPeriodicStudentPresentListView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $date_form = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($date_form));\n $date_to = trim($request->to); \n $date_too = trim($request->to);\n $to = date (\"Y-m-d\", strtotime($date_to));\n $sorting_type = trim($request->sorting_type);\n $attendent_days = trim($request->attendent_days);\n\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n // total day caluclation\n $date1 = date_create($from);\n $date2 = date_create($to);\n //difference between two dates\n $diff = date_diff($date1,$date2);\n $total_day = $diff->format(\"%a\")+1;\n if($sorting_type == '1'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }elseif($sorting_type == '2'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('count','DESC')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }elseif($sorting_type == '3'){\n $result = DB::table('student_attendent')\n ->join('students','student_attendent.studentId','=','students.id')\n ->join('student','students.id','=','student.studentID')\n ->select('student_attendent.*','student.roll','student.registration', DB::raw(\"COUNT( DISTINCT student_attendent.created_at) AS count\"))\n ->where('student_attendent.year',$year)\n ->where('student_attendent.shift_id',$shift)\n ->where('student_attendent.dept_id',$dept)\n ->where('student_attendent.semister_id',$semister)\n ->where('student_attendent.section_id',$section)\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereBetween('student_attendent.created_at', [$from, $to])\n ->groupBy('student_attendent.studentId')\n ->orderBy('count','DESC')\n ->orderBy('student_attendent.studentId','ASC')\n ->get();\n }\n\n foreach($result as $value) {\n //do something\n $attentdent_id[] = $value->studentId;\n}\n$absent_result = DB::table('students')\n ->join('student', 'students.id', '=', 'student.studentID')\n ->select('student.*', 'students.studentName','students.studentMobile','students.studentImage','student.registration')\n ->where('student.year',$year)\n ->where('student.shift_id',$shift)\n ->where('student.dept_id',$dept)\n ->where('student.semister_id',$semister)\n ->where('student.section_id',$section)\n ->whereNotIn('student.studentID',$attentdent_id)\n ->orderBy('student.roll','asc')\n ->get();\n\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n return view('view_report.reportPeriodicStudentPresentListView')->with('result',$result)->with('count_holiday',$count_holiday)->with('total_day',$total_day)->with('from',$from)->with('to',$to)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('shift',$shift)->with('dept',$dept)->with('semister',$semister)->with('section',$section)->with('date_form',$date_form)->with('date_to',$date_to)->with('absent_result',$absent_result)->with('attendent_days',$attendent_days)->with('sorting_type',$sorting_type); \n\n\n\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "public function ctrreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t\t$productname='本周'.$productname;\t\t\t\t \n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_name . time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('ctrreports') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function dispAttendence ($class_id,$stud_id)\n\t{\n\t\t\t$year_id = $this->getYear();\n\n\t\t\t$total_days_query = \"SELECT * FROM `edu_attendence` WHERE ac_year='$year_id' AND class_id='$class_id'\";\n\t\t\t$total_days_res = $this->db->query($total_days_query);\n\t\t\t$total_days_result= $total_days_res->result();\n\t\t\t$total_days_count = $total_days_res->num_rows();\n\n\t\t\tif($total_days_res->num_rows()==0){\n\t\t\t\t $response = array(\"status\" => \"error\", \"msg\" => \"Attendance not yet taken!\");\n\t\t\t}else{\n\t\t\t // $total_days = $total_days_count/2;\n\t\t\t $total_days = $total_days_count;\n\n\t\t\t foreach($total_days_result as $rows){\n \t\t\t\t$at_id = $rows->at_id;\n\t\t\t }\n\n \t\t\t$absent_query = \"SELECT * FROM `edu_attendance_history` WHERE class_id='$class_id' AND student_id='$stud_id' AND a_status = 'A' \";\n \t\t\t$absent_res = $this->db->query($absent_query);\n \t\t\t$absent_result= $absent_res->result();\n \t\t\t$absent_count = $absent_res->num_rows();\n\n \t\t\tif($absent_res->num_rows()>0){\n \t\t\t\t//$absent_days = $absent_count/2;\n \t\t\t\t$absent_days = $absent_count;\n \t\t\t} else {\n \t\t\t $absent_days = 0;\n \t\t\t}\n\n \t\t\t$leave_query = \"SELECT * FROM `edu_attendance_history` WHERE class_id='$class_id' AND student_id='$stud_id' AND a_status = 'L' \";\n \t\t\t$leave_res = $this->db->query($leave_query);\n \t\t\t$leave_result= $leave_res->result();\n \t\t\t$leave_count = $leave_res->num_rows();\n\n \t\t\tif($leave_res->num_rows()>0){\n \t\t\t\t //$leave_days = $leave_count/2;\n \t\t\t\t $leave_days = $leave_count;\n \t\t\t} else {\n \t\t\t $leave_days = 0;\n \t\t\t}\n\n \t\t\t$od_query = \"SELECT * FROM `edu_attendance_history` WHERE class_id='$class_id' AND student_id='$stud_id' AND a_status = 'OD' \";\n \t\t\t$od_res = $this->db->query($od_query);\n \t\t\t$od_result= $od_res->result();\n \t\t\t$od_count = $od_res->num_rows();\n\n \t\t\tif($od_res->num_rows()>0){\n \t\t\t\t //$od_days = $od_count/2;\n \t\t\t\t $od_days = $od_count;\n \t\t\t} else {\n \t\t\t $od_days = 0;\n \t\t\t}\n\t\t\t $total_leave = $absent_days+$leave_days+$od_days;\n\t\t\t $present_days = $total_days-$total_leave;\n\n\t\t\t \t$attendence_history = array(\"total_working_days\"=>$total_days, \"absent_days\"=>$absent_days, \"leave_days\"=>$leave_days, \"od_days\"=>$od_days, \"present_days\"=>$present_days);\n\n \t\t\t$attend_query = \"SELECT\n COUNT(B.abs_date) AS abs_count,\n A.at_id,\n B.student_id,\n B.abs_date,\n B.a_status\n FROM\n edu_attendence A,\n edu_attendance_history B\n WHERE\n A.ac_year = '$year_id' AND B.class_id = '$class_id' AND B.student_id = '$stud_id' AND B.attend_id = A.at_id\n GROUP BY\n B.abs_date\";\n \t\t\t$attend_res = $this->db->query($attend_query);\n \t\t\t$attend_result= $attend_res->result();\n \t\t\t$attend_count = $attend_res->num_rows();\n\n \t\t\t if($attend_res->num_rows()==0){\n \t\t\t\t $response = array(\"status\" => \"success\", \"msg\" => \"View Attendence\",\"attendenceHistory\"=>$attendence_history, \"attendenceDetails\"=>$attend_result);\n \t\t\t}else{\n \t\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"View Attendence\",\"attendenceHistory\"=>$attendence_history, \"attendenceDetails\"=>$attend_result);\n \t\t\t}\n\t\t\t}\n\t\t\treturn $response;\n\t}", "public function reportMonthlyClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function actionReporting() {\n $result = array();\n $result['TOTAL_RAISED'] = $this->query(\"SELECT SUM(amount) as count from user_fund_project where status='SUCCESS'\");\n $result['SUCCESSFULLY_FUNDED_CAMPAIGNS'] = $this->query(\"SELECT COUNT(*) as count from project where project_status='success' \");\n $result['CAMPAIGNS_LOVED'] = $this->query(\" SELECT COUNT(distinct project_id) FROM user_love_project\");\n $result['TOTAL_BACKERS'] = $this->query(\" SELECT COUNT(distinct user_id) FROM user_fund_project where status='SUCCESS'\");\n $result['REPEAT_BACKERS'] = $this->query(\" select count(count) as total from (select count(*) as count from user_fund_project where status='success' group by user_id having( count)>1) as a\");\n $result['TOTAL_PLEDGES'] = $this->query(\" SELECT COUNT(*) FROM reward \");\n $result['AVERAGE_PLEDGE_VALUE'] = $this->query(\" SELECT AVG(amount) FROM user_fund_project where status='SUCCESS'\");\n $result['TOTAL_LAUNCHED'] = $this->query(\" SELECT COUNT(*) FROM project WHERE publish_status = 'published' \");\n $result['UNSUCCESSFUL'] = $this->query(\" SELECT COUNT(*) FROM project WHERE project_status = 'failed' \");\n $result['DRAFT'] = $this->query(\" SELECT COUNT(*) FROM project WHERE publish_status = 'draft' \");\n $result['FIXED'] = $this->query(\" SELECT COUNT(*) FROM project WHERE funding_type = 'fixed' \");\n $result['FLEXIBLE'] = $this->query(\" SELECT COUNT(*) FROM project WHERE funding_type = 'flexible' \");\n $result['NO_OF_MEMBERS'] = $this->query(\" SELECT COUNT(*) FROM tribes \");\n $result['ACTIVE_MEMBERS'] = $this->query(\" SELECT COUNT(*) FROM tribes where status = 'ACTIVE' \");\n $result['NO_OF_ABANDONED_CART'] = $this->query(\" SELECT COUNT(*) FROM user_fund_project where status='FAILED'\");\n \n// CHART DATA\n $total_projects = (int)$this->query(\" select count(*) from project \");\n $success_projects = (int)$this->query(\" select count(*) from project where project_status = 'success' \"); \n $result['SUCCESS_FUND_RATE'] =(int)(($success_projects/$total_projects)*100) ; \n $result['FIXED_VS_FLEXIBLE'] = (int)(($result['FIXED']/$result['FLEXIBLE'])*100);\n \n \n $result['MOST_FUNDED_PROJECTS'] = $this->query(\" select SUM(x.amount) as funded,x.project_id,y.title as project \n from user_fund_project as x \n join project as y\n on x.project_id = y.id\n group by x.project_id order by funded desc limit 0,5\",FALSE,TRUE);\n \n $result['MOST_FUNDED_CATEGORIES'] = $this->query(\"select SUM(x.amount) as funded,z.category_id,z.name as category from user_fund_project as x \n join project as y\n on x.project_id = y.id\n join category as z \n on z.category_id = y.category\n group by z.category_id order by funded desc limit 0,5\",FALSE,TRUE);\n \n $result['MOST_POPULAR_REWARD_TYPES'] = $this->query(\"select SUM(x.amount) as funded,y.id,y.reward_types as reward_type from user_fund_project as x \n join reward as y\n on x.reward_id = y.id\n group by y.reward_types order by funded desc limit 0,5\",FALSE,TRUE);\n \n \n// LAST ROW\n $result['TOP_PROJECT_LOCATIONS'] = $this->query(\" select count(*) as locations,city from project where project_status ='success' group by city order by locations desc\",FALSE,TRUE);\n $result['TOP_FUNDING_LOCATION'] = $this->query(\"select SUM(x.amount) as funded,y.id as city_id,y.city as city from user_fund_project as x \n join project as y\n on x.project_id = y.id\n group by y.city order by funded desc\",FALSE,TRUE);\n \n \n //pass array to front end \n $params =array(\n 'reportData'=>$result,\n );\n \n //render page \n $this->render('reporting',$params);\n }", "public function actionScript($startdate = \"2016-12-01\",$enddate = \"2016-12-31\")\n {\n\t\tif(!strtotime($startdate)||!strtotime($enddate)){\n\t\t\t\n\t\t\techo \"日期错误\";\n\t\t\texit;\n\t\t}\n\t\tignore_user_abort(true);\n\t\t$data = \\app\\models\\AttendanceCheckinView::find()->where([\"and\",['>=', 'signdate', $startdate],['<=', 'signdate', $enddate]])->asArray()->all();//->andWhere(\"personnel_id != 0\")\n\t\t$Personnels = \\app\\models\\Personnel::find()->where([\"validflag\"=>\"1\",\"checkin\"=>\"1\"])->asArray()->all();\n\t\t// var_dump($data);exit;\n\t\t// echo \"<pre>\";\n\t\t$result = \\yii\\helpers\\ArrayHelper::index($data, \"personnel_id\", 'signdate');\n\t\t// echo \"<pre>\";\n\t\t// print_r($Personnels);\n\t\t// print_r($result);\n\t\t// exit;\n\t\t// echo date('w');exit;\n\t\t$startdateInt = strtotime($startdate);\n\t\t$enddateInt = strtotime($enddate);\n\t\t$weekArr=[\"0\"=>\"星期日\",\"1\"=>\"星期一\",\"2\"=>\"星期二\",\"3\"=>\"星期三\",\"4\"=>\"星期四\",\"5\"=>\"星期五\",\"6\"=>\"星期六\"];\n\t\tfor($time = $startdateInt;$time<=$enddateInt;$time+=86400){\n\t\t\t// var_dump(date(\"Y-m-d\",$time));\n\t\t\t// echo $time;\n\t\t\t// echo \"<hr/>\";\n\t\t\t// echo $time+86400;\n\t\t\t$Leaves = \\app\\models\\AttendanceLeave::find()->where([\"and\",['>=', 'leaveend', $time],['<', 'leavestart', $time+86400]])->asArray()->all();\n\t\t\t$LeavesDatas = \\yii\\helpers\\ArrayHelper::index($Leaves, \"id\",\"personnel_id\");\n\t\t\t\n\t\t\t$Overtimes = \\app\\models\\AttendanceOvertime::find()->where([\"and\",['>=', 'overtimestart', $time],['<', 'overtimestart', $time+86400]])->asArray()->all();\n\t\t\t$OvertimesDatas = \\yii\\helpers\\ArrayHelper::index($Overtimes, \"id\",\"personnel_id\");\n\t\t \n\t\t\t\n\t\t\t$goouts = \\app\\models\\AttendanceGoout::find()->where([\"gooutdate\"=>date(\"Y-m-d\",$time)])->asArray()->all();\n\t\t\t$gooutDatas = \\yii\\helpers\\ArrayHelper::index($goouts, \"id\",\"personnel_id\");\n\t\t\t\n\t\t\t\n\t\t\t// var_dump($goouts);\n\t\t\t// var_dump($gooutDatas);\n\t\t\t// continue;\n\t\t\t// exit;\n\t\t\t\n\t\t\t$curYear = date(\"Y\",$time);\n\t\t\t$curMonth = date(\"m\",$time);\n\t\t\t$curDate = date(\"Y-m-d\",$time);\n\t\t\t$curDayofWeekKey = date(\"w\",$time);\n\t\t\t$curDayofWeek = $weekArr[$curDayofWeekKey];\n\t\t\tforeach($Personnels as $personnel){\n\t\t\t\t$model =\\app\\models\\AttendanceCheckinReports::find()->where([\"personnel_id\"=>$personnel[\"id\"],\"signdate\"=>$curDate])->one()?:new \\app\\models\\AttendanceCheckinReports();\n\t\t\t\t// var_dump($model);exit;\n\t\t\t\t$model->personnel_id = $personnel['id'];\n\t\t\t\t$model->employeeid = $personnel['employeeid'];\n\t\t\t\t$model->username = $personnel['name'];\n\t\t\t\t$model->signdate = $curDate;\n\t\t\t\t$model->year = $curYear;\n\t\t\t\t$model->month = $curMonth;\n\t\t\t\t$model->dayofweekkey = $curDayofWeekKey;\n\t\t\t\t$model->dayofweek = $curDayofWeek;\n\t\t\t\t\n\t\t\t\t//考勤记录\n\t\t\t\tif(isset($result[$curDate])&&isset($result[$curDate][$personnel['id']])){\n\t\t\t\t\t$userSign= $result[$curDate][$personnel['id']];\n\t\t\t\t\t// var_dump($userSign);exit;\n\t\t\t\t\t$model->signstatus = $userSign[\"daytype\"];\n\t\t\t\t\tif($userSign[\"daytype\"]==\"迟到补齐\"&&$model->signstatus_valid==''){\n\t\t\t\t\t\t$model->signstatus_valid ='迟到';\n\t\t\t\t\t}\n\t\t\t\t\t$model->latetime = $userSign[\"uplate\"]>0?$userSign[\"uplate\"]:0;\n\t\t\t\t\t$model->overtime = $userSign[\"downlate\"]>0?floor($userSign[\"downlate\"]/30)*0.5:0;\n\t\t\t\t\t$model->timediff = $userSign[\"timediff\"]?:0;\n\t\t\t\t\t$model->signtime1 = $userSign[\"upsigntime\"]?date(\"Y-m-d H:i:s\",$userSign[\"upsigntime\"]):'0000-00-00 00:00:00';\n\t\t\t\t\t$model->signtime2 = $userSign[\"downsigntime\"]?date(\"Y-m-d H:i:s\",$userSign[\"downsigntime\"]):'0000-00-00 00:00:00';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//请假记录\n\t\t\t\tif(isset($LeavesDatas[$personnel['id']])){\n\t\t\t\t\t$userLeaves= $LeavesDatas[$personnel['id']];\n\t\t\t\t\t$leaveids=\"\";\n\t\t\t\t\t$leavehour=0;\n\t\t\t\t\t$leavememo=\"\";\n\t\t\t\t\tforeach($userLeaves as $leaveid => $leave){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$timeE = min(strtotime($curDate.\" 18:00:00\"),$leave[\"leaveend\"]);\n\t\t\t\t\t\t$timeS = max(strtotime($curDate.\" 09:00:00\"),$leave[\"leavestart\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$difftime=$timeE-$timeS;\n\t\t\t\t\t\t// echo date(\"Y-m-d H:i:s\",$timeS);\n\t\t\t\t\t\t// echo date(\"Y-m-d H:i:s\",$timeE);\n\t\t\t\t\t\t// var_dump($difftime);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$timeAM = strtotime($curDate.\" 12:00:00\");\n\t\t\t\t\t\t$timePM = strtotime($curDate.\" 13:00:00\");\n\t\t\t\t\t\tif($timeS<=$timeAM&&$timeE>=$timePM){\n\t\t\t\t\t\t\t$difftime-=3600;\n\t\t\t\t\t\t}elseif($timeS<=$timeAM&&$timeE>=$timeAM){\n\t\t\t\t\t\t\t$difftime-=($timeE-$timeAM);\n\t\t\t\t\t\t}elseif($timeS<=$timePM&&$timeE>=$timePM){\n\t\t\t\t\t\t\t$difftime-=($timePM-$timeS);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$totalhour =$difftime>0?floor($difftime/60/30)*0.5:0;\n\t\t\t\t\t\t$leaveids.=$leaveids?(\",\". $leave[\"id\"]):$leave[\"id\"];\n\t\t\t\t\t\t$leavehour += $totalhour;\n\t\t\t\t\t\t$leavememo .= $leavememo?\"||,||\":\"\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$leavememo .= \"id:\".$leave[\"id\"].\"\\n时长:\".date(\"Y-m-d H:i\",$timeS).\"~\".date(\"Y-m-d H:i\",$timeE).\"(\".$totalhour.\"小时)\\n说明:\".$leave[\"description\"];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$model->leaveids = $leaveids;\n\t\t\t\t\t$model->leavehour = $leavehour;\n\t\t\t\t\t$model->leavememo = $leavememo;\n\t\t\t\t}else{\n\t\t\t\t\t$model->leaveids = \"\";\n\t\t\t\t\t$model->leavehour = 0;\n\t\t\t\t\t$model->leavememo = \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//加班记录\n\t\t\t\tif(isset($OvertimesDatas[$personnel['id']])){\n\t\t\t\t\t$userOvertimes= $OvertimesDatas[$personnel['id']];\n\t\t\t\t\t$overtimeids=\"\";\n\t\t\t\t\t$overtimehour=0;\n\t\t\t\t\t$overtimememo=\"\";\n\t\t\t\t\tforeach($userOvertimes as $overtimeid => $overtime){\n\t\t\t\t\t\t$overtimeids.=$overtimeids?(\",\". $overtime[\"id\"]):$overtime[\"id\"];\n\t\t\t\t\t\t$overtimehour += $overtime[\"totalhour\"];\n\t\t\t\t\t\t$overtimememo .= $overtimememo?\"||,||\":\"\";\n\t\t\t\t\t\t$overtimememo .= \"id:\".$overtime[\"id\"].\"\\n时长:\".date(\"Y-m-d H:i\",$overtime['overtimestart']).\"~\".date(\"Y-m-d H:i\",$overtime['overtimeend']).\"(\".$overtime[\"totalhour\"].\"小时)\\n说明:\".$overtime[\"description\"];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$model->overtimeids = $overtimeids;\n\t\t\t\t\t$model->overtimehour = $overtimehour;\n\t\t\t\t\t$model->overtimememo = $overtimememo;\n\t\t\t\t}else{\n\t\t\t\t\t$model->overtimeids = '';\n\t\t\t\t\t$model->overtimehour = 0;\n\t\t\t\t\t$model->overtimememo = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//外出记录\n\t\t\t\tif(isset($gooutDatas[$personnel['id']])){\n\t\t\t\t\t$userGoout= $gooutDatas[$personnel['id']];\n\t\t\t\t\t$gooutids=\"\";\n\t\t\t\t\t$goouthour=0;\n\t\t\t\t\t$gooutmemo=\"\";\n\t\t\t\t\tforeach($userGoout as $gooutid => $goout){\n\t\t\t\t\t\t$gooutids.=$gooutids?(\",\". $goout[\"id\"]):$goout[\"id\"];\n\t\t\t\t\t\t$goouthour += $goout[\"totalhour\"];\n\t\t\t\t\t\t$gooutmemo .= $gooutmemo?\"||,||\":\"\";\n\t\t\t\t\t\t$gooutmemo .= \"id:\".$goout[\"id\"].\"\\n时长:\".\"(\".$overtime[\"totalhour\"].\"小时)\\n说明:\".$overtime[\"description\"];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$model->gooutids = $gooutids;\n\t\t\t\t\t$model->goouthour = $goouthour;\n\t\t\t\t\t$model->gooutmemo = $gooutmemo;\n\t\t\t\t}else{\n\t\t\t\t\t$model->gooutids = '';\n\t\t\t\t\t$model->goouthour = 0;\n\t\t\t\t\t$model->gooutmemo = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($model->save()){\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tvar_dump($model->errors);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo \"从\",$startdate,\"到\",$enddate,\"考勤脚本执行完毕!\";\n }", "function report( $data = array() ) {\n\n/* ... data declarations */\n $teamID = \"\";\n $data['tournDetails'] = array();\n\n/* ... ensure user is properly logged in to the site */\n if (!$this->Model_Account->amILoggedIn()) {\n redirect( \"mainpage/notLoggedIn\", \"refresh\" );\n }\n\n/* ... determine their team affiliation and get the games their team are involved in */\n $data['scheduleHeader'] = \"\";\n if (array_key_exists( 'TeamID', $_SESSION )) {\n $data['scheduleHeader'] = \"Playoff Schedule For \".htmlspecialchars( $this->Model_Team->getTeamName( $_SESSION['TeamID'] ) );\n $teamID = $_SESSION['TeamID'];\n $data['tournDetails'] = $this->Model_Tournament->getTeamSchedule( $teamID );\n }\n \n/* ... define values for template variables to display on page */\n $data['title'] = \"Reporting Playoff Scores - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournScores\";\n\n/* ... set the variable that controls whether we display the form go get the results of a game */\n if (!array_key_exists( 'showResultsForm', $data )) {\n $data['showResultsForm'] = false;\n }\n\n/* ... determine which view for the small left hand contextual navigation menu */\n if (array_key_exists( 'UserId', $_SESSION )) {\n $data['contextNav'] = \"loggedIn\";\n }\n else {\n $data['contextNav'] = \"loggedOut\";\n }\n\n/* ... enable our template variables and then display the template, as we want it shown */ \n $this->load->vars( $data );\n $this->load->view( \"template\" );\n\n/* ... time to go */\n return;\n }", "public function reportStudentDoorAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportStudentDoorAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister); \n }", "function export_report()\n {\n // load csv generator library\n $this->load->library('csvgenerator');\n \n // get current session data \n $session_data = $this->session->userdata('logged_in');\n\n // get filter criteria from post input\n $data = array(\n 'risk_register' => $this->input->post('risk_register'),\n 'user_id' => $this->input->post('general_user'),\n 'project_id' => $session_data['report_project_id']\n );\n\n if ($session_data['role_id'] == 8)\n {\n // get assigned risk register and its ID\n $register_row = $this->project_model->getAssignedRiskRegisterName($data['user_id']);\n $assigned_register_id = $register_row->subproject_id;\n $this->csvgenerator->fetch_data( $user_id, $main_category, $risk_level, $risk_register, $assigned_register_id );\n }\n else\n {\n if($this->csvgenerator->fetch_response_data($data))\n {\n redirect('dashboard/report_response/generate'); \n }\n else\n {\n // error\n $this->session->set_flashdata('negative_msg','Sorry. No report or data for the selected data filter!');\n redirect('dashboard/reports/response_project');\n }\n } \n }", "public function dormitoryReport() {\n $data['dormitory'] = $this->common->getAllData('dormitory');\n $data['dormitoryRoom'] = $this->common->getAllData('dormitory_room');\n $data['dormitory_bed'] = $this->common->getAllData('dormitory_bed');\n $this->load->view('temp/header');\n $this->load->view('dormitoryReport', $data);\n $this->load->view('temp/footer');\n }", "public function generate()\n {\n $start_year = $this->_vars['start_year'];\n $start_month = $this->_vars['start_month'];\n $start_day = $this->_vars['start_day'];\n\n $end_year = $this->_vars['end_year'];\n $end_month = $this->_vars['end_month'];\n $end_day = $this->_vars['end_day'];\n\n $code = '';\n\n if (empty($this->_vars['start']) || empty($this->_vars['end'])) {\n return $this->_vacationCode();\n } elseif ($end_year > $start_year + 1) {\n $code .= $this->_yearCheck($start_year + 1, $end_year - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\"\n . $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year + 1) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($end_month > $start_month) {\n if ($end_month > $start_month + 1) {\n $code .= $this->_monthCheck($start_month + 1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\"\n . $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n } elseif ($end_month == $start_month) {\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n }\n $code .= \"}\";\n }\n\n return $code;\n }", "public function exportAction(Request $request) {\n $resource = $this->findOr404($request);\n $details = $resource->getDetails();\n $summary = $resource->getSummary();\n\n $categoryArrangementProgram = (string) $resource->getCategoryArrangementProgram();\n $tacticalObjective = (string) $resource->getTacticalObjective();\n $operationalObjective = (string) $resource->getOperationalObjective();\n\n $styleArrayBordersContent = array(\n 'borders' => array(\n 'allborders' => array(\n 'style' => \\PHPExcel_Style_Border::BORDER_THIN\n )\n ),\n 'font' => array(\n 'bold' => false\n ),\n 'alignment' => array(\n 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_GENERAL,\n 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n 'wrap' => true\n )\n );\n\n $location = '';\n if ($resource->getType() == ArrangementProgram::TYPE_ARRANGEMENT_PROGRAM_TACTIC) {\n $location = (string) $resource->getTacticalObjective()->getGerencia()->getComplejo();\n } else if ($resource->getType() == ArrangementProgram::TYPE_ARRANGEMENT_PROGRAM_OPERATIVE) {\n $location = (string) $resource->getOperationalObjective()->getGerencia()->getComplejo();\n }\n\n $management = (string) $resource->getTacticalObjective()->getGerencia();\n $description = $resource->getDescription() ? : ($this->trans('pequiven.arrangement_program.description_none'));\n\n $responsibles = '';\n\n foreach ($resource->getResponsibles() as $responsible) {\n $responsibles .= $responsible;\n $responsibles .= ',';\n }\n $responsiblesLen = strlen($responsibles);\n if ($responsiblesLen > 0) {\n $responsibles[strlen($responsibles) - 1] = '.';\n }\n $responsibles = ucwords(strtolower($responsibles));\n $path = $this->get('kernel')->locateResource('@PequivenArrangementProgramBundle/Resources/skeleton/programa_de_gestion.xls');\n\n $now = new \\DateTime();\n $objPHPExcel = \\PHPExcel_IOFactory::load($path);\n $objPHPExcel\n ->getProperties()\n ->setCreator(\"SEIP\")\n ->setTitle('SEIP - Programa de gestion')\n ->setCreated()\n ->setLastModifiedBy('SEIP')\n ->setModified()\n ;\n $objPHPExcel\n ->setActiveSheetIndex(0);\n $activeSheet = $objPHPExcel->getActiveSheet();\n\n $activeSheet->getDefaultRowDimension()->setRowHeight();\n //Setear informacion base\n $activeSheet\n ->setCellValue('B5', $categoryArrangementProgram)\n ->setCellValue('F5', $tacticalObjective)\n ->setCellValue('Q5', $operationalObjective)\n ->setCellValue('B7', $location)\n ->setCellValue('F7', $management)\n ->setCellValue('J7', $responsibles)\n ->setCellValue('AA7', $description)\n ;\n\n\n\n $timeline = $resource->getTimeline();\n $countGoals = 1;\n $rowGoal = 11;\n $goals = $timeline->getGoals();\n //Agregar las filas faltantes\n if ($goals->count() > 13) {\n $totalDiff = $goals->count() - 13;\n $activeSheet\n ->insertNewRowBefore(24, $totalDiff);\n }\n //Setear las metas\n foreach ($goals as $goal) {\n $startDate = $goal->getStartDate() ? $goal->getStartDate()->format('Y-m-d') : '';\n $endDate = $goal->getEndDate() ? $goal->getEndDate()->format('Y-m-d') : '';\n\n $responsiblesGoal = '';\n foreach ($goal->getResponsibles() as $responsible) {\n $responsiblesGoal .= '' . $responsible;\n $responsiblesGoal .= \"\\n\";\n }\n $responsiblesLen = strlen($responsiblesGoal);\n if ($responsiblesLen > 0) {\n $responsiblesGoal[strlen($responsiblesGoal) - 1] = '.';\n }\n $responsiblesGoal = ucwords(strtolower($responsiblesGoal));\n\n $weight = $goal->getWeight();\n $goalDetails = $goal->getGoalDetails();\n\n $januaryPlanned = $goalDetails->getJanuaryPlanned() > 0 ? $goalDetails->getJanuaryPlanned() : '';\n $januaryReal = $goalDetails->getJanuaryReal() > 0 ? $goalDetails->getJanuaryReal() : '';\n\n $februaryPlanned = $goalDetails->getFebruaryPlanned() > 0 ? $goalDetails->getFebruaryPlanned() : '';\n $februaryReal = $goalDetails->getFebruaryReal() > 0 ? $goalDetails->getFebruaryReal() : '';\n\n $marchPlanned = $goalDetails->getMarchPlanned() > 0 ? $goalDetails->getMarchPlanned() : '';\n $marchReal = $goalDetails->getMarchReal() > 0 ? $goalDetails->getMarchReal() : '';\n\n $aprilPlanned = $goalDetails->getAprilPlanned() > 0 ? $goalDetails->getAprilPlanned() : '';\n $aprilReal = $goalDetails->getAprilReal() > 0 ? $goalDetails->getAprilReal() : '';\n\n $mayPlanned = $goalDetails->getMayPlanned() > 0 ? $goalDetails->getMayPlanned() : '';\n $mayReal = $goalDetails->getMayReal() > 0 ? $goalDetails->getMayReal() : '';\n\n $junePlanned = $goalDetails->getJunePlanned() > 0 ? $goalDetails->getJunePlanned() : '';\n $juneReal = $goalDetails->getJuneReal() > 0 ? $goalDetails->getJuneReal() : '';\n\n $julyPlanned = $goalDetails->getJulyPlanned() > 0 ? $goalDetails->getJulyPlanned() : '';\n $julyReal = $goalDetails->getJulyReal() > 0 ? $goalDetails->getJulyReal() : '';\n\n $augustPlanned = $goalDetails->getAugustPlanned() > 0 ? $goalDetails->getAugustPlanned() : '';\n $augustReal = $goalDetails->getAugustReal() > 0 ? $goalDetails->getAugustReal() : '';\n\n $septemberPlanned = $goalDetails->getSeptemberPlanned() > 0 ? $goalDetails->getSeptemberPlanned() : '';\n $septemberReal = $goalDetails->getSeptemberReal() > 0 ? $goalDetails->getSeptemberReal() : '';\n\n $octoberPlanned = $goalDetails->getOctoberPlanned() > 0 ? $goalDetails->getOctoberPlanned() : '';\n $octoberReal = $goalDetails->getOctoberReal() > 0 ? $goalDetails->getOctoberReal() : '';\n\n $novemberPlanned = $goalDetails->getNovemberPlanned() > 0 ? $goalDetails->getNovemberPlanned() : '';\n $novemberReal = $goalDetails->getNovemberReal() > 0 ? $goalDetails->getNovemberReal() : '';\n\n $decemberPlanned = $goalDetails->getDecemberPlanned() > 0 ? $goalDetails->getDecemberPlanned() : '';\n $decemberReal = $goalDetails->getDecemberReal() > 0 ? $goalDetails->getDecemberReal() : '';\n\n $goalObservations = $goal->getObservations();\n\n if ($countGoals > 13) {\n $activeSheet->mergeCells(sprintf('C%s:F%s', $rowGoal, $rowGoal));\n $activeSheet->mergeCells(sprintf('AI%s:AL%s', $rowGoal, $rowGoal));\n }\n\n $activeSheet\n ->setCellValue('B' . $rowGoal, $countGoals)\n ->setCellValue('C' . $rowGoal, $goal->getName())\n ->setCellValue('G' . $rowGoal, $startDate)\n ->setCellValue('H' . $rowGoal, $endDate)\n ->setCellValue('I' . $rowGoal, $responsiblesGoal)\n ->setCellValue('J' . $rowGoal, $weight);\n\n //Valores planeado y real de la meta\n $activeSheet\n ->setCellValue('K' . $rowGoal, $januaryPlanned)\n ->setCellValue('L' . $rowGoal, $januaryReal)\n ->setCellValue('M' . $rowGoal, $februaryPlanned)\n ->setCellValue('N' . $rowGoal, $februaryReal)\n ->setCellValue('O' . $rowGoal, $marchPlanned)\n ->setCellValue('P' . $rowGoal, $marchReal)\n ->setCellValue('Q' . $rowGoal, $aprilPlanned)\n ->setCellValue('R' . $rowGoal, $aprilReal)\n ->setCellValue('S' . $rowGoal, $mayPlanned)\n ->setCellValue('T' . $rowGoal, $mayReal)\n ->setCellValue('U' . $rowGoal, $junePlanned)\n ->setCellValue('V' . $rowGoal, $juneReal)\n ->setCellValue('W' . $rowGoal, $julyPlanned)\n ->setCellValue('X' . $rowGoal, $julyReal)\n ->setCellValue('Y' . $rowGoal, $augustPlanned)\n ->setCellValue('Z' . $rowGoal, $augustReal)\n ->setCellValue('AA' . $rowGoal, $septemberPlanned)\n ->setCellValue('AB' . $rowGoal, $septemberReal)\n ->setCellValue('AC' . $rowGoal, $octoberPlanned)\n ->setCellValue('AD' . $rowGoal, $octoberReal)\n ->setCellValue('AE' . $rowGoal, $novemberPlanned)\n ->setCellValue('AF' . $rowGoal, $novemberReal)\n ->setCellValue('AG' . $rowGoal, $decemberPlanned)\n ->setCellValue('AH' . $rowGoal, $decemberReal)\n ->setCellValue('AI' . $rowGoal, $goalObservations)\n ;\n\n $activeSheet\n ->getStyle('I')->getAlignment()->setWrapText(true);\n $activeSheet->getStyle(sprintf('C%s:I%s', $rowGoal, $rowGoal))->applyFromArray($styleArrayBordersContent);\n $activeSheet->getStyle(sprintf('AI%s:AL%s', $rowGoal, $rowGoal))->applyFromArray($styleArrayBordersContent);\n $rowHeight = 50;\n $responsiblesGoalLen = strlen($responsiblesGoal);\n $goalObservationsLen = strlen($goalObservations);\n if ($responsiblesGoalLen > $rowHeight) {\n $rowHeight = $responsiblesGoalLen;\n }\n if ($goalObservationsLen > $responsiblesGoalLen) {\n $rowHeight = $goalObservationsLen;\n }\n $activeSheet->getRowDimension($rowGoal)->setRowHeight($rowHeight);\n $countGoals++;\n $rowGoal++;\n }\n $rowSummary = 24;\n if ($rowGoal > $rowSummary) {\n $rowSummary = $rowGoal;\n }\n $detailsAdvancesPlanned = $summary['detailsAdvancesPlanned'];\n $detailsAdvancesReal = $summary['detailsAdvancesReal'];\n $totalWeight = $summary['weight'];\n //Setear el peso total distribuido\n $activeSheet->setCellValue('J' . $rowSummary, $totalWeight);\n //Setear avances del programa\n $activeSheet\n ->setCellValue('K' . $rowSummary, $detailsAdvancesPlanned['januaryPlanned'])\n ->setCellValue('L' . $rowSummary, $detailsAdvancesReal['januaryReal'])\n ->setCellValue('M' . $rowSummary, $detailsAdvancesPlanned['februaryPlanned'])\n ->setCellValue('N' . $rowSummary, $detailsAdvancesReal['februaryReal'])\n ->setCellValue('O' . $rowSummary, $detailsAdvancesPlanned['marchPlanned'])\n ->setCellValue('P' . $rowSummary, $detailsAdvancesReal['marchReal'])\n ->setCellValue('Q' . $rowSummary, $detailsAdvancesPlanned['aprilPlanned'])\n ->setCellValue('R' . $rowSummary, $detailsAdvancesReal['aprilReal'])\n ->setCellValue('S' . $rowSummary, $detailsAdvancesPlanned['mayPlanned'])\n ->setCellValue('T' . $rowSummary, $detailsAdvancesReal['mayReal'])\n ->setCellValue('U' . $rowSummary, $detailsAdvancesPlanned['junePlanned'])\n ->setCellValue('V' . $rowSummary, $detailsAdvancesReal['juneReal'])\n ->setCellValue('W' . $rowSummary, $detailsAdvancesPlanned['julyPlanned'])\n ->setCellValue('X' . $rowSummary, $detailsAdvancesReal['julyReal'])\n ->setCellValue('Y' . $rowSummary, $detailsAdvancesPlanned['augustPlanned'])\n ->setCellValue('Z' . $rowSummary, $detailsAdvancesReal['augustReal'])\n ->setCellValue('AA' . $rowSummary, $detailsAdvancesPlanned['septemberPlanned'])\n ->setCellValue('AB' . $rowSummary, $detailsAdvancesReal['septemberReal'])\n ->setCellValue('AC' . $rowSummary, $detailsAdvancesPlanned['octoberPlanned'])\n ->setCellValue('AD' . $rowSummary, $detailsAdvancesReal['octoberReal'])\n ->setCellValue('AE' . $rowSummary, $detailsAdvancesPlanned['novemberPlanned'])\n ->setCellValue('AF' . $rowSummary, $detailsAdvancesReal['novemberReal'])\n ->setCellValue('AG' . $rowSummary, $detailsAdvancesPlanned['decemberPlanned'])\n ->setCellValue('AH' . $rowSummary, $detailsAdvancesReal['decemberReal'])\n ;\n\n //Observaciones del programa.\n $rowObservation = $rowSummary + 2;\n $observations = $resource->getObservations();\n $reference = $resource->getRef();\n $observationString = '';\n $count = 0;\n foreach ($observations as $observation) {\n $count++;\n $observationString .= sprintf(\"%d.- %s. \\n\", $count, $observation->getDescription());\n }\n $observationsLen = strlen($observationString);\n if ($observationsLen > 0) {\n $observationString = ucwords(strtolower($observationString));\n } else {\n $observationString = 'Ninguna.';\n }\n\n $activeSheet\n ->setCellValue('B' . $rowObservation, $observationString)\n ->setCellValue('AE' . $rowObservation, $reference);\n\n $activeSheet\n ->getStyle('B')->getAlignment()->setWrapText(true);\n\n $activeSheet->getStyle(sprintf('B%s:AD%s', $rowObservation, $rowObservation))->applyFromArray($styleArrayBordersContent);\n\n //Agregar los detalles del programa de gestion\n $sendToReviewBy = ucwords(strtolower($details->getReviewedBy() ? $details->getReviewedBy() : $this->trans('pequiven.arrangement_program.no_send_to_review_date')));\n $revisionDate = $details->getRevisionDate() ? $details->getRevisionDate()->format($this->getSeipConfiguration()->getGeneralDateFormat()) : $this->trans('pequiven.arrangement_program.no_revison_date');\n\n $approvedBy = ucwords(strtolower($details->getApprovedBy() ? $details->getApprovedBy() : $this->trans('pequiven.arrangement_program.no_approval_date')));\n $approvalDate = $details->getApprovalDate() ? $details->getApprovalDate()->format($this->getSeipConfiguration()->getGeneralDateFormat()) : $this->trans('pequiven.arrangement_program.no_approval_date');\n if ($rowObservation > 26) {\n $rowDetails = $rowObservation + 2;\n } else {\n $rowDetails = 28;\n }\n $activeSheet\n ->setCellValue('B' . $rowDetails, $sendToReviewBy)\n ->setCellValue('I' . $rowDetails, $revisionDate)\n ->setCellValue('L' . $rowDetails, $approvedBy)\n ->setCellValue('AI' . $rowDetails, $approvalDate)\n ;\n $row = $rowDetails + 3;\n $merge = 'B' . $row . ':H' . $row . '';\n $activeSheet->mergeCells($merge);\n $activeSheet->setCellValue(sprintf('B%s', $row), 'NIVEL DE REVISION: 1');\n $activeSheet->setCellValue(sprintf('AI%s', $row), 'C-PG-DM-OI-R-002');\n $activeSheet->getStyle(sprintf('B%s:AI%s', $row, $row))->getFont()->setSize(8);\n\n $activeSheet->calculateColumnWidths();\n $activeSheet->getRowDimension('1');\n\n $activeSheet->getProtection()\n ->setSheet(true)\n ->setPassword('SEIP-PG-P1A-2014')\n ;\n\n $fileName = sprintf('SEIP-Programa-De-Gestion-%s.xls', $now->format('Ymd-His'));\n // Redirect output to a client’s web browser (Excel5)\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"' . $fileName . '\"');\n header('Cache-Control: max-age=0');\n // If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n // If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit;\n }", "public function getCDateAttendances_new()\n {\n $orgid = isset($_REQUEST['refno']) ? $_REQUEST['refno'] : 0;\n $att = isset($_REQUEST['att']) ? $_REQUEST['att'] : 0;\n $date = isset($_REQUEST['date']) ? $_REQUEST['date'] : '';\n $datafor = isset($_REQUEST['datafor']) ? $_REQUEST['datafor'] : '';\n $empid = isset($_REQUEST['empid']) ? $_REQUEST['empid'] : ''; \n $zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n $date =date('Y-m-d',strtotime($date));\n $time = date('H:i:s');\n $data = array();\n $cdate = date('Y-m-d');\n\t $adminstatus = getAdminStatus($empid);\n\t\t$cond = \"\";\n\t\t$cond1 = \"\";\n\t\tif($adminstatus == '2')\n\t\t{ \n\t \t$dptid = getDepartmentIdByEmpID($empid);\n\t\t\t$cond = \" AND Department = $dptid \";\n\t\t\t$cond1 = \" AND Dept_id = $dptid \";\n\t\t\t\n\t\t}\n\t \n\t \n //today attendance\n\t\t if($datafor=='present'){\n\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE `AttendanceDate`=? $cond1 and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = ? AND Is_Delete = 0 ) order by `name`\", array($date,$orgid,$orgid));\n $data['present'] = $query->result();\n\t\t\t\n\t\t\t }else if($datafor=='absent'){/*\n //---managing off (weekly and holiday)\n $dt = $date; \n // day of month : 1 sun 2 mon --\n $dayOfWeek = 1 + date('w', strtotime($dt));\n $weekOfMonth = weekOfMonth($dt);\n $week = '';\n $query = $this->db->query(\"SELECT `WeekOff` FROM `WeekOffMaster` WHERE `OrganizationId` =? AND `Day` = ?\", array(\n $orgid,\n $dayOfWeek\n ));\n if ($row = $query->result()) {\n $week = explode(\",\", $row[0]->WeekOff);\n }\n if ($week[$weekOfMonth - 1] == 1) {\n $data['absentees'] = '';\n } else {\n $query = $this->db->query(\"SELECT `DateFrom`, `DateTo` FROM `HolidayMaster` WHERE OrganizationId=? and (? between `DateFrom` and `DateTo`) \", array(\n $orgid,\n $dt\n ));\n if ($query->num_rows() > 0) {\n //-----managing off (weekly and holiday) - close \n $query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name,'-' as TimeIn,'-' as TimeOut ,'Absent' as status from EmployeeMaster where `OrganizationId` =$orgid and EmployeeMaster.archive=1 and EmployeeMaster.Id not in(select AttendanceMaster.`EmployeeId` from AttendanceMaster where `AttendanceDate`='$date' and `OrganizationId` =$orgid) and CAST('$time' as time) > (select TimeIn from ShiftMaster where ShiftMaster.Id=shift) order by `name`\", array(\n $orgid,\n $date,\n $orgid\n ));\n $data['absentees'] = $query->result();\n } \n }*/\n\t\t\t//////////today_abs\n\t\t\t\n\t\t\tif($date != date('Y-m-d')){// for other deay's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? $cond1 and OrganizationId=? and (AttendanceStatus=2 or AttendanceStatus=6 or AttendanceStatus=7 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by `name`\", array($date,$orgid));\n\t\t\t\t$this->db->close();\n\t\t\t\t$data['absent'] = $query->result();\n\t\t\t}else{ // for today's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? $cond1 and OrganizationId=? \nand AttendanceStatus in (2,6,7) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0 ) order by `name` \",array($date,$orgid));\n\t\t\t$temp=array();\n $temp = $query->result();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name, '-' as `TimeOut` ,'-' as TimeIn FROM `EmployeeMaster` WHERE `OrganizationId` =? AND Is_Delete=0 $cond AND ARCHIVE =1 AND is_Delete = 0 AND (DOL='0000-00-00' OR DOL>CURDATE()) AND Id NOT IN ( SELECT EmployeeId FROM AttendanceMaster WHERE AttendanceDate = ? AND `OrganizationId` =? ) AND ( SELECT `TimeIn` FROM `ShiftMaster` WHERE `Id` = Shift AND TimeIn < ? )\",array($orgid,$date,$orgid,$time));\n\t\t\t\n\t\t\t\t$data['absent']= array_merge($temp,$query->result());\t\n\t\t\t}\n\t\t\t\n\t}else if($datafor=='latecomings'){\n //////// today_late\n $query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`=? $cond1 and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0 ) order by `name`\", array(\n $date,\n $orgid\n ));\n $data['lateComings'] = $query->result();\n\t}else if($datafor=='earlyleavings'){\t\t\n ////////today_early\n /*$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeOut) < (select time(TimeOut) from ShiftMaster where ShiftMaster.Id=shiftId) and TimeOut!='00:00:00' ) and `AttendanceDate`=? $cond1 and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by `name`\", array( $date,$orgid ));\n $data['earlyLeavings'] = $query->result();*/\n\t\t\t\n\t\t $query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$date' and TimeIn != '00:00:00' ) AND is_Delete=0 order by FirstName\");\n\t\t $res = array();\n\t\t $cond = '';\n foreach ($query->result() as $row) {\n $ShiftId = $row->Shift;\n $EId = $row->Id;\n $query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n if ($data123 = $query->row()) {\n $shiftout = $data123->TimeOut;\n $shiftout1 = $date. ' '.$data123->TimeOut;\n\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t{\n\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($date . \"+1 days\"));\n\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t}\n $shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n $ct = date('H:i:s');\n \n if ($cdate == $date)\n $cond = \" and TimeOut !='00:00:00'\";\n $query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$date' and TimeOut !='00:00:00' \");\n\t\t\t\t\t\n\t\t\t\t\t\n if ($row333 = $query333->row()) {\n $a = new DateTime($row333->TimeOut);\n $b = new DateTime($data123->TimeOut);\n $interval = $a->diff($b);\n $data1['earlyby'] = $interval->format(\"%H:%I\");\n $data1['timeout'] = substr($row333->TimeOut, 0, 5);\n $data1['name'] = $row->FirstName . ' ' . $row->LastName;\n $data1['shift'] = $shift;\n $data1['status'] = $row333->status;\n $data1['TimeIn'] = $row333->TimeIn;\n $data1['TimeOut'] = $row333->TimeOut;\n $data1['CheckOutLoc'] = $row333->CheckOutLoc;\n $data1['checkInLoc'] = $row333->checkInLoc;\n $data1['EntryImage'] = $row333->EntryImage;\n $data1['ExitImage'] = $row333->ExitImage;\n $data1['latit_in'] = $row333->latit_in;\n $data1['longi_in'] = $row333->longi_in;\n $data1['latit_out'] = $row333->latit_out;\n $data1['longi_out'] = $row333->longi_out;\n $data1['date'] = $date;\n $res[] = $data1;\n }\n \n }\n }\n\t\t $data['earlyLeavings'] =\t $res;\n\t\t\t\n\t}\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n \n \n \n echo json_encode($data, JSON_NUMERIC_CHECK);\n \n }", "public function actionMedicalvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t// rendering the layout\n\t\t\t$this->layout = 'main';\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$company_detals = array ();\n\t\t\t$company_validation = array ();\n\t\t\t$error_medical_classes = array ();\n\t\t\t$arr_medical_individual_issues = array ();\n\t\t\t$medical_period_issues = array();\n\t\t\t$medical_validation_issues = array();\n\t\t\t$top_ten_employee_id = array();\n\t\t\t\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\tif (! empty ( $encrypt_company_id )) {\n\t\t\t\t\t\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t \n\t\t\t\t\t// / get the company details\n\t\t\t\t\t$company_detals = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// checking if the validation starts for this company\n\t\t\t\t\t\n\t\t\t\t\t$company_validation = TblAcaCompanyValidationStatus::find ()->where ( [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_initialized' => 1 \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_completed' => 0 \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination ***********************/\t\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t } else {\n\t\t\t\t\t \t$page=1; \n\t\t\t\t\t }\n\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t**/\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_validation = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($medical_validation as $medical_validation){\n\t\t\t\t\t\t$medical_validation_issues[$i] = $medical_validation['employee_id'];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_enrollment_period_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_period = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$j=0;\n\t\t\t\t\tforeach($medical_period as $medical_period){\n\t\t\t\t\t\t$medical_period_issues[$j] = $medical_period['employee_id'];\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// combining both the issue arrays to combine all the employee ids\t\t\t\t\t\n\t\t\t\t\t$issues_array = array_merge($medical_validation_issues,$medical_period_issues);\n\t\t\t\t\n\t\t\t\t\t// get the unique employee ids\n\t\t\t\t\t$final_employee_ids_array = array_unique($issues_array);\n\t\t\t\t\t$final_employee_ids_array = array_values($final_employee_ids_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(count($final_employee_ids_array)> 10){\n\n\t\t\t\t\t\t//pagination\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=$start_from;$i<($start_from+10);$i++){\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($i<count($final_employee_ids_array)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\tif(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=0;$i<count($final_employee_ids_array);$i++){\n\t\t\t\t\t\t\t//if(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$medical_details = ArrayHelper::index(TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id\n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t//ArrayHelper::map($array, 'id', 'name')\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for individual payroll data\n\t\t\t\t\t$error_individual_medical = ArrayHelper::index(TblAcaMedicalValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for period payroll data\n\t\t\t\t\t$error_individual_medical_period = ArrayHelper::index(TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\tif(!empty($medical_details))\t\t\n\t\t\t\t\t{\t\t//print_r($issue_count);\t\t\t\n\t\t\t\t\tforeach($medical_details as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$employee_id = \t$key;\n\t\t\t\t\t\t$medical_issue = '';\n\t\t\t\t\t\t$medical_period_issue = '';\n\t\t\t\t\t\tif(!empty($error_individual_medical[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_issue = $error_individual_medical[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($error_individual_medical_period[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_period_issue = $error_individual_medical_period[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = $medical_issue+ $medical_period_issue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count != 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $employee_id );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t'medical_firstname' => $value['first_name'],\n\t\t\t\t\t\t\t\t'medical_lastname' => $value['last_name'],\n\t\t\t\t\t\t\t\t'medical_middlename' => $value['middle_name'],\n\t\t\t\t\t\t\t\t'medical_ssn' => $value['ssn'],\n\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination **********************\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$page=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t*\n\t\t\t\t\t$medical_validation = TblAcaMedicalValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] = count($medical_validation);\n\t\t\t\t\t\n\t\t\t\t\t$medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] += count($medical_period);\n\t\t\t\t\t//print_r($arr_validations ['medical_data_validation']);die();\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t \n\t\t\t\t\tif($arr_validations ['medical_data_validation']>10){\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )\n\t\t\t\t\t\t->offset($start_from)\n\t\t\t\t\t\t->limit($num_rec_per_page)\n\t\t\t\t\t\t\n\t\t\t\t\t\t->All ();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//////// using for pagination\n\t\t\t\t\t$error_medical_classes_count = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->count ();\n\t\t\t\t\t//$searchModel = new TblAcaMedicalErrorSearch();\n\t\t\t\t\t\n\t\t\t\t\t// get the individual payroll employee details\n\t\t\t\t\tforeach ( $error_medical_classes as $error_medical_class ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$medical_details = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for individual medical data\n\t\t\t\t\t\t$error_individual_medical = TblAcaMedicalValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for period medical data\n\t\t\t\t\t\t$error_individual_medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->Count ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = count ( $error_individual_medical );\n\t\t\t\t\t\t$issue_count += $error_individual_medical_period;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count > 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $error_medical_class->employee_id );\n\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_lastname' => $medical_details->last_name,\n\t\t\t\t\t\t\t\t\t'medical_middlename' => $medical_details->middle_name,\n\t\t\t\t\t\t\t\t\t'medical_ssn' => $medical_details->ssn,\n\t\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t*/\n\t\t\t\t\t//print_r($arr_medical_individual_issues);die();\n\t\t\t\t\t\t//$dataProvider = $searchModel->search($arr_medical_individual_issues); //dataProvider for grid \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($arr_medical_individual_issues)){\n\t\t\treturn $this->render ( 'medicalvalidation', array (\n\t\t\t\t\t'company_detals' => $company_detals,\n\t\t\t\t\t//'dataProvider'=>$dataProvider,\n\t\t\t\t\t//'searchModel'=>$searchModel,\n\t\t\t\t\t'company_validation' => $company_validation,\n\t\t\t\t\t'encoded_company_id' => $_GET ['c_id'],\n\t\t\t\t\t'arr_medical_individual_issues' => $arr_medical_individual_issues,\n\t\t\t\t\t'total_issue_count' => count($final_employee_ids_array),\n\t\t\t\t\t'error_medical_classes_count' => count($final_employee_ids_array)\n\t\t\t) );\n\t\t\t\n\t\t\t}else{\n\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t'/client/validateforms?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t) );\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function export(Request $request)\n {\n //$to_date = Carbon::createFromFormat('Y-m-d H:i:s', $request['to_date']. \"23:59:59\");//date('Y-m-d 23:59:59', strtotime($to_date));\n //$clients = VwClient::select()->whereBetween('created_at',[$from_date, $to_date])->get();\n // $formatted_from_date = date('YMd', strtotime($request['from_date']));\n // $formatted_to_date = date('YMd', strtotime($request['to_date']));\n $report_year = $request['report_year'];\n \n $date = $request['report_year'];\n\n $report1_data = DB::table('vw_kpi_report_potential_clients')->where('target_year', $report_year)->get();\n $report2A_data = DB::table('vw_kpi_report2a')->where('target_year', $report_year)->get();\n $report2B_data = DB::table('vw_kpi_report2b')->where('target_year', $report_year)->get();\n $report2C_data = DB::table('vw_kpi_report2c')->where('target_year', $report_year)->get();\n $report2D_data = DB::table('vw_kpi_report2d')->where('target_year', $report_year)->get();\n $report2E_data = DB::table('vw_kpi_report2e')->where('target_year', $report_year)->get();\n $report2F_data = DB::table('vw_kpi_report2f')->where('target_year', $report_year)->get();\n $report2F1_data = DB::table('vw_kpi_report2f1')->where('target_year', $report_year)->get();\n $report3_data = DB::table('vw_kpi_report3')->where('target_year', $report_year)->get();\n $report4_data = DB::table('vw_kpi_report4')->where('target_year', $report_year)->get();\n \n $file = Excel::create('NB_LOCATORSLIST_'.$report_year.' - '.date('YMd'), function ($excel) use ($report1_data, $report2A_data, $report2B_data, $report2C_data , $report2D_data, $report2E_data, $report2F_data, $report2F1_data, $report3_data, $report4_data, $date) {\n $excel->setTitle('KPI Analysis NB GROUP')\n ->setCreator(auth()->user()->name)\n ->setCompany('Serbisyo Outsourcing Facility Inc.');\n //Create excel sheet\n $excel->sheet('KPI Analysis NB Group', function ($sheet) use ($report1_data, $report2A_data, $report2B_data, $report2C_data, $report2D_data, $report2E_data, $report2F_data, $report2F1_data, $report3_data, $report4_data, $date) {\n $report1_row = 12;\n $report2A_row = 34;\n $report2B_row = 54;\n $report2C_row = 74;\n $report2D_row = 94;\n $report2E_row = 114;\n $report2F_row = 134;\n $report2F1_row = 154;\n $report3_row = 175;\n $report4_row = 196;\n $total_clients = 0;\n $total_target_r1 = 0;\n $total_percentage_r1 = 0;\n $blank_rows = [\n 15, 19, 23, 27,\n 37, 41, 45, 49,\n 57, 61, 65, 69,\n 77, 81, 85, 89,\n 97, 101, 105, 109,\n 117, 121, 125, 129,\n 137, 141, 145, 149,\n 157, 161, 165, 169,\n 178, 182, 186, 190,\n 199, 203, 207, 211\n ];\n $current_quarter = 0;\n\n /** Start Loop report 1 data */\n foreach ($report1_data as $key => $report1) {\n /** Check if current row is in blank rows which are rows for quarter 1,2,3,4 */\n if ($boolean = in_array($report1_row + $key, $blank_rows)) {\n if ($current_quarter == 1) {\n $sheet->setCellValueByColumnAndRow(1, $report1_row + $key, \"Q\" . $current_quarter);\n }\n if ($current_quarter == 2) {\n $sheet->setCellValueByColumnAndRow(1, $report1_row + $key, \"Q\" . $current_quarter);\n }\n if ($current_quarter == 3) {\n $sheet->setCellValueByColumnAndRow(1, $report1_row + $key, \"Q\" . $current_quarter);\n }\n $sheet->setCellValueByColumnAndRow(2, $report1_row + $key, $total_clients);\n $sheet->setCellValueByColumnAndRow(3, $report1_row + $key, $total_target_r1);\n $sheet->setCellValueByColumnAndRow(4, $report1_row + $key, round($total_percentage_r1, 2) . \"%\");\n $sheet->setCellValueByColumnAndRow(5, $report1_row + $key, 100 . \"%\");\n $sheet->setCellValueByColumnAndRow(6, $report1_row + $key, $status);\n\n $report1_row = $report1_row + 1;\n }\n /** start report 1 computation */\n $report1_percentage = $report1->clients_count != null ? (intval($report1->clients_count) / intval($report1->target_increase_potential_client))*100:0;\n $total_clients = $total_clients + $report1->clients_count;\n $total_target_r1 = $total_target_r1 + $report1->target_increase_potential_client;\n $total_percentage_r1 = ($total_clients / $total_target_r1) * 100;\n $current_quarter = $report1->quarter;\n $status = $report1_percentage >= 100 ? \"MET\" : \"UNMET\";\n /** end report 1 computation */\n \n /** start setting value report 1 */\n $sheet->setCellValueByColumnAndRow(1, $report1_row + $key, $report1->target_month); // . $report1_row.\"+\".$key\n $sheet->setCellValueByColumnAndRow(2, $report1_row + $key, $report1->clients_count != null ? $report1->clients_count : 0);\n $sheet->setCellValueByColumnAndRow(3, $report1_row + $key, $report1->target_increase_potential_client); //. \"|\".$bolean\n $sheet->setCellValueByColumnAndRow(4, $report1_row + $key, $report1_percentage . \"%\");\n $sheet->setCellValueByColumnAndRow(5, $report1_row + $key, 100 . \"%\");\n $sheet->setCellValueByColumnAndRow(6, $report1_row + $key, $status);\n /** end setting vaue report 1 */\n }\n /** End Loop Report 1 */\n\n /** Start setting value for quarter 4 report 1 */\n $sheet->setCellValueByColumnAndRow(1, 27, \"Q\" . 4);\n $sheet->setCellValueByColumnAndRow(2, 27, $total_clients);\n $sheet->setCellValueByColumnAndRow(3, 27, $total_target_r1);\n $sheet->setCellValueByColumnAndRow(4, 27, round($total_percentage_r1, 2) . \"%\");\n $sheet->setCellValueByColumnAndRow(5, 27, 100 . \"%\");\n $sheet->setCellValueByColumnAndRow(6, 27, $status);\n \n /**\n * Start Report 2\n *\n */\n $this->generate_report2($sheet, $report2A_data, $report2A_row, $blank_rows, 49);//2A last row for Quarter 4\n $this->generate_report2($sheet, $report2B_data, $report2B_row, $blank_rows, 69);//2B last row for Quarter 4\n $this->generate_report2($sheet, $report2C_data, $report2C_row, $blank_rows, 89); //2C last row for Quarter 4\n $this->generate_report2($sheet, $report2D_data, $report2D_row, $blank_rows, 109);//2D last row for Quarter 4\n $this->generate_report2($sheet, $report2E_data, $report2E_row, $blank_rows, 129);//2E last row for Quarter 4\n $this->generate_report2($sheet, $report2F_data, $report2F_row, $blank_rows, 149);//2F last row for Quarter 4\n $this->generate_report2($sheet, $report2F1_data, $report2F1_row, $blank_rows, 169);//2F1 last row for Quarter 4\n $this->generate_report2($sheet, $report3_data, $report3_row, $blank_rows, 190); //3 last row for Quarter 4\n $this->generate_report2($sheet, $report4_data, $report4_row, $blank_rows, 211);\n\n $sheet->cells('B12:B211', function ($cells) {\n $cells->setFontWeight('bold');\n });\n\n $sheet->mergeCells('A1:J1');\n $sheet->cells('A1:J1', function ($cells) {\n $cells->setAlignment('center');\n $cells->setFontSize(16);\n $cells->setFontWeight('bold');\n });\n $sheet->row('1', array(\n 'FUNCTIONAL QUALITY OBJECTIVE-MONITORING'\n ));\n $sheet->mergeCells('A2:B2');\n $sheet->cell('A2', function ($cell) {\n $cell->setValue('GROUP/SECTION:');\n });\n $sheet->cells('A2:B2', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n \n $sheet->mergeCells('C2:J2');\n $sheet->cell('C2', function ($cell) {\n $cell->setValue('NEW BUSINESS');\n });\n $sheet->cells('C2:J2', function ($cells) {\n $cells->setAlignment('center');\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n \n $sheet->mergeCells('A3:B3');\n $sheet->cell('A3', function ($cell) {\n $cell->setValue('YEAR:');\n });\n\n $sheet->cells('A3:B3', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n\n $sheet->mergeCells('C3:D3');\n $sheet->cell('C3', function ($cell) use ($date) {\n $cell->setValue($date);\n //$year = date(\"Y\", strtotime($date['from_date'])) . \"-\" .date(\"Y\", strtotime($date['to_date']));\n // if (date(\"Y\", strtotime($date['from_date'])) == date(\"Y\", strtotime($date['to_date']))) {\n // $cell->setValue(date(\"Y\", strtotime($date['from_date'])));\n // } else {\n // $cell->setValue($year);\n // }\n });\n $sheet->cells('C3:D3', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n $cells->setAlignment('center');\n });\n \n \n $sheet->mergeCells('E3:G3');\n $sheet->cell('E3', function ($cell) {\n $cell->setValue('QUARTER');\n });\n $sheet->cells('E3:G3', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n \n\n $sheet->mergeCells('H3:J3');\n $sheet->cell('H3', function ($cell) {\n $cell->setValue('4th QUARTER');\n });\n $sheet->cells('H3:J3', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n $cells->setAlignment('center');\n });\n \n\n $sheet->mergeCells('A6:B6');\n $sheet->cell('A6', function ($cell) {\n $cell->setValue('PROCESS OWNER:');\n });\n $sheet->setBorder('A6:B6', 'thin');\n $sheet->cells('A6:B6', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n });\n \n\n $sheet->cell('D6', function ($cell) {\n $cell->setValue('NB GROUP');\n });\n \n $sheet->cells('D6', function ($cells) {\n $cells->setFontSize(12);\n $cells->setFontWeight('bold');\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n $cells->setAlignment('center');\n });\n\n /**\n * Start Sub headers with numbers\n */\n\n $sheet->cell('A8', function ($cell) {\n $cell->setValue('1');\n });\n $sheet->cell('A29', function ($cell) {\n $cell->setValue('2');\n });\n $sheet->cell('A171', function ($cell) {\n $cell->setValue('3');\n });\n $sheet->cell('A192', function ($cell) {\n $cell->setValue('4');\n });\n $sheet->cell('A213', function ($cell) {\n $cell->setValue('5');\n });\n \n $sub_number_arr = [8, 29, 171, 192, 213];\n for ($i = 0; $i < count($sub_number_arr); $i++) {\n $sheet->row($sub_number_arr[$i], function ($row) {\n $row->setAlignment('center');\n $row->setFontColor('#4286f4');\n $row->setFontWeight('bold');\n });\n }\n /** End*/\n /**\n * Start Sub header beside numbering 1. 2. 3.4.5\n */\n $sheet->mergeCells('B8:E8');\n $sheet->cell('B8', function ($cell) {\n $cell->setValue('To increase database of potential clients');\n });\n \n $sheet->mergeCells('B29:J29');\n $sheet->cell('B29', function ($cell) {\n $cell->setValue('To ensure steady growth of client base in all areas regardless of territory and to ensure that proposals made to prospective clients are accepted.');\n });\n\n $sheet->mergeCells('B171:E171');\n $sheet->cell('B171', function ($cell) {\n $cell->setValue('To increase number of Clients by at least one (1) per quarter');\n });\n\n $sheet->mergeCells('B192:G192');\n $sheet->cell('B192', function ($cell) {\n $cell->setValue('To secure a duly-signed Service Contract which is approved by the Client and the Company.');\n });\n\n $sheet->mergeCells('B213:G213');\n $sheet->cell('B213', function ($cell) {\n $cell->setValue('To ensure continual improvement of the process and to provide corrective action to prevent recurrence of a nonconformity raised');\n });\n $sheet->getStyle('B213')->getAlignment()->setWrapText(true);\n \n for ($i = 0; $i < count($sub_number_arr); $i++) {\n $sheet->cells('B'.$sub_number_arr[$i], function ($cells) {\n $cells->setAlignment('center');\n $cells->setFontColor('#4286f4');\n $cells->setFontWeight('bold');\n });\n }\n /**END */\n \n /**\n * Start Sub headers Letters for no.2 A, B, C, D, E, F\n * 2 To ensure steady growth of client base in all areas regardless of territory and to ensure that proposals made to prospective clients are accepted\n */\n $sub_letters_arr = [31, 51, 71, 91, 111, 131, 151];\n \n $sheet->cell('B31', function ($cell) {\n $cell->setValue('A');\n });\n $sheet->cell('B51', function ($cell) {\n $cell->setValue('B');\n });\n $sheet->cell('B71', function ($cell) {\n $cell->setValue('C');\n });\n $sheet->cell('B91', function ($cell) {\n $cell->setValue('D');\n });\n $sheet->cell('B111', function ($cell) {\n $cell->setValue('E');\n });\n $sheet->cell('B131', function ($cell) {\n $cell->setValue('F');\n });\n $sheet->mergeCells('B151:C151');\n $sheet->cell('B151', function ($cell) {\n $cell->setValue('F.1 FOR ANALYSIS ONLY');\n });\n \n for ($i = 0; $i < count($sub_letters_arr); $i++) {\n $sheet->cells('B'.$sub_letters_arr[$i], function ($cells) {\n $cells->setAlignment('left');\n $cells->setFontColor('#4286f4');\n $cells->setFontWeight('bold');\n });\n }\n /** END */\n /**\n * 5.A | 5.B | 5.C | 5.D | 5.E\n */\n\n $sub5_letters_arr = [215, 237, 259, 281, 303];\n \n $sheet->cell('B215', function ($cell) {\n $cell->setValue('A');\n });\n $sheet->cell('B237', function ($cell) {\n $cell->setValue('B');\n });\n $sheet->cell('B259', function ($cell) {\n $cell->setValue('C');\n });\n $sheet->cell('B281', function ($cell) {\n $cell->setValue('D');\n });\n $sheet->cell('B303', function ($cell) {\n $cell->setValue('E');\n });\n \n for ($i = 0; $i < count($sub5_letters_arr); $i++) {\n $sheet->cells('B'.$sub5_letters_arr[$i], function ($cells) {\n $cells->setAlignment('left');\n $cells->setFontColor('#4286f4');\n $cells->setFontWeight('bold');\n });\n }\n /** END */\n\n $sub_row_no2 = [10, 32, 52, 72, 92, 112, 132, 152, 173, 194, 216, 238, 260, 282, 304];\n for ($i = 0; $i < count($sub_row_no2); $i++) {\n $sheet->mergeCells('B'.$sub_row_no2[$i].':'.'F'.$sub_row_no2[$i]);\n \n $sheet->setBorder('B'.$sub_row_no2[$i].':'.'F'.$sub_row_no2[$i], 'thick');\n $sheet->cells('B'.$sub_row_no2[$i].':'.'F'.$sub_row_no2[$i], function ($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n $cells->setFontWeight('bold');\n });\n $sheet->getStyle('B'.$sub_row_no2[$i])->getAlignment()->setWrapText(true);\n }\n /**Start A header/subheaders */\n $sheet->cell('B10', function ($cell) {\n $cell->setValue('Increase in prospective clients listing vs No. of clients per existing database');\n });\n $sheet->cell('B11', function ($cell) {\n $cell->setValue('Months');\n });\n \n $sheet->cell('C11', function ($cell) {\n $cell->setValue('Increase in prospective clients listing');\n });\n $sheet->getStyle('C11')->getAlignment()->setWrapText(true);\n\n $sheet->cell('D11', function ($cell) {\n $cell->setValue('Target increase in prospective clients listing per existing database');\n $cell->setFontSize(9);\n });\n $sheet->getStyle('D11')->getAlignment()->setWrapText(true); //Wrap text for this cell\n\n $sheet->cell('E11', function ($cell) {\n $cell->setValue('Percentage %');\n });\n\n $sheet->cell('F11', function ($cell) {\n $cell->setValue('Target');\n });\n /**END */\n \n /**\n * START 2.A headers\n */\n $sheet->cell('B32', function ($cell) {\n $cell->setValue('Target No. of Calls vs. No. of Calls made');\n });\n $sub2A_headers_arr = [\n 'B33' => 'Months', 'C33' => 'No. of Calls Made', 'D33'=>'Target No. of Calls Made',\n 'E33' =>'Percentage %', 'F33' => 'Target'\n ];\n foreach ($sub2A_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B33:F33', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n /**\n * Start 2.B headers\n */\n $sheet->cell('B52', function ($cell) {\n $cell->setValue('No. of productive calls made vs. Actual No. of proposal sent related to calls made');\n });\n $sub2B_headers_arr = [\n 'B53' => 'Months', 'C53' => 'Actual No. of proposal sent related to calls made', 'D53'=>'No. of Productive Calls',\n 'E53' =>'Percentage %', 'F53' => 'Target'\n ];\n foreach ($sub2B_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B53:F53', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n\n /**START 2C header */\n $sheet->cell('B72', function ($cell) {\n $cell->setValue('Actual No. of Proposal sent vs Target Proposal to be sent out');\n });\n $sub2C_headers_arr = [\n 'B73' => 'Months', 'C73' => 'Actual No. of proposal sent', 'D73'=>'Target Proposal to be sent out',\n 'E73' =>'Percentage %', 'F73' => 'Target'\n ];\n foreach ($sub2C_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B73:F73', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n\n /**END */\n\n /**START 2D header*/\n $sheet->cell('B92', function ($cell) {\n $cell->setValue('No. of proposal submitted vs No. of proposals received and accepted');\n });\n $sub2D_headers_arr = [\n 'B93' => 'Months', 'C93' => 'No. of proposals receive and accepted', 'D93'=>'Actual No. of Proposal sent',\n 'E93' =>'Percentage %', 'F93' => 'Target'\n ];\n foreach ($sub2D_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B93:F93', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**START 2E header */\n $sheet->cell('B112', function ($cell) {\n $cell->setValue('No. of proposals received and accepted vs. No. of Follow-up calls made related to accepted and received proposals');\n });\n $sub2E_headers_arr = [\n 'B113' => 'Months', 'C113' => 'No. of follow-up calls made related to submitted proposals', 'D113'=>'No. of Proposals received and accepted',\n 'E113' =>'Percentage %', 'F113' => 'Target'\n ];\n foreach ($sub2E_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B113:F113', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**START 2F */\n $sheet->cell('B132', function ($cell) {\n $cell->setValue('Actual No. of Formal Presentation vs. Target Number of Formal Presentation');\n });\n $sub2F_headers_arr = [\n 'B133' => 'Months', 'C133' => 'Actual No. of Formal Presentation', 'D133'=>'Target Number of Formal Presentation',\n 'E133' =>'Percentage %', 'F133' => 'Target'\n ];\n foreach ($sub2F_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B133:F133', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**START 2F.1 FOR ANALYSIS ONLY */\n $sheet->cell('B152', function ($cell) {\n $cell->setValue('Actual No. of CALL Presentation vs. Actual No. of Formal Presentation');\n });\n $sub2F1_headers_arr = [\n 'B153' => 'Months', 'C153' => 'Actual No. of Call Presentation', 'D153'=>'Actual No. of Formal Presentation',\n 'E153' =>'Percentage %', 'F153' => 'Target'\n ];\n foreach ($sub2F1_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B153:F153', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**START 3. */\n $sheet->cell('B173', function ($cell) {\n $cell->setValue('Number of Newly acquired Client');\n });\n $sub3_headers_arr = [\n 'B174' => 'Months', 'C174' => 'Number of client acquired', 'D174'=>'Target Number of client to be acquired',\n 'E174' =>'Percentage %', 'F174' => 'Target'\n ];\n foreach ($sub3_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B174:F174', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**START 4 */\n $sheet->cell('B194', function ($cell) {\n $cell->setValue('Number of duly-signed contracts vs. number of client acquired');\n });\n $sub4_headers_arr = [\n 'B195' => 'Months', 'C195' => 'Number duly-signed contract/s', 'D195'=>'Number of client acquired',\n 'E195' =>'Percentage %', 'F195' => 'Target'\n ];\n foreach ($sub4_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B195:F195', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /**END */\n\n /**\n * START 5.A headers\n */\n $sheet->cell('B216', function ($cell) {\n $cell->setValue('No. of Nonconformity raised vs. No. of Issued CPIAR for the Conformities raised');\n });\n $sub5A_headers_arr = [\n 'B217' => 'Months', 'C217' => 'No. of Nonconformity raised', 'D217'=>'No. of Issued CPIAR for Nonconformities raised',\n 'E217' =>'Percentage %', 'F217' => 'Target'\n ];\n foreach ($sub5A_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B217:F217', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n\n /**\n * START 5.B headers\n */\n $sheet->cell('B238', function ($cell) {\n $cell->setValue('No. of Improvement raised vs. No. of Issued CPIAR for the Observations raised');\n });\n $sub5B_headers_arr = [\n 'B239' => 'Months', 'C239' => 'No. of Improvement raised', 'D239'=>'No. of Issued CPIAR for the Observation raised',\n 'E239' =>'Percentage %', 'F239' => 'Target'\n ];\n foreach ($sub5B_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B239:F239', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n\n /**\n * START 5.C headers\n */\n $sheet->cell('B260', function ($cell) {\n $cell->setValue('No. of Nonconformity resolved vs. No. of Issued CPIAR for the Conformities raised');\n });\n $sub5C_headers_arr = [\n 'B261' => 'Months', 'C261' => 'No. of Nonconformity resolved', 'D261'=>'No. of Issued CPIAR for the Nonconformities raised',\n 'E261' =>'Percentage %', 'F261' => 'Target'\n ];\n foreach ($sub5C_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B261:F261', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n\n /**\n * START 5.D headers\n */\n $sheet->cell('B282', function ($cell) {\n $cell->setValue('No. of effected improvement vs. No. of Issued CPIAR for the obeservation raised');\n });\n $sub5D_headers_arr = [\n 'B283' => 'Months', 'C283' => 'No. of effected improvement', 'D283'=>'No. of Issued CPIAR for the Observation raised',\n 'E283' =>'Percentage %', 'F283' => 'Target'\n ];\n foreach ($sub5D_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B283:F283', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n\n /**\n * START 5.E headers\n */\n $sheet->cell('B304', function ($cell) {\n $cell->setValue('No. of nonrecurring Nonconformity vs. No. of Issued CPIAR for the Nonconformities raise');\n });\n $sub5E_headers_arr = [\n 'B305' => 'Months', 'C305' => 'No. of Nonconformity raised without recurrence', 'D305'=>'No. of Issued CPIAR for the Nonconformities raised',\n 'E305' =>'Percentage %', 'F305' => 'Target'\n ];\n foreach ($sub5E_headers_arr as $cell => $value) {\n $sheet->cell($cell, function ($cell) use ($value) {\n $cell->setValue($value);\n });\n $sheet->getStyle($cell)->getAlignment()->setWrapText(true);\n }\n $sheet->cells('B305:F305', function ($cells) {\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n /** END */\n \n /** Start styling of row of Months, subheaders. */\n $table_col_header = ['B', 'C', 'D', 'E', 'F'];\n $table_header_arr = [11, 33, 53, 73, 93, 113, 133, 153, 174, 195, 217, 239, 261, 283, 305];\n for ($i = 0; $i < count($table_col_header); $i++) {\n for ($j = 0; $j < count($table_header_arr); $j++) {\n $sheet->cells($table_col_header[$i].$table_header_arr[$j], function ($cells) {\n $cells->setBorder('thick', 'thick', 'thin', 'thick');\n });\n }\n }\n \n \n /**\n * Set column header for status\n */\n\n $status_header_arr = [ 10 => 11, 32 => 33, 52 => 53, 72 => 73, 92 => 93, 112 => 113, 132 => 133, 152 => 153, 173 => 174, 194 => 195, 216 => 217, 238 => 239, 260 => 261, 282 => 283, 304 => 305];\n foreach ($status_header_arr as $row1 => $row2) {\n $sheet->mergeCells('G'.$row1.':G'.$row2);\n $sheet->cells('G'.$row1.':G'.$row2, function ($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n $cells->setFontWeight('bold');\n $cells->setBorder('thick', 'thick', 'thin', 'thick');\n });\n $sheet->mergeCells('H'.$row1.':H'.$row2);\n $sheet->cells('H'.$row1.':H'.$row2, function ($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n $cells->setFontWeight('bold');\n $cells->setBorder('thick', 'thick', 'thin', 'thick');\n });\n $sheet->mergeCells('I'.$row1.':I'.$row2);\n $sheet->cells('I'.$row1.':I'.$row2, function ($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n $cells->setFontWeight('bold');\n $cells->setBorder('thick', 'thick', 'thin', 'thick');\n });\n $sheet->mergeCells('J'.$row1.':J'.$row2);\n $sheet->cells('J'.$row1.':J'.$row2, function ($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n $cells->setFontWeight('bold');\n $cells->setBorder('thick', 'thick', 'thin', 'thick');\n });\n $sheet->cell('G'.$row1, function ($cell) {\n $cell->setValue('Status');\n });\n $sheet->cell('H'.$row1, function ($cell) {\n $cell->setValue('Other details and/or Explanation if below the target');\n });\n $sheet->setSize('H'.$row1, 58.57, 50);\n $sheet->cell('I'.$row1, function ($cell) {\n $cell->setValue('Actions to be Taken (Action Plans)');\n });\n $sheet->setSize('I'.$row1, 37.57, 40);\n $sheet->cell('J'.$row1, function ($cell) {\n $cell->setValue('Commit Date');\n });\n $sheet->setSize('J'.$row1, 20, 30);\n }\n /**\n * Set row attribute for rows\n */\n $sheet->row(11, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n $row->setFontWeight('bold');\n });\n /**\n * Set alignment/border for row 12 to 23\n * This is the cells that contains data\n * used in foreach\n * */\n \n $column_header = ['B','C','D', 'E', 'F','G','H','I','J'];\n /** Start report 1 cell styling */\n for ($i = 12; $i <= 27; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2A */\n for ($i = 34; $i <= 49; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2B */\n for ($i = 54; $i <= 69; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2C */\n for ($i = 74; $i <= 89; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2D */\n for ($i = 94; $i <= 109; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2E */\n for ($i = 114; $i <= 129; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2F */\n for ($i = 134; $i <= 149; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 2F.1 */\n for ($i = 154; $i <= 169; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 3 */\n for ($i = 175; $i <= 190; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n /** Start report 4 */\n for ($i = 196; $i <= 211; $i++) {\n $sheet->row($i, function ($row) {\n $row->setAlignment('center');\n $row->setValignment('center');\n });\n for ($j = 0; $j < count($column_header); $j++) {\n $sheet->cells($column_header[$j].$i, function ($cells) {\n $cells->setBorder('thin', 'thin', 'thin', 'thin');\n });\n }\n }\n /**END */\n \n /**\n * For report #5 with different format (Quarter and Semister)\n **/\n $rep5_months = (object) [\n 0 => 'JANUARY', 1 => 'FEBRUARY', 2 =>'MARCH', 3 =>'Q1',\n 4 =>'APRIL', 5 =>'MAY', 6 =>'JUNE' , 7 => 'Q2', 8 => 'SEM 1',\n 9 => 'JULY', 10 => 'AUGUST', 11 => 'SEPTEMBER', 12 => 'Q3',\n 13 => 'OCTOBER', 14 => 'NOVEMBER', 15 => 'DECEMBER', 16 => 'Q4', 17 => 'SEM 2'\n // [\n // 'month' => 'JANUARY',\n // 'quarter' => 'Q1',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month' => 'FEBRUARY',\n // 'quarter' => 'Q1',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month' => 'MARCH',\n // 'quarter' => 'Q1',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month'=>'APRIL',\n // 'quarter' => 'Q2',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month'=>'MAY',\n // 'quarter' => 'Q2',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month'=>'JUNE',\n // 'quarter' => 'Q2',\n // 'semester' => 'SEM 1',\n // ],\n // [\n // 'month'=>'JULY',\n // 'quarter' => 'Q3',\n // 'semester' => 'SEM 2',\n // ],\n // [\n // 'month'=>'AUGUST',\n // 'quarter' => 'Q3',\n // 'semester' => 'SEM 2',\n // ],\n // [\n // 'month'=>'SEPTEMBER',\n // 'quarter' => 'Q3',\n // 'semester' => 'SEM 2',\n // ],\n // [\n // 'month'=>'OCTOBER',\n // 'quarter' => 'Q4',\n // 'semester' => 'SEM 2',\n // ],\n // [\n // 'month'=>'NOVEMBER',\n // 'quarter' => 'Q4',\n // 'semester' => 'SEM 2',\n // ],\n // [\n // 'month'=>'DECEMBER',\n // 'quarter' => 'Q4',\n // 'semester' => 'SEM 2',\n // ]\n ];\n\n /**\n * Printing report months\n **/\n $rep5A_row = 218;\n $rep5B_row = 240;\n $rep5C_row = 262;\n $rep5D_row = 284;\n $rep5E_row = 306;\n\n foreach ($rep5_months as $key => $value) {\n //$sheet->setCellValueByColumnAndRow(1, $rep5A_row + $key, $value['month']);\n $r1 = $rep5A_row + $key;\n $r2 = $rep5B_row + $key;\n $r3 = $rep5C_row + $key;\n $r4 = $rep5D_row + $key;\n $r5 = $rep5E_row + $key;\n /** set months for 5.A */\n $sheet->setCellValueByColumnAndRow(1, $r1, $value);\n $sheet->setCellValueByColumnAndRow(2, $r1, 0);\n $sheet->setCellValueByColumnAndRow(4, $r1, '-');\n $sheet->setCellValueByColumnAndRow(5, $r1, '100%');\n $sheet->setCellValueByColumnAndRow(6, $r1, 'MET');\n /** set months for 5.B */\n $sheet->setCellValueByColumnAndRow(1, $r2, $value);\n $sheet->setCellValueByColumnAndRow(2, $r2, 0);\n $sheet->setCellValueByColumnAndRow(4, $r2, '-');\n $sheet->setCellValueByColumnAndRow(5, $r2, '100%');\n $sheet->setCellValueByColumnAndRow(6, $r2, 'MET');\n /** set months for 5.C */\n $sheet->setCellValueByColumnAndRow(1, $r3, $value);\n $sheet->setCellValueByColumnAndRow(2, $r3, 0);\n $sheet->setCellValueByColumnAndRow(4, $r3, '-');\n $sheet->setCellValueByColumnAndRow(5, $r3, '100%');\n $sheet->setCellValueByColumnAndRow(6, $r3, 'MET');\n /** set months for 5.D */\n $sheet->setCellValueByColumnAndRow(1, $r4, $value);\n $sheet->setCellValueByColumnAndRow(2, $r4, 0);\n $sheet->setCellValueByColumnAndRow(4, $r4, '-');\n $sheet->setCellValueByColumnAndRow(5, $r4, '100%');\n $sheet->setCellValueByColumnAndRow(6, $r4, 'MET');\n /** set months for 5.E */\n $sheet->setCellValueByColumnAndRow(1, $r5, $value);\n $sheet->setCellValueByColumnAndRow(2, $r5, 0);\n $sheet->setCellValueByColumnAndRow(4, $r5, '-');\n $sheet->setCellValueByColumnAndRow(5, $r5, '100%');\n $sheet->setCellValueByColumnAndRow(6, $r5, 'MET');\n\n if ($value == 'Q1' || $value == 'Q2' || $value == 'Q3' || $value == 'Q4' || $value == 'SEM 1' || $value == 'SEM 2') {\n $sheet->cells('B'.$r1.':G'.$r1, function ($cells) {\n $cells->setFontWeight('bold');\n });\n $sheet->cells('B'.$r2.':G'.$r2, function ($cells) {\n $cells->setFontWeight('bold');\n });\n $sheet->cells('B'.$r3.':G'.$r3, function ($cells) {\n $cells->setFontWeight('bold');\n });\n $sheet->cells('B'.$r4.':G'.$r4, function ($cells) {\n $cells->setFontWeight('bold');\n });\n $sheet->cells('B'.$r5.':G'.$r5, function ($cells) {\n $cells->setFontWeight('bold');\n });\n }\n /** Set horizontal alignment to center for 5.A to 5.E */\n $sheet->cells('B'.$r1.':J'.$r1, function ($cells) {\n $cells->setAlignment('center');\n });\n $sheet->cells('B'.$r2.':J'.$r2, function ($cells) {\n $cells->setAlignment('center');\n });\n $sheet->cells('B'.$r3.':J'.$r3, function ($cells) {\n $cells->setAlignment('center');\n });\n $sheet->cells('B'.$r4.':J'.$r4, function ($cells) {\n $cells->setAlignment('center');\n });\n $sheet->cells('B'.$r5.':J'.$r5, function ($cells) {\n $cells->setAlignment('center');\n });\n $sheet->setBorder('B'.$r1.':J'.$r1, 'thin');\n $sheet->setBorder('B'.$r2.':J'.$r2, 'thin');\n $sheet->setBorder('B'.$r3.':J'.$r3, 'thin');\n $sheet->setBorder('B'.$r4.':J'.$r4, 'thin');\n $sheet->setBorder('B'.$r5.':J'.$r5, 'thin');\n }\n\n /**\n * END\n **/\n\n /**\n * SET COLUMN WIDTH\n * You can set multiple columns here\n */\n $sheet->setWidth(\n array(\n 'A' => 3.86,\n 'B' => 14.30,\n 'C' => 14,\n 'D' => 18,\n 'E' => 22,\n 'F' => 14,\n 'G' => 17\n )\n );\n /**\n * Set height for multitple rows\n */\n $sheet->setHeight(array(\n 10 => 31.5,\n 112 => 33\n ));\n /**\n * Set single cell size\n */\n // $sheet->setSize(array(\n // 'C6' => array(\n // 'width' => 17.43,\n // 'height' => 500\n // )\n // ));\n /**\n * Set Sheet Protection settings\n * excel itself is not supported in PHPExcel\n * only in PHPSpreadsheet\n */\n $sheet->getProtection()->setPassword('l0cl!$t');\n $sheet->getProtection()->setSheet(true);\n $sheet->getProtection()->setSort(true);\n $sheet->getProtection()->setInsertRows(true);\n $sheet->getProtection()->setFormatCells(true);\n });\n });\n\n $filename = $file->filename;\n $file = $file->string('xlsx');\n\n return [\n 'filename' => $filename,\n 'file' => \"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,\".base64_encode($file),\n 'year' => $report_year\n ];\n }", "public function emp_report(Request $request){\n\t\t$inputs['month'] = date('m');\n\t\t$inputs['year'] = date('Y');\n\t\t$data['inputs'] = $inputs;\n\t\t$fromDate =$inputs['year'].'-'.$inputs['month'].'-'.'1';\n\t\t$toDate=$inputs['year'].'-'.$inputs['month'].'-'.date('t');\n $range = [$fromDate, $toDate]; \n\t\t//$reviews = ProjectReview::where('user_id',Auth::user()->id)->get();\n\t\t//if(Auth::user()->role == 6){\n $data = $this->prepare_report(Auth::user()->id, date('m'), date('Y'));\n $data['month'] = $inputs['month'];\n\t \t$data['year'] = $inputs['year'];\n\t\t $eod_project = Eod::where('user_id',Auth::user()->id)->whereBetween('date', $range)->distinct('project_id')->pluck('project_id');\n // dd($eod_project);\n\t\t\n\t\t if(!is_null($eod_project))\n\t\t { \n\t\t\t$data['emp_projects'] = Project::whereIn('id',$eod_project)\n\t\t\t //->join('project_reviews','project_reviews.project_id','=','projects.id')\n\t\t\t // ->whereBetween('emp_update_month', $range)\n ->get();\n\t\t }\n\t // }\n\t // if(Auth::user()->role == 4){\n\t // \t $data = $this->prepare_report(Auth::user()->id, date('m'), date('Y'));\n // $data['month'] = $inputs['month'];\n\t // \t$data['year'] = $inputs['year'];\n\t\t // $eod_project = Eod::where('user_id',Auth::user()->id)->whereBetween('date', $range)->distinct('project_id')->pluck('project_id');\n // // dd($eod_project);\n\t\t\n\t\t // if(!is_null($eod_project))\n\t\t // { \n\t\t\t// $data['emp_projects'] = Project::whereIn('id',$eod_project)\n\t\t\t// //->join('project_reviews','project_reviews.project_id','=','projects.id')\n\t\t\t// // ->whereBetween('emp_update_month', $range)\n // ->get();\n\t\t // }\n\t // }\n\t\t\n \t//print_r($data['emp_projects']);die();\n // foreach($data['emp_projects'] as $project)\n // {\n \n // \t $data['projects_review'] = ProjectReview::where('user_id',Auth::user()->id)->where('project_id',$project->project_id)->first();\n // \t // print_r($data['projects_review']);die();\n \t\n // }\n\n \t//print_r($data['projects_review']);\n\t\treturn view('common.reports.emp_report', $data); \n\t}", "public function sales_report(){\n ini_set(\"memory_limit\",\"512M\");\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $executive = array('' => 'Select');\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n $data['executive'] = $executive;\n if (!empty($_POST)) {\n $sales_executive_id = $this->input->post('sales_exec');\n $start = $this->input->post('start_date');\n $end = $this->input->post('end_date');\n $all_data = $this->reportsModel->salesrep($tenant_id,$sales_executive_id,$start,$end);\n $data['final_data']=$all_data;\n }\n if($this->input->post('start_date')=='' || $this->input->post('end_date')==''){\n $data['error']='Kindly Select The Date Range!!';\n }\n $data['page_title'] = 'Reports';\n $data['main_content'] = 'reports/sales_reports';\n $this->load->view('layout', $data);\n }" ]
[ "0.76985073", "0.7221716", "0.6984586", "0.6580522", "0.650633", "0.6465776", "0.63977027", "0.63785875", "0.6225617", "0.6208223", "0.61751956", "0.614161", "0.6124895", "0.61182946", "0.6103934", "0.61004525", "0.6095921", "0.6072185", "0.60597414", "0.603011", "0.5998244", "0.5995478", "0.5983425", "0.5981332", "0.59759796", "0.59372586", "0.5935564", "0.5927218", "0.59226745", "0.5922098", "0.590479", "0.59007955", "0.59007955", "0.5900106", "0.58973145", "0.5894927", "0.5888903", "0.58871955", "0.58842313", "0.58732855", "0.5870393", "0.58698887", "0.58634746", "0.58605564", "0.58596253", "0.5855849", "0.58441824", "0.5840623", "0.58375204", "0.58234644", "0.58159536", "0.5808022", "0.58040124", "0.57979953", "0.57958734", "0.5792192", "0.57906234", "0.57846904", "0.57832277", "0.57794446", "0.5776848", "0.57582885", "0.5753782", "0.5749917", "0.57489187", "0.5743475", "0.5737691", "0.57184625", "0.57139385", "0.571009", "0.57100767", "0.57074827", "0.57071704", "0.5702296", "0.56992954", "0.5695036", "0.5691171", "0.5691171", "0.56767", "0.5670721", "0.56659764", "0.5665527", "0.56650114", "0.56637686", "0.5652797", "0.5650575", "0.56386065", "0.5637311", "0.5636435", "0.56361204", "0.5632724", "0.56324667", "0.5628851", "0.5622147", "0.5618109", "0.5611671", "0.5610149", "0.56092715", "0.5608693", "0.56033874" ]
0.8395774
0
generate_subject_code_attendance_report function. commit 10/11/2018
Функция generate_subject_code_attendance_report. коммит 10/11/2018
public function generate_subject_code_attendance_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty')); // get inputs $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $students = $this->admin_model->getStudentsBasicInfo($con,'a'); $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']); $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance) && !empty($att_record)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); }else{ $this->session->set_flashdata('danger', 'Invalid input.'); } redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }", "public function generate_voc_program_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar'));\n // get inputs\n $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program']));\n $students = $this->admin_model->getStudentsBasicInfo($condition,'a');\n $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']);\n $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n redirect('attendance_report');\n }\n $this->session->set_flashdata('danger', 'Invalid input.');\n redirect('attendance_report');\n \n }", "public function generate()\n {\n $start_year = $this->_vars['start_year'];\n $start_month = $this->_vars['start_month'];\n $start_day = $this->_vars['start_day'];\n\n $end_year = $this->_vars['end_year'];\n $end_month = $this->_vars['end_month'];\n $end_day = $this->_vars['end_day'];\n\n $code = '';\n\n if (empty($this->_vars['start']) || empty($this->_vars['end'])) {\n return $this->_vacationCode();\n } elseif ($end_year > $start_year + 1) {\n $code .= $this->_yearCheck($start_year + 1, $end_year - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\"\n . $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year + 1) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($end_month > $start_month) {\n if ($end_month > $start_month + 1) {\n $code .= $this->_monthCheck($start_month + 1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\"\n . $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n } elseif ($end_month == $start_month) {\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n }\n $code .= \"}\";\n }\n\n return $code;\n }", "function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "abstract public function buildReport();", "public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}", "function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }", "public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "function generate_weekly_report_txt($c_data=array()){\n\t\t\n\t\tApp::import('Helper','txt');\n\t\t$txt = new txtHelper();\n\t\t$line = array(\"Store number\",\"Terminal\",\"Vendor\",\"Product\",\"Item\",\"Face Value\",\"Billed downloads\",\"Billed returns\",\"Net Billed Downloads\",\"Net Face Value\",\"Net Cost\",\"Net Commission\",\"Merchant\",\"Site\",\"Street\",\"Postcode\",\"City\",\"Duplicate Downloads\",\"All Downloads\",\"Duplicate Returns\",\"All Returns\",\"Net All Downloads\",\"Download Face Value\",\"Download Cost\",\"Download Commission\",\"Return Face Value\",\"Return Cost\",\"Return Commission\",\"From\",\"To\");\n\t\t$txt->addRow($line);\n\t\tif(!empty($c_data)){\n\t\t\tforeach($c_data as $data){\n\t\t\t\n\t\t\t\t$line = array($data['u']['u_id'],'X','X','X',$data['p']['p_id'],'X',$data['0']['total'],'X',$data['0']['total'],'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X');\n\t\t\t\t$txt->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $txt->render(date(\"d_M_Y_h_i_s\").\"_weekly\");\n\t\texit();\n\t}", "public function report($typeId = null, $reportDate = null, $numOfDays = null, $classId = null, $sectionId = null)\n\t{\t\t\t\n\t\t$year = substr($reportDate, 0, 4);\n\t\t$month = substr($reportDate, 5, 7);\t\t\n\n\t\t$classData = $this->model_classes->fetchClassData($classId);\n\t\t$sectionData = $this->model_section->fetchSectionByClassSection($classId, $sectionId);\n\n\t\t\t// student\t\t\t\n\t\t\t$div = '<div class=\"well\">\n\t\t\t\t<center>\n\t\t\t\t\t<h4> Ngành học: '.$classData['class_name'].'<br> Lớp học : '.$sectionData['section_name'].'<h4>\n\t\t\t\t\t<h4> Năm : '.$year.' - Month :'.$month.'<h4>\t\t\n\t\t\t\t\t<small>\t\n\t\t\t\t\t\t1 : Tiết 1-2 ( 7h00-8h45) <br />\t\t\t\t\n\t\t\t\t\t\t2 : Tiết 3-4 (9h-10h45) <br />\n\t\t\t\t\t\t3 : Tiết 5-6 (13h - 14h45)<br />\n\t\t\t\t\t\t4 : Tiết 7-8 (15h-16h45)<br />\n\t\t\t\t\t\t\t5 : Tiết 9-10 (17h00 - 18h45)<br />\n\t\t\t\t\t</small>\n\t\t\t\t</center>\n\t\t\t</div>\n\n\t\t\t<div style=\"overflow-x:auto;\">\t\t\t\n\t\t\t<table class=\"table table-bordered\" style=\"width:100%;\">\t\t\t\n\t\t\t\t<tbody style=\"width:100%;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"width:25%;\">Môn học</td>\n\t\t\t\t\t\t';\t\t\n\t\t\t\t\t\t// loop for days\n\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t<td style=\"width:10%;\">'.$i.'</td>';\t\n\t\t\t\t\t\t} // /for\n\t\t\t\t\t$div .= '</tr>';\n\t\t\t\t\t\t\n\t\t\t\t\t$subjectInfo = $this->model_subject->fetchSubjectDataByClass($classId);\n\n\t\t\t\t\tforeach ($subjectInfo as $key => $value) {\n\t\t\t\t\t\t$subjectName = $value['name'];\n\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$subjectName.'</td>';\n\n\t\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t\t// $attendanceData = $this->model_attendance->getAttendance($i, $reportDate, $value['student_id'], $typeId, $classId, $sectionId);\n\t\t\t\t\t\t\t\t$scheduleData = $this->model_schedule->getAttendance($i, $reportDate, $value['subject_id'], $sectionId);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$div .= '<td>';\n\t\t\t\t\t\t\t\tforeach ($scheduleData as $scheduleKey => $scheduleValue) {\n\n\t\t\t\t\t\t\t\t\tif($scheduleValue['schedule_type'] == 1) {\n\t\t\t\t\t\t\t\t\t\t// Có mặt\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-success\">1</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 2) {\n\t\t\t\t\t\t\t\t\t\t// Vắng\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-primary\">2</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 3) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">3</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 4) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">4</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Không xác định\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-danger\">5</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$div .= $scheduleStatus;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t\t</td>';\t\n\t\t\t\t\t\t\t\t} // /for\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t$div .= '</tr>';\t\t\n\t\t\t\t\t} // /foreach\n\t\t\t\t$div .= '</tbody>\n\t\t\t\t</table>\n\t\t\t<div>';\t\t\t\n\t\t\techo $div;\n\t\t\n\n\t\t\n\t}", "public function Get_Special_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=special&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT DISTINCT `course_id` FROM `course_hire_special_instructor` WHERE `status` = '1' AND `semester_id` = \".$semester_id;\n $result_course = $this->DB->Query($sql);\n if($result_course)\n {\n for($i=0;$i<count($result_course);$i++)\n {\n if(!in_array($result_course[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`cv` FROM `course_hire_special_instructor` ci ,`special_instructor` si \";\n $sql.= \"WHERE ci.`instructor_id` = si.`instructor_id` AND ci.`course_id` = '\".$result_course[$i]['course_id'].\"' AND ci.`status` = '1' AND ci.`semester_id` = \".$semester_id;\n $result_instructor = $this->DB->Query($sql);\n $data = array();\n $data['id'] = $result_course[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['special'] = array();\n if($result_instructor)\n {\n for($j=0;$j<count($result_instructor);$j++)\n {\n $instructor['id'] = $result_instructor[$j]['instructor_id'];\n $instructor['name'] = $result_instructor[$j]['prefix'].' '.$result_instructor[$j]['firstname'].' '.$result_instructor[$j]['lastname'];\n $instructor['cv'] = $this->PERSON->Get_CV($instructor['id']);\n $instructor['pdf'] = $this->VIEW_URL.\"?course=\".$data['id'].\"&id=\".$instructor['id'].\"&type=complete&info=special&semester=\".$semester.\"&year=\".$year;\n array_push($data['special'],$instructor);\n }\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n }", "function generate_xls(){ \n //Would like to ask for term to generate report for. Can we do this?\n global $CFG, $DB, $USER;\n\n\n\n //find all workers\n $workers = $DB->get_records('block_timetracker_workerinfo');\n\n foreach($workers as $worker){\n //demo courses, et. al.\n if($worker->courseid >= 73 && $worker->courseid <= 76){\n continue;\n }\n\n $earnings = get_earnings_this_term($worker->id,$worker->courseid);\n \n $course = $DB->get_record('course', array('id'=>$worker->courseid));\n echo $course->shortname.','.$worker->lastname.','.$worker->firstname.\n ','.$earnings.','.$worker->maxtermearnings.\"\\n\";\n }\n}", "function php_gen_report($date) {\r\n\r\n $uid = php_get_uid();\r\n $returnStatus['status'] = 'undefined';\r\n\r\n php_database_connect();\r\n\r\n $safe_uid = GetSQLValueString($uid, 'int');\r\n\r\n if (!php_check_convert_resv_date($date, $d, $m, $y)) {\r\n $returnStatus['status'] = 'Date format is incorrect';\r\n return $returnStatus;\r\n }\r\n\r\n //Get the date from the MySQL server.\r\n $query = \"SELECT DATE_FORMAT(NOW(),'%d, %M, %Y %h:%i%p') AS 'current_time'\";\r\n $rs = php_database_query($query);\r\n $timeInfo = mysql_fetch_array($rs);\r\n if (empty($timeInfo)) {\r\n $returnStatus['status'] = 'Cannot get the database server time';\r\n return $returnStatus;\r\n }\r\n\r\n $arrMonth = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');\r\n $strM = $arrMonth[$m];\r\n\r\n $header = '<h2>Reservation Report</h2>';\r\n $header = $header . '<h4>Current Date Time:' . $timeInfo['current_time'] . '</h4>';\r\n $header = $header . '<h4>Selected from:' . $d . ', ' . $strM . ', ' . $y . ' (Maximum 200 records will be shown)</h4>';\r\n\r\n //lookup table to query the output from restID, date, person, special request\r\n #and then lookup the customer name.\r\n $safe_timeslot = GetSQLValueString($y . '-' . $m . '-' . $d, 'date');\r\n\r\n $query = sprintf(\"SELECT id, cust_id, DATE_FORMAT(timeslot, '%%d, %%M, %%Y %%h:%%i%%p') AS datetime_timeslot, person, special_request, HEX(response) AS hex_response FROM resv WHERE rest_id = %s AND DATE(timeslot) >= DATE(%s) ORDER BY timeslot ASC LIMIT 200\", $safe_uid, $safe_timeslot);\r\n $rs = php_database_query($query);\r\n $body = '';\r\n\r\n while ($resvInfo = mysql_fetch_array($rs)) {\r\n $query = sprintf(\"SELECT fullname FROM customer WHERE id = %s\", $resvInfo['cust_id']);\r\n $custResult = php_database_query($query);\r\n $custInfo = mysql_fetch_array($custResult);\r\n if (empty($custInfo)) {\r\n $returnStatus['status'] = 'Cannot get the customer info';\r\n return $returnStatus;\r\n }\r\n\r\n $htmlElement['time'] = $resvInfo['datetime_timeslot'];\r\n $htmlElement['person'] = $resvInfo['person'];\r\n $htmlElement['customer_name'] = $custInfo['fullname'];\r\n $htmlElement['msg'] = $resvInfo['special_request'];\r\n $htmlElement['resv_id'] = $resvInfo['id'];\r\n $htmlElement['response'] = \"undefined\";\r\n\r\n switch (intval($resvInfo['hex_response'])) {\r\n case 0: //pending\r\n $htmlElement['response'] = 'pending';\r\n break;\r\n case 1: //decline\r\n $htmlElement['response'] = 'decline';\r\n break;\r\n case 2: //accept\r\n $htmlElement['response'] = 'accept';\r\n break;\r\n default:\r\n $htmlElement['response'] = 'undefined';\r\n }\r\n\r\n $body = $body . \"<tr><td>\" . $htmlElement['time'] . \"</td><td>\" . $htmlElement['customer_name'] . \"</td><td>\" . $htmlElement['person'] . \"</td><td>\" . $htmlElement['msg'] . \"</td><td>\" . $htmlElement['resv_id'] . \"</td><td>\" . $htmlElement['response'] . \"</td></tr>\\n\";\r\n }\r\n\r\n $body = \"<table><thead><tr><th>Date Time</th><th>Customer Name</th><th>Person</th><th>Special Request</th><th>Resv ID</th><th>Response</th></tr></thead>\\n<tfoot><tr><td colspan=\\\"6\\\">The end</td></tr></tfoot>\\n<tbody>\" . $body . \"</tbody></table>\";\r\n //re-factoring the query string\r\n\r\n $footer = \"\";\r\n\r\n $reportTxt = $header . $body . $footer;\r\n echo $reportTxt;\r\n\r\n $returnStatus['status'] = 'success';\r\n return $returnStatus;\r\n}", "public function reportTeacherDatewiseAttendent()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n return view('report.reportTeacherDatewiseAttendent')->wit;\n }", "function generate_report_modelwise($id, $field, $from, $to) {\n switch ($field) {\n case 'tl':\n $fieldName = 'Team_Lead';\n break;\n case 'dse':\n $fieldName = 'DSE';\n break;\n case 'asm':\n $fieldName = 'ASM_SM';\n break;\n case '6':\n $fieldName = 'Team_Lead';\n break;\n case '7':\n $fieldName = 'DSE';\n break;\n case '5':\n $fieldName = 'ASM_SM';\n break;\n }\n $empID = $id;\n $this->db->where('Inv_Dt >=', $from);\n $data = $this->db->get_where('rtl_daily_rep', array($fieldName => $id))->result_array();\n $countArr = array();\n\n foreach ($data as $k => $d) {\n if ($d['Model'] != 'Total_Target') {\n $id = $d['Model'];\n $countVar = 0;\n foreach ($data as $key => $var) {\n if ($id == $var['Model']) {\n $countVar++;\n }\n\n $countArr[strtoupper((string) $d['Model'])]['achieved'] = $countVar;\n $countArr[strtoupper((string) $d['Model'])]['target'] = 0;\n }\n }\n }\n\n $select = array(\n 'target_table_id',\n 'target_table_emp_id',\n 'employe_table_employe_name',\n 'target_table_product',\n 'target_table_product_qty',\n 'target_table_exp_date'\n );\n $toNxt = new DateTime($to);\n $toNxt->modify('+1 day');\n $to = date_format($toNxt,\"Y-m-d\");\n $col = 'target_table_emp_id';\n $Where = (\"DATE (target_table_create) BETWEEN '$from' AND '$to' AND $col = $empID\");\n $this->db->where('target_table_target_level',$field);\n if($field == 6)\n $data['tl'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 7)\n $data['dse'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 5)\n $data['asm'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n\n switch ($field) {\n case 'tl':\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'dse':\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'asm':\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n break;\n case 6:\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 7:\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 5:\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n }\n\n\n\n return $countArr;\n }", "public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }", "public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public static function generate()\n {\n $data = array();\n foreach (College::all() as $college) {\n # $current = The current year\n # $should = How many actieve assessors there is needed at the end of the year\n # $count = Count of all the active assessors\n $data[$college->id] = array(\n 'current' => date('Y'),\n 'should' => 1 + round(Assessors::where('fk_college', $college->id)->where('status', 1)->count() / 100 * 110),\n 'count' => Assessors::where('fk_college', $college->id)->where('status', 1)->count()\n );\n }\n return $data;\n }", "function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function prepare_report($emp, $month, $year){\n\n // echo $emp.' '.$month.' '.$year;\n\t\t$start = date('Y-m-d', strtotime(\"$year-$month-01\")); \n\t $end = date('Y-m-t', strtotime($start));\n\t\t$data['attendance'] = calculate_attendance($emp,$start,$end);\n\t\t\n\t\t//array_walk($data['attendance'], function(&$key, $b) { ucwords(str_replace('_', ' ', $key)) }); \n\t\t$data['at_labels'] = json_encode(['Present','Absent','Half Day','Uninformed Leave','Sandwich Leave','Late Login']); \n\t\t$data['at_values'] = json_encode(array_values($data['attendance'])); \n\t\t\n\t\t$project_data = Project::join('project_assignation','projects.id','project_assignation.project_id')\n\t\t\t\t\t\t\t\t->join('users','project_assignation.employee_id','users.id')\n\t\t\t\t\t\t\t\t->join('eods','eods.user_id','users.id')\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t ->select('projects.project_name','projects.id', DB::Raw('SUM(eods.today_hours) as pr_time'))\n\n\t\t\t\t\t\t\t\t->where('users.id', $emp)\n\t\t\t\t\t\t\t\t->whereMonth('eods.date', $month)\t\n\t\t\t\t\t\t\t\t->whereYear('eods.date', $year)\t \t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->whereRaw('eods.project_id = projects.id')\n\t\t\t\t\t\t\t\t->groupBy('projects.project_name','projects.id')\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t->get(); \n\n\n\t \n\t\t\n\t\t\t$sum = array_sum(array_column($project_data->toArray(),'pr_time')); \n\n\t\t\t$data['projects'] = $project_data;\n\t\t\tforeach($project_data as $project){\n\t\t\t\t$labels[] = $project->project_name;\n\t\t\t\t$cdata[] = number_format(($project->pr_time*100) / $sum, 2); \n\t\t\t\t//$sdata[] = array('label'=> $project->project_name,'data'=>number_format(($project->pr_time*100) / $sum, 2),'backgroundColor'=>'green','borderColor'=>'red') ;\n\t\t\t\t$sdata[] = array('label'=>$project->project_name,'y'=>number_format(($project->pr_time*100) / $sum, 2));\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!empty($labels) && !empty($cdata)){\n\t\t $data['labels'] = json_encode($labels);\n\t\t $data['cdata'] = json_encode($cdata);\n\t\t $data['sdata'] = json_encode($sdata); \n\t\t\t} \n\t\t\t//print_r($data['sdata']);\n\n\t\t return $data; \n\t}", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "public function reportTeacherMonthlyAttendent()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n return view('report.reportTeacherMonthlyAttendent')->with('year',$year);\n }", "function stp_getSubject($date_to_use='now') {\r\n\r\n\t// Array of Christian Science Bible Lesson subjects \r\n\t$cs_lesson_subjects = array(\r\n\t\t__('God', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Sacrament', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Life', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Truth', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Love', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Spirit', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mind', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christ Jesus', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Substance', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Matter', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Reality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Unreality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Are Sin, Disease, and Death Real?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Doctrine of Atonement', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Probation After Death', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Everlasting Punishment', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Adam and Fallen Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mortals and Immortals', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul and Body', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Ancient and Modern Necromancy, <i>alias</i> Mesmerism and Hypnotism, Denounced', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Only Cause and Creator', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Preserver of Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Is the Universe, Including Man, Evolved by Atomic Force?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christian Science', 'christian-science-bible-lesson-subjects')\r\n\t\t);\r\n\t\r\n\t// repeat the array since lesson subjects are repeated twice a year in the same order\r\n\t$cs_lesson_subjects = array_merge($cs_lesson_subjects, $cs_lesson_subjects);\r\n\r\n\t// Bonus lesson for years with 53 Sundays\r\n\t$cs_lesson_subjects[] = __('Christ Jesus', 'christian-science-bible-lesson-subjects');\r\n\t\r\n\t// Add a blank entry to the front of the array so we're matching week 1 = [1]\r\n\tarray_unshift($cs_lesson_subjects, \"\");\r\n\r\n\t// Get the lesson for the upcoming next Sunday for any given date\r\n // Use strftime('%U, ...) not date(\"W\", ...) in order to get weeks of the year using Sunday as starting day, not Monday\r\n\t$week_num_sun = (int) strftime('%U', strtotime('next Sunday ' . $date_to_use));\r\n\r\n\treturn $cs_lesson_subjects[$week_num_sun];\r\n\r\n}", "function getStudentReport( $datetypeselect, $startdate, $enddate, $classyear,\r\n\t\t\t\t $residenceselect, $ethnic, $userselect, $watched, $redflag, $vip,\r\n\t\t\t\t $acpro, $housingwaitlist, $field1, $field2, $field3 ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \"left\";\r\n\t\t\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tSELECT x.ID,\r\n\t\t\t concat( x.LAST_NAME, ', ', x.FIRST_NAME, ' ', x.MIDDLE_NAME ) as FullName,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as AssignedToName,\r\n\t\t\t s.AssignedTo,\r\n\t\t\t x.ENROLL_STATUS,\r\n\t\t\t x.CAMPUS_PHONE,\r\n\t\t\t x.CELL_PHONE,\r\n\t\t\t x.WOOSTER_EMAIL,\r\n\t\t\t x.PRIMARY_EMAIL,\r\n\t\t\t x.CAMPUS_BOX,\r\n\t\t\t x.CLASS_YEAR,\r\n\t\t\t s.AcProbation,\r\n\t\t\t s.HousingWaitList,\r\n\t\t\t s.Field1,\r\n\t\t\t s.Field2,\r\n\t\t\t s.Field3,\r\n\t\t\t s.VIP,\r\n\t\t\t s.RedFlag,\r\n\t\t\t x.HOME_PHONE,\r\n\t\t\t concat( x.HOUSING_BLDG, ' ', x.HOUSING_ROOM ) as HousingAssignment,\r\n\t\t\t x.ETHNIC,\r\n\t\t\t x.ADVISOR\r\n\t\t\tFROM X_PNSY_STUDENT x, students s, users u, contacts c, `contacts-students` cs\r\n\t\t\tWHERE x.ID = s.StudentID AND cs.ContactID = c.ID $datestuff AND cs.StudentID = x.ID\r\n\t\t\tAND s.StudentID IN (SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID)\r\n\t\t\";\r\n\t\t\r\n\t\tif( $classyear ) $query .= \" and x.CLASS_YEAR = '$classyear'\";\r\n\r\n\t\tif( $residenceselect ) $query .= \" and x.HOUSING_BDLG = '$residenceselect'\";\r\n\t\tif( $userselect ) $query .= \" and s.assignedto = '$userselect'\";\r\n\t\tif( isset($watched) ) $query .= \" and x.ID in (select studentid from studentwatch where userid = '$userid')\";\r\n\t\tif( isset($redflag) ) $query .= \" and s.redflag != ''\";\r\n\t\tif( isset($vip) ) $query .= \" and s.vip != ''\";\r\n\t\tif( isset($acpro) ) $query .= \" and s.acprobation = 1\";\r\n\t\tif( isset($housingwaitlist) ) $query .= \" and s.housingwaitlist = 1\";\r\n\t\tif( isset($field1) ) $query .= \" and s.Field1 = 1\";\r\n\t\tif( isset($field2) ) $query .= \" and s.Field2 = 1\";\r\n\t\tif( isset($field3) ) $query .= \" and s.Field3 = 1\";\r\n\t\t$query .= \" group by x.ID order by x.LAST_NAME\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-students` cs\r\n\t\t\t\t\twhere cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-students` cs\r\n\t\t\t\t\ton cs.contactid = c.id\r\n\t\t\t\t\tand cs.studentid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the users associated with the contacts\r\n\t\t\t$query = \"select distinct u.ID,\r\n\t\t\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t\t\t u.Email\r\n\t\t\t\t from users u, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where u.id = cu.userid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$usersArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $userrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $usersArray, $userrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Users'] = $usersArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}", "function student_attendance()\n\t{\n\t\t\n\t\t$usercode = $_REQUEST['usercode'];\n\t\t$userdt\t\t\t\t=\t$this->ObjM->get_user_by_usercode($usercode);\n\t\t$yearly_acccount \t= $this->ObjM->student_yearly_acccount($userdt[0]['idcode']);\n\t\t\n\t\t$arr=array('student_yearly_code' =>$yearly_acccount[0]['student_yearly_code'],'attendance_month'=>$_REQUEST['month']);\n\t\t$stud_att\t\t\t\t=\t$this->ObjM->get_student_attendance($arr);\n\t\t\n\t\tif(count($stud_att)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($stud_att);$i++){\n\t\t\t\t$attendance_date = date('d-m-Y',$stud_att[$i]['attendance_date']);\n\t\t\t\t$json_arr[]=array(\n\t\t\t\t\t'attendance_date'\t\t=>\t$attendance_date,\n\t\t\t\t\t'attendance'\t\t\t=>\t$stud_att[$i]['attendance'],\n\t\t\t\t\t'validation'\t \t\t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t}", "public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }", "public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')\n {\n $attendance = new Attendance();\n $courseInfo = CourseManager::get_course_information($course_id);\n $attendance->set_course_id($courseInfo['code']);\n $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;\n $data_array = array();\n $data_array['attendance_id'] = $attendance_id;\n $data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);\n\n $filter_type = 'today';\n\n if (!empty($_REQUEST['filter'])) {\n $filter_type = $_REQUEST['filter'];\n }\n\n $my_calendar_id = null;\n if (is_numeric($filter_type)) {\n $my_calendar_id = $filter_type;\n $filter_type = 'calendar_id';\n }\n\n $data_array['attendant_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n $filter_type,\n $my_calendar_id,\n $groupId\n );\n\n if (api_is_allowed_to_edit(null, true) || api_is_drh()) {\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, 0, $groupId);\n } else {\n if (!empty($student_id)) {\n $user_id = intval($student_id);\n } else {\n $user_id = api_get_user_id();\n }\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id, $groupId);\n $data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id, $groupId);\n $data_array['user_id'] = $user_id;\n }\n\n $data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);\n\n // Set headers pdf.\n $courseCategory = CourseManager::get_course_category($courseInfo['category_code']);\n $teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);\n $teacherName = null;\n foreach ($teacherInfo as $teacherData) {\n if ($teacherName != null) {\n $teacherName = $teacherName.\" / \";\n }\n $teacherName .= api_get_person_name($teacherData['firstname'], $teacherData['lastname']);\n }\n\n // Get data table\n $data_table = array();\n $head_table = array('#', get_lang('Name'));\n foreach ($data_array['attendant_calendar'] as $class_day) {\n $head_table[] =\n api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR).' '.\n api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);\n }\n $data_table[] = $head_table;\n $data_attendant_calendar = $data_array['attendant_calendar'];\n $data_users_presence = $data_array['users_presence'];\n $count = 1;\n\n if (!empty($data_array['users_in_course'])) {\n foreach ($data_array['users_in_course'] as $user) {\n $cols = 1;\n $result = array();\n $result['count'] = $count;\n $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);\n foreach ($data_array['attendant_calendar'] as $class_day) {\n if ($class_day['done_attendance'] == 1) {\n if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {\n $result[$class_day['id']] = get_lang('UserAttendedSymbol');\n } else {\n $result[$class_day['id']] = '<span style=\"color:red\">'.get_lang('UserNotAttendedSymbol').'</span>';\n }\n } else {\n $result[$class_day['id']] = ' ';\n }\n $cols++;\n }\n $count++;\n $data_table[] = $result;\n }\n }\n $max_cols_per_page = 12; //10 dates + 2 name and number\n $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10\n $rows = count($data_table);\n\n if ($cols > $max_cols_per_page) {\n $number_tables = round(($cols-2)/$max_dates_per_page);\n $headers = $data_table[0];\n $all = array();\n $tables = array();\n $changed = 1;\n\n for ($i= 0; $i <= $rows; $i++) {\n $row = isset($data_table[$i]) ? $data_table[$i] : null;\n $key = 1;\n $max_dates_per_page = 10;\n $item = isset($data_table[$i]) ? $data_table[$i] : null;\n $count_j = 0;\n\n if (!empty($item)) {\n foreach ($item as $value) {\n if ($count_j >= $max_dates_per_page) {\n $key++;\n $max_dates_per_page = $max_dates_per_page_original*$key;\n //magic hack\n $tables[$key][$i][] = $tables[1][$i][0];\n $tables[$key][$i][] = $tables[1][$i][1];\n }\n $tables[$key][$i][] = $value;\n $count_j++;\n }\n }\n }\n\n $content = null;\n if (!empty($tables)) {\n foreach ($tables as $sub_table) {\n $content .= Export::convert_array_to_html($sub_table).'<br /><br />';\n }\n }\n } else {\n $content = Export::convert_array_to_html(\n $data_table,\n array('header_attributes' => array('align' => 'center'))\n );\n }\n\n $params = array(\n 'filename' => get_lang('Attendance').'-'.api_get_local_time(),\n 'pdf_title' => $courseInfo['title'],\n 'course_code' => $courseInfo['code'],\n 'add_signatures' => true,\n 'orientation' => 'landscape',\n 'pdf_teachers' => $teacherName,\n 'pdf_course_category' => $courseCategory['name'],\n 'format' => 'A4-L',\n 'orientation' => 'L'\n );\n\n Export::export_html_to_pdf($content, $params);\n exit;\n }", "public function reportMonthlyAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function generate_report($req, $res, $isMonthly = true, $timeUnit = null, $uid = 1) {\r\n\tif ($isMonthly) {\r\n\t\tif (is_null ( $timeUnit ) || ! is_numeric ( $timeUnit ) || $timeUnit > 12 || $timeUnit < 1) {\r\n\t\t\t$timeUnit = date ( 'M' );\r\n\t\t}\r\n\t} else {\r\n\t\tif (is_null ( $timeUnit )) {\r\n\t\t\t$timeUnit = date ( 'Y' );\r\n\t\t}\r\n\t}\r\n\t\r\n\trequire_once 'PHPExcel/PHPExcel.php';\r\n\t$objPHPExcel = new PHPExcel ();\r\n\t\r\n\theader ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );\r\n\theader ( 'Content-Disposition: attachment;filename=\"report_' . ($isMonthly ? 'monthly' : 'yearly') . date ( 'YMDhm' ) . '.xlsx\"' );\r\n\theader ( 'Cache-Control: max-age=0' );\r\n\t\r\n\t// Set properties\r\n\t$objPHPExcel->getProperties ()->setCreator ( \"Roy Ganor\" )->setTitle ( \"Doctors Report\" )->setSubject ( \"Doctors Report\" )->setDescription ( \"Doctors Report\" );\r\n\t\r\n\twriteSurgeries ( $req, $res, $uid, $objPHPExcel );\r\n\twriteShifts ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSessions ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSurgeons ( $req, $res, $uid, $objPHPExcel );\r\n\twriteOperations ( $req, $res, $uid, $objPHPExcel );\r\n\t\r\n\t$objPHPExcel->setActiveSheetIndex ( 0 );\r\n\t\r\n\t$objWriter = PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' );\r\n\t$objWriter->save ( 'php://output' );\r\n}", "public function attendance(){\n\t\t\t$data['title'] = 'Students Attendences Course name '; \n\n\t\t\t$course_code = $_GET['course_code'];\n\t\t\t\n\t\t\t$ids = $this->register_model->ids($course_code);\n\n\t\t\t$course_id;\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t\t$course_id = $id['id'];\n\t\t\t\t\t$data['course_name'] = $id['course_name'];\n\t\t\t}\t\t\t\n\t\t\t$data['courses'] = $this->register_model->get_attendance($course_id);\n\n\t\t\t$this->load->view('admin/header1');\n\t\t\t$this->load->view('admin/attendance', $data);\n\t\t\t$this->load->view('admin/footer');\n\t\t}", "public function makeReport()\n {\n }", "public function reportDatewiseClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function ciniki_courses_reportStudents($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'start_date'=>array('required'=>'yes', 'blank'=>'no', 'type'=>'date', 'name'=>'Start Date'), \n 'end_date'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'date', 'name'=>'End Date'), \n 'output'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'json', 'name'=>'Output'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'courses', 'private', 'checkAccess');\n $rc = ciniki_courses_checkAccess($ciniki, $args['tnid'], 'ciniki.courses.reportStudents'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\n //\n // Load tenant details\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'tenantDetails');\n $rc = ciniki_tenants_tenantDetails($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) && is_array($rc['details']) ) { \n $tenant_details = $rc['details'];\n } else {\n $tenant_details = array();\n }\n\n //\n // Get the list of registrations between the dates\n //\n $strsql = \"SELECT registrations.id, \"\n . \"offerings.name AS offering_name, \"\n . \"offerings.code AS offering_code, \"\n . \"offerings.condensed_date AS condensed_date, \"\n . \"courses.name AS course_name, \"\n . \"courses.code AS course_code, \"\n . \"customers.id AS customer_id, \"\n . \"customers.display_name, \"\n . \"DATE_FORMAT(offerings.start_date, '%b %d, %Y') AS start_date, \"\n . \"DATE_FORMAT(offerings.end_date, '%b %d, %Y') AS end_date, \"\n . \"IFNULL(prices.name, '') AS price_name, \"\n . \"emails.email AS emails \"\n . \"FROM ciniki_course_offering_classes AS classes \"\n . \"INNER JOIN ciniki_course_offering_registrations AS registrations ON (\"\n . \"classes.offering_id = registrations.offering_id \"\n . \"AND registrations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_course_offerings AS offerings ON (\"\n . \"classes.offering_id = offerings.id \"\n . \"AND offerings.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_courses AS courses ON (\"\n . \"offerings.course_id = courses.id \"\n . \"AND courses.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_sapos_invoice_items AS items ON (\"\n . \"registrations.invoice_id = items.invoice_id \"\n . \"AND items.object_id = registrations.id \"\n . \"AND items.object = 'ciniki.courses.offering_registration' \"\n . \"AND items.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_course_offering_prices AS prices ON (\"\n . \"items.price_id = prices.id \"\n . \"AND prices.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_customers AS customers ON (\"\n . \"registrations.student_id = customers.id \"\n . \"AND customers.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_customer_emails AS emails ON (\"\n . \"customers.id = emails.customer_id \"\n . \"AND emails.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE classes.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND classes.class_date >= '\" . ciniki_core_dbQuote($ciniki, $args['start_date']) . \"' \"\n . \"\";\n if( isset($args['end_date']) && $args['end_date'] != '' && $args['end_date'] != '0000-00-00' ) {\n $strsql .= \"AND classes.class_date <= '\" . ciniki_core_dbQuote($ciniki, $args['end_date']) . \"' \";\n }\n $strsql .= \"ORDER BY customers.display_name, courses.name, offerings.name, registrations.id \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.courses', array(\n array('container'=>'customers', 'fname'=>'id', \n 'fields'=>array('id', 'customer_id', 'display_name', 'offering_name', 'offering_code', 'course_code', 'course_name', \n 'condensed_date', 'price_name', 'start_date', 'end_date', 'emails'),\n 'lists'=>array('emails'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.112', 'msg'=>'Unable to load offering_registrations', 'err'=>$rc['err']));\n }\n $customers = isset($rc['customers']) ? $rc['customers'] : array();\n\n //\n // Output PDF version\n //\n if( $args['output'] == 'pdf' ) {\n //\n // FIXME: Add pdf output\n //\n/* $rc = ciniki_core_loadMethod($ciniki, 'ciniki', 'courses', 'templates', 'offeringRegistrationsPDF');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $fn = $rc['function_call'];\n\n $rc = $fn($ciniki, $args['tnid'], $args['offering_id'], $tenant_details, $courses_settings);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $title = $rc['offering']['code'] . '_' . $rc['offering']['course_name'] . '_' . $rc['offering']['course_name'];\n\n $filename = preg_replace('/[^a-zA-Z0-9_]/', '', preg_replace('/ /', '_', $title));\n if( isset($rc['pdf']) ) {\n $rc['pdf']->Output($filename . '.pdf', 'D');\n } */\n }\n\n //\n // Output Excel version\n //\n elseif( $args['output'] == 'excel' ) {\n require($ciniki['config']['core']['lib_dir'] . '/PHPExcel/PHPExcel.php');\n $objPHPExcel = new PHPExcel();\n $objPHPExcelWorksheet = $objPHPExcel->setActiveSheetIndex(0);\n\n $col = 0;\n $row = 1;\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Student', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Email', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Code', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Course', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Session', false);\n $row++;\n foreach($customers as $student) {\n $col = 0;\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['display_name'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['emails'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['offering_code'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['course_name'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['offering_name'], false);\n\n $row++;\n }\n $objPHPExcelWorksheet->getStyle('A1:E1')->getFont()->setBold(true);\n $objPHPExcelWorksheet->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('D')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('E')->setAutoSize(true);\n\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"students.xls\"');\n header('Cache-Control: max-age=0');\n \n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n \n return array('stat'=>'exit');\n } \n\n return array('stat'=>'ok', 'customers'=>$customers);\n}", "public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "function generate_weekly_report_csv($c_data=array()){\n\t\t\n\t\tApp::import('Helper','csv');\n\t\t$csv = new csvHelper();\n\t\t$line = array(\"Store number\",\"Terminal\",\"Vendor\",\"Product\",\"Item\",\"Face Value\",\"Billed downloads\",\"Billed returns\",\"Net Billed Downloads\",\"Net Face Value\",\"Net Cost\",\"Net Commission\",\"Merchant\",\"Site\",\"Street\",\"Postcode\",\"City\",\"Duplicate Downloads\",\"All Downloads\",\"Duplicate Returns\",\"All Returns\",\"Net All Downloads\",\"Download Face Value\",\"Download Cost\",\"Download Commission\",\"Return Face Value\",\"Return Cost\",\"Return Commission\",\"From\",\"To\");\n\t\t$csv->addRow($line);\n\t\tif(!empty($c_data)){\n\t\t\tforeach($c_data as $data){\n\t\t\t\n\t\t\t\t$line = array($data['u']['u_id'],'X','X','X',$data['p']['title'],'X',$data['0']['total'],'X',$data['0']['total'],'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X');\n\t\t\t\t$csv->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $csv->render(\"weekly\".date(\"d/M/Y\"));\n\t\texit();\n\t}", "public function generateReport()\n {\n\t\t$this->_lastColumn=$this->objWorksheet->getHighestColumn();//TODO: better detection\n\t\t$this->_lastRow=$this->objWorksheet->getHighestRow();\n foreach($this->_data as $data)\n\t\t{\n\t\t\tif(isset ($data['repeat']) && $data['repeat']==true)\n\t\t\t{\n\t\t\t\t//Repeating data\n\t\t\t\t$foundTags=false;\n\t\t\t\t$repeatRange='';\n\t\t\t\t$firstRow='';\n\t\t\t\t$lastRow='';\n\n\t\t\t\t$firstCol='A';//TODO: better detection\n\t\t\t\t$lastCol=$this->_lastColumn;\n\n\t\t\t\t//scan the template\n\t\t\t\t//search for repeating part\n\t\t\t\tforeach ($this->objWorksheet->getRowIterator() as $row)\n\t\t\t\t{\n\t\t\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\t\t\t$rowIndex = $row->getRowIndex();\n\t\t\t\t\t//find the repeating range (one or more rows)\n\t\t\t\t\tforeach ($cellIterator as $cell)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cellval=trim($cell->getValue());\n\t\t\t\t\t\t$column = $cell->getColumn();\n\t\t\t\t\t\t//see if the cell has something for replacing\n\t\t\t\t\t\tif(preg_match_all(\"/\\{\".$data['id'].\":(\\w*|#\\+?-?(\\d*)?)\\}/\", $cellval, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this cell has replacement tags\n\t\t\t\t\t\t\tif(!$foundTags) $foundTags=true;\n\t\t\t\t\t\t\t//remember the first ant the last row\n\t\t\t\t\t\t\tif($rowIndex!=$firstRow)\n\t\t\t\t\t\t\t\t$lastRow=$rowIndex;\n\t\t\t\t\t\t\tif($firstRow=='')\n\t\t\t\t\t\t\t\t$firstRow=$rowIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//form the repeating range\n\t\t\t\tif($foundTags)\n\t\t\t\t\t$repeatRange=$firstCol.$firstRow.\":\".$lastCol.$lastRow;\n\n\t\t\t\t//check if this is the last row\n\t\t\t\tif($foundTags && $lastRow==$this->_lastRow)\n\t\t\t\t\t$data['last']=true;\n\n\t\t\t\t//set initial format data\n\t\t\t\tif(! isset($data['format']))\n\t\t\t\t\t$data['format']=array();\n\n\t\t\t\t//set default step as 1\n\t\t\t\tif(! isset($data['step']))\n\t\t\t\t\t$data['step']=1;\n\n\t\t\t\t//check if data is an array\n\t\t\t\tif(is_array($data['data']))\n\t\t\t\t{\n\t\t\t\t\t//every element is an array with data for all the columns\n\t\t\t\t\tif($foundTags)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert repeating rows, as many as needed\n\t\t\t\t\t\t//check if grouping is defined\n\t\t\t\t\t\tif(count($this->_group))\n\t\t\t\t\t\t\t$this->generateRepeatingRowsWithGrouping($data, $repeatRange);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->generateRepeatingRows($data, $repeatRange);\n\t\t\t\t\t\t//remove the template rows\n\t\t\t\t\t\tfor($i=$firstRow;$i<=$lastRow;$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->objWorksheet->removeRow($firstRow);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//if there is no data\n\t\t\t\t\t\tif(count($data['data'])==0)\n\t\t\t\t\t\t\t$this->addNoResultRow($firstRow,$firstCol,$lastCol);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t //TODO\n\t\t\t\t //maybe an SQL query?\n\t\t\t\t //needs to be database agnostic\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//non-repeating data\n\t\t\t\t//check for additional formating\n\t\t\t\tif(! isset($data['format']))\n\t\t\t\t\t$data['format']=array();\n\n\t\t\t\t//check if data is an array or mybe a SQL query\n\t\t\t\tif(is_array($data['data']))\n\t\t\t\t{\n\t\t\t\t\t//array of data\n\t\t\t\t\t$this->generateSingleRow($data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//TODO\n\t\t\t\t //maybe an SQL query?\n\t\t\t\t //needs to be database agnostic\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //call the replacing function\n $this->searchAndReplace();\n\n //generate heading if heading text is set\n if($this->_headingText!='')\n $this->generateHeading();\n\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "public function reportMonthlyClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function sendExport() {\n\tglobal $orgcode;\n\tglobal $filename;\n\tglobal $firstdate;\n\tglobal $lastdate;\n\t$headers = [\n\t\t\"ORGCODE\",\t//0\n\t\t\"PARTICIP\",\n\t\t\"ENROLL\",\n\t\t\"PAYER\",\n\t\t\"STATE\",\n\t\t\"GLUCTEST\",\t//5\n\t\t\"GDM\",\n\t\t\"RISKTEST\",\n\t\t\"AGE\",\n\t\t\"ETHNIC\",\n\t\t\"AIAN\",\t\t//10\n\t\t\"ASIAN\",\n\t\t\"BLACK\",\n\t\t\"NHOPI\",\n\t\t\"WHITE\",\n\t\t\"SEX\",\t\t//15\n\t\t\"HEIGHT\",\n\t\t\"EDU\",\n\t\t\"DMODE\",\n\t\t\"SESSID\",\n\t\t\"SESSTYPE\",\t//20\n\t\t\"DATE\",\n\t\t\"WEIGHT\",\n\t\t\"PA\"\n\t];\n\t\n\t$data = [$headers];\n\t$noncompliant = [$headers];\n\t$today = new DateTime(\"NOW\");\n\t\n\t// get all participant data\n\t$records = \\REDCap::getData(PROJECT_ID);\n\t$project = new \\Project(PROJECT_ID);\n\t\n\t// get year value for when these records were created or first logged update\n\t$recordCreationDates = [];\n\t$sql = \"SELECT pk, ts FROM redcap_log_event WHERE project_id=\" . PROJECT_ID . \" and pk in (\" . implode(array_keys($records), \", \") . \") and (description=\\\"Create record\\\" OR description=\\\"Update record\\\") ORDER BY pk ASC, ts ASC\";\n\t$query = db_query($sql);\n\twhile ($row = db_fetch_assoc($query)) {\n\t\tif (!isset($recordCreationDates[$row['pk']])) {\n\t\t\t$recordCreationDates[$row['pk']] = substr($row['ts'], 2, 2);\n\t\t}\n\t}\n\t\n\t// regex for getting labels for project fields (like state, sess_type, etc)\n\t$labelPattern = \"/(\\d+),?\\s?(.+?)(?=\\x{005c}\\x{006E}|$)/\";\n\t\n\tforeach ($records as $rid => $record) {\n\t\t$eid = array_keys($record)[0];\n\t\t\n\t\t// skip if orgcode set and not match\n\t\tif (isset($orgcode) and $orgcode != $record[$eid]['orgcode']) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// skip if have diabietes\n\t\tif ($record[$eid]['have_diabetes'] == 1 or $record[$eid]['enter_roster'] == 0) continue;\n\t\t\n\t\t$line = array_fill(0, 23, null);\n\t\t$line[0] = $record[$eid]['orgcode'];\n\t\t\n\t\t// determine participant ID\n\t\t$participantID = $recordCreationDates[$rid];\n\t\tpreg_match_all($labelPattern, $project->metadata['participant_id_group']['element_enum'], $matches);\n\t\t$participantID .= trim($matches[2][$record[$eid]['participant_id_group'] - 1]);\n\t\t$participantID .= $record[$eid]['participant_id_group'];\n\t\tpreg_match_all(\"/\\d+/\", $record[$eid]['participant_employee_id'], $matches);\n\t\t$participantID .= $matches[0][0];\n\t\t\n\t\t$line[1] = $participantID;\n\t\t$line[2] = $record[$eid]['program_referral'] === null ? 10 : $record[$eid]['program_referral'];\n\t\t$line[3] = $record[$eid]['payer'] === null ? 9 : $record[$eid]['payer'];\n\t\tpreg_match_all($labelPattern, $project->metadata['state']['element_enum'], $matches);\n\t\tpreg_match(\"/- ([A-Z]{2})(?:\\s|$)/\", $matches[2][$record[$eid]['state'] - 1], $matches);\n\t\t$line[4] = $matches[1];\n\t\t$line[5] = $record[$eid]['gluctest'] == 1 ? 1 : 2;\n\t\t$line[6] = $record[$eid]['gdm'] == 1 ? 1 : 2;\n\t\t$line[7] = $record[$eid]['risktest'] == 1 ? 1 : 2;\n\t\t$dob = new DateTime($record[$eid]['dob']);\n\t\t$line[8] = $dob->diff($today)->format('%y');\n\t\t$line[9] = $record[$eid]['ethnicity'] == null ? 9 : $record[$eid]['ethnicity'];\n\t\t$line[10] = $record[$eid]['race'][1] == 1 ? 1 : 2;\n\t\t$line[11] = $record[$eid]['race'][2] == 1 ? 1 : 2;\n\t\t$line[12] = $record[$eid]['race'][3] == 1 ? 1 : 2;\n\t\t$line[13] = $record[$eid]['race'][4] == 1 ? 1 : 2;\n\t\t$line[14] = $record[$eid]['race'][5] == 1 ? 1 : 2;\n\t\t$line[15] = $record[$eid]['sex'] == null ? 9 : $record[$eid]['sex'];\n\t\tpreg_match_all($labelPattern, $project->metadata['height']['element_enum'], $matches);\n\t\tpreg_match_all(\"/[0-9]{1,2}/\", $matches[2][$record[$eid]['height'] - 1], $matches);\n\t\t$line[16] = @((int) $matches[0][0] * 12 + (int) $matches[0][1]);\n\t\t$line[17] = $record[$eid]['education'] == null ? 9 : $record[$eid]['education'];\n\t\t\n\t\t$instanceSum = 0;\n\t\tforeach ($record['repeat_instances'][$eid]['sessionscoaching_log'] as $i => $instance) {\n\t\t\t// only add data that's within last 6 months!\n\t\t\t$sess_date = $instance[\"sess_actual_date\"];\n\t\t\tif (empty($sess_date)) {\n\t\t\t\t$sess_date = $instance[\"sess_scheduled_date\"];\n\t\t\t}\n\t\t\t\n\t\t\t$thisdate = strtotime($sess_date);\n\t\t\tif (empty($sess_date) or (!empty($firstdate) and $firstdate > $thisdate) or (!empty($lastdate) and $lastdate < $thisdate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$instanceSum++;\n\t\t\t$line_copy = $line;\n\t\t\t$line_copy[18] = $instance['sess_mode'];\n\t\t\t$line_copy[19] = $instance['sess_id'];\n\t\t\tif ($instance[\"sess_month\"] >= 7) {\n\t\t\t\t$line_copy[19] = 99;\n\t\t\t\t$line_copy[20] = \"CM\";\n\t\t\t}\n\t\t\tif ($instance[\"sess_month\"] >= 7)\n\t\t\t\t$line_copy[20] = \"OM\";\n\t\t\tpreg_match_all($labelPattern, $project->metadata['sess_type']['element_enum'], $matches);\n\t\t\tpreg_match_all(\"/\\(([A-Z]|[A-Z][A-Z])\\)/\", $matches[2][$instance['sess_type'] - 1], $matches);\n\t\t\t$line_copy[20] = $matches[1][0];\n\t\t\t$line_copy[21] = $sess_date == null ? null : date(\"m/d/Y\", strtotime($sess_date));\n\t\t\t$line_copy[22] = $instance['sess_weight'];\n\t\t\t$line_copy[23] = $instance['sess_pa'];\n\t\t\t\n\t\t\t$session_attended = false;\n\t\t\tif ($instance[\"sess_attended\"] or $instance['sess_weight'] or $instance['sess_pa'])\n\t\t\t\t$session_attended = true;\n\t\t\t\n\t\t\tvalidateLine($line_copy, $session_attended);\n\t\t\t\n\t\t\t// if session is marked as attended but weight and/or pa values not included, use 999\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[22]))\n\t\t\t\t$line_copy[22] = 999;\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[23]))\n\t\t\t\t$line_copy[23] = 999;\n\t\t\t\n\t\t\t// if error messages were appended...\n\t\t\tif (isset($line_copy[24]) and isset($_GET['noncompliant'])) {\n\t\t\t\t$noncompliant[] = $line_copy;\n\t\t\t}\n\t\t\t\n\t\t\t// no errors and no non-compliant param\n\t\t\tif (!isset($line_copy[24]) and !isset($_GET['noncompliant'])) {\n\t\t\t\t$data[] = $line_copy;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send participant records with no session data to noncompliant set\n\t\tif ($instanceSum == 0)\n\t\t\t$noncompliant[] = $line;\n\t}\n\t\n\theader('Content-Type: text/csv');\n\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t$fp = fopen('php://output', 'wb');\n\t\n\t// non-compliance report\n\tif (isset($_GET['noncompliant'])) {\n\t\t$data = $noncompliant;\n\t}\n\t\n\tforeach ($data as $line) {\n\t\tfputcsv($fp, $line, ',');\n\t}\n\tfclose($fp);\n}", "public function generate_acknowledgement() {\n \n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $usrid = $this->input->post('usr');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $usrid);\n\n $tanant = $this->courses_model->get_tenant_details();\n \n //sankar code starts here\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n //sankar code ends here\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $Url = base_url() . 'payments/print_ack';\n\n $date = date('M d Y');\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n \n /* skm code start for remark.\n reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($ack_data[class_start_datetime]);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($crsid == 67 || $crsid == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n $tenant_id = TENANT_ID;\n if($tenant_id == 'T12')\n { \n $name = $tanant->contact_name;\n }else{\n\n $name = $gender. $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name];\n }\n \n $message3 = '\n <ol>\n <li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\n <li>Your NRIC, work permit or will be photocopied on the class date</li>\n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n </ol>';\n /* skm end */\n \n echo '<form action=\"' . $Url . '\" method=\"post\"><p> \n <a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n\t\t\t <h2 class=\"panel_heading_style\">Booking Acknowledgment</h2>\t\t\t \n\t\t\n\t\t\t Your seat has been temporarily booked. Please pay the class fees on or before the class start date.\n\t\t\tTemporary booking for <b>' . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course:\"' . $ack_data[crse_name] . ',Class:' . $ack_data[class_name] . ',Certificate Code:' . $ack_data[cert_level] . ' </b>\".</i><br>\n\t\t\t </br><strong>Class start date:</strong> ' . $startdate . '<br>\n\t\t\t </br><strong>Location:</strong> ' . $ack_data[classroom_location] . '<br>\n\t\t\t</br><strong>Contact Details:</strong> ' . $name . ',(Phone: ' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n </br><strong>Remark:</strong> ' . $message3 . '<br>\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/>\n <input type=\"hidden\" value=\"' . $usrid . '\" name=\"userId\"/> \n <input type=\"hidden\" value=\"' . $ack_data . '\" name=\"ackdata\"/>\n <div style=\"clear:both;\"></div><br>\t\t\t \n\t\t\t <span style=\"float:right;\">\n\t\t\t<button class=\"btn btn-primary\" type=\"submit\">Print</button>\n\t\t\t </p></form> ';\n }", "public function getAcademicAnalyticsPDF()\n {\n\n /*$getUrl = $this->connection->prepare(\"SELECT * FROM `AC_FacultyInfo` WHERE OU_ABBREV = ? AND OUTCOMES_AY = ?\");\n $getUrl->bindParam(1,$this->ouAbbrev,PDO::PARAM_STR);\n $getUrl->bindParam(2,$this->selectedYear,PDO::PARAM_STR);\n $getUrl->execute();\n $data = $getUrl->fetch();\n\n if (!empty($data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"])){\n\n if (file_exists(\"../../uploads/ac_programs/\".$data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"]))\n $this->getSupplementPdf(\"../../uploads/ac_programs/\".$data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"]);\n\n }*/\n\n }", "private function gASummary($date_from,$date_to) {\n $service_account_email = 'service-account@fintech-159506.iam.gserviceaccount.com'; \n // Create and configure a new client object.\n $client = new \\Google_Client();\n $client->setApplicationName(\"Analytics Reporting\");\n $analytics = new \\Google_Service_Analytics($client);\n $cred = new \\Google_Auth_AssertionCredentials(\n $service_account_email,\n array(\\Google_Service_Analytics::ANALYTICS_READONLY),\n \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAUT0xOyseXwTo\\nMRchra9QmsRYGUZ8+rdGihcAXrt3AqDq4/sKRaIe5gvte+C3bwHV8fI42nz0axRN\\n8WJo7lT7TzZweuAFTv+yuH/yHvNQlPAHMDCars7QTTGf8XcUHO5cq9yYA0FD2/gg\\nWAwU9V34RjL0fvEFHPii9zOZoPMtrNsMwxQcKSw2cs9TZ+grwfp5r/pRbUbPlUYg\\n/3B87jk5FjG9NKO7eRW2Pu7zf7pPZw067EMdAcGpZO7Gnzc21T1f3qj0JR0V7ooh\\nQcxiGCUIUbkKMYOuj/Rb5uQhnfb8ERehxfGFAg9FSiYbPZqag2d/adbmt32hQEKW\\nvud0nU4HAgMBAAECggEAHmy7wY4axDNEE3ewsSNJGPdjGIznGd6QIBi4itZx0eIY\\nkxB+JqHdhAXg3TE728k0ASTFrTjji8dk7u/BIdiSmS9u7VyDFFPrH9sQYr2CwLzP\\nPFPjXJVLIqkTsLoCnKv3CbIms+XP7WxfVL6ZKrempiB07zkl6CktLJrvDt7nmdH4\\nevtrk7aKxpESJUQQVgs5CULH5gIQow/qx5rDHjAaLIsbIlmUXOBZQ4yO77/Lub8u\\nZe6GDBZGeqHqA1yzKgYQiFu/TqAmtsNbtDYfm8dUY/Tkxv/RhJDCJRlpE7Vhq5zD\\nBdrnjW/IWlMVZV0SFLgvkIZ8KMBhvJi6TARzhEXcAQKBgQDswarwvnXmbGCzi4Qh\\ntJ84VeSqzOib4Gp4wzC5WyWHdQdgVb4Ob/HpI69zswwB112W7GbRy/eiUZz7Cg8Q\\nak+3ZbIVeLTlNcJApa0sNEBft+ps7Ww9hajPpTOEhtuSQu9Hx5GXgj65a6a3l+gG\\n9DPGkZC0dLXMrSgWDFZMmtLtPQKBgQDP8uYyy3mhg9owkAhgr1gdSdLJxQ/13o+Y\\nozOWHvBjoF84k/0iLDOqGxuqwBaZBf1ov5W9TS4CeyEfECaCSYc87gThcsKngeZM\\n2fSICIkmOHh24WXamEENQqmKvMXQ8g9HGKzo0TL+r9/iDrrsfo0nCPVEC2A/QBU9\\nBB5YQ9SkkwKBgQDDXSAwXgmt5Vp6bbLPmVsVQpNZeZKsJafWFMMdAKBcQW6fyMD2\\n6tsE1cSOxX0v+8YnptVFY3jpQU03PdqmYgN7w3gLDbq/tPehHtViN4+zLHFOBzCd\\nJ7Df/2MehaWj8IXAhmaWTgxyNumwb7IwIsyimzV8Ix5tUalVYELKHavVxQKBgCkO\\nMMq4h4QO7yYFWdIU7FWj/Jzfbj5BuaIOHqI164oP4JzgAusbRPwBrB2zHQMLPrPO\\nl3avZTUSMEDcxG2WrL+n0ojcSngd2mUz5uZwoPtNzOLTr3NP+g/vKF/+0yNklwWX\\nZpP0sZe9C3urItaMSbv6NcpAYLk8IrVQOdl9Ut9HAoGACt0YP/MLOlnn/S/qyn5+\\npQhuIsnv3rNa7yZrhfn0u+jdLNk4ubmc/A6Z4Yc/hqQEV/UOwfSwAAlHAZgdUWYi\\nvL6VfVaDxX5goKnWxnuvErFH1Zg+3Lem+moBzXXpb0EPxMXsAgXWe6j8YuZReXXu\\nOLoW4l5DW4h2ZmxxWr/D/Jc=\\n-----END PRIVATE KEY-----\\n\"\n ); \n $client->setAssertionCredentials($cred);\n if($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($cred);\n }\n $optParams = [\n 'dimensions' => 'ga:date',\n 'sort'=>'-ga:date'\n ] ; \n $results = $analytics->data_ga->get(\n 'ga:140884579',\n $date_from,\n $date_to,\n 'ga:sessions,ga:users,ga:pageviews,ga:bounceRate,ga:hits,ga:avgSessionDuration',\n $optParams\n );\n \n $rows = $results->getRows();\n $rows_re_align = [] ;\n foreach($rows as $key=>$row) {\n foreach($row as $k=>$d) {\n $rows_re_align[$k][$key] = $d ;\n }\n } \n $optParams = array(\n 'dimensions' => 'rt:medium'\n );\n try {\n $results1 = $analytics->data_realtime->get(\n 'ga:140884579',\n 'rt:activeUsers',\n $optParams);\n // Success. \n } catch (apiServiceException $e) {\n // Handle API service exceptions.\n $error = $e->getMessage();\n }\n $active_users = $results1->totalsForAllResults ;\n return [\n 'data'=> $rows_re_align ,\n 'summary'=>$results->getTotalsForAllResults(),\n 'active_users'=>$active_users['rt:activeUsers']\n ] ;\n }", "function makeTXT()\n {\n $calendar_text = \"No calendar information available.\";\n if (isset($this->calendar->events)) {\n $calendar_text = \"\";\n foreach ($this->calendar->events as $event) {\n $description_seperator = \" - \";\n $description = \"description\";\n if ($this->description_flag != \"on\") {\n $description_seperator = \"\";\n $description = \"\";\n }\n\n $t =\n $this->textCalendar($event, [\n \"timestamp Y-m-d H:i\",\n \" \",\n // 'timezone',\n // ' ',\n \"summary\",\n \" [\",\n \"runtime\",\n \"]\",\n $description_seperator,\n $description,\n ]) . \"\\n\";\n\n $calendar_text .= $t;\n }\n }\n\n $txt =\n \"CALENDAR \" .\n $this->time_zone .\n \"\\n\\n\" .\n $calendar_text .\n \"\\n\\n\" .\n $this->response;\n\n $this->txt = $txt;\n $this->thing_report[\"txt\"] = $txt;\n }", "function demo_report_all() {\n\n $conn = sql_connect();\n\n $sql_patient = mysqli_query($conn, \"SELECT * FROM Patients;\");\n\n $insurance_Y = 0;\n $insurance_N = 0;\n $age = 0;\n $sex_M = 0;\n $sex_F = 0;\n $sex_Other = 0;\n\n $ethn_api = 0;\n $ethn_afam = 0;\n $ethn_natam = 0;\n $ethn_white = 0;\n $ethn_hisp = 0;\n $ethn_other = 0;\n\n $marital_sing = 0;\n $marital_marr = 0;\n $marital_widow = 0;\n $marital_divor = 0;\n $marital_separ = 0;\n\n $total = 0;\n\n if($sql_patient) {\n\n while($patient = mysqli_fetch_assoc($sql_patient)) {\n\n $total++;\n\n $sql_demo = mysqli_query($conn, \"SELECT * FROM Demographics WHERE Demo_ID=\".$patient['Demographics_ID'].\";\") or die(mysqli_error($conn));\n $demo = mysqli_fetch_assoc($sql_demo);\n\n if(strcmp($demo['Has_insurance'],'Yes') == 0) {\n $insurance_Y++;\n } else {\n $insurance_N++;\n }\n\n $age += $demo['Age'];\n\n if(strcmp($demo['Sex'],'M') == 0) {\n $sex_M++;\n } elseif (strcmp($demo['Sex'],'F') == 0) {\n $sex_F++;\n } else {\n $sex_Other++;\n }\n\n if (strcmp($demo['Ethnicity'], 'Asian/Pacific Islander') == 0) {\n $ethn_api++;\n } elseif (strcmp($demo['Ethnicity'], 'African-American') == 0) {\n $ethn_afam++;\n } elseif (strcmp($demo['Ethnicity'], 'Native American') == 0) {\n $ethn_natam++;\n } elseif (strcmp($demo['Ethnicity'], 'White') == 0) {\n $ethn_white++;\n } elseif (strcmp($demo['Ethnicity'], 'Hispanic') == 0) {\n $ethn_hisp++;\n } else {\n $ethn_other++;\n }\n\n if(strcmp($demo['Marital_status'], 'Single') == 0) {\n $marital_sing++;\n } elseif (strcmp($demo['Marital_status'], 'Married') == 0) {\n $marital_marr++;\n } elseif (strcmp($demo['Marital_status'], 'Widowed') == 0) {\n $marital_widow++;\n } elseif (strcmp($demo['Marital_status'], 'Divorced') == 0) {\n $marital_divor++;\n } else {\n $marital_separ++;\n }\n\n }\n\n $insurance_Y = number_format($insurance_Y/(float)$total, 3);\n $insurance_N = number_format($insurance_N/(float)$total, 3);\n $sex_M = number_format($sex_M/(float)$total, 3);\n $sex_F = number_format($sex_F/(float)$total, 3);\n $sex_Other = number_format($sex_Other/(float)$total, 3);\n $age = number_format($age/(float)$total, 1);\n $marital_sing = number_format($marital_sing/(float)$total, 3);\n $marital_marr = number_format($marital_marr/(float)$total, 3);\n $marital_widow = number_format($marital_widow/(float)$total, 3);\n $marital_divor = number_format($marital_divor/(float)$total, 3);\n $marital_separ = number_format($marital_separ, 3);\n $ethn_api = number_format($ethn_api/(float)$total, 3);\n $ethn_afam = number_format($ethn_afam/(float)$total, 3);\n $ethn_natam = number_format($ethn_natam/(float)$total, 3);\n $ethn_white = number_format($ethn_white/(float)$total, 3);\n $ethn_hisp = number_format($ethn_hisp/(float)$total, 3);\n $ethn_other = number_format($ethn_other/(float)$total, 3);\n\n\n echo \"<h3> Patient Demographics for Entire Clinic</h3><br>\";\n echo \"<table><tr><th>[Has Insurance]</th><th></th><th>[Gender]</th><th></th><th></th></tr>\";\n echo \"<tr><th>Yes</th><th>No</th><th>Male</th><th>Female</th><th>Other</th></tr>\";\n echo \"<tr><td><center>\".($insurance_Y*100).\"%</center></td><td><center>\".($insurance_N*100).\"%</center></td><td><center>\".($sex_M*100).\"%</center></td><td><center>\".($sex_F*100).\"%</center></td><td><center>\".($sex_Other*100).\"%</center></td></tr>\";\n echo \"<tr><th>[Average Age]</th><th></th><th></th><th>[Marital Status]</th><th></th><th></th><th></th></tr>\";\n echo \"<tr><th></th><th>Single</th><th>Married</th><th>Widowed</th><th>Divorced</th><th>Separated</th></tr>\";\n echo \"<tr><td><center>\".$age.\"</center></td><td><center>\".($marital_sing*100).\"%</center></td><td><center>\".($marital_marr*100).\"%</center></td><td><center>\".($marital_widow*100).\"%</center></td><td><center>\".($marital_divor*100).\"%</center></td><td><center>\".($marital_separ*100).\"%</center></td></tr>\";\n echo \"<tr><th></th><th></th><th>[Ethnicity]</th><th></th><th></th><th></th></tr>\";\n echo \"<tr><th>Asian/Pacific Islander</th><th>Africa-American</th><th>Native American</th><th>White</th><th>Hispanic</th><th>Other</th></tr>\";\n echo \"<tr><td><center>\".($ethn_api*100).\"%</center></td><td><center>\".($ethn_afam*100).\"%</center></td><td><center>\".($ethn_natam*100).\"%</center></td><td><center>\".($ethn_white*100).\"%</center></td><td><center>\".($ethn_hisp*100).\"%</center></td><td><center>\".($ethn_other*100).\"%</center></td></tr></table>\";\n\n } else {\n\n echo \"No patients found\";\n\n }\n\n }", "function report_availabilty($student_id)\n {\n global $CFG;\n\n $now=time();\n\n //if a maximum number of entries has been set lets see if the student has reached this number\n if (!empty($this->reportmaxentries)) {\n $studententries = $this->dbc->count_report_entries($this->report_id,$student_id);\n\n if ($studententries >= $this->reportmaxentries) {\n $extension = $this->extension_check('reportmaxentries');\n\n if (empty($extension) || $studententries >= $extension->value) {\n $temp = new stdClass();\n $temp->entries = $studententries;\n $temp->maxentries = (!empty($extension))? $extension->value : $this->reportmaxentries;\n return false;\n }\n }\n }\n\n //if this report has a lock date check if the date has passed\n if ($this->reporttype == ILP_RT_RECURRING_FINALDATE || $this->reporttype == ILP_RT_FINALDATE) {\n\n if ( $this->reportlockdate < $now ) {\n //find out if this student has been given a report extension\n $extension = $this->extension_check('reportlockdate');\n if (empty($extension) || $extension->value < $now) {\n $temp = new stdClass();\n $temp->expiredate = (!empty($extension))? date('d-m-Y',$extension->value) : date('d-m-Y',$this->reportlockdate);\n return false;\n }\n }\n }\n\n //if the report is a recurring report\n if ($this->reporttype == ILP_RT_RECURRING || $this->reporttype == ILP_RT_RECURRING_FINALDATE) {\n $recurringstart = 0;\n\n if ($this->recurstart == ILP_RECURRING_REPORTCREATION) {\n //rules started at report creation\n $recurringstart = $this->timecreated;\n } else if ($this->recurstart == ILP_RECURRING_SPECIFICDATE) {\n //rules started at specific date\n $recurringstart = $this->recurdate;\n } else {\n //rules started at first entry\n $studententries = $this->dbc->get_user_report_entries($this->id,$student_id);\n\n if (!empty($studententries)) {\n //get the creation time of the first user entry\n $recurringstart = reset($studententries);\n $recurringstart = $recurringstart->timecreated;\n }\n }\n\n if (!empty($recurringstart)) {\n $recurringperiod = $this->recurring_period($recurringstart,$this->recurfrequency);\n\n $entriescount = $this->dbc->count_report_entries($this->id,$student_id,$recurringperiod['start'],$recurringperiod['end']);\n\n if (!empty($entriescount) && $entriescount >= $this->recurmax) {\n $extension = $this->extension_check('recurmax');\n if (empty($extension) || $extension->value <= $entriescount) {\n $temp = new stdClass();\n $temp->entries = $entriescount;\n $temp->maxentries = (!empty($extension))? $extension->value : $this->recurmax;\n return false;\n }\n }\n }\n }\n return true;\n }", "function getSubjectTransaction($subject_id)\n {\n $school_id = '';\n if(($this->session->userdata('school_id'))) {\n $school_id = $this->session->userdata('school_id');\n if($school_id > 0){\n $this->db->where('school_id',$school_id);\n } \n }\n \n $transaction = 0;\n $count = 0;\n $current_date = date(\"Y-m-d\");\n // book issue table\n $result_array = $this->db->get_where(\"exam_routine\", array(\"subject_id\" => $subject_id))->result_array();\n $count = count($result_array);\n if($count)\n { \n $transaction = 1;\n return $transaction;\n }\n // \n \n $result_array = $this->db->get_where(\"mark\", array(\"subject_id\" =>$subject_id))->result_array();\n $count = count($result_array);\n if($count)\n { \n $transaction = 1;\n return $transaction;\n }\n \n \n return $transaction;\n }", "public function paynow1($scheduleid){\n //die(var_dump($this->usertype));\n $user_details = $this->pay_mdl->get_user_details($this->usertype, $this->user_id);\n \n $excep_param = array(\n 'usertype' => $user_details['usertype'],\n 'colid'=> $user_details['colid'],\n 'deptid' => $user_details['deptid'],\n 'progid' => ($user_details['usertype'] == 'applicant')? $user_details['prog1'] : $user_details['progid'],\n 'type' => ($user_details['usertype'] == 'applicant')? $user_details['type'] : \"\",\n 'coi'=>($user_details['usertype'] == 'applicant')? $user_details['coi'] : \"\",\n 'stid' => $user_details['stid'],\n 'level' => ($user_details['usertype'] == 'student')? $user_details['level'] : \"\",\n );\n $excep = $this->pay_mdl->get_user_exceptions($excep_param, $scheduleid)['rs'];\n \n //set pay history parameter\n $pay_hist_param = array(\n \"scheduleid\" => $scheduleid,\n \"userid\" => $user_details['userid'],\n \"status\" => \"'APPROVED'\"\n );\n $my_pay_hist = $this->pay_mdl->gets('my_pay_history', $pay_hist_param );\n \n $data['my_paying'] = '';\n \n \n switch ($this->usertype) {\n case 'applicant':\n \n\n break;\n case 'student':\n $hist_perc = array();\n $tot = 0;\n $total_paid = 0;\n\n\n // Set User session parameters\n if(!$this->main->get('level')){\n\n $student_details = $this->pay_mdl->gets('student_details', $this->main->item('user_id'));\n\n $this->main->set('level', $student_details['level'] );\n $this->main->set('colid', $student_details['colid'] );\n $this->main->set('deptid', $student_details['deptid'] );\n $this->main->set('progid', $student_details['progid'] );\n $this->main->set('usertype', $student_details['usertype']);\n }\n\n\n //set pay history parameter\n $pay_hist_param = array(\n \"scheduleid\" => $scheduleid,\n \"userid\" => $this->main->item('user_id'),\n \"status\" => \"'APPROVED'\"\n );\n $my_pay_hist = $this->pay_mdl->gets('my_pay_history', $pay_hist_param );\n\n\n\n // get the total sum of last payment and percentage \n if(!empty($my_pay_hist)){\n\n foreach($my_pay_hist as $key => $val){\n\n $hist_perc[$key] = $my_pay_hist[$key]['percentage'];\n\n $tot = $tot + $my_pay_hist[$key]['percentage'];\n $total_paid = $total_paid + $my_pay_hist[$key]['amt'];\n } \n }\n\n // Get pay schedule base on the session_parameters\n $session_param = array( \n \"scheduleid\" => $scheduleid,\n \"level\" => $this->main->get('level'),\n \"colid\" => $this->main->get('colid'),\n \"deptid\" => $this->main->get('deptid'),\n \"progid\" => $this->main->get('progid'),\n \"usertype\" => $this->main->get('usertype')\n );\n\n\n\n $schedule = $this->pay_mdl->gets('pay_schedule', $session_param);\n\n //var_dump($schedule);\n\n /*\n * check if schedule have exceptions\n */\n if($schedule['exceptions'] == 'Yes'){\n\n $excep = $this->pay_mdl->gets('my_pay_exception', $session_param);\n\n if(is_array($excep) && !empty($excep)){\n\n foreach($excep as $key => $value){\n\n if($excep[$key]['unittype'] == 'programme'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break;\n\n }elseif($excep[$key]['unittype'] == 'department'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break;\n\n }elseif($excep[$key]['unittype'] == 'college'){\n\n $to_pay = array();\n array_push($to_pay, $excep[$key]);\n\n break; \n } \n\n }\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => $to_pay[0]['exceptionid'],\n \"session_name\" => $to_pay[0]['sesname'],\n \"paying_amount\" => $to_pay[0]['ex_amount'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"session_id\" => $this->main->item('cur_session'),\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"adm_status\" => $to_pay[0]['admstatus'],\n \"level\" => $to_pay[0]['level'],\n \"payer_type\" => $to_pay[0]['payertype'],\n \"total_percent_paid\" => $tot,\n \"total_paid\" => $total_paid,\n \"revenue_head\" => $schedule['revhead']\n );\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n\n }else{\n\n $to_pay = array();\n array_push($to_pay, $schedule);\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => NULL,\n \"session_name\" => $to_pay[0]['sesname'],\n \"paying_amount\" => $to_pay[0]['amount'],\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"session_id\" => $this->main->item('cur_session'),\n \"adm_status\" => NULL,\n \"level\" => NULL,\n \"payer_type\" => NULL,\n \"total_percent_paid\" => $tot,\n \"revenue_head\" => $schedule['revhead']\n );\n\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n\n } // End of Exception is not Empty\n\n }else{\n\n $to_pay = array();\n array_push($to_pay, $schedule);\n\n $my_paying = array(\n \"schedule_id\" => $to_pay[0]['scheduleid'],\n \"schedule_type\" => $to_pay[0]['type'],\n \"exception_id\" => NULL,\n \"session_name\" => $to_pay[0]['sesname'],\n \"session_id\" => $this->main->item('cur_session'),\n \"paying_amount\" => $to_pay[0]['amount'],\n \"school_id\" => $to_pay[0]['schoolid'],\n \"penalty\" => ($schedule['penalty_status'] == 'active')? $schedule['penalty'] : 0,\n \"penalty_status\" => $schedule['penalty_status'],\n \"adm_status\" => NULL,\n \"level\" => NULL,\n \"payer_type\" => NULL,\n \"total_percent_paid\" => $tot,\n \"revenue_head\" => $schedule['revhead']\n );\n\n if($schedule['penalty_status'] == 'active'){\n\n $my_paying['penalty_percentage'] = (100 - $my_paying['total_percent_paid']);\n $my_paying['paying_amount'] = (($my_paying['paying_amount'] + $schedule['penalty']) - $total_paid);\n\n }else{\n\n $percentage_arr = explode(':', $to_pay[0]['percentage']);\n\n $a = $hist_perc;\n $b = $percentage_arr;\n\n foreach ($a as $key => $value) {\n foreach($b as $k => $v){\n if($value == $v){\n unset($b[$k]);\n break;\n }\n }\n }\n\n $my_paying['percentage'] = $b;\n\n }// End of penalty Check\n\n }//End of schedule Has Exception Check\n\n $data['my_paying'] = $my_paying;\n\n break;\n\n default:\n break;\n } \n \n \n \n \n \n \n \n $page_name = 'paynow';\n \n //build view page for pay Now \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n \n \n \n }", "public function _generate($params)\n {\n $all = $makati = $clark = 0;\n $filter = array(\n 'sort' => \"floor_name\",\n 'search' => \"\"\n );\n\n $event_id = $_GET['event_id'];\n $model_attendee = &GnGn::getInstance('Model_Attendee');\n $attendees = $model_attendee->get_all_attendees($event_id, $filter);\n\n if(!empty($attendees) && is_array($attendees)):\n $all = count($attendees);\n foreach ($attendees as $key => $value) {\n if((int)$value['office_branch'] === 1):\n $clark++;\n else:\n $makati++;\n endif;\n }\n endif;\n return compact('event_id', 'attendees', 'all', 'makati', 'clark');\n }", "function getReport() ;", "public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }", "public function Get_Evaluate_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=evaluate&semester=\".$semester.\"&year=\".$year;\n $sql =\"SELECT `course_id` FROM `course_evaluate` WHERE `status` = '1' AND `semester_id` = \".$semester_id.\" ORDER BY `course_id`\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n \t$count = count($result);\n for($i=0;$i<$count;$i++)\n {\n if(!in_array($result[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $data['id'] = $result[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['syllabus'] = $this->COURSE->Get_Course_Syllabus($data['id'],$semester_id);\n $data['pdf'] = $this->DOWNLOAD_URL.\"?course=\".$data['id'].\"&type=report&info=evaluate&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT `file_name` FROM `couse_grade` WHERE `course_id` = '\".$data['id'].\"' AND `semester_id` = \".$semester_id;\n $result_filename = $this->DB->Query($sql);\n if($result_filename)\n {\n $data['grade'] = $result_filename[0]['file_name'];\n }\n else\n {\n $data['grade'] = null;\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n\n }", "public function testReport(){\n // $autoTaskTools->checkTask('AutoDaySessReport');\n // $date = array(\n // date_to_int('-',date('Y-m-01', strtotime('-1 month'))),\n // date_to_int('-',date('Y-m-t', strtotime('-1 month'))),\n // );\n\n $reportTools = new ReportTools();\n $reportTools->saveReportList('AutoDaySessReport');\n\n\n $BeginDate = date('Y-m-01', strtotime(date(\"Y-m-d\")));\n $date = array(\n date_to_int('-',$BeginDate),\n date_to_int('-',date('Y-m-d', strtotime(\"$BeginDate +1 month -1 day\"))),\n );\n $month = date('Y-m-01', strtotime('-1 month'));\n $month1 = date('Y-m-t', strtotime('-1 month'));\n dump($month);\n dump($month1);\n $mytime = date(\"Y-01-01\", strtotime(\"-1 year\"));\n dump($mytime);\n $monthEndDays = cal_days_in_month(CAL_GREGORIAN, 12, date(\"Y\", strtotime(\"-1 year\")));\n $year = date(\"Y-12-\".$monthEndDays, strtotime(\"-1 year\"));\n echo 'year:' . $year;\n $monthDays = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 month')), date('Y'));\n dump($monthDays);\n echo 'n:' . date('n');\n $season = ceil((date('n'))/3)-1;\n echo '<br>上季度起始时间:<br>';\n echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n //获取第几季度\n // $season = ceil((date('n'))/3);\n // echo date('m', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n // echo date('Y-m-d', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n dump($season);\n // $daySessReportTools = new DaySessReportTools();\n // $daySessReportTools->getDateList($date);\n // $daySessReportTools->daySessExcelGen($date);\n //\n // $dayErrorReportTools = new DayErrorReportTools();\n // $dayErrorReportTools->dayErrorExcelGen($date);\n // $daySessReportTools->getDateList($date);\n $str = stristr('DaySuccessReport_UID_2017-06-29.xlsx','_',true);\n dump($str);\n $this->display();\n }", "private function XML_getXSSTestSubjects() {\n\t\t$subjectsEntity = $this->xmlHandler->createElement('subjects');\n\n\t\tforeach( $this->XSSReport->getTechniqueList() as $techniqueType => $techniques ) {\n\t\t\tforeach($techniques as $techniqueName) {\n\t\t\t\t$subjectEntity = $this->xmlHandler->createElement('subject');\n\t\t\t\t$subjectEntity->appendChild($this->xmlHandler->createTextNode($techniqueName));\n\t\t\t\t$subjectTechniqueTypeEntity = $this->xmlHandler->createAttribute('type');\n\t\t\t\tif($techniqueType === 'check' )\n\t\t\t\t\t$subjectTechniqueTypeEntity->appendChild($this->xmlHandler->createTextNode('vulnerability'));\n\t\t\t\telseif($techniqueType === 'inject')\n\t\t\t\t\t$subjectTechniqueTypeEntity->appendChild($this->xmlHandler->createTextNode('exploit'));\n\t\t\t\t$subjectEntity->appendChild($subjectTechniqueTypeEntity);\n\n\t\t\t\t$subjectsEntity->appendChild($subjectEntity);\n\t\t\t}\n\t\t}\n\n\t\treturn $subjectsEntity;\n\t}", "function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}", "public function reportStudentDoorAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportStudentDoorAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister); \n }", "public function generateReport(Request $request)\n {\n $this->authorize('report', Purchase::class);\n $reportCard = [];\n if ($request->input('year-month')) {\n $reportCard = [\n 'time' => $request->input('year-month'),\n 'total_cost' => $this->_monthlyBuilder('total_cost', $request),\n 'total_qty' => $this->_monthlyBuilder('total_qty', $request),\n 'tax_amount' => $this->_monthlyBuilder('tax_amount', $request),\n 'total_payment' => $this->_monthlyBuilder('total_payment', $request),\n 'shipping' => $this->_monthlyBuilder('shipping', $request),\n 'off_amount' => $this->_monthlyBuilder('discount_amount', $request),\n 'list' => $this->_monthlyBuilder('id', $request, true),\n ];\n }\n if ($request->date_s && $request->date_e) {\n $reportCard = [\n 'time' => $request->date_s . ' to ' . $request->date_e,\n 'total_cost' => $this->_periodBuilder('total_cost', $request),\n 'total_qty' => $this->_periodBuilder('total_qty', $request),\n 'tax_amount' => $this->_periodBuilder('tax_amount', $request),\n 'total_payment' => $this->_periodBuilder('total_payment', $request),\n 'shipping' => $this->_periodBuilder('shipping', $request),\n 'off_amount' => $this->_periodBuilder('discount_amount', $request),\n 'list' => $this->_periodBuilder('id', $request, true),\n 'date_s' => $request->date_s,\n 'date_e' => $request->date_e,\n ];\n }\n if ($request->frame) {\n $reportCard = [\n 'time' => ucwords($request->frame),\n 'total_cost' => $this->_frameBuilder('total_cost', $request),\n 'total_qty' => $this->_frameBuilder('total_qty', $request),\n 'tax_amount' => $this->_frameBuilder('tax_amount', $request),\n 'total_payment' => $this->_frameBuilder('total_payment', $request),\n 'shipping' => $this->_frameBuilder('shipping', $request),\n 'off_amount' => $this->_frameBuilder('discount_amount', $request),\n 'list' => $this->_frameBuilder('id', $request, true),\n 'frame' => $request->frame,\n ];\n }\n if (request()->input('print') === 'yes') {\n return view('report.cost.costPrint', compact('reportCard'));\n }\n event(\n new LogActivity(\n $reportCard['time'],\n __('Cost report generated'),\n __('Report')\n )\n );\n return view('report.cost.cost')\n ->with('reportData', json_encode($reportCard))\n ->with('reportCard', $reportCard);\n }", "public function getSubjectCodes() {\n\t\n\t\t\t$this->valid_subject_codes = array();\n\t\t\t\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT Description, ID FROM tblsubject\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$key = $sql->Record['Description'];\n\t\t\t\t\t$this->valid_subject_codes[$key] = $sql->Record['ID'];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function Generate_Report()\n\t{\n\t\t//\n\t\t// criteria start_date YYYYMMDD\n\t\t// criteria end_date YYYYMMDD\n\t\t// company_id\n\t\t//\n\t\ttry\n\t\t{\n\t\t\t$this->search_query = new Transaction_History_Report_Query($this->server);\n\n\t\t\t$data = new stdClass();\n\n\t\t\t// Save the report criteria\n\t\t\t$data->search_criteria = array(\n\t\t\t 'specific_date_MM' => $this->request->specific_date_month,\n\t\t\t 'specific_date_DD' => $this->request->specific_date_day,\n\t\t\t 'specific_date_YYYY' => $this->request->specific_date_year,\n\t\t\t 'company_id' => $this->request->company_id,\n\t\t\t 'loan_type' => $this->request->loan_type\n\t\t\t);\n\n\t\t\t$_SESSION['reports']['transaction_history']['report_data'] = new stdClass();\n\t\t\t$_SESSION['reports']['transaction_history']['report_data']->search_criteria = $data->search_criteria;\n\t\t\t$_SESSION['reports']['transaction_history']['url_data'] = array('name' => 'Transaction History', 'link' => '/?module=reporting&mode=transaction_history');\n\n\t\t\t// Start date\n\t\t\t$start_date_YYYY = $this->request->specific_date_year;\n\t\t\t$start_date_MM\t = $this->request->specific_date_month;\n\t\t\t$start_date_DD\t = $this->request->specific_date_day;\n\t\t\tif(!checkdate($start_date_MM, $start_date_DD, $start_date_YYYY))\n\t\t\t{\n\t\t\t\t//return with no data\n\t\t\t\t$data->search_message = \"Start Date invalid or not specified.\";\n\t\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$start_date_YYYYMMDD = 10000 * $start_date_YYYY\t+ 100 * $start_date_MM + $start_date_DD;\n\n\t\t\t$data->search_results = $this->search_query->Fetch_Transaction_History_Data( $start_date_YYYYMMDD,\n\t\t\t\t $this->request->loan_type,\n\t\t\t\t $this->request->company_id);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$data->search_message = \"Unable to execute report. Reporting server may be unavailable.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// we need to prevent client from displaying too large of a result set, otherwise\n\t\t// the PHP memory limit could be exceeded;\n\t\tif(!empty($data->search_results) && count($data->search_results) > $this->max_display_rows)\n\t\t{\n\t\t\t$data->search_message = \"Your report would have more than \" . $this->max_display_rows . \" lines to display. Please narrow the date range.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Sort if necessary\n\t\t$data = $this->Sort_Data($data);\n\n\t\tECash::getTransport()->Add_Levels(\"report_results\");\n\t\tECash::getTransport()->Set_Data($data);\n\t\t$_SESSION['reports']['transaction_history']['report_data'] = $data;\n\t}", "public function gen_inv_pdf_basedon_subsidy($invoice_id, $is_subsidy) {\n $tenant_id = $this->tenant_id;\n if (empty($invoice_id)) {\n return show_404();\n }\n if (empty($is_subsidy)) {\n $res = $this->classtraineemodel->get_company_invoice_no_subsidy($invoice_id);\n $text = 'b';\n } else {\n $res = $this->classtraineemodel->get_company_invoice_subsidy($invoice_id);\n $text = 'a';\n }\n \n $result = $res[0];\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($invoice_id);\n //\n $result->invoice_label = $text;\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n }\n //$result->discount_rate = round($result->discount_rate, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n $total_unitfees = 0;\n $total_discount = 0;\n $total_gst = 0;\n $total_subsidy = 0;\n $total_inv_amount = 0;\n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach ($res as $k => $row) {\n $received = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $refunded = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($row->total_amount_due + $refunded) - $received) <= 0){\n $payment_label = 'PAID';\n }else{ \n if($refunded > 0){\n $payment_label = 'REFUNDED'; \n } else{ \n if($received == 0){\n $payment_label = 'NOT PAID';\n }else if($received > 0){\n $payment_label = 'PART PAID';\n }\n }\n }\n $res[$k]->payment_label = $payment_label;\n $total_unitfees +=$row->class_fees;\n $total_discount += ($row->class_fees * ($result->discount_rate / 100));\n $total_gst += $row->gst_amount;\n $total_subsidy += $row->subsidy_amount;\n $total_inv_amount += $row->total_amount_due;\n $result->total_inv_amount1 = $row->total_inv_amount;\n }\n $result->payble_amount=$total_inv_amount+$refunded_amt-$received_amt;\n $result->total_unit_fees = round($total_unitfees, 2);\n $result->total_inv_discnt = round($total_discount, 2);\n $result->total_inv_subsdy = round($total_subsidy, 2);\n $result->total_gst = round($total_gst, 2);\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n $result->total_inv_amount = round($total_inv_amount, 2);\n $result->payment_due_details = $res;\n\n $this->load->helper('pdf_reports_helper');\n generate_company_pdf_invoice($result);\n }", "public function generateReport()\n {\n $activities = '';\n // General information.\n $totalExecution = $this->getActivityDetails(DFullProfiler::ACTIVITY_TOTAL);\n $report = '<h2>General Performance Details</h2>';\n $report .= '<table><tbody>';\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Total Execution Time</th><td>%0.4f sec</td></tr>\\n\",\n $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ]);\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Execution Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryExecutionTime,\n ($this->queryExecutionTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Processing Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryProcessingTime,\n ($this->queryProcessingTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<tr><th width=\\\"180px\\\">Memory Cache Usage</th><td>%0.4f sec (%0.1f%%) [%d Hits, %d Missed, %d Added, %d Removed, %d Invalidations]</td></tr>\\n\",\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ],\n ($this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ] / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100),\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_HIT ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_MISS ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_ADD ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_REMOVE ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_INVALIDATION ]);\n $report .= \"\\t<tr><th width=\\\"180px\\\">Peak Memory Usage</th><td>\" . DFile::bytesToString(memory_get_peak_usage(),\n 5) . \" (\" . DFile::bytesToString(DFile::stringToBytes(ini_get('memory_limit'))) . \" available)</td></tr>\\n\";\n $report .= '</tbody></table>';\n // Activity times.\n foreach ($this->activities as $name => $activity) {\n $end =& $activity[ DFullProfiler::ACTIVITY_POINT_END ];\n $length = $end[ DFullProfiler::ACTIVITY_VALUE_TIME ];\n $memory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ], 2);\n $peakMemory = DFile::bytesToString($activity['peakMemory'], 2);\n $queries = $end[ DFullProfiler::ACTIVITY_VALUE_QUERIES ];\n $modelsMemory = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_MEMORY ];\n $modelsCache = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_CACHE ];\n $modelsDatabase = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_DATABASE ];\n $cacheHit = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_HIT ];\n $cacheMiss = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_MISS ];\n $iterations = $activity[ DFullProfiler::ACTIVITY_VALUE_ITERATIONS ];\n if ($iterations > 1) {\n $iterationLength = $length / $iterations;\n $iterationMemory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ] / $iterations, 2);\n $iterationQueries = $queries / $iterations;\n $iterationObjectsMemory = $modelsMemory / $iterations;\n $iterationObjectsCache = $modelsCache / $iterations;\n $iterationObjectsDatabase = $modelsDatabase / $iterations;\n $iterationCacheHit = $cacheHit / $iterations;\n $iterationCacheMiss = $cacheMiss / $iterations;\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec<br />(%0.4f sec)</td><td class=\\\"good\\\">%s<br />(%s)</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $iterationLength, $memory, $iterationMemory, $peakMemory,\n $queries, $iterationQueries, $modelsMemory, $iterationObjectsMemory,\n $modelsCache, $iterationObjectsCache, $modelsDatabase == 0 ? 'good' : 'bad',\n $modelsDatabase, $iterationObjectsDatabase, $cacheHit, $iterationCacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterationCacheMiss, $iterations);\n } else {\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $memory, $peakMemory, $queries, $modelsMemory, $modelsCache,\n $modelsDatabase == 0 ? 'good' : 'bad', $modelsDatabase, $cacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterations);\n }\n }\n $report .= '<h2>Performance Break-down</h2>';\n $report .= sprintf('<table><thead><tr><th width=\"100px\" rowspan=\"2\">Activity</th><th rowspan=\"2\">Execution Time</td><th rowspan=\"2\">Memory Usage<br />Differential</th><th rowspan=\"2\">Memory Usage<br />Peak</th><th rowspan=\"2\">Queries</th><th colspan=\"3\">Loaded Models</th><th colspan=\"2\">Cache Activity</th><th rowspan=\"2\">Iterations</th></tr><tr><th>Memory</th><th>Cache</th><th>Database</th><th>Hit</th><th>Miss</th></tr></thead><tbody>%s</tbody></table>',\n $activities);\n // Query information.\n $report .= $this->generateQueryReport();\n // Cache information.\n $report .= $this->generateCachesReport() . '<br />';\n $url = DRequest::load()->getUrl();\n\n return \"<h1 id=\\\"\" . count(DErrorHandler::$profiling) . \"\\\">Profiler ({$url})</h1>{$report}\";\n }", "public function generate()\n {\n $reportType = Input::get('report_type');\n $from = Input::get('from');\n $to = Input::get('to');\n $disciplineId = Input::get('discipline');\n $info = explode(',', Input::get('info'));\n $id = $info[1];\n $type = $info[0];\n $license = array_key_exists(2, $info) ? $info[2] : '0';\n\n $from = empty($from) ? null : date('Y-m-d', strtotime($from));\n $to = empty($to) ? null : date('Y-m-d', strtotime($to));\n \n if (! $reportType) {\n Flash::danger('Please select a <strong>Report Type</strong>.');\n return Redirect::route('reports.index')->withInput();\n }\n\n if (empty($from)) {\n Flash::danger('Please enter a <strong>From Date</strong> to generate report.');\n return Redirect::route('reports.index')->withInput();\n }\n\n // all route params\n $routeParams = [$disciplineId, $type, $id, $license, $from, $to];\n\n switch ($reportType) {\n case 'site_summary':\n return Redirect::route('reports.site_summary', $routeParams);\n break;\n\n case 'scheduled_exams':\n return Redirect::route('reports.scheduled_exams', $routeParams);\n break;\n\n case 'retake_summary':\n return Redirect::route('reports.retake_summary', $routeParams);\n break;\n\n case 'skills_detail':\n return Redirect::route('reports.skills_detail', $routeParams);\n break;\n\n case 'knowledge_detail':\n return Redirect::route('reports.knowledge_detail', $routeParams);\n break;\n\n case 'pass_fail':\n // if admin / agency / staff show a page to select facility and instructor\n /*if(Auth::user()->ability(['Admin', 'Staff', 'Agency'], []))\n {\n return Redirect::route('reports.select_facility', [$from, $to]);\n }*/\n\n // Otherwise just show the regular pass/fail report\n return Redirect::route('reports.pass_fail', $routeParams);\n break;\n\n default:\n Flash::warning('This report type is not yet supported.', 'Warning');\n return Redirect::route('reports.index');\n\n }\n }", "public function basicreport()\n\t{\n\t\t\n\t\t$disp_msg = $this->session->flashdata('disp_msg');\n\t\t\n\t\t\n\t\t$search_filters = array();\n\t\t$search_results = array();\n\t\t\n\t\t$search_query = \"SELECT * FROM postpatch_schedule WHERE 1=1 \";\n\t\t\n\t\tif (!empty($_POST)) {\n\t\t\tif(!empty($_POST['dpa_flexinet_id']) && count($_POST['dpa_flexinet_id'])>0) {\n\t\t\t\t$dpavals = implode(\"' , '\", $_POST['dpa_flexinet_id']);\n\t\t\t\t$search_query .= \" AND dpa_flexinet IN ('\".$dpavals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['verificationstatus']) && count($_POST['verificationstatus'])>0) {\n\t\t\t\t$verfstatusvals = implode(\"' , '\", $_POST['verificationstatus']);\n\t\t\t\t$search_query .= \" AND verificationstatus IN ('\".$verfstatusvals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['scheduledate']) && count($_POST['scheduledate'])>0) {\n\t\t\t\t$scdvals = implode(\"' , '\", $_POST['scheduledate']);\n\t\t\t\t$search_query .= \" AND scheduledate IN ('\".$scdvals.\"') \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search_query_res = $this->commonclass->execute_rawquery($search_query);\n\t\t$search_results = $search_query_res->result_array();\n\t\t\n\t\t$dpa_emps = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(dpa_flexinet) as dpa_flexinet ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($dpa_emps)>0) {\n\t\t\tforeach($dpa_emps as $onedpa) {\n\t\t\t\t$search_filters['dpa'][] = $onedpa['dpa_flexinet'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$verf_status_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(verificationstatus) as verificationstatus ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($verf_status_res)>0) {\n\t\t\tforeach($verf_status_res as $oneverif) {\n\t\t\t\t$search_filters['verf_status'][] = $oneverif['verificationstatus'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$scheduledate_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(scheduledate) as scheduledate ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($scheduledate_res)>0) {\n\t\t\tforeach($scheduledate_res as $oneverif1) {\n\t\t\t\t$search_filters['scheduledates'][$oneverif1['scheduledate']] = ($oneverif1['scheduledate'] != \"0000-00-00\") ? $this->commonclass->dateformat1($oneverif1['scheduledate']) : \"00/00/0000\";\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t## ____________ Data sending to the template starts ____________ ##\n\t\t$data['disp_msg'] = $disp_msg; # display messages\n\t\t$data['search_filters'] = $search_filters; # search_filters\n\t\t$data['search_results'] = $search_results; # search_filters\n\t\t//$data['postpatch_uploads'] = $postpatch_uploads; # postpatch_schedule\n\t\t\n\t\t## ____________ Data sending to the template ends here ____________ ##\n\t\t\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/header', $data); # html view page\n\t\t$this->load->view('admin/report1-page', $data); # html view page\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/footer', $data); # html view page\n\t}", "function exam_schedule()\n\t {\n\t\t$standardcode = $_REQUEST['standardcode'];\n\t\t$exam_data \t \t\t\t= $this ->ObjM->get_exam_by_standard($standardcode);\n\t\t//var_dump($exam_data); exit;\n\t\t\n\t\tif(count($exam_data)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($exam_data);$i++){\n\t\t\t$exam_date = date('d-m-Y',$exam_data[$i]['date_dt']);\n\t\t\t$exam_time = $exam_data[$i]['start_time'].' To '.$exam_data[$i]['end_time'];\n\t\t\t\n\t\t\t$json_arr[]=array(\n\t\t\t\t\t'standard_name'\t\t=>\t$exam_data[$i]['standard_name'],\n\t\t\t\t\t'exam_title'\t\t=>\t$exam_data[$i]['exam_title'],\n\t\t\t\t\t'subject_name'\t\t=>\t$exam_data[$i]['subject_name'],\n\t\t\t\t\t'exam_date'\t\t\t=>\t$exam_date,\n\t\t\t\t\t'exam_time'\t\t\t=>\t$exam_time,\n\t\t\t\t\t'marks'\t\t\t\t=>\t$exam_data[$i]['marks'],\n\t\t\t\t\t'validation'\t \t\t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t }", "public function CreateExcelReport(){\n\t\t$objPHPExcel = new PHPExcel();\n\n\t\t$rows = array();\n\t\t$row_count = 2; //counter to loop through the Excel spreadsheet rows\n\n\t\t$objPHPExcel->getProperties()->setCreator(\"dxLink\")\n\t\t\t\t\t\t\t ->setLastModifiedBy(\"dxLink\")\n\t\t\t\t\t\t\t ->setTitle(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setSubject(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setDescription(\"Generates all data from dxLink evaluation program form\")\n\t\t\t\t\t\t\t ->setKeywords(\"dxLink evaluation program form feedback\")\n\t\t\t\t\t\t\t ->setCategory(\"evaluation result file\");\n\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', 'First Name')\n\t\t\t\t ->setCellValue('B1', 'Last Name')\n\t\t\t\t ->setCellValue('C1', 'Program')\n\t\t\t\t ->setCellValue('D1', 'Question')\n\t\t\t\t ->setCellValue('E1', 'Answer')\n\t\t\t\t ->setCellValue('F1', 'Comment')\n\t\t\t\t ->setCellValue('G1', 'Date Posted');\n\n \t$sql = \"SELECT doctor_answers.question_id, doctor_answers.doctor_answer, DATE_FORMAT(doctor_answers.date_of_answer,'%Y-%m-%d') AS date_of_answer, doctor_answers.comments, doctors.first_name, doctors.last_name, program_sections.program_id \n\t\tFROM doctor_answers, doctors, program_sections, questions \n\t\tWHERE doctors.doctor_id = doctor_answers.doctor_id AND program_sections.program_section_id = doctor_answers.program_section_id AND program_sections.program_section_type = 'Evaluation form' AND questions.question_id = doctor_answers.question_id\n\t\tORDER BY doctor_answers.date_of_answer DESC\";\n\n $query = $this->con->prepare($sql);\n $query->execute();\n\n while($result_row = $query->fetch(PDO::FETCH_ASSOC) ){\n \t$fisrt_name = $result_row['first_name'];\n \t$last_name = $result_row['last_name'];\n \t$program_id = $result_row['program_id']; \n\t\t\t$question_id = $result_row['question_id']; \n\t\t\t$answer = $result_row['doctor_answer']; \n\t\t\t$date_posted = $result_row['date_of_answer'];\n\t\t\t$comment = $result_row['comments'];\n\t\t\t$program = $this->Get_Program($program_id);\n\t\t\t$question = $this->Get_question($question_id);\n\t\t\tarray_push($rows, array($fisrt_name, $last_name, $program, $question, $answer, $comment, $date_posted));\n }\n \n \n foreach ($rows as $row => $column) {\n\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A' . $row_count, $column[0])\n\t\t\t\t\t\t\t ->setCellValue('B' . $row_count, $column[1])\n\t\t\t\t\t\t\t ->setCellValue('C' . $row_count, $column[2])\n\t\t\t\t\t\t\t ->setCellValue('D' . $row_count, $column[3])\n\t\t\t\t\t\t\t ->setCellValue('E' . $row_count, $column[4])\n\t\t\t\t\t\t\t ->setCellValue('F' . $row_count, $column[5])\n\t\t\t\t\t\t\t ->setCellValue('G' . $row_count, $column[6]);\n\n\t\t\t$objPHPExcel->getActiveSheet()->getRowDimension($row_count)->setRowHeight(50); \n\n\t\t $row_count++;\t\t\n\t\t}\t\n\n\t\t//Set widths of all columns\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n\n\t\t//Fill design settings for first heading row\n\t\t$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(30);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FF808080');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->setSize(16);\n\t\t$objPHPExcel->getActiveSheet()->freezePane('A2');\n\n\t\t//Align all cells\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('../Reports/dxLink_Evaluation_feedback_report.xlsx');\n\t\t\n\t\techo 'exported';\n\t\treturn true;\n\t}", "function get_time_table()\n\t{\n\t\t$usercode \t \t= $_REQUEST['usercode'];\n\t\t$daycode \t\t= $_REQUEST['day_code'];\n\t\t$user_dt \t \t\t= $this ->ObjM->get_user_by_usercode($usercode);\n\t\t$yearly_acccount \t= $this ->ObjM->student_yearly_acccount($user_dt[0]['idcode']);\n\t\t\n\t\t$arr=array('standard_code' =>$yearly_acccount[0]['current_standard'],'division_code' =>$yearly_acccount[0]['division_code'],'day' =>$daycode);\n\t\t$time_table\t\t\t=\t$this->ObjM->get_time_table($arr);\n\t\t\n\t\tif(count($time_table)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($time_table);$i++){\n\t\t\tif($time_table[$i]['recess'] == 'Y')\n\t\t\t { \n\t\t\t\t$time = $time_table[$i]['recess_to'] .'-'. $time_table[$i]['recess_from'];\n\t\t\t\t$recess = $time_table[$i]['recess_to'] .'-'. $time_table[$i]['recess_from'];\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\t$time = $time_table[$i]['s_time'] .'-'. $time_table[$i]['e_time'];\n\t\t\t\t$recess = '-';\n\t\t\t }\n\t\t\t \n\t\t\tif($time_table[$i]['subject_name'] == '')\n\t\t\t { \n\t\t\t\t$subject_name = '-';\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\t$subject_name = $time_table[$i]['subject_name'];\n\t\t\t }\n\t\t\t \n\t\t\t if($time_table[$i]['staff_name'] == '')\n\t\t\t { \n\t\t\t\t$staff_name = '-';\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\t$staff_name = $time_table[$i]['staff_name'];\n\t\t\t }\n\t\t\t \n\t\t\t \t$lec=($i==0)?'-':$i;\n\t\t\t \t\n\t\t\t\t$json_arr[]=array(\n\t\t\t\t\t'lecture'\t\t=>\t$lec,\n\t\t\t\t\t'time'\t\t\t=>\t$time,\n\t\t\t\t\t'recess'\t\t=>\t$recess,\n\t\t\t\t\t'subject_name'\t=>\t$subject_name,\n\t\t\t\t\t'staff_name'\t=>\t$staff_name,\n\t\t\t\t\t'validation'\t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t}", "public function invoice_ammend_summary_function($path6, $invoice_ammend) {\n $object = PHPExcel_IOFactory::load($path6);\n $worksheet = $object->getActiveSheet();\n $highestRow = $worksheet->getHighestRow();\n $highestColumn = $worksheet->getHighestColumn();\n $customer_id = $this->input->post(\"cust_id\");\n $insert_id = $this->generate_insert_id();\n $customer_file_years = $this->input->post('customer_file_years');\n $original_month = array();\n $include_month = array();\n $amendment_month = array();\n $category = array();\n $gstin_arr = array();\n $invoice_date = array();\n $invoice_no = array();\n $name = array();\n $invoice_value = array();\n $taxable_value = array();\n $igst = array();\n $cgst = array();\n $sgst = array();\n $cess = array();\n $abc2 = $object->getActiveSheet()->getCell('A' . 3)->getValue();\n $x = filter_var($abc2, FILTER_SANITIZE_NUMBER_INT);\n $a1 = chunk_split($x, 4, \"-\");\n $a2 = rtrim($a1, '-');\n// exit;\n if ($customer_file_years == \"\") {\n $response['id'] = 'customer_file_years';\n $response['error'] = 'Please Select year';\n echo json_encode($response);\n exit;\n } else if ($customer_file_years == $a2) {\n for ($i = 0; $i <= $highestRow; $i++) {\n if ($object->getActiveSheet()->getCell(\"B\" . $i)->getValue() == \"Original Month\") { //get records of origial month\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $og_mon = $object->getActiveSheet()->getCell(\"B\" . $j)->getValue();\n $original_month[] = $og_mon;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"C\" . $i)->getValue() == \"Include in month\") { //get records of Showing month\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $show_mon = $object->getActiveSheet()->getCell(\"C\" . $j)->getValue();\n $include_month[] = $show_mon;\n }\n } else {\n \n } if ($object->getActiveSheet()->getCell(\"D\" . $i)->getValue() == \"Amendment in month\") { //get records of Showing month\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $amend_mon = $object->getActiveSheet()->getCell(\"D\" . $j)->getValue();\n $amendment_month[] = $amend_mon;\n }\n } else {\n \n }\n\n if ($object->getActiveSheet()->getCell(\"E\" . $i)->getValue() == \"Category\") { //get records of Showing month\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $cat = $object->getActiveSheet()->getCell(\"E\" . $j)->getValue();\n $category[] = $cat;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"F\" . $i)->getValue() == \"GSTIN\") { //get records of GSTIN\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $gstin = $object->getActiveSheet()->getCell(\"F\" . $j)->getValue();\n $gstin_arr[] = $gstin;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"G\" . $i)->getValue() == \"Invoice Date\") { //get records of Invoice Date\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $invoiceDate = $object->getActiveSheet()->getCell(\"G\" . $j)->getValue();\n $invoice_date[] = $invoiceDate;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"H\" . $i)->getValue() == \"Invoice No\") { //get records of Invoice No\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $invoiceno = $object->getActiveSheet()->getCell(\"H\" . $j)->getValue();\n $invoice_no[] = $invoiceno;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"I\" . $i)->getValue() == \"Name\") { //get records of Names\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $names = $object->getActiveSheet()->getCell(\"I\" . $j)->getValue();\n $name[] = $names;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"J\" . $i)->getValue() == \"Invoice Value \") { //get records of Invoice Value \n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $invoice_val = $object->getActiveSheet()->getCell(\"J\" . $j)->getValue();\n $invoice_value[] = $invoice_val;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"K\" . $i)->getValue() == \"Taxable Value\") { //get records of Showing month\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $tax_val = $object->getActiveSheet()->getCell(\"K\" . $j)->getValue();\n $taxable_value[] = $tax_val;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"L\" . $i)->getValue() == \"IGST\") { //get records of IGST\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $igst_val = $object->getActiveSheet()->getCell(\"L\" . $j)->getValue();\n $igst[] = $igst_val;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"M\" . $i)->getValue() == \"CGST\") { //get records of CGST\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $cgst_val = $object->getActiveSheet()->getCell(\"M\" . $j)->getValue();\n $cgst[] = $cgst_val;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"N\" . $i)->getValue() == \"SGST\") { //get records of SGST\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $sgst_val = $object->getActiveSheet()->getCell(\"N\" . $j)->getValue();\n $sgst[] = $sgst_val;\n }\n } else {\n \n }\n if ($object->getActiveSheet()->getCell(\"O\" . $i)->getValue() == \"CESS\") { //get records of SGST\n for ($j = $i + 1; $j <= $highestRow; $j++) {\n $cess_val = $object->getActiveSheet()->getCell(\"O\" . $j)->getValue();\n $cess[] = $cess_val;\n }\n } else {\n \n }\n }\n } else {\n $response['id'] = 'file_ex_invoice_amend';\n $response['error'] = 'Year is mismatch with file.Please choose correct.';\n echo json_encode($response);\n exit;\n }\n\n\n $count = count($original_month);\n $query = $this->db2->query(\"SELECT * FROM `invoices_amended_summary_all` where customer_id='$customer_id'\");\n if ($this->db2->affected_rows() > 0) {\n $monthly_history = $this->insert_invoice_ammend_summary_history($customer_id);\n if ($monthly_history == true) {\n for ($k = 0; $k < $count; $k++) {\n\n if ($original_month[$k] == \"\") {\n $original_month[$k] = \"0\";\n }\n if ($include_month[$k] == \"\") {\n $include_month[$k] = \"0\";\n }\n if ($amendment_month[$k] == \"\") {\n $amendment_month[$k] = \"0\";\n }\n if ($category[$k] == \"\") {\n $category[$k] = \"0\";\n }\n if ($gstin_arr[$k] == \"\") {\n $gstin_arr[$k] = \"0\";\n }\n if ($invoice_date[$k] == \"\") {\n $invoice_date[$k] = \"0\";\n }\n if ($invoice_no[$k] == \"\") {\n $invoice_no[$k] = \"0\";\n }\n if ($name[$k] == \"\") {\n $name[$k] = \"Not Given\";\n }\n if ($invoice_value[$k] == \"\") {\n $invoice_value[$k] = \"0\";\n }\n if ($taxable_value[$k] == \"\") {\n $taxable_value[$k] = \"0\";\n }\n if ($igst[$k] == \"\") {\n $igst[$k] = \"0\";\n }\n if ($cgst[$k] == \"\") {\n $cgst[$k] = \"0\";\n }\n if ($sgst[$k] == \"\") {\n $sgst[$k] = \"0\";\n }\n if ($cess[$k] == \"\") {\n $cess[$k] = \"0\";\n }\n\n $query = (\"insert into invoices_amended_summary_all (`customer_id`,`insert_id`,`original_month`,`included_in_month`,`amendment_month`,\"\n . \"`category`,`gstin_no`,`invoice_date`,`invoice_no`,`name`,`invoice_value`,`taxable_value`,`igst`,`cgst`,`sgst`,`cess`)\"\n . \"values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)\");\n $this->db2->query($query, array($customer_id, $insert_id, $original_month[$k], $include_month[$k], $amendment_month[$k], $category[$k], $gstin_arr[$k],\n $invoice_date[$k], $invoice_no[$k], $name[$k], $invoice_value[$k], $taxable_value[$k], $igst[$k], $cgst[$k], $sgst[$k], $cess[$k]));\n if ($this->db2->affected_rows() > 0) {\n $invoice_ammend++;\n }\n }\n }\n } else {\n for ($k = 0; $k < $count; $k++) {\n\n if ($original_month[$k] == \"\") {\n $original_month[$k] = \"0\";\n }\n if ($include_month[$k] == \"\") {\n $include_month[$k] = \"0\";\n }\n if ($amendment_month[$k] == \"\") {\n $amendment_month[$k] = \"0\";\n }\n if ($category[$k] == \"\") {\n $category[$k] = \"0\";\n }\n if ($gstin_arr[$k] == \"\") {\n $gstin_arr[$k] = \"0\";\n }\n if ($invoice_date[$k] == \"\") {\n $invoice_date[$k] = \"0\";\n }\n if ($invoice_no[$k] == \"\") {\n $invoice_no[$k] = \"0\";\n }\n if ($name[$k] == \"\") {\n $name[$k] = \"Not Given\";\n }\n if ($invoice_value[$k] == \"\") {\n $invoice_value[$k] = \"0\";\n }\n if ($taxable_value[$k] == \"\") {\n $taxable_value[$k] = \"0\";\n }\n if ($igst[$k] == \"\") {\n $igst[$k] = \"0\";\n }\n if ($cgst[$k] == \"\") {\n $cgst[$k] = \"0\";\n }\n if ($sgst[$k] == \"\") {\n $sgst[$k] = \"0\";\n }\n if ($cess[$k] == \"\") {\n $cess[$k] = \"0\";\n }\n\n $query = (\"insert into invoices_amended_summary_all (`customer_id`,`insert_id`,`original_month`,`included_in_month`,`amendment_month`,\"\n . \"`category`,`gstin_no`,`invoice_date`,`invoice_no`,`name`,`invoice_value`,`taxable_value`,`igst`,`cgst`,`sgst`,`cess`)\"\n . \"values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)\");\n $this->db2->query($query, array($customer_id, $insert_id, $original_month[$k], $include_month[$k], $amendment_month[$k], $category[$k], $gstin_arr[$k],\n $invoice_date[$k], $invoice_no[$k], $name[$k], $invoice_value[$k], $taxable_value[$k], $igst[$k], $cgst[$k], $sgst[$k], $cess[$k]));\n if ($this->db2->affected_rows() > 0) {\n $invoice_ammend++;\n }\n }\n }\n return $invoice_ammend;\n }", "public function download_in_pdf($seq_no)\n\t{\n\t\t$this->load->model('statement_header_model');\n\t\t// $this->load->library('m_pdf');\n\t\t$this->load->model('transactions_model');\n\t\t$statement = $this->statement_header_model->get_statement($seq_no);\n\t\t$start_date = $statement[0]->START_DATE;\n\t\t$end_date = $statement[0]->END_DATE;\n\t\t$internal_key = $statement[0]->INTERNAL_KEY;\n\t\t$data['statement'] = $statement[0];\n\n\t\t// return print_r($statement);\n\t\t$data['transactions'] = $this->transactions_model\n\t\t\t\t->get_trans_history($start_date,$end_date,$internal_key);\n\n\t\t$data['start_date'] = $this->formatDate($start_date);\n\t\t$data['end_date'] = $this->formatDate($end_date);\n\n\n\t\t $this->load->helper('dompdf');\n\t\t $html = $this->load->view('transactions/view_statement2', $data, true);\n \t return pdf_create($html, 'eStatement as of '.$start_date. ' to' .$end_date);\n\t}", "public function render()\n {\n $chromosome = explode(\",\", $this->timetable->chromosome);\n $scheme = explode(\",\", $this->timetable->scheme);\n $data = $this->generateData($chromosome, $scheme);\n\n $days = $this->timetable->days()->orderBy('id', 'ASC')->get();\n $timeslots = TimeslotModel::orderBy('rank', 'ASC')->get();\n $classes = CollegeClassModel::all();\n\n $tableTemplate = '<h3 class=\"text-center\">{TITLE}</h3>\n <div style=\"page-break-after: always\">\n <table class=\"table table-bordered\">\n <thead>\n {HEADING}\n </thead>\n <tbody>\n {BODY}\n </tbody>\n </table>\n </div>';\n\n $content = \"\";\n\n foreach ($classes as $class) {\n $header = \"<tr class='table-head'>\";\n $header .= \"<td>Days</td>\";\n\n foreach ($timeslots as $timeslot) {\n $header .= \"\\t<td>\" . $timeslot->time . \"</td>\";\n }\n\n $header .= \"</tr>\";\n\n $body = \"\";\n\n foreach ($days as $day) {\n $body .= \"<tr><td>\" . strtoupper($day->short_name) . \"</td>\";\n foreach ($timeslots as $timeslot) {\n if (isset($data[$class->id][$day->name][$timeslot->time])) {\n $body .= \"<td class='text-center'>\";\n $slotData = $data[$class->id][$day->name][$timeslot->time];\n $courseCode = $slotData['course_code'];\n $courseName = $slotData['course_name'];\n $professor = $slotData['professor'];\n $room = $slotData['room'];\n\n $body .= \"<span class='course_code'>{$courseCode}</span><br />\";\n $body .= \"<span class='room pull-left'>{$room}</span>\";\n $body .= \"<span class='professor pull-right'>{$professor}</span>\";\n\n $body .= \"</td>\";\n } else {\n $body .= \"<td></td>\";\n }\n }\n $body .= \"</tr>\";\n }\n\n $title = $class->name;\n $content .= str_replace(['{TITLE}', '{HEADING}', '{BODY}'], [$title, $header, $body], $tableTemplate);\n }\n\n $path = 'public/timetables/timetable_' . $this->timetable->id . '.html';\n Storage::put($path, $content);\n\n $this->timetable->update([\n 'file_url' => $path\n ]);\n }", "function genrate_inspectorvehicleloghistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n \n\t\t$columnwidtharrays = array(15,17,16,20,15,15,15,15,27,16,18);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c = 0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t \n\n\t\t if( $c == 0 || $c ==3 || $c ==6 || $c ==7|| $c ==9|| $c ==8){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 6, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_log_date = \t\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date']));\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleLogDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name= \t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t $nu_start_ometer=\t\tnumber_format($val['VehicleLogDetail']['nu_start_ometer']);\n\t\t\t$nu_end_ometer = \t\tnumber_format($val['VehicleLogDetail']['nu_end_ometer']);\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t\t$ch_road_type = 'Other Road';\n\t\t\telse\n\t\t\t\t$ch_road_type = 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t // $vc_orign_name = \t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t\t // $vc_destination_name = \t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t // $nu_km_traveled = \t\tnumber_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t // $nu_other_road_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_created_date']));\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_log_date, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_start_ometer, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_end_ometer, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $destination, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_km_traveled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t}\n\t}", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "public function formatData(){\n $from = $this->dataObject->getFrom();\n\n // prepare array for counterxmlbuild with vendor informations\n $data = array(\n 'Report' => array (\n 0 => array(\n // Report attributes\n 'Created' => date('Y-m-d\\TH:i:s'),\n 'ID' => 'ID01', //TODO\n 'Version' => $this->dataObject->getVersion(),\n 'Name' => $this->dataObject->getReportName(),\n 'Title' => $this->dataObject->getReportTitle(),\n // Vendor node\n 'Vendor' => array(\n 'Name' => VENDOR_NAME,\n 'ID' => VENDOR_ID,\n 'Contact' => array(\n 0 => array(\n 'Contact' => VENDOR_CONTACT_NAME,\n 'E-mail' => VENDOR_CONTACT_MAIL\n ),\n ),\n 'WebSiteUrl' => VENDOR_WEBSITEURL,\n 'LogoUrl' => VENDOR_LOGOURL,\n ),\n ),\n ),\n );\n\n // prepare with customer informations\n $data['Report'][0]['Customer'][0] = $this->dataObject->getCustomerInfo();\n\n $j=0; // ReportItem\n $y=0; // ItemPerfomance\n $previousIdentifier = '';\n $count = 0;\n\n foreach ($this->dataObject->getData() as $row) {\n if (!($row['identifier'] == $previousIdentifier)) {\n // next Reportitem\n $j++;\n // reset ItemPerfomance\n $y=0;\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPlatform'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemDataType'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemName'] = $row['identifier'];\n }\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['Begin'] = date('Y-m-d', strtotime($row['date']));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['End'] = date('Y-m-d', strtotime('last day of this month', strtotime($row['date'])));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Category'] = 'TODO'; //TODO\n\n // check for different counts\n $x=0; // Instance\n\n // TODO: implement/translate format for different metric types\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['MetricType'] = 'ft_total';\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['Count'] = $row['counter'];\n\n $y++; //next ItemPerformance\n $previousIdentifier = $row['identifier'];\n $count++;\n }\n\n $counterxmlbuild = new CounterXMLBuilder();\n $counterxmlbuild->setIndentString(\"\\t\");\n $counterxmlbuild->start();\n $counterxmlbuild->add_reports($data);\n $counterxmlbuild->done();\n return $this->formattedData = $counterxmlbuild->outputMemory();\n }", "public function tms_report_count() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['pStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayTextCount = \"Total Paid Trainees : \";\n $export_url = '?pStatus=1';\n } else if ($_POST['pStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayTextCount = \"Total Unpaid Trainees : \";\n $export_url = '?payStatus=2';\n }\n \n $year = $_POST['yVal'];\n $month = $_POST['mVal'];\n \n $training_score1 = $_POST['tStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['pStatus'] == '1') {\n $data_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $paidVal1 = $this->calculate_paid($data_res);\n $count=count($data_res);\n $displayTextCount = 'Total Amount Received : ';\n } else if ($_POST['pStatus'] == '2') {\n $data_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $amount_due = $data_res[0]->total_amount_due;\n $paidVal1 = $amount_due;\n $count=$data_res[0]->count;\n $displayTextCount = 'Total Amount Pending : ';\n } else if ($_POST['pStatus'] == '3'){\n $payment_status2 = \"PAID','PARTPAID\";\n $payment_status1 = \"NOTPAID','PARTPAID\";\n $data1_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status1, $year, $month, $training_score);\n $data2_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status2, $year, $month, $training_score);\n $amount_due = $data1_res[0]->total_amount_due;\n $paid_amout = $this->calculate_paid($data2_res);\n $count = ($data1_res[0]->count)+count($data2_res);\n $displayTextCount = \"Total Paid + Unpaid Amount : \";\n \n $paidVal1 =$amount_due + $paid_amout;\n \n }\n \n }\n \n $data['text1'] = 'Total Trainee: '.$count;\n $data['amount1'] = $displayTextCount.$paidVal1;\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "public function booking_acknowledge_company_pdf($trainee_ids, $class_id, $company) \n {\n $tenant_id = $this->tenant_id;\n $trainee_allid = explode('-', $trainee_ids);\n $tr_count = 0;\n foreach ($trainee_allid as $row) {\n $trainee_id = $row;\n $trainee_name = $this->classtraineemodel->get_trainee_name('', '', $row, $tenant_id);\n $name = $trainee_name->first . ' ' . $trainee_name->last;\n $trainee_names = ($trainee_name->gender == 'MALE') ? 'Mr.' . $name : 'Ms.' . $name;\n $trainee .=$trainee_names . ', ';\n $tr_count++;\n }\n $trainee = rtrim($trainee, ', ');\n\n $company_details = $this->company->get_company_details($tenant_id, $company);\n $classes = $this->class->get_class_details($tenant_id, $class_id);\n $ClassLoc = $this->get_classroom_location($classes->classroom_location, $classes->classroom_venue_oth);\n $courses = $this->course->get_course_detailse($classes->course_id);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $courseLevel = rtrim($this->course->get_metadata_on_parameter_id($courses->certi_level), ', ');\n $data = ''; \n if ($tr_count > 0) {\n $contact_details = '';\n if($tenant_details->tenant_id =='T12')\n {\n if (!empty($tenant_details->contact_name))\n {\n $contact_details .=$tenant_details->contact_name . ' ';\n }\n }\n\nif (!empty($tenant_details->tenant_contact_num)) {\n $contact_details .='(Phone: ' . $tenant_details->tenant_contact_num . ', ';\n }\n if (!empty($tenant_details->tenant_email_id)) {\n $contact_details .='Email Id: ' . $tenant_details->tenant_email_id . ')';\n }\n $contact_details = rtrim($contact_details, ', ');\n if ($company[0] == 'T') {\n $company_details->company_name = $tenant_details->tenant_name;\n }\n \n /* skm code start for remark. reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($classes->class_start_datetime);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($classes->course_id == 67 || $classes->course_id == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n if($tenant_details->tenant_id == 'T02')\n {\n $li2 = \"<li>In the event of unforeseen circumstances (example: SkillsFuture Credit website is down for maintenance, etc), Cash payment has to be collected from Candidate and Xprienz Pte Ltd will assist in making the appeal for them.</li>\";\n } else {\n $li2 = '';\n } \n ///// added by shubhranshu for wablab points\n if($tenant_details->tenant_id == 'T20' || $tenant_details->tenant_id == 'T17'){\n $li_first = \"<li>Your NRIC, work permit or will be photocopied on the class date</li>\";\n }else{\n $li_first =\"<li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\";\n }\n $message3 = '\n <ol style=\"font-size:13px;color:#4f4b4b\">\n '.$li_first.'\n \n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n '.$li2.'\n </ol>';\n \n /* skm end */\n \n $data = '<br><br>\n <table style=\"font-size:15px\">\n <tr>\n <td>'.$tr_count . ' Seats for your company ' . $company_details->company_name . ' has been booked. Booking details for your employees: \n ' . $trainee . ' for \\'Course: <b>' . $courses->crse_name . '</b>, Class: <b>' . $classes->class_name . '</b>, Certificate Code: ' . $courseLevel . '\\'<br><br>\n <strong>Class start date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_start_datetime)) . '\n <br>\n <br>\n <strong>Class end date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_end_datetime)) . '\n <br>\n <br>\n \n <strong>Location: </strong>\n ' . $ClassLoc . '<br><br>\n <strong>Contact Details: </strong>\n ' . $contact_details. '<br><br>\n <strong>Remark: </strong>\n ' . $message3.'</td>\n </tr>\n </table>';\n }\n $booking_details = $this->classtraineemodel->get_paydue_invoice($trainee_id, $class_id);\n if ($booking_details) {\n $booking_no = date('Y', strtotime($booking_details->inv_date)) . ' ' . $booking_details->invoice_id;\n $booking_date = date('d/m/Y', strtotime($booking_details->inv_date));\n } else {\n $booking_no = date('Y') . ' ' . $trainee_id;\n $booking_date = date('d/m/Y');\n }\n $this->load->helper('pdf_reports_helper');\n generate_booking_acknowledge_pdf($data, $tenant_details, $booking_no, $booking_date);\n }", "public function run()\n {\n $data = [\n\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Course Name',\n 'identifier' => 'course_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Grade',\n 'identifier' => 'grade',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Academic Year',\n 'identifier' => 'academic_year',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Absences',\n 'identifier' => 'absences',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Tardies',\n 'identifier' => 'tardies',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'First Name',\n 'identifier' => 'first_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Last Name',\n 'identifier' => 'last_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Student Image',\n 'identifier' => 'student_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Student Id',\n 'identifier' => 'student_id',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Date of Birth',\n 'identifier' => 'dob',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Home Teacher',\n 'identifier' => 'home_teacher',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Student Reflection',\n 'identifier' => 'student_reflection',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Teacher Reflection',\n 'identifier' => 'teacher_reflection',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Services',\n 'identifier' => 'services',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Strand Template',\n 'identifier' => 'strand_template = 1',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Standard Template',\n 'identifier' => 'standard_template = 2',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Impact Template',\n 'identifier' => 'impact_template = 3',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Teacher Name',\n 'identifier' => 'teacher_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Teacher Image',\n 'identifier' => 'teacher_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Course Comment',\n 'identifier' => 'course_comment',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Course Scale Name',\n 'identifier' => 'course_scale_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 1,\n 'name' =>'Course Scale Value Image',\n 'identifier' => 'course_scale_value_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 2,\n 'name' =>'Strand Name',\n 'identifier' => 'strand_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 2,\n 'name' =>'Strand Scale Name',\n 'identifier' => 'strand_scale_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 2,\n 'name' =>'Strand Scale Value Image',\n 'identifier' => 'strand_scale_value_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 2,\n 'name' =>'Strand Comment',\n 'identifier' => 'strand_comment',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 3,\n 'name' =>'Standards Name',\n 'identifier' => 'standard_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 3,\n 'name' =>'Standard Scale Name',\n 'identifier' => 'standard_scale_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 3,\n 'name' =>'Standard Scale Value Image',\n 'identifier' => 'standard_scale_value_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 3,\n 'name' =>'Standard Comment',\n 'identifier' => 'standard_comment',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 4,\n 'name' =>'Impact Name',\n 'identifier' => 'impact_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 4,\n 'name' =>'Impact Scale Name',\n 'identifier' => 'impact_scale_name',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 4,\n 'name' =>'Impact Scale Value Image',\n 'identifier' => 'impact_scale_value_image',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n [ \n 'report_template_type_id' => 4,\n 'name' =>'Impact Comment',\n 'identifier' => 'impact_comment',\n 'created' => date('Y-m-d H:i:s'),\n 'modified' => date('Y-m-d H:i:s')\n ],\n ];\n\n $table = $this->table('report_template_variables');\n $table->insert($data)->save();\n }", "public function invoice_audit_trail_export_PDF() {\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $query = $this->reportsModel->get_invoice_audit_trail($tenant_id, NULL, NULL, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $this->load->helper('pdf_reports_helper');\n return invoice_audit_trail_report_PDF($query, $tenant_details);\n }", "public function generateCode()\n {\n $date = Carbon::now()->format('m-y');\n $count = (new self)->onCurrentMonth()->count() + 1;\n\n return Code::make([\n $date, \n $count,\n ]);\n }", "public function fecthExpencesWiseReport($data=array())\n\t{\n\t // echo \"<pre>\"; print_r($data); exit;\n// \t\t$query = $this->db->select('expences.name as name, expences.date as date, expences.cheque_no, expences.amount, payment_method.name as payment_method')\n// \t\t\t\t\t\t\t->from('expences')\n// \t\t\t\t\t\t\t->join('payment_method', 'payment_method.id = expences.payment_method')\n// \t\t\t\t\t\t\t->where('expences.id', $data['expences'])\n// \t\t\t\t\t\t\t->where('expences.date >=', $data['from'])\n// \t\t\t\t\t\t\t->where('expences.date <=', $data['to'])\n// \t\t\t\t\t\t\t->get();\n// \t\treturn $query->result();\n\t\t\n\t\t$query = $this->db->select('expences.name as name, expences.date as date, expences.cheque_no, expences.amount, payment_method.name as payment_method, expences_category.name as exp_catemane')\n\t\t\t\t\t\t\t->from('expences')\n\t\t\t\t\t\t\t->join('payment_method', 'payment_method.id = expences.payment_method')\n\t\t\t\t\t\t\t->join('expences_category', 'expences_category.id = expences.expcat_id')\n\t\t\t\t\t\t\t->where('expences.date >=', $data['from'])\n\t\t\t\t\t\t\t->where('expences.date <=', $data['to'])\n\t\t\t\t\t\t\t->where('expences.id', $data['expences'])\n\t\t\t\t\t\t\t->get();\n\t\treturn $query->result();\n\t}", "public function reportMonthlyAttendentView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $month = trim($request->month);\n // get student\n $result = DB::table('student')->where('year',$year)->where('shift_id',$shift)->where('dept_id', $dept )->where('semister_id',$semister)->where('section_id',$section)->orderBy('roll','asc')->get();\n // get holiday\n $from = $year.'-'.$month.'-01';\n $to = $year.'-'.$month.'-31';\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n $month_total_day =cal_days_in_month(CAL_GREGORIAN,$month,$year);\n \n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n\n return view('report.reportMonthlyAttendentView')->with('result',$result)->with('count_holiday',$count_holiday)->with('month_total_day',$month_total_day)->with('from',$from)->with('to',$to)->with('month',$month)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('section',$section)->with('semister',$semister)->with('dept',$dept)->with('shift',$shift); \n }", "function genrate_inspectorpaymenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name) {\n\t\n\t\t$columnwidtharrays = array(10,24,26,26,28,26,25,24);\n\t\t\n\t\t$heightdynamic = 12;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 7);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_assessment_no = \t$val['AssessmentVehicleMaster']['vc_assessment_no'];\n\t\t $vc_customer_name=\t\t$val['AssessmentVehicleMaster']['vc_customer_name'];\n\t\t $dt_assessment_date=\tdate('d-M-y', strtotime($val['AssessmentVehicleMaster']['dt_assessment_date']));\n\t\t $nu_total_payable_amount= number_format($val['AssessmentVehicleMaster']['nu_total_payable_amount'],2,'.',',');\n\t\t $vc_mdc_paid=\t\t\tnumber_format($val['AssessmentVehicleMaster']['vc_mdc_paid'],2,'.',',');\n\t\t\t$dt_received_date = \tdate('d M Y', strtotime($val['AssessmentVehicleMaster']['dt_received_date']));\n\t\t $vc_prtype_name = \t\t$val['PaymentStatus']['vc_prtype_name'];\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_assessment_date, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_total_payable_amount, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_mdc_paid, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_received_date, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "function timesheetYear(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0, $perioduser='')\n{\n\tglobal $bc, $langs;\n\tglobal $form, $projectstatic, $taskstatic;\n\tglobal $periodyear, $displaymode ;\n\n\tglobal $transfertarray;\n\n\t$lastprojectid=0;\n\t$totalcol = array();\n\t$totalline = 0;\n\t$var=true;\n\n\t$numlines=count($lines);\n\tfor ($i = 0 ; $i < $numlines ; $i++)\n\t{\n\t\tif ($parent == 0) $level = 0;\n\n\t\tif ($lines[$i]->fk_parent == $parent)\n\t\t{\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\t$totalprojet = array();\n\t\t\t\t$var = !$var;\n\t\t\t\t$lastprojectid=$lines[$i]->fk_project;\n\t\t\t}\n\n\t\t\tprint \"<tr \".$bc[$var].\">\\n\";\n\t\t\t// Ref\n\t\t\tprint '<td>';\n\t\t\t$taskstatic->fetch($lines[$i]->id);\n\t\t\t$taskstatic->label=$lines[$i]->label.\" (\".dol_print_date($lines[$i]->date_start,'day').\" - \".dol_print_date($lines[$i]->date_end,'day').')'\t;\n\t\t\t//print $taskstatic->getNomUrl(1);\n\t\t\tprint $taskstatic->getNomUrl(1,($showproject?'':'withproject'));\n\t\t\tprint '</td>';\n\n\t\t\t// Progress\n\t\t\tprint '<td align=\"right\">';\n\t\t\tprint $lines[$i]->progress.'% ';\n\t\t\tprint $taskstatic->getLibStatut(3);\n\t\t\t\n\t\t\tif ($taskstatic->fk_statut == 3)\n\t\t\t\t$transfertarray[] = $lines[$i]->id;\n\n\t\t\tprint '</td>';\n\n\t\t\t$totalline = 0;\n\t\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t\t{\n\t\t\t\t$szvalue = fetchSumMonthTimeSpent($taskstatic->id, $month, $periodyear, $perioduser, $displaymode);\n\t\t\t\t$totalline+=$szvalue;\n\t\t\t\t$totalprojet[$month]+=$szvalue;\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? convertSecondToTime($szvalue, 'allhourmin'):\"\").'</td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? price($szvalue):\"\").'</td>';\n\t\t\t\t// le nom du champs c'est à la fois le jour et l'id de la tache\n\t\t\t}\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\n\t\t\t$inc++;\n\t\t\t$level++;\n\t\t\tif ($lines[$i]->id) timesheetYear($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask, $perioduser);\n\t\t\t$level--;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$level--;\n\t\t}\n\t}\n\t\n\tif ($level == 0)\n\t{\n\t\tprint \"<tr class='liste_total'>\\n\";\n\t\tprint '<td colspan=2 align=right><b>Total</b></td>';\n\t\tprint '</td>';\n\t\t$totalline = 0;\n\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t{\n\t\t\t// on affiche le total du projet\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? convertSecondToTime($totalgen[$month], 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? price($totalgen[$month]):\"\").'</td>';\n\n\t\t\t$totalline+=$totalgen[$month];\n\t\t}\n\t\t// on affiche le total du projet\n\t\tif ($displaymode==0)\n\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\telse\n\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\t\tprint \"</tr>\\n\";\n\t}\n\treturn $inc;\n}", "function genrate_inspectorvehiclelogsheet_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(17,20,15,15,18,14,13,13,15,25,25);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+25);\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(165, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(165, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t}\n\t}\n\t\n\t\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($c == 4 || $c == 7 || $c == 8 || $c == 1|| $c == 9){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n\t\t\t\tif($c==$length ){\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $LogDate = !empty ($val['VehicleLogDetail']['dt_log_date']) ? \n date('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date'])):\n '';\n\t\t $vc_customer_name=\t\tucfirst($val['VehicleLogMaster']['vc_customer_name']);\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name=\t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t\t$StartOMet = \t\t\tisset($val['VehicleLogDetail']['nu_start_ometer']) ?$val['VehicleLogDetail']['nu_start_ometer']:'';\n\t\t $EndOMet = \t\t\t\tisset($val['VehicleLogDetail']['nu_end_ometer']) ?$val['VehicleLogDetail']['nu_end_ometer']:'';\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t//$kmtravldnamroad = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_other_road_km_traveled'];\n\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_km_traveled'];\n\t\t\t//$kmtrvldotheroad = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\n\t\t\t}\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t$ch_road_type= 'Other Road';\n\t\t\telse\n\t\t\t$ch_road_type= 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t\t\n//\t\t\t$vc_orign_name =\t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t//\t $vc_destination_name=\t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t//\t$KmTraV = \t\t\t\tisset($val['VehicleLogDetail']['nu_km_traveled']) ?$val['VehicleLogDetail']['nu_km_traveled']:'';\n\t\t // $KmTravOth = \t\t\tisset($val['VehicleLogDetail']['nu_other_road_km_traveled']) ?$val['VehicleLogDetail']['nu_other_road_km_traveled']:'';\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $LogDate, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($StartOMet), 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($EndOMet), 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$destination, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' =>number_format($KmTraV), 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\n\t\t}\n\t\n\t}", "public function get_sales_man_daily_work_report($date){\n\t\t $this->db->select('empployee.e_id,empployee.e_emplouee_id,assign_work.w_d_id,assign_work.date')->from('assign_work');\n\t\t $this->db->join('empployee', 'empployee.e_id = assign_work.work_employee_id ', 'left');\n\t\t $this->db->order_by('empployee.role_id',8);\n\t\t $this->db->where('empployee.status',1);\n\t\t $this->db->where('assign_work.date',$date);\n\t\t $return=$this->db->get()->result_array();\n\t\t $work_details=$data_work='';\n\t\t foreach($return as $list){\n\t\t\t $emp_work=$this->get_employee_work_dailay_details($list['date'],$list['e_id'],$list['w_d_id']);\n\t\t\t $data[$list['e_id']]=$list;\n\t\t\t $data[$list['e_id']]['work']=isset($emp_work)?$emp_work:'';\n\t\t\t \n\t\t }\n\t\t if(!empty($data)){\n\t\t\t return $data;\n\t\t }\n\t}", "public function gen_inv_pdf_basedon_forgeigner($invoice_id, $is_subsidy) {\n //$this->output->enable_profiler();\n $tenant_id = $this->tenant_id;\n \n if (empty($invoice_id)) {\n return show_404();\n }\n if (empty($is_subsidy)) {\n $res = $this->classtraineemodel->get_company_invoice_foreigner($invoice_id);\n $text = 'f';\n } \n \n $result = $res[0];\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($invoice_id);\n //\n $result->invoice_label = $text;\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n }\n //$result->discount_rate = round($result->discount_rate, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n $total_unitfees = 0;\n $total_discount = 0;\n $total_gst = 0;\n $total_subsidy = 0;\n $total_inv_amount = 0;\n// $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $company_received = $this->classtraineemodel->company_payment_recd_forgeiner($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n// $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $company_refunded = $this->classtraineemodel->company_payment_refund_foreigner($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach ($res as $k => $row) \n {\n $received = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $refunded = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($row->total_amount_due + $refunded) - $received) <= 0){\n $payment_label = 'PAID';\n }\n else{ \n if($refunded > 0){\n $payment_label = 'REFUNDED'; \n } else{ \n if($received == 0){\n $payment_label = 'NOT PAID';\n }else if($received > 0){\n $payment_label = 'PART PAID';\n }\n }\n }\n \n $res[$k]->payment_label = $payment_label;\n $total_unitfees +=$row->class_fees;\n $total_discount += ($row->class_fees * ($result->discount_rate / 100));\n $total_gst += $row->gst_amount;\n $total_subsidy += $row->subsidy_amount;\n $total_inv_amount += $row->total_amount_due;\n $result->total_inv_amount1 = $row->total_inv_amount;\n \n }\n $result->payble_amount=$total_inv_amount+$refunded_amt-$received_amt;\n $result->total_unit_fees = round($total_unitfees, 2);\n $result->total_inv_discnt = round($total_discount, 2);\n $result->total_inv_subsdy = round($total_subsidy, 2);\n $result->total_gst = round($total_gst, 2);\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n $result->total_inv_amount = round($total_inv_amount, 2);\n \n $result->payment_due_details = $res;\n\n $this->load->helper('pdf_reports_helper');\n generate_company_pdf_invoice($result);\n }", "public function reportPeriodicStudentPresentList()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportPeriodicStudentPresentList')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function generate_date_attendance(Request $request)\n {\n \t$unit_id=$request->unit_id;\n \t$a_date=date('Y-m-d', strtotime(str_replace('-', '/', $request->attendance_date)));\n \t$attendance=DB::table('tbl_attendance')\n \t\t\t->join('tbl_employee','tbl_attendance.employee_id','=','tbl_employee.employee_id')\n \t\t\t->join('tbl_unit','tbl_attendance.unit_id','=','tbl_unit.unit_id')\n ->join('tbl_designation','tbl_employee.designation_id','=','tbl_designation.designation_id')\n \t\t\t->where('attendance_date',$a_date)\n \t\t\t->where('tbl_attendance.unit_id',$unit_id)\n \t\t\t->get();\n \t\t/*dd($a_date);*/\n \treturn view('manager.show_update_attendance_form', compact('attendance','a_date'));\n }", "function attendance_construct_sessions_data_for_add($formdata, mod_attendance_structure $att) {\n global $CFG;\n\n $sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;\n $sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;\n $sessiondate = $formdata->sessiondate + $sesstarttime;\n $duration = $sesendtime - $sesstarttime;\n if (empty(get_config('attendance', 'enablewarnings'))) {\n $absenteereport = get_config('attendance', 'absenteereport_default');\n } else {\n $absenteereport = empty($formdata->absenteereport) ? 0 : 1;\n }\n\n $now = time();\n\n if (empty(get_config('attendance', 'studentscanmark'))) {\n $formdata->studentscanmark = 0;\n }\n\n if (empty(get_config('attendance', 'allowupdatestatus'))) {\n $formdata->allowupdatestatus = 0;\n }\n\n $calendarevent = 0;\n if (isset($formdata->calendarevent)) { // Calendar event should be created.\n $calendarevent = 1;\n }\n\n $sessions = array();\n if (isset($formdata->addmultiply)) {\n $startdate = $sessiondate;\n $enddate = $formdata->sessionenddate + DAYSECS; // Because enddate in 0:0am.\n\n if ($enddate < $startdate) {\n return null;\n }\n\n // Getting first day of week.\n $sdate = $startdate;\n $dinfo = usergetdate($sdate);\n if ($CFG->calendar_startwday === '0') { // Week start from sunday.\n $startweek = $startdate - $dinfo['wday'] * DAYSECS; // Call new variable.\n } else {\n $wday = $dinfo['wday'] === 0 ? 7 : $dinfo['wday'];\n $startweek = $startdate - ($wday - 1) * DAYSECS;\n }\n\n $wdaydesc = array(0 => 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');\n\n while ($sdate < $enddate) {\n if ($sdate < strtotime('+1 week', $startweek)) {\n $dinfo = usergetdate($sdate);\n if (isset($formdata->sdays) && array_key_exists($wdaydesc[$dinfo['wday']], $formdata->sdays)) {\n $sess = new stdClass();\n $sess->sessdate = make_timestamp($dinfo['year'], $dinfo['mon'], $dinfo['mday'],\n $formdata->sestime['starthour'], $formdata->sestime['startminute']);\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->absenteereport = $absenteereport;\n $sess->studentpassword = '';\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n $sess->automark = !empty($formdata->automark) ? $formdata->automark : 0;\n $sess->automarkcmid = !empty($formdata->automarkcmid) ? $formdata->automarkcmid : 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark)) { // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (isset($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (isset($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n } else {\n $sess->subnet = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n $sess->preventsharedip = 0;\n $sess->preventsharediptime = '';\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n $sdate = strtotime(\"+1 day\", $sdate); // Set start to tomorrow.\n } else {\n $startweek = strtotime(\"+\".$formdata->period.' weeks', $startweek);\n $sdate = $startweek;\n }\n }\n } else {\n $sess = new stdClass();\n $sess->sessdate = $sessiondate;\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->studentscanmark = 0;\n $sess->allowupdatestatus = 0;\n $sess->autoassignstatus = 0;\n $sess->subnet = '';\n $sess->studentpassword = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->automarkcmid)) {\n $sess->automarkcmid = $formdata->automarkcmid;\n } else {\n $sess->automarkcmid = 0;\n }\n\n $sess->absenteereport = $absenteereport;\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) {\n // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (!empty($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus) && !empty($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n return $sessions;\n}", "function export_report()\n {\n // load csv generator library\n $this->load->library('csvgenerator');\n \n // get current session data \n $session_data = $this->session->userdata('logged_in');\n\n // get filter criteria from post input\n $data = array(\n 'risk_register' => $this->input->post('risk_register'),\n 'user_id' => $this->input->post('general_user'),\n 'project_id' => $session_data['report_project_id']\n );\n\n if ($session_data['role_id'] == 8)\n {\n // get assigned risk register and its ID\n $register_row = $this->project_model->getAssignedRiskRegisterName($data['user_id']);\n $assigned_register_id = $register_row->subproject_id;\n $this->csvgenerator->fetch_data( $user_id, $main_category, $risk_level, $risk_register, $assigned_register_id );\n }\n else\n {\n if($this->csvgenerator->fetch_response_data($data))\n {\n redirect('dashboard/report_response/generate'); \n }\n else\n {\n // error\n $this->session->set_flashdata('negative_msg','Sorry. No report or data for the selected data filter!');\n redirect('dashboard/reports/response_project');\n }\n } \n }", "public function dtincomegroupreport()\n {\n $search_type = $this->input->post('search_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $head = $this->input->post('head');\n\n if (isset($search_type) && $search_type != '') {\n\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $_POST['search_type'];\n\n } else {\n\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n\n }\n $data['head_id'] = $head_id = \"\";\n if (isset($_POST['head']) && $_POST['head'] != '') {\n $data['head_id'] = $head_id = $_POST['head'];\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n $incomeList = $this->income_model->searchincomegroup($start_date, $end_date, $head_id);\n $m = json_decode($incomeList);\n $currency_symbol = $this->customlib->getSchoolCurrencyFormat();\n $dt_data = array();\n $grand_total = 0;\n if (!empty($m->data)) {\n $grd_total = 0;\n foreach ($m->data as $key => $value) {\n\n $incomedata = explode(',', $value->income);\n $income_id = \"\";\n $income_name = \"\";\n $income_date = \"\";\n $invoice_no = \"\";\n $income_amount = \"\";\n $total_amount = 0;\n foreach ($incomedata as $incomevalue) {\n $incomeexpload = explode('@', $incomevalue);\n $income_id .= $incomeexpload[0];\n $income_id .= \"<br>\";\n $income_name .= $incomeexpload[1];\n $income_name .= \"<br>\";\n $income_date .= date($this->customlib->getSchoolDateFormat(), strtotime($incomeexpload[3]));\n $income_date .= \"<br>\";\n $invoice_no .= $incomeexpload[2];\n $invoice_no .= \"<br>\";\n $income_amount .= $incomeexpload[4];\n $income_amount .= \"<br>\";\n }\n $total_amount = \"<b>\" . $value->total_amount . \"</b>\";\n $grd_total += $value->total_amount;\n $row = array();\n $row[] = $value->income_category;\n $row[] = $income_id;\n $row[] = $income_name;\n $row[] = $income_date;\n $row[] = $invoice_no;\n $row[] = $income_amount;\n $dt_data[] = $row;\n\n $amount_row = array();\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = $total_amount;\n $dt_data[] = $amount_row;\n }\n\n $grand_total = \"<b>\" . $currency_symbol . $grd_total . \"</b>\";\n $footer_row = array();\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"<b>\" . $this->lang->line('total') . \"</b>\";\n $footer_row[] = $grand_total;\n $dt_data[] = $footer_row;\n }\n\n $json_data = array(\n \"draw\" => intval($m->draw),\n \"recordsTotal\" => intval($m->recordsTotal),\n \"recordsFiltered\" => intval($m->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function getCurrentlyEnrolledSubjects($studentNumber) {\r\n \r\n $result = array();\r\n\r\n $queryresult = $this->db->query(\"SELECT c.`ID`, c.`STUDENT_NO`, CONCAT(sy.`SY_START`, ' - ', sy.`SY_END`) `SY`, \r\n ss.`SEMESTER`, \r\n CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ' ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SUBJECT, \r\n sub.`ID` subjectID, c.`SUBJECT_CODE`, sub.`DESCRIPTION` subjectTitle, sub.`UNITS` units\r\n FROM r_student_class_list c\r\n INNER JOIN r_sy sy\r\n ON sy.`ID` = c.`SY`\r\n INNER JOIN r_subject sub\r\n ON sub.`SUBJECT_CODE` = c.`SUBJECT_CODE`\r\n INNER JOIN r_semester ss\r\n ON ss.`ID` = c.`SEM`\r\n INNER JOIN r_schedule sc ON sc.`SECTION_CODE` = c.`SECTION_CODE` AND sc.`SY` = c.`SY` AND sc.`SEM` = c.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n WHERE c.`STUDENT_NO` = ? AND\r\n sy.`STATUS` = 'Active' AND ss.`STATUS` = 'Active'\", array($studentNumber));\r\n\r\n if($queryresult->num_rows() > 0) {\r\n foreach($queryresult->result() as $rows) {\r\n $result[] = array(\r\n 'SUBJECT_ID' => $rows->ID,\r\n 'SUBJECT' => $rows->SUBJECT,\r\n 'SUBJECT_CODE' => $rows->SUBJECT_CODE,\r\n 'subjectTitle' => $rows->subjectTitle,\r\n 'units' => $rows->units,\r\n 'SY' => $rows->SY,\r\n 'SEMESTER' => $rows->SEMESTER\r\n );\r\n }\r\n }\r\n\r\n return $result;\r\n }", "public function populateReport(){\n\t\t$companyID = $this->input->post('companyID');\n\t\t$courseID = $this->input->post('courseID');\n\t\t$daterange = $this->input->post('dateRange');\n\t\t\n\t\t$ranges = explode(\" - \", $daterange);\n\t\t#formatting the date ranges\n\t\t$from = date(\"Y-m-d H:i:s\",strtotime($ranges[0]));\n\t\t$to = date(\"Y-m-d H:i:s\",strtotime($ranges[1]));\n\t\t\n $report = $this->report->get_report($companyID, $courseID, $from, $to);\n $data = array();\n foreach ($report as $report_row) {\n $row = array();\n $row[] = '<td class=\"min-width nowrap\"></td>';\n $row[] = $report_row->name;\n $row[] = $report_row->mobile;\n $row[] = $report_row->email;\n $row[] = $report_row->questionSet;\n $row[] = $report_row->totalQuestions;\n $row[] = $report_row->duration;\n $row[] = $report_row->passingMarks;\n $row[] = $report_row->maxScore;\n $row[] = $report_row->timeTaken;\n $row[] = $report_row->result;\n $row[] = date(\"M d Y h:i A\",strtotime($report_row->timeStamp));\n array_push($data, $row);\n }\n \n $output = array(\n\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->report->count_all(),\n\t\t\t\"recordsFiltered\" => $this->report->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n echo json_encode($output);\n }", "function addPageSchedules4(&$pdf, $font, $template, $data_sub_plus, $data_sub_minus, $datas, $first=false)\n {\n $size_of_sub_plus = sizeof($data_sub_plus);\n $size_of_sub_minus = sizeof($data_sub_minus);\n\n $Term = ClassRegistry::init('Term');\n $target_day29 ='2017/04/01';\n\n //Term.account_beggining\n $term = $Term->getCurrentTerm();\n\n if(strtotime($target_day29) <= strtotime($term['Term']['account_end'])){\n\n if ($size_of_sub_plus <= 5 && $size_of_sub_minus <= 4) {\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n } else if($size_of_sub_plus > 5 && $size_of_sub_minus <= 4) {\n $data_sub_plus_1 = array_slice($data_sub_plus, 0, 5);\n $data_sub_plus_2 = array_slice($data_sub_plus, 5);\n $data_sub_plus_1 = array_slice($data_sub_plus, 0, 5);\n $data_sub_plus_2 = array_slice($data_sub_plus, 5);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_1);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_2);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n } else if($size_of_sub_plus <= 5 && $size_of_sub_minus > 4) {\n $data_sub_minus_1 = array_slice($data_sub_minus, 0, 4);\n $data_sub_minus_2 = array_slice($data_sub_minus, 4);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_1);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_2);\n } else {\n $data_sub_plus_1 = array_slice($data_sub_plus, 0, 5);\n $data_sub_plus_2 = array_slice($data_sub_plus, 5);\n $data_sub_minus_1 = array_slice($data_sub_minus, 0, 4);\n $data_sub_minus_2 = array_slice($data_sub_minus, 4);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_1);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_1);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->addPageSchedules4($pdf, $font, $template, $data_sub_plus_2, $data_sub_minus_2, $datas);\n }\n } else {\n if ($size_of_sub_plus <= 4 && $size_of_sub_minus <= 4) {\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n } else if($size_of_sub_plus > 4 && $size_of_sub_minus <= 4) {\n $data_sub_plus_1 = array_slice($data_sub_plus, 0, 4);\n $data_sub_plus_2 = array_slice($data_sub_plus, 4);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_1);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_2);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus);\n } else if($size_of_sub_plus <= 4 && $size_of_sub_minus > 4) {\n $data_sub_minus_1 = array_slice($data_sub_minus, 0, 4);\n $data_sub_minus_2 = array_slice($data_sub_minus, 4);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_1);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_2);\n } else {\n $data_sub_plus_1 = array_slice($data_sub_plus, 0, 4);\n $data_sub_plus_2 = array_slice($data_sub_plus, 4);\n $data_sub_minus_1 = array_slice($data_sub_minus, 0, 4);\n $data_sub_minus_2 = array_slice($data_sub_minus, 4);\n if (empty($first)) {\n $this->putDataAddPageSchedules4s($pdf, $font, $datas);\n }\n $this->putDataSubPlus4s($pdf, $font, $data_sub_plus_1);\n $this->putDataSubMinus4s($pdf, $font, $data_sub_minus_1);\n $pdf->AddPage();\n $pdf->useTemplate($template, null, null, null, null, true);\n $this->addPageSchedules4($pdf, $font, $template, $data_sub_plus_2, $data_sub_minus_2, $datas);\n }\n }\n }", "function generate_rep($empList, $from, $to, $field) {\n foreach ($empList as $val) {\n $Arr[$val]['split'] = $this->generate_report_modelwise($val, $field, $from, $to);\n }\n $select = array(\n 'model_name'\n );\n $final = array();\n $this->db->distinct();\n $this->db->select($select);\n $this->db->order_by('model_name', 'ASC');\n $modelList = $this->db->get('inventory_table')->result_array();\n\n foreach ($modelList as $val) {\n $model[$val['model_name']]['target'] = 0;\n $model[$val['model_name']]['achieved'] = 0;\n }\n foreach ($Arr as $k => $v) {\n $final[$k] = array_merge($model, $Arr[$k]['split']);\n }\n foreach ($empList as $val) {\n $Arr[$val]['Total'] = $this->generate_rep_each_emp($val, $from, $to, $field);\n foreach ($Arr[$val]['Total'] as $key => $value) {\n $final[$val]['Total'] = $value;\n }\n }\n foreach ($empList as $emp) {\n $this->db->select('employe_table_employe_name');\n $inter = $this->db->get_where(\"employe_table\", array('employe_table_employe_id' => $emp))->result_array();\n $empName[$emp] = $inter[0];\n }\n\n foreach ($empName as $key => $pair) {\n $final[$empName[$key]['employe_table_employe_name']] = $final[$key];\n unset($final[$key]);\n }\n $this->db->order_by('model_name', 'ASC');\n\n foreach ($modelList as $k => $m)\n foreach ($m as $key => $value) { {\n $final['Dealership'][$value]['achieved'] = 0;\n $final['Dealership'][$value]['target'] = 'Not Applicable ';\n }\n }\n\n $final['Dealership']['Total']['target'] = 'Not Applicable ';\n $final['Dealership']['Total']['achieved'] = $this->db->from(\"rtl_daily_rep\")->where('Inv_Dt >=', $from)->where('Inv_Dt <=', $to)\n ->count_all_results();\n foreach ($modelList as $k => $m) {\n foreach ($m as $key => $value) {\n $final['Dealership'][$value]['achieved'] = $this->db->from(\"rtl_daily_rep\")->where('Inv_Dt >=', $from)->where('Inv_Dt <=', $to)\n ->where(array('Model' => $value))\n ->count_all_results();\n }\n }\n\n\n\n return $final;\n }", "public function report_sales_pdf() {\n $tenant_id = $this->tenant_id;\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n\n $sales_exec = $this->input->get('sales_exec');\n $non_sales_exec = $this->input->get('non_sales_exec');\n if (!empty($sales_exec)) {\n $sales_exec = $sales_exec;\n } else if (!empty($non_sales_exec)) {\n $sales_exec = $non_sales_exec;\n }\n\n\n\n $sales_comm_result = $this->reportsModel->get_sales_comm('pdf', $tenant_id, $records_per_page, $offset, $field, $order_by, $sales_exec);\n $comm_due_periods = $this->reportsModel->get_comm_due_period($tenant_id, $sales_exec);\n $year_arr = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',\n 5 => 'May', 6 =>\n 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep',\n 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');\n $periods = array();\n foreach ($comm_due_periods as $val) {\n $periods[$val->sales_exec_id] .= $year_arr[$val->comm_period_mth] . ' ' . $val->comm_period_yr . \", \";\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return sales_reports_pdf($sales_comm_result, $periods, $tenant_details, $executive);\n }", "function genrate_inspectorvehiclehistorypdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t \n\t\t$columnwidtharrays = array(10,30,26,26,23,18,20,20,16);\n\t\t\n\t\t$heightdynamic =8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164 ,8, '',0,'','L',true);\t\t\t\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name =\t\tucfirst($val['CustomerProfile']['vc_customer_name']);\n\t\t $vc_vehicle_lic_no =\t\t$val['VehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no =\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleDetail']['dt_created_date']));\n\t\t $vc_prtype_name =\t\t$val['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_v_rating =\t\tnumber_format($val['VehicleDetail']['vc_v_rating']);\n\t\t $vc_dt_rating =\t\tnumber_format($val['VehicleDetail']['vc_dt_rating']);\n\t\t $vc_rate =\t\tnumber_format($val['VehicleDetail']['vc_rate'],2,'.',',');\n\t\t\t\n\t\t\t$font_size=7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_v_rating, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_dt_rating, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$vc_rate, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "function profile_download($report_for, $organizer_id, $event_id) {\n switch ($report_for) {\n case 'All':\n $get_data = $this->model->get_download_analytics('All', $event_id);\n $excel_column = \" Type \\t From Attendee Type \\t From Name \\t Designation \\t Company Name \\t To Attendee Type \\t To Name / Session Name \\t Designation \\t Company Name\\t Created \\n\";\n if ($get_data) {\n foreach ($get_data as $att) {\n $download_type = $this->get_download_type($att['type']);\n $sender_type = $this->get_user_type($att['sender_type']);\n $receiver_type = $this->get_user_type($att['receiver_type']);\n if ($download_type == 'Event Map') {\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . '-' . \"\\t\" . '-' . \"\\t\" .\n '-' . \"\\t\" . '-' . \"\\t\" . $att['created_date'] . \"\\n\";\n } else {\n if ($download_type == 'Session Profile') {\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att ['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . 'Session' . \"\\t\" . $att['session_name'] . \"\\t\" .\n '-' . \"\\t\" . '-' . \"\\t\" . $att['created_date'] . \"\\n\";\n } else {\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . $receiver_type . \"\\t\" . $att['receiver_name'] . \"\\t\" .\n $att['receiver_designation'] . \"\\t\" . $att['receiver_company'] . \"\\t\" . $att['created_date'] . \"\\n\";\n }\n }\n }\n }\n $this->download_excel('All_profile_download_report', $excel_column);\n\n break;\n case 'download_evt_map':\n $get_data = $this->model->get_download_analytics('download_evt_map', $event_id);\n $excel_column = \" Type \\t From Attendee Type \\t From Name \\t Designation \\t Company Name \\t Created \\n\";\n if ($get_data) {\n foreach ($get_data as $att) {\n $download_type = $this->get_download_type($att['type']);\n $sender_type = $this->get_user_type($att['sender_type']);\n $receiver_type = $this->get_user_type($att['receiver_type']);\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att ['sender_designation'] . \"\\t\" .\n $att ['sender_company'] . \"\\t\" . $att['created_date'] . \"\\n\";\n }\n }\n $this->download_excel('profile_download_event_map_report', $excel_column);\n break;\n case 'download_ses_map':\n $get_data = $this->model->get_download_analytics('download_ses_map', $event_id);\n $excel_column = \" Type \\t From Attendee Type \\t From Name \\t Designation \\t Company Name \\t Session Name \\t Created \\n\";\n if ($get_data) {\n foreach ($get_data as $att) {\n $download_type = $this->get_download_type($att['type']);\n $sender_type = $this->get_user_type($att['sender_type']);\n $receiver_type = $this->get_user_type($att['receiver_type']);\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att ['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . $att['session_name'] . \"\\t\" . $att['created_date'] . \"\\n\";\n }\n }\n $this->download_excel('profile_download_session_report', $excel_column);\n break;\n case 'download_exh_pro':\n $get_data = $this->model->get_download_analytics('download_exh_pro', $event_id);\n $excel_column = \" Type \\t From Attendee Type \\t From Name \\t Designation \\t Company Name \\t To Attendee Type \\t To Name / Session Name \\t Designation \\t Company Name\\t Created \\n\";\n if ($get_data) {\n foreach ($get_data as $att) {\n $download_type = $this->get_download_type($att['type']);\n $sender_type = $this->get_user_type($att['sender_type']);\n $receiver_type = $this->get_user_type($att['receiver_type']);\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att ['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . 'Exhibitor' . \"\\t\" . $att['receiver_name'] . \"\\t\" .\n $att ['receiver_designation'] . \"\\t\" . $att['receiver_company'] . \"\\t\" . $att['created_date'] . \"\\n\";\n }\n }\n $this->download_excel('profile_download_exhibitor_report', $excel_column);\n break;\n case 'download_exe_pro':\n //*************************************************** Speaker *******************************\n $get_data = $this->model->get_download_analytics('download_exe_pro', $event_id);\n $excel_column = \" Type \\t From Attendee Type \\t From Name \\t Designation \\t Company Name \\t To Attendee Type \\t To Name / Session Name \\t Designation \\t Company Name\\t Created \\n\";\n if ($get_data) {\n foreach ($get_data as $att) {\n $download_type = $this->get_download_type($att['type']);\n $sender_type = $this->get_user_type($att['sender_type']);\n $receiver_type = $this->get_user_type($att['receiver_type']);\n $excel_column .= $download_type . \"\\t\" . $sender_type . \"\\t\" . $att['sender_name'] . \"\\t\" . $att ['sender_designation'] . \"\\t\" .\n $att['sender_company'] . \"\\t\" . 'Speaker' . \"\\t\" . $att['receiver_name'] . \"\\t\" .\n $att ['receiver_designation'] . \"\\t\" . $att['receiver_company'] . \"\\t\" . $att['created_date'] . \"\\n\";\n }\n }\n $this->download_excel('profile_download_speaker_report', $excel_column);\n\n break;\n }\n }", "public function actionOutputStatistical()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->statistictalSearch(Yii::$app->request->queryParams);\n\t\t \n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n $arr = []; \n foreach($result as $r) {\n $arr[] = $r;\n }\n\t\t$header = [\n 'year' => '年', \n 'month' => '月', \n 'personnel_id' => '员工ID', \n 'username' => '员工姓名', \n 'overtime' => '当月加班时长(计算)', \n 'overtime_valid' => '当月加班时长(有效)', \n ];\n\t\t$columns = array_keys($header);\n \\moonland\\phpexcel\\Excel::export([\n 'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤统计' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤统计' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤统计' => $header, \n\t\t\t],\n ]);\n }", "public function getdistringsubject()\n\t{\n\t\t$this->db->distinct();\n\t\t$this->db->select('gen_type');\n\t\t$this->db->order_by('gen_type', 'asc');\n\t\t$query=$this->db->get('admission_erp');\n\t\treturn $query->result();\n\t}", "public function create_coursework_scenario(){\n \n $da = function($c,$r){\n return array('cols'=>$c, 'rows'=>$r);\n };\n \n $tables = array(\n 'ucourse' =>'enrol_ues_courses',\n 'user' =>'user',\n 'ustu' =>'enrol_ues_students',\n 'usem'=>'enrol_ues_semesters',\n 'usect' =>'enrol_ues_sections',\n 'course' =>'course',\n 'ctx' =>'context',\n 'ra' =>'role_assignments',\n 'log' =>'log',\n 'g' =>'groups',\n 'gm' =>'groups_members',\n 'mgi' =>'grade_items',\n 'mgg' =>'grade_grades',\n 'mgc' =>'grade_categories',\n 'quiz' =>'quiz',\n 'qatt' =>'quiz_attempts' \n );\n \n \n//--------------------------------------------------------------------//\n//----------------------------- enrollment ITEMS ---------------------//\n//--------------------------------------------------------------------//\n\n foreach(array_keys($tables) as $t){\n ${\"{$t}_rows\"} = array();\n }\n\n \n \n \n $date = new DateTime('today');\n $now = $date->getTimestamp();\n $current_semester = array(\n 'id' =>5,\n 'year' =>strftime('%Y', $now),\n 'name' =>'Current',\n 'campus' =>'LSU',\n 'session_key' =>null,\n 'classes_start' =>$now-(86400*21),\n 'grades_due' =>$now+(86400*14)\n ); //end two weeks ahead\n \n $enr1 = array(\n 'cid' => '1234',\n 'idnumber' => 'COURSE001_SPRING',\n 'usectid' => '4321',\n 'semester' => $current_semester,\n 'ucourseid' => 1,\n 'ucourse_fname' => 'COURSE001',\n 'ucourse_dept' => 'COURSE',\n 'ucourse_num' => 4001,\n 'usect_num' => 003\n );\n\n $user1 = array(9541,'student-3','exampleuser','student-3@example.com',700188683,'student-3');\n\n $enrol = function($user, $enrollments) \n use(&$usem_rows,\n &$ucourse_rows,\n &$ustu_rows,\n &$usect_rows,\n &$course_rows,\n &$ctx_rows,\n &$ra_rows,\n &$user_rows)\n {\n $user_rows[] = $user;\n foreach($enrollments as $e){\n $usem_rows[] = array_values($e['semester']);\n \n $flag = false;\n foreach($ucourse_rows as $r){\n if($r[0] == $e['ucourseid']){\n $flag = true;\n }\n }\n if(!$flag) $ucourse_rows[] = array($e['ucourseid'],$e['ucourse_fname'],$e['ucourse_dept'],$e['ucourse_num']);\n \n $flag = false;\n foreach($ustu_rows as $r){\n if($r[0] == $user[0].$e['usectid']){\n $flag = true;\n }\n }\n if(!$flag) $ustu_rows[] = array($user[0].$e['usectid'],$user[0], $e['usectid'],3,'Enrolled');\n \n $flag = false;\n foreach($usect_rows as $r){\n if($r[0] == $e['usectid']){\n $flag = true;\n }\n }\n if(!$flag) $usect_rows[] = array($e['usectid'],$e['idnumber'],$e['cid'],$e['semester']['id'],$e['usect_num']);\n \n \n \n $flag = false;\n foreach($course_rows as $r){\n if($r[0] == $e['cid']){\n $flag = true;\n }\n }\n if(!$flag) $course_rows[] = array($e['cid'],$e['idnumber']);\n \n $flag = false;\n foreach($ctx_rows as $r){\n if($r[0] == $e[cid].$user[0]){\n $flag = true;\n }\n }\n if(!$flag) $ctx_rows[] = array($e['cid'].$user[0],50,$e['cid']);\n \n $ra_rows[] = array(count($ra_rows)+1,5,$user[0],'contextid',$e['cid'].$user[0]);\n \n }\n };\n \n $enrol($user1,array($enr1));\n\n \n //ues semesters\n $usem_rows = $ucourse_rows = $usect_rows = $ustu_rows = array();\n $user_rows = $course_rows = $ctx_rows = $groups = $groups_members = array();\n \n $usem_cols = array('id','year','name','campus','session_key','classes_start','grades_due');\n $usem_rows[] = array(5,2013,'Spring','LSU',null,1358143200,time()+(86400*14)); //end two weeks ahead\n \n //ues_courses\n $ucourse_cols = array('id', 'fullname', 'department', 'cou_number');\n $ucourse_rows[] = array(2656,'BIOL1335','BIOL', 1335);\n $ucourse_rows[] = array(3613,'AGRI4009','AGRI', 4009);\n \n //ues_students\n $ustu_cols = array('id', 'userid', 'sectionid', 'credit_hours', 'status');\n $ustu_rows[] = array(1415, 465, 7227, 5, 'enrolled');\n $ustu_rows[] = array(5442, 465, 743, 4, 'enrolled');\n $ustu_rows[] = array(4861, 9584, 743, 5, 'enrolled');\n $ustu_rows[] = array( 452, 8251, 743, 5, 'enrolled');\n $ustu_rows[] = array(1413, 9541, 743, 5, 'enrolled');\n \n //ues sections\n $usect_cols = array('id','idnumber','courseid','semesterid','sec_number');\n $usect_rows[] = array(7227,'BIOL13356099',2656, 5, '006');\n $usect_rows[] = array(743,'AGRI40095354',3613,5,'009');\n \n //mdl_courses\n $course_cols = array('id','idnumber');\n $course_rows[] = array(2326,'BIOL13356099');\n $course_rows[] = array(9850,'AGRI40095354');\n \n //mdl_context\n $ctx_cols = array('id','contextlevel','instanceid');\n $ctx_rows[] = array(2042,50,2326);\n $ctx_rows[] = array(333,50,9850);\n $ctx_rows[] = array(334,50,3613);\n \n //mdl_role_asignment\n $ra_cols = array('id','roleid','userid','contextid');\n $ra_rows[] = array(1,5,465,2042);\n $ra_rows[] = array(2,5,465,333);\n $ra_rows[] = array(3,5,8251,2042);\n $ra_rows[] = array(4,5,8251,333);\n $ra_rows[] = array(5,3,999,2042);\n $ra_rows[] = array(6,4,555,2042);\n $ra_rows[] = array(7,3,5566,2042);\n $ra_rows[] = array(8,5,9854,334);\n \n //mdl_user\n $user_cols = array('id','firstname','lastname','email', 'idnumber','username');\n $user_rows[] = array(999, 'teacher-0','exampleuser','teacher-0@example.com',666777555,'teacher-0');\n $user_rows[] = array(5566,'teacher-1','exampleuser','teacher-1@example.com',666777545,'teacher-1');\n $user_rows[] = array(555, 'coach-0', 'exampleuser', 'coach-0@example.com',123777555,'coach-0');\n $user_rows[] = array(9584,'student-2','exampleuser','student-2@example.com',253071515,'student-2');\n $user_rows[] = array(9541,'student-3','exampleuser','student-3@example.com',700188683,'student-3');\n \n //user id 465 is in 2 sections\n $user_rows[] = array(465, 'student-0','exampleuser','student-0@example.com',472725024,'student-0');\n\n //user id 8251 has only one section\n $user_rows[] = array(8251,'student-1','exampleuser','student-1@example.com',163360288,'student-1');\n\n //mdl_groups\n $g_cols = array('id','courseid','name');\n $g_rows[] = array(666,2326,'control-01');\n $g_rows[] = array(667,2326,'control-02');\n $g_rows[] = array(7,2326,'control-02');\n \n //mdl_groups_members\n $gm_cols = array('id','groupid','userid','timeadded');\n $gm_rows[] = array(45,666,465,1358143200);\n $gm_rows[] = array(46,666,8251,1358143200);\n $gm_rows[] = array(47,666,999,1358143200);\n $gm_rows[] = array(48,666,555,1358143200);\n $gm_rows[] = array(49,667,5566,1358143200);\n \n \n //mdl_log\n $log_cols = array('id','time','userid','course', 'action');\n //note that log_rows is populated by a dedicated function \n $log_rows = $this->generate_activity_sequence();\n \n //--------------------------------------------------------------------//\n //----------------------------- coursework ITEMS ---------------------//\n //--------------------------------------------------------------------//\n \n /**\n * grade tables: grade_item, grade_categories, grade_grades\n */\n $mgi_cols = array('id','courseid', 'itemtype', 'itemmodule', 'iteminstance', 'aggregationcoef', 'categoryid');\n $mgc_cols = array('id','fullname','courseid', 'timecreated','timemodified');\n $mgg_cols = array('finalgrade', 'userid', 'itemid');\n \n $mgi_rows = $mgc_rows = $mgg_rows = array();\n \n $mgi_rows[] = array(1,2326,'mod','quiz',1,1,9);\n $mgc_rows[] = array(432,'categ fullname',9, time()-rand(100,10000),time());\n $mgg_rows[] = array(95,465,1);\n \n \n /**\n * Tables required: quiz, quiz_attempts\n * Dependencies: grade item with `itemmodule = 'quiz'`\n */\n $quiz_rows = $qatt_rows = array();\n \n $quiz_cols = array('id','intro','name','timeclose','grade','course','questions');\n $quiz_rows[] = array(1,'intro-test-1','quiz-test-1',time()+rand(0,100000), 100, 2326,'question dfjkskjgf');\n $quiz_rows[] = array(2,'intro-test-2','quiz-test-2',time()+rand(0,100000), 10, 2326, 'question 1 gfshsf');\n\n $qatt_cols = array('id','quiz', 'timefinish', 'layout');\n $qatt_rows[] = array(84,1,time()-10, 'default layout (reqd field)');\n \n //build xml file\n $xdoc = new DOMDocument();\n $root = $xdoc->createElement('dataset');\n foreach($tables as $table_key => $table_name){\n $t = $xdoc->createElement('table');\n $t->setAttribute('name', $table_name);\n// mtrace($table_key);\n foreach(${$table_key.'_cols'} as $tc){\n $column = $xdoc->createElement('column', $tc);\n $t->appendChild($column);\n }\n foreach(${$table_key.'_rows'} as $tr=>$vals){\n// mtrace($table_key);\n $row = $xdoc->createElement('row');\n foreach($vals as $v){\n $value = $xdoc->createElement('value', $v);\n $row->appendChild($value);\n }\n $t->appendChild($row);\n }\n $root->appendChild($t);\n }\n $xdoc->appendChild($root);\n return $xdoc;\n }", "public function finalreportcreate() {\n $supervisaornames = DB::select(\"SELECT name,id \n\t\t FROM panelmembers\n\t\t WHERE id = any (SELECT supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* Get all group ids */\n $groupids = DB::select(\"SELECT groupID \n\t\t FROM research_groups\");\n\n /* Get all student actual id acording to the auto generated id */\n $studentid = DB::select(\"SELECT id,regId \n\t\t FROM students\n\t\t WHERE id = any (SELECT studentId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* filtering projects according to the groups */\n $students = DB::select(\"SELECT id,title,studentId,supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved' and groupID = any (SELECT groupID \n\t\t FROM research_groups)\");\n\n $los = DB::table('settings')->first();\n\n return view('supevaluation.finalreportevaluation', compact('students', 'supervisaornames', 'studentid', 'groupids', 'los'));\n }" ]
[ "0.77966917", "0.6952219", "0.6225241", "0.59348047", "0.5846901", "0.58378285", "0.5793984", "0.5739033", "0.57314277", "0.5726573", "0.57134396", "0.57125956", "0.57031906", "0.56990755", "0.5669414", "0.563711", "0.5636193", "0.56284374", "0.56207716", "0.55699575", "0.55605674", "0.55554706", "0.55425525", "0.5519224", "0.550124", "0.54917026", "0.5476998", "0.5474807", "0.546664", "0.54573965", "0.54520994", "0.54453206", "0.5440688", "0.5422574", "0.5407494", "0.53855795", "0.5368656", "0.5332244", "0.5329854", "0.5326656", "0.53214926", "0.5315664", "0.5309336", "0.5306264", "0.5297455", "0.5294414", "0.52728575", "0.5257381", "0.52440166", "0.5238002", "0.52369577", "0.5236191", "0.5228277", "0.52177674", "0.52127266", "0.5200895", "0.52006674", "0.51978236", "0.51902235", "0.51838565", "0.51831764", "0.51824075", "0.5171246", "0.51587427", "0.5148056", "0.5144116", "0.51332057", "0.5130593", "0.5121949", "0.5121931", "0.51203895", "0.5115132", "0.51051843", "0.5104685", "0.50927687", "0.50917876", "0.5079269", "0.50769544", "0.50672936", "0.506214", "0.50620526", "0.506102", "0.5059193", "0.5053505", "0.5052489", "0.505219", "0.5047334", "0.5043904", "0.5043012", "0.5042259", "0.5041396", "0.5040356", "0.5035429", "0.5034755", "0.50328207", "0.5032718", "0.503076", "0.5030204", "0.5020836", "0.5017159" ]
0.79717195
0
End Action controllers for generating attendance report Start Action controllers for generating remarks report generate_subject_code_remarks_report function. commit 10/12/2018
Конец действий контроллеров для генерации отчета о посещаемости Начало действий контроллеров для генерации отчета о замечаниях generate_subject_code_remarks_report функция. commit 10/12/2018
public function generate_subject_code_remarks_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty')); // get inputs $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $students = $this->admin_model->getStudentsBasicInfo($con,'a'); $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']); $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance) && !empty($att_record)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); }else{ $this->session->set_flashdata('danger', 'Invalid input.'); } redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }", "public function generate_voc_program_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar'));\n // get inputs\n $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program']));\n $students = $this->admin_model->getStudentsBasicInfo($condition,'a');\n $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']);\n $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n redirect('attendance_report');\n }\n $this->session->set_flashdata('danger', 'Invalid input.');\n redirect('attendance_report');\n \n }", "public function generate_acknowledgement() {\n \n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $usrid = $this->input->post('usr');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $usrid);\n\n $tanant = $this->courses_model->get_tenant_details();\n \n //sankar code starts here\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n //sankar code ends here\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $Url = base_url() . 'payments/print_ack';\n\n $date = date('M d Y');\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n \n /* skm code start for remark.\n reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($ack_data[class_start_datetime]);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($crsid == 67 || $crsid == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n $tenant_id = TENANT_ID;\n if($tenant_id == 'T12')\n { \n $name = $tanant->contact_name;\n }else{\n\n $name = $gender. $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name];\n }\n \n $message3 = '\n <ol>\n <li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\n <li>Your NRIC, work permit or will be photocopied on the class date</li>\n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n </ol>';\n /* skm end */\n \n echo '<form action=\"' . $Url . '\" method=\"post\"><p> \n <a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n\t\t\t <h2 class=\"panel_heading_style\">Booking Acknowledgment</h2>\t\t\t \n\t\t\n\t\t\t Your seat has been temporarily booked. Please pay the class fees on or before the class start date.\n\t\t\tTemporary booking for <b>' . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course:\"' . $ack_data[crse_name] . ',Class:' . $ack_data[class_name] . ',Certificate Code:' . $ack_data[cert_level] . ' </b>\".</i><br>\n\t\t\t </br><strong>Class start date:</strong> ' . $startdate . '<br>\n\t\t\t </br><strong>Location:</strong> ' . $ack_data[classroom_location] . '<br>\n\t\t\t</br><strong>Contact Details:</strong> ' . $name . ',(Phone: ' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n </br><strong>Remark:</strong> ' . $message3 . '<br>\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/>\n <input type=\"hidden\" value=\"' . $usrid . '\" name=\"userId\"/> \n <input type=\"hidden\" value=\"' . $ack_data . '\" name=\"ackdata\"/>\n <div style=\"clear:both;\"></div><br>\t\t\t \n\t\t\t <span style=\"float:right;\">\n\t\t\t<button class=\"btn btn-primary\" type=\"submit\">Print</button>\n\t\t\t </p></form> ';\n }", "function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }", "public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function download_in_pdf($seq_no)\n\t{\n\t\t$this->load->model('statement_header_model');\n\t\t// $this->load->library('m_pdf');\n\t\t$this->load->model('transactions_model');\n\t\t$statement = $this->statement_header_model->get_statement($seq_no);\n\t\t$start_date = $statement[0]->START_DATE;\n\t\t$end_date = $statement[0]->END_DATE;\n\t\t$internal_key = $statement[0]->INTERNAL_KEY;\n\t\t$data['statement'] = $statement[0];\n\n\t\t// return print_r($statement);\n\t\t$data['transactions'] = $this->transactions_model\n\t\t\t\t->get_trans_history($start_date,$end_date,$internal_key);\n\n\t\t$data['start_date'] = $this->formatDate($start_date);\n\t\t$data['end_date'] = $this->formatDate($end_date);\n\n\n\t\t $this->load->helper('dompdf');\n\t\t $html = $this->load->view('transactions/view_statement2', $data, true);\n \t return pdf_create($html, 'eStatement as of '.$start_date. ' to' .$end_date);\n\t}", "function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}", "public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}", "public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }", "public function generate()\n {\n $reportType = Input::get('report_type');\n $from = Input::get('from');\n $to = Input::get('to');\n $disciplineId = Input::get('discipline');\n $info = explode(',', Input::get('info'));\n $id = $info[1];\n $type = $info[0];\n $license = array_key_exists(2, $info) ? $info[2] : '0';\n\n $from = empty($from) ? null : date('Y-m-d', strtotime($from));\n $to = empty($to) ? null : date('Y-m-d', strtotime($to));\n \n if (! $reportType) {\n Flash::danger('Please select a <strong>Report Type</strong>.');\n return Redirect::route('reports.index')->withInput();\n }\n\n if (empty($from)) {\n Flash::danger('Please enter a <strong>From Date</strong> to generate report.');\n return Redirect::route('reports.index')->withInput();\n }\n\n // all route params\n $routeParams = [$disciplineId, $type, $id, $license, $from, $to];\n\n switch ($reportType) {\n case 'site_summary':\n return Redirect::route('reports.site_summary', $routeParams);\n break;\n\n case 'scheduled_exams':\n return Redirect::route('reports.scheduled_exams', $routeParams);\n break;\n\n case 'retake_summary':\n return Redirect::route('reports.retake_summary', $routeParams);\n break;\n\n case 'skills_detail':\n return Redirect::route('reports.skills_detail', $routeParams);\n break;\n\n case 'knowledge_detail':\n return Redirect::route('reports.knowledge_detail', $routeParams);\n break;\n\n case 'pass_fail':\n // if admin / agency / staff show a page to select facility and instructor\n /*if(Auth::user()->ability(['Admin', 'Staff', 'Agency'], []))\n {\n return Redirect::route('reports.select_facility', [$from, $to]);\n }*/\n\n // Otherwise just show the regular pass/fail report\n return Redirect::route('reports.pass_fail', $routeParams);\n break;\n\n default:\n Flash::warning('This report type is not yet supported.', 'Warning');\n return Redirect::route('reports.index');\n\n }\n }", "public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }", "public function mailReportAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page url array\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t$this->module_name, $this->action_name,\r\n \t\t\t'form_id', make_id($form_id),\r\n \t\t);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page number from url and set attribute\r\n \t\t */\r\n \t\t$page_no = $this->getUrlParam('page');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page number to 1 if page number is empty and assign to view\r\n \t\t */\r\n \t\tif (empty($page_no)){\r\n \t\t\t$page_no = 1;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($page_no))\r\n \t\t\t\tarray_push($url_array, 'page',$page_no);\r\n \t\t}\r\n \t\t$this->viewAssign('page_no', $page_no);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page limit from parameter\r\n \t\t */\r\n \t\t$limit = $this->getUrlParam('limit');\r\n \t\tif (is_numeric($limit))\r\n \t\t\t$this->setAttribute('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * if page limit is empty set page limit and assign to view\r\n \t\t */\t\r\n \t\tif (empty($limit)){\r\n \t\t\t$limit = ADMIN_DISP;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($limit))\r\n \t\t\t\tarray_push($url_array, 'limit', $limit);\r\n \t\t}\r\n \t\t$this->viewAssign('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * set paging offset\r\n \t\t */\r\n \t\t$offset = ($page_no-1) * $limit;\r\n \t\t\r\n \t\t/**\r\n \t\t * set number to dispaly list number on view\r\n \t\t */\r\n \t\t$this->viewAssign('number', (($page_no-1)*$limit));\r\n \t\t\r\n \t\t/**\r\n\t\t * get form mail list\r\n\t\t */\r\n \t\t$list = $this->db_model->getFormMailList($form_id, $limit, $offset);\r\n \t\t\r\n \t\t/**\r\n \t\t * page view list assign to view\r\n \t\t */\r\n \t\t$this->viewAssign('list', $list);\r\n \t\t \t\t\r\n \t\t/**\r\n \t\t * if show all in one page\r\n \t\t */\r\n\t\tif ($limit == 'all'){\r\n \t\t\t$limit = 0;\r\n \t\t\t$this->viewAssign(\"paging\",'<li><span>1</span></li>');\r\n \t\t}else {\r\n \t\t\t\r\n \t\t\t/**\r\n \t\t\t * get paging html, previous, next page info and assign to view\r\n \t\t \t */\r\n \t\t\t$page_class = new PageClass($total_rows, $page_no, $limit);\r\n \t\t\t$this->viewAssign('prev', $page_class->isPrev());\r\n\t\t\t$this->viewAssign('prev_pn', $page_no-1);\r\n\t\t\t$this->viewAssign('next', $page_class->isNext());\r\n\t\t\t$this->viewAssign('next_pn', $page_no+1);\r\n\t\t\t$link_url = $this->self_url.'/'.$this->action_name.'/form_id/'.make_id($form_id).'/limit/'.$limit;;\r\n\t\t\t$paging = $page_class->DisPage($link_url);\r\n\t\t\t$this->viewAssign(\"paging\",$paging);\r\n\t\t}\r\n \t\t\r\n\t\t\r\n \t\t$this->setDisplay('report');\r\n \t\t\r\n \t}", "public function reportMonthlyAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function generate_ack_receipt() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n\n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n if(!empty($sfc_amount['othr_mode_of_payment'])){ \n $other_mod_of_payment= \" & Other Mode Of Payment : ($ \".number_format($sfc_amount['other_amount_recd'],2,'.','').\")\";}\n else{\n $other_mod_of_payment=\"\";\n }\n if(($sfc_amount['sfc_claimed']>0))\n { \n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['sfc_claimed'],2,'.','').')'.''.$other_mod_of_payment;\n }else\n {\n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['amount_recd'],2,'.','').')'.''.$other_mod_of_payment;\n }\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n\n $tanant = $this->courses_model->get_tenant_details();\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $date = date('M d Y', strtotime($ack_data['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n $Url = base_url() . 'payments/print_receipt';\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p>\n \n <h2 class=\"panel_heading_style\">Payment Receipt</h2><br><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <table width=\"100%\"> \n <tbody>\n <tr>\n <td rowspan=\"4\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n <td colspan=\"2\">' . $tanant->tenant_name . '</td>\n <td class=\"td_heading\">Receipt No.:</td>\n <td>' . date('Y') . '' . $ack_data['invoice_id'] . '</td>\n </tr>\n <tr>\n <td colspan=\"2\">' . $tanant->tenant_address, $tanant->tenant_city . '</td>\n <td class=\"td_heading\">Receipt Date:</td>\n <td>' . $date . '</td>\n </tr>\n <tr>\n <td colspan=\"4\"></td>\n </tr>\n <tr>\n <td colspan=\"4\">' . $tanant->tenant_contact_num . '</td>\n </tr>\n \n </tbody>\n </table><br>\n \n <p><font style=\"font-size:14px; font-weight:bold;\">Received</font> with thanks SGD ' . $ack_data[total_inv_amount] . ' from <b>' \n . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course: \"' . $ack_data[crse_name] . ' ,Class: '\n . $ack_data[class_name] . ' Certificate Code:' . $ack_data[cert_level] . '</b>\". '.$mod.'</p>\n\n <table class=\"table table-bordered\">\n \n <tbody>\n <tr>\n <td class=\"td_heading\">Class Start Date:</td>\n <td>' . $startdate . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Location:</td>\n <td>' . $ack_data[classroom_location] . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Contact Details:</td>\n <td>' . $gender . $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name] . '(Phone:' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n </tbody>\n </table>\n \n <p>\n\n</br><p class=\"red\"><i>This is a computer generated receipt and does not require a seal or signature.</i></p>\n\n<div style=\"clear:both;\"></div><br>\n<span style=\"float:right;\">\n<button id=\"print_ack_receipt\" class=\"btn btn-primary\" type=\"submit\">Print</button>\n</p> </form> ';\n }", "public function reportMonthlyClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "function report() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n $resultData = $this->webservicemodel->getReportData($getData);\n if ($resultData) {\n $exportData = array();\n foreach ($resultData as $record) {\n $total_due = $record[\"costo_base\"] + $record[\"importo_tasse_volo\"] + $record[\"importo_aeroporto_aggiuntivo\"] + $record[\"supplementi\"];\n $balance = round(( $total_due - $record[\"pagamenti\"]), 2);\n\n $exportRecord = array(\n 'Accompagnatore' => $record['accompagnatore'],\n 'Collaboratore' => $record['collaboratore'],\n 'Prodotto' => $record['prodotto'],\n 'Codice Prodotto' => $record['codice_prodotto'],\n 'Passeggero' => $record['passeggero'],\n 'Tipologia Passeggero' => $record['tipologia_passeggero'],\n 'Total Due' => $total_due,\n 'Balance' => $balance\n );\n array_push($exportData, $exportRecord);\n }\n $this->load->library('export');\n $this->export->to_excel($exportData, 'webservicereport');\n } else\n redirect('webservice');\n }\n else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n// $data['report_data'] = $this->webservicemodel->getReportData($getData);\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n\n $data['tipologia_passeggero'] = $this->webservicemodel->getDistinctDataByField('tipologia_passeggero');\n $data['glf'] = $this->webservicemodel->getDistinctDataByField('glf');\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n $data['codice_prodotto'] = $this->webservicemodel->getDistinctDataByField('codice_prodotto');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }", "public function actionReceipt_due_report(){\n\t\t$connection = Yii::app()->db; \n // return $cmdrow->queryAll();\n\t\t$connection = Yii::app()->db; \n\t\t$temp_projects_array = Yii::app()->session['projects_array'];\n\t\t$num_of_projects_counter = count($temp_projects_array);\t\n\t\t$num_of_projects_counter2 = $num_of_projects_counter;\n\t\t$sql1 = \"select * from projects where\";\n\t\t$num_of_projects_counter--;\n\t\twhile($num_of_projects_counter>-1)\n\t\t{\n\t\t\t$sql2[$num_of_projects_counter] = \" id=\".Yii::app()->session['projects_array'][$num_of_projects_counter]['project_id'];\n\t\t\t$num_of_projects_counter--;\n\t\t}\n\t\t\n\t\t$sql_project = $sql1;\n\t\t$sql_project = $sql_project.implode(' or',$sql2);\n\t\t$result_projects = $connection->createCommand($sql_project)->query() or mysql_error();\n\t //////////////////////////////////FUNCTION 3 END///////////////////////////////////////////\n\t $this->render('receipt_due_report',array('projects'=>$result_projects));\n\t\t}", "public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }", "public function Mrrecord() {\n\n $concat_string = '';\n $ret_url = 'Mrrecord';\n if(!empty($this->input->get('page_id'))){\n $concat_string = '?page_id='.$this->input->get('page_id');\n }\n if(!empty($this->input->get('bpg'))){\n $ret_url = $this->input->get('bpg');\n }\n $title = 'Medical Records';\n if(!empty($this->input->get('ptl'))){\n $title = $this->input->get('ptl');\n }\n \n $breadcrumb_links[] = array('title' => $title,'link' => getUrl($ret_url).$concat_string);\n \n $data['breadcrumbs'] = $breadcrumb_links;\n $data['tail'] = 'Details';\n \n $data['page_title'] = \"Medical Records / Details\";\n \n $data['page_current'] = \"medical_record\";\n \n $inputData['patient_id'] = $this->input->get('pid');\n if(empty($inputData['patient_id'])){\n $inputData['patient_id'] = $this->input->post('pid');\n }\n \n $inputData['visit_id'] = $this->input->get('vid');\n $inputData['records'] = '';\n $inputData['offset'] = 0;\n\n $patientData = $this->medicalincidentHandler->getMedicalIncidentVisitDetails($inputData);\n \n if ($patientData['statusCode'] == 200) {\n //echo '<pre>'; print_r($patientData['response']['medicalIncidentVisitData']); echo '</pre>';\n $data['imgpath'] = $this->config->item('hff_media_path');\n $data['pdetails'] = $patientData['response']['patientData'][0];\n $data['userdata'] = $patientData['response']['userData'][0];\n// $data['userdata'] = (isset($patientData['response']['userData'][0]))?$patientData['response']['userData'][0]:null;\n $data['mivdata'] = $patientData['response']['medicalIncidentVisitData'];\n $data['feedback_ids'] = $patientData['response']['feedback_ids'];\n// $data['presc_options'] = $patientData['response']['presc_option_ids'];\n $data['visitid'] = $this->input->get('vid');\n $data['message'] = '';\n } else {\n $data['pdetails'] = '';\n $data['userdata'] = '';\n $data['mivdata'] = '';\n $data['message'] = STATUS_NO_DATA;\n// $data['message'] = $patientData['response']['message'];\n }\n// debugArray($data); exit;\n $data['content'] = \"doctor/doc_mr_number.php\";\n $template = 'templates/doctor_template';\n $this->load->view($template, $data);\n }", "public function makeReport()\n {\n }", "public function actionPdfRevisedratesreport()\n {\n $res = AllocationManager::getRevisedRatesData();\n $contents= $this->renderAjax('pdf-revised-rates-report',['res' => $res]);\n $pdf = Yii::$app->pdf;\n\n $pdf->generatePdf( \n $contents,\n null,\n 'Revised Rates Report for Evaluation of Questionnaire Reports',\n '|Page {PAGENO}|'.' '.\\Yii::$app->name,\n [\n 'orientation'=>\\kartik\\mpdf\\Pdf::ORIENT_LANDSCAPE\n ]);\n }", "public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function reportDatewiseClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function tms_report_count() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['pStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayTextCount = \"Total Paid Trainees : \";\n $export_url = '?pStatus=1';\n } else if ($_POST['pStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayTextCount = \"Total Unpaid Trainees : \";\n $export_url = '?payStatus=2';\n }\n \n $year = $_POST['yVal'];\n $month = $_POST['mVal'];\n \n $training_score1 = $_POST['tStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['pStatus'] == '1') {\n $data_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $paidVal1 = $this->calculate_paid($data_res);\n $count=count($data_res);\n $displayTextCount = 'Total Amount Received : ';\n } else if ($_POST['pStatus'] == '2') {\n $data_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $amount_due = $data_res[0]->total_amount_due;\n $paidVal1 = $amount_due;\n $count=$data_res[0]->count;\n $displayTextCount = 'Total Amount Pending : ';\n } else if ($_POST['pStatus'] == '3'){\n $payment_status2 = \"PAID','PARTPAID\";\n $payment_status1 = \"NOTPAID','PARTPAID\";\n $data1_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status1, $year, $month, $training_score);\n $data2_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status2, $year, $month, $training_score);\n $amount_due = $data1_res[0]->total_amount_due;\n $paid_amout = $this->calculate_paid($data2_res);\n $count = ($data1_res[0]->count)+count($data2_res);\n $displayTextCount = \"Total Paid + Unpaid Amount : \";\n \n $paidVal1 =$amount_due + $paid_amout;\n \n }\n \n }\n \n $data['text1'] = 'Total Trainee: '.$count;\n $data['amount1'] = $displayTextCount.$paidVal1;\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }", "function generarRecibo15_txt() {\n $ids = $_REQUEST['ids'];\n $id_pdeclaracion = $_REQUEST['id_pdeclaracion'];\n $id_etapa_pago = $_REQUEST['id_etapa_pago'];\n//---------------------------------------------------\n// Variables secundarios para generar Reporte en txt\n $master_est = null; //2;\n $master_cc = null; //2;\n\n if ($_REQUEST['todo'] == \"todo\") { // UTIL PARA EL BOTON Recibo Total\n $cubo_est = \"todo\";\n $cubo_cc = \"todo\";\n }\n\n $id_est = $_REQUEST['id_establecimientos'];\n $id_cc = $_REQUEST['cboCentroCosto'];\n\n if ($id_est) {\n $master_est = $id_est;\n } else if($id_est=='0') {\n $cubo_est = \"todo\";\n }\n\n if ($id_cc) {\n $master_cc = $id_cc;\n } else if($id_cc == '0'){\n $cubo_cc = \"todo\";\n }\n //\n $dao = new PlameDeclaracionDao();\n $data_pd = $dao->buscar_ID($id_pdeclaracion);\n $fecha = $data_pd['periodo'];\n\n //---\n $dao_ep = new EtapaPagoDao();\n $data_ep = $dao_ep->buscar_ID($id_etapa_pago);\n ;\n\n $_name_15 = \"error\";\n if ($data_ep['tipo'] == 1):\n $_name_15 = \"1RA QUINCENA\";\n elseif ($data_ep['tipo'] == 2):\n $_name_15 = \"2DA QUINCENA\";\n endif;\n\n\n $nombre_mes = getNameMonth(getFechaPatron($fecha, \"m\"));\n $anio = getFechaPatron($fecha, \"Y\");\n\n\n $file_name = '01.txt';//NAME_COMERCIAL . '-' . $_name_15 . '.txt';\n $file_name2 = '02.txt';//NAME_COMERCIAL . '-BOLETA QUINCENA.txt';\n $fpx = fopen($file_name2, 'w');\n $fp = fopen($file_name, 'w');\n \n //..........................................................................\n $FORMATO_0 = chr(27).'@'.chr(27).'C!';\n $FORMATO = chr(18).chr(27).\"P\";\n $BREAK = chr(13) . chr(10);\n //$BREAK = chr(14) . chr(10);\n //chr(27). chr(100). chr(0)\n $LINEA = str_repeat('-', 80);\n//..............................................................................\n// Inicio Exel\n//.............................................................................. \n fwrite($fp,$FORMATO); \n \n\n\n // paso 01 Listar ESTABLECIMIENTOS del Emplearo 'Empresa'\n $dao_est = new EstablecimientoDao();\n $est = array();\n $est = $dao_est->listar_Ids_Establecimientos(ID_EMPLEADOR);\n $pagina = 1;\n\n // paso 02 listar CENTROS DE COSTO del establecimento. \n if (is_array($est) && count($est) > 0) {\n //DAO\n $dao_cc = new EmpresaCentroCostoDao();\n $dao_pago = new PagoDao();\n $dao_estd = new EstablecimientoDireccionDao();\n\n // -------- Variables globales --------// \n $TOTAL = 0;\n $SUM_TOTAL_CC = array();\n $SUM_TOTAL_EST = array();\n\n\n\n for ($i = 0; $i < count($est); $i++) { // ESTABLECIMIENTO\n //echo \" i = $i establecimiento ID=\".$est[$i]['id_establecimiento'];\n //echo \"<br>\";\n //$SUM_TOTAL_EST[$i]['establecimiento'] = strtoupper(\"Establecimiento X ==\" . $est[$i]['id_establecimiento']);\n $bandera_1 = false;\n if ($est[$i]['id_establecimiento'] == $master_est) {\n $bandera_1 = true;\n } else if ($cubo_est == \"todo\") {\n $bandera_1 = true;\n }\n\n if ($bandera_1) {\n \n // if($bander_ecc){\n \n $SUM_TOTAL_EST[$i]['monto'] = 0;\n //Establecimiento direccion Reniec\n $data_est_direc = $dao_estd->buscarEstablecimientoDireccionReniec($est[$i]['id_establecimiento']/* $id_establecimiento */);\n\n $SUM_TOTAL_EST[$i]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n\n $ecc = array();\n $ecc = $dao_cc->listar_Ids_EmpresaCentroCosto($est[$i]['id_establecimiento']);\n // paso 03 listamos los trabajadores por Centro de costo \n\n for ($j = 0; $j < count($ecc); $j++) {\n\n $bandera_2 = false;\n if ($ecc[$j]['id_empresa_centro_costo'] == $master_cc) {\n $bandera_2 = true;\n } else if ($cubo_est == 'todo' || $cubo_cc == \"todo\") { // $cubo_est\n $bandera_2 = true;\n }\n \n if ($bandera_2) {\n //$contador_break = $contador_break + 1;\n // LISTA DE TRABAJADORES\n $data_tra = array();\n $data_tra = $dao_pago->listar_2($id_etapa_pago, $est[$i]['id_establecimiento'], $ecc[$j]['id_empresa_centro_costo']);\n\n if (count($data_tra)>0) {\n \n $SUM_TOTAL_CC[$i][$j]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n $SUM_TOTAL_CC[$i][$j]['centro_costo'] = strtoupper($ecc[$j]['descripcion']);\n $SUM_TOTAL_CC[$i][$j]['monto'] = 0;\n\n //fwrite($fp, $LINEA); \n fwrite($fp, NAME_EMPRESA); \n //$worksheet->write(($row + 1), ($col + 1), NAME_EMPRESA);\n //$data_pd['periodo'] $data_pd['fecha_modificacion']\n $descripcion1 = date(\"d/m/Y\");\n \n fwrite($fp, str_pad(\"FECHA : \", 56, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($descripcion1, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PAGINA :\", 69, \" \", STR_PAD_LEFT)); \n fwrite($fp, str_pad($pagina, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad($_name_15/*\"1RA QUINCENA\"*/, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PLANILLA DEL MES DE \" . strtoupper($nombre_mes) . \" DEL \" . $anio, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"LOCALIDAD : \" . $data_est_direc['ubigeo_distrito']);\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"CENTRO DE COSTO : \" . strtoupper($ecc[$j]['descripcion']));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n //$worksheet->write($row, $col, \"##################################################\");\n \n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"N \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad(\"DNI\", 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"APELLIDOS Y NOMBRES\", 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"IMPORTE\", 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"FIRMA\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n \n $pag = 0;\n $num_trabajador = 0;\n for ($k = 0; $k < count($data_tra); $k++) {\n $num_trabajador = $num_trabajador +1; \n if($num_trabajador>24):\n fwrite($fp,chr(12));\n $num_trabajador=0;\n endif;\n \n $data = array();\n $data = $data_tra[$k]; \n //$DIRECCION = $SUM_TOTAL_EST[$i]['establecimiento'];\n // Inicio de Boleta \n \n generarRecibo15_txt2($fpx, $data, $nombre_mes, $anio,$pag);\n $pag = $pag +1;\n\n \n // Final de Boleta\n $texto_3 = $data_tra[$k]['apellido_paterno'] . \" \" . $data_tra[$k]['apellido_materno'] . \" \" . $data_tra[$k]['nombres']; \n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(($k + 1) . \" \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($data_tra[$k]['num_documento'], 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(limpiar_caracteres_especiales_plame($texto_3), 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad($data_tra[$k]['sueldo'], 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"_______________\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n \n // por persona\n $SUM_TOTAL_CC[$i][$j]['monto'] = $SUM_TOTAL_CC[$i][$j]['monto'] + $data_tra[$k]['sueldo'];\n }\n\n\n $SUM_TOTAL_EST[$i]['monto'] = $SUM_TOTAL_EST[$i]['monto'] + $SUM_TOTAL_CC[$i][$j]['monto'];\n \n //--- LINE\n fwrite($fp, $BREAK);\n //fwrite($fp, $LINEA);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"TOTAL \" . $SUM_TOTAL_CC[$i][$j]['centro_costo'] . \" \" . $SUM_TOTAL_EST[$i]['establecimiento'], 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$j]['monto'], 2));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n\n fwrite($fp,chr(12));\n $pagina = $pagina + 1;\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK);\n $TOTAL = $TOTAL + $SUM_TOTAL_CC[$i][$j]['monto'];\n //$row_a = $row_a + 5;\n }//End Trabajadores\n }//End Bandera.\n }//END FOR CCosto\n\n\n // CALCULO POR ESTABLECIMIENTOS\n /* $SUM = 0.00;\n for ($z = 0; $z < count($SUM_TOTAL_CC[$i]); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_CC[$i][$z]['centro_costo'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$z]['monto'], 2));\n fwrite($fp, $BREAK);\n\n\n $SUM = $SUM + $SUM_TOTAL_CC[$i][$z]['monto'];\n }\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM, 2));\n */\n\n //fwrite($fp, $BREAK . $BREAK);\n \n }\n }//END FOR Est\n\n /*\n fwrite($fp, str_repeat('*', 85));\n fwrite($fp, $BREAK);\n fwrite($fp, \"CALCULO FINAL ESTABLECIMIENTOS \");\n fwrite($fp, $BREAK);\n\n //$worksheet->write(($row+4), ($col + 1), \".::RESUMEN DE PAGOS::.\");\n $SUM = 0;\n for ($z = 0; $z < count($SUM_TOTAL_EST); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_EST[$z]['establecimiento'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_EST[$z]['monto'], 2));\n fwrite($fp, $BREAK);\n $SUM = $SUM + $SUM_TOTAL_EST[$z]['monto'];\n }\n */\n \n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(number_format_var($TOTAL), 15, ' ',STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n \n \n }//END IF\n//..............................................................................\n// Inicio Exel\n//..............................................................................\n //|---------------------------------------------------------------------------\n //| Calculos Finales\n //|\n //|---------------------------------------------------------------------------\n //\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n\n\n fclose($fp);\n fclose($fpx);\n // $workbook->close();\n // .........................................................................\n // SEGUNDO ARCHIVO\n //..........................................................................\n\n\n\n\n\n\n\n\n\n\n $file = array();\n $file[] = $file_name;\n $file[] = ($file_name2);\n ////generarRecibo15_txt2($id_pdeclaracion, $id_etapa_pago);\n\n\n $zipfile = new zipfile();\n $carpeta = \"file-\" . date(\"d-m-Y\") . \"/\";\n $zipfile->add_dir($carpeta);\n\n for ($i = 0; $i < count($file); $i++) {\n $zipfile->add_file(implode(\"\", file($file[$i])), $carpeta . $file[$i]);\n //$zipfile->add_file( file_get_contents($file[$i]),$carpeta.$file[$i]);\n }\n\n header(\"Content-type: application/octet-stream\");\n header(\"Content-disposition: attachment; filename=zipfile.zip\");\n\n echo $zipfile->file();\n}", "public function payments_received_reports_pdf() {\n ini_set('memory_limit', '256M');\n $tenant_id = $this->tenant_id;\n $company = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $companies = array();\n foreach ($company as $row) {\n $companies[$row->company_id] = $row->company_name;\n }\n $company = $this->input->get('company');\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_recd($records_per_page, NULL, NULL, $order_by, $company, $invoice_id, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $pids = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $pids[] = $tabledata[$i]->pymnt_due_id;\n }\n $tb_extra = $this->reportsModel->get_payment_recd_trainee_company($pids);\n $tabledataextra = array();\n for ($i = 0; $i < count($tb_extra); $i++) {\n $tabledataextra[$tb_extra[$i]->pymnt_due_id] = $tb_extra[$i];\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return payments_recd_report_pdf($tabledataextra, $tabledata, $tenant_details, $companies);\n }", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n $cur = $this->input->post('ccurrency');\n $start = $this->input->post('start');\n $end = $this->input->post('end');\n\n $data['currency'] = $cur;\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n // Property Details\n $data['company'] = $this->properti['name'];\n\n $result = null;\n foreach ($this->model->report($cur,$start,$end)->result() as $res) {\n $result[] = array (\"id\"=>$res->id, \"no\"=>$res->no, \"notes\"=>$res->notes, \"dates\"=>tglin($res->dates), \n \"currency\"=>$res->currency, \"from\"=>$this->get_acc($res->from), \"to\"=>$this->get_acc($res->to), \n \"posted\"=>$res->approved, \"amount\"=>$res->amount);\n }\n $data['result'] = $result; $this->output = $data;\n }else { $this->reject_token(); }\n $this->response('content');\n }", "public function basicreport()\n\t{\n\t\t\n\t\t$disp_msg = $this->session->flashdata('disp_msg');\n\t\t\n\t\t\n\t\t$search_filters = array();\n\t\t$search_results = array();\n\t\t\n\t\t$search_query = \"SELECT * FROM postpatch_schedule WHERE 1=1 \";\n\t\t\n\t\tif (!empty($_POST)) {\n\t\t\tif(!empty($_POST['dpa_flexinet_id']) && count($_POST['dpa_flexinet_id'])>0) {\n\t\t\t\t$dpavals = implode(\"' , '\", $_POST['dpa_flexinet_id']);\n\t\t\t\t$search_query .= \" AND dpa_flexinet IN ('\".$dpavals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['verificationstatus']) && count($_POST['verificationstatus'])>0) {\n\t\t\t\t$verfstatusvals = implode(\"' , '\", $_POST['verificationstatus']);\n\t\t\t\t$search_query .= \" AND verificationstatus IN ('\".$verfstatusvals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['scheduledate']) && count($_POST['scheduledate'])>0) {\n\t\t\t\t$scdvals = implode(\"' , '\", $_POST['scheduledate']);\n\t\t\t\t$search_query .= \" AND scheduledate IN ('\".$scdvals.\"') \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search_query_res = $this->commonclass->execute_rawquery($search_query);\n\t\t$search_results = $search_query_res->result_array();\n\t\t\n\t\t$dpa_emps = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(dpa_flexinet) as dpa_flexinet ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($dpa_emps)>0) {\n\t\t\tforeach($dpa_emps as $onedpa) {\n\t\t\t\t$search_filters['dpa'][] = $onedpa['dpa_flexinet'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$verf_status_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(verificationstatus) as verificationstatus ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($verf_status_res)>0) {\n\t\t\tforeach($verf_status_res as $oneverif) {\n\t\t\t\t$search_filters['verf_status'][] = $oneverif['verificationstatus'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$scheduledate_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(scheduledate) as scheduledate ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($scheduledate_res)>0) {\n\t\t\tforeach($scheduledate_res as $oneverif1) {\n\t\t\t\t$search_filters['scheduledates'][$oneverif1['scheduledate']] = ($oneverif1['scheduledate'] != \"0000-00-00\") ? $this->commonclass->dateformat1($oneverif1['scheduledate']) : \"00/00/0000\";\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t## ____________ Data sending to the template starts ____________ ##\n\t\t$data['disp_msg'] = $disp_msg; # display messages\n\t\t$data['search_filters'] = $search_filters; # search_filters\n\t\t$data['search_results'] = $search_results; # search_filters\n\t\t//$data['postpatch_uploads'] = $postpatch_uploads; # postpatch_schedule\n\t\t\n\t\t## ____________ Data sending to the template ends here ____________ ##\n\t\t\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/header', $data); # html view page\n\t\t$this->load->view('admin/report1-page', $data); # html view page\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/footer', $data); # html view page\n\t}", "public function report() {\n $data = [];\n if ($this->input->post('submit')) {\n $report_data['from_date'] = $this->input->post('form_from_date');\n $report_data['to_date'] = $this->input->post('form_to_date');\n if ($this->input->post('form_summarized')) {\n $data['summarized_report'] = $this->account_model->getSummarizedReport($report_data);\n } else {\n $data['report'] = $this->account_model->getReport($report_data);\n }\n } else {\n if ($this->session->has_userdata('financialyear')) {\n $data['financialyear'] = $this->session->userdata('financialyear');\n }\n }\n $this->view('report', $data);\n }", "public function attendance(){\n\t\t\t$data['title'] = 'Students Attendences Course name '; \n\n\t\t\t$course_code = $_GET['course_code'];\n\t\t\t\n\t\t\t$ids = $this->register_model->ids($course_code);\n\n\t\t\t$course_id;\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t\t$course_id = $id['id'];\n\t\t\t\t\t$data['course_name'] = $id['course_name'];\n\t\t\t}\t\t\t\n\t\t\t$data['courses'] = $this->register_model->get_attendance($course_id);\n\n\t\t\t$this->load->view('admin/header1');\n\t\t\t$this->load->view('admin/attendance', $data);\n\t\t\t$this->load->view('admin/footer');\n\t\t}", "public function report($typeId = null, $reportDate = null, $numOfDays = null, $classId = null, $sectionId = null)\n\t{\t\t\t\n\t\t$year = substr($reportDate, 0, 4);\n\t\t$month = substr($reportDate, 5, 7);\t\t\n\n\t\t$classData = $this->model_classes->fetchClassData($classId);\n\t\t$sectionData = $this->model_section->fetchSectionByClassSection($classId, $sectionId);\n\n\t\t\t// student\t\t\t\n\t\t\t$div = '<div class=\"well\">\n\t\t\t\t<center>\n\t\t\t\t\t<h4> Ngành học: '.$classData['class_name'].'<br> Lớp học : '.$sectionData['section_name'].'<h4>\n\t\t\t\t\t<h4> Năm : '.$year.' - Month :'.$month.'<h4>\t\t\n\t\t\t\t\t<small>\t\n\t\t\t\t\t\t1 : Tiết 1-2 ( 7h00-8h45) <br />\t\t\t\t\n\t\t\t\t\t\t2 : Tiết 3-4 (9h-10h45) <br />\n\t\t\t\t\t\t3 : Tiết 5-6 (13h - 14h45)<br />\n\t\t\t\t\t\t4 : Tiết 7-8 (15h-16h45)<br />\n\t\t\t\t\t\t\t5 : Tiết 9-10 (17h00 - 18h45)<br />\n\t\t\t\t\t</small>\n\t\t\t\t</center>\n\t\t\t</div>\n\n\t\t\t<div style=\"overflow-x:auto;\">\t\t\t\n\t\t\t<table class=\"table table-bordered\" style=\"width:100%;\">\t\t\t\n\t\t\t\t<tbody style=\"width:100%;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"width:25%;\">Môn học</td>\n\t\t\t\t\t\t';\t\t\n\t\t\t\t\t\t// loop for days\n\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t<td style=\"width:10%;\">'.$i.'</td>';\t\n\t\t\t\t\t\t} // /for\n\t\t\t\t\t$div .= '</tr>';\n\t\t\t\t\t\t\n\t\t\t\t\t$subjectInfo = $this->model_subject->fetchSubjectDataByClass($classId);\n\n\t\t\t\t\tforeach ($subjectInfo as $key => $value) {\n\t\t\t\t\t\t$subjectName = $value['name'];\n\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$subjectName.'</td>';\n\n\t\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t\t// $attendanceData = $this->model_attendance->getAttendance($i, $reportDate, $value['student_id'], $typeId, $classId, $sectionId);\n\t\t\t\t\t\t\t\t$scheduleData = $this->model_schedule->getAttendance($i, $reportDate, $value['subject_id'], $sectionId);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$div .= '<td>';\n\t\t\t\t\t\t\t\tforeach ($scheduleData as $scheduleKey => $scheduleValue) {\n\n\t\t\t\t\t\t\t\t\tif($scheduleValue['schedule_type'] == 1) {\n\t\t\t\t\t\t\t\t\t\t// Có mặt\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-success\">1</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 2) {\n\t\t\t\t\t\t\t\t\t\t// Vắng\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-primary\">2</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 3) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">3</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 4) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">4</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Không xác định\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-danger\">5</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$div .= $scheduleStatus;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t\t</td>';\t\n\t\t\t\t\t\t\t\t} // /for\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t$div .= '</tr>';\t\t\n\t\t\t\t\t} // /foreach\n\t\t\t\t$div .= '</tbody>\n\t\t\t\t</table>\n\t\t\t<div>';\t\t\t\n\t\t\techo $div;\n\t\t\n\n\t\t\n\t}", "public function crystal_report_view()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/crystal_report',$this->data);\n\t}", "public function ss_reports()\n\t{\n\t\t$data['title'] = \"Social Security Reports\"; //Page title\n $flag = $this->input->post('sbtn', TRUE);\n\t\tif(!empty($flag))\n\t\t{\n\t\t\t$data['flag'] = 1;\n\t\t\t$data['month'] = $this->input->post('txtmonth');\n\t\t\t$data['social_security'] = $this->reports_model->get_emp_salary_details($data['month'],'ss');\n\t\t}\n $data['subview'] = $this->load->view('admin/reports/ss_reports', $data, TRUE);\n $this->load->view('admin/_layout_main', $data); //page load\n\t}", "public function genCIOMS ($caseId) {\n $this->viewBuilder()->layout('CIOMS');\n //1.\n $this->set('patientInitial', $this->getCiomsDirectValue($caseId,79,1));//B.1.1 patientinitial\n //1a.\n $this->set('country', $this->getCiomsLookupValue($caseId,3,1));// A.1.2 occurcountry\n //2.\n $this->set('birth', $this->getCiomsDirectValue($caseId,85,1));// A.1.2.1b patientbirthdate\n $this->set('birthMonth', $this->getCiomsMonthValue($caseId,85,1));// A.1.2.1b patientbirthdate\n //2a.\n $this->set('age', $this->getCiomsDirectValue($caseId,86,1));//B.1.2.2a patientonsetage\n $this->set('ageUnit',$this->getCiomsLookupValue($caseId,87,1));//B.1.2.2b patientonsetageunit\n //4-6\n $this->set('reaction', $this->getCiomsDirectValue($caseId,156,1));//B.2.i.4b reactionstartdate\n $this->set('reactionMonth', $this->getCiomsMonthValue($caseId,156,1));//B.2.i.4b reactionstartdate\n //3\n $this->set('sex',$this->getCiomsLookupValue($caseId,93,1));//B.1.5 sex\n //7\n $this->set('primarySourceReaction', $this->getCiomsDirectValue($caseId,149,1));//B.2.i.0 primarysourcereaction\n $this->set('reactionOutcome ', $this->getCiomsDirectValue($caseId,165,1));//B.2.i.8 reactionoutcome\n $this->set('actionDrug', $this->getCiomsDirectValue($caseId,208,1));// B.4.K.16 actiondrug\n $this->set('narrativeIncludeClinical', $this->getCiomsDirectValue($caseId,218,1));//B.5.1 narrativeincludeclinical\n \n //8-12\n $this->getCiomsSeriousValue($caseId,354,1);\n //13\n $this->set('resultsTestsProcedures', $this->getCiomsDirectValue($caseId,174,1));//B.3.2 resultstestsprocedures\n //14\n $this->set('drugone', $this->getCiomsDirectValue($caseId,177,1));//B.4.K.2+B.4.K.3 activesubstancename+obtaindrugcountry\n $this->set('genericOne', $this->getCiomsDirectValue($caseId,178,1));//B.4.K.3 obtaindrugcountry\n $this->set('drugtwo', $this->getCiomsDirectValue($caseId,177,2));//B.4.K.2+B.4.K.3 activesubstancename+obtaindrugcountry\n $this->set('genericTwo', $this->getCiomsDirectValue($caseId,178,2));//B.4.K.3 obtaindrugcountry\n //15\n $this->set('doseOne', $this->getCiomsDirectValue($caseId,183,1));//B.4.k.5.1Dose(number)\n $this->set('doseUnitOne', $this->getCiomsLookupValue($caseId,184,1));//Dose(unit) (B.4.k.5.2)\n $this->set('separateDosageOne', $this->getCiomsDirectValue($caseId,185,1));//Number Of Separate Dosages (B.4.k.5.3)\n $this->set('intervalOne', $this->getCiomsDirectValue($caseId,186,1));// Interval (B.4.k.5.4)\n $this->set('intervalUnitOne', $this->getCiomsLookupValue($caseId,187,1));//Interval Unit (B.4.k.5.5)\n\n\n $this->set('doseTwo', $this->getCiomsDirectValue($caseId,183,2));//B.4.k.5.1Dose(number)\n $this->set('doseUnitTwo', $this->getCiomsLookupValue($caseId,184,2));//Dose(unit) (B.4.k.5.2)\n $this->set('separateDosageTwo', $this->getCiomsDirectValue($caseId,185,2));//Number Of Separate Dosages (B.4.k.5.3)\n $this->set('intervalTwo', $this->getCiomsDirectValue($caseId,186,2));// Interval (B.4.k.5.4)\n $this->set('intervalUnitTwo', $this->getCiomsLookupValue($caseId,187,2));//Interval Unit (B.4.k.5.5)\n //16\n $this->set('routeone', $this->getCiomsLookupValue($caseId,192,1));//B.4.k.8 drugadministrationroute\n $this->set('routetwo', $this->getCiomsLookupValue($caseId,192,2));//B.4.k.8 drugadministrationroute\n //17\n $this->set('indicationOne', $this->getCiomsDirectValue($caseId,197,1));//B.4.k.11b drugindication\n $this->set('indicationTwo', $this->getCiomsDirectValue($caseId,197,2));//B.4.k.11b drugindication\n //18\n $this->set('TherapyStartOne', $this->getCiomsDateValue($caseId,199,1));//B.4.k.12b drugstartdate\n $this->set('TherapyStartTwo', $this->getCiomsDateValue($caseId,199,2));//B.4.k.12b drugstartdate\n $this->set('TherapyStopOne', $this->getCiomsDateValue($caseId,205,1));//B.4.k.14b drugenddate\n $this->set('TherapyStopTwo', $this->getCiomsDateValue($caseId,205,2));//B.4.k.14b drugenddate\n //19\n $this->set('TherapyDurationOne', $this->getCiomsDirectValue($caseId,206,1));//B.4.k.15a drugtreatmentduration\n $this->set('TherapyDurationUnitOne', $this->getCiomsLookupValue($caseId,207,1));//B.4.k.15b drugtreatmentdurationunit\n $this->set('TherapyDurationTwo', $this->getCiomsDirectValue($caseId,206,2));//B.4.k.15a drugtreatmentduration\n $this->set('TherapyDurationUnitTwo', $this->getCiomsLookupValue($caseId,207,2));//B.4.k.15b drugtreatmentdurationunit\n //20.\n $this->getCiomsDechallengeValue($caseId,381,1);//dechallenge\n //21.\n $this->getCiomsRechallengeValue($caseId,209,1);//Rechallenge\n //22. concomitant drugs and dates of administration\n $this->set('productName', $this->getCiomsDirectValue($caseId,176,2));//B.4.k.2.1medicinalproduct\n $this->set('substanceName', $this->getCiomsDirectValue($caseId,177,2));//B.4.k.2.2activesubstancename\n $this->set('countryObtain', $this->getCiomsDirectValue($caseId,178,2));//+B.4.k.2.3obtaindrugcountry\n $this->set('startDate', $this->getCiomsDirectValue($caseId,199,2));////B.4.k.12b drugstartdate\n $this->set('stopDate', $this->getCiomsDateValue($caseId,205,2));//B.4.k.14b drugenddate\n //23.other relevant history\n $this->set('patientEpisodeName', $this->getCiomsDirectValue($caseId,97,1));//B.1.7.1a.2 patientepisodename\n $this->set('patientMedicalStartDate', $this->getCiomsDateValue($caseId,99,1));//B.1.7.1c\tpatientmedicalstartdate\n $this->set('patientMedicalContinue', $this->getCiomsLooKupValue($caseId,100,1));//B.1.7.1d patientmedicalcontinue\n $this->set('patientMedicalEndDate', $this->getCiomsDateValue($caseId,102,1));//B.1.7.1f patientmedicalenddate\n $this->set('patientMedicalComment', $this->getCiomsDirectValue($caseId,103,1));//B.1.7.1g patientmedicalcomment\n //24a\n $this->set('caseSource', $this->getCiomsDateValue($caseId,19,1));//A.1.11.1 Source of the case identifier \n //24b\n $this->set('otherCaseIndentifier', $this->getCiomsDateValue($caseId,18,1));//A.1.11 Other case identifiers in previous transmissions\n //24c\n $this->set('receiptDate', $this->getCiomsDateValue($caseId,12,1));//A.1.7b Latest received date \n //24d\n $this->getCiomsReportSourceValue($caseId,1);\n\n }", "public function student_step5dw(){\n\t\t\t$id = $this->session->userdata['sm_id'];\n\t\t\t//print_r($id);\n\t\t$email = $this->commodel->get_listspfic1(\"student_master\",\"sm_email\",\"sm_id\",$id)->sm_email;\n\t\t$data['email'] = $email;\n\t\t\n\t\t//get the education detail from student_education\n\t\t// availabe final form for printing\n\t\t$this->sname=$this->commodel->get_listspfic1('student_master','sm_fname','sm_id',$id)->sm_fname;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$id)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$id)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$id)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$id)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$id)->sm_bloodgroup;\n\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$id)->spar_mothername;\t\t\n\t\t$this->fname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$id)->spar_fathername;\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$id)->sp_programid;\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$id)->sm_gender;\n\t\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_paddress','spar_smid',$id)->spar_paddress;\n\t\t$this->cadd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$id)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_pcity','spar_smid',$id)->spar_pcity;\n\t\t$this->ccity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$id)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_ppostoffice','spar_smid',$id)->spar_ppostoffice;\n\t\t$this->cpost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$id)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_pdistrict','spar_smid',$id)->spar_pdistrict;\n\t\t$this->cdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$id)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_pstate','spar_smid',$id)->spar_pstate;\n\t\t$this->cstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$id)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_ppincode','spar_smid',$id)->spar_ppincode;\n\t\t$this->cpin= $this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$id)->spar_cpincode;\n\t\t\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$id)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//fees detail\n\t\t$this->prog=$this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->amnt=$this->commodel->get_listspfic1('student_fees','sfee_feeamount','sfee_smid',$id)->sfee_feeamount;\n\t\t$this->pmethod=$this->commodel->get_listspfic1('student_fees','sfee_paymentmethod','sfee_smid',$id)->sfee_paymentmethod;\n\t\t$this->rno=$this->commodel->get_listspfic1('student_fees','sfee_referenceno','sfee_smid',$id)->sfee_referenceno; \n\t\t$this->fid=$this->commodel->get_listspfic1('student_fees','sfee_id','sfee_smid',$id)->sfee_id; \n\t\t$this->bname=$this->commodel->get_listspfic1('student_fees','sfee_bankname','sfee_smid',$id)->sfee_bankname;\n\n\t\t$this->rollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$id)->senex_rollno;\n\t\t\n\t\t//education detail\n\t\t$this->seresult = $this->commodel->get_listrow('student_education','sedu_smid',$id)->result();\n\t\t//get photo or sign\n\t\t$this->phresult = $this->commodel->get_listspfic1('student_master','sm_photo','sm_id',$id)->sm_photo;\n\t\t$this->signresult = $this->commodel->get_listspfic1('student_master','sm_signature','sm_id',$id)->sm_signature;\n\t\t\n\t\t$this->load->library('pdf');\n \t\t$this->pdf->load_view('student/student_step5dw');\n \t$this->pdf->render();\n \t$this->pdf->stream(\"Student_Admission.pdf\");\n\t\t\n\t\t//$this->load->view('student/student_step5');\n\t}", "function exam_marks() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $year = $this->db->get_where('settings', array('type' => 'running_year'))->row()->description;\n\n $student_id = $this->session->userdata('parent_id');\n $page_data['student_id'] = $student_id;\n $page_data['teacher_id'] = $this->parents_model->get_student_id('teacher_id', $student_id);\n $page_data['exams'] = $this->parents_model->get_student_exams();\n foreach ($page_data['exams'] as $data) {\n $this->parents_model->create_exam_positions($page_data['teacher_id'], $data['exam_id'], $year);\n }$page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['page_name'] = 'exam_marks';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $page_data['year'] = $year;\n $this->load->view('backend/index', $page_data);\n }", "function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "function create()\n\t{\n\n\t\t$kStudent = $this->uri->segment(3);\n\t\t$this->load->model(\"student_model\",\"student\");\n\t\t$this->load->model(\"teacher_model\",\"teacher\");\n\t\t$this->load->model(\"menu_model\",\"menu\");\n\t\t$data[\"ranks\"] = get_keyed_pairs($this->menu->get_pairs(\"report_rank\"),array(\"value\",\"label\"));\n\t\t$data[\"kTeach\"] = $this->session->userdata(\"userID\");\n\t\t//if the individual is not a teacher, show a dropdown list of teachers on whose behalf.\n\t\t//Include the author as an option\n\t\t$data[\"is_teacher\"] = TRUE;\n\t\tif($this->session->userdata('dbRole') != 2){\n\t\t\t$this->load->model(\"teacher_model\");\n\t\t\t$teachers = $this->teacher_model->get_teacher_pairs();\n\t\t\t$data['teachers'] = get_keyed_pairs($teachers, array('kTeach', 'teacher'),NULL,NULL,array('value'=>\"Myself\",'name'=>$data[\"kTeach\"]));\n\t\t\t$data[\"is_teacher\"] = FALSE;\n\t\t}\n\t\t$data[\"kStudent\"] = $kStudent;\n\t\t$report = $this->student->get($kStudent,\"stuFirst,stuLast,stuNickname,teacher.teachFirst as advisorFirst,teacher.teachLast as advisorLast,teacher.kTeach as kAdvisor\",TRUE);\n\t\t$data[\"student\"] = format_name($report->stuFirst,$report->stuLast,$report->stuNickname);\n\t\t$data[\"advisor\"] = format_name($report->advisorFirst,$report->advisorLast);\n\t\t$data[\"report\"] = $report;\n\t\t$data[\"methods\"] = array(\"In Person\",\"Over the Phone\",\"Via Email\");\n\n\t\t$data[\"statuses\"] = get_keyed_pairs($this->menu->get_pairs(\"report_status\"),array(\"value\",\"label\"));\n\t\t$data[\"categories\"] = get_keyed_pairs($this->menu->get_pairs(\"report_category\"),array(\"value\",\"label\"));\n\t\t$data[\"methods\"] = $this->menu->get_pairs(\"report_contact_method\");\n\t\t$data[\"action\"] = \"insert\";\n\t\t$data[\"title\"] = sprintf(\"Adding an %s for %s\", STUDENT_REPORT, $data[\"student\"]);\n\t\t$data[\"target\"] = \"report/edit\";\n\t\t$this->_view($data);\n\t\t\n\t}", "public function reportStudentDoorAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportStudentDoorAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister); \n }", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "public function batch_garde_summary(){\r\n \t$GradeID = $this->input->GET('GradeID');\r\n \t$OptionID = $this->input->GET('OptionID');\r\n\r\n\r\n \t$this->load->model('admission/admission_batch_model');\r\n\r\n \tif($OptionID==1){\r\n \t$data['admission_batch'] = $this->admission_batch_model->get_batchwisegradesummary($GradeID); \t\t\r\n \t}else if($OptionID==2){\r\n \t$data['admission_batch'] = $this->admission_batch_model->get_GradeBatchSummary($GradeID); \t\t\r\n \t}\r\n\r\n //var_dump($data['admission_batch']);\r\n\t\t\r\n\t\t// Overall Font Size\t\t\t\r\n\t\t$font_name = 'Helvetica';\r\n\t\t$now_date = date('D d M @ h:i a');\r\n\r\n\r\n\r\n /***** Title *****/\r\n $Adm_Tit = 'Admission 2017';\r\n if(!empty($data['admission_batch'][0]->grade_name)){\r\n $Gde_Tit = $data['admission_batch'][0]->grade_name;\t\r\n }\r\n else{\r\n \t$Gde_Tit = '';\r\n } \r\n\r\n \r\n\r\n /***** Calculation Veriables *******/\r\n $Border_Clc = 1;\r\n $Border_Clc2 = 0;\r\n $FontSize_Clc = 8;\r\n $X_Clc = '';\r\n $Y_Clc = '';\r\n $CW_Clc = '';\r\n $CH_Clc = '';\r\n\r\n\r\n $TForms = 0;\r\n $TInprocess = 0;\r\n $TReAllocated = 0;\r\n $TSettled = 0;\r\n\r\n $TGirls = 0;\r\n $TBoys = 0;\r\n $TSiblings = 0;\r\n $TPets = 0;\r\n\r\n $TAAP = 0;\r\n $TAA = 0;\r\n $TAAM = 0;\r\n $TABP = 0;\r\n $TAB = 0;\r\n $TABM = 0;\r\n $TAC = 0;\r\n $TAD = 0;\r\n $TASD = 0;\r\n $TACFD = 0;\r\n $TAWL = 0;\r\n $TAOH = 0;\r\n $TARGR = 0;\r\n\r\n $TDAP = 0;\r\n $TDA = 0;\r\n $TDAM = 0;\r\n $TDBP = 0;\r\n $TDB = 0;\r\n $TDBM = 0;\r\n $TDC = 0;\r\n $TDD = 0;\r\n $TDSC = 0;\r\n $TDOFR = 0;\r\n $TDWL = 0;\r\n $TDOH = 0;\r\n $TDRGR = 0;\r\n\r\n $TWL = 0;\r\n $TOH = 0;\r\n $TFU = 0;\r\n $TOFD = 0;\r\n\r\n $TCNF = 0;\r\n $TRGT = 0;\r\n $TNIT = 0;\r\n /************************/\r\n\r\n\r\n \r\n\r\n\r\n\t\trequire_once('components/pdf/fpdf/fpdf.php');\r\n\t\trequire_once('components/pdf/fpdi/fpdi.php');\r\n\r\n\t\t// initiate FPDI\t\t\t\r\n\t\t$pdf = new FPDI();\r\n\t\t$pdf->aliasNbPages();\r\n\t\t$pdf->AddPage('L','A4');\r\n\t\t$pdf->SetMargins(0,0,0);\r\n\t\t$pdf->SetAutoPageBreak(true, 17);\r\n\r\n\r\n\r\n\t\t/***** Title Setup *******/\r\n $Border_Tit = 0;\r\n $FontSize_Tit = 12;\r\n $FontSize_Tit2 = 10;\r\n $X_Tit = 6;\r\n $Y_Tit = 5;\r\n $CW_Tit = 286;\r\n $CH_Tit = 6;\r\n /************************/\r\n\t\t\r\n\r\n\t /**************** Title ****************/\r\n\r\n\t $pdf->SetFillColor(209,209,209);\r\n\t\t$pdf->SetFont($font_name);\r\n\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t $pdf->SetXY($X_Tit, $Y_Tit);\r\n\t if ($OptionID == 1){\r\n\t \t$pdf->Cell($CW_Tit/3, $CH_Tit, 'Batch Wise Summary', $Border_Tit, 0, 'C', 1);\r\n\t\t}else if ($OptionID == 2){\r\n\t\t\t$pdf->Cell($CW_Tit/3, $CH_Tit, 'Grade Wise Summary', $Border_Tit, 0, 'C', 1);\r\n\t\t}\r\n\r\n\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t $pdf->Cell($CW_Tit/3, $CH_Tit, $Adm_Tit, $Border_Tit, 0, 'C', 1);\r\n\r\n\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t $pdf->Cell($CW_Tit/3, $CH_Tit, 'Page No', $Border_Tit, 2, 'C', 1);\r\n\r\n\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t $pdf->SetXY($X_Tit, $Y_Tit+$CH_Tit);\r\n\t $pdf->Cell($CW_Tit/3, $CH_Tit, $Gde_Tit, $Border_Tit, 0, 'C', 1);\r\n\r\n\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t $pdf->Cell($CW_Tit/3, $CH_Tit, 'as of '.$now_date, $Border_Tit, 0, 'C', 1);\r\n\r\n\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t $pdf->Cell($CW_Tit/3, $CH_Tit, '1', $Border_Tit, 0, 'C', 1);\r\n\r\n\t /***************************************/\r\n\r\n\r\n\t\t/***** Table Setup *******/ \r\n $Border_Tbl = 1;\r\n $Border_Tbl2 = 0;\r\n $FontSize_Tbl = 8;\r\n $X_Tbl = 6;\r\n $Y_Tbl = 20;\r\n $CW_Tbl = 286;\r\n $CH_Tbl = 9;\r\n $CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl/1.5;\r\n /************************/\r\n\r\n // Calculation Header\r\n\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl);\r\n\t\t\t$pdf->SetXY($X_Tbl, $Y_Tbl);\r\n\t\t\t$pdf->Cell($CW_Clc/3.07, $CH_Clc/1.5, 'Applicants', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc/1.5, '', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/2.93, $CH_Clc/1.5, 'Profile', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc/1.5, 'Assessment', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc/1.5, 'Discussion', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/5.25, $CH_Clc/1.5, 'Intermediates', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t$pdf->Cell($CW_Clc/3.23, $CH_Clc/1.5, 'Outcomes', $Border_Tbl, 0, 'C', 1);\r\n\r\n\r\n\t\t$PageNo = 1;\r\n\t\t$i = 1;\r\n\t\t$len = count($data['admission_batch']);\r\n\r\n\t\tforeach ($data['admission_batch'] as $data) {\r\n\r\n\t\t\tif ($i > 7){\r\n\t\t\t\t$i = 1;\r\n\t\t\t\t$pdf->AddPage('L','A4');\r\n\r\n\r\n\t\t\t\t$PageNo++;\r\n\t\t\t\t/***** Title Setup *******/\r\n\t\t $Border_Tit = 0;\r\n\t\t $FontSize_Tit = 12;\r\n\t\t $FontSize_Tit2 = 10;\r\n\t\t $X_Tit = 6;\r\n\t\t $Y_Tit = 5;\r\n\t\t $CW_Tit = 286;\r\n\t\t $CH_Tit = 6;\r\n\t\t /************************/\r\n\t\t\t\t\r\n\r\n\t\t\t /**************** Title ****************/\r\n\r\n\t\t\t $pdf->SetFillColor(209,209,209);\r\n\t\t\t\t$pdf->SetFont($font_name);\r\n\t\t\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t\t\t $pdf->SetXY($X_Tit, $Y_Tit);\r\n\t\t\t if ($OptionID == 1){\r\n\t\t\t \t$pdf->Cell($CW_Tit/3, $CH_Tit, 'Batch Wise Summary', $Border_Tit, 0, 'C', 1);\r\n\t\t\t\t}else if ($OptionID == 2){\r\n\t\t\t\t\t$pdf->Cell($CW_Tit/3, $CH_Tit, 'Grade Wise Summary', $Border_Tit, 0, 'C', 1);\r\n\t\t\t\t}\r\n\t\t\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t\t\t $pdf->Cell($CW_Tit/3, $CH_Tit, $Adm_Tit, $Border_Tit, 0, 'C', 1);\r\n\r\n\t\t\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t\t\t $pdf->Cell($CW_Tit/3, $CH_Tit, 'Page No', $Border_Tit, 2, 'C', 1);\r\n\r\n\t\t\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t\t\t $pdf->SetXY($X_Tit, $Y_Tit+$CH_Tit);\r\n\t\t\t $pdf->Cell($CW_Tit/3, $CH_Tit, $Gde_Tit, $Border_Tit, 0, 'C', 1);\r\n\r\n\t\t\t $pdf->SetFont($font_name,'',$FontSize_Tit2);\r\n\t\t\t $pdf->Cell($CW_Tit/3, $CH_Tit, 'as of '.$now_date, $Border_Tit, 0, 'C', 1);\r\n\r\n\t\t\t $pdf->SetFont($font_name,'B',$FontSize_Tit);\r\n\t\t\t $pdf->Cell($CW_Tit/3, $CH_Tit, $PageNo, $Border_Tit, 0, 'C', 1);\r\n\r\n\t\t\t /***************************************/\r\n\r\n\r\n\t\t\t\t/***** Table Setup *******/ \r\n\t\t $Border_Tbl = 1;\r\n\t\t $Border_Tbl2 = 0;\r\n\t\t $FontSize_Tbl = 8;\r\n\t\t $X_Tbl = 6;\r\n\t\t $Y_Tbl = 20;\r\n\t\t $CW_Tbl = 286;\r\n\t\t $CH_Tbl = 9;\r\n\t\t $CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\t\t /************************/\r\n\r\n\t\t // Calculation Header\r\n\t\t\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl);\r\n\t\t\t\t\t$pdf->SetXY($X_Tbl, $Y_Tbl);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/3.07, $CH_Clc/1.5, 'Applicants', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc/1.5, '', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/2.93, $CH_Clc/1.5, 'Profile', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc/1.5, 'Assessment', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc/1.5, 'Discussion', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/5.25, $CH_Clc/1.5, 'Intermediates', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t\t\t$pdf->Cell($CW_Clc/3.23, $CH_Clc/1.5, 'Outcomes', $Border_Tbl, 0, 'C', 1);\r\n\t\t\t}\r\n\r\n\t\t\t// Veriable\r\n\t\t\t$Clc_TotalForm = $data->total_forms;\r\n\t\t\t$Clc_InProcess = 0;\r\n\t $Clc_ReAllocated = $data->re_allocated;\r\n\t $Clc_Settled = 0;\r\n\t $Clc_Followup = 0;\r\n\r\n\t $Clc_Batch = $data->batch;\r\n\t $Clc_BatchDate = $data->batch_date;\r\n\r\n\t $Clc_boy = $data->gender_b;\r\n\t $Clc_Girl = $data->gender_g;\r\n\r\n\t $Clc_Sib = $data->siblings;\r\n\t $Clc_PetSib = $data->pet;\r\n\r\n\t $Clc_AAplus = $data->ass_ap;\r\n\t $Clc_AA = $data->ass_a;\r\n\t $Clc_AAminus = $data->ass_am;\r\n\t $Clc_ABplus = $data->ass_bp;\r\n\t $Clc_AB = $data->ass_b;\r\n\t $Clc_ABminus = $data->ass_bm;\r\n\t $Clc_AC = $data->ass_c;\r\n\t $Clc_AD = $data->ass_d;\r\n\t $Clc_ACfd = $data->ass_cfd;\r\n\t $Clc_AWil = $data->ass_wl;\r\n\t $Clc_AOhd = $data->ass_oh;\r\n\t $Clc_ARgt = $data->ass_rgr + $data->ass_rgr_pre;\r\n\r\n\t $Clc_DAplus = $data->dsc_ap;\r\n\t $Clc_DA = $data->dsc_a;\r\n\t $Clc_DAminus = $data->dsc_am;\r\n\t $Clc_DBplus = $data->dsc_bp;\r\n\t $Clc_DB = $data->dsc_b;\r\n\t $Clc_DBminus = $data->dsc_bm;\r\n\t $Clc_DC = $data->dsc_c;\r\n\t $Clc_DD = $data->dsc_d;\r\n\t $Clc_DOfr = $data->dsc_tbo + $data->inter_ofd + $data->adm_cnf + $data->dsc_total;\r\n\t $Clc_DWil = $data->dsc_wl;\r\n\t $Clc_DOhd = $data->dsc_oh;\r\n\t $Clc_DRgt = $data->dsc_rgr + $data->dsc_rgr_pre;\r\n\r\n\t $Clc_TWil = $data->inter_wl;\r\n\t $Clc_TOhd = $data->inter_oh;\r\n\t $Clc_TOfd = $data->inter_ofd + $data->adm_cnf;\r\n\t $Clc_TCnf = 0;\r\n\t $Clc_TNit = $data->ass_total + $data->dsc_total;\r\n\t $Clc_TRgt = $data->ass_rgr + $data->dsc_rgr;\r\n\t //$Clc_TInp = 0;\r\n\r\n\t \r\n\t $Clc_TAst = $Clc_AAplus + $Clc_AA + $Clc_AAminus + $Clc_ABplus + $Clc_AB + $Clc_ABminus + $Clc_AC + $Clc_AD;\r\n\t $Clc_TDis = $Clc_DAplus + $Clc_DA + $Clc_DAminus + $Clc_DBplus + $Clc_DB + $Clc_DBminus + $Clc_DC + $Clc_DD;\r\n\t $Clc_CNF = $data->adm_cnf;\r\n\r\n\t if ($data->batch_case == 'AND'){\r\n\t \t$Clc_ACfd = $Clc_DOfr + $Clc_DWil + $Clc_DOhd + $Clc_DRgt;\r\n\t }else if ($data->batch_case == 'ASO'){\r\n\t \t$Clc_ACfd = $data->ass_cfd + $Clc_TDis;\r\n\t }\r\n\r\n\t $Clc_Settled = $Clc_CNF + $Clc_TNit + $Clc_TRgt;\r\n\t\t\t$Clc_InProcess = $Clc_TotalForm - $Clc_Settled;\r\n\t\t\t\r\n\r\n\t\t\t$X_Clc = 6;\r\n\t\t\t$Y_Clc = 7 + ($CH_Tbl*2.5) * $i;\r\n\t\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\r\n\r\n\t\t\t// Calculation First Line\r\n\t\t\t$pdf->SetTextColor(96,96,96);\r\n\t\t\t$pdf->SetFont($font_name,'',$FontSize_Tbl);\r\n\t\t\t$pdf->SetXY($X_Clc, $Y_Clc);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'T Forms Sub', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'In Process', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Girls', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Boys', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'C', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'D', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'C', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'D', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'OH', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'F/U', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"CNF'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"RGT'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"ABT'D\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t// Calculation Second Line\r\n\t\t\t$X_Clc = $X_Tbl;\r\n\t\t\t$Y_Clc = 11 + ($CH_Tbl*2.5) * $i;\r\n\t\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t\t$pdf->SetTextColor(0,0,0);\r\n\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t\t$pdf->SetXY($X_Clc, $Y_Clc);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $Clc_TotalForm, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $Clc_InProcess, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+3);\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, $Clc_Batch, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $Clc_Girl, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $Clc_boy, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AAplus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AA, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AAminus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_ABplus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AB, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_ABminus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AC, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_AD, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DAplus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DA, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DAminus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DBplus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DB, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DBminus, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DC, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $Clc_DD, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $Clc_TWil, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $Clc_TOhd, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $Clc_Followup, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $Clc_CNF, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $Clc_TRgt, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $Clc_TNit, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t\r\n\t\t\t// Calculation 3rd Line\r\n\t\t\t$X_Clc = $X_Tbl;\r\n\t\t\t$Y_Clc = 17 + ($CH_Tbl*2.5) * $i;\r\n\t\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t\t$pdf->SetTextColor(96,96,96);\r\n\t\t\t$pdf->SetFont($font_name,'',$FontSize_Tbl);\r\n\t\t\t$pdf->SetXY($X_Clc, $Y_Clc);\r\n\t\t\tif ($OptionID == 2){\r\n\t\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t}else {\r\n\t\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'Re-Allocated', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t}\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'Settled', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, $Clc_BatchDate, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Siblings', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, \"Pet's\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, \"T ASS'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '> CFD', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '*OH*', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'TBR', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, \"T DIS'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '> TBO', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '*OH*', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'TBR', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25), $CH_Clc, \"OFR'D\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2), $CH_Clc, 'INP', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t// Calculation 4th Line\r\n\t\t\t$X_Clc = $X_Tbl;\r\n\t\t\t$Y_Clc = 21 + ($CH_Tbl*2.5) * $i;\r\n\t\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t\t$pdf->SetTextColor(0,0,0);\r\n\t\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t\t$pdf->SetXY($X_Clc, $Y_Clc);\r\n\t\t\tif ($OptionID == 2){\r\n\t\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t}else{\r\n\t\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $Clc_ReAllocated, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t}\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $Clc_Settled, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $Clc_Sib, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $Clc_PetSib, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, $Clc_TAst, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_ACfd, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_AWil, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_AOhd, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_ARgt, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, $Clc_TDis, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_DOfr, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_DWil, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_DOhd, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $Clc_DRgt, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/5.25), $CH_Clc, $Clc_TOfd, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t$pdf->Cell(($CW_Clc/3.2), $CH_Clc, $Clc_InProcess, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t\t// Formatting\r\n\r\n\t\t\t$X_Clc = 6;\r\n\t\t\t$Y_Clc = 5 + ($CH_Tbl*2.5) * $i;\r\n\t\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t\t$CH_Clc = $CH_Tbl*2.5;\r\n\r\n\t\t\t$pdf->SetXY($X_Clc, $Y_Clc);\r\n\t\t\t$pdf->Cell($CW_Clc/3.07, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/2.93, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/2, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/5.25, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t\t$pdf->Cell($CW_Clc/3.23, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\r\n\r\n\t\t\t$TForms += $Clc_TotalForm;\r\n\t\t\t$TInprocess += $Clc_InProcess;\r\n\t $TReAllocated += $Clc_ReAllocated;\r\n\t $TSettled += $Clc_Settled;\r\n\r\n\t $TGirls += $Clc_Girl;\r\n\t $TBoys += $Clc_boy;\r\n\t $TSiblings += $Clc_Sib;\r\n\t $TPets += $Clc_PetSib;\r\n\r\n\t $TAAP += $Clc_AAplus;\r\n\t $TAA += $Clc_AA;\r\n\t $TAAM += $Clc_AAminus;\r\n\t $TABP += $Clc_ABplus;\r\n\t $TAB += $Clc_AB;\r\n\t $TABM += $Clc_ABminus;\r\n\t $TAC += $Clc_AC;\r\n\t $TAD += $Clc_AD;\r\n\t $TASD += $Clc_TAst;\r\n\t $TACFD += $Clc_ACfd;\r\n\t $TAWL += $Clc_AWil;\r\n\t $TAOH += $Clc_AOhd;\r\n\t $TARGR += $Clc_ARgt;\r\n\r\n\t $TDAP += $Clc_DAplus;\r\n\t $TDA += $Clc_DA;\r\n\t $TDAM += $Clc_DAminus;\r\n\t $TDBP += $Clc_DBplus;\r\n\t $TDB += $Clc_DB;\r\n\t $TDBM += $Clc_DBminus;\r\n\t $TDC += $Clc_DC;\r\n\t $TDD += $Clc_DD;\r\n\t $TDSC += $Clc_TDis;\r\n\t $TDOFR += $Clc_DOfr;\r\n\t $TDWL += $Clc_DWil;\r\n\t $TDOH += $Clc_DOhd;\r\n\t $TDRGR += $Clc_DRgt;\r\n\r\n\t $TWL += $Clc_TWil;\r\n\t $TOH += $Clc_TOhd;\r\n\t $TFU += 0;\r\n\t $TOFD += $Clc_TOfd;\r\n\r\n\t $TCNF += $Clc_CNF;\r\n\t $TRGT += $Clc_TRgt;\r\n\t $TNIT += $Clc_TNit;\r\n\r\n\r\n\r\n\t\t $i++;\r\n\r\n\t\t\t/***************************************/\r\n\t\t}\r\n\r\n\r\n\t\t\r\n\t\t$X_Clc1 = $X_Tbl;\r\n\t\t$Y_Clc1 = $Y_Clc+($CH_Clc)+($len/$PageNo);\r\n\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t// Calculation First Line\r\n\t\t$pdf->SetTextColor(96,96,96);\r\n\t\t$pdf->SetFont($font_name,'',$FontSize_Tbl);\r\n\t\t$pdf->SetXY($X_Clc1, $Y_Clc1);\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'T Forms Sub', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'In Process', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Girls', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Boys', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'C', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'D', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'A-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B+', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'B-', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'C', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, 'D', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'OH', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, 'F/U', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"CNF'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"RGT'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, \"ABT'D\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t// Calculation Second Line\r\n\t\t$pdf->SetTextColor(0,0,0);\r\n\t\t$X_Clc1 = $X_Tbl;\r\n\t\t$Y_Clc1 = $Y_Clc+($CH_Clc*4.5)+($len/$PageNo);\r\n\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t$pdf->SetXY($X_Clc1, $Y_Clc1);\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $TForms, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $TInprocess, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+3);\r\n\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, $Gde_Tit, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $TGirls, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $TBoys, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAAP, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAA, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAAM, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TABP, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAB, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TABM, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAC, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TAD, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDAP, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDA, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDAM, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDBP, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDB, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDBM, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDC, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/8, $CH_Clc, $TDD, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $TWL, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $TOH, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/5.25)/3, $CH_Clc, $TFU, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $TCNF, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $TRGT, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/3.2)/3, $CH_Clc, $TNIT, $Border_Tbl2, 0, 'C', 0);\r\n\t\t\r\n\t\t// Calculation 3rd Line\r\n\t\t$pdf->SetTextColor(96,96,96);\r\n\t\t$X_Clc1 = $X_Tbl;\r\n\t\t$Y_Clc1 = $Y_Clc+($CH_Clc*5.5)+($len/$PageNo);\r\n\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t$pdf->SetFont($font_name,'',$FontSize_Tbl);\r\n\t\t$pdf->SetXY($X_Clc1, $Y_Clc1);\r\n\t\tif ($OptionID == 2){\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\t\t}else {\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'Re-Allocated', $Border_Tbl2, 0, 'C', 0);\r\n\t\t}\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, 'Settled', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, 'Siblings', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, \"Pet's\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, \"T ASS'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '> CFD', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '*OH*', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'TBR', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, \"T DIS'D\", $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '> TBO', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'WL', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, '*OH*', $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, 'TBR', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/5.25), $CH_Clc, \"OFR'D\", $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/3.2), $CH_Clc, 'INP', $Border_Tbl2, 0, 'C', 0);\r\n\t\t\r\n\t\t// Calculation 4th Line\r\n\t\t$pdf->SetTextColor(0,0,0);\r\n\t\t$X_Clc1 = $X_Tbl;\r\n\t\t$Y_Clc1 = $Y_Clc+($CH_Clc*6.2)+($len/$PageNo);\r\n\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl/1.5;\r\n\r\n\t\t$pdf->SetFont($font_name,'B',$FontSize_Tbl+1);\r\n\t\t$pdf->SetXY($X_Clc1, $Y_Clc1);\r\n\t\tif ($OptionID == 2){\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\t\t}else{\r\n\t\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $TReAllocated, $Border_Tbl2, 0, 'C', 0);\r\n\t\t}\r\n\t\t$pdf->Cell(($CW_Clc/3.07)/2, $CH_Clc, $TSettled, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $TSiblings, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2.93)/2, $CH_Clc, $TPets, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, $TASD, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TACFD, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TAWL, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TAOH, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TARGR, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/2)/3, $CH_Clc, $TDSC, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TDOFR, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TDWL, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TDOH, $Border_Tbl2, 0, 'C', 0);\r\n\t\t$pdf->Cell(($CW_Clc/2)/6, $CH_Clc, $TDRGR, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/5.25), $CH_Clc, $TOFD, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t$pdf->Cell(($CW_Clc/3.2), $CH_Clc, $TInprocess, $Border_Tbl2, 0, 'C', 0);\r\n\r\n\t\t// Formatting\r\n\r\n\t\t$X_Clc1 = $X_Tbl;\r\n\t\t$Y_Clc1 = $Y_Clc+($CH_Clc*3.5)+($len/$PageNo);\r\n\t\t$CW_Clc = ($CW_Tbl/2.5);\r\n\t\t$CH_Clc = $CH_Tbl*2.5;\r\n\r\n\t\t$pdf->SetXY($X_Clc1, $Y_Clc1);\r\n\t\t$pdf->Cell($CW_Clc/3.07, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/3, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/2.93, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/2, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/2, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/5.25, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\t$pdf->Cell($CW_Clc/3.2, $CH_Clc, '', $Border_Tbl, 0, 'C', 0);\r\n\t\r\n\r\n\t\t$this->load->model('staff/staff_registered_model');\r\n\t\t$this->data['staff_registered_data'] = $this->staff_registered_model->get_by(array('user_id' => (int)$this->session->userdata('user_id')));\r\n\t if (!empty($this->data['staff_registered_data'][0])){\r\n\t \t$Username = ucwords($this->data['staff_registered_data'][0]->abridged_name);\r\n\t } else {\r\n\t \t$Username = 'UserName';\r\n\t\t}\r\n\t $pdf->SetTextColor(255,255,255);\r\n\t $pdf->SetFont($font_name,'',7.5);\r\n\t $pdf->SetFillColor(0,0,0);\r\n\t $pdf->SetXY(233, 189);\r\n\t $pdf->Cell(60, 4, date('D-d-M-Y H:i') . ' (' . $Username . ')', 0, 0, 'R', true);\r\n\t \r\n\t \r\n\t\t// Output the new PDF\r\n\t\t$pdf->Output($Gde_Tit . '.pdf', 'I');\r\n }", "public function actionInquiryReport()\n {\n $s_date='';\n $e_date='';\n $export = Yii::$app->request->get('export');\n $search = Yii::$app->request->get('search');\n if(isset($export) && !isset($search)) {\n $this->InquiryExport();\n }\n else{\n if (isset(Yii::$app->request->queryParams['BookingSearch']['start_date']))\n $s_date = Yii::$app->request->queryParams['BookingSearch']['start_date'];\n if (isset(Yii::$app->request->queryParams['BookingSearch']['end_date']))\n $e_date = Yii::$app->request->queryParams['BookingSearch']['end_date'];\n if($s_date=='')\n $s_date = date(\"M-d-Y\");\n if($e_date=='')\n $e_date = date(\"M-d-Y\");\n $searchModel = new RecordInquirySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('inquiry_index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 's_date' => $s_date,\n 'e_date' => $e_date,\n ]);\n }\n\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}", "function get_list()\n\t{\n\t\t$type = $this->uri->segment(3);\n\t\t$key = $this->uri->segment(4);\n\t\t$data[\"student_report\"] = STUDENT_REPORT;\n\n\t\tif($type && $key){\n\t\t\t$data[\"report_key\"] = $key;\n\t\t\t$data[\"report_type\"] = $type;\n\t\t\tswitch($type){\n\t\t\t\tcase \"student\":\n\t\t\t\t\t$this->load->model(\"student_model\",\"student\");\n\t\t\t\t\t$person = $this->student->get($key,\"stuFirst,stuLast,stuNickname,student.*,(`baseGrade`+\" . get_current_year() . \"-`baseYear`) as stuGrade\");\n\t\t\t\t\t$title = sprintf(\"for %s\" , format_name($person->stuFirst,$person->stuLast, $person->stuNickname));\n\t\t\t\t\t$data[\"kStudent\"] = $key;\n\n\t\t\t\t\t//$data[\"target\"] = \"report/\" . $type . \"_list\";\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"teacher\":\n\t\t\t\t\t$this->load->model(\"teacher_model\",\"teacher\");\n\t\t\t\t\t$person = $this->teacher->get($key,\"teachFirst,teachLast,dbRole,isAdvisor,gradeStart,gradeEnd,kTeach\");\n\t\t\t\t\t$title = sprintf(\"by %s %s\", $person->teachFirst,$person->teachLast);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"advisor\":\n\t\t\t\t\t$this->load->model(\"teacher_model\",\"teacher\");\n\t\t\t\t\t$person = $this->teacher->get($key,\"teachFirst as advisorFirst,teachLast as advisorLast,dbRole,isAdvisor,gradeStart,gradeEnd,kTeach\");\n\t\t\t\t\t$title = sprintf(\"to %s %s\",$person->advisorFirst,$person->advisorLast);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$options = array();\n\t\t\tif($this->input->get(\"date_start\") && $this->input->get(\"date_end\")){\n\t\t\t\t$date_start = $this->input->get(\"date_start\");\n\t\t\t\t$date_end = $this->input->get(\"date_end\");\n\t\t\t\t$options[\"date_range\"][\"date_start\"] = $date_start;\n\t\t\t\t$options[\"date_range\"][\"date_end\"] = $date_end;\n\n\t\t\t\t//$this->session->set_userdata(\"date_start\",$date_start);\n\t\t\t\t//$this->session->set_userdata(\"date_end\",$date_end);\n\t\t\t\tbake_cookie(\"date_start\", $date_start);\n\t\t\t\tbake_cookie(\"date_end\", $date_end);\n\t\t\t}\n\n\t\t\tif($this->input->get(\"category\")){\n\t\t\t\t$options[\"category\"] = $this->input->get(\"category\");\n\t\t\t}\n\n\t\t\t$data[\"options\"] = $options;\n\t\t\t$data[\"target\"] = \"report/list\";\n\t\t\t$data[\"person\"] = $person;\n\n\t\t\t$data[\"reports\"] = $this->report->get_list($type,$key,$options);\n\t\t\t$data[\"type\"] = $type;\n\t\t\t$data[\"title\"] = sprintf(\"%ss Submitted %s\", $data[\"student_report\"], $title);\n\t\t\t$this->load->view(\"page/index\",$data);\n\n\n\t\t}\n\t}", "public function hrEmpLeaveReport(Request $request, $type=null){\n $data['post_data'] = $request->all();\n //$userInfo = $this->getEmployeeInfo( null,3883);\n if ($type == 'pdf' && $request->users !=''){\n //$userInfo = $this->getEmployeeInfo( null, $request->users);\n\n $year = $request->year?$request->year:date(\"Y\");\n\n $data['user_id'] = $request->users;\n $data['year'] = $year;\n $data['leave_policys'] = self::getLeavePolicy($year,$request->users);\n\n $data['report_title'] = 'Leave Report - '. $year;\n $data['filename'] = 'leave_report_pdf';\n $data['orientation'] = \"P\";\n $data['branch_address'] = getUserInfoFromId(Auth::user()->id)->address;\n $data['signatures']=['Prepared by','Checked by','Approved by'];\n $view='HR.leave_report.leave_report_pdf';\n PdfHelper::exportPdf($view,$data);\n }else if(!empty($data['post_data'])){\n $data['emp_info'] = employeeInfo($request->users);\n $data['leave_summery'] = $this->getEmployeeLeaveInfo($request->users,'');\n }\n\n return view('HR.leave_report.leave_report', $data);\n\n }", "public function payments_due_report_pdf() {\n $tenant_id = $this->tenant_id;\n $executive = array('' => 'Select');\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n $salesexec = $this->input->get('salesexec');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_due($tenant_id, NULL, NULL, $field, $order_by, $salesexec, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $invs = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $invs[] = $tabledata[$i]->invoice_id;\n }\n $tb_recd = $this->reportsModel->get_payment_recd_sum($invs);\n $tabledatarecd = array();\n for ($i = 0; $i < count($tb_recd); $i++) {\n $tabledatarecd[$tb_recd[$i]->invoice_id] = $tb_recd[$i]->amount_recd;\n }\n $tb_refund = $this->reportsModel->get_payment_refund_sum($invs);\n $tabledatarefund = array();\n for ($i = 0; $i < count($tb_refund); $i++) {\n $tabledatarefund[$tb_refund[$i]->invoice_id] = $tb_refund[$i]->amount_refund;\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return payments_due_report_pdf($tabledatarefund, $tabledatarecd, $tabledata, $tenant_details, $executive);\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course AND Exam_Remark IS NULL\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course AND Exam_Remark IS NULL\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "public function booking_acknowledge_company_pdf($trainee_ids, $class_id, $company) \n {\n $tenant_id = $this->tenant_id;\n $trainee_allid = explode('-', $trainee_ids);\n $tr_count = 0;\n foreach ($trainee_allid as $row) {\n $trainee_id = $row;\n $trainee_name = $this->classtraineemodel->get_trainee_name('', '', $row, $tenant_id);\n $name = $trainee_name->first . ' ' . $trainee_name->last;\n $trainee_names = ($trainee_name->gender == 'MALE') ? 'Mr.' . $name : 'Ms.' . $name;\n $trainee .=$trainee_names . ', ';\n $tr_count++;\n }\n $trainee = rtrim($trainee, ', ');\n\n $company_details = $this->company->get_company_details($tenant_id, $company);\n $classes = $this->class->get_class_details($tenant_id, $class_id);\n $ClassLoc = $this->get_classroom_location($classes->classroom_location, $classes->classroom_venue_oth);\n $courses = $this->course->get_course_detailse($classes->course_id);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $courseLevel = rtrim($this->course->get_metadata_on_parameter_id($courses->certi_level), ', ');\n $data = ''; \n if ($tr_count > 0) {\n $contact_details = '';\n if($tenant_details->tenant_id =='T12')\n {\n if (!empty($tenant_details->contact_name))\n {\n $contact_details .=$tenant_details->contact_name . ' ';\n }\n }\n\nif (!empty($tenant_details->tenant_contact_num)) {\n $contact_details .='(Phone: ' . $tenant_details->tenant_contact_num . ', ';\n }\n if (!empty($tenant_details->tenant_email_id)) {\n $contact_details .='Email Id: ' . $tenant_details->tenant_email_id . ')';\n }\n $contact_details = rtrim($contact_details, ', ');\n if ($company[0] == 'T') {\n $company_details->company_name = $tenant_details->tenant_name;\n }\n \n /* skm code start for remark. reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($classes->class_start_datetime);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($classes->course_id == 67 || $classes->course_id == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n if($tenant_details->tenant_id == 'T02')\n {\n $li2 = \"<li>In the event of unforeseen circumstances (example: SkillsFuture Credit website is down for maintenance, etc), Cash payment has to be collected from Candidate and Xprienz Pte Ltd will assist in making the appeal for them.</li>\";\n } else {\n $li2 = '';\n } \n ///// added by shubhranshu for wablab points\n if($tenant_details->tenant_id == 'T20' || $tenant_details->tenant_id == 'T17'){\n $li_first = \"<li>Your NRIC, work permit or will be photocopied on the class date</li>\";\n }else{\n $li_first =\"<li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\";\n }\n $message3 = '\n <ol style=\"font-size:13px;color:#4f4b4b\">\n '.$li_first.'\n \n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n '.$li2.'\n </ol>';\n \n /* skm end */\n \n $data = '<br><br>\n <table style=\"font-size:15px\">\n <tr>\n <td>'.$tr_count . ' Seats for your company ' . $company_details->company_name . ' has been booked. Booking details for your employees: \n ' . $trainee . ' for \\'Course: <b>' . $courses->crse_name . '</b>, Class: <b>' . $classes->class_name . '</b>, Certificate Code: ' . $courseLevel . '\\'<br><br>\n <strong>Class start date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_start_datetime)) . '\n <br>\n <br>\n <strong>Class end date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_end_datetime)) . '\n <br>\n <br>\n \n <strong>Location: </strong>\n ' . $ClassLoc . '<br><br>\n <strong>Contact Details: </strong>\n ' . $contact_details. '<br><br>\n <strong>Remark: </strong>\n ' . $message3.'</td>\n </tr>\n </table>';\n }\n $booking_details = $this->classtraineemodel->get_paydue_invoice($trainee_id, $class_id);\n if ($booking_details) {\n $booking_no = date('Y', strtotime($booking_details->inv_date)) . ' ' . $booking_details->invoice_id;\n $booking_date = date('d/m/Y', strtotime($booking_details->inv_date));\n } else {\n $booking_no = date('Y') . ' ' . $trainee_id;\n $booking_date = date('d/m/Y');\n }\n $this->load->helper('pdf_reports_helper');\n generate_booking_acknowledge_pdf($data, $tenant_details, $booking_no, $booking_date);\n }", "public function actionMedicalvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t// rendering the layout\n\t\t\t$this->layout = 'main';\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$company_detals = array ();\n\t\t\t$company_validation = array ();\n\t\t\t$error_medical_classes = array ();\n\t\t\t$arr_medical_individual_issues = array ();\n\t\t\t$medical_period_issues = array();\n\t\t\t$medical_validation_issues = array();\n\t\t\t$top_ten_employee_id = array();\n\t\t\t\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\tif (! empty ( $encrypt_company_id )) {\n\t\t\t\t\t\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t \n\t\t\t\t\t// / get the company details\n\t\t\t\t\t$company_detals = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// checking if the validation starts for this company\n\t\t\t\t\t\n\t\t\t\t\t$company_validation = TblAcaCompanyValidationStatus::find ()->where ( [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_initialized' => 1 \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_completed' => 0 \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination ***********************/\t\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t } else {\n\t\t\t\t\t \t$page=1; \n\t\t\t\t\t }\n\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t**/\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_validation = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($medical_validation as $medical_validation){\n\t\t\t\t\t\t$medical_validation_issues[$i] = $medical_validation['employee_id'];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_enrollment_period_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_period = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$j=0;\n\t\t\t\t\tforeach($medical_period as $medical_period){\n\t\t\t\t\t\t$medical_period_issues[$j] = $medical_period['employee_id'];\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// combining both the issue arrays to combine all the employee ids\t\t\t\t\t\n\t\t\t\t\t$issues_array = array_merge($medical_validation_issues,$medical_period_issues);\n\t\t\t\t\n\t\t\t\t\t// get the unique employee ids\n\t\t\t\t\t$final_employee_ids_array = array_unique($issues_array);\n\t\t\t\t\t$final_employee_ids_array = array_values($final_employee_ids_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(count($final_employee_ids_array)> 10){\n\n\t\t\t\t\t\t//pagination\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=$start_from;$i<($start_from+10);$i++){\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($i<count($final_employee_ids_array)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\tif(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=0;$i<count($final_employee_ids_array);$i++){\n\t\t\t\t\t\t\t//if(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$medical_details = ArrayHelper::index(TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id\n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t//ArrayHelper::map($array, 'id', 'name')\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for individual payroll data\n\t\t\t\t\t$error_individual_medical = ArrayHelper::index(TblAcaMedicalValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for period payroll data\n\t\t\t\t\t$error_individual_medical_period = ArrayHelper::index(TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\tif(!empty($medical_details))\t\t\n\t\t\t\t\t{\t\t//print_r($issue_count);\t\t\t\n\t\t\t\t\tforeach($medical_details as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$employee_id = \t$key;\n\t\t\t\t\t\t$medical_issue = '';\n\t\t\t\t\t\t$medical_period_issue = '';\n\t\t\t\t\t\tif(!empty($error_individual_medical[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_issue = $error_individual_medical[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($error_individual_medical_period[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_period_issue = $error_individual_medical_period[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = $medical_issue+ $medical_period_issue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count != 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $employee_id );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t'medical_firstname' => $value['first_name'],\n\t\t\t\t\t\t\t\t'medical_lastname' => $value['last_name'],\n\t\t\t\t\t\t\t\t'medical_middlename' => $value['middle_name'],\n\t\t\t\t\t\t\t\t'medical_ssn' => $value['ssn'],\n\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination **********************\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$page=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t*\n\t\t\t\t\t$medical_validation = TblAcaMedicalValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] = count($medical_validation);\n\t\t\t\t\t\n\t\t\t\t\t$medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] += count($medical_period);\n\t\t\t\t\t//print_r($arr_validations ['medical_data_validation']);die();\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t \n\t\t\t\t\tif($arr_validations ['medical_data_validation']>10){\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )\n\t\t\t\t\t\t->offset($start_from)\n\t\t\t\t\t\t->limit($num_rec_per_page)\n\t\t\t\t\t\t\n\t\t\t\t\t\t->All ();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//////// using for pagination\n\t\t\t\t\t$error_medical_classes_count = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->count ();\n\t\t\t\t\t//$searchModel = new TblAcaMedicalErrorSearch();\n\t\t\t\t\t\n\t\t\t\t\t// get the individual payroll employee details\n\t\t\t\t\tforeach ( $error_medical_classes as $error_medical_class ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$medical_details = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for individual medical data\n\t\t\t\t\t\t$error_individual_medical = TblAcaMedicalValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for period medical data\n\t\t\t\t\t\t$error_individual_medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->Count ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = count ( $error_individual_medical );\n\t\t\t\t\t\t$issue_count += $error_individual_medical_period;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count > 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $error_medical_class->employee_id );\n\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_lastname' => $medical_details->last_name,\n\t\t\t\t\t\t\t\t\t'medical_middlename' => $medical_details->middle_name,\n\t\t\t\t\t\t\t\t\t'medical_ssn' => $medical_details->ssn,\n\t\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t*/\n\t\t\t\t\t//print_r($arr_medical_individual_issues);die();\n\t\t\t\t\t\t//$dataProvider = $searchModel->search($arr_medical_individual_issues); //dataProvider for grid \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($arr_medical_individual_issues)){\n\t\t\treturn $this->render ( 'medicalvalidation', array (\n\t\t\t\t\t'company_detals' => $company_detals,\n\t\t\t\t\t//'dataProvider'=>$dataProvider,\n\t\t\t\t\t//'searchModel'=>$searchModel,\n\t\t\t\t\t'company_validation' => $company_validation,\n\t\t\t\t\t'encoded_company_id' => $_GET ['c_id'],\n\t\t\t\t\t'arr_medical_individual_issues' => $arr_medical_individual_issues,\n\t\t\t\t\t'total_issue_count' => count($final_employee_ids_array),\n\t\t\t\t\t'error_medical_classes_count' => count($final_employee_ids_array)\n\t\t\t) );\n\t\t\t\n\t\t\t}else{\n\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t'/client/validateforms?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t) );\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function dayDetailsPdf() {\n check_access($this->session->userdata('role_id'),3);\n \n\t\tif($this->uri->segment(4)!=\"\"){\n\t\t\t$day_id = $this->uri->segment(4);\n\t\t}else if($this->session->userdata('day_id')){\n\t\t\t$day_id = $this->session->userdata('day_id');\n\t\t}\n\t\tif($day_id==\"\"){\n\t\t\tredirect(base_url().'admin/day/listing');\n\t\t}\n\t\t$data = array();\n\t\t$day = $this->day_model->getDay($day_id);\n\t\t$daydetails = $this->day_model->getDayDetails($day_id);\n\t\t$data['title'] = \"Day Details Pdf\";\n\t\t$data['day_id'] = $day_id;\n\t\t$data['day'] = $day;\n\t\t$data['daydetails'] = $daydetails;\n\t\t$this->pdf->loadHtml($this->load->view('dailyReport',$data, TRUE));\n\t\t$this->pdf->render();\n\t\t$this->pdf->stream(\"Day_details_\".$day_id.\".pdf\", array(\"Attachment\"=>0));\n\t}", "function genrate_inspectorpaymenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name) {\n\t\n\t\t$columnwidtharrays = array(10,24,26,26,28,26,25,24);\n\t\t\n\t\t$heightdynamic = 12;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 7);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_assessment_no = \t$val['AssessmentVehicleMaster']['vc_assessment_no'];\n\t\t $vc_customer_name=\t\t$val['AssessmentVehicleMaster']['vc_customer_name'];\n\t\t $dt_assessment_date=\tdate('d-M-y', strtotime($val['AssessmentVehicleMaster']['dt_assessment_date']));\n\t\t $nu_total_payable_amount= number_format($val['AssessmentVehicleMaster']['nu_total_payable_amount'],2,'.',',');\n\t\t $vc_mdc_paid=\t\t\tnumber_format($val['AssessmentVehicleMaster']['vc_mdc_paid'],2,'.',',');\n\t\t\t$dt_received_date = \tdate('d M Y', strtotime($val['AssessmentVehicleMaster']['dt_received_date']));\n\t\t $vc_prtype_name = \t\t$val['PaymentStatus']['vc_prtype_name'];\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_assessment_date, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_total_payable_amount, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_mdc_paid, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_received_date, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "public function actionCreate() {\n if (Yii::$app->user->can('school_exam')) {\n $model = new SchoolExamMarks();\n\n $classList = ArrayHelper::map(Classes::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'name');\n $subclassList = ArrayHelper::map(Subclass::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'sub_class');\n $semesterList = ArrayHelper::map(SchoolExamSemester::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'semester');\n $divisionList = ArrayHelper::map(Division::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'division');\n $subjectList = ArrayHelper::map(SchoolSubject::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'name_en');\n $standardList = ArrayHelper::map(SchoolExam::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'standard');\n\n $yearList = [];\n\n for ($i = 1430; $i <= 1600; $i++) {\n $yearList[$i] = $i;\n }\n\n if ($model->load(Yii::$app->request->post())) {\n return $this->redirect(['enter-marks', 'year' => $model->year, 'class_id' => $model->class_id, 'subclass_id' => $model->subclass_id, 'division_id' => $model->division_id, 'standard_id' => $model->standard_id, 'semester_id' => $model->semester_id, 'subject_id' => $model->subject_id]);\n //return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'classList' => $classList,\n 'subclassList' => $subclassList,\n 'semesterList' => $semesterList,\n 'yearList' => $yearList,\n 'divisionList' => $divisionList,\n 'standardList' => $standardList,\n 'subjectList' => $subjectList,\n ]);\n }\n } else {\n throw new ForbiddenHttpException;\n }\n }", "public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')\n {\n $attendance = new Attendance();\n $courseInfo = CourseManager::get_course_information($course_id);\n $attendance->set_course_id($courseInfo['code']);\n $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;\n $data_array = array();\n $data_array['attendance_id'] = $attendance_id;\n $data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);\n\n $filter_type = 'today';\n\n if (!empty($_REQUEST['filter'])) {\n $filter_type = $_REQUEST['filter'];\n }\n\n $my_calendar_id = null;\n if (is_numeric($filter_type)) {\n $my_calendar_id = $filter_type;\n $filter_type = 'calendar_id';\n }\n\n $data_array['attendant_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n $filter_type,\n $my_calendar_id,\n $groupId\n );\n\n if (api_is_allowed_to_edit(null, true) || api_is_drh()) {\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, 0, $groupId);\n } else {\n if (!empty($student_id)) {\n $user_id = intval($student_id);\n } else {\n $user_id = api_get_user_id();\n }\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id, $groupId);\n $data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id, $groupId);\n $data_array['user_id'] = $user_id;\n }\n\n $data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);\n\n // Set headers pdf.\n $courseCategory = CourseManager::get_course_category($courseInfo['category_code']);\n $teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);\n $teacherName = null;\n foreach ($teacherInfo as $teacherData) {\n if ($teacherName != null) {\n $teacherName = $teacherName.\" / \";\n }\n $teacherName .= api_get_person_name($teacherData['firstname'], $teacherData['lastname']);\n }\n\n // Get data table\n $data_table = array();\n $head_table = array('#', get_lang('Name'));\n foreach ($data_array['attendant_calendar'] as $class_day) {\n $head_table[] =\n api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR).' '.\n api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);\n }\n $data_table[] = $head_table;\n $data_attendant_calendar = $data_array['attendant_calendar'];\n $data_users_presence = $data_array['users_presence'];\n $count = 1;\n\n if (!empty($data_array['users_in_course'])) {\n foreach ($data_array['users_in_course'] as $user) {\n $cols = 1;\n $result = array();\n $result['count'] = $count;\n $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);\n foreach ($data_array['attendant_calendar'] as $class_day) {\n if ($class_day['done_attendance'] == 1) {\n if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {\n $result[$class_day['id']] = get_lang('UserAttendedSymbol');\n } else {\n $result[$class_day['id']] = '<span style=\"color:red\">'.get_lang('UserNotAttendedSymbol').'</span>';\n }\n } else {\n $result[$class_day['id']] = ' ';\n }\n $cols++;\n }\n $count++;\n $data_table[] = $result;\n }\n }\n $max_cols_per_page = 12; //10 dates + 2 name and number\n $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10\n $rows = count($data_table);\n\n if ($cols > $max_cols_per_page) {\n $number_tables = round(($cols-2)/$max_dates_per_page);\n $headers = $data_table[0];\n $all = array();\n $tables = array();\n $changed = 1;\n\n for ($i= 0; $i <= $rows; $i++) {\n $row = isset($data_table[$i]) ? $data_table[$i] : null;\n $key = 1;\n $max_dates_per_page = 10;\n $item = isset($data_table[$i]) ? $data_table[$i] : null;\n $count_j = 0;\n\n if (!empty($item)) {\n foreach ($item as $value) {\n if ($count_j >= $max_dates_per_page) {\n $key++;\n $max_dates_per_page = $max_dates_per_page_original*$key;\n //magic hack\n $tables[$key][$i][] = $tables[1][$i][0];\n $tables[$key][$i][] = $tables[1][$i][1];\n }\n $tables[$key][$i][] = $value;\n $count_j++;\n }\n }\n }\n\n $content = null;\n if (!empty($tables)) {\n foreach ($tables as $sub_table) {\n $content .= Export::convert_array_to_html($sub_table).'<br /><br />';\n }\n }\n } else {\n $content = Export::convert_array_to_html(\n $data_table,\n array('header_attributes' => array('align' => 'center'))\n );\n }\n\n $params = array(\n 'filename' => get_lang('Attendance').'-'.api_get_local_time(),\n 'pdf_title' => $courseInfo['title'],\n 'course_code' => $courseInfo['code'],\n 'add_signatures' => true,\n 'orientation' => 'landscape',\n 'pdf_teachers' => $teacherName,\n 'pdf_course_category' => $courseCategory['name'],\n 'format' => 'A4-L',\n 'orientation' => 'L'\n );\n\n Export::export_html_to_pdf($content, $params);\n exit;\n }", "public function midreportcreate() {\n $supervisaornames = DB::select(\"SELECT name,id \n\t\t FROM panelmembers\n\t\t WHERE id = any (SELECT supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* Get all group ids */\n $groupids = DB::select(\"SELECT groupID \n\t\t FROM research_groups\");\n\n /* Get all student actual id acording to the auto generated id */\n $studentid = DB::select(\"SELECT id,regId \n\t\t FROM students\n\t\t WHERE id = any (SELECT studentId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* filtering projects according to the groups */\n $students = DB::select(\"SELECT id,title,studentId,supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved' and groupID = any (SELECT groupID \n\t\t FROM research_groups)\");\n\n $los = DB::table('settings')->first();\n\n return view('supevaluation.midreportevaluation', compact('students', 'supervisaornames', 'studentid', 'groupids', 'los'));\n }", "public function ctrreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t\t$productname='本周'.$productname;\t\t\t\t \n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_name . time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('ctrreports') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function getReports()\n\t{\n\t\t$this->load->model('admin/inceptra_admin_model');\n\t\t$res=$this->inceptra_admin_model->get_report();\n\t\t\n\t\t$this->load->helper('file'); \n\t\t$this->load->helper(array('dompdf', 'file'));\n\t\t$head=\"LIST OF Candidates and there Marks\";\n\t\t$html=\"<center><h3>\".$head.\"</h3></center><br/>\";\n\t\t\t\t\n\t\t$html.='<center><table width=\"600\">';\n\t\t$html.='<tr><th align=\"left\">Username</th><th align=\"left\">Multichoice</th><th align=\"left\">Pickup1</th><th align=\"left\">Pickup2</th><th align=\"left\">Match Catch</th><th align=\"left\">Toal Marks</th></tr>';\n\t\tforeach($res as $r)\n\t\t{\n\t\t$html.='<tr><td>'.$r->r_id.'</td><td>'.$r->username.'</td><td>'.$r->multichoice.'</td><td>'.$r->pickup1marks.'</td><td>'.$r->pickup2marks.'</td><td>'.$r->matchcatch.'</td><td>'.$r->totalmarks.'</td></tr>';\n\t\t\n\t\t}\n\t\t$html.='</table></center>';\n\t\t\t\t\n \tpdf_create($html, 'pdfreport');\n write_file('name', $data);\n\t}", "public function actionOutputIndex()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t\n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n\t\t// var_dump($result);exit;\n $arr = [];\n $ic = 1; \n foreach($result as $r) {\n\t\t\t$r['signtime1'] = $r[\"signtime1\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime1\"];\n\t\t\t$r['signtime2'] = $r[\"signtime2\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime2\"];\n\t\t\t\n\t\t\t\n\t\t\t$r['signstatus'] = $r['signstatus_valid']?:$r['signstatus'];\n\t\t\t$r['latetime'] = $r['latetime']-$r['latetime_valid'];\n\t\t\t$r['overtime'] = $r['overtime_valid'];\n $arr[] = $r;\n }\n\t\t$header = [\n 'id' => 'ID',\n 'personnel_id' => '员工ID',\n 'employeeid' => '工号',\n 'username' => '员工姓名',\n 'signdate' => '签到日期',\n 'dayofweek' => '星期几',\n 'signtime1' => '上班签到',\n 'signtime2' => '下班签到',\n 'timediff' => '工作时长',\n 'signstatus' => '签到状态',\n 'latetime' => '迟到分钟',\n 'overtime' => '加班时长',\n 'memo' => '备注',\n ];\n\t\t$columns = array_keys($header);\n\t\t\n\t\t \n \\moonland\\phpexcel\\Excel::export([\n\t\t\t'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤报表' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤报表' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤报表' => $header, \n\t\t\t],\n ]);\n }", "function export_report()\n {\n // load csv generator library\n $this->load->library('csvgenerator');\n \n // get current session data \n $session_data = $this->session->userdata('logged_in');\n\n // get filter criteria from post input\n $data = array(\n 'risk_register' => $this->input->post('risk_register'),\n 'user_id' => $this->input->post('general_user'),\n 'project_id' => $session_data['report_project_id']\n );\n\n if ($session_data['role_id'] == 8)\n {\n // get assigned risk register and its ID\n $register_row = $this->project_model->getAssignedRiskRegisterName($data['user_id']);\n $assigned_register_id = $register_row->subproject_id;\n $this->csvgenerator->fetch_data( $user_id, $main_category, $risk_level, $risk_register, $assigned_register_id );\n }\n else\n {\n if($this->csvgenerator->fetch_response_data($data))\n {\n redirect('dashboard/report_response/generate'); \n }\n else\n {\n // error\n $this->session->set_flashdata('negative_msg','Sorry. No report or data for the selected data filter!');\n redirect('dashboard/reports/response_project');\n }\n } \n }", "function glReport() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n if ($_POST['type'] == \"pdf\") {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $data['report_table_data'] = $glExportReportData['report_table_data'];\n\n $pdfFileName = \"Webservice_Report\";\n $reportHTML = $this->load->view(\"webservice_report_view\", $data, TRUE);\n downloadhtmltopdf($reportHTML, $pdfFileName);\n } else {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $report_data = $glExportReportData['report_table_data'];\n $grand_total = $passeggero_start = $passeggero_si_start = 0;\n $exportData = array();\n $prev_codice_prodotto = '';\n foreach ($report_data as $rdata) {\n $passeggero_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_start;\n $passeggero_si_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_si_start;\n\n if ($rdata['codice_prodotto'] != 'Total') {\n if ($rdata['pax'] > 1 && ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' )) {\n $passeggero_arr = $this->webservicemodel->getPasseggero($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n for ($i = 0; $i < $rdata['pax']; $i++) {\n $pax = 1;\n $total = $rdata['amount_per_pax'] * $pax;\n $grand_total = $grand_total + $total;\n $pass = isset($passeggero[$passeggero_start])?$passeggero[$passeggero_start]:'';\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $pass,\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $pax,\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $total\n );\n $passeggero_start++;\n }\n } else if ($rdata['type'] == 'GLF') {\n $passeggero_arr = $this->webservicemodel->getPasseggeroSi($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $passeggero[$passeggero_si_start],\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n $passeggero_si_start++;\n } else {\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' ) ? $rdata['passeggero'] : \"\",\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n }\n }\n $prev_codice_prodotto = $rdata['codice_prodotto'];\n }\n if (!empty($exportData)) {\n // Empty row before total\n $exportData[] = array(\n 'Collaboratore' => '',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => ''\n );\n\n $exportData[] = array(\n 'Collaboratore' => 'Total',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => $grand_total\n );\n }\n\n $this->load->library('export');\n $this->export->exportUsingPhpExcel($exportData, 'webserviceglreport');\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n\n $glReportData = $this->_getGlReportData($data['collaboratore'], $data['accompagnatore']);\n $data['reportData'] = $glReportData['report_data'];\n $data['report_table_data'] = $glReportData['report_table_data'];\n $data['report_analysis_data'] = $glReportData['report_analysis_data'];\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n\t\t\t\t\t\t//echo \"<pre>\";print_r($data);die;\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }", "public function view_estatement($seq_no)\n\t{\n\t\t$this->load->model('statement_header_model');\n\t\t// $this->load->library('m_pdf');\n\t\t$this->load->model('transactions_model');\n\t\t$statement = $this->statement_header_model->get_statement($seq_no);\n\t\t$start_date = $statement[0]->START_DATE;\n\t\t$end_date = $statement[0]->END_DATE;\n\t\t// return print $end_date;\n\t\t$internal_key = $statement[0]->INTERNAL_KEY;\n\t\t$data['statement'] = $statement[0];\n\n\t\t// return print_r($statement);\n\t\t$data['transactions'] = $this->transactions_model\n\t\t\t\t->get_trans_history($start_date,$end_date,$internal_key);\n\t\t\n\t\t$data['start_date'] = $this->formatDate($start_date);\n\t\t$data['end_date'] = $this->formatDate($end_date);\n\n\n\t\t// return print_r($data['transactions']);\n\t\treturn $this->render('transactions/view_statement3',$data);\n\t}", "public function Get_Special_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=special&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT DISTINCT `course_id` FROM `course_hire_special_instructor` WHERE `status` = '1' AND `semester_id` = \".$semester_id;\n $result_course = $this->DB->Query($sql);\n if($result_course)\n {\n for($i=0;$i<count($result_course);$i++)\n {\n if(!in_array($result_course[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`cv` FROM `course_hire_special_instructor` ci ,`special_instructor` si \";\n $sql.= \"WHERE ci.`instructor_id` = si.`instructor_id` AND ci.`course_id` = '\".$result_course[$i]['course_id'].\"' AND ci.`status` = '1' AND ci.`semester_id` = \".$semester_id;\n $result_instructor = $this->DB->Query($sql);\n $data = array();\n $data['id'] = $result_course[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['special'] = array();\n if($result_instructor)\n {\n for($j=0;$j<count($result_instructor);$j++)\n {\n $instructor['id'] = $result_instructor[$j]['instructor_id'];\n $instructor['name'] = $result_instructor[$j]['prefix'].' '.$result_instructor[$j]['firstname'].' '.$result_instructor[$j]['lastname'];\n $instructor['cv'] = $this->PERSON->Get_CV($instructor['id']);\n $instructor['pdf'] = $this->VIEW_URL.\"?course=\".$data['id'].\"&id=\".$instructor['id'].\"&type=complete&info=special&semester=\".$semester.\"&year=\".$year;\n array_push($data['special'],$instructor);\n }\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n }", "public function actionCreate() {\n if (User::userIsAllowedTo('Submit back to office report')) {\n $model = new MeBackToOfficeReport();\n if (Yii::$app->request->isAjax) {\n $model->load(Yii::$app->request->post());\n return Json::encode(\\yii\\widgets\\ActiveForm::validate($model));\n }\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit_for_review') == 'true') {\n //var_dump(Yii::$app->request->post());\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = \\backend\\models\\Storyofchange::_submitted_for_review;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Submitted a back to office report for review\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n $role_model = \\common\\models\\RightAllocation::find()->where(['right' => 'Review back to office report'])->all();\n if (!empty($role_model)) {\n $subject = \"Back to office report:\" . $model->name_of_officer;\n foreach ($role_model as $_role) {\n //We now get all users with the fetched role\n $resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/login']);\n $_user_model = User::find()\n ->where(['role' => $_role->role])\n ->all();\n if (!empty($_user_model)) {\n //We send the emails\n foreach ($_user_model as $_model) {\n $msg = \"\";\n $msg .= \"<p>Dear \" . $_model->first_name . \" \" . $_model->other_name . \" \" . $_model->last_name . \",<br/>\";\n $msg .= $model->name_of_officer . \" has submitted a 'Back to office report' below is the summary of the assignment outcome<br/>\";\n $msg .= $model->summary_of_assignment_outcomes . \"</b></p>\";\n $msg .= '<p>You can login <i style=\"color: blue;\">' . Html::a('(Click Here to Login)', $resetLink) . '</i> to see more details and review the submitted BtOR</p>';\n \\backend\\models\\Storyofchange::sendEmail($msg, $subject, $_model->email);\n }\n }\n }\n }\n\n Yii::$app->session->setFlash('success', 'Back to office report was successfully submitted for review');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while submitting back to office report for review.Error::' . $message);\n }\n }\n\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit for review') != 'true') {\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = 0;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Saved back to office report as draft\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n Yii::$app->session->setFlash('success', 'Back to office report was successfully saved as a draft');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while saving back to office report.Error::' . $message);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }", "function create_course_subject(){\n\n\t\t$Input_course_id =$this->input->post('course');\n\n\t\t$course_data =$this->setting_model->Get_All('course');\n\n\t\tforeach ($course_data as $data) {\n\t\t\tif($data['course_id'] == $Input_course_id){\n\t\t\t\t$course_title =$data['course_title'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$courses_modules= array(\n\t\t\t'module_subjects' => implode(\" \", $this->input->post('myInputs')),\n\t\t\t'course_id' => $this->input->post('course'),\n\t\t);\t\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses subjects for\".$course_title; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\n\t\t$this->setting_model->insert($courses_modules,'course_module_subject');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Course Subjects Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_subject');\n\t}", "public function finalreportcreate() {\n $supervisaornames = DB::select(\"SELECT name,id \n\t\t FROM panelmembers\n\t\t WHERE id = any (SELECT supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* Get all group ids */\n $groupids = DB::select(\"SELECT groupID \n\t\t FROM research_groups\");\n\n /* Get all student actual id acording to the auto generated id */\n $studentid = DB::select(\"SELECT id,regId \n\t\t FROM students\n\t\t WHERE id = any (SELECT studentId \n\t\t FROM projects\n\t\t WHERE status = 'Approved')\");\n\n /* filtering projects according to the groups */\n $students = DB::select(\"SELECT id,title,studentId,supervisorId \n\t\t FROM projects\n\t\t WHERE status = 'Approved' and groupID = any (SELECT groupID \n\t\t FROM research_groups)\");\n\n $los = DB::table('settings')->first();\n\n return view('supevaluation.finalreportevaluation', compact('students', 'supervisaornames', 'studentid', 'groupids', 'los'));\n }", "public function achievementsReport() {\n if (userLogedIn()) {\n if(check_access('achievementsReport')){\n $fromDate = date(\"Y-m-d\", strtotime(\"first day of this month\"));\n if (isset($_POST['fromDate'])) {\n $date = explode('/', $this->input->post('repDate'));\n $day = $date[1];\n $month = $date[0];\n $year = $date[2];\n $fromDate = $year . '-' . $month . '-' . $day;\n }\n $data['get_target'] = $this->admin_model->get_target($fromDate);\n \n $date = explode('-', $fromDate);\n $day = $date[2];\n $month = $date[1];\n $year = $date[0];\n $fromDate = $month . '/' . $day . '/' . $year;\n $data['fromDate'] = $fromDate;\n \n $this->load->view(\"admin/achievementsReport\", $data);\n \n }\n \n \n else{\n $url=$this->router->fetch_class().'/'.$this->router->fetch_method(); \n // echo $url;\n myLoader('No Access', 'home/login');\n }\n } else {\n $this->load->view('admin/login');\n }\n }", "public function index()\n\t{\n\t\tif(isset($_GET['id_report'])==true)\n\t\t{\t\t\t\t\n\t\t\t$k = 0;\n\t\t\t$id_report=\"\";\n\t\t\tif(isset($_GET['id'])==true)\n\t\t\t{\t\t\t\t\n\t\t\t\t$query = $this->db->query(\"SELECT id_report, nodoc2, letter, DATE_FORMAT(created_date,'%d-%M-%Y') as created_date, DATE_FORMAT(letter_date,'%d/%m/%Y') as letter_date, event_name, event_venue, event_institution, doctor, event_address, event_start_time, event_end_time, DATE_FORMAT(event_start_date,'%d/%m/%Y') as event_start_date, DATE_FORMAT(event_end_date,'%d/%m/%Y') as event_end_date FROM thank_letter2 where id_tl=\".$_GET['id']);\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$id_report = $row2->id_report;\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'event_organizer' => $row2->event_institution,\n\t\t\t\t\t\t'event_address' => $row2->event_address,\n\t\t\t\t\t\t'event_name' => $row2->event_name,\n\t\t\t\t\t\t'nodoc2' => $row2->nodoc2,\n\t\t\t\t\t\t'letter_date' => $row2->letter_date,\n\t\t\t\t\t\t'created_date' => $row2->created_date,\n\t\t\t\t\t\t'letter' => $row2->letter,\n\t\t\t\t\t\t'event_start_date' => $row2->event_start_date,\n\t\t\t\t\t\t'event_end_date' => $row2->event_end_date,\n\t\t\t\t\t\t'event_start_time' => $row2->event_start_time,\n\t\t\t\t\t\t'event_end_time' => $row2->event_end_time,\n\t\t\t\t\t\t'event_venue' => $row2->event_venue\n\t\t\t\t\t);\n\t\t\t\t\t$k = $k+1;\n\t\t\t\t}\n//\t\t\t\t$this->load->view('thank-letter2',$data);\n\t\t\t}\t\n\n\t\t\tif($k==0)\n\t\t\t{\n\t\t\t\t$nodoc = \"0001\";\t\n\t\t\t\t$max = 0;\n\t\t\t\t$max2 = 0;\n\t\t\t\t$max3 = 0;\n\t\t\t\t$query = $this->db->query(\"select max(nodoc2)+1 as nodoc from thank_letter where year='\".date(\"Y\").\"'\");\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$max = $row2->nodoc;\n\t\t\t\t}\n\t\t\t\tif($max==null)\t$max=0;\n\t\t\t\t$query = $this->db->query(\"select max(nodoc2)+1 as nodoc from thank_letter3 where year='\".date(\"Y\").\"'\");\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$max2 = $row2->nodoc;\n\t\t\t\t}\n\t\t\t\tif($max2==null)\t$max2=0;\n\t\t\t\t$query = $this->db->query(\"select max(nodoc2)+1 as nodoc from thank_letter2 where year='\".date(\"Y\").\"'\");\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$max3 = $row2->nodoc;\n\t\t\t\t}\n\t\t\t\tif($max3==null)\t$max3=0;\n//\t\t\t\tif($max>0 && $max2>0)\n\t\t\t\tif($max==0 && $max2==0 && $max3==0)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\t\n\t\t\t\t{\n\t\t\t\t\tif($max<$max3 && $max2<$max3)\n\t\t\t\t\t{\n\t\t\t\t\t\t$nodoc = str_pad($max3,4,\"0\",STR_PAD_LEFT);\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\telse if($max2<$max && $max3<$max)\n\t\t\t\t\t{\n\t\t\t\t\t\t$nodoc = str_pad($max,4,\"0\",STR_PAD_LEFT);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$nodoc = str_pad($max2,4,\"0\",STR_PAD_LEFT);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\t\t\t\t$k=0;\t\n\n\t\t\t\t$query = $this->db->query(\"SELECT a.event_organizer, a.nodoc2, a.event_name, a.event_venue, DATE_FORMAT(event_start_date,'%d/%m/%Y') as event_start_date, DATE_FORMAT(event_end_date,'%d/%m/%Y') as event_end_date FROM hco_report a, hco b where a.id_hco=b.id_hco and a.id_report=\".$_GET['id_report']);\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'event_organizer' => $row2->event_organizer,\n\t\t\t\t\t\t'event_address' => \"\",\n\t\t\t\t\t\t'event_name' => $row2->event_name,\n\t\t\t\t\t\t'doctor' => \"\",\n\t\t\t\t\t\t'event_start_date' => $row2->event_start_date,\n\t\t\t\t\t\t'event_end_date' => $row2->event_end_date,\n\t\t\t\t\t\t'created_date' => date(\"d-M-Y\"),\n\t\t\t\t\t\t'nodoc2' => $nodoc,\n\t\t\t\t\t\t'event_start_time' => \"\",\n\t\t\t\t\t\t'letter_date' => \"\",\n\t\t\t\t\t\t'letter' => \"\",\n\t\t\t\t\t\t'event_end_time' => \"\",\n\t\t\t\t\t\t'event_venue' => $row2->event_venue\n\t\t\t\t\t);\n\t\t\t\t\t$k = $k+1;\n\t\t\t\t}\n\n\t\t\t}\t\n\t\t\t\t$jumlah = 0;\n\t\t\t\t$query = $this->db->query(\"select count(*) as jumlah from menu a, menu_group b where a.id_menu=b.id_menu and replace(page,'List','')='\".$this->uri->segment(1).\"' and (id_group like '\".$this->session->userdata('id_group').\",%' or id_group like '%,\".$this->session->userdata('id_group').\"' or id_group like '%,\".$this->session->userdata('id_group').\",%' or id_group='\".$this->session->userdata('id_group').\"')\");\n\t\t\t\tforeach ($query->result() as $row2)\n\t\t\t\t{\n\t\t\t\t\t$jumlah = $row2->jumlah;\n\t\t\t\t\tif($jumlah==0 && isset($_GET['access']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query2 = $this->db->query(\"select count(*) as jumlah from menu a, menu_group b where a.id_menu=b.id_menu and replace(page,'List','')='\".$this->uri->segment(1).\"' and (id_group like '\".$_GET['access'].\",%' or id_group like '%,\".$_GET['access'].\"' or id_group like '%,\".$_GET['access'].\",%' or id_group='\".$_GET['access'].\"')\");\n\t\t\t\t\t\tforeach ($query2->result() as $row3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$jumlah = $row3->jumlah;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(!$this->session->userdata('id_group') && !isset($_GET['access']))\n\t\t\t\t{\n\t\t\t\t\t$this->load->view('login');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\n\t\t\t\t\tif($jumlah==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->load->view('thank-letter2',$data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->load->view('info2');\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\t\n\t\t}\t\n\t}", "public function actionExamReport() {\n// $modelExam = new Exam;\n// $this->render('examReport', array('modelClassroom'=>$modelClassroom,'modelExam'=>$modelExam));\n $modelClassroom = new Classroom;\n if (isset($_POST['Classroom'])) {\n $modelClassroom->attributes = $_POST['Classroom'];\n }\n\n// trace($modelClassroom->id);\n\n $modelExam = new Exam;\n if (isset($_POST['Exam'])) {\n $modelExam->attributes = $_POST['Exam'];\n }\n $this->render('examReport', array('modelClassroom' => $modelClassroom, 'modelExam' => $modelExam));\n }", "public function Generate_Report()\n\t{\n\t\t//\n\t\t// criteria start_date YYYYMMDD\n\t\t// criteria end_date YYYYMMDD\n\t\t// company_id\n\t\t//\n\t\ttry\n\t\t{\n\t\t\t$this->search_query = new Transaction_History_Report_Query($this->server);\n\n\t\t\t$data = new stdClass();\n\n\t\t\t// Save the report criteria\n\t\t\t$data->search_criteria = array(\n\t\t\t 'specific_date_MM' => $this->request->specific_date_month,\n\t\t\t 'specific_date_DD' => $this->request->specific_date_day,\n\t\t\t 'specific_date_YYYY' => $this->request->specific_date_year,\n\t\t\t 'company_id' => $this->request->company_id,\n\t\t\t 'loan_type' => $this->request->loan_type\n\t\t\t);\n\n\t\t\t$_SESSION['reports']['transaction_history']['report_data'] = new stdClass();\n\t\t\t$_SESSION['reports']['transaction_history']['report_data']->search_criteria = $data->search_criteria;\n\t\t\t$_SESSION['reports']['transaction_history']['url_data'] = array('name' => 'Transaction History', 'link' => '/?module=reporting&mode=transaction_history');\n\n\t\t\t// Start date\n\t\t\t$start_date_YYYY = $this->request->specific_date_year;\n\t\t\t$start_date_MM\t = $this->request->specific_date_month;\n\t\t\t$start_date_DD\t = $this->request->specific_date_day;\n\t\t\tif(!checkdate($start_date_MM, $start_date_DD, $start_date_YYYY))\n\t\t\t{\n\t\t\t\t//return with no data\n\t\t\t\t$data->search_message = \"Start Date invalid or not specified.\";\n\t\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$start_date_YYYYMMDD = 10000 * $start_date_YYYY\t+ 100 * $start_date_MM + $start_date_DD;\n\n\t\t\t$data->search_results = $this->search_query->Fetch_Transaction_History_Data( $start_date_YYYYMMDD,\n\t\t\t\t $this->request->loan_type,\n\t\t\t\t $this->request->company_id);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$data->search_message = \"Unable to execute report. Reporting server may be unavailable.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// we need to prevent client from displaying too large of a result set, otherwise\n\t\t// the PHP memory limit could be exceeded;\n\t\tif(!empty($data->search_results) && count($data->search_results) > $this->max_display_rows)\n\t\t{\n\t\t\t$data->search_message = \"Your report would have more than \" . $this->max_display_rows . \" lines to display. Please narrow the date range.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Sort if necessary\n\t\t$data = $this->Sort_Data($data);\n\n\t\tECash::getTransport()->Add_Levels(\"report_results\");\n\t\tECash::getTransport()->Set_Data($data);\n\t\t$_SESSION['reports']['transaction_history']['report_data'] = $data;\n\t}", "public function sendReportCheckin()\n { // $sended = $this->TBLTSendMail\n // ->exists([\n // 'Date' => date(\"Y-m-d\"),\n // 'Result' => 'success'\n // ]);\n\n // if($sended) { exit; }\n\n $alert = $this->TBLMItem->find()\n ->where([\n 'Code' => 'alert_time',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail1 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_1',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail2 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_2',\n 'Value IS NOT NULL'\n ])\n ->first();\n \n $allow = false;\n if (isset($alert['Value']) && (isset($mail1['Value']) || isset($mail2['Value']))) {\n if ($alert['Value'] == date(\"H:i\")) {\n $allow = true;\n } \n }\n\n // debug\n // $allow = true;\n\n if ($allow) {\n // set_time_limit(0);\n // ini_set(\"memory_limit\", \"-1\");\n // $builder = $this->viewBuilder();\n // // configure as needed\n // $builder->setLayout(false);\n // $builder->setTemplate('/Element/Pdf/ExportResultCheckin');\n // $builder->setHelpers(['Html']);\n // create a view instance\n\n\n $data[\"checked_in\"] = $this->TBLTTimeCard->find()\n ->contain(['TBLMStaff'])\n ->where([\n 'Date' => date(\"Y-m-d\"),\n // 'TimeIn <=' => $alert\n ])\n ->order(['TimeIn' => 'ASC'])\n ->toArray();\n\n $data[\"not_come\"] = $this->TBLMStaff->find()\n ->where([\n \"StaffID NOT IN (SELECT StaffID FROM tblTTimeCard WHERE Date ='\" . date(\"Y-m-d\") . \"')\",\n \"Position LIKE '%Leader%'\",\n \"FlagDelete = 0\"\n ])\n ->order(['StaffID' => 'ASC'])\n ->toArray();\n\n // echo '<pre>';\n // var_dump($data);\n // echo '</pre>';\n // exit;\n\n\n\n // $view = $builder->build(compact('data'));\n // $content = $view->render();\n\n // $dompdf = new Dompdf(array('enable_font_subsetting' => true));\n // $dompdf->loadHtml(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), \"UTF-8\");\n // $dompdf->set_option('defaultFont', 'Times-Roman');\n\n // // (Optional) Setup the paper size and orientation\n // $dompdf->setPaper('A4');\n\n // // Render the HTML as PDF\n // $dompdf->render();\n\n // /* save file */\n // $path = WWW_ROOT . \"files/PdfResultCheckin\";\n // if (!file_exists($path)) {\n // mkdir($path);\n // }\n\n // $fileNameExport = \"ASM SYSTEM \" . date(\"Ymd\") . \" (\" . date(\"D\") . \") \" . date(\"Hi\") . \".pdf\";\n // $output = $path . \"/\" . $fileNameExport;\n\n // $file = $dompdf->output();\n // file_put_contents($output, $file);\n\n // debug\n // exit;\n\n $result_sended = self::__sendFileToMail($data, $mail1['Value'], $mail2['Value']);\n // mails receipt\n $mails_receipt = \"\";\n if ($mail1['Value']) {\n $mails_receipt .= $mail1['Value'];\n }\n\n if ($mail2['Value']) {\n $mails_receipt .= \", \" . $mail2['Value'];\n }\n // result\n $result = \"\";\n if(isset($result_sended['success']) && $result_sended['success'] == 1){\n $result = \"success\";\n } else {\n $result = \"fail\";\n }\n\n // ==> SAVE RESULT TO DB\n $sended = TableRegistry::getTableLocator()->get('TBLTSendMail')->newEntity();\n $sended->Date = date(\"Y-m-d\");\n $sended->Time = date(\"H:i\");\n $sended->ToEmail = $mails_receipt;\n $sended->FileSend = '';\n $sended->Result = $result;\n TableRegistry::getTableLocator()->get('TBLTSendMail')->save($sended);\n\n // ==> WRITE LOG\n $content = \n \"Date: \".date(\"Y-m-d\") . \"\\n\" .\n \"Time: \".date(\"H:i\") . \"\\n\" . \n \"To emails: \" . $mails_receipt .\"\\n\".\n \"Filename attachment: \".'' . \"\\n\" .\n \"Result: \".$result . \"\\n \\n\";\n Log::info($content, ['scope' => ['SENDMAIL']]);\n }\n exit;\n }", "function getMarksheet(){\n \n //get student datails to print in marksheet\n $unique_id1 = $this->session->userdata('unique_id1');\n $session1 = $this->session->userdata('session1');\n $q = $this->db->where('unique_id',$unique_id1)\n ->get('userinfo');\n \n\t if( $q->num_rows()>0 ){\n\t\t\t\t//login valid\n\t\t\t\t$name1 = $q->row('name');\n\t\t\t\t$contact_number1 = $q->row('contact_number');\n\t\t\t\t$city1 = $q->row('city');\n\t\t\t\t$state1 =\t$q->row('state');\n\t\t\t\t$address1 = $q->row('address');\n\t\t\t\t$school_name1 = $q->row('school_name');\n\t\t\t\t$father_name1 = $q->row('father_name');\n\t\t\t\t$enroll_no1 = $q->row('enroll_no');\n\t\t\t\t$class11 = $q->row('class1');\n\t\t\t\t$profile_img_path1 = $q->row('profile_img_path');\n\t\t\t\t$sign_img_path1 = $q->row('sign_img_path');\n\t\t\t\t$parent_sign_path1 = $q->row('parent_sign_path');\n\t\t\t\t$dob1 = $q->row('dob');\n\t\t\t\t$gender1 = $q->row('gender');\n\t\t\t\t$aadhar_no1 = $q->row('aadhar_no');\n\t\t\t\t$section1 = $q->row('section');\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata('name1',$name1);\n\t\t\t\t$this->session->set_userdata('contact_number1',$contact_number1);\n\t\t\t\t$this->session->set_userdata('city1',$city1);\n\t\t\t\t$this->session->set_userdata('state1',$state1);\n\t\t\t\t$this->session->set_userdata('address1',$address1);\n\t\t\t\t$this->session->set_userdata('school_name1',$school_name1);\n\t\t\t\t$this->session->set_userdata('father_name1',$father_name1);\n\t\t\t\t$this->session->set_userdata('enroll_no1',$enroll_no1);\n\t\t\t\t$this->session->set_userdata('class11',$class11);\n\t\t\t\t$this->session->set_userdata('section1',$section1);\n $this->session->set_userdata('profile_img_path1',$profile_img_path1);\n $this->session->set_userdata('dob1',$dob1);\n\t\t\t\t$this->session->set_userdata('sign_img_path1',$sign_img_path1);\n\t\t\t\t$this->session->set_userdata('aadhar_no1',$aadhar_no1);\n\t\t\t\t$this->session->set_userdata('parent_sign_path1',$parent_sign_path1);\n\t\t\t\t$this->session->set_userdata('gender1',$gender1);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//get school details to display in marksheet\n\t\t\t\t$school_name = $this->session->userdata('school_name');\n\t $q = $this->db->like('school_name',$school_name)\n\t\t\t\t\t\t->get('userinfo');\n\n\t\t\tif( $q->num_rows()>0 ){\n\t\t\t\t//login valid\n\t\t\t\t$contact_number2 = $q->row('contact_number');\n\t\t\t\t$email2 = $q->row('email');\n\t\t\t\t$city2 = $q->row('city');\n\t\t\t\t$state2 =\t$q->row('state');\n\t\t\t\t$address2 = $q->row('address');\n\t\t\t\t$profile_img_path2 = $q->row('profile_img_path');\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata('contact_number2',$contact_number2);\n\t\t\t\t$this->session->set_userdata('email2',$email2);\n\t\t\t\t$this->session->set_userdata('city2',$city2);\n\t\t\t\t$this->session->set_userdata('state2',$state2);\n\t\t\t\t$this->session->set_userdata('address2',$address2);\n\t\t\t\t$this->session->set_userdata('profile_img_path2',$profile_img_path2);\n\t\t\t\t\n\t\t\t}\n \n $q = $this->db->where('student_id',$unique_id1)\n\t\t ->where('session1',$session1)\n\t\t ->get('marks_table');\n\t\t \n\t\t $result = $q->result();\n\t\t $this->load->view('view_marksheet_operator',['dblist'=>$result]);\n \n\t }\n }", "public function main()\n {\n $records = array();\n\n $this->pObj->arrReport[] = '\n <h2>\n ' . $this->pObj->pi_getLL('ts_create_header') . '\n </h2>';\n\n $records = $this->page();\n $this->sqlInsert($records);\n }", "public function feVisitReportAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$comment\t= isset($params['comment'])?$params['comment']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$fe_report = array(); \n\n\t\t\t\t\t$fe_report['comment'] = $comment;\n\n\t\t\t\t\t$fe_report['farmer_code'] = $farmer_code;\n\t\t\t\t\t$fe_report['farmer_id'] = $farmerID;\n\t\t\t\t\t$fe_report['fe_code'] = $LoginID;\n\t\t\t\t\t$fe_report['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$fe_report['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_fevisit_report', $fe_report);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Fe report Detail Inserted successfully.', 'fe_report_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function show_report_service()\n { \n $this->load->model(\"swm/frontend/M_swm_attend\", \"msa\");\n $rs_service_data = $this->msa->get_time_us_attend(getNowDate(),getNowDate());//startDate, endDate, startAge, endAge, state\n $data['rs_service_data'] = $rs_service_data->result();\n $this->output(\"swm/frontend/v_report_service\", $data, true);\n }", "function processRemitaReceipt(){\n\n// redirect(base_url() . 'index.php?login', 'refresh');\n\t\tsession_start();\n\n\t\t\n\n\t\t$rrr = $this->input->post('rrr');\n\t\t\n\t\tif($rrr == '' || $rrr == ' ')\n\t\t{\n\n\t\t\n\t\t\t$_SESSION['err_msg'] = 'Incorrect RRR supplied.';\n\n\t\t\tredirect(base_url() . 'index.php?register/remitaGetReceipt');\n\t\t}\n\t\t\n\t\t\n\t\t$payment= $this->db->get_where('applicationinvoice_gen', array('rrr' => $rrr))->row();\n\t\t$PortalID1=$payment->payerID;\n\t\t$st= $this->db->get_where('student', array('portal_id' => $PortalID1))->row();\n\t\tif(!$st)\n\t\t\t {\n\t\t\t\t $names = explode(\" \",$payment->payername);\n\t\t\t\t \n\t\t\t$data[\"name\"]=$names[0];\n\t\t\t$data[\"othername\"]=$names[1].\" \".$names[2];\n\t\t\t$data[\"reg_no\"]=$payment->payerID;\n\t\t\t$data[\"portal_id\"]=$payment->payerID;\n\t\t\t$data[\"password\"]=rand(1000,100000);\n\t\t\t$data[\"dept\"]=0;\n\t\t\t$data[\"school\"]=0;\n\t\t\t$data[\"programme\"]=0;\n\t\t\t$data[\"prog_type\"]=0;\n\t\t\t$data[\"dept_option\"]=0;\n\t\t\t//$email =strtolower($adm_exist->surname).'.'.strtolower($adm_exist->firstname).mt_rand(1,1000).'@student.yabatech.edu.ng';\n\t\t\t$data[\"program_id\"]=0;\t\t\n\t\t\t$data[\"phone\"]=$payment->payerphone;\n $data[\"email\"]=$payment->payeremail;\t\t\t\n\t\t\t//$this->db->where('student_id',$row['student_id']);\n // $this->db->update('student', $data);\n\t\t\t//$data[\"email\"]=$adm_exist->dept_option_id;\n\t\t\t\n\t\t\t$result=$this->db->insert('student',$data);\n\t\t\t }\n\t\t\n\t\t\tif(!$payment)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Invalid RRR: Sorry RRR was not generated on this Portal';\n\n\t\t\tredirect(base_url() . 'index.php?register/remitaGetReceipt');\n\n\t\t}\n\t\t\n\t\t\n\t\tif($pmode==1)\n\t\t{\n\t $exp_paid = $this->db->get_where('nekede_etranzact_payment', array(\"confirm_code\" => $confirmcode))->row();\n\t\tif($exp_paid)\n\t\t{\n\t\t$verify_invoice = $this->db->get_where('invoice_gen', array(\"invoice_no\" => $exp_paid->payee_id,\"portal_id\"=>$portalID))->row();\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry Confirmation Code Supplied does not Belong to you! Contact Administrator for further information';\n\n\t\t\tredirect(base_url() . 'index.php?register/pay_acp_fees');\n\t\t}\n\t\t$session = $verify_invoice->session_id;\n\t\n\t\t\n\t\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => '1','student_id' => $this->session->userdata('newstudent_id'),'payment_session'=>$session))->row();\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$portalID,\n 'payment_code' => $confirmcode,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $year,\n\t\t\t 'payment_amount'=>$verify_invoice->amount,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => '1',\n\t\t\t 'student_id' => $this->session->userdata('student_id'),\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\t\n\t\t}\n\t\t$_SESSION['payeeID']= $confirmcode;\n\t\tredirect(base_url() . 'index.php?register/etransact_acp_receipt');\n}\nelse\n{\n \t$terminalID = '7630000003';\n // $cfc = $this->input->post('CONFIRMATION_NO'); \n \n //start etranzact\n\n $this->load->library('etranzact'); //load the ozioma library $this->input->post('message')\n $this->etranzact->set_terminal($terminalID);//message from textfield\n $this->etranzact->set_conf($confirmcode);//message from textfield\n $this->etranzact->send();\n\n \n //break;\n if($this->etranzact->get_status() != \"-1\" && $this->etranzact->get_status() != \"00\" && strlen($this->etranzact->get_confirm()) > 3){ \n\n $student = $this->db->get_where('student', array(\"student_id\" => $this->session->userdata('student_id')))->row();\n\t\t\t $school = $this->db->get_where('schools', array(\"schoolid\" => $student->school))->row();\n$dept = $this->db->get_where('department', array(\"deptID\" => $student->dept))->row();\n$programme = $this->db->get_where('student_type', array(\"student_type_id\" => $student->programme))->row();\n$programme_type = $this->db->get_where('programme_type', array(\"programme_type_id\" => $student->prog_type))->row();\n$yr = $this->db->get_where('course_year_of_study', array(\"year_of_study_id\" => $student->level))->row();\n \n $data['receipt_no'] = $this->etranzact->get_receipt();\n $data['bankcode'] = $this->etranzact->get_bankcode();\n $data['bankname'] = $this->etranzact->get_bankname();\n $data['branchcode'] = $this->etranzact->get_branchcode();\n $data['confirm_code'] = $this->etranzact->get_confirm();\n $data['amount'] = $this->etranzact->get_amount();\n $data['description'] = $this->etranzact->get_descr();\n $data['payment_confirmation_date'] = $this->etranzact->get_date();\n $data['payee_id'] = $this->etranzact->get_customer();\n $data['payment_method'] = 'Bank';\n $data['status'] = 'PAID';\n $data['prog_type'] = $student->prog_type; \n $data['student_id'] = $this->session->userdata('student_id'); \n\t\t\t\t\t \n $data['portal_id'] = $portalID;\n \n $data['session'] = '2016/2017'; \n\t\t\t\t\t$data['fullname'] = $student->name.' '.$student->othername;\n\t\t\t\t\t$data['phone'] = $student->phone;\n\t\t\t\t\t$data['email'] = $student->email;\n\t\t\t\t\t$data['programme'] = $programme_type->programme_type_name;\n\t\t\t\t\t$data['faculty'] = $school->schoolname;\n\t\t\t\t\t$data['department'] = $dept->deptName;\n\t\t\t\t\t$data['level'] = $yr->year_of_study_name; \n \n\n //$this->db->insert('prehnd_etranzact_data', $data);\n // $this->db->where('payee_id', $this->etranzact->get_customer());\n\t\t\t\t \n $verify_invoice = $this->db->get_where('invoice_gen', array(\"invoice_no\" => $this->etranzact->get_customer(),\"portal_id\"=>$portalID))->row();\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry Confirmation Code Supplied does not Belong to you! Contact Administrator for further information';\n\n\t\t\tredirect(base_url() . 'index.php?student/pay_acp_fees');\n\t\t}\n\t\t$session = $verify_invoice->session_id;\n\t\t//$student= $this->db->get_where('student', array('student_id' => $this->session->userdata('student_id')))->row();\n\t\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => '1','student_id' => $this->session->userdata('student_id'),'payment_session'=>$session))->row();\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$portalID,\n 'payment_code' => $confirmcode,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $year,\n\t\t\t 'payment_amount'=>$verify_invoice->amount,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => '1',\n\t\t\t 'student_id' => $this->session->userdata('student_id'),\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\t\n\t\t}\n\t\t\n \n\t\t$this->db->insert('nekede_etranzact_payment', $data);\n \n\n //get the sms sender\n //$sender = $this->db->get_where('prehnd_settings', array('settings' => 'sms_sender'))->row();\n $sender = 'Eduportal';\n $reciever = $this->session->userdata('fullname'); \n\n // Start Ozioma\n $this->load->library('ozioma'); \n\n //set message\n $this->ozioma->set_message(\"Hello \" . $reciever . \", you have successfully confirmed your HND Acceptance Fee payment.\");\n\n //recipient phone number\n $this->ozioma->set_recipient('2348034158429');\n\n //sender\n //$this->ozioma->set_sender($sender->value);\n $this->ozioma->set_sender($sender);\n \n //send\n $this->ozioma->send();\n session_start();\n\t\t\t\t\t$_SESSION['payeeID']= $confirmcode;\n\t\t\n redirect(base_url() . 'index.php?student/etransact_acp_receipt'); \n\t\t\t\t \n\n }else{\n $terminalID = '7630000002';\n // $cfc = $this->input->post('CONFIRMATION_NO'); \n \n //start etranzact\n\n $this->load->library('etranzact'); //load the ozioma library $this->input->post('message')\n $this->etranzact->set_terminal($terminalID);//message from textfield\n $this->etranzact->set_conf($confirmcode);//message from textfield\n $this->etranzact->send();\n\n \n //break;\n if($this->etranzact->get_status() != \"-1\" && $this->etranzact->get_status() != \"00\" && strlen($this->etranzact->get_confirm()) > 3){ \n\n $student = $this->db->get_where('student', array(\"student_id\" => $this->session->userdata('student_id')))->row();\n\t\t\t $school = $this->db->get_where('schools', array(\"schoolid\" => $student->school))->row();\n$dept = $this->db->get_where('department', array(\"deptID\" => $student->dept))->row();\n$programme = $this->db->get_where('student_type', array(\"student_type_id\" => $student->programme))->row();\n$programme_type = $this->db->get_where('programme_type', array(\"programme_type_id\" => $student->prog_type))->row();\n$yr = $this->db->get_where('course_year_of_study', array(\"year_of_study_id\" => $student->level))->row();\n \n $data['receipt_no'] = $this->etranzact->get_receipt();\n $data['bankcode'] = $this->etranzact->get_bankcode();\n $data['bankname'] = $this->etranzact->get_bankname();\n $data['branchcode'] = $this->etranzact->get_branchcode();\n $data['confirm_code'] = $this->etranzact->get_confirm();\n $data['amount'] = $this->etranzact->get_amount();\n $data['description'] = $this->etranzact->get_descr();\n $data['payment_confirmation_date'] = $this->etranzact->get_date();\n $data['payee_id'] = $this->etranzact->get_customer();\n $data['payment_method'] = 'Bank';\n $data['status'] = 'PAID';\n $data['prog_type'] = $student->prog_type; \n $data['student_id'] = $this->session->userdata('student_id'); \n\t\t\t\t\t \n $data['portal_id'] = $portalID;\n \n $data['session'] = '2016/2017'; \n\t\t\t\t\t$data['fullname'] = $student->name.' '.$student->othername;\n\t\t\t\t\t$data['phone'] = $student->phone;\n\t\t\t\t\t$data['email'] = $student->email;\n\t\t\t\t\t$data['programme'] = $programme_type->programme_type_name;\n\t\t\t\t\t$data['faculty'] = $school->schoolname;\n\t\t\t\t\t$data['department'] = $dept->deptName;\n\t\t\t\t\t$data['level'] = $yr->year_of_study_name; \n \n\n //$this->db->insert('prehnd_etranzact_data', $data);\n // $this->db->where('payee_id', $this->etranzact->get_customer());\n\t\t\t\t \n $verify_invoice = $this->db->get_where('invoice_gen', array(\"invoice_no\" => $this->etranzact->get_customer(),\"portal_id\"=>$portalID))->row();\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry Confirmation Code Supplied does not Belong to you! Contact Administrator for further information';\n\n\t\t\tredirect(base_url() . 'index.php?student/pay_acp_fees');\n\t\t}\n\t\t$session = $verify_invoice->session_id;\n\t\t//$student= $this->db->get_where('student', array('student_id' => $this->session->userdata('student_id')))->row();\n\n\t\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => '1','student_id' => $this->session->userdata('student_id'),'payment_session'=>$session))->row();\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$portalID,\n 'payment_code' => $confirmcode,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $year,\n\t\t\t 'payment_amount'=>$verify_invoice->amount,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => '1',\n\t\t\t 'student_id' => $this->session->userdata('student_id'),\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\t\n\t\t}\n\t\t\n \n\t\t$this->db->insert('nekede_etranzact_payment', $data);\n \n\n //get the sms sender\n //$sender = $this->db->get_where('prehnd_settings', array('settings' => 'sms_sender'))->row();\n $sender = 'Eduportal';\n $reciever = $this->session->userdata('fullname'); \n\n // Start Ozioma\n $this->load->library('ozioma'); \n\n //set message\n $this->ozioma->set_message(\"Hello \" . $reciever . \", you have successfully confirmed your HND Acceptance Fee payment.\");\n\n //recipient phone number\n $this->ozioma->set_recipient('2348034158429');\n\n //sender\n //$this->ozioma->set_sender($sender->value);\n $this->ozioma->set_sender($sender);\n \n //send\n $this->ozioma->send();\n session_start();\n\t\t\t\t\t$_SESSION['payeeID']= $confirmcode;\n\t\t\n redirect(base_url() . 'index.php?student/etransact_acp_receipt'); \n\t\t\t\t \n\n }\n \n else{\n\t\t\t\t\t $terminalID = '7730020028';\n // $cfc = $this->input->post('CONFIRMATION_NO'); \n \n //start etranzact\n\n $this->load->library('etranzact'); //load the ozioma library $this->input->post('message')\n $this->etranzact->set_terminal($terminalID);//message from textfield\n $this->etranzact->set_conf($confirmcode);//message from textfield\n $this->etranzact->send();\n\n \n //break;\n if($this->etranzact->get_status() != \"-1\" && $this->etranzact->get_status() != \"00\" && strlen($this->etranzact->get_confirm()) > 3){ \n\n $student = $this->db->get_where('student', array(\"student_id\" => $this->session->userdata('student_id')))->row();\n\t\t\t $school = $this->db->get_where('schools', array(\"schoolid\" => $student->school))->row();\n$dept = $this->db->get_where('department', array(\"deptID\" => $student->dept))->row();\n$programme = $this->db->get_where('student_type', array(\"student_type_id\" => $student->programme))->row();\n$programme_type = $this->db->get_where('programme_type', array(\"programme_type_id\" => $student->prog_type))->row();\n$yr = $this->db->get_where('course_year_of_study', array(\"year_of_study_id\" => $student->level))->row();\n \n $data['receipt_no'] = $this->etranzact->get_receipt();\n $data['bankcode'] = $this->etranzact->get_bankcode();\n $data['bankname'] = $this->etranzact->get_bankname();\n $data['branchcode'] = $this->etranzact->get_branchcode();\n $data['confirm_code'] = $this->etranzact->get_confirm();\n $data['amount'] = $this->etranzact->get_amount();\n $data['description'] = $this->etranzact->get_descr();\n $data['payment_confirmation_date'] = $this->etranzact->get_date();\n $data['payee_id'] = $this->etranzact->get_customer();\n $data['payment_method'] = 'Bank';\n $data['status'] = 'PAID';\n $data['prog_type'] = $student->prog_type; \n $data['student_id'] = $this->session->userdata('student_id'); \n\t\t\t\t\t \n $data['portal_id'] = $portalID;\n \n $data['session'] = '2016/2017'; \n\t\t\t\t\t$data['fullname'] = $student->name.' '.$student->othername;\n\t\t\t\t\t$data['phone'] = $student->phone;\n\t\t\t\t\t$data['email'] = $student->email;\n\t\t\t\t\t$data['programme'] = $programme_type->programme_type_name;\n\t\t\t\t\t$data['faculty'] = $school->schoolname;\n\t\t\t\t\t$data['department'] = $dept->deptName;\n\t\t\t\t\t$data['level'] = $yr->year_of_study_name; \n \n\n //$this->db->insert('prehnd_etranzact_data', $data);\n // $this->db->where('payee_id', $this->etranzact->get_customer());\n\t\t\t\t \n $verify_invoice = $this->db->get_where('invoice_gen', array(\"invoice_no\" => $this->etranzact->get_customer(),\"portal_id\"=>$portalID))->row();\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry Confirmation Code Supplied does not Belong to you! Contact Administrator for further information';\n\n\t\t\tredirect(base_url() . 'index.php?student/pay_acp_fees');\n\t\t}\n\t\t$session = $verify_invoice->session_id;\n\t\t//$student= $this->db->get_where('student', array('student_id' => $this->session->userdata('student_id')))->row();\n\n\t\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => '1','student_id' => $this->session->userdata('student_id'),'payment_session'=>$session))->row();\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$portalID,\n 'payment_code' => $confirmcode,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $year,\n\t\t\t 'payment_amount'=>$verify_invoice->amount,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => '1',\n\t\t\t 'student_id' => $this->session->userdata('student_id'),\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\t\n\t\t}\n\t\t\n \n\t\t$this->db->insert('nekede_etranzact_payment', $data);\n \n\n //get the sms sender\n //$sender = $this->db->get_where('prehnd_settings', array('settings' => 'sms_sender'))->row();\n $sender = 'Eduportal';\n $reciever = $this->session->userdata('fullname'); \n\n // Start Ozioma\n $this->load->library('ozioma'); \n\n //set message\n $this->ozioma->set_message(\"Hello \" . $reciever . \", you have successfully confirmed your HND Acceptance Fee payment.\");\n\n //recipient phone number\n $this->ozioma->set_recipient('2348034158429');\n\n //sender\n //$this->ozioma->set_sender($sender->value);\n $this->ozioma->set_sender($sender);\n \n //send\n $this->ozioma->send();\n session_start();\n\t\t\t\t\t$_SESSION['payeeID']= $confirmcode;\n\t\t\n redirect(base_url() . 'index.php?student/etransact_acp_receipt'); \n\t\t\t\t \n\n }\n\t\t\t\t\t else{\n $_SESSION['err_msg'] = 'The Confirmation Code you entered is incorrect';\n redirect(base_url() . 'index.php?student/pay_acp_fees');\n\t\t\t\t\t }\n }\n \n \n \n } \n\t\n}\n\t\t}\n\t\telse{\n\t\t$exp_paid = $this->db->get_where('eduportal_remita_payment', array(\"rrr\" => $rrr))->row();\n\t\tif($exp_paid)\n\t\t{\n\t\t$verify_invoice = $this->db->get_where('applicationinvoice_gen', array(\"rrr\" => $rrr))->row();\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry RRR Supplied does not Exist';\n\n\t\t\tredirect(base_url() . 'index.php?register/remitaGetReceipt');\n\t\t}\n\t\t$session = $verify_invoice->acadsession;\n\t\t$student= $this->db->get_where('student', array('portal_id' => $verify_invoice->payerID))->row();\n\t\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => $verify_invoice->paymentid,'payment_code' => $rrr,'payment_session'=>$session))->row();\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$verify_invoice->payerID,\n 'payment_code' => $rrr,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $session,\n\t\t\t 'payment_amount'=>$verify_invoice->amt,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => $verify_invoice->paymentid,\n\t\t\t 'student_id' => $student->student_id,\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\t\n\t\t}\n\t\t$_SESSION['payeeID']= $rrr;\n\t\tredirect(base_url() . 'index.php?register/remita_payment_receipt');\n}\nelse\n{\n\t\n\t\t\t$mert = '576943955';\n\n\t\t\t$api_key = '428537';\n\n\t\t\t$concatString = $rrr . $api_key . $mert;\n\n\t\t\t$hash = hash('sha512', $concatString);\n\n\t\t\t$url \t= 'https://login.remita.net/remita/ecomm/' . $mert . '/' . $rrr . '/' . $hash . '/' . 'status.reg';\n\n\t\t\t// Initiate curl\n\n\n\n\t\t\t$ch = curl_init();\n\n\t\t\t// Disable SSL verification\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n\t\t\t// Will return the response, if false it print the response\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\t\t\t// Set the url\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL,$url);\n\n\t\t\t// Execute\n\n\t\t\t$result=curl_exec($ch);\n\n\t\t\t// Closing\n\n\t\t\tcurl_close($ch);\n\n\t\t\t$response = json_decode($result, true);\n\n\t\t\t$msg = $response['message'];\n\n\t\t\t$rem = $response['RRR'];\n\n\t\t\t\n\n\t\t\tif($msg == 'Approved'){\n\n\t\t\t\t\n\n\t\t\t\t//get the applicant invoice details using the portal id\n\n\t\t\t\t$stud = $this->db->get_where('applicationinvoice_gen', array(\"rrr\" => $rem))->row();\n $student = $this->db->get_where('student', array(\"portal_id\" => $stud->payerID))->row();\n\t\t\t\t\n\n\t\t\t\t$data5['rrr'] = $rem;\n\t\t\t\t$data5['payment_id'] = $response['orderId'];\n\t\t\t\t$data5['channel'] = 'BRANCH';\n\t\t\t\t$data5['amount'] = $response['amount'];\n\t\t\t\t$data5['payer_name'] = $stud->payername;\n\t\t\t\t$data5['payer_email'] =$stud->payeremail;\n\n\t\t\t\t$data5['payer_phone'] = $stud->payerphone;\n\n\t\t\t\t$data5['unique_id'] = $response['orderId'];\n\n\t\t\t\t$data5['response_code'] = $response['status'];\n\n\t\t\t\t$data5['trans_date'] = date(\"Y-m-d\");\n $data5['debit_date']=$response['transactiontime'];\n\t\t\t\t$data2['status'] = $msg;\n\n\t\t\t\t\n\t\t\t\t $this->session->set_userdata('receipt',$stud->$response['orderId']); //Trans Receipt\n\t\t\t\t\t\t //Transaction PayeeID\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t // \tinclude('application/config/z.php');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n$verify_invoice = $this->db->get_where('applicationinvoice_gen', array(\"rrr\" => $rrr))->row();\n$session = $verify_invoice->acadsession;\n$year = $verify_invoice->acadsession;\n\t\tif(!$verify_invoice)\n\t\t{\n\t\t\t$_SESSION['err_msg'] = 'Sorry RRR Supplied does not Exit';\n\n\t\t\tredirect(base_url() . 'index.php?register/pay_acp_fees');\n\t\t}\n\t\t\t\t\t\t\n\t\t\t\t$this->db->where('rrr', $rrr);\n\n\t\t\t\t$this->db->update('applicationinvoice_gen', $data2);\n\t\t\t\t\n\t\t\t\t$this->db->where('rrr', $rrr);\n\n\t\t\t\t$this->db->update('eduportal_remita_payment', $data2);\n\n\t\t\t\t\n\n\t\t\t\t//check if record already exists\n\n\t\t\t\t$rrrset = $this->db->get_where('eduportal_remita_payment', array(\"rrr\" => $rrr))->row();\n\t\t\t\t\n\n\t\t\t\tif($rrrset){\n\n\t\t\t\t\n\t\t\t\t\t//$this->session->set_userdata('logged_in',\"1\");\t\n\t\t\t\t\t$_SESSION['payeeID']= $rrr;\n\t\t\t\t\tredirect(base_url() . 'index.php?register/remita_acp_receipt');\n\t\t\t\t\t\t\t\t//echo $rem . ' already in accp table <br />';\n\n\t\t\t\t\t\n\n\t\t\t\t}else{\n\t\t\t\t\t\n\n\t\t\t\t\t$this->db->insert('eduportal_remita_payment', $data5);\n\n\t$verify_payment_log = $this->db->get_where('eduportal_fees_payment_log', array(\"payment_fee_type\" => $verify_invoice->paymentid,'payment_code' => $rrr,'payment_session'=>$session))->row();\n\t\n\t\tif(!$verify_payment_log)\n\t\t{\n\t\t\t$payment_data = array(\n 'regno'=>$verify_invoice->payerID,\n 'payment_code' => $rrr,\n 'payment_session' => $session,\n\t\t\t 'payment_level'=> $year,\n\t\t\t 'payment_amount'=>$verify_invoice->amt,\n\t\t\t 'payment_status' =>'F',\n\t\t\t 'payment_date' => date('Y-m-d H:i:s'),\n\t\t\t 'payment_fee_type' => $verify_invoice->paymentid,\n\t\t\t 'student_id' => $student->student_id,\n\t\t\t 'semester'=> 'FIRST'\n\t\t\t \n );\t\t\t\n\n$this->db->insert('eduportal_fees_payment_log',$payment_data);\ninclude('application/config/z.php');\n \n$serviceheadid = \"gtcopaul\";\n$token = \"736@_73gh\";\n\n$adm= sqlsrv_query($conn,\"SELECT payername, payerID from applicationinvoice_gen where rrr='$rrr'\")or die( print_r( sqlsrv_errors(), true));\n while(list( $payername, $payerID)=sqlsrv_fetch_array($adm))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$names =$payername; \t\ntry{\n\t $opts = array(\n 'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)\n);\n// SOAP 1.2 client\n\n\n$params = array ('encoding' => 'UTF-8', 'verifypeer' => false, 'verifyhost' => false, 'soap_version' => SOAP_1_2, 'trace' => 1, 'exceptions' => 1, \"connection_timeout\" => 180, 'stream_context' => stream_context_create($opts) );\n$soapclient = new SoapClient('http://portal.yabatech.edu.ng/paymentservice/yctoutservice.asmx?wsdl',$params);\n\n$param=array(\n'tx'=>$serviceheadid,\n'ty'=>$token,\n't1'=>\"Approved\",\n't2'=>date('Y-m-d H:i:s'),\n't3'=>$verify_invoice->amt,\n't4'=>$verify_invoice->paymentdescription,\n't5'=>$rrr,\n't6'=>$verify_invoice->paymentid,\n't7'=>$payerID);\n//print_r($param);\n//exit;\n\n$response =$soapclient->dodo($param);\n\necho '<br>';\n$array = json_decode(json_encode($response), true);\n//$response = json_decode($jsonData, true);\n\n\n\n\n\tforeach($array as $item) {\n\t\t\necho $item;\n$result =json_decode($item, true);\necho '<br/>';\n\t\n\t\n}\t$pid=$verify_invoice->paymentid;\n\tsqlsrv_query($conn,\"update eduportal_fees_payment_log set posted_citm='1' where regno='$payerID' and payment_fee_type='$pid'\") or die( print_r( sqlsrv_errors(), true));\n\t\n\t//print_r($items);\n}catch(Exception $e){\n\techo $e->getMessage();\n\t\n\tsqlsrv_query($conn,\"update eduportal_fees_payment_log set posted_citm='1' where regno='$payerID' and payment_fee_type='$pid'\") or die( print_r( sqlsrv_errors(), true));\n\t\n}\n\t\t}\n\t\t}\n\t\t\t\t\t$_SESSION['payeeID']= $rrr;\n\t\t\t\t\tredirect(base_url() . 'index.php?register/remita_payment_receipt');\n\t\t\t\t\n}\n\t\t\t\t\n\t\t\t\n\t}\n\telse{\n\t\t\t$_SESSION['err_msg'] = 'Invalid Remita RRR';\n\t\t\t\t\n\n\t\t\tredirect(base_url() . 'index.php?register/remitaGetReceipt');\n\t\t}\n\t$_SESSION['err_msg'] = 'Error: Network problem. Please try again at a later time.';\n\t$this->session->set_userdata('error', 'Error: Network problem. Please again at a later time.');\nredirect(base_url() . 'index.php?student/remitaGetReceipt');\t\n\n}\t\t\t\n\t\n}\n\n\t}", "function genrate_inspectorvehicleloghistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n \n\t\t$columnwidtharrays = array(15,17,16,20,15,15,15,15,27,16,18);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c = 0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t \n\n\t\t if( $c == 0 || $c ==3 || $c ==6 || $c ==7|| $c ==9|| $c ==8){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 6, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_log_date = \t\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date']));\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleLogDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name= \t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t $nu_start_ometer=\t\tnumber_format($val['VehicleLogDetail']['nu_start_ometer']);\n\t\t\t$nu_end_ometer = \t\tnumber_format($val['VehicleLogDetail']['nu_end_ometer']);\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t\t$ch_road_type = 'Other Road';\n\t\t\telse\n\t\t\t\t$ch_road_type = 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t // $vc_orign_name = \t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t\t // $vc_destination_name = \t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t // $nu_km_traveled = \t\tnumber_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t // $nu_other_road_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_created_date']));\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_log_date, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_start_ometer, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_end_ometer, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $destination, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_km_traveled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t}\n\t}", "public function select_subject(){\n $this->block_for_test();\n if($this->session->has_userdata('APPLICATION_ID')) {\n $APPLICATION_ID = $this->session->userdata('APPLICATION_ID');\n\n $user = $this->session->userdata($this->SessionName);\n $user = $this->User_model->getUserById($user['USER_ID']);\n\n $data['user'] = $user;\n $data['APPLICATION_ID'] = $APPLICATION_ID;\n\n $application = $this->Application_model->getApplicationByUserAndApplicationId($user['USER_ID'], $APPLICATION_ID);\n if($application['STATUS_ID']==FINAL_SUBMIT_STATUS_ID){\n redirect(base_url('form/application_form'));\n exit();\n }\n if($application['STATUS_ID']>FINAL_SUBMIT_STATUS_ID){\n redirect(base_url('form/dashboard'));\n }\n if ($application) {\n \n //form close from bachelor\n $this->close_registration_for_bachelor($application);\n \n \n $form_data = $this->User_model->getUserFullDetailById($user['USER_ID'],$APPLICATION_ID);\n\n $degree_list = array(\n 'BACHELOR'=>array('PROGRAM_TYPE_ID'=>1,'DEGREE_ID'=>3),\n 'MASTER'=>array('PROGRAM_TYPE_ID'=>2,'DEGREE_ID'=>array(4,5,6))\n );\n\n //$form_data = json_decode($application['FORM_DATA'],true);\n $bool = false;\n $valid_qualification = null;\n if($application['PROGRAM_TYPE_ID']==$degree_list['BACHELOR']['PROGRAM_TYPE_ID']){\n // echo \"bach\";\n foreach ($form_data['qualifications'] as $qualification){\n if($qualification['DEGREE_ID'] ==$degree_list['BACHELOR']['DEGREE_ID']){\n $bool = true;\n $valid_qualification = $qualification;\n break;\n }\n }\n\n\n }\n else if($application['PROGRAM_TYPE_ID']==$degree_list['MASTER']['PROGRAM_TYPE_ID']){\n //echo \"master\";\n //4\n // prePrint($form_data['qualifications']);\n\n\n// prePrint($degree_list['MASTER']['DEGREE_ID']);\n \n// prePrint($form_data['qualifications']);\n// exit();\n foreach ($form_data['qualifications'] as $k=>$qualification){\n $check = false;\n \n \n foreach($degree_list['MASTER']['DEGREE_ID'] as $degree_id){\n if($degree_id==$qualification['DEGREE_ID']){\n $check = true;\n break;\n }\n }\n if($check){\n $bool = true;\n if($k==0){\n $valid_qualification = $qualification;\n }\n \n if($qualification['DEGREE_ID']>$valid_qualification['DEGREE_ID']){\n $valid_qualification = $qualification;\n }\n\n //break;\n }\n // prePrint(\"K\".$k);\n // prePrint($qualification);\n // prePrint(\"CEHL\".$check);\n // prePrint($valid_qualification);\n }\n }\n\n// exit();\n $form_fees = $this->Admission_session_model->getFormFeesBySessionAndCampusId($application['SESSION_ID'], $application['CAMPUS_ID']);\n\n if ($form_fees) {\n// $valid_upto = getDateCustomeView($application['ADMISSION_END_DATE'], 'd-m-Y');\n//\n// if ($application['ADMISSION_END_DATE'] < date('Y-m-d')) {\n// exit(\"Sorry your challan is expired..\");\n// }\n\n\n\n $data['profile_url'] = $this->profile;\n// $data['is_valid_qualification'] = $bool;\n// $data['form_data'] = $form_data;\n //$data['application'] = $application;\n if($bool&&$valid_qualification!=null){\n\n $result = $this->Application_model->getMinorMappingByDisciplineId($valid_qualification['DISCIPLINE_ID']);\n \n if($result!=null && count($result)==1){\n //prePrint($result);\n $result =$result[0];\n \n $is_exist = $this->Application_model->getApplicantsMinorsByApplicationIdAndMinorMappingId($APPLICATION_ID,$result['MINOR_MAPPING_ID']);\n if(count($is_exist)==0) {\n $applicants_minnor = array(\n \"APPLICATION_ID\" => $APPLICATION_ID,\n \"DISCIPLINE_ID\" => $result['DISCIPLINE_ID'],\n \"MINOR_MAPPING_ID\" => $result['MINOR_MAPPING_ID'],\n \"USER_ID\" => $user['USER_ID'],\n \"ACTIVE\" => 1\n );\n $is_add = $this->Application_model->addApplicantsMinors($applicants_minnor);\n if ($is_add) {\n echo \"Minor Automatic Added\";\n $error = \"<div class='text-danger'>Minor Automatic Added</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ALERT');\n //$this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url('form/select_category'));\n\n } else{\n echo \"ByDefault Minor Not added\";\n $error = \"<div class='text-danger'> ByDefault Minor Not added</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ALERT');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url('form/select_category'));\n\n }\n\n }else{\n\n// $error = \"<div class='text-danger'> Already selected minors</div>\";\n// $alert = array('MSG'=>$error,'TYPE'=>'ALERT');\n// $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url('form/select_category'));\n\n }\n\n }\n else if($result!=null && count($result)>1){\n $data['minors'] = $result;\n $data['DISCIPLINE_ID'] = $valid_qualification['DISCIPLINE_ID'];\n /***********DANGER**************\n WE NEED TO UPDATE APPLICATION ID INSTEAD OF USER ID IN \n $data['applicantsMinors'] = $this->Application_model->getApplicantsMinorsByUserIdAndDisciplineID($user['USER_ID'],$valid_qualification['DISCIPLINE_ID']);\n ***********DANGER**************/\n /***********UPDATED**************/\n $data['applicantsMinors'] = $this->Application_model->getApplicantsMinorsByApplicationIdAndDisciplineID($APPLICATION_ID,$valid_qualification['DISCIPLINE_ID']);\n $data['PROGRAM_TYPE_ID'] =$application['PROGRAM_TYPE_ID'];\n // $data['roll_no'] = $user['USER_ID'];\n $this->load->view('include/header', $data);\n $this->load->view('include/preloder');\n $this->load->view('include/side_bar', $data);\n $this->load->view('include/nav', $data);\n $this->load->view('select_minor_subject', $data);\n $this->load->view('include/footer_area', $data);\n $this->load->view('include/footer', $data);\n }else{\n echo \"minors not found\";\n }\n }\n else{\n\n $error = \"<div class='text-danger'>Please must add appropriate degree</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ALERT');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url('candidate/add_inter_qualification'));\n }\n // prePrint($application);\n\n\n\n } else {\n echo \"fees not found\";\n redirect(base_url('form/dashboard'));\n }\n\n } else {\n echo \"this application id is not associate with you\";\n redirect(base_url('form/dashboard'));\n }\n }else{\n echo \"Application Id Not Found\";\n redirect(base_url('form/dashboard'));\n }\n }", "function admin_export_patients($id=NULL) // template for new classes\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['home_clinic'] = $_SESSION['location_id'];\r\n\t\t$data['title'] = \"Export Patients\";\r\n\t\t$data['form_purpose'] = \t\"new_export\";\r\n $data['now_id'] = time();\r\n\t\t$data['unsynched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic']);\r\n\t\t$data['synched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic'],TRUE);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_emr_wap\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_wap\";\r\n $new_body = \"ehr/emr_newpage_wap\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_export_patients_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n }", "public function print_ack() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_acknowledgment($data);\n }", "public function reporteFinalMantenimientosController(){\n\n\t\t\t$respuesta = GestorMantenimientosModel::reporteFinalMantenimientosModel();\n\n\t\t\tforeach ($respuesta as $row => $item) {\n\t\t\t\t\n\t\t\t\techo '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>' . $item[\"cedula_cliente\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"nombre_cliente\"] . \" \" . $item[\"apellido_cliente\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"placas_vehiculo\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"marca_vehiculo\"] . ' '. $item[\"modelo_vehiculo\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"kilometraje_vehiculo\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"nombre_categoria\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"descripcion_mantenimiento\"] . '</td>\n\t\t\t\t\t\t<td>' . $item[\"fecha_ingreso\"] . '</td>\n\t\t\t\t\t</tr>\n\t\t\t\t';\n\t\t\t}\n\n\t\t}", "function genrate_inspectorvehiclehistorypdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t \n\t\t$columnwidtharrays = array(10,30,26,26,23,18,20,20,16);\n\t\t\n\t\t$heightdynamic =8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164 ,8, '',0,'','L',true);\t\t\t\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name =\t\tucfirst($val['CustomerProfile']['vc_customer_name']);\n\t\t $vc_vehicle_lic_no =\t\t$val['VehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no =\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleDetail']['dt_created_date']));\n\t\t $vc_prtype_name =\t\t$val['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_v_rating =\t\tnumber_format($val['VehicleDetail']['vc_v_rating']);\n\t\t $vc_dt_rating =\t\tnumber_format($val['VehicleDetail']['vc_dt_rating']);\n\t\t $vc_rate =\t\tnumber_format($val['VehicleDetail']['vc_rate'],2,'.',',');\n\t\t\t\n\t\t\t$font_size=7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_v_rating, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_dt_rating, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$vc_rate, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "public function actionReport()\n\t{\n\t\t$model = new AutoChores();\n\t\t$results = array();\n\t\t$errors = array();\n\t\t$isPrint = 0;\n\t\t//exit;\n\t\tif(isset($_REQUEST['go'])){\n\t\t if(!isset($_REQUEST['go']))\n \t\t $isPrint = 1;\n\t\t\tif(empty($_REQUEST['from_date'])){\n\t\t\t\t$errors[\"from_date\"] = \"Invalid From Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['to_date'])){\n\t\t\t\t$errors[\"to_date\"] = \"Invalid To Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['farm'])){\n\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}else {\n\t\t\t\t$qtxt =\"SELECT farm_herd FROM herd_setup WHERE farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t$res =$command->queryColumn();\n\n\t\t\t\tif($_REQUEST['farm'] != 'A' && (!isset($res[0]) || $res[0] != $_REQUEST['farm']))\n\t\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}\n\t\t\tif(count($errors) == 0) {\n\t\t\t\t$results1 = $this->dateRange($_REQUEST['from_date'], $_REQUEST['to_date'],'+1 day','m/d/Y');\n\t\t\t\tforeach ($results1 as $result) {\n\t\t\t\t\t$qtxt = \"SELECT * FROM chores WHERE date = '\".$result.\"' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res =$command->queryAll();\n\t\t\t\t\t//$results[$result] = $res;\n\n\t\t\t\t\t//D\n\t\t\t\t\t$qtxt = \"SELECT * FROM auto_chores WHERE generated_by = 'D' AND disabled = 'N' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND (farm_herd = '\".$_REQUEST['farm'].\"' OR generated_by = 'A') \";\n\n\t\t\t\t\t$qtxt1 = \" ADDDATE(date_asof, days_after) = '\".$result.\"' \";\n\t\t\t\t\t$qtxt2 = \" ADDDATE(date_asof, (days_after+(times_occur*days_between))) = '\".$result.\"' AND times_occur >= 2\";\n\t\t\t\t\t$qtxt .= \" AND ((\".$qtxt1.\") OR (\".$qtxt2.\")) \";\n\n\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res1 =$command->queryAll();\n\t\t\t\t\t$results[$result] = array_merge($res,$res1);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$model->addErrors($errors);\n\t\t\t}\n\t\t}\n\n\n\t\t$this->render('report',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'results'=>$results,\n\t\t 'isPrint'=>$isPrint,\n\n\t\t));\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "public function report_sales_pdf() {\n $tenant_id = $this->tenant_id;\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n\n $sales_exec = $this->input->get('sales_exec');\n $non_sales_exec = $this->input->get('non_sales_exec');\n if (!empty($sales_exec)) {\n $sales_exec = $sales_exec;\n } else if (!empty($non_sales_exec)) {\n $sales_exec = $non_sales_exec;\n }\n\n\n\n $sales_comm_result = $this->reportsModel->get_sales_comm('pdf', $tenant_id, $records_per_page, $offset, $field, $order_by, $sales_exec);\n $comm_due_periods = $this->reportsModel->get_comm_due_period($tenant_id, $sales_exec);\n $year_arr = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',\n 5 => 'May', 6 =>\n 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep',\n 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');\n $periods = array();\n foreach ($comm_due_periods as $val) {\n $periods[$val->sales_exec_id] .= $year_arr[$val->comm_period_mth] . ' ' . $val->comm_period_yr . \", \";\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return sales_reports_pdf($sales_comm_result, $periods, $tenant_details, $executive);\n }", "function sendExport() {\n\tglobal $orgcode;\n\tglobal $filename;\n\tglobal $firstdate;\n\tglobal $lastdate;\n\t$headers = [\n\t\t\"ORGCODE\",\t//0\n\t\t\"PARTICIP\",\n\t\t\"ENROLL\",\n\t\t\"PAYER\",\n\t\t\"STATE\",\n\t\t\"GLUCTEST\",\t//5\n\t\t\"GDM\",\n\t\t\"RISKTEST\",\n\t\t\"AGE\",\n\t\t\"ETHNIC\",\n\t\t\"AIAN\",\t\t//10\n\t\t\"ASIAN\",\n\t\t\"BLACK\",\n\t\t\"NHOPI\",\n\t\t\"WHITE\",\n\t\t\"SEX\",\t\t//15\n\t\t\"HEIGHT\",\n\t\t\"EDU\",\n\t\t\"DMODE\",\n\t\t\"SESSID\",\n\t\t\"SESSTYPE\",\t//20\n\t\t\"DATE\",\n\t\t\"WEIGHT\",\n\t\t\"PA\"\n\t];\n\t\n\t$data = [$headers];\n\t$noncompliant = [$headers];\n\t$today = new DateTime(\"NOW\");\n\t\n\t// get all participant data\n\t$records = \\REDCap::getData(PROJECT_ID);\n\t$project = new \\Project(PROJECT_ID);\n\t\n\t// get year value for when these records were created or first logged update\n\t$recordCreationDates = [];\n\t$sql = \"SELECT pk, ts FROM redcap_log_event WHERE project_id=\" . PROJECT_ID . \" and pk in (\" . implode(array_keys($records), \", \") . \") and (description=\\\"Create record\\\" OR description=\\\"Update record\\\") ORDER BY pk ASC, ts ASC\";\n\t$query = db_query($sql);\n\twhile ($row = db_fetch_assoc($query)) {\n\t\tif (!isset($recordCreationDates[$row['pk']])) {\n\t\t\t$recordCreationDates[$row['pk']] = substr($row['ts'], 2, 2);\n\t\t}\n\t}\n\t\n\t// regex for getting labels for project fields (like state, sess_type, etc)\n\t$labelPattern = \"/(\\d+),?\\s?(.+?)(?=\\x{005c}\\x{006E}|$)/\";\n\t\n\tforeach ($records as $rid => $record) {\n\t\t$eid = array_keys($record)[0];\n\t\t\n\t\t// skip if orgcode set and not match\n\t\tif (isset($orgcode) and $orgcode != $record[$eid]['orgcode']) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// skip if have diabietes\n\t\tif ($record[$eid]['have_diabetes'] == 1 or $record[$eid]['enter_roster'] == 0) continue;\n\t\t\n\t\t$line = array_fill(0, 23, null);\n\t\t$line[0] = $record[$eid]['orgcode'];\n\t\t\n\t\t// determine participant ID\n\t\t$participantID = $recordCreationDates[$rid];\n\t\tpreg_match_all($labelPattern, $project->metadata['participant_id_group']['element_enum'], $matches);\n\t\t$participantID .= trim($matches[2][$record[$eid]['participant_id_group'] - 1]);\n\t\t$participantID .= $record[$eid]['participant_id_group'];\n\t\tpreg_match_all(\"/\\d+/\", $record[$eid]['participant_employee_id'], $matches);\n\t\t$participantID .= $matches[0][0];\n\t\t\n\t\t$line[1] = $participantID;\n\t\t$line[2] = $record[$eid]['program_referral'] === null ? 10 : $record[$eid]['program_referral'];\n\t\t$line[3] = $record[$eid]['payer'] === null ? 9 : $record[$eid]['payer'];\n\t\tpreg_match_all($labelPattern, $project->metadata['state']['element_enum'], $matches);\n\t\tpreg_match(\"/- ([A-Z]{2})(?:\\s|$)/\", $matches[2][$record[$eid]['state'] - 1], $matches);\n\t\t$line[4] = $matches[1];\n\t\t$line[5] = $record[$eid]['gluctest'] == 1 ? 1 : 2;\n\t\t$line[6] = $record[$eid]['gdm'] == 1 ? 1 : 2;\n\t\t$line[7] = $record[$eid]['risktest'] == 1 ? 1 : 2;\n\t\t$dob = new DateTime($record[$eid]['dob']);\n\t\t$line[8] = $dob->diff($today)->format('%y');\n\t\t$line[9] = $record[$eid]['ethnicity'] == null ? 9 : $record[$eid]['ethnicity'];\n\t\t$line[10] = $record[$eid]['race'][1] == 1 ? 1 : 2;\n\t\t$line[11] = $record[$eid]['race'][2] == 1 ? 1 : 2;\n\t\t$line[12] = $record[$eid]['race'][3] == 1 ? 1 : 2;\n\t\t$line[13] = $record[$eid]['race'][4] == 1 ? 1 : 2;\n\t\t$line[14] = $record[$eid]['race'][5] == 1 ? 1 : 2;\n\t\t$line[15] = $record[$eid]['sex'] == null ? 9 : $record[$eid]['sex'];\n\t\tpreg_match_all($labelPattern, $project->metadata['height']['element_enum'], $matches);\n\t\tpreg_match_all(\"/[0-9]{1,2}/\", $matches[2][$record[$eid]['height'] - 1], $matches);\n\t\t$line[16] = @((int) $matches[0][0] * 12 + (int) $matches[0][1]);\n\t\t$line[17] = $record[$eid]['education'] == null ? 9 : $record[$eid]['education'];\n\t\t\n\t\t$instanceSum = 0;\n\t\tforeach ($record['repeat_instances'][$eid]['sessionscoaching_log'] as $i => $instance) {\n\t\t\t// only add data that's within last 6 months!\n\t\t\t$sess_date = $instance[\"sess_actual_date\"];\n\t\t\tif (empty($sess_date)) {\n\t\t\t\t$sess_date = $instance[\"sess_scheduled_date\"];\n\t\t\t}\n\t\t\t\n\t\t\t$thisdate = strtotime($sess_date);\n\t\t\tif (empty($sess_date) or (!empty($firstdate) and $firstdate > $thisdate) or (!empty($lastdate) and $lastdate < $thisdate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$instanceSum++;\n\t\t\t$line_copy = $line;\n\t\t\t$line_copy[18] = $instance['sess_mode'];\n\t\t\t$line_copy[19] = $instance['sess_id'];\n\t\t\tif ($instance[\"sess_month\"] >= 7) {\n\t\t\t\t$line_copy[19] = 99;\n\t\t\t\t$line_copy[20] = \"CM\";\n\t\t\t}\n\t\t\tif ($instance[\"sess_month\"] >= 7)\n\t\t\t\t$line_copy[20] = \"OM\";\n\t\t\tpreg_match_all($labelPattern, $project->metadata['sess_type']['element_enum'], $matches);\n\t\t\tpreg_match_all(\"/\\(([A-Z]|[A-Z][A-Z])\\)/\", $matches[2][$instance['sess_type'] - 1], $matches);\n\t\t\t$line_copy[20] = $matches[1][0];\n\t\t\t$line_copy[21] = $sess_date == null ? null : date(\"m/d/Y\", strtotime($sess_date));\n\t\t\t$line_copy[22] = $instance['sess_weight'];\n\t\t\t$line_copy[23] = $instance['sess_pa'];\n\t\t\t\n\t\t\t$session_attended = false;\n\t\t\tif ($instance[\"sess_attended\"] or $instance['sess_weight'] or $instance['sess_pa'])\n\t\t\t\t$session_attended = true;\n\t\t\t\n\t\t\tvalidateLine($line_copy, $session_attended);\n\t\t\t\n\t\t\t// if session is marked as attended but weight and/or pa values not included, use 999\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[22]))\n\t\t\t\t$line_copy[22] = 999;\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[23]))\n\t\t\t\t$line_copy[23] = 999;\n\t\t\t\n\t\t\t// if error messages were appended...\n\t\t\tif (isset($line_copy[24]) and isset($_GET['noncompliant'])) {\n\t\t\t\t$noncompliant[] = $line_copy;\n\t\t\t}\n\t\t\t\n\t\t\t// no errors and no non-compliant param\n\t\t\tif (!isset($line_copy[24]) and !isset($_GET['noncompliant'])) {\n\t\t\t\t$data[] = $line_copy;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send participant records with no session data to noncompliant set\n\t\tif ($instanceSum == 0)\n\t\t\t$noncompliant[] = $line;\n\t}\n\t\n\theader('Content-Type: text/csv');\n\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t$fp = fopen('php://output', 'wb');\n\t\n\t// non-compliance report\n\tif (isset($_GET['noncompliant'])) {\n\t\t$data = $noncompliant;\n\t}\n\t\n\tforeach ($data as $line) {\n\t\tfputcsv($fp, $line, ',');\n\t}\n\tfclose($fp);\n}", "public function invoice_audit_trail_export_PDF() {\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $query = $this->reportsModel->get_invoice_audit_trail($tenant_id, NULL, NULL, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $this->load->helper('pdf_reports_helper');\n return invoice_audit_trail_report_PDF($query, $tenant_details);\n }", "public function generate_invoice() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $status = $this->input->post('status');\n $this->load->helper('common_helper');\n \n $paid_details = $this->payments_model->get_invoice_paid_details($invoice_id);\n $paid_arr = array();\n $paid_rcd_till_date = 0;\n foreach ($paid_details as $row) \n {\n $paid_rcd_till_date = $row->amount_recd + $paid_rcd_till_date;\n }\n $total_paid = $paid_rcd_till_date;\n $refund_details = $this->payments_model->get_refund_paid_details($invoice_id);\n $refund_amount = 0;\n foreach ($refund_details as $k => $row) \n {\n $refund_amount = $refund_amount + $row->amount_refund;\n }\n $paid_paid_till_date = $paid_rcd_till_date - $refund_amount;\n \n \n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n $invoice = $this->payments_model->get_invoice_details($clsid, $crsid, $userid);\n $user_org = $this->payments_model->get_user_org_details($userid);\n $invoice_amount=$invoice['total_inv_amount'];\n $invoice_amount_temp=$invoice['total_inv_amount'];\n if($status==\"PAID\"){\n \n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n $invoice_amount=$sfc_amount['amount_recd'];\n $invoice_amount1=$sfc_amount['amount_recd'];\n $invoice_amount=$invoice['total_inv_amount']-$sfc_amount['sfc_claimed'];\n if($sfc_amount['sfc_claimed']>0){\n $mop=explode('_',$sfc_amount['mode_of_pymnt']);\n \n }\n \n }\n //$outstanding_amount=$invoice_amount_temp-$invoice_amount1;\n $outstanding_amount=$invoice_amount_temp-$paid_paid_till_date;\n $tanant = $this->payments_model->get_tanant();\n $date = date('M d Y', strtotime($invoice['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date(''\n . 'h:i A', strtotime($ack_data[class_start_datetime]));\n $after_discount = $invoice['class_fees'] - $invoice['total_inv_discnt'];\n $after_gst = $after_discount + $invoice['total_gst'];\n $Url = base_url() . 'payments/print_invoice';\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n //added by sankar\n $gst_label = 'GST Not Applicable';\n $gst_prelabel = 'GST OFF';\n if (!empty($invoice['gst_rule'])) {\n $gst_label = 'GST ON, ' . $this->meta_data[$invoice['gst_rule']];\n $gst_prelabel = 'GST (' . number_format($invoice['gst_rate'], 2, '.', '') . '%)';\n }\n \n //code ends here\n\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <h2 class=\"sub_panel_heading_style\">Invoice \n <!-- commended by sankar <span class=\"label label-default push_right\"><a href=\"#export\" rel=\"modal:open\" class=\"small_text1\">Print/ Export to PDF</a></span>-->\n </h2>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td align=\"left\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n </tr>\n <tr>\n <td class=\"td_heading\" align=\"left\">' . $tanant[tenant_address] . ' </br>' .\n $tanant[tenant_city] . ' ' . get_catname_by_parm($tanant[tenant_state]) . ' ' . get_catname_by_parm($tanant[tenant_country]) . '</br>\n Tel:' . $tanant[tenant_contact_num] . ' <br>\n ' . $tanant[tenant_email_id] . ' </td>\n </tr>\n\n </table>\n\n </div>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td colspan=\"2\"><font style=\"font-size:18px; font-weight:bold;\">' . $tanant['invoice_name'] . '</font></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong>' . $tanant['invoice_name'] . ' No. </strong> ' . date('Y') . '' . $invoice['invoice_id'] . '<br><strong>' . $tanant['invoice_name'] . ' Date</strong>: ' . $date . '<br><br></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong><u>Individual Details:</u></strong></td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Address:</td>\n <td>' . $user_org[personal_address_bldg] . '</br>\n ' . $user_org[personal_address_city] . ' '\n . $this->meta_data[$user_org[personal_address_state]] . ' '\n . $this->meta_data[$user_org[personal_address_country]] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Contact No:</td>\n <td>' . $user_org[contact_number] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Attention:</td>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n </tr>\n </table>\n\n </div>\n\n <div style=\"clear:both;\"></div>\n <br>\n <div class=\"table-responsive\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th class=\"th_header\">Description</th>\n <th class=\"th_header\">Unit Price</th>\n <th class=\"th_header\">Total</th>\n \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' . $ack_data['crse_name'] . ', ' . $invoice['class_name'] . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n \n </tr>\n \n <tr>\n <td>' . $this->meta_data[$invoice['discount_type']] . ' Discount @ ' . number_format($invoice['discount_rate'], 2, '.', '') . '%</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">After Discounts</td>\n <td>$' . number_format($after_discount, 2, '.', '') . '</td>\n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_prelabel . '</td>\n <td>$' . number_format($invoice['total_gst'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_label . '</td>\n <td>$' . number_format($after_gst, 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Subsidy :</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Skills Future Credit :</td>\n <td></td>\n <td>$' .number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n </tr>\n \n <tr class=\"info\">\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">Invoice Amount</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n \n </tr>\n </tbody>\n </table>\n </div>\n <br>\n <div class=\"table-responsive\">\n <div>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th colspan=\"9\">Particulars of Participants</th>\n </tr>\n <tr>\n <th width=\"16%\" class=\"th_header\">Name</th>\n <th width=\"13%\" class=\"th_header\">Tax Code</th>\n <th width=\"9%\" class=\"th_header\">TG# </th>\n <th width=\"10%\" class=\"th_header\">Subsidy</th>\n <th width=\"12%\" class=\"th_header\">Discount</th>\n <th width=\"13%\" class=\"th_header\">GST Amount</th>\n <th width=\"13%\" class=\"th_header\">SFC('.$mop[1].') Amount</th>\n <th width=\"16%\" class=\"th_header\">Unit Fee(GST Applicable)</th>\n <th width=\"11%\" class=\"th_header\">Remarks </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n <td>' . $user_org[tax_code] . '</td>\n <td>' . $invoice[tg_number] . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_discnt], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_gst], 2, '.', '') . '</td>\n <td>$' . number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n <td>'. $invoice['payment_status'].'</td> \n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n \n <td colspan=\"2\">OUT STANDING AMOUNT</td>\n <td>$' . number_format($outstanding_amount, 2, '.', '') . '</td>\n <td></td> \n \n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"clear:both;\"></div>\n <br>\n <p class=\"red\">This is a computer generated invoice. No signature is required- ' . $tanant['tenant_name'] . ' Administrator.</p>\n <div style=\"color:red;\">' . html_entity_decode($tanant['invoice_footer_text']) . '</div>\n <div style=\"clear:both;\"></div><br>\n <span style=\"float:right;\">\n<!-- <button class=\"btn btn-primary\" type=\"submit\">Print</button></form><br><br>-->\n ';\n }", "public function Reporte(){\r\n\t\t$roles=new RolesModel();\r\n\t\t//Conseguimos todos los usuarios\r\n\t\t\r\n\t\r\n\t\r\n\t\tsession_start();\r\n\t\r\n\t\r\n\t\tif (isset( $_SESSION['usuario']) )\r\n\t\t{\r\n\t\t\t$resultRep = $roles->getByPDF(\"id_rol, nombre_rol\", \" nombre_rol != '' \");\r\n\t\t\t$this->report(\"Roles\",array(\t\"resultRep\"=>$resultRep));\r\n\t\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\r\n\t}", "public function sendMarks($noOfStudent ){\n\t\t$datestring = '%Y/%m/%d';\n\t\t$date = mdate($datestring);\n\n\t\t//echo \"Total student\".$noOfStudent;\n\n\t\t$teacherid = $this->session->userdata('username');\n\t\t$subjectid = $this->input->post('subjectid');\n\t\t$fullmarks = $this->input->post('fullmarks');\n\t\t$passmarks = $this->input->post('passmarks');\n\t\t$semester = $this->input->post('semester');\n\t\t$term = $this->input->post('term');\n\n\t\t$i;\n\t\t$marks = array(\n\t\t\t\t\t\tarray('teacherid' => $teacherid,\n\t\t\t\t\t\t\t'course_id' => $subjectid,\n\t\t\t\t\t\t\t'fullmarks' => $fullmarks,\n\t\t\t\t\t\t\t'passmarks' => $passmarks,\n\t\t\t\t\t\t\t'semester' => $semester,\n\t\t\t\t\t\t\t'term' => $term,\n\t\t\t\t\t\t\t'userid' => '',\n\t\t\t\t\t\t\t'obtainmarks' => '',\n\t\t\t\t\t\t\t'date' => $date ),\n\n\t\t \t\t\t\t);\n\n\t\tfor ($i=0; $i < $noOfStudent; $i++) { \n\t\t\t$marks[$i]['teacherid'] = $teacherid;\n\t\t\t$marks[$i]['course_id'] = $subjectid;\n\t\t\t$marks[$i]['fullmarks'] = $fullmarks;\n\t\t\t$marks[$i]['passmarks'] = $passmarks;\n\t\t\t$marks[$i]['semester'] = $semester;\n\t\t\t$marks[$i]['term'] = $term;\n\t\t\t$marks[$i]['userid'] = $this->input->post(\"sid\".$i);\n\t\t\t$marks[$i]['obtainmarks'] = $this->input->post('oid'+$i);\n\t\t\t$marks[$i]['date'] = $date;\n\t\t}\n\n\t\t$status = $this->staff_model->sendAllMarks($marks);\n\n\n\t\t$email = $this->session->userdata('username');\n\t\t$data['mail']=$email;\n\t\tif($status == true){\n\t\t\t$a = array('no'=> 1, 'sucmsg'=>\"Marks Sent Successfully!!!\");\n\t\t\t$this->load->view('templates/header');\n\t\t\t$this->load->view('templates/staff_nav',$data);\n \t$this->load->view('staff_views/sendmark',$a);\n \t$this->load->view('templates/footer');\n\t\t}\n\t\t\n\t}", "abstract public function buildReport();", "public function paytax_reports()\n\t{\n\t\t$data['title'] = \"Payroll Tax Report\"; //Page title\n\t\t$this->reports_model->_table_name = \"tbl_allow_ded\";\n\t\t$this->reports_model->_order_by = \"id\";\n\t\t\n $data['global_allowance'] = $this->reports_model->get_by(array('id_gsettings' => $this->session->userdata('id_gsettings')));\n\t\t\n\t\t$flag = $this->input->post('sbtn', TRUE);\n\t\tif(!empty($flag))\n\t\t{\n\t\t\t$data['flag'] = 1;\n\t\t\t$data['month'] = $this->input->post('txtmonth');\n\t\t\t$data['paytax_history'] = $this->reports_model->get_emp_salary_details($data['month'],'pay_tax');\n\t\t}\n $data['subview'] = $this->load->view('admin/reports/paytax_reports', $data, TRUE);\n $this->load->view('admin/_layout_main', $data); //page load\n\t}", "public function postProcess() {\n $config =& CRM_Core_Config::singleton( );\n \t\t$params = $this->controller->exportValues( );\n \t\t\n \t\tif(!empty($params['start_date']))\n \t\t $start_date = CRM_Utils_Date::processDate($params['start_date']);\n \t\tif(!empty($params['next_sched_contribution'])) \n \t\t $next_sched_contribution = CRM_Utils_Date::processDate($params['next_sched_contribution']);\n \t\t\n if ($params['action'] == 'add') {\n //$recur->create_date = date( 'YmdHis' );\n $sql = \"INSERT INTO civicrm_contribution_recur SET contact_id = %1 , amount = %2 , frequency_interval = %3 , frequency_unit = %4 , invoice_id = %5 ,\n trxn_id = %6 , currency = %7 , create_date = %8 , start_date = %9 , next_sched_contribution = %10 , processor_id = %11\";\n $invoice_id = md5(uniqid(rand(), true));\n $recur_params = array(\n 1 => array( $params['cid'] , 'Integer' ) , \n 2 => array( $params['amount'] , 'String' ) ,\n 3 => array( $params['frequency_interval'] , 'String' ) ,\n 4 => array( $params['frequency_unit'] , 'String' ) ,\n 5 => array( $invoice_id , 'String' ) ,\n 6 => array( $invoice_id , 'String' ) ,\n 7 => array( $config->defaultCurrency , 'String' ) ,\n 8 => array( date('YmdHis') , 'String' ) ,\n 9 => array( $start_date , 'String' ) ,\n 10 => array( $next_sched_contribution , 'String' ) ,\n 11 => array( $params['processor_id'] , 'String' )\n \n );\n $status = ts('Recurring Contribution setup successfully'); \n }\n elseif ($params['action'] == 'update') {\n $sql = \"UPDATE civicrm_contribution_recur SET amount = %1 , frequency_interval = %2 , frequency_unit = %3 ,\n start_date = %4 , next_sched_contribution = %5 , modified_date = %6 , processor_id = %8 WHERE id = %7\";\n $recur_params = array(\n 1 => array( $params['amount'] , 'String' ) ,\n 2 => array( $params['frequency_interval'] , 'String' ) ,\n 3 => array( $params['frequency_unit'] , 'String' ) ,\n 4 => array( $start_date , 'String' ) ,\n 5 => array( $next_sched_contribution , 'String' ) ,\n 6 => array( date('YmdHis') , 'String' ) ,\n 7 => array( $params['id'] , 'Integer') ,\n 8 => array( $params['processor_id'] , 'String' )\n );\n \n $status = ts('Recurring Contribution updated'); \n }\n \n CRM_Core_DAO::executeQuery($sql , $recur_params);\n \n $session = CRM_Core_Session::singleton( );\n CRM_Core_Session::setStatus( $status );\n \n CRM_Utils_System::redirect( '?q=civicrm/contact/view&reset=1&cid='.$params['cid'] );\n\t }", "public function invoice_audit_trail_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n //Build required values to display invoice audit report in table format\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_invoice_audit_trail($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n\n //EXPORT PART\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Inv Dt.', 'Inv Type', 'Taxcode', 'Discount', 'Subsidy', 'GST', 'Net Amt.', 'Prev. Inv. Number', 'Next Inv. Number');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $paid_arr = array('PAID' => 'Paid', 'PARTPAID' => 'Part Paid', 'NOTPAID' => 'Not Paid');\n $paid_sty_arr = array('PAID' => 'color:green;', 'PARTPAID' => 'color:red;', 'NOTPAID' => 'color:red;');\n if ($tabledata[$i]->enrolment_mode == 'SELF') {\n $taxcode = $tabledata[$i]->tax_code;\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n $status = $paid_arr[$tabledata[$i]->payment_status];\n } else {\n // Modified by dummy for internal staff enroll on 01 Dec 2014.\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name;\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name;\n }\n $status = ($tabledata[$i]->payment_status > 0) ? 'Part Paid/Not Paid' : 'Paid';\n }\n $inv_type1 = $tabledata[$i]->inv_type1 . ' (' . $name . ')';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = $inv_type1;\n $excel_data[$i][] = $this->mask_format($taxcode);\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_discnt, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_subsdy, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_gst, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '') . ' SGD';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = $tabledata[$i]->regen_inv_id;\n }\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n $excel_filename = 'invlice_audit_list.xls';\n $excel_sheetname = 'Invoice Audit Trail';\n $excel_main_heading = 'Accounting Reports - Invoice Audit Trail' . $period;\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "public function viewcontract_reportemployee() { \r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n );\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $employeeid = $this->uri->segment(3);\r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['clientname'] = strtoupper($set_data['firstname']) .\" \". strtoupper($set_data['lastname']);\r\n $records['employeecontract']=$this->Client_Model->viewcontractemployee($set_data['clientID'], $employeeid);\r\n if ($set_data['username']){\r\n $this->load->view('contractdetail', $records); \r\n }\r\n else{\r\n $this->load->view('login');\r\n }\r\n }", "public function dormitoryReport() {\n $data['dormitory'] = $this->common->getAllData('dormitory');\n $data['dormitoryRoom'] = $this->common->getAllData('dormitory_room');\n $data['dormitory_bed'] = $this->common->getAllData('dormitory_bed');\n $this->load->view('temp/header');\n $this->load->view('dormitoryReport', $data);\n $this->load->view('temp/footer');\n }" ]
[ "0.78921235", "0.6877639", "0.63729405", "0.63677514", "0.6346944", "0.6255291", "0.60872173", "0.6075249", "0.5999765", "0.59749573", "0.5970591", "0.5963558", "0.5930038", "0.59207654", "0.5920088", "0.5911183", "0.58961457", "0.58660185", "0.58473986", "0.5843417", "0.5839251", "0.58361727", "0.5826392", "0.5813611", "0.58129823", "0.5805866", "0.58003485", "0.57954794", "0.5791967", "0.5782226", "0.5778544", "0.5776056", "0.57611525", "0.57553625", "0.57462233", "0.5742617", "0.57357544", "0.57304317", "0.56759363", "0.56644183", "0.5663315", "0.5650022", "0.5649546", "0.56414676", "0.56413484", "0.5639113", "0.56384486", "0.5632259", "0.56232655", "0.5620259", "0.5615513", "0.5613836", "0.5605752", "0.56007373", "0.5599147", "0.55966586", "0.55904883", "0.5581717", "0.55807465", "0.55632764", "0.556264", "0.5557997", "0.5557843", "0.5556331", "0.55547047", "0.5553824", "0.5546863", "0.55404794", "0.55329907", "0.55314654", "0.55297995", "0.5528178", "0.5527193", "0.55271786", "0.5522788", "0.55186296", "0.55154014", "0.5512301", "0.5505114", "0.55005586", "0.549913", "0.54933256", "0.54854804", "0.54842323", "0.547531", "0.5472558", "0.5472558", "0.5470688", "0.54650813", "0.5463285", "0.5462699", "0.5456334", "0.54552335", "0.5449493", "0.5449241", "0.5448906", "0.5442807", "0.5441999", "0.5441969", "0.5438809" ]
0.84146255
0
Gets the invoice timestamp.
Получает временной штамп счета.
public function getInvoiceTimestamp();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp()\n\t{\n\t\treturn $this->getValue('timestamp');\n\t}", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n { return $this->get('timestamp'); }", "public function getTimestamp() {\n return $this->timestamp;\n }", "public function getTimestamp() {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function getTimestamp() \n\t{\n\t\treturn $this->timestamp;\n\t}", "function getTimestamp() {\n return $this->time_stamp;\n }", "public function getTimestamp()\n {\n return $this->_timestamp;\n }", "public function getTimestamp()\n {\n return $this->proxyBase->timestamp;\n }", "public function getTimestamp() {\n\n return $this->timestamp;\n }", "public function getTimestamp()\n\t\t\t{\n\t\t\t\treturn $this->timestamp;\n\t\t\t}", "public function getTimestamp()\n {\n return $this->dateIssued->getTimestamp();\n }", "public function getTimestamp()\r\n {\r\n return $this->_timestamp;\r\n }", "public function getTimestamp(){\n\t\treturn $this->_timestamp;\n\t}", "public function getTimestamp()\n\t{\n\t\treturn $this->_timestamp;\n\t}", "public function getTimestamp()\n {\n return $this->baseEvent->getTimestamp();\n }", "public function getTimestamp()\n {\n }", "public function getTimeStamp() {\n return $this->timestamp;\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "public function getTimeStamp()\n\t{\n\t\treturn $this->_current_timestamp;\n\t}", "public function getEventTimestamp();", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "public function getTimestamp()\n {\n return time();\n }", "public function getTimestamp() { \n\t\tif ($this->change) {\n\t\t\t$this->_calc();\n\t\t}\n\t\t\n\t\treturn $this->timestamp; \n\t}", "public function getTimeStamp() {\n\t\treturn $this->timeStamp;\n\t}", "private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }", "public static function curTimestamp()\n {\n return date_timestamp_get(new DateTime());\n }", "public function getTimestamp()\n {\n return $this->currentMonth[0];\n }", "protected function getTimeStamp(){\n\t\t$result = $this->getFile()->getProperty('tstamp');\n\t\tif ($this->processedFile) {\n\t\t\t$result = $this->processedFile->getProperty('tstamp');\n\t\t}\n\t\treturn $result;\n\t}", "public function expirationTimestamp()\n {\n if ($this->expiration instanceof \\DateTime) {\n return $this->expiration->getTimestamp();\n }\n }", "protected static function getTimestamp()\n\t{\n\t\treturn date(\"Y-m-d H:00:00\");\n\t}", "public function getTime()\n {\n return date('c', strtotime($this->data['payment_date']));\n }", "public function getInvdate()\n {\n return $this->invdate;\n }", "protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "protected function getTimeStamp() {\n return time().' ('.strftime( '%Y.%m.%d %H:%I:%S', time() ).')';\n }", "public function getDocTime()\n {\n return $this->doc_time;\n }", "public function getInvoiceDate()\n {\n if (array_key_exists(\"invoiceDate\", $this->_propDict)) {\n if (is_a($this->_propDict[\"invoiceDate\"], \"\\Beta\\Microsoft\\Graph\\Model\\DateTimeTimeZone\") || is_null($this->_propDict[\"invoiceDate\"])) {\n return $this->_propDict[\"invoiceDate\"];\n } else {\n $this->_propDict[\"invoiceDate\"] = new DateTimeTimeZone($this->_propDict[\"invoiceDate\"]);\n return $this->_propDict[\"invoiceDate\"];\n }\n }\n return null;\n }", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "public function getTstamp()\n {\n return $this->tstamp;\n }", "public static function timestamp(){\n $timestamp = time();\n return $timestamp;\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }", "public function getEventTime()\n {\n return $this->event_time;\n }", "public function getEventTime()\n {\n return $this->event_time;\n }", "public function getTstamp() {\n\t\treturn $this->tstamp;\n\t}", "public function getTimestamp()\n {\n return (int) floor(microtime(true) / $this->keyRegeneration);\n }", "public function getTimestamp()\n {\n return $this->server['REQUEST_TIME'];\n }", "private static function timestamp(){\n date_default_timezone_set('Africa/Nairobi');\n $time = time();\n return date(\"Y-m-d G:i:s\", $time);\n }", "public function timestamp();", "public function getStartTimestamp() {}", "function get_date_of_previous_invoice() {\n\t\tforeach ($this->get_calendar_events(time()-(86400 * 90), time()) as $event) {\n\t\t\tif (preg_match($this->config['calendar_entry'], $event->title->text, $m)) {\n\t\t\t\tforeach ($event->when as $when) {\n\t\t\t\t\treturn substr($when->startTime,0,10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdie(\"Unable to find a previous invoice entry in the calendar.\\n\");\n\t}", "public function getInvoiceProcessingTime()\n {\n return $this->invoiceProcessingTime;\n }", "public function _getTimestamp()\n {\n $DateTime = new DateTime($this->_getDatePublish());\n return $DateTime->getTimestamp();\n }", "public function getCheckinTimeStamp()\n\t{\n\t\treturn $this->checkin;\n\t}", "public function getRevisionTime()\n {\n return $this->revisionTime;\n }", "function getTime()\n {\n return date('Y-m-d H:i:s', $this->model->getTime());\n }", "protected function getTimeStamp()\n {\n return time() . ' (' . strftime('%Y.%m.%d %H:%I:%S', time()) . ')';\n }", "abstract public function getTstamp();", "static public function timestamp()\r\n {\r\n $output = date('Y-m-d H:i:s', time());\r\n return $output;\r\n }", "public function getTimestamp() : float\n {\n return $this->timestamp;\n }", "public function getOffer_timestamp()\n {\n return $this->offer_timestamp;\n }", "public function getTimestamp()\n {\n return strtotime($this->getValue());\n }", "public function get() {\n\t\treturn (new \\DateTime)->getTimestamp()*1000;\n\t}", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTimestampSent(): string\n {\n $temp=$this->timestampSent;\n return $temp->format('D H:i');\n }", "public static function timestamp() {}", "public function getStamp()\n {\n return $this->_list->getStamp();\n }", "public function getStamp()\n {\n return $this->_list->getStamp();\n }", "public function getTime()\n {\n return $this->get(self::TIME);\n }", "function getDateTime(){\r\n return date('jS F Y\\, g:ia',$this->timestamp);\r\n }", "public function getCurrent() {\r\n $currentDate = new \\DateTime();\r\n return $currentDate->getTimestamp();\r\n }" ]
[ "0.70949066", "0.70701075", "0.70630103", "0.70630103", "0.70630103", "0.70532495", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7016278", "0.69950724", "0.69950724", "0.69841284", "0.6980688", "0.6969136", "0.6966403", "0.6960639", "0.69595903", "0.6957801", "0.6940367", "0.69123375", "0.6911759", "0.69032854", "0.6902137", "0.6863236", "0.6855794", "0.6811446", "0.6775791", "0.6756615", "0.6753594", "0.6734579", "0.67317605", "0.6720125", "0.6708321", "0.6665589", "0.66388893", "0.6637504", "0.66340363", "0.6633711", "0.6589092", "0.650845", "0.64931077", "0.64795077", "0.64732873", "0.64732873", "0.64326406", "0.64191234", "0.64183885", "0.6398372", "0.6386914", "0.63754153", "0.6361918", "0.63356555", "0.63356555", "0.6326653", "0.63095033", "0.6307841", "0.62939996", "0.62769616", "0.6271995", "0.6269085", "0.626782", "0.62644285", "0.62421876", "0.62398225", "0.6231615", "0.62223643", "0.622116", "0.6206409", "0.61917275", "0.61794204", "0.6178379", "0.61543226", "0.61535937", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61488396", "0.61329687", "0.61329496", "0.61320156", "0.61320156", "0.61311436", "0.6127606", "0.6118934" ]
0.89875394
0
Returns route that can be matched against specified methods.
Возвращает маршрут, который можно сопоставить с указанными методами.
public function withMethods(array $methods): Route;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getRoutesForMethod($method);", "public function test_match_withSupportedMethod()\n {\n $route = new Route('GET|POST', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if method provided is supported by the route instanciated with more than one method.'\n );\n }", "function match($methods, $uri, $action)\n {\n Route::match($methods, $uri, $action);\n }", "public function match($methods, $uri, $action)\n {\n return $this->addRoute(\\array_map('strtoupper', (array) $methods), $uri, $action);\n }", "public function match($methods, $pattern, $fn)\n {\n\n $pattern = $this->baseRoute . '/' . trim($pattern, '/');\n $pattern = $this->baseRoute ? rtrim($pattern, '/') : $pattern;\n\n $params = [];\n foreach(explode('/',$pattern) as $item){\n if(strpos($item, '{') !== false && strpos($item, '}') !== false){\n $is_required = strpos($item, '?') !== false?false:true;\n $params[str_replace(['}','{','?'],'',$item)] = array('required'=>$is_required);\n }\n }\n $routeName = is_string($fn)\n ? strtolower(preg_replace(\n '/[^\\w]/i', '.', str_replace($this->namespace, '', $fn)\n ))\n : null;\n\n $routeName = (!is_null($this->defaultName))?$this->defaultName.'.'.$routeName:$routeName;\n\n $middlewares = [];\n\n if(!is_null($this->defaultMiddleware)){\n $middlewares = (is_string($this->defaultMiddleware))?[$this->defaultMiddleware]:(is_array($this->defaultMiddleware)?$this->defaultMiddleware:[]);\n }\n\n foreach (explode('|', $methods) as $method) {\n $this->routes[] = [\n 'method' => $method,\n 'pattern' => $pattern,\n 'fn' => $fn,\n 'name'=>$routeName,\n 'fields'=>$params,\n 'middlewares'=> $middlewares\n ];\n }\n return $this;\n }", "public function route(string $requestUri, string $requestMethod);", "public function getRoutesOf(String $method)\n {\n $method = strtoupper($method);\n\n if (!isset($this->routes[$method])) return null;\n\n return $this->routes[$method];\n }", "public function match($methods, $path, $action)\n {\n $methods = array_map('strtoupper', (array) $methods);\n\n return $this->addRoute($methods, $path, $action);\n }", "public function getDynamic(string $regex, string $method = null): Route|null;", "public function findMatch(\\string $uri, \\string $method);", "public function match($url=null, $method=null)\n{\n foreach(RouteCollection::group($method) as $route)\n {\n $regex = $route->convertPattern();\n if(preg_match($regex, $url, $matches))\n {\n array_shift($matches);\n $this->matches = $matches;\n $this->route = $route;\n $route->register('matches', $matches);\n $route->register('regex', $regex);\n return $route->parameters();\n }\n }\n return false;\n}", "private function match($uri, $method)\n\t{\n\t\tif(isset($this->routes[$method]) and !empty($this->routes[$method]))\n\t\t{\n\t\t\tforeach(array_keys($this->route[$method]) as $route)\n\t\t\t{\n\t\t\t\tforeach($this->choices as $search => $replace)\n\t\t\t\t{\n\t\t\t\t\t$route = str_replace($search, $replace, $route);\n\t\t\t\t}\n\n\t\t\t\tif($route == '(.+)')\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $uri,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telseif(preg_match('#^'.$route.'$#i', $uri, $matches))\n\t\t\t\t{\n\t\t\t\t\t$parameters = [];\n\n\t\t\t\t\tfor($i = 1, $count = count($matches); $i < $count; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$parameters[] = $matches[$i];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $parameters,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testRouterAddByAddRouteSeveralMethods($method)\n {\n $router = new Router();\n\n $router->any([\"GET\", \"POST\"], \"user\", function () {\n return \"user\";\n });\n\n $router->always(function () {\n return \"always\";\n });\n\n $res = $router->handle(\"user\", $method);\n if ($method === \"GET\" || $method === \"POST\") {\n $this->assertEquals(\"user\", $res);\n }\n\n if (!($method === \"GET\" || $method === \"POST\")) {\n $this->assertEquals(\"always\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function getRoutesByMethod()\n {\n return collect($this->getRoutes())\n ->groupBy(function (Route $route) {\n return $route->methods();\n })\n ->map(function (Collection $routes) {\n return $routes->mapWithKeys(function (Route $route) {\n return [$route->getDomain().$route->uri => $route];\n })->all();\n })\n ->all();\n }", "public function getRoutes($method = null)\n {\n if (null !== $method) {\n return (isset($this->routes[$method])) ? $this->routes[$method] : null;\n } else {\n return $this->routes;\n }\n }", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}", "private static function route($method, $request){\n\t\t $params = array(\n\t\t\t\t\t\t\t'splat' => array(),\n\t\t\t\t\t\t\t'captures' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t// If the HTTP method and the request exactly match an existing route,\n\t\t\tif(isset(self::$routes[$method][$request])){\n\t\t\t\n\t\t\t\t// Then we store the anonymous function defined for that route.\n\t\t\t\t$function = self::$routes[$method][$request];\n\t\t\t\n\t\t\t/*\tIf there is no exact match, we check to see if there are any routes that match when you treat\n\t\t\t\tthem as regexes. We also treat named parameter and splat segments as matches. */\n\t\t\t} elseif( ($route = self::reverse_preg_match_array($request, array_keys(self::$routes[$method]), array('#\\*(/|$)#', '/:[A-Za-z0-9]+/'))) && $route !== false ) {\n\t\t\t\n\t\t\t\t// If multiple matching routes were returned, we pick the last one.\n\t\t\t\t$route = end($route);\n\t\t\t\t\n\t\t\t\t// Once we've found the matching route, we retrieve and store its anonymous function.\n\t\t\t\t$function = self::$routes[$method][$route];\n\t\t\t\t\n\t\t\t\t/*\tNext, we need to construct the $params array to pass into the anonymous function. In\n\t\t\t\t\torder to do that, we need to extract all the path segments where the user's request\n\t\t\t\t\tmatched a regex pattern, named parameter, or splat segment. We call a helper\n\t\t\t\t\tfunction to extract these path segments for us. Since these path segments are the\n\t\t\t\t\tonly ones for which the request differs from the defined route, it's simple to\n\t\t\t\t\textract them. */\n\t\t\t\t$changes = self::url_diff($request, $route);\n\t\t\t\t\n\t\t\t\t// We go through each difference, and store the appropriate value in $params:\n\t\t\t\tforeach($changes as $change){\n\t\t\t\t\n\t\t\t\t\t// A difference is stored as an array that contains the route segment as its only key, with the corresponding request segment as the value.\n\t\t\t\t\tforeach($change as $index => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a named parameter (i.e. it starts with a colon ):\n\t\t\t\t\t\tif(preg_match('/^:/', $index)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Strip off the leading colon,\n\t\t\t\t\t\t\t$index = preg_replace('/^:/', '', $index);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and add the key-value pair to the $params array.\n\t\t\t\t\t\t\t$params[$index] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a splat,\n\t\t\t\t\t\t} elseif ($index == '*'){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['splat'] array.\n\t\t\t\t\t\t\t$params['splat'][] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a regex (or, if the request has more segments than the route\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['captures'] array.\n\t\t\t\t\t\t\t$params['captures'][] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// If we've found a matching route, then $function will already be set. If we haven't, we'll use the not_found function.\n\t\t\tif(!isset($function)){\n\t\t\t\t$function = self::$not_found;\n\t\t\t}\n\t\t\t\n\t\t\t// Return the function for matched route, and the $params to pass into it when executed. \n\t\t\treturn array($function, $params);\n\t\t}", "public static function match($methods, $pattern, $callback)\n\t{\n\t\tforeach ($methods as $method) {\n\t\t\tself::route(strtoupper($method), $pattern, $callback);\n\t\t}\n\t}", "public function getRouteMatch();", "public static function getRoutes();", "public static function getRoutes();", "public function test_route_method_string() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );\n\t}", "public function match($methods, $match, $rewrite = null, $closure = null);", "public function match($requestUrl = null, $requestMethod = null)\n {\n\n $params = [];\n\n // set Request Url if it isn't passed as parameter\n if ($requestUrl === null) {\n $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\n }\n\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n\n // Strip query string (?a=b) from Request Url\n if (($strpos = strpos($requestUrl, '?')) !== false) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n\n $lastRequestUrlChar = $requestUrl[strlen($requestUrl) - 1];\n\n // set Request Method if it isn't passed as a parameter\n if ($requestMethod === null) {\n $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n }\n\n foreach ($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n\n $method_match = (stripos($methods, $requestMethod) !== false);\n\n if ($route === '*') {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n // Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)\n if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position - 1] !== '/')) {\n continue;\n }\n\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n\n if ($match) {\n if ($params) {\n foreach ($params as $key => $value) {\n if (is_numeric($key)) {\n unset($params[$key]);\n }\n }\n }\n\n // Method did not match, continue to next route.\n if (!$method_match) {\n $this->methodError = true;\n continue;\n } else {\n $this->methodError = false;\n }\n\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n ];\n }\n }\n\n if ($this->methodError) {\n return self::METHOD_ERROR;\n } else {\n return self::NO_MATCH;\n }\n }", "function match_and_exec($method, $path)\n {\n $possible_routes = $this->routes[$method];\n foreach($possible_routes as $route)\n {\n $result = $route->match($path);\n if (is_array($result) == false)\n {\n continue;\n }\n return $route->call($result);\n }\n return false;\n }", "public function match($requestUrl = null, $requestMethod = null)\n {\n $params = [];\n // set Request Url if it isn't passed as parameter\n if ( $requestUrl === null ) {\n $requestUrl = Server::isSetted('REQUEST_URI') ? Server::get('REQUEST_URI') : '/';\n }\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n // Strip query string (?a=b) from Request Url\n if ( ($strpos = strpos($requestUrl, '?')) !== false ) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';\n // set Request Method if it isn't passed as a parameter\n if ( $requestMethod === null ) {\n $requestMethod = Server::isSetted('REQUEST_METHOD') ? Server::get('REQUEST_METHOD') : 'GET';\n }\n foreach ($this->routes as $handler) {\n list($methods,$route,$target,$name,$permissions) = $handler;\n $method = (stripos($methods,$requestMethod) !== false);\n // Method did not match, continue to next route.\n if ( !$method ) {\n continue;\n }\n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif ( isset($route[0]) && $route[0] === '@' ) {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif ( ($position = strpos($route, '[')) === false ) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n if ( strncmp($requestUrl,$route,$position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/') ) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex,$requestUrl,$params) === 1;\n }\n if ( $match ) {\n if ( $params ) {\n foreach ($params as $key => $value) {\n if ( TypeCheck::isInt($key) ) {\n unset($params[$key]);\n }\n }\n }\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name,\n 'permissions' => $permissions\n ];\n }\n }\n return false;\n }", "public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}", "public static function route();", "public function test_match_withUnsupportedMethod()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('POST', '/home'),\n 'match() must return false method provided is not supported by the route.'\n );\n }", "static public function validUriMethodProvider()\n {\n return array(\n array('/foo', 'GET'),\n array('/', 'POST'),\n array('*', 'OPTIONS'),\n array('baz:1234', 'CONNECT'),\n array('http://example.com', 'GET'),\n array('/a/b/?d=e&f=g', 'FAKEMETHOD'),\n array('/some+encoded/%aa%bb%cc/text', 'HEAD')\n );\n }", "public function test_route_method_comma_seperated() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET,POST',\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "function __invoke($method, $uri)\n {\n $method = strtolower($method);\n if (!isset($this->routes[$method])) {\n return null;\n }\n\n foreach ($this->routes[$method] as $regex => $callback) {\n\n if (preg_match($regex, $uri, $params)) {\n array_shift($params);\n return call_user_func_array($callback, $params);\n }\n }\n return null;\n }", "public function testGetOnHitReturnsRoutesWithMethodAction(): void\n {\n $routes = new RouteCollection([\n new Route(\n new UriTemplate('foo'),\n new MethodRouteAction('Foo', 'bar'),\n [$this->createMock(IRouteConstraint::class)],\n [new MiddlewareBinding('foo')]\n )\n ]);\n $this->cache->set($routes);\n $this->assertEquals($routes, $this->cache->get());\n }", "public function map(array $methods, $pattern, $callable)\n\t\t{\n if(!empty($this->groups))\n {\n \t$pp = '';\n \tforeach($this->groups as $group)\n \t $pp .= $group->getPattern();\n\n \t\t$pattern = $pp . $pattern;\n }\n\n\t\t\t// Create a new route\n\t\t\t$route = new Route($methods, $pattern, $callable, $this->groups);\n\t\t\t$route->setContainer($this->container);\n\n\t\t\t// Add route to routes\n\t\t\t$this->routes[] = $route;\n\n\t\t\treturn $route;\n\t\t}", "public function match($methods, $pattern, $func)\n {\n $pattern = $this->setBaseRoute($pattern);\n\n foreach (explode('|', $methods) as $method) {\n $this->routes[$method][] = array(\n 'pattern' => $pattern,\n 'fn' => $func\n );\n }\n\n return $this;\n }", "public function get($method = null)\n {\n return $this->getRoutesByMethod()[$method] ?? [];\n }", "function serve(array $routes, string $reqmethod, string $reqpath, ...$args): callable {\n\n $action = null;\n $params = null;\n $mwares = null;\n\n # test method + path against action method + expression\n foreach ($routes as [$actmethod, $regexp, $handlers]) {\n if ($reqmethod === $actmethod && preg_match($regexp, $reqpath, $caps)) {\n # action is last in the handlers chain\n $action = array_pop($handlers);\n $params = array_slice($caps, 1);\n $mwares = $handlers;\n break;\n }\n }\n\n # no matching route, 404\n if (empty($action)) {\n return call_user_func(_404(), ...$args);\n }\n\n # if we have params, run them through bindings\n $bindings = stash(DISPATCH_BINDINGS_KEY) ?? [];\n if (count($params) && count($bindings)) {\n foreach ($params as $key => $val) {\n $params[$key] = isset($bindings[$key])\n ? call_user_func($bindings[$key], $params[$key], ...$args)\n : $params[$key];\n }\n }\n\n # wrap action as last midware chain link\n $next = function () use ($action, $params, $args) {\n return empty($params)\n ? $action(...$args)\n : $action($params, ...$args);\n };\n\n # prepend matching global middleware into middleware chain\n $globalmwares = array_reverse(stash(DISPATCH_MIDDLEWARE_KEY) ?? []);\n foreach ($globalmwares as $middleware) {\n $pattern = array_shift($middleware);\n if (preg_match($pattern, $reqpath)) {\n array_unshift($mwares, ...$middleware);\n }\n }\n\n # build midware chain, from last to first, if any\n foreach (array_reverse($mwares) as $middleware) {\n $next = function () use ($middleware, $next, $params, $args) {\n return empty($params)\n ? $middleware($next, ...$args)\n : $middleware($next, $params, ...$args);\n };\n }\n\n # trigger middleware chain + handlers\n return $next();\n}", "public function get_matched_route()\n {\n }", "public function getStatic(string $path, string $method = null): Route|null;", "public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }", "public function map(array $methods, string $pattern, $callable): MethodsInterface;", "public function getRoute();", "public function find($uri, $methods) {\n $route = $this->collection->match($uri, $methods);\n\n if ($route == false) { \n echo \"404\";\n return;\n }\n\n if ($this->collection->middleware !== NULL) {\n foreach ($this->collection->middleware as $m) {\n $m->run($route);\n }\n }\n\n $this->run($route->action);\n }", "public function resolve(string $uri, string $method = null, array $options = null): array|null\n {\n $routes = $this->routes();\n $routes || throw new RouterException('No route directives to resolve');\n\n $options = array_options($options, self::$options);\n $patterns = [];\n\n foreach ($routes as $i => [$pattern]) {\n $pattern || throw new RouterException('No pattern given for route `%s`', $i);\n\n // Format named parameters if given.\n if (str_contains($pattern, ':')) {\n $pattern = preg_replace_callback(\n // Eg: /:id[\\d] or /:tab{show|hide}\n '~(?<!\\?):(\\w+)(?:(?<c>[\\[\\{])(.+?)[\\]\\}])?~',\n function ($match) {\n $name = $match[1];\n\n // Simple (eg: /book/:id => /book/(?<id>[^/]+)).\n if (empty($match['c'])) {\n return '(?<'. $name .'>[^/]+)';\n }\n\n switch ($match['c']) {\n // Sets (eg: /book/:id[\\d] => /book/(?<id>[\\d]+)).\n case '[': return '(?<'. $name .'>['. $match[3] .']+)';\n // Optionals (eg: /book/:tab{show|hide} => /book/(?<tab>show|hide)).\n case '{': return '(?<'. $name .'>'. $match[3] .')';\n }\n },\n $pattern\n );\n }\n\n // Curlies are normal parens.\n $pattern = strtr($pattern, '{}', '()');\n\n // Escape delimiter.\n $pattern = addcslashes($pattern, '~');\n\n // Add optional slash to end.\n $options['endingSlashes'] && $pattern .= '/?';\n\n // See http://www.pcre.org/pcre.txt for verbs.\n $patterns[] = ' (*MARK:'. $i .') '. $pattern;\n }\n\n // Operator \"x\" is just for readability at debugging times.\n $pattern = \"~^(?:\\n\" . join(\" |\\n\", $patterns) . \"\\n)$~xAJ\";\n\n // Apply options.\n $options['unicode'] && $pattern .= 'u';\n $options['decodeUri'] && $uri = rawurldecode($uri);\n\n // Normalize URI (removes repeating & ending slashes).\n $uri = '/' . preg_replace('~/+~', '/', trim($uri, '/'));\n\n $this->debug = ['uri' => $uri, 'pattern' => $pattern, 'mark' => null];\n\n $res = preg_match($pattern, $uri, $match, PREG_UNMATCHED_AS_NULL);\n\n // Check invalid-pattern causing errors.\n if (!$res && $options['throwErrors']) {\n $message = preg_error_message($code, 'preg_match');\n $message && throw new RouterException($message, code: $code);\n }\n\n if ($res) {\n $this->debug['match'] = $match;\n\n $mark = (int) $match['MARK'];\n if (empty($routes[$mark][1])) {\n throw new RouterException('No call directives found for route `%s`', $mark);\n }\n\n $this->debug['mark'] = $mark;\n\n $calls = (array) $routes[$mark][1];\n $callArgs = $usedArgs = [];\n\n // Drop input & mark fields.\n $match = array_slice($match, 1, -1);\n\n // Handle conditional replacements, eg: [\"/user/:x{login|logut}\", \"User.{x}\"].\n foreach ($calls as $i => $call) {\n $rep = grep('~{(\\w+)}~', $call);\n if ($rep) {\n if (isset($match[$rep])) {\n // Replace & tick (\"-\" for camel-case).\n $calls[$i] = str_replace('{' . $rep . '}', '-' . $match[$rep] . '-', $call);\n $usedArgs[$match[$rep]] = 1;\n } else {\n // Remove non-found replacements from call.\n $calls[$i] = str_replace('{' . $rep . '}', '', $call);\n }\n }\n }\n\n // Fill call arguments.\n $i = 0;\n foreach ($match as $key => $value) {\n if (is_string($key)) {\n $value = $match[$i] ?? $value;\n // Skip NULLs that set via PREG_UNMATCHED_AS_NULL.\n if (isset($value) && !isset($usedArgs[$value])) {\n $callArgs[$key] = $value;\n }\n // Step back, so we need after-string indexes only.\n $i--;\n }\n $i++;\n }\n\n // Add extra call arguments if provided (in config as third field).\n if (isset($routes[$mark][2])) {\n $callArgs = array_merge($callArgs, (array) $routes[$mark][2]);\n }\n\n $pack = self::pack($calls, $callArgs);\n\n // Try to return defined method or all (*) methods.\n return $method ? $pack[$method] ?? $pack['*'] ?? null\n : $pack;\n }\n\n $this->debug['match'] = $match;\n\n // Not found.\n return null;\n }", "public function getMatchingRoute($uri, $method)\n {\n if (!isset($this->routes[$method]) || !is_array($this->routes[$method])) {\n throw new \\Exception(\"No route found\");\n }\n\n foreach ($this->routes[$method] as $route) {\n if ($method != $route->getMethod()) {\n continue;\n }\n\n if ($route->matches($uri)) {\n return $route;\n }\n }\n\n throw new \\Exception(\"No route found\");\n }", "public function getRoutes();", "public function getRoutes();", "protected function methodNotAllowedRoute(array $allowedMethods): Route\n\t{\n\t\treturn new Route([], '', static function () use ($allowedMethods): void\n\t\t{\n\t\t\tthrow new MethodNotAllowedException($allowedMethods);\n\t\t}, 'router:405');\n\t}", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "abstract public function getRouteMatch();", "public function testAddRouteShorthandMethodGet()\n {\n $this->collection->get('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('GET', $routes[0]->getMethods());\n }", "public function route($methods, $uri = null, $action)\n {\n // Get methods\n $methods = explode(',', str_replace(', ', ',', $methods));\n\n // Loop through the methods, validating and storing their URIs/actions\n foreach ($methods as $method) {\n $method = strtolower($method);\n if (!array_key_exists($method, $this->routes)) {\n throw new \\Pop\\Exception('Error: One or more of the methods are not valid.');\n }\n if ($method == 'error') {\n $this->error($action);\n } else {\n if (null === $uri) {\n throw new \\Pop\\Exception('Error: You must assign a URI to an action routed to the ' . strtoupper($method) . ' method.');\n }\n $this->$method($uri, $action);\n }\n }\n\n return $this;\n }", "public function testHttpMethodBasedRouting() {\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}', [\n\t\t\t'http:method' => 'GET', 'action' => 'view'\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}', [\n\t\t\t'http:method' => 'PUT', 'action' => 'edit'\n\t\t]);\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'GET'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$expected = ['controller' => 'Posts', 'action' => 'view', 'id' => '13'];\n\t\t$this->assertEqual($expected, $params);\n\n\t\t$this->assertIdentical('/posts/13', Router::match($params));\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'PUT'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$expected = ['controller' => 'Posts', 'action' => 'edit', 'id' => '13'];\n\t\t$this->assertEqual($expected, $params);\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'POST'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$this->assertEmpty($params);\n\t}", "public function route(string $method, $options = null)\n {\n return $options\n ? route(\"{$this->routePrefix}.{$method}\", $options)\n : route(\"{$this->routePrefix}.{$method}\");\n }", "protected function matchAgainstRoutes(array $routes, $request, $includingMethod = true)\n {\n [$fallbacks, $routes] = collect($routes)->partition(function ($route) {\n return $route->isFallback;\n });\n\n /* Here $routes will be sort by version desc */\n return Version::sortRoutes($routes)\n ->merge($fallbacks)->first(\n fn (Route $route) => $route->matches($request, $includingMethod)\n );\n }", "private function searchRoute()\r\n {\r\n $currentUrl = self::cleanUrl(self::getCurentUrl());\r\n $activeMethod = self::getActiveMethod();\r\n\r\n foreach (array_reverse($this->routes) as $route) {\r\n if (preg_match('/^'.$route['regex'].'$/', $currentUrl) && $activeMethod === $route['method']) {\r\n $route['active'] = $currentUrl;\r\n return $route;\r\n }\r\n }\r\n }", "public function match(CalledUri $calledUri): MatchingRoutes\n {\n $allowedMethods = [];\n $matching = [];\n foreach ($this->routes as $route) {\n /* @var $route \\stubbles\\webapp\\routing\\Route */\n if ($route->matches($calledUri)) {\n return new MatchingRoutes(\n ['exact' => $route],\n $route->allowedRequestMethods()\n );\n } elseif ($route->matchesPath($calledUri)) {\n $matching[] = $route;\n $allowedMethods = array_merge(\n $allowedMethods,\n $route->allowedRequestMethods()\n );\n }\n }\n\n return new MatchingRoutes($matching, array_unique($allowedMethods));\n }", "abstract public function getRoute();", "private function _getRoute($path)\n {\n if (strpos($this->request->getPath(), '/api') === 0) {\n $routes = $this->config->get('routes:rest');\n } else {\n $routes = $this->config->get('routes');\n }\n\n foreach ($routes as $name => $data) {\n\n if ($target = $this->_getDirectMatch($path, $data)) {\n return $target;\n } else if ($target = $this->_getVariableMatch($path, $data)) {\n return $target;\n }\n\n }\n\n throw new MethodNotFoundException('No matching route for path \"' . $path . '\" found');\n }", "private function getRouterMath()\n {\n \t$router = Zend_Controller_Front::getInstance()->getRouter();\n \t$request = Zend_Controller_Front::getInstance()->getRequest();\n \t \n \t// Find the matching route\n \t$routeMatched = false;\n \t \n \tforeach (array_reverse($router->getRoutes(), true) as $name => $route) {\n \t\t// TODO: Should be an interface method. Hack for 1.0 BC\n \t\tif (method_exists($route, 'isAbstract') && $route->isAbstract()) {\n \t\t\tcontinue;\n \t\t}\n \t\t \n \t\t// TODO: Should be an interface method. Hack for 1.0 BC\n \t\tif (!method_exists($route, 'getVersion') || $route->getVersion() == 1) {\n \t\t\t$match = $request->getPathInfo();\n \t\t} else {\n \t\t\t$match = $request;\n \t\t}\n \t\t \n \t\tif ($params = $route->match($match)) {\n \t\t\t$routeMatched = $params;\n \t\t\tbreak;\n \t\t}\n \t}\n \t \n \treturn $routeMatched;\n }", "public function getSystemRoutes();", "public function route(Request $request): Route\n\t{\n\t\t$requestMethod = $request->getMethod();\n\n\t\t$requestPath = $request->getPath();\n\n\t\tforeach($this->routes->getRoutesByMethod($requestMethod) as $route)\n\t\t{\n\t\t\tif($this->matches($route, $requestPath) && $this->constraintsAreSatisfied($route))\n\t\t\t{\n\t\t\t\t// If the matching route is missing its trailing slash then we'll\n\t\t\t\t// redirect it (but only if it's a GET or HEAD request)\n\n\t\t\t\tif($route->hasTrailingSlash() && !empty($requestPath) && substr($requestPath, -1) !== '/')\n\t\t\t\t{\n\t\t\t\t\tif(in_array($requestMethod, ['GET', 'HEAD']))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $this->redirectRoute($requestPath);\n\t\t\t\t\t}\n\n\t\t\t\t\tgoto notFound;\n\t\t\t\t}\n\n\t\t\t\t// If this is an \"OPTIONS\" request then we'll collect all the allowed request methods\n\t\t\t\t// from all routes matching the requested path. We'll then add an \"allows\" header\n\t\t\t\t// to the matched route\n\n\t\t\t\tif($requestMethod === 'OPTIONS')\n\t\t\t\t{\n\t\t\t\t\treturn $this->optionsRoute($requestPath);\n\t\t\t\t}\n\n\t\t\t\t// Assign the route to the request\n\n\t\t\t\t$request->setRoute($route);\n\n\t\t\t\t// Return the matched route and parameters\n\n\t\t\t\treturn $route;\n\t\t\t}\n\t\t}\n\n\t\t// Check if there are any routes that match the pattern and constaints for other request methods\n\n\t\tif(!empty(($allowedMethods = $this->getAllowedMethodsForMatchingRoutes($requestPath))))\n\t\t{\n\t\t\treturn $this->methodNotAllowedRoute($allowedMethods);\n\t\t}\n\n\t\t// No routes matched so we'll return a not found route\n\n\t\tnotFound:\n\n\t\treturn $this->notFoundRoute();\n\t}", "static function route () {\n\t\tif (isset($_GET['path'])) {\n\t\t\t$get_path = $_GET['path'];\n\t\t}\n\t\telse {\n\t\t\t$get_path = '/';\n\t\t}\n\n\t\t// check if GET path has a match, show 404 by default if it does not\n\t\t$parameters = [];\n\t\t$controller_method = 'AppController::four_zero_four';\n\n\t\tforeach (self::$routes as $route) {\n\t\t\tif ($route['regex_path'] != '/') {\n\t\t\t\t$route['regex_path'] = trim($route['regex_path'], '/');\n\t\t\t}\n\n\t\t\tif (preg_match('|^'.$route['regex_path'].'$|i', $get_path, $parameters)) {\n\t\t\t\t// match found for GET path\n\t\t\t\tif ($route['auth_required'] == 'not_signed_in' && AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is not_signed_in and user is signed in, redirect to dashboard\n\t\t\t\t\tRedirector::redirect('dashboard');\n\t\t\t\t}\n\t\t\t\telse if ($route['auth_required'] == 'signed_in' && !AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is signed in and user is not signed in, redirect to sign in page\n\t\t\t\t\tRedirector::redirect('sign_in');\n\t\t\t\t}\n\n\t\t\t\tif ($route['permission_required'] == null || AppUser::has_permission($route['permission_required'])) {\n\t\t\t\t\t// set controller method if user has permission\n\t\t\t\t\t$controller_method = $route['controller_method'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// user does not have permission, redirect to index\n\t\t\t\t\tRedirector::redirect('/');\n\t\t\t\t}\n\n\t\t\t\t// remove first parameter as it is the GET path and not a value we want\n\t\t\t\tif (!empty($parameters)) {\n\t\t\t\t\tunset($parameters[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// route to the corresponding controller method\n\t\tcall_user_func_array($controller_method, $parameters);\n\t}", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function testRouterAddByAny($method)\n {\n $router = new Router();\n\n $router->any(null, \"about\", function () {\n return \"about\";\n });\n\n $res = $router->handle(\"about\", $method);\n $this->assertEquals(\"about\", $res);\n\n $routes = $router->getAll();\n $this->assertEquals(1, count($routes));\n }", "protected function route()\n {\n return route($this->uri, $this->params);\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'exclusive/json/messagetutor',\r\n 'path' => '/exclusive/json/mT',\r\n 'middleware' => Action\\Json\\MessageTutor::class,\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'exclusive/json/certificateprintfree',\r\n 'path' => '/exclusive/json/cPf',\r\n 'middleware' => Action\\Json\\CertificatePrintFree::class,\r\n 'allowed_methods' => ['POST']\r\n ]\r\n ];\r\n }", "public function testRouterAddByAll($method)\n {\n $router = new Router();\n\n $router->all($method, function () use ($method) {\n return \"all-$method\";\n });\n\n $res = $router->handle(\"\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $res = $router->handle(\"about\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $res = $router->handle(\"what/ever\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $routes = $router->getAll();\n $this->assertEquals(1, count($routes));\n }", "protected function defineRoute($method,$path,$fn,$paramsSequence) {\n \n $route = Array('method'=>$method,'path'=>$path,'fn'=>$fn,'paramsSequence'=>$paramsSequence);\n $this->_routes[] = $route;\n return true;\n \n }", "static public function invalidUriMethodProvider()\n {\n return array(\n array('some crap', 'GET'),\n array('*', 'POST'),\n array('ftp://example.com/baz/bar', 'GET'),\n array('host:433', 'HEAD'),\n array('http://example.com/path', 'CONNECT')\n );\n }", "protected function getMethodPatterns($uri, $method)\n {\n return $this->router->findPatternFilters(\n Request::create($uri, $method)\n );\n }", "public function useRoute(){\n\t\t\t$routeParts = explode(\"@\", $this->matchingRoute->location);\n\t\t\treturn [\"controller\" => ucfirst($routeParts[0]), \"method\" => $routeParts[1]];\n\t\t}", "public function getFullRoute();", "public function getRoutes() {}", "public static function methodsProvider(): array\n {\n return [\n 'GET' => ['get'],\n 'POST' => ['post'],\n 'PATCH' => ['patch'],\n 'PUT' => ['put'],\n 'DELETE' => ['delete'],\n ];\n }", "public function routerMatchingExamples()\n {\n return [\n ['GET', '', MatchResult::found(['name' => 'root'], [])],\n ['GET', '/', MatchResult::found(['name' => 'root-slash'], [])],\n ['GET', '/a', MatchResult::notFound()],\n ];\n }", "public static function parseRouter(array|null $router = [], string $prefix = \"/\", array $methodsAllowed = self::METHODS):array {\n\n # Prepare result\n $result = [];\n\n # Check patterns\n if(\n $router === null ||\n empty($router) ||\n !isset($router[\"patterns\"]) || \n empty($router[\"patterns\"])\n )\n\n # Stop function\n return $result;\n\n # Prepare prefix\n $prefix = trim($prefix, \"/\");\n\n # Check methods\n if(!isset($router[\"methods\"]) || empty($router[\"methods\"]))\n\n # Set get\n $router[\"methods\"] = [\"GET\"];\n\n # Check router is array\n if(!is_array($router[\"methods\"])) $router[\"methods\"] = [$router[\"methods\"]];\n\n # Iteration of methods\n foreach($router[\"methods\"] as $method){\n\n # Check current router\n if(!in_array(strtoupper($method), $methodsAllowed))\n\n # Continue iteration\n continue;\n\n # Check patterns is array\n if(!is_array($router[\"patterns\"])) \n $router[\"patterns\"] = [$router[\"patterns\"]];\n\n # Iteration of patterns\n foreach($router[\"patterns\"] as $pattern){\n\n # Set and/or clear data \n $data = [];\n\n # Clean pattern\n $pattern = trim($pattern, \"/\");\n\n # Fill name in data\n if(!isset($router[\"name\"]) || empty($router[\"name\"]))\n\n # New Exception\n throw new CrazyException(\n \"Name is missing in router given \\\"\".json_encode($router).\"\\\"\",\n 500,\n [\n \"custom_code\" => \"router-001\",\n ]\n );\n\n else\n\n # Fill name\n $data[\"name\"] = $router[\"name\"];\n\n # Fill controller in data\n if(!isset($router[\"controller\"]) || empty($router[\"controller\"]))\n\n # New Exception\n throw new CrazyException(\n \"Controller class is missing in router given \\\"\".json_encode($router).\"\\\"\",\n 500,\n [\n \"custom_code\" => \"router-002\",\n ]\n );\n\n else\n\n # Fill controller\n $data[\"controller\"] = $router[\"controller\"].\"::\".$method;\n\n # Fill pattern\n $data[\"pattern\"] = (isset($router[\"prefix\"])) ?\n (\n $router[\"prefix\"] ?\n \"/\".trim($router[\"prefix\"], \"/\").\"/$pattern/\" :\n \"/$pattern/\"\n\n ) :\n \"/$prefix/$pattern/\";\n\n # Check if not double //\n $data[\"pattern\"] = str_replace(\"//\", \"/\", $data[\"pattern\"]);\n\n # Fill method\n $data[\"method\"] = strtoupper($method);\n\n # Fill type\n $data[\"type\"] = \"router\";\n\n # Push data in result\n $result[] = $data;\n\n }\n\n }\n\n # Return result\n return $result;\n\n }", "public function testRouterAddByGet($method)\n {\n $router = new Router();\n\n $router->get(\"\", function () {\n return \"get\";\n });\n\n $router->always(function () {\n return \"not get\";\n });\n\n $res = $router->handle(\"\", $method);\n if ($method === \"GET\") {\n $this->assertEquals(\"get\", $res);\n }\n if ($method !== \"GET\") {\n $this->assertEquals(\"not get\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function method(string $method): Route\n {\n $this->setMethods(explode('|', $method));\n\n return $this;\n }", "public function match ( Request $request ) {\n $params = [];\n $match = false;\n \n // set Request Url if it isn't passed as parameter\n $requestUrl = $request->requesturi();\n \n // set Request Method if it isn't passed as a parameter\n $requestMethod = $request->method();\n foreach($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n $method_match = (stripos($methods, $requestMethod) !== false);\n // Method did not match, continue to next route.\n if (!$method_match) continue;\n \n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url\n if (strncmp($requestUrl, $route, $position) !== 0) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n if ($match) {\n if ($params) {\n foreach($params as $key => $value) {\n if(is_numeric($key)) unset($params[$key]);\n }\n }\n return array(\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n );\n }\n }\n return false;\n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function GetRouteClass ();", "function route($method, $regex, $controller, $function, ...$parameters) {\n if($_SERVER[\"REQUEST_METHOD\"] !== $method) return;\n // Remove the root part of the URI so we only have the request\n $url = str_replace(ROOT, \"\", $_SERVER[\"REQUEST_URI\"]);\n\n $regex = createRegex($regex);\n\n if(preg_match($regex, $url, $args)) {\n // preg_match puts the matched string in the first element of the array, so we remove it\n array_shift($args);\n // Call the controller (autoloaded)\n $controller = new $controller();\n // Call the method with unpacked arguments\n $controller->$function(...$args, ...$parameters);\n exit;\n }\n}", "public function any(string $pattern, $callable): MethodsInterface;", "function routes($http, $uri) {\n\n $dispatcher = FastRoute\\simpleDispatcher(function(FastRoute\\RouteCollector $r) {\n $r->addRoute('GET', '/question', 'questions#get_answer');\n $r->addRoute('GET', '/hello', 'questions#get_hello');\n $r->addRoute('GET', '/question/{name}/{id}/', 'questions#get_answer');\n $r->addRoute('GET', '/question/{name}/{id}', 'questions#get_answer');\n });\n\n\n// Strip query string (?foo=bar) and decode URI\n if (false !== $pos = strpos($uri, '?')) {\n $uri = substr($uri, 0, $pos);\n }\n\n $uri = rawurldecode($uri);\n $uri = str_replace(BASENAME_DIR . '/', '', $uri);\n $routeInfo = $dispatcher->dispatch($http, $uri);\n\n switch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n core\\basebuild::view('error/404');\n break;\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $allowedMethods = $routeInfo[1];\n echo 'allowed not found';\n break;\n case FastRoute\\Dispatcher::FOUND:\n\n $handler = explode('#', $routeInfo[1]);\n $build = $handler[0];\n $function = $handler[1];\n $vars = $routeInfo[2];\n $interfaces = APP_INTERFACE . $build;\n $interfaces = new $interfaces();\n $interfaces->$function();\n break;\n }\n}", "public static function route(array $route)\n\t\t{\n\t\t\t// Store actual Route, within the REQUEST_URI server\n\t\t\tBootstrap::getInstance()->setServerUri(implode('/', $route));\n\n\t\t\t$controller = ucfirst(urldecode(array_shift($route)));\n\n\t\t\ttry {\n\t\t\t\t$class = new ReflectionClass($controller);\n\t\t\t\t$method = new ReflectionMethod($controller, urldecode(array_shift($route)));\n\n\t\t\t\tif (($method->isPublic()) && ($class->isInstantiable())) {\n\t\t\t\t\t// is there any arguments ?\t\t\t\t\t\n\t\t\t\t\tif ((count($route) == 0) && ($method->getNumberOfRequiredParameters() == 0)) {\n\t\t\t\t\t\treturn $method->invoke($class->newInstance(Bootstrap::getInstance(), $class->name, $method->name), null);\n\t\t\t\t\t}\n\n\t\t\t\t\t// are we sending the correct amount of parameters ?\n\t\t\t\t\tif (count($route) >= $method->getNumberOfRequiredParameters()) {\n\t\t\t\t\t\treturn $method->invokeArgs($class->newInstance(Bootstrap::getInstance(), $class->name, $method->name), $route);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow new RouterException('The controller method was not sent the correct amount of parameters', 404);\n\t\t\t\t}\n\n\t\t\t\tthrow new RouterException('The method is either not public or the class is not isInstantiable', 404);\n\t\t\t} catch (ClassNotFoundException $e) {\n\t\t\t\t// catch it for Line 51\n\t\t\t}\n\n\t\t\t$route = func_get_args();\n\n\t\t\tthrow new RouterException('The controller/method could not be found | ' . implode('::', array_slice($route[0], 0, 2)) . '()', 404, ifsetor($e));\n\t\t}", "public function getRoute($path, $method)\n {\n foreach ($this->collection as $route) {\n if ($route->getPath() == $path && $route->getMethod() == $method) {\n return $route;\n }\n }\n\n return null;\n }", "public function matchRoute($method, $uri, $action) {\n $action = $this->parseAction($action);\n\n $uri = '/'.trim($uri, '/');\n\n if (isset($action['as'])) {\n $this->namedRoutes[$action['as']] = $uri;\n }\n\n if (is_array($method)) {\n foreach ($method as $verb) {\n $this->routes[$verb.$uri] = ['method' => $verb, 'uri' => $uri, 'action' => $action];\n }\n } else {\n $this->routes[$method.$uri] = ['method' => $method, 'uri' => $uri, 'action' => $action];\n }\n }", "public static function route($mappings)\n\t{\n\t\t$uri = Request::uri();\n\t\t\n\t\tforeach ( $mappings as $mapped_uri => $map )\n\t\t{\n\t\t\tif ( preg_match($mapped_uri, $uri) )\n\t\t\t{\n\t\t\t\treturn self::run_method($map['object'], $map['method']);\n\t\t\t}\n\t\t\t\n\t\t\t// Check for a 404 page\n\t\t\telse if ( strpos($mapped_uri, ':404') != FALSE )\n\t\t\t{\n\t\t\t\t$mapped_uri = str_replace(':404', self::$placeholders[':any'], $mapped_uri);\n\t\t\t\t\n\t\t\t\t// Check if the 404 page should be used for the current URI\n\t\t\t\tif ( preg_match($mapped_uri, $uri) )\n\t\t\t\t{\n\t\t\t\t\treturn self::run_method($map['object'], $map['method']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}", "private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }", "public function supports($method = '');", "private static function traverseRoutes() {\r\n\r\n\r\n\t\t$method = $_SERVER['REQUEST_METHOD'];\r\n\t\t$requested = $_SERVER['REQUEST_URI'];\r\n\t\t$path = $requested; // set our path to our request\r\n\t\t$path = explode('?',$path)[0]; // check for a query string. At zero index\r\n\t\t$path = strlen($path) > 1 ? rtrim($path,'/') : $path; //strip the slash at the end of the string (if its there). rtrim will take care of this automatically\r\n\t\t$parts = explode('/',$path);\r\n\t\t$parameters = array(); // Start traversal process. These are the parameters that we will pass\r\n\t\t$level = &self::$routes[$method]; // same as when we are registering. Grab a reference to our trunk\r\n\t\t\r\n\t\t// traverse the tree and determine if we have a valid route\r\n\t\treset($parts);\r\n\t\twhile(($part = current($parts)) !== false) {\r\n\r\n\t\t\tif(isset($level[$part])) { // found, now we move down one more level\r\n\t\t\t\t$level = &$level[$part];\r\n\t\t\t} elseif(isset($level['@'])) { // didn't find a defined, but we have a wild card. Go down this level\r\n\t\t\t\t$level = &$level['@'];\r\n\t\t\t\t$parameters[$level['name']] = urldecode($part);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new RouteException($requested.' route not found');\r\n\t\t\t}\r\n\r\n\t\t\tnext($parts);\r\n\t\t}\r\n\r\n\t\t// we have reached the final level. Extract the required information and dig in \r\n\t\t$callback = $level['*'];\r\n\t\tif(is_callable($callback)) {\r\n\t\t\t$callback($parameters);\r\n\t\t} else {\r\n\t\t\t$callbackParts = explode('@', $callback);\r\n\t\t\t$class = 'App\\Controllers\\\\'.$callbackParts[0];\r\n\t\t\t$function = $callbackParts[1];\r\n\t\t\t$controller = new $class();\r\n\t\t\treturn $controller->{$function}($parameters);\r\n\t\t}\r\n\r\n\t}", "public function route(): RouteContract;", "public static function getUriMethods()\n {\n $root = str_replace($_SERVER['DOCUMENT_ROOT'], '', getcwd());\n $subfolder = trim($root, '/');\n\n return trim(str_replace($subfolder, '', self::getUri()), '/');\n }", "function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}", "public function addRoute(string $pattern, array $methods, $handler = null): Route\n {\n $this->routes[] = $route = new Route($pattern, $methods, $handler);\n\n $this->resolveWith($route);\n\n return $route;\n }" ]
[ "0.76350987", "0.72354025", "0.71437126", "0.6987343", "0.6827819", "0.6740208", "0.6739182", "0.6672395", "0.6671263", "0.6658784", "0.66331995", "0.6502796", "0.6476182", "0.6460012", "0.64570296", "0.6456512", "0.642763", "0.64084524", "0.6405221", "0.64032155", "0.64032155", "0.6388064", "0.63579637", "0.6321336", "0.63109213", "0.6307321", "0.630189", "0.62637687", "0.6242444", "0.62416023", "0.6222248", "0.6220556", "0.62150455", "0.62072986", "0.6197838", "0.61934745", "0.6180909", "0.6169837", "0.6148877", "0.61130804", "0.6098337", "0.60859704", "0.60819256", "0.6078562", "0.6049916", "0.604963", "0.6043164", "0.6043164", "0.6031765", "0.59965277", "0.5980209", "0.59646064", "0.59281784", "0.59089303", "0.59058255", "0.5886524", "0.58807844", "0.587054", "0.5861185", "0.58585006", "0.58492875", "0.5840146", "0.583738", "0.5835107", "0.5834578", "0.58151525", "0.5808592", "0.5795182", "0.57881325", "0.5774189", "0.5770924", "0.5769897", "0.5764735", "0.57641804", "0.5762565", "0.57588905", "0.5740699", "0.57393515", "0.57341385", "0.57284427", "0.57224387", "0.5721244", "0.5714454", "0.5708849", "0.56917894", "0.5686774", "0.5678889", "0.56671107", "0.56597316", "0.5659594", "0.5652765", "0.56467366", "0.56437737", "0.5625182", "0.5614209", "0.55973595", "0.55971694", "0.5591059", "0.55814344", "0.5581176" ]
0.7759646
0
Sets up the $categoryWithPermissions array Key is the category name Value is permission with dots
Настройка массива $categoryWithPermissions. Ключ — это название категории, значение — разрешение с точками.
private static function setupCategoriesPermissions() { $result = []; // Looping into userPermissions and getting the category as the key and the value as an array of permissions foreach(self::$userPermissions as $userPermissionWithDots) { // checking if the permission has a menu category or not, it is separated in the DB with | $userCategoryPermission = explode ('.',$userPermissionWithDots,2); $userCategory = $userCategoryPermission[0]; // if the permission is without a dot then it is a category only if(count($userCategoryPermission) > 1) { $userPermission = $userCategoryPermission[1]; } else { $userPermission = ''; } if(is_numeric($userPermission)) { // If the permission is a number this means it is a role-manage permission // Add it if the role is in the roles to manage array if (in_array($userPermission, self::$rolesToManage)) { $result[$userCategory][] = $userPermission; } } else { $result[$userCategory][] = $userPermission; } } self::$categoryWithPermissions = $result; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $category=new User_category();\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n $category->category_description=$request->input('description');\n $category->deleted=false;\n\n\n $category->save();\n $category_id=$category->user_category_id;\n\n if (isset($_POST['permissions'])) {\n foreach (($_POST['permissions']) as $permission){\n $perm=new Category_permission();\n $perm->category_id=$category_id;\n $perm->permission_id=$permission;\n $perm->deleted=false;\n $perm->save();\n }\n }\n\n\n // auth()->login();\n\n return redirect('/')->with('success','Category added');\n }", "function publisher_saveCategoryPermissions($groups, $categoryid, $perm_name)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n $result = true;\r\n\r\n $module_id = $publisher->getModule()->getVar('mid');\r\n $gperm_handler = xoops_gethandler('groupperm');\r\n // First, if the permissions are already there, delete them\r\n $gperm_handler->deleteByModule($module_id, $perm_name, $categoryid);\r\n\r\n // Save the new permissions\r\n if (count($groups) > 0) {\r\n foreach ($groups as $group_id) {\r\n $gperm_handler->addRight($perm_name, $categoryid, $group_id, $module_id);\r\n }\r\n }\r\n return $result;\r\n}", "private function updateCategoryAndChildrenForumPermissions($categoryId, $groupId, $permissions, $isAuthOnly) {\n $categoryIds = $this->myForumService->getCategoryIdsDownStream($categoryId);\n\n foreach ($categoryIds as $categoryId) {\n $forumPermission = ForumPermission::where('categoryId', $categoryId)->where('groupId', $groupId)->first();\n\n if ($forumPermission) {\n $forumPermission->permissions = $permissions;\n $forumPermission->isAuthOnly = $isAuthOnly;\n $forumPermission->save();\n } else {\n $forumPermission = new ForumPermission(\n [\n 'categoryId' => $categoryId,\n 'groupId' => $groupId,\n 'permissions' => $permissions,\n 'isAuthOnly' => $isAuthOnly\n ]\n );\n $forumPermission->save();\n }\n }\n }", "function set_acl_category($category)\n {\n $this->acl_category = $category;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_category($category);\n }\n }", "public function savePermissions($permissions, $permissionSettings) {\n\t\t// create inserts\n\t\t$groupInserts = '';\n\t\tforeach ($permissions as $key => $permission) {\n\t\t\t// skip default values\n\t\t\t$noDefaultValue = false;\n\t\t\tforeach ($permission['settings'] as $value) {\n\t\t\t\tif ($value != -1) $noDefaultValue = true;\n\t\t\t}\n\t\t\tif (!$noDefaultValue) {\n\t\t\t\tunset($permissions[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!empty($groupInserts)) $groupInserts .= ',';\n\t\t\t$groupInserts .= '('.$this->categoryID.',\n\t\t\t\t\t '.intval($permission['id']).',\n\t\t\t\t\t '.(implode(', ', ArrayUtil::toIntegerArray($permission['settings']))).')';\n\t\t}\n\t\t\n\t\tif (!empty($groupInserts)) {\n\t\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\t\t\t\t(categoryID, groupID, \".implode(', ', $permissionSettings).\")\n\t\t\t\tVALUES\t\t\".$groupInserts;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}", "public function addMultipleCategoriesToGroup();", "private function buildForumPermissions($permissions) {\n $forumPermissions = [];\n\n if (!isset($permissions)) {\n return $forumPermissions;\n }\n\n foreach (CategoryPermissions::getAsOptions() as $key => $value) {\n $forumPermissions[$key] = $permissions->permissions & $value;\n }\n\n return $forumPermissions;\n }", "public function createCategory();", "public function setPermissions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->permissions = $arr;\n\n return $this;\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "public function update(Request $request, $id)\n {\n\n $category=User_category::find($id);\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n $category->category_description=$request->input('description');\n $category->deleted=false;\n\n\n $category->save();\n //$category_id=$category->user_category_id;\n\n if (isset($_POST['permissions'])) {\n foreach (($_POST['permissions']) as $permission){\n $perm=new Category_permission();\n $perm->category_id=$id;\n $perm->permission_id=$permission;\n $perm->deleted=false;\n $perm->save();\n }\n }\n\n\n // auth()->login();\n\n return redirect('/')->with('success','Category updated');\n\n\n }", "public function setPermissions($permissions) {}", "function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }", "public function getPermissionArrayToNameWise($permission = []) {\n $data = [];\n if(!empty($permission)) {\n foreach ($permission as $permission_key => $permission_array) {\n foreach ($permission_array as $permission_name => $permission_value) {\n $permi = explode('.', $permission_value);\n $data[$permi[0]][$permission_name] = array(\n 'permission' => base64_encode($permission_value),\n 'label' => $permi[1],\n 'can_inherit' => -1,\n );\n //$data[$permi[0]][$permi[1]] = -1; //inherit\n //$data[$permi[0]][$permi[1]] = base64_encode($permi[1]); //inherit\n }\n }\n }\n return $data;\n }", "public function __construct() {\n $perm_data = 'data/permissions.json';\n if(file_exists($perm_data)) {\n $list = json_decode(file_get_contents($perm_data), true);\n foreach($list as $groupname => $group) {\n if(isset($group['inherit'])) {\n $group['permissions'] = array_merge(\n $group['permissions'],\n $list[$group['inherit']]['permissions']\n );\n }\n $this->permissions[$groupname] = $group['permissions'];\n $this->display_names[$groupname] = $group['display_name'];\n }\n }\n }", "private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\n }", "private function process_permission_array(Request $request, &$temp_permission){\n if($request->permission !== null){\n $checkbox_values = array_map('intval', $request->permission);\n foreach($checkbox_values as $value){\n $checkbox_values = array_map('intval', $request->permission);\n\n $temp_permission[$value] = \"1\";\n \n }\n }\n $temp_permission = implode(',',$temp_permission);\n }", "function set_rights_of_cat($p_catid, $p_suggest_right, $p_suggest_group_right, &$p_changed){\n// Hauptprozedur. Diese wird aufgerufen um die Rechte einer Kategorie zu setzen, inklusive deren Unterkategorien.\n// $p_catid = KategorienID, welche gesetzt werden soll.\n// $p_suggested_right = Die rechte welche gesetzt werden sollen.\n// $p_changed = Anzahl der Korrekturen oder (-1): Gewuenschte aenderung war nicht zulaessig! \n $database = &JFactory::getDBO();\n // Kategorie laden aus Datenbank.\n $l_sql = \"SELECT parent_id, cat_access, cat_group_access FROM #__jdownloads_cats WHERE cat_id = \".$p_catid;\n $database->setQuery($l_sql);\n $l_catrow = $database->loadObjectList();\n if (!isset($l_catrow[0]) && ($p_catid > 0)){\n // Die Kategorie existiert nicht. Nicht weiterfahren.\n return '';\n }\n // Urspruengliche Rechte der Kategorie lesen.\n $l_rights_from = $l_catrow[0]->cat_access;\n //$l_rights_from_group = $l_catrow[0]->cat_group_access;\n if ($l_catrow[0]->parent_id == 0){\n // Es ist eine Hauptkategorie. Darueberliegende Kategorien muessen nicht nach niedrigen Rechten durchsucht werden.\n $l_rights_to_set = $p_suggest_right;\n } else {\n // Es ist eine Unterkategorie. Darueberliegenden Kategoriebaum nach niedrigen Rechten (=hoeherer Wert) durchsuchen.\n // Damit wird gewaehrleitet, dass eine Unterkategorie keine hoeheren Rechte erhalten kann.\n $l_rights_to_set = get_lowest_rights($p_catid, $p_suggest_right);\n if ($l_rights_to_set > $p_suggest_right) $p_changed = -1;\n }\n // Die Rechte der Kategorie und aller Unter- und Unter-Unter-Kategorien setzen.\n set_rights_to_tree($p_catid, $l_rights_to_set, $l_rights_from, $p_suggest_group_right, $p_changed);\n}", "public function run()\n {\n $permission = [\n // [\n // 'name' => 'user-list',\n // 'display_name' => 'List Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-create',\n // 'display_name' => 'Create Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-edit',\n // 'display_name' => 'Edit Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-delete',\n // 'display_name' => 'Delete Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-list',\n // 'display_name' => 'List roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-create',\n // 'display_name' => 'Create roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-edit',\n // 'display_name' => 'Edit roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-delete',\n // 'display_name' => 'Delete roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-list',\n // 'display_name' => 'List Question Categories',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-create',\n // 'display_name' => 'Create Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-edit',\n // 'display_name' => 'Edit Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-delete',\n // 'display_name' => 'Delete Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-list',\n // 'display_name' => 'List Questions',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-create',\n // 'display_name' => 'Create Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-edit',\n // 'display_name' => 'Edit Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-delete',\n // 'display_name' => 'Delete Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-list',\n // 'display_name' => 'List Exams',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-create',\n // 'display_name' => 'Create Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-edit',\n // 'display_name' => 'Edit Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-delete',\n // 'display_name' => 'Delete Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n [\n 'name' => 'group-list',\n 'display_name' => 'List Groups',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-create',\n 'display_name' => 'Create Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-edit',\n 'display_name' => 'Edit Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-delete',\n 'display_name' => 'Delete Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-list',\n 'display_name' => 'List Teams',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-create',\n 'display_name' => 'Create Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-edit',\n 'display_name' => 'Edit Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-delete',\n 'display_name' => 'Delete Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n ];\n\n foreach ($permission as $key => $value) {\n Permission::create($value);\n }\n }", "public function create(Request $request)\n {\n //\n $roles_permission = RolesPermission::where('role_id', Auth::user()->role_id)->get();\n $rolespermission = [];\n foreach ($roles_permission as $rolepermission) {\n array_push($rolespermission, $rolepermission->permission_id);\n }\n if (in_array(10, $rolespermission)) {\n\n $data = $this->validate($request, [\n 'category_id' => 'required',\n ]);\n\n $setting = Setting::first();\n $category = Category::findorfail($data['category_id']);\n return view('backend.subcategories.create', compact('category', 'setting'));\n\n } else {\n return view('backend.permissions.permission');\n }\n }", "function setPermissions($component, $group, $actions, $permissions)\n\t{\n\t\t$this->jClick($component);\n\t\tif ($component == 'Global Configuration')\n\t\t{\n\t\t\t$this->click('permissions');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->jClick('Options');\n\t\t\t$this->click(\"//dt[contains(span,'Permissions')]\");\n\t\t}\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = array($actions);\n\t\t}\n\t\tif (!is_array($permissions)) {\n\t\t\t$permissions = array($permissions);\n\t\t}\n\t\techo \"Open panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'$group')]\");\n\n\t\tfor ($i = 0; $i < count($actions); $i++) {\n\t\t\t$action = $actions[$i];\n\t\t\t$permission = $permissions[$i];\n\t\t\techo \"Setting $action action for $group to $permission in $component.\\n\";\n\t\t\tswitch ($action)\n\t\t\t{\n\t\t\t\tcase 'Site Login':\n\t\t\t\t\t$doAction = 'login.site';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Admin Login':\n\t\t\t\t\t$doAction = 'login.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Configure':\n\t\t\t\tcase 'Super Admin':\n\t\t\t\t\t$doAction = 'core.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Access Component':\n\t\t\t\t\t$doAction = 'core.manage';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Create':\n\t\t\t\t\t$doAction = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Delete':\n\t\t\t\t\t$doAction = 'delete';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit':\n\t\t\t\t\t$doAction = 'edit';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit State':\n\t\t\t\t\t$doAction = 'edit.state';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit Own':\n\t\t\t\t\t$doAction = 'edit.own';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->select(\"//select[contains(@id,'$doAction')][contains(@title,'$group')]\", \"label=$permission\");\n\t\t}\n\n\t\techo \"Close panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'Public')]\");\n\n\t\tif ($component == 'Global Configuration') {\n\t\t\t$this->click(\"//li[@id='toolbar-save']/a/span\");\n\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\ttry {\n\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"));\n\t\t\t}\n\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Need to click the Save & Close button\n\t\t\t$this->click(\"//button[contains(text(),'Save')][contains(text(),'Close')]\");\n\t\t\tfor ($second = 0; ; $second++) {\n\t\t\t\tif ($second >= 60) $this->fail(\"timeout\");\n\t\t\t\ttry {\n\t\t\t\t\tif (!$this->isElementPresent(\"//dl[contains(@id, 'configuration')]\")) break;\n\t\t\t\t} catch (Exception $e) {}\n\t\t\t\tsleep(1);\n\t\t\t}\n\t\t}\n\t}", "function _make_cat_compat(&$category)\n {\n }", "function forum_group_permissions( $perms ){\n\t$perms[ 'forum' ] = 'Can Post to Forum';\n\t$perms[ 'forum_moderate' ] = 'Can Moderate Forum';\n\treturn $perms;\n}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'milo.food.some_permission' => [\n 'tab' => 'Food',\n 'label' => 'Some permission'\n ],\n ];\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function setPermissions($permissions);", "public function addCategoryToGroupByName($gorup_name, $category_name);", "protected function getAllowedCategories($field)\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$user = Factory::getUser();\n\n\t\t// categories scope parameters\n\t\t$use_cat_acl = $field->parameters->get('use_cat_acl', 1);\n\t\t$method_cat = $field->parameters->get('method_cat', 1);\n\t\t$usesubcats = $field->parameters->get('usesubcats', 0);\n\n\t\t$catids = $field->parameters->get('catids');\n\t\tif (empty($catids)) $catids = array();\n\t\telse if (!is_array($catids)) $catids = !FLEXI_J16GE ? array($catids) : explode(\"|\", $catids);\n\n\n\t\t// ***\n\t\t// *** Get & check Global category related permissions\n\t\t// ***\n\n\t\trequire_once(JPATH_ROOT . DS . 'components' . DS . 'com_flexicontent' . DS . 'helpers' . DS . 'permission.php');\n\t\t$viewallcats = FlexicontentHelperPerm::getPerm()->ViewAllCats;\n\n\n\t\t// ***\n\t\t// *** Calculate categories to use for retrieving the items\n\t\t// ***\n\n\t\t$allowed_cats = $disallowed_cats = false;\n\n\t\t// Get user allowed categories\n\t\t$usercats = $use_cat_acl && !$viewallcats ?\n\t\t\tFlexicontentHelperPerm::getAllowedCats($user, $actions_allowed = array('core.create', 'core.edit', 'core.edit.own'), $require_all = false, $check_published = true) :\n\t\t\tFlexicontentHelperPerm::returnAllCats($check_published = true, $specific_catids = null);\n\n\t\t// Find (if configured) , descendants of the categories\n\t\tif ($usesubcats)\n\t\t{\n\t\t\tglobal $globalcats;\n\t\t\t$_catids = array();\n\t\t\tforeach ($catids as $catid)\n\t\t\t{\n\t\t\t\t$subcats = $globalcats[$catid]->descendantsarray;\n\t\t\t\tforeach ($subcats as $subcat) $_catids[(int) $subcat] = 1;\n\t\t\t}\n\t\t\t$catids = array_keys($_catids);\n\t\t}\n\n\n\t\t// ***\n\t\t// *** Decided allowed categories according to method of CATEGORY SCOPE\n\t\t// ***\n\n\t\t// Include method\n\t\tif ($method_cat == 3)\n\t\t{\n\t\t\t$allowed = array_intersect($usercats, $catids);\n\n\t\t\treturn $allowed;\n\t\t}\n\n\t\t// Exclude method\n\t\telse if ($method_cat == 2)\n\t\t{\n\t\t\t$allowed = array_diff($usercats, $catids);\n\n\t\t\treturn $allowed;\n\t\t}\n\n\t\t// Neither INCLUDE / nor EXCLUDE method, return all user 's allowed categories\n\t\telse\n\t\t{\n\t\t\treturn $usercats;\n\t\t}\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }", "private function field_permissions($field_name, $perm_name, $label, $field_values, $is_object, $is_options, $permission) {\n\t $values = self::$FIELD_OPTIONS;\n if ($is_options) {\n unset($values['a']);\n unset($values['d']);\n }\n\n $field = 'permissions-'.$perm_name;\n $params = array();\n if ($is_object) {\n $params['label'] = $label.($is_options ? ' (Options)' : '');\n }\n $params['name'] = $field;\n\t\t$params['values'] = $values;\n $params['value'] = $field_values;\n\t\t$params['placeholder'] = 'No permissions set';\n\t\t$params['is_multiple'] = true;\n\t\t$params['use_template_vars'] = false;\n\t\t$params['is_readonly'] = $permission->has_add() === false && $permission->has_update() === false;\n\t\t$params['attr']['id'] = $field;\n\t\t$params['attr']['class'] = 'permissions';\n\t\t$params['attr']['data-native-menu'] = 'false';\n $params['attr']['data-field'] = $field_name;\n $params['attr']['data-object'] = $is_object ? 1 : 0;\n\t\treturn form_select($params);\n\t}", "public function & GetPermissions ();", "private function _setTaskPermission($loginInfo)\n {\n $taskPermissionList = explode(\",\", $loginInfo['taskpermission']);\n $result = array();\n $rpcClient = Rpc_HttpDao::getInstance();\n $list = $rpcClient->getResultRaw('AU007', array(\n 'type' => Enum_Service::PERMISSION_TYPE_TASK,\n ), true, 0);\n $taskCategory = $list['data']['list'];\n foreach ($taskCategory as $item) {\n if (in_array($item['id'], $taskPermissionList)) {\n $result[] = $item;\n }\n }\n $this->_view->assign('taskPermissionList', $result);\n }", "function insert_category($categories_data, $dest_category_id, $action = 'insert') {\n\n\t\t$categories_id = olc_db_prepare_input($categories_data['categories_id']);\n\n\t\t$sort_order = olc_db_prepare_input($categories_data['sort_order']);\n\t\t$categories_status = olc_db_prepare_input($categories_data['status']);\n\n\n\n\n\n\t\t$customers_statuses_array = olc_get_customers_statuses();\n\n\t\t$permission = array ();\n\t\tfor ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 0;\n\t\t}\n\t\tif (isset ($categories_data['groups']))\n\t\t\tforeach ($categories_data['groups'] AS $dummy => $b) {\n\t\t\t\t$permission[$b] = 1;\n\t\t\t}\n\t\t// build array\n\t\tif ($permission['all']==1) {\n\t\t\t$permission = array ();\n\t\t\tend($customers_statuses_array);\n\t\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 1;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t$permission_array = array ();\n\t\t\n\t\t\n\t\t// set pointer to last key\n\t\tend($customers_statuses_array);\t\t\n\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id'])) {\n\t\t\t\t$permission_array = array_merge($permission_array, array ('group_permission_'.$customers_statuses_array[$i]['id'] => $permission[$customers_statuses_array[$i]['id']]));\n\t\t\t}\n\t\t}\n\n\n\t\t$sql_data_array = array ('sort_order' => $sort_order, 'categories_status' => $categories_status, 'products_sorting' => olc_db_prepare_input($categories_data['products_sorting']), 'products_sorting2' => olc_db_prepare_input($categories_data['products_sorting2']), 'categories_template' => olc_db_prepare_input($categories_data['categories_template']), 'listing_template' => olc_db_prepare_input($categories_data['listing_template']));\n\t\t$sql_data_array = array_merge($sql_data_array,$permission_array);\n\t\tif ($action == 'insert') {\n\t\t\t$insert_sql_data = array ('parent_id' => $dest_category_id, 'date_added' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\t\t\t$categories_id = olc_db_insert_id();\n\t\t}\n\t\telseif ($action == 'update') {\n\t\t\t$update_sql_data = array ('last_modified' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\'');\n\t\t}\n\t\tolc_set_groups($categories_id, $permission_array);\n\t\t$languages = olc_get_languages();\n\t\tforeach ($languages AS $lang) {\n\t\t\t$categories_name_array = $categories_data['name'];\n\t\t\t$sql_data_array = array ('categories_name' => olc_db_prepare_input($categories_data['categories_name'][$lang['id']]), 'categories_heading_title' => olc_db_prepare_input($categories_data['categories_heading_title'][$lang['id']]), 'categories_description' => olc_db_prepare_input($categories_data['categories_description'][$lang['id']]), 'categories_meta_title' => olc_db_prepare_input($categories_data['categories_meta_title'][$lang['id']]), 'categories_meta_description' => olc_db_prepare_input($categories_data['categories_meta_description'][$lang['id']]), 'categories_meta_keywords' => olc_db_prepare_input($categories_data['categories_meta_keywords'][$lang['id']]));\n\n\n\t\t\tif ($action == 'insert') {\n\t\t\t\t$insert_sql_data = array ('categories_id' => $categories_id, 'language_id' => $lang['id']);\n\t\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);\n\t\t\t}\n\t\t\telseif ($action == 'update') {\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\' and language_id = \\''.$lang['id'].'\\'');\n\t\t\t}\n\t\t}\n\n\t\tif ($categories_image = & olc_try_upload('categories_image', DIR_FS_CATALOG_IMAGES.'categories/')) {\n\t\t\t$cname_arr = explode('.', $categories_image->filename);\n\t\t\t$cnsuffix = array_pop($cname_arr);\n\t\t\t$categories_image_name = $categories_id.'.'.$cnsuffix;\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\trename(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image->filename, DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = '\".olc_db_input($categories_image_name).\"'\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t\tif ($categories_data['del_cat_pic'] == 'yes') {\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_data['categories_previous_image']);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = ''\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'jc91715.music.some_permission' => [\n 'tab' => 'music',\n 'label' => 'Some permission'\n ],\n ];\n }", "function permission_group_types($category='all',$userId='')\n\t{\n\t\tlog_message('debug', '_setting/permission_group_types');\n\t\tlog_message('debug', '_setting/permission_group_types:: [1] category='.$category.' userId='.$userId);\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_permission_group_types', 'variables'=>array(\n\t\t\t'category_condition'=>($category != 'all'? \" AND group_category='\".$category.\"' \": \"\")\n\t\t)));\n\t\tlog_message('debug', '_setting/permission_group_types:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "public function registerMenuOptions()\n {\n if (Auth::user()->hasPermission('property_category.index')) {\n Menu::registerMenuOptions(Category::class, trans('plugins/real-estate::category.menu'));\n }\n }", "public function store(CreatePermissionCategoryRequest $request)\n {\n $input = $request->all();\n\n $permissionCategory = $this->permissionCategoryRepository->create($input);\n\n Flash::success('Permission Category saved successfully.');\n\n return redirect(route('permissionCategories.index'));\n }", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "protected function buildPermissions(DiscussionType $discussion_type) {\n $type_id = $discussion_type->id();\n $type_params = ['%type' => $discussion_type->label()];\n\n return [\n \"view $type_id discussion\" => [\n 'title' => $this->t('%type: View discussion', $type_params),\n ],\n \"create $type_id discussion\" => [\n 'title' => $this->t('%type: Create new discussion', $type_params),\n ],\n \"edit own $type_id discussion\" => [\n 'title' => $this->t('%type: Edit own discussion', $type_params),\n ],\n \"edit any $type_id discussion\" => [\n 'title' => $this->t('%type: Edit any discussion', $type_params),\n ],\n \"delete own $type_id discussion\" => [\n 'title' => $this->t('%type: Delete own discussion', $type_params),\n ],\n \"delete any $type_id discussion\" => [\n 'title' => $this->t('%type: Delete any discussion', $type_params),\n ],\n \"reply to own $type_id discussion\" => [\n 'title' => $this->t('%type: Reply to own discussion', $type_params),\n ],\n \"reply to any $type_id discussion\" => [\n 'title' => $this->t('%type: Reply to any discussion', $type_params),\n ],\n ];\n }", "public function set__categories($categories)\n\t{\n\t\t// Currently cannot get multiple category groups through relationships\n\t\t$cat_groups = array();\n\n\t\tif ($this->Channel->cat_group)\n\t\t{\n\t\t\t$cat_groups = explode('|', $this->Channel->cat_group);\n\t\t}\n\n\t\tif ($this->isNew() OR empty($categories))\n\t\t{\n\t\t\t$this->Categories = NULL;\n\t\t}\n\n\t\tif (empty($categories))\n\t\t{\n\t\t\tforeach ($cat_groups as $cat_group)\n\t\t\t{\n\t\t\t\t$this->setRawProperty('cat_group_id_'.$cat_group, '');\n\t\t\t\t$this->getCustomField('categories[cat_group_id_'.$cat_group.']')->setData('');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t$set_cats = array();\n\n\t\t// Set the data on the fields in case we come back from a validation error\n\t\tforeach ($cat_groups as $cat_group)\n\t\t{\n\t\t\tif (array_key_exists('cat_group_id_'.$cat_group, $categories))\n\t\t\t{\n\t\t\t\t$group_cats = $categories['cat_group_id_'.$cat_group];\n\n\t\t\t\t$cats = implode('|', $group_cats);\n\n\t\t\t\t$this->setRawProperty('cat_group_id_'.$cat_group, $cats);\n\t\t\t\t$this->getCustomField('categories[cat_group_id_'.$cat_group.']')->setData($cats);\n\n\t\t\t\t$group_cat_objects = $this->getModelFacade()\n\t\t\t\t\t->get('Category')\n\t\t\t\t\t->filter('site_id', ee()->config->item('site_id'))\n\t\t\t\t\t->filter('cat_id', 'IN', $group_cats)\n\t\t\t\t\t->all();\n\n\t\t\t\tforeach ($group_cat_objects as $cat)\n\t\t\t\t{\n\t\t\t\t\t$set_cats[] = $cat;\n\t\t\t\t}\n\n\t\t\t\t$cat_ids = $group_cat_objects->pluck('cat_id');\n\t\t\t\tif (ee()->config->item('auto_assign_cat_parents') == 'y')\n\t\t\t\t{\n\t\t\t\t\tforeach ($set_cats as $cat)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($cat->Parent !== NULL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cat = $cat->Parent;\n\t\t\t\t\t\t\tif ( ! in_array($cat->getId(), $cat_ids))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$set_cats[] = $cat;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->Categories = $set_cats;\n\t}", "protected function _inheritCategoryPermission($path)\n {\n if (strpos($path, '/') !== false) {\n $parentPath = substr($path, 0, strrpos($path, '/'));\n } else {\n $parentPath = '';\n }\n\n $permissionParent = Enterprise_CatalogPermissions_Model_Permission::PERMISSION_PARENT;\n\n if (isset($this->_permissionCache[$path])) {\n foreach (array_keys($this->_permissionCache[$path]) as $uniqKey) {\n if (isset($this->_permissionCache[$parentPath][$uniqKey])) {\n foreach ($this->_grantsInheritance as $grant => $inheritance) {\n\n $value = $this->_permissionCache[$parentPath][$uniqKey][$grant];\n\n if ($this->_permissionCache[$path][$uniqKey][$grant] == $permissionParent) {\n $this->_permissionCache[$path][$uniqKey][$grant] = $value;\n } else {\n if ($inheritance == 'allow') {\n $value = max(\n $this->_permissionCache[$path][$uniqKey][$grant],\n $value\n );\n }\n\n $value = min(\n $this->_permissionCache[$path][$uniqKey][$grant],\n $value\n );\n\n $this->_permissionCache[$path][$uniqKey][$grant] = $value;\n }\n\n if ($this->_permissionCache[$path][$uniqKey][$grant] == $permissionParent) {\n $this->_permissionCache[$path][$uniqKey][$grant] = null;\n }\n\n }\n }\n }\n if (isset($this->_permissionCache[$parentPath])) {\n foreach (array_keys($this->_permissionCache[$parentPath]) as $uniqKey) {\n if (!isset($this->_permissionCache[$path][$uniqKey])) {\n $this->_permissionCache[$path][$uniqKey] = $this->_permissionCache[$parentPath][$uniqKey];\n }\n }\n }\n } elseif (isset($this->_permissionCache[$parentPath])) {\n $this->_permissionCache[$path] = $this->_permissionCache[$parentPath];\n }\n\n\n\n return $this;\n }", "public function initializePermissions() {\n\t\tLoader::helper('clov_permissions', 'clov');\n\t\t$page = $this->getCollectionObject();\n\t\t\n\t\tClovPermissionsHelper::setBaselinePermissions($page);\n\t\t\n\t\t// Project managers and employees can add new expenses.\n\t\t$clovGroups = Loader::package('clov')->getGroups();\n\t\t$page->assignPermissions($clovGroups[ClovPackage::PROJECT_MANAGERS], array('add_subpage'));\n\t\t$page->assignPermissions($clovGroups[ClovPackage::EMPLOYEES], array('add_subpage'));\n\t\t\n\t\t// Only allow clov_expense pages under this one.\n\t\tClovPermissionsHelper::restrictSubpageType($page, CollectionType::getByHandle('clov_expense'));\n\t}", "public function deletePermissions() {\n\t\t// delete group permissions\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\tWHERE\t\tcategoryID = \".$this->categoryID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "private static function managePermissions(Role $group, $briefcases, $permissions, $method = 'create')\n { \n if($method == 'update') \n {\n $group->permissions()->delete();\n $group->detachAllPermissions(); \n }\n\n foreach ($briefcases as $key => $value)\n {\n foreach ($permissions[$value] as $keyp => $valuep)\n { \n $group->attachPermission( Permission::create( Self::parseData($valuep, $value) ) ); \n }\n } \n }", "public function setPermissionsAttribute($permissions)\n\t{\n\t\t$this->attributes['permissions'] = serialize($permissions);\n\t}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'gency.slack.some_permission' => [\n 'tab' => 'Slack',\n 'label' => 'Some permission'\n ],\n ];\n }", "function rename_categories() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['category']->labels;\n $labels->name = 'Groups';\n $labels->singular_name = 'Group';\n $labels->add_new = 'Add Group';\n $labels->add_new_item = 'Add Group';\n $labels->edit_item = 'Edit Group';\n $labels->new_item = 'Group';\n $labels->view_item = 'View Group';\n $labels->search_items = 'Search Groups';\n $labels->not_found = 'No Groups found';\n $labels->not_found_in_trash = 'No Groups found in Trash';\n $labels->all_items = 'All Groups';\n $labels->menu_name = 'Groups';\n $labels->name_admin_bar = 'Groups';\n}", "public function setCategory($category)\n {\n if(strlen($category) <= 25 && strlen($category) > 0 && preg_match('#^[a-zA-Z- ]*$#', $category)) {\n $this->category = $category;\n }\n }", "private function createCategoryRules()\n {\n // Validation rules\n $this->form_validation->set_rules('category_title', 'Category Title', 'trim|required|max_length[255]');\n }", "abstract public function getPermissions();", "public function run()\n {\n $permissions = array(\n [\n 'name' => 'view_admin_dashboard',\n 'display_name' => 'View Admin Dashboard',\n 'description' => 'View Admin Dashboard',\n 'category' => 'general'\n ],\n [\n 'name' => 'manage_site_settings',\n 'display_name' => 'Manage Site Settings',\n 'description' => 'Manage Site Settings',\n 'category' => 'general'\n ],\n [\n 'name' => 'add_user_profile',\n 'display_name' => 'Add User Profile',\n 'description' => 'Add User Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'view_own_profile',\n 'display_name' => 'View Own Profile',\n 'description' => 'View Own Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'view_any_profile',\n 'display_name' => 'View Any Profile',\n 'description' => 'View Any Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'edit_own_profile',\n 'display_name' => 'Edit Own Profile',\n 'description' => 'Edit Own Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'edit_any_profile',\n 'display_name' => 'Edit Any Profile',\n 'description' => 'Edit Any Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'delete_own_profile',\n 'display_name' => 'Delete Own Profile',\n 'description' => 'Delete Own Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'delete_any_profile',\n 'display_name' => 'Delete Any Profile',\n 'description' => 'Delete Any Profile',\n 'category' => 'users'\n ],\n [\n 'name' => 'manage_users',\n 'display_name' => 'Manage Users',\n 'description' => 'Manage Users',\n 'category' => 'users'\n ],\n [\n 'name' => 'manage_roles',\n 'display_name' => 'Manage Roles',\n 'description' => 'Manage Roles',\n 'category' => 'roles'\n ],\n [\n 'name' => 'add_roles',\n 'display_name' => 'Add Roles',\n 'description' => 'Add Roles',\n 'category' => 'roles'\n ],\n [\n 'name' => 'view_roles',\n 'display_name' => 'View Roles',\n 'description' => 'View Roles',\n 'category' => 'roles'\n ],\n [\n 'name' => 'edit_roles',\n 'display_name' => 'Edit Roles',\n 'description' => 'Edit Roles',\n 'category' => 'roles'\n ],\n [\n 'name' => 'delete_roles',\n 'display_name' => 'Delete Roles',\n 'description' => 'Delete Roles',\n 'category' => 'roles'\n ],\n [\n 'name' => 'manage_permissions',\n 'display_name' => 'Manage Permissions',\n 'description' => 'Manage Permissions',\n 'category' => 'permissions'\n ],\n [\n 'name' => 'add_permissions',\n 'display_name' => 'Add Permissions',\n 'description' => 'Add Permissions',\n 'category' => 'permissions'\n ],\n [\n 'name' => 'view_permissions',\n 'display_name' => 'View Permissions',\n 'description' => 'View Permissions',\n 'category' => 'permissions'\n ],\n [\n 'name' => 'edit_permissions',\n 'display_name' => 'Edit Permissions',\n 'description' => 'Edit Permissions',\n 'category' => 'permissions'\n ],\n [\n 'name' => 'delete_permissions',\n 'display_name' => 'Delete Permissions',\n 'description' => 'Delete Permissions',\n 'category' => 'permissions'\n ],\n [\n 'name' => 'manage_restaurants',\n 'display_name' => 'Manage Permissions',\n 'description' => 'Manage Permissions',\n 'category' => 'restaurants'\n ],\n [\n 'name' => 'add_restaurants',\n 'display_name' => 'Add Permissions',\n 'description' => 'Add Permissions',\n 'category' => 'restaurants'\n ],\n [\n 'name' => 'view_restaurants',\n 'display_name' => 'View Permissions',\n 'description' => 'View Permissions',\n 'category' => 'restaurants'\n ],\n [\n 'name' => 'edit_restaurants',\n 'display_name' => 'Edit Permissions',\n 'description' => 'Edit Permissions',\n 'category' => 'restaurants'\n ],\n [\n 'name' => 'delete_restaurants',\n 'display_name' => 'Delete Restaurants',\n 'description' => 'Delete Restaurants',\n 'category' => 'restaurants'\n ],\n );\n\n\n foreach($permissions as $permission) {\n $category = PermissionCategory::all()->where('name', $permission['category'])->first();\n unset($permission['category']);\n $perm = new Permission($permission);\n $category->permissions()->save($perm);\n }\n }", "function pico_get_requests4category($mydirname, $cat_id = null)\n{\n\t(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = &MyTextSanitizer::sGetInstance()) || $myts = &MyTextSanitizer::getInstance();\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\tinclude dirname(__DIR__) . '/include/configs_can_override.inc.php';\n\t$cat_options = [];\n\tforeach ($GLOBALS['xoopsModuleConfig'] as $key => $val) {\n\t\tif (empty($pico_configs_can_be_override[$key])) continue;\n\t\tforeach (explode(\"\\n\", @$_POST['cat_options']) as $line) {\n\t\t\tif (preg_match('/^' . $key . '\\:(.{1,100})$/', $line, $regs)) {\n\t\t\t\tswitch ($pico_configs_can_be_override[$key]) {\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$cat_options[$key] = trim($regs[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1] > 0 ? 1 : 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (0 === $cat_id) {\n\t\t// top category\n\t\t$cat_vpath = null;\n\t\t$pid = 0xffff;\n\t} else {\n\t\t// normal category\n\t\t$cat_vpath = trim($myts->stripSlashesGPC(@$_POST['cat_vpath']));\n\t\t$pid = (int)@$_POST['pid'];\n\t\t// check $pid\n\t\tif ($pid) {\n\t\t\t$sql = 'SELECT * FROM ' . $db->prefix($mydirname . '_categories') . \" c WHERE c.cat_id=$pid\";\n\t\t\tif (!$crs = $db->query($sql)) die(_MD_PICO_ERR_SQL . __LINE__);\n\t\t\tif ($db->getRowsNum($crs) <= 0) die(_MD_PICO_ERR_READCATEGORY);\n\t\t}\n\t}\n\n\treturn [\n 'cat_title' => $myts->stripSlashesGPC(@$_POST['cat_title']),\n 'cat_desc' => $myts->stripSlashesGPC(@$_POST['cat_desc']),\n 'cat_weight' => (int)@$_POST['cat_weight'],\n 'cat_vpath' => $cat_vpath,\n 'pid' => $pid,\n 'cat_options' => pico_common_serialize($cat_options),\n ];\n}", "public function getCategory() {}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'cifq.newsletter.some_permission' => [\n 'tab' => 'Newsletter',\n 'label' => 'Some permission'\n ],\n ];\n }", "public function add_membership_category()\n {\n $this->modify_object('Booking_membership_category');\n }", "public function registerPermissions()\n {\n return [\n 'xitara.nexus.mainmenu' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.mainmenu',\n ],\n 'xitara.nexus.settings' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.settings',\n ],\n 'xitara.nexus.dashboard' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.dashboard',\n ],\n 'xitara.nexus.menu' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.menu',\n ],\n 'xitara.nexus.custommenus' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.custommenus',\n ],\n ];\n }", "public function __construct($permissions)\n {\n $this->permissions = $permissions;\n }", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'hon.honcuratoruser.some_permission' => [\n 'tab' => 'HonCuratorUser',\n 'label' => 'Some permission'\n ],\n ];\n }", "private function seedPermissions()\n {\n (new \\Naraki\\Permission\\Models\\Permission())->insert([\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::GROUPS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 4,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::GROUPS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 5,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::USERS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::BLOG_POSTS,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::MEDIA,\n 'permission_mask' => 0b1111\n ],\n [\n 'entity_type_id' => 6,\n 'entity_id' => \\Naraki\\Core\\Models\\Entity::SYSTEM,\n 'permission_mask' => 0b1111\n ],\n ]);\n\n }", "function feed_category_admin_access() {\r\n $arguments = func_get_args();\r\n $allow_public = array_shift($arguments);\r\n $feed_category = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_category_access($allow_public, $feed_category);\r\n}", "public function givePermission($permissions);", "public function providePermissions() {\n return array(\n 'CMS_ACCESS_KapostBridgeLogViewer'=>array(\n 'name'=>_t(\n 'CMSMain.ACCESS',\n \"Access to '{title}' section\",\n \"Item in permission selection identifying the admin section. Example: Access to 'Files & Images'\",\n array('title'=>_t('KapostBridgeLogViewer.MENUTITLE', 'Kapost Bridge Logs'))\n ),\n 'category'=>_t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')\n )\n );\n }", "public function create()\n {\n return view('permission_categories.create');\n }", "private function setParamsByCategory($categoryName){\n $category = $this->CC->getPublishedItem($categoryName);\n $category = $this->CC->parseItems($category['rows']);\n $params['category'] = (object) $category[0];\n \n if(!$category[0]->url || !$category[0]->uri){\n $this->CC->setCanonical($category[0]->_qname);\n }\n\n $results = $this->CC->getAssociation($category[0]->_qname,'ers:category-association');\n $params['items'] = $this->CC->parseItems($results['rows']);\n $items = $this->CC->parseItems($results['rows']);\n \n $sortedItems = $this->CC->sortItems($items);\n $params['items'] = (object) $sortedItems; \n return $params;\n }", "protected function generatePermissionsField()\n {\n return [\n 'permissions' => [\n 'tab' => 'backend::lang.user.permissions',\n 'type' => 'Modules\\Backend\\FormWidgets\\PermissionEditor',\n 'mode' => 'checkbox'\n ]\n ];\n }", "public function attachPermissions($permissions);", "public function SetPermissions ($permissions);", "public function test_admin_user_can_add_category_test()\n {\n $this->factory\n ->createCategory()\n ->createUser()\n ->signIn($this);\n\n $attribute = [\n 'name' => 'Test Category'\n ];\n\n $response = $this->post('api/category', $attribute);\n\n $response->assertOk();\n\n $this->assertEquals('Test Category', $response->getOriginalContent()['data']['category']['name']);\n }", "public function renderManageCategories()\n\t{\n\t\t// Check access\n\t\tif (! $this->user->isInRole('admin'))\n\t\t{\n\t\t\tthrow new ForbiddenRequestException('Nemáte oprávnění');\n\t\t}\n\t\t$database = $this->context->database;\n\t\t$this->template->categories = $database->table(\"WritingCategories\");\n\t}", "public function index()\n {\n $categoriess=User_category::all();\n\n if(Auth::user()->category_id ==11){\n $permissions=Permission::all();\n $categories=User_category::where('deleted',false)->get();\n }else{\n $permissions=Permission::where('permission_id','!=',3)->get();\n $categories=User_category::where('deleted',false)->where('user_category_id','!=',11)->get();\n }\n\n\n return view('pages.user_categorys')->with('categories',$categories)->with('permissions',$permissions)->with('categoriess',$categoriess);\n }", "public function providePermissions()\n {\n $category = EcommerceConfig::get(EcommerceRole::class, 'permission_category');\n $perms[EcommerceConfig::get(EcommerceRole::class, 'customer_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.CUSTOMER_PERMISSION_ANME',\n 'Customers'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.CUSTOMERS_HELP',\n 'Customer Permissions (usually very little)'\n ),\n 'sort' => 98,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'admin_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'admin_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.ADMINISTRATORS_HELP',\n 'Store Manager - can edit everything to do with the e-commerce application.'\n ),\n 'sort' => 99,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'assistant_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'assistant_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.STORE_ASSISTANTS_HELP',\n 'Store Assistant - can only view sales details and makes notes about orders'\n ),\n 'sort' => 100,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'process_orders_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_NAME',\n 'Can process orders'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_HELP',\n 'Can the user progress orders through the order steps (e.g. dispatch orders)'\n ),\n 'sort' => 101,\n ];\n\n return $perms;\n }", "function addPermissions(& $obj, & $permissionsElement, $type, $permissionsArray) {\n\t\t$hasPerms = FALSE;\n\t\t$element =& $this->_document->createElement($type.'_permission');\n\t\t\n\t\tforeach ($permissionsArray as $editorName => $array) {\n\t\t\t\n\t\t\t// if they have permission here, create an entry for them.\n\t\t\tif ($this->hasPermission($permissionsArray, $editorName, $type) && !$obj->getField(\"l%$editorName%\".$type)) {\n\t\t\t\t$agent =& $this->_document->createElement('agent');\n\t\t\t\t$agent->appendChild($this->_document->createTextNode($editorName));\n\t\t\t\t$element->appendChild($agent);\n\t\t\t\t$hasPerms = TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($hasPerms)\n\t\t\t$permissionsElement->appendChild($element);\n\t\t\n\t\treturn $hasPerms;\n\t}", "public function getCategory();", "public function getCategory();", "private function getPermissionsPermissions()\n {\n return [\n [\n 'name' => 'Permissions - List all permissions',\n 'description' => 'Allow to list all permissions.',\n 'slug' => PermissionsPolicy::PERMISSION_LIST,\n ],\n [\n 'name' => 'Permissions - View a permission',\n 'description' => 'Allow to view the permission\\'s details.',\n 'slug' => PermissionsPolicy::PERMISSION_SHOW,\n ],\n [\n 'name' => 'Permissions - Update a permission',\n 'description' => 'Allow to update a permission.',\n 'slug' => PermissionsPolicy::PERMISSION_UPDATE,\n ],\n ];\n }", "public function getCategory(Request $request)\n {\n\t\t$user = null;\n\t\t$nope = false;\n\t\t$v = \"\";\n\t\t\n\t\t$signals = $this->helpers->signals;\n\t\t$plugins = $this->helpers->getPlugins();\n\t\t$permissions = $this->helpers->permissions;\n\t\t#$this->helpers->populateTips();\n $cpt = ['user','signals','plugins'];\n\t\t\t\t\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_tickets','edit_tickets']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n \n\t\t\t\tif(isset($req['xf']))\n\t\t\t\t{\n\t\t\t\t\t$v = \"category\";\n\t\t\t\t\t$c = $this->helpers->getCategory($req['xf']);\n\t\t\t\t\t#dd($c);\n\t\t\t\t\tif(count($c) < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsession()->flash(\"validation-status-error\",\"ok\");\n\t\t\t\t\t\treturn redirect()->intended('categories');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$categories = $this->helpers->getCategories();\n\t\t\t\t\t\tarray_push($cpt,'c'); \n\t\t\t\t\t\tarray_push($cpt,'categories'); \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"validation-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('categories');\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$v = \"login\";\n\t\t}\n\t\treturn view($v,compact($cpt));\n }", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "function permission_group_list($category, $offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/permission_group_list');\n\t\tlog_message('debug', '_setting/permission_group_list:: [1] category='.$category.' offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND G.name LIKE '%\".htmlentities($phrase, ENT_QUOTES).\"%'\": '';\n\t\t$values['category_condition'] = $category != 'all'? \" AND G.group_category ='\".$category.\"' \": \"\";\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_permission_group_list', 'variables'=>$values));\n\t\tlog_message('debug', '_setting/permission_group_list:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "protected function normalizePermissions($permissions)\n {\n $permissions = substr($permissions, 1);\n\n // map the string rights to the numeric counterparts\n $map = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1');\n $permissions = strtr($permissions, $map);\n\n // split up the permission groups\n $parts = str_split($permissions, 3);\n\n // convert the groups\n $mapper = function ($part) {\n return array_sum(str_split($part));\n };\n\n // get the sum of the groups\n return array_sum(array_map($mapper, $parts));\n }", "static function RegisterAddonPermissions() {\n $description = self::LoadDescription('dynamiccontenttags');\n $perms = array (\n 'dynamiccontenttags' => array (\n 'addon_description' => GetLang('Addon_dynamiccontenttags_Settings_Header'),\n 'general' => array('name' => GetLang('Addon_dynamiccontenttags_Permission_General')),\n ),\n );\n self::RegisterAddonPermission($perms);\n }", "private function filterByPermission(){\n\n }", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "public function run()\n {\n \tDB::table(\"permissions\")->truncate();\n \t\n DB::table(\"permissions\")->insert( [\n\t\t'id'=>1,\n\t\t'key'=>'browse_admin',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>2,\n\t\t'key'=>'browse_bread',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>3,\n\t\t'key'=>'browse_database',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>4,\n\t\t'key'=>'browse_media',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>5,\n\t\t'key'=>'browse_compass',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>6,\n\t\t'key'=>'browse_menus',\n\t\t'table_name'=>'menus',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>7,\n\t\t'key'=>'read_menus',\n\t\t'table_name'=>'menus',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>8,\n\t\t'key'=>'edit_menus',\n\t\t'table_name'=>'menus',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>9,\n\t\t'key'=>'add_menus',\n\t\t'table_name'=>'menus',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>10,\n\t\t'key'=>'delete_menus',\n\t\t'table_name'=>'menus',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>11,\n\t\t'key'=>'browse_roles',\n\t\t'table_name'=>'roles',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>12,\n\t\t'key'=>'read_roles',\n\t\t'table_name'=>'roles',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>13,\n\t\t'key'=>'edit_roles',\n\t\t'table_name'=>'roles',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>14,\n\t\t'key'=>'add_roles',\n\t\t'table_name'=>'roles',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>15,\n\t\t'key'=>'delete_roles',\n\t\t'table_name'=>'roles',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>16,\n\t\t'key'=>'browse_users',\n\t\t'table_name'=>'users',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>17,\n\t\t'key'=>'read_users',\n\t\t'table_name'=>'users',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>18,\n\t\t'key'=>'edit_users',\n\t\t'table_name'=>'users',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>19,\n\t\t'key'=>'add_users',\n\t\t'table_name'=>'users',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>20,\n\t\t'key'=>'delete_users',\n\t\t'table_name'=>'users',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>21,\n\t\t'key'=>'browse_settings',\n\t\t'table_name'=>'settings',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>22,\n\t\t'key'=>'read_settings',\n\t\t'table_name'=>'settings',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>23,\n\t\t'key'=>'edit_settings',\n\t\t'table_name'=>'settings',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>24,\n\t\t'key'=>'add_settings',\n\t\t'table_name'=>'settings',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>25,\n\t\t'key'=>'delete_settings',\n\t\t'table_name'=>'settings',\n\t\t'created_at'=>'2019-02-11 14:24:41',\n\t\t'updated_at'=>'2019-02-11 14:24:41'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>26,\n\t\t'key'=>'browse_hooks',\n\t\t'table_name'=>NULL,\n\t\t'created_at'=>'2019-02-11 14:24:42',\n\t\t'updated_at'=>'2019-02-11 14:24:42'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>27,\n\t\t'key'=>'browse_articles',\n\t\t'table_name'=>'articles',\n\t\t'created_at'=>'2019-02-11 14:49:57',\n\t\t'updated_at'=>'2019-02-11 14:49:57'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>28,\n\t\t'key'=>'read_articles',\n\t\t'table_name'=>'articles',\n\t\t'created_at'=>'2019-02-11 14:49:57',\n\t\t'updated_at'=>'2019-02-11 14:49:57'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>29,\n\t\t'key'=>'edit_articles',\n\t\t'table_name'=>'articles',\n\t\t'created_at'=>'2019-02-11 14:49:57',\n\t\t'updated_at'=>'2019-02-11 14:49:57'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>30,\n\t\t'key'=>'add_articles',\n\t\t'table_name'=>'articles',\n\t\t'created_at'=>'2019-02-11 14:49:57',\n\t\t'updated_at'=>'2019-02-11 14:49:57'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>31,\n\t\t'key'=>'delete_articles',\n\t\t'table_name'=>'articles',\n\t\t'created_at'=>'2019-02-11 14:49:57',\n\t\t'updated_at'=>'2019-02-11 14:49:57'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>32,\n\t\t'key'=>'browse_cgys',\n\t\t'table_name'=>'cgys',\n\t\t'created_at'=>'2019-02-11 14:50:46',\n\t\t'updated_at'=>'2019-02-11 14:50:46'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>33,\n\t\t'key'=>'read_cgys',\n\t\t'table_name'=>'cgys',\n\t\t'created_at'=>'2019-02-11 14:50:46',\n\t\t'updated_at'=>'2019-02-11 14:50:46'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>34,\n\t\t'key'=>'edit_cgys',\n\t\t'table_name'=>'cgys',\n\t\t'created_at'=>'2019-02-11 14:50:46',\n\t\t'updated_at'=>'2019-02-11 14:50:46'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>35,\n\t\t'key'=>'add_cgys',\n\t\t'table_name'=>'cgys',\n\t\t'created_at'=>'2019-02-11 14:50:46',\n\t\t'updated_at'=>'2019-02-11 14:50:46'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>36,\n\t\t'key'=>'delete_cgys',\n\t\t'table_name'=>'cgys',\n\t\t'created_at'=>'2019-02-11 14:50:46',\n\t\t'updated_at'=>'2019-02-11 14:50:46'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>37,\n\t\t'key'=>'browse_comments',\n\t\t'table_name'=>'comments',\n\t\t'created_at'=>'2019-02-11 14:52:14',\n\t\t'updated_at'=>'2019-02-11 14:52:14'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>38,\n\t\t'key'=>'read_comments',\n\t\t'table_name'=>'comments',\n\t\t'created_at'=>'2019-02-11 14:52:14',\n\t\t'updated_at'=>'2019-02-11 14:52:14'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>39,\n\t\t'key'=>'edit_comments',\n\t\t'table_name'=>'comments',\n\t\t'created_at'=>'2019-02-11 14:52:14',\n\t\t'updated_at'=>'2019-02-11 14:52:14'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>40,\n\t\t'key'=>'add_comments',\n\t\t'table_name'=>'comments',\n\t\t'created_at'=>'2019-02-11 14:52:14',\n\t\t'updated_at'=>'2019-02-11 14:52:14'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>41,\n\t\t'key'=>'delete_comments',\n\t\t'table_name'=>'comments',\n\t\t'created_at'=>'2019-02-11 14:52:14',\n\t\t'updated_at'=>'2019-02-11 14:52:14'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>42,\n\t\t'key'=>'browse_contacts',\n\t\t'table_name'=>'contacts',\n\t\t'created_at'=>'2019-02-11 14:53:06',\n\t\t'updated_at'=>'2019-02-11 14:53:06'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>43,\n\t\t'key'=>'read_contacts',\n\t\t'table_name'=>'contacts',\n\t\t'created_at'=>'2019-02-11 14:53:06',\n\t\t'updated_at'=>'2019-02-11 14:53:06'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>44,\n\t\t'key'=>'edit_contacts',\n\t\t'table_name'=>'contacts',\n\t\t'created_at'=>'2019-02-11 14:53:06',\n\t\t'updated_at'=>'2019-02-11 14:53:06'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>45,\n\t\t'key'=>'add_contacts',\n\t\t'table_name'=>'contacts',\n\t\t'created_at'=>'2019-02-11 14:53:06',\n\t\t'updated_at'=>'2019-02-11 14:53:06'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>46,\n\t\t'key'=>'delete_contacts',\n\t\t'table_name'=>'contacts',\n\t\t'created_at'=>'2019-02-11 14:53:06',\n\t\t'updated_at'=>'2019-02-11 14:53:06'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>47,\n\t\t'key'=>'browse_elements',\n\t\t'table_name'=>'elements',\n\t\t'created_at'=>'2019-02-11 14:57:08',\n\t\t'updated_at'=>'2019-02-11 14:57:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>48,\n\t\t'key'=>'read_elements',\n\t\t'table_name'=>'elements',\n\t\t'created_at'=>'2019-02-11 14:57:08',\n\t\t'updated_at'=>'2019-02-11 14:57:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>49,\n\t\t'key'=>'edit_elements',\n\t\t'table_name'=>'elements',\n\t\t'created_at'=>'2019-02-11 14:57:08',\n\t\t'updated_at'=>'2019-02-11 14:57:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>50,\n\t\t'key'=>'add_elements',\n\t\t'table_name'=>'elements',\n\t\t'created_at'=>'2019-02-11 14:57:08',\n\t\t'updated_at'=>'2019-02-11 14:57:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>51,\n\t\t'key'=>'delete_elements',\n\t\t'table_name'=>'elements',\n\t\t'created_at'=>'2019-02-11 14:57:08',\n\t\t'updated_at'=>'2019-02-11 14:57:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>52,\n\t\t'key'=>'browse_medias',\n\t\t'table_name'=>'medias',\n\t\t'created_at'=>'2019-02-11 14:57:58',\n\t\t'updated_at'=>'2019-02-11 14:57:58'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>53,\n\t\t'key'=>'read_medias',\n\t\t'table_name'=>'medias',\n\t\t'created_at'=>'2019-02-11 14:57:58',\n\t\t'updated_at'=>'2019-02-11 14:57:58'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>54,\n\t\t'key'=>'edit_medias',\n\t\t'table_name'=>'medias',\n\t\t'created_at'=>'2019-02-11 14:57:58',\n\t\t'updated_at'=>'2019-02-11 14:57:58'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>55,\n\t\t'key'=>'add_medias',\n\t\t'table_name'=>'medias',\n\t\t'created_at'=>'2019-02-11 14:57:58',\n\t\t'updated_at'=>'2019-02-11 14:57:58'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>56,\n\t\t'key'=>'delete_medias',\n\t\t'table_name'=>'medias',\n\t\t'created_at'=>'2019-02-11 14:57:58',\n\t\t'updated_at'=>'2019-02-11 14:57:58'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>57,\n\t\t'key'=>'browse_partners',\n\t\t'table_name'=>'partners',\n\t\t'created_at'=>'2019-02-11 15:01:08',\n\t\t'updated_at'=>'2019-02-11 15:01:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>58,\n\t\t'key'=>'read_partners',\n\t\t'table_name'=>'partners',\n\t\t'created_at'=>'2019-02-11 15:01:08',\n\t\t'updated_at'=>'2019-02-11 15:01:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>59,\n\t\t'key'=>'edit_partners',\n\t\t'table_name'=>'partners',\n\t\t'created_at'=>'2019-02-11 15:01:08',\n\t\t'updated_at'=>'2019-02-11 15:01:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>60,\n\t\t'key'=>'add_partners',\n\t\t'table_name'=>'partners',\n\t\t'created_at'=>'2019-02-11 15:01:08',\n\t\t'updated_at'=>'2019-02-11 15:01:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>61,\n\t\t'key'=>'delete_partners',\n\t\t'table_name'=>'partners',\n\t\t'created_at'=>'2019-02-11 15:01:08',\n\t\t'updated_at'=>'2019-02-11 15:01:08'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>62,\n\t\t'key'=>'browse_serials',\n\t\t'table_name'=>'serials',\n\t\t'created_at'=>'2019-02-11 15:03:26',\n\t\t'updated_at'=>'2019-02-11 15:03:26'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>63,\n\t\t'key'=>'read_serials',\n\t\t'table_name'=>'serials',\n\t\t'created_at'=>'2019-02-11 15:03:26',\n\t\t'updated_at'=>'2019-02-11 15:03:26'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>64,\n\t\t'key'=>'edit_serials',\n\t\t'table_name'=>'serials',\n\t\t'created_at'=>'2019-02-11 15:03:26',\n\t\t'updated_at'=>'2019-02-11 15:03:26'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>65,\n\t\t'key'=>'add_serials',\n\t\t'table_name'=>'serials',\n\t\t'created_at'=>'2019-02-11 15:03:26',\n\t\t'updated_at'=>'2019-02-11 15:03:26'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>66,\n\t\t'key'=>'delete_serials',\n\t\t'table_name'=>'serials',\n\t\t'created_at'=>'2019-02-11 15:03:26',\n\t\t'updated_at'=>'2019-02-11 15:03:26'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>67,\n\t\t'key'=>'browse_tags',\n\t\t'table_name'=>'tags',\n\t\t'created_at'=>'2019-02-11 15:04:01',\n\t\t'updated_at'=>'2019-02-11 15:04:01'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>68,\n\t\t'key'=>'read_tags',\n\t\t'table_name'=>'tags',\n\t\t'created_at'=>'2019-02-11 15:04:01',\n\t\t'updated_at'=>'2019-02-11 15:04:01'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>69,\n\t\t'key'=>'edit_tags',\n\t\t'table_name'=>'tags',\n\t\t'created_at'=>'2019-02-11 15:04:01',\n\t\t'updated_at'=>'2019-02-11 15:04:01'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>70,\n\t\t'key'=>'add_tags',\n\t\t'table_name'=>'tags',\n\t\t'created_at'=>'2019-02-11 15:04:01',\n\t\t'updated_at'=>'2019-02-11 15:04:01'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>71,\n\t\t'key'=>'delete_tags',\n\t\t'table_name'=>'tags',\n\t\t'created_at'=>'2019-02-11 15:04:01',\n\t\t'updated_at'=>'2019-02-11 15:04:01'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>72,\n\t\t'key'=>'browse_orders',\n\t\t'table_name'=>'orders',\n\t\t'created_at'=>'2019-02-16 13:38:07',\n\t\t'updated_at'=>'2019-02-16 13:38:07'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>73,\n\t\t'key'=>'read_orders',\n\t\t'table_name'=>'orders',\n\t\t'created_at'=>'2019-02-16 13:38:07',\n\t\t'updated_at'=>'2019-02-16 13:38:07'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>74,\n\t\t'key'=>'edit_orders',\n\t\t'table_name'=>'orders',\n\t\t'created_at'=>'2019-02-16 13:38:07',\n\t\t'updated_at'=>'2019-02-16 13:38:07'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>75,\n\t\t'key'=>'add_orders',\n\t\t'table_name'=>'orders',\n\t\t'created_at'=>'2019-02-16 13:38:07',\n\t\t'updated_at'=>'2019-02-16 13:38:07'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>76,\n\t\t'key'=>'delete_orders',\n\t\t'table_name'=>'orders',\n\t\t'created_at'=>'2019-02-16 13:38:07',\n\t\t'updated_at'=>'2019-02-16 13:38:07'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>77,\n\t\t'key'=>'browse_consolidations',\n\t\t'table_name'=>'consolidations',\n\t\t'created_at'=>'2019-02-23 06:15:34',\n\t\t'updated_at'=>'2019-02-23 06:15:34'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>78,\n\t\t'key'=>'read_consolidations',\n\t\t'table_name'=>'consolidations',\n\t\t'created_at'=>'2019-02-23 06:15:34',\n\t\t'updated_at'=>'2019-02-23 06:15:34'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>79,\n\t\t'key'=>'edit_consolidations',\n\t\t'table_name'=>'consolidations',\n\t\t'created_at'=>'2019-02-23 06:15:34',\n\t\t'updated_at'=>'2019-02-23 06:15:34'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>80,\n\t\t'key'=>'add_consolidations',\n\t\t'table_name'=>'consolidations',\n\t\t'created_at'=>'2019-02-23 06:15:34',\n\t\t'updated_at'=>'2019-02-23 06:15:34'\n\t\t] );\n\n\n\t\t\t\t\t\n\t\tDB::table(\"permissions\")->insert( [\n\t\t'id'=>81,\n\t\t'key'=>'delete_consolidations',\n\t\t'table_name'=>'consolidations',\n\t\t'created_at'=>'2019-02-23 06:15:34',\n\t\t'updated_at'=>'2019-02-23 06:15:34'\n\t\t] );\n\n\n }", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "public function savePermissions($inputPermissions);", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "function svbk_policy_block_category( $categories, $post ) {\n\treturn array_merge(\n\t\t$categories,\n\t\tarray(\n\t\t\tarray(\n\t\t\t\t'slug' => 'policy',\n\t\t\t\t'title' => __( 'Policy', 'svbk-wp-policy' ),\n\t\t\t),\n\t\t)\n\t);\n}", "public function getPermissions() {}", "public function getPermissions() {}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'ams.core.some_permission' => [\n 'tab' => 'Core',\n 'label' => 'Some permission'\n ],\n ];\n }", "public function addPermission($idGroup, $permissions) {\n foreach($permissions as $permission){\n $idFunction = $permission[\"idFunction\"];\n $idAction = $permission[\"idAction\"];\n $sql = \"INSERT INTO `SM_PERMISSION` (sm_idGroup, sm_idFunction, sm_idAction) VALUES ('$idGroup', '$idFunction', '$idAction')\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n }\n }\n return true;\n }", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function getAccessibleCategories(): array\n {\n $isAllowedToSeeResourceStmt = $this->app->repositories->lockedResourceRepository->buildIsLockForRecordTypeAndTargetStatement();\n $haveCategoriesNotesStmt = $this->app->repositories->myNotesCategoriesRepository->buildHaveCategoriesNotesStatement();\n\n $allCategories = $this->app->repositories->myNotesCategoriesRepository->getCategories();\n $accessibleCategories = [];\n\n foreach ($allCategories as $key => $result) {\n $categoryId = $result[self::CATEGORY_ID];\n\n // check if this category is accessible\n if( !$this->myNotesController->hasCategoryFamilyVisibleNotes($categoryId, $isAllowedToSeeResourceStmt, $haveCategoriesNotesStmt)){\n unset($allCategories[$key]);\n continue;\n }\n\n // check if category is locked (parent)\n if( !$this->lockedResourceController->isAllowedToSeeResource($categoryId, LockedResource::TYPE_ENTITY, ModulesController::MODULE_ENTITY_NOTES_CATEGORY, false, $isAllowedToSeeResourceStmt) ){\n unset($allCategories[$key]);\n continue;\n }\n\n $accessibleCategories[$categoryId] = $result;\n\n if (!is_null($allCategories[$key][self::CHILDRENS_ID])) {\n $accessibleCategories[$categoryId][self::CHILDRENS_ID] = explode(',', $allCategories[$key][self::CHILDRENS_ID]);\n }\n\n // check if children categories are accessible\n if( !array_key_exists(self::CHILDRENS_ID, $accessibleCategories[$categoryId]) ) {\n continue;\n }\n\n $childrenIds = $accessibleCategories[$categoryId][self::CHILDRENS_ID];\n if( is_null($childrenIds) ){\n continue;\n }\n\n foreach( $childrenIds as $index => $childId ){\n $isChildAccessible = true;\n if(\n !$this->myNotesController->hasCategoryFamilyVisibleNotes($childId, $isAllowedToSeeResourceStmt, $haveCategoriesNotesStmt)\n || !$this->lockedResourceController->isAllowedToSeeResource($childId, LockedResource::TYPE_ENTITY, ModulesController::MODULE_ENTITY_NOTES_CATEGORY, false, $isAllowedToSeeResourceStmt)\n ){\n $isChildAccessible = false;\n }\n\n if( !$isChildAccessible ){\n unset($accessibleCategories[$categoryId][self::CHILDRENS_ID][$index]);\n }\n }\n }\n\n // sort alphabetically by category name\n uasort($accessibleCategories, fn(array $currentCategory, array $nextCategory) =>\n $currentCategory[self::CATEGORY] >= $nextCategory[self::CATEGORY]\n );\n return $accessibleCategories;\n }" ]
[ "0.5981092", "0.597878", "0.58900464", "0.5832863", "0.5684485", "0.56338066", "0.5620916", "0.555938", "0.5548968", "0.5526383", "0.53283894", "0.5316216", "0.53121877", "0.530834", "0.53014857", "0.5289787", "0.52774435", "0.5274407", "0.5219961", "0.5214245", "0.52108973", "0.52048737", "0.5199108", "0.5185846", "0.5170143", "0.5170143", "0.5170143", "0.5170143", "0.5170143", "0.5162537", "0.5159717", "0.51593417", "0.51591635", "0.51465964", "0.51459396", "0.514503", "0.51320016", "0.5127192", "0.51182216", "0.51103085", "0.5107618", "0.51018405", "0.50955516", "0.5087383", "0.50775707", "0.5068251", "0.50609004", "0.5056981", "0.5049205", "0.5009079", "0.5007659", "0.50029796", "0.49997264", "0.49863657", "0.4985338", "0.49746656", "0.4974133", "0.49740276", "0.49726802", "0.4964194", "0.49576348", "0.49549013", "0.4951228", "0.49510232", "0.4949269", "0.49418068", "0.49383903", "0.4938206", "0.49366912", "0.49338377", "0.49319053", "0.49286014", "0.4926678", "0.492601", "0.49257365", "0.49163386", "0.4915989", "0.49109513", "0.49107155", "0.49107155", "0.49062157", "0.4906169", "0.4903461", "0.4903375", "0.48972455", "0.48949015", "0.48947406", "0.4887399", "0.48850793", "0.48802242", "0.48733664", "0.48719406", "0.48658597", "0.48653117", "0.48604324", "0.48604324", "0.48548874", "0.4853489", "0.48520878", "0.48498216" ]
0.7674575
0
Widgets for current permission level Uses the role id to get all widgets linked to the role
Виджеты для текущего уровня разрешений Использует идентификатор роли для получения всех виджетов, связанных с ролью
public static function getAllowedWidgets($roleId = null) { if(is_null($roleId)) $roleId = session('admin.user.role_id'); // Getting an array of the widgets allowed to the current role_id $allowedWidgets = PermissionModel::where('role_id', $roleId) ->where('permission', 'like', 'widgets.%') ->get() ->pluck('permission') ->map(function($permission){ return explode('.', $permission)[1];}) ->toArray(); // Searching the widgets for the widget title and getting its role_widget data too $widgetsWithRoleWidgets = self::getWidgetsWithRoleWidgets($allowedWidgets, $roleId); return $widgetsWithRoleWidgets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roles_dashboard_update_widget_definitions() {\n\n\t$widget_types = elgg_get_widget_types('all', true);\n\tforeach ($widget_types as $handler => $options) {\n\t\t$context = $options->context;\n\t\t$context[] = 'dashboard';\n\t\t$context = array_unique($context);\n\t\telgg_register_widget_type($handler, $options->name, $options->description, $context, $options->multiple);\n\t}\n\n\t$roles = roles_get_all_selectable_roles();\n\n\t$widget_types = elgg_get_widget_types('dashboard', true);\n\tforeach ($widget_types as $handler => $options) {\n\t\t$context = $options->context;\n\t\tforeach ($roles as $role) {\n\t\t\t$context[] = \"role::{$role->name}\";\n\t\t}\n\t\t$context = array_unique($context);\n\t\telgg_register_widget_type($handler, $options->name, $options->description, $context, $options->multiple);\n\t}\n}", "private function getWidgets()\n {\n /* Config: menu widget,metodo getGonfig\n * $this->widget\n *\n * Content: array(widget,metodo,);\n */\n\n /*\n * 'config' => $this->widget('menu', 'getConfig', array('perfil-img')),\n * ** array('perfil-img') == array de la posicion y la visibilidad **\n */\n\n /*\n * 'content' => array('menu', 'getMenu', array('perfil-img', 'perfil-img')),\n * ** array('perfil-img', 'perfil-img') ==\n */\n $db = new Database(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_CHAR);\n $query = $db->query(\"SELECT * FROM \" . DB_PREFIJO . \"widgets\");\n $widget = $query->fetchAll(PDO::FETCH_OBJ);\n $widgets = array();\n foreach ($widget as $key => $valor) {\n $widgets[$valor->nombre] = array('config' => $this->widget('menu', 'getConfig', array($valor->nombre)), 'content' => array('menu', 'getMenu', array($valor->nombre, $valor->view)),);\n }\n $positions = $this->getLayoutPositions();\n $keys = array_keys($widgets);\n foreach ($keys as $k) {\n /* verificar si la posicion del widget esta presente */\n if (isset($positions[$widgets[$k]['config']['position']])) {\n /* verificar si esta deshabilitado para la vista */\n if (!isset($widgets[$k]['config']['hide']) || !in_array(self::$_item, $widgets[$k]['config']['hide'])) {\n /* verificar si esta habilitado para la vista */\n if ($widgets[$k]['config']['show'] === 'all' || in_array(self::$_item, $widgets[$k]['config']['show'])) {\n if (isset($this->_widget[$k])) {\n $widgets[$k]['content'][2] = $this->_widget[$k];\n }\n /* llenar la posicion del layout */\n $positions[$widgets[$k]['config']['position']][] = $this->getWidgetContent($widgets[$k]['content']);\n\n }\n }\n }\n }\n return $positions;\n }", "protected function retrieve_widgets()\n {\n }", "protected function retrieve_widgets()\n {\n }", "public function widgets($params) {\n include_once 'common/widget/WidgetLayoutManager.class.php';\n if ($params['owner_type'] == WidgetLayoutManager::OWNER_TYPE_USER) {\n if ($this->_userCanViewWidget('admindelegation')) {\n include_once 'AdminDelegation_UserWidget.class.php';\n $params['codendi_widgets'][] = 'admindelegation';\n }\n if ($this->_userCanViewWidget('admindelegation_projects')) {\n include_once 'AdminDelegation_ShowProjectWidget.class.php';\n $params['codendi_widgets'][] = 'admindelegation_projects';\n }\n }\n }", "public function widget_privileges()\n {\n $site_id = Model_Site::current()->id;\n if ($site_id === NULL)\n {\n return $this->_widget_error('Выберите портал!');\n }\n\n $order_by = $this->request->param('acl_prorder', 'position');\n $desc = (bool) $this->request->param('acl_prdesc', '0');\n\n $privileges = Model::fly('Model_Privilege')->find_all_by_site_id($site_id, array(\n 'order_by' => $order_by,\n 'desc' => $desc\n ));\n\n // Set up view\n $view = new View('backend/privileges');\n\n $view->order_by = $order_by;\n $view->desc = $desc;\n\n $view->privileges = $privileges;\n\n return $view->render();\n }", "protected function get_widgets()\n {\n }", "public function get_available_widgets()\n {\n }", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "private static function getWidgetsWithRoleWidgets($widgets, $roleId)\n\t{\n\t\t$resultArray = [];\n\n\t\t$widgetsWithRoleWidgets = WidgetModel::whereIn('title', $widgets)\n\t\t\t->with(['RoleWidget' => function($q) use ($roleId){\n\t\t\t\t$q->where('role_id', $roleId);\n\t\t\t}])\n\t\t\t->get()\n\t\t\t->toArray();\n\n\t\t// Handling multiple routes per widget\n\t\tarray_map(function($widget) use(&$resultArray){\n\t\t\t$explodedRoutes = explode(',', $widget['routes']);\n\n\t\t\t// If the widget has many routes i.e. comma separated values\n\t\t\tif( count($explodedRoutes) > 1)\n\t\t\t{\n\t\t\t\t// Explode them and create a new item per widget with the new route\n\t\t\t\tforeach ($explodedRoutes as $route)\n\t\t\t\t{\n\t\t\t\t\t$widget['routes'] = $route;\n\t\t\t\t\t$resultArray[] = $widget;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\t$resultArray[] = $widget;\n\t\t}, $widgetsWithRoleWidgets);\n\n\n\t\t// Array Map to remove un-related role_widgets\n\t\t$resultArray = array_map(function($widgetWithRoleWidget){\n\t\t\t$currectRoute = $widgetWithRoleWidget['routes'];\n\n\t\t\t// If there is many role_widgets we need to delete the ones that is not related to the route of the current widget\n\t\t\tif(count($widgetWithRoleWidget['role_widget']) > 1)\n\t\t\t\t// Looping in the role_widget array that comes from the widgets->with('role_widget')\n\t\t\t\tforeach($widgetWithRoleWidget['role_widget'] as $key=>$roleWidget)\n\t\t\t\t\t// If the role_widget has different route than the one we are handling then remove it\n\t\t\t\t\tif($roleWidget['route'] != $currectRoute)\n\t\t\t\t\t\t// Removing un-related role_widget since it has a wrong order and is causing issues\n\t\t\t\t\t\tunset($widgetWithRoleWidget['role_widget'][$key]);\n\n\t\t\t// Rebasing the array $widgetWithRoleWidget['role_widget'] because some items were removed\n\t\t\t$widgetWithRoleWidget['role_widget'] = array_values($widgetWithRoleWidget['role_widget']);\n\t\t\treturn $widgetWithRoleWidget;\n\t\t},$resultArray);\n\n\t\treturn $resultArray;\n\t}", "public function widgets()\n {\n\t\t//Many To Many (Polymorphic)\n return $this->morphToMany(Widget::class, 'widgetable');\n }", "function roles_dashboard_default_widget_contexts($hook, $type, $return, $params) {\n\n\t$roles = roles_get_all_selectable_roles();\n\tif (empty($roles)) {\n\t\treturn;\n\t}\n\n\tforeach ($roles as $role) {\n\t\t// We are not configuring the event information here as we will need to apply some custom logic,\n\t\t// i.e. check relationship between a specific role and a dashboard\n\t\t// @see roles_dashboard_create_default_widgets\n\t\t$return[] = array(\n\t\t\t'name' => $role->getDisplayName(),\n\t\t\t'widget_context' => \"role::{$role->name}\",\n\t\t\t'widget_columns' => ROLES_DASHBOARD_NUM_COLUMNS,\n\t\t);\n\t}\n\n\treturn $return;\n}", "public function uultra_get_custom_widgets_membership($package_id)\r\n\t{\t\t\r\n\t\t\r\n\t\tif(!get_option('userultra_custom_user_widgets_package_'.$package_id.''))\r\n\t\t{\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets');\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets_package_'.$package_id.'');\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $custom_widgets;\r\n\t\t\r\n\t\r\n\t}", "function get_list_widget_admin()\n {\n global $active_modules;\n\n $result = [];\n /**\n * List widgets of Admin\n */\n $result['Admin'] = config('Admin::widget.admin');\n\n /**\n * List widgets of Modules\n */\n if ($active_modules) {\n foreach ($active_modules as $mod) {\n $result[$mod] = config($mod . '::widget.admin');\n }\n }\n\n return $result;\n }", "public function eventRmcommonDashboardRightWidgets(){\n global $xtAssembler, $xtFunctions;\n\n if (!isset($GLOBALS['xtAssembler']))\n $xtAssembler = new XtAssembler();\n\n if ( !$xtAssembler->isSupported() )\n return;\n\n $theme = $xtAssembler->theme();\n\n RMTemplate::get()->add_style('rmc-dashboard.css', 'xthemes');\n\n ?>\n <div class=\"cu-box\">\n <div class=\"box-header\">\n <span class=\"fa fa-caret-up box-handler\"></span>\n <h3><?php _e('Appearance','rmcommon'); ?></h3>\n </div>\n <div class=\"box-content collapsable\" id=\"xthemes-options\">\n <img src=\"<?php echo XOOPS_THEME_URL; ?>/<?php echo $theme->getInfo('dir'); ?>/<?php echo $theme->getInfo('screenshot'); ?>\" class=\"img-thumbnail\">\n <ul class=\"nav nav-pills nav-justified nav-options\">\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/themes.php\" title=\"<?php _e('Manage Themes', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-th-large\"></span>\n </a>\n </li>\n <?php if(method_exists($theme, 'controlPanel')): ?>\n <li>\n <a rel=\"tooltip\" href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/theme.php\" title=\"<?php echo sprintf(__('%s Control Panel', 'xthemes'), $theme->getInfo('name')); ?>\">\n <span class=\"fa fa-dashboard\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($xtAssembler->rootMenus()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/navigation.php\" title=\"<?php _e('Menu Maker', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-bars\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($theme->options()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/settings.php\" title=\"<?php _E('Theme Settings', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-wrench\"></span>\n </a>\n </li>\n <?php endif; ?>\n </ul>\n <small><?php echo $theme->getInfo('description'); ?></small>\n <?php if( $theme->getInfo('social') ): ?>\n <hr>\n <ul class=\"nav nav-pills xthemes-social\">\n <?php foreach( $theme->getInfo('social') as $type => $link ): ?>\n <li>\n <a href=\"<?php echo $link; ?>\" target=\"_blank\">\n <?php echo $xtFunctions->social_icon( $type ); ?>\n </a>\n </li>\n <?php endforeach; ?>\n </ul>\n <?php endif; ?>\n </div>\n </div>\n <?php\n }", "public function getWidgets()\n {\n return $this->widgets;\n }", "public function getWidgets()\n {\n return $this->_widgets;\n }", "public function getWidgets()\n\t\t{\n\t\t\tif(!isset($this->id))\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\tglobal $conn;\n\t\t\tglobal $SERVICENTER_WIDGETS;\n\t\t\t\n\t\t\t$g = $conn->prepare(\"SELECT position,widget FROM ServiCenter_Workspace_Widget WHERE workspace = ?\");\n\t\t\t$g->bindParam(1, $this->id);\n\t\t\t$g->execute();\n\t\t\t\n\t\t\t$widgets = [];\n\t\t\t\n\t\t\tforeach($g->fetchAll() as $widgetData)\n\t\t\t{\n\t\t\t\tif(isset($SERVICENTER_WIDGETS[$widgetData['widget']]))\n\t\t\t\t{\n\t\t\t\t\t$widgets[] = [$widgetData['position'], $SERVICENTER_WIDGETS[$widgetData['widget']][0]];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $widgets;\n\t\t}", "function getWidgets() {\n \t$returnArray = array();\n \tforeach($this->_widgetRegistry as $name => $item) {\n \t\t$returnArray[] = array('name' => $name, 'description' => $item['description']);\n \t}\n \treturn $returnArray;\n }", "public function get_profile_widgets()\r\n\t{\r\n\t\t\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\t$user_id = get_current_user_id();\r\n\t\t\r\n\t\t$widgets = array();\r\n\t\t\r\n\t\t//get user package id\r\n\t\t$package_id = get_user_meta($user_id, 'usersultra_user_package_id', true);\r\n\t\t\r\n\t\tif($package_id!='') //user is under a membership pacakge\r\n\t\t{\r\n\t\t\t//get package\r\n\t\t\t$package = $xoouserultra->paypal->get_package($package_id);\r\n\t\t\t\r\n\t\t\t//get widgets layout for this package\r\n\t\t\t$widgets = get_option('userultra_default_user_tabs_package_'.$package_id.'');\r\n\t\t\t\r\n\t\t\t//custom layout package\r\n\t\t\t$custom_package_layout = true;\r\n\t\t\t\t\t\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$custom_package_layout = false;\t\t\t\t\t\t\r\n\t\t\t$widgets = get_option('userultra_default_user_tabs');\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html = '';\r\n\t\tforeach($widgets as $key => $widget)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//check if is in column\t\t\t\r\n\t\t\tif($this->check_if_active($key))\r\n\t\t\t{\r\n\t\t\t\tif(!$this->uultra_check_if_unused_widget($key) && !$custom_package_layout)\r\n\t\t\t\t{\r\n\t\t\t\r\n\t\t\t\t\t$html .= '<li class=\"uultra-profile-widget ui-state-default rounded\" id=\"'.$key.'\"><a class=\"uultra-btn-widget-elements\" href=\"#\" widget-id=\"'.$key.'\"><span><i class=\"fa '.$widget[\"icon\"].' fa-2x\"></i></span>'.$widget[\"title\"].' <span class=\"uultra-widgets-icon-close-open\" id=\"uultra-widgets-icon-close-open-id-'.$key.'\" style=\"background-position: 0px 0px;\" widget-id=\"'.$key.'\"></span></a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<div id=\"uultra-widget-adm-cont-id-'.$key.'\" class=\"uultra-widget-user-options-cont\" style=\"display:none\">';\r\n\t\t\t\t\t//get widget options\t\t\t\t\t\r\n\t\t\t\t\t$html .= $this->get_widget_customization_options($key);\r\n\t\t\t\t\t$html .= '</div>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t}elseif(!$this->uultra_check_if_unused_widget_settings($key, $package_id) && $custom_package_layout){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<li class=\"uultra-profile-widget ui-state-default rounded\" id=\"'.$key.'\"><a class=\"uultra-btn-widget-elements\" href=\"#\" widget-id=\"'.$key.'\"><span><i class=\"fa '.$widget[\"icon\"].' fa-2x\"></i></span>'.$widget[\"title\"].' <span class=\"uultra-widgets-icon-close-open\" id=\"uultra-widgets-icon-close-open-id-'.$key.'\" style=\"background-position: 0px 0px;\" widget-id=\"'.$key.'\"></span></a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<div id=\"uultra-widget-adm-cont-id-'.$key.'\" class=\"uultra-widget-user-options-cont\" style=\"display:none\">';\r\n\t\t\t\t\t//get widget options\t\t\t\t\t\r\n\t\t\t\t\t$html .= $this->get_widget_customization_options($key);\r\n\t\t\t\t\t$html .= '</div>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</li>';\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\treturn $html;\r\n\t\t\r\n\t}", "function roles_dashboard_create_default_widgets($event, $type, $entity) {\n\n\tif ($entity->getSubtype() != MultiDashboard::SUBTYPE) {\n\t\treturn;\n\t}\n\n\t$default_widget_info = elgg_get_config('default_widget_info');\n\n\tif (!$default_widget_info || !$entity->roles_context) {\n\t\treturn;\n\t}\n\n\t// need to be able to access everything\n\t$ia = elgg_set_ignore_access(true);\n\telgg_push_context('create_default_widgets');\n\n\t// pull in by widget context with widget owners as the site\n\t// not using elgg_get_widgets() because it sorts by columns and we don't care right now.\n\t$options = array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'widget',\n\t\t'owner_guid' => elgg_get_site_entity()->guid,\n\t\t'private_setting_name' => 'context',\n\t\t'private_setting_value' => $entity->roles_context,\n\t\t'limit' => 0\n\t);\n\n\t$widgets = elgg_get_entities_from_private_settings($options);\n\t/* @var \\ElggWidget[] $widgets */\n\n\tforeach ($widgets as $widget) {\n\t\t// change the container and owner\n\t\t$new_widget = clone $widget;\n\t\t$new_widget->container_guid = $entity->owner_guid;\n\t\t$new_widget->owner_guid = $entity->owner_guid;\n\n\t\t// pull in settings\n\t\t$settings = get_all_private_settings($widget->guid);\n\n\t\tforeach ($settings as $name => $value) {\n\t\t\t$new_widget->$name = $value;\n\t\t}\n\n\t\tif ($new_widget->save()) {\n\t\t\t// Add to dashboard\n\t\t\tadd_entity_relationship($new_widget->guid, MultiDashboard::WIDGET_RELATIONSHIP, $entity->guid);\n\t\t}\n\t}\n\n\twidget_manager_update_fixed_widgets($entity->roles_context, $entity->owner_guid);\n\n\telgg_set_ignore_access($ia);\n\telgg_pop_context();\n}", "function wp_list_widgets()\n {\n }", "public function get_widgets() {\n\n $sidebar_name = sidebar\\Sidebar::get_sidebar_name();\n \n global $wp_registered_widgets;\n\n $sidebars_widgets = get_option( 'sidebars_widgets' );\n\n $sidebar_widgets = [];\n if ( array_key_exists( $sidebar_name, $sidebars_widgets ) ) {\n\n foreach( $sidebars_widgets[$sidebar_name] as $key => $value ) {\n $widget_id = $value;\n $widget_parts = explode( '-', $widget_id );\n $widget_base_id = $widget_parts[0];\n $widget_number = $widget_parts[1];\n $options = get_option( 'widget_' . $widget_base_id );\n\n $widget_title = '';\n if ( is_array( $options[$widget_number] ) ) {\n\n if ( array_key_exists( 'title', $options[$widget_number] ) && !empty( $options[$widget_number]['title'] ) ) {\n $widget_title = $options[$widget_number]['title'];\n }\n else {\n foreach ( $wp_registered_widgets as $w => $rwidget ) {\n if ( $w == $widget_id ) {\n $widget_title = $rwidget['name']; \n }\n else {\n if ($widget_title == '') {\n $widget_title = $widget_id; \n }\n }\n }\n }\n }\n $sidebar_widgets[] = [ $widget_id => $widget_title ];\n }\n\n }\n\n \n return $sidebar_widgets;\n\n }", "public function getPermissionByRoleID($id);", "public function getWidgets(){\n $return = [];\n foreach ($this->widgets as $key => $value) {\n $namespance = str_replace([base_path(\"modules\"),base_path(\"contents/templates\"),'.php','/'], ['Modules','Themes','','\\\\'], $value);\n $namespance = str_replace('Themes\\default', 'Themes\\_default', $namespance);\n if(class_exists($namespance) && method_exists($namespance, \"register\")){\n $paths = str_replace(base_path().'/','',$value);\n $ado = [];\n $ado = with(new $namespance)->register();\n $ado[\"paths\"] = $paths;\n $return[$namespance] = $ado;\n }\n }\n return $return;\n }", "public function getRolePermissions($role_id)\r\n {\r\n $permissions = $this->AdminRoleModel->getPermissions($role_id);\r\n echo $this->load->view('admin/roles/permissions-select', compact('permissions'), TRUE);\r\n }", "function portal_add_dashboard_widgets() {\n\n if(current_user_can('publish_portal_projects')) {\n\n wp_add_dashboard_widget(\n 'portal_dashboard_overview', // Widget slug.\n 'Projects', // Title.\n 'portal_dashboard_overview_widget_function' // Display function.\n );\n\n\t\twp_add_dashboard_widget(\n\t\t\t'portal_dashboard_timing',\n\t\t\t'Project Calendar',\n\t\t\t'portal_dashboard_calendar_widget'\n\t\t);\n\n }\n\n}", "public function getWidgetMenu(){\n $layout = $this->getLayout();\n $widgetType = Yii::app()->controller instanceof TopicsController ?\n 'topics' : 'recordView';\n $layoutName = $widgetType.'WidgetLayout';\n $recordViewWidgetLayout = $this->$layoutName;\n\n $hiddenRecordViewWidgetMenu = '';\n foreach ($recordViewWidgetLayout as $widgetClass => $settings) {\n if ($settings['hidden']) {\n $hiddenRecordViewWidgetMenu .=\n '<li>\n <span class=\"x2-hidden-widgets-menu-item '.$widgetType.'-widget\" \n id=\"'.$widgetClass.'\">'.\n CHtml::encode ($settings['label']).\n '</span>\n </li>';\n }\n }\n\n // used to determine where section dividers should be placed\n $hiddenCenter = $hiddenRecordViewWidgetMenu !== '';\n $hiddenRight = !empty ($layout['hiddenRight']);\n\n $menu = '<div id=\"x2-hidden-widgets-menu\">';\n $menu .= '<ul id=\"x2-hidden-recordView-widgets-menu\" \n class=\"x2-hidden-widgets-menu-section\">';\n $menu .= $hiddenRecordViewWidgetMenu;\n $menu .= '</ul>';\n $menu .= '<ul id=\"x2-hidden-right-widgets-menu\" class=\"x2-hidden-widgets-menu-section\">';\n $menu .= '<li '.(($hiddenCenter && $hiddenRight) ? '' : 'style=\"display: none;\"').\n 'class=\"x2-hidden-widgets-menu-divider\"></li>';\n foreach($layout['hiddenRight'] as $name => $widget){\n $menu .= '<li><span class=\"x2-hidden-widgets-menu-item widget-right\" id=\"'.$name.'\">'.\n $widget['title'].'</span></li>';\n }\n $menu .= '</ul>';\n $menu .= '</div>';\n\n return $menu;\n }", "private function drawPermissions($menu, $roleId, $level = 0)\n {\n $this->id++;\n if(!is_array($menu)) \n {\n return;\n }\n \n $ret = $ret . \"<ul class='permission \"\n . ($level==0?\"root-permission\":\"sub-permission\")\n . \" permission-level-$level' id='permission-{$this->id}'>\";\n\n foreach($menu as $item)\n {\n $link = is_array($item[\"permissions\"]) ? \"<b>{$item[\"title\"]}</b>\" : \"<a href='{$this->urlPath}/permissions/$roleId{$item[\"path\"]}'>{$item[\"title\"]}</a>\";\n\n $ret = $ret . \"<li $style $extra >$link\";\n\n if(is_array($item[\"permissions\"]))\n {\n $this->save = \"<div id='fapi-submit-area'><input type='submit' value='Save'/>\";\n $ret =$ret . \"<div class='permission-box' style='padding-bottom:20px;width:500px'>\n <table width='100%'>\n <thead><tr><td width='50%'></td><td><center>Enabled</center></td><td><center>Disabled</center></td></tr></thead>\";\n foreach($item[\"permissions\"] as $permission)\n {\n $permissionName = str_replace(\".\", \"_\", $permission[\"name\"]);\n $enableChecked = User::getPermission($permissionName, $roleId) == true ? \"checked='checked'\" : \"\";\n $disabledChecked = User::getPermission($permissionName, $roleId) == true ? \"\" : \"checked='checked'\";\n \n $ret .= \"<tr>\n <td>{$permission[\"label\"]}</td>\n <td><center><input type='radio' name='{$permission[\"name\"]}[]' value='1' $enableChecked /></center></td>\n <td>\n <center><input type='radio' name='{$permission[\"name\"]}[]' value='0' $disabledChecked /></center>\n <input type='hidden' name='{$permission[\"name\"]}[]' value = '{$item[\"path\"]}' />\n </td>\n </tr>\";\n }\n $ret .= \"</table></div>\";\n }\n\n if(count($item[\"children\"]>0))\n {\n $ret = $ret \n . $this->drawPermissions($item[\"children\"],$roleId,$level+1);\n }\n $ret = $ret . \"</li>\";\n }\n\n $ret = $ret . \"</ul>\";\n return $ret;\n }", "protected function getWidget()\n {\n $widgets = $this->getPage()->findAll('css', 'body div.filter-container ul.ui-multiselect-checkboxes');\n\n /** @var NodeElement $widget */\n foreach ($widgets as $widget) {\n if ($widget->isVisible()) {\n return $widget;\n }\n }\n\n self::fail('Could not find widget on page or it\\'s not visible');\n }", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function list()\n\t{\n\t\treturn $this->widgets()->orderBy('order')->get();\n\t}", "public function getAvailableWidgets()\r\n {\r\n }", "function roles_dashboard_widget_layout_permissions_check($hook, $type, $return, $params) {\n\n\t$user = elgg_extract('user', $params);\n\t$context = elgg_extract('context', $params);\n\n\tif (strpos($context, 'role::') === 0) {\n\t\treturn $user && $user->isAdmin();\n\t}\n}", "function retrieve_widgets($theme_changed = \\false)\n {\n }", "public static function getWidgets(): ?array\n {\n return collect(Filament::getWidgets())\n ->filter(function ($widget) {\n if (Utils::isGeneralExcludeEnabled()) {\n return ! in_array(Str::afterLast($widget, '\\\\'), Utils::getExcludedWidgets());\n }\n\n return true;\n })\n ->reduce(function ($widgets, $widget) {\n $prepend = Str::of(Utils::getWidgetPermissionPrefix())->append('_');\n $name = Str::of(class_basename($widget))\n ->prepend($prepend);\n\n $widgets[\"{$name}\"] = \"{$name}\";\n\n return $widgets;\n }, collect())\n ->toArray();\n }", "public function Widgets()\n\t{\n\t\treturn $this->hasMany('ThunderID\\Widboard\\Models\\PersonWidget');\n\t}", "function wp_list_widget_controls($sidebar, $sidebar_name = '')\n {\n }", "public function getWidgetListing(){\t\n\t\t$query = 'SELECT '.DB_PREFIX.'widget_category.name AS \"category\", '.DB_PREFIX.'languages.prefix AS \"language\", '.DB_PREFIX.'widget.alias AS \"alias\", '.DB_PREFIX.'widget.language_id AS \"language_id\", '.DB_PREFIX.'widget.id AS \"id\", '.DB_PREFIX.'widget.status AS \"status\", '.DB_PREFIX.'widget.category_id AS \"category_id\", '.DB_PREFIX.'widget.name AS \"name\", '.DB_PREFIX.'widget.data AS \"data\" FROM '.DB_PREFIX.'widget LEFT JOIN '.DB_PREFIX.'languages ON '.DB_PREFIX.'languages.id = '.DB_PREFIX.'widget.language_id LEFT JOIN '.DB_PREFIX.'widget_category ON '.DB_PREFIX.'widget.category_id = '.DB_PREFIX.'widget_category.id ORDER BY '.DB_PREFIX.'widget_category.name ASC, '.DB_PREFIX.'languages.prefix ASC;';\n\t\t$rs = $this->reg->get('db')->query($query);\n\t\tif($rs->num_rows){\n\t\t\treturn $rs->rows;\n\t\t\t}\n\t\treturn false;\n\t\t}", "public static function get_all_widgets() {\r\n\t\t$ret = array(\r\n\t\t\tself::WIDGET_ACCORDION,\r\n\t\t\tself::WIDGET_DATEPICKER,\r\n\t\t\tself::WIDGET_DIALOG,\r\n\t\t\tself::WIDGET_PROGRESSBAR,\r\n\t\t\tself::WIDGET_SLIDER,\r\n\t\t\tself::WIDGET_TABS,\r\n\t\t\tself::WIDGET_AUTOCOMPLETE\r\n\t\t);\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\t$ret[] = self::WIDGET_BUTTON; \r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }", "public function run()\n {\n $currentUser = Auth::user();\n if (!empty($currentUser)) {\n if ($currentUser->role == '2') {\n $public = Rooms::where('type','public')->get();\n $private = $currentUser->rooms()->where('type','private')->get();\n $listRoomPL = collect([$public, $private]);\n $listRoomPL = $listRoomPL->collapse();\n } else {\n $listRoomPL = \\App\\Models\\Rooms::all();\n }\n }\n return view('frontend.widgets.list_rooms', [\n 'config' => $this->config,\n 'listRoomPL' => $listRoomPL,\n ]);\n }", "private function _get_permissions_section_settings() {\r\n\r\n // Get all user roles\r\n global $wp_roles;\r\n\r\n if(!isset($wp_roles))\r\n $wp_roles = new WP_Roles();\r\n\r\n $allUserRoles = $wp_roles->get_names();\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'Permissions Options' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_permissions_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'User Role Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Only allow a given user role/s to access the wholesale page. Left blank to disable filter.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_permissions_user_role_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some User Roles...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $allUserRoles\r\n ),\r\n\r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_permissions_role_filter_sectionend'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Access Denied Message' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => __( 'Message to display to users who do not have permission to access the wholesale order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_permissions_noaccess_section_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Title' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'text',\r\n 'desc' => __( 'Defaults to <b>\"Access Denied\"</b> if left blank' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_permissions_noaccess_title',\r\n 'css' => 'min-width: 400px;'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Message' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'wwof_editor',\r\n 'desc' => __( 'Defaults to <b>\"You do not have permission to view wholesale product listing\"</b> if left blank' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_permissions_noaccess_message',\r\n 'css' => 'min-width: 400px; min-height: 100px;'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Login URL' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'text',\r\n 'desc' => __( 'URL of the login page. Uses default WordPress login URL if left blank' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_permissions_noaccess_login_url',\r\n 'css' => 'min-width: 400px;'\r\n ),\r\n\r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_permissions_sectionend'\r\n )\r\n\r\n );\r\n\r\n }", "public function getDafaultsWidgets()\r\n {\r\n\r\n $widgets = array();\r\n\r\n return $widgets;\r\n }", "protected function get_views() {\n\t\tglobal $role;\n\n\t\t$wp_roles = wp_roles();\n\n\t\t$url = admin_url( 'admin.php?page=itsec&module=user-security-check' );\n\t\tif ( $this->is_site_users ) {\n\t\t\tswitch_to_blog( $this->site_id );\n\t\t\t$users_of_blog = count_users();\n\t\t\trestore_current_blog();\n\t\t} else {\n\t\t\t$users_of_blog = count_users();\n\t\t}\n\n\t\t$total_users = $users_of_blog['total_users'];\n\t\t$avail_roles =& $users_of_blog['avail_roles'];\n\t\tunset($users_of_blog);\n\n\t\t$class = empty($role) ? ' class=\"current\"' : '';\n\t\t$role_links = array();\n\t\t$role_links['all'] = \"<a href='$url' data-role=''$class>\" . sprintf( _nx( 'All <span class=\"count\">(%s)</span>', 'All <span class=\"count\">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';\n\t\tforeach ( $wp_roles->get_names() as $this_role => $name ) {\n\t\t\tif ( !isset($avail_roles[$this_role]) )\n\t\t\t\tcontinue;\n\n\t\t\t$class = '';\n\n\t\t\tif ( $this_role === $role ) {\n\t\t\t\t$class = ' class=\"current\"';\n\t\t\t}\n\n\t\t\t$name = translate_user_role( $name );\n\t\t\t/* translators: User role name with count */\n\t\t\t$name = sprintf( __('%1$s <span class=\"count\">(%2$s)</span>'), $name, number_format_i18n( $avail_roles[$this_role] ) );\n\t\t\t$role_links[$this_role] = \"<a href='\" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . \"' data-role='\" . esc_attr( $this_role ) . \"'$class>$name</a>\";\n\t\t}\n\n\t\tif ( ! empty( $avail_roles['none' ] ) ) {\n\n\t\t\t$class = '';\n\n\t\t\tif ( 'none' === $role ) {\n\t\t\t\t$class = ' class=\"current\"';\n\t\t\t}\n\n\t\t\t$name = __( 'No role' );\n\t\t\t/* translators: User role name with count */\n\t\t\t$name = sprintf( __('%1$s <span class=\"count\">(%2$s)</span>'), $name, number_format_i18n( $avail_roles['none' ] ) );\n\t\t\t$role_links['none'] = \"<a href='\" . esc_url( add_query_arg( 'role', 'none', $url ) ) . \"' data-role='none'$class>$name</a>\";\n\n\t\t}\n\n\t\treturn $role_links;\n\t}", "function wp_render_widget_control($id)\n {\n }", "public function loadWidgets($params)\r\n {\r\n $ret = array();\r\n \r\n $dashboardId = $params['dashboardId'];\r\n \r\n if($dashboardId)\r\n {\r\n $dashObj = CAntObject::factory($this->ant->dbh, \"dashboard\", $dashboardId, $this->user);\r\n $ret = $dashObj->getWidgets();\r\n }\r\n \r\n $this->sendOutput($ret);\r\n return $ret;\r\n }", "public function getWidget($widgetId);", "public function getWidgetsByContext($context)\r\n {\r\n }", "public function getWidgetList()\n { \n $widgets = HomePageWidget::where('status', HomePageWidget::ACTIVE)->where('type', HomePageWidget::TYPE_SLIDER)->orderBy('id', 'asc')->take(3)->get();\n return $widgets;\n }", "public function uulra_reload_all_widgets_admin()\r\n\t{\r\n\t\t$html = '';\t\r\n\t\t\r\n\t\t$widgets_ids = array();\t\r\n\t\t\r\n\t\t$widgets_col = $this->mWidgetsCol;\t\t\r\n\t\t$widgets_ids = get_option('uultra_profile_widget_col_1');\t\t\r\n\t\t\r\n\t\t$unused = false;\r\n\t\t\r\n\t\tif(isset($_POST[\"unused\"]))\r\n\t\t{\r\n\t\t\t$unused = true;\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(!$unused)\r\n\t\t{\t\t\r\n\t\t\r\n\t\t//col 1\t\t\r\n\t\t$html .= '<ul id=\"uultra-profile-widgets-available\" class=\"uultra-connectedSortable uultra-admin-available-widgets\">';\r\n\t\t\r\n\t\tforeach($widgets_ids as $key)\r\n\t\t{\r\n\t\t\t$widget = $widgets_col[$key];\t\t\t\r\n\t\t\t$html .= $this->get_admin_widget_template($widget, $key);\t\t\r\n\t\t\r\n\t\t}//end for each\r\n\t\t\r\n\t\t$html .= ' </ul> ';\r\n\t\t\r\n\t\t//col 2\t\t\r\n\t\t$html .= '<ul id=\"uultra-profile-widgets-available-2\" class=\"uultra-connectedSortable uultra-admin-available-widgets\">';\r\n\t\t\r\n\t\t$widgets_ids = get_option('uultra_profile_widget_col_2');\r\n\t\t\r\n\t\tforeach($widgets_ids as $key)\r\n\t\t{\r\n\t\t\t$widget = $widgets_col[$key];\t\t\t\r\n\t\t\t$html .= $this->get_admin_widget_template($widget, $key);\t\t\t\r\n\t\t\r\n\t\t}//end for each\r\n\t\t\r\n\t\t$html .= ' </ul> ';\r\n\t\t\r\n\t\t//col 3\t\t\r\n\t\t$html .= '<ul id=\"uultra-profile-widgets-available-3\" class=\"uultra-connectedSortable uultra-admin-available-widgets\">';\r\n\t\t\r\n\t\t$widgets_ids = get_option('uultra_profile_widget_col_3');\r\n\t\t\r\n\t\tforeach($widgets_ids as $key)\r\n\t\t{\r\n\t\t\t$widget = $widgets_col[$key];\t\t\t\r\n\t\t\t$html .= $this->get_admin_widget_template($widget, $key);\r\n\t\t\t\r\n\t\t\r\n\t\t}//end for each\r\n\t\t\r\n\t\t$html .= ' </ul> ';\t\r\n\t\t\r\n\t\t\r\n\t\t}else{ //unused only\r\n\t\t\r\n\t\t\r\n\t\t\tforeach($widgets_col as $key => $widget)\r\n\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$html .= $this->get_admin_widget_template($widget, $key,$unused );\t\t\t\t\r\n\t\t\t\r\n\t\t\t}//end for each\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\techo $html;\t\t\r\n\t\tdie();\r\n\t\t\r\n\t}", "function widget_permissions_check($hook, $type, $return, $params) {\n\tif (!elgg_instanceof($params['entity'], 'object', 'widget')) {\n\t\treturn $return;\n\t}\n\n\tif ($params['entity']->getContext() != 'pinboards') {\n\t\treturn $return;\n\t}\n\n\tif (elgg_get_config('au_sets_widget_noedit')) {\n\t\treturn false;\n\t}\n\n\treturn $return;\n}", "public function getAllControls();", "public function registerDashboardWidgets()\n {\n return [];\n }", "public function getWidgets() {\n\t\t$widgets = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$widgets[$name] = $this->getTranslator()->trans($widget['label']);\n\t\t\t}\n\t\t}\n\t\treturn $widgets;\n\t}", "function layout_builder_post_update_update_permissions() {\n foreach (Role::loadMultiple() as $role) {\n if ($role->hasPermission('configure any layout')) {\n $role->grantPermission('create and edit custom blocks')->save();\n }\n }\n}", "public static function getWidgets($name) {\n add_filter('dynamic_sidebar_params', 'NpShortcodes::paramsFilter');\n ob_start();\n dynamic_sidebar($name);\n $content = ob_get_clean();\n remove_filter('dynamic_sidebar_params', 'NpShortcodes::paramsFilter');\n\n $data = explode('</widget>', $content);\n $widgets = array();\n for ($i = 0; $i < count($data); $i++) {\n $widget = $data[$i];\n if (!$widget) {\n continue;\n }\n\n $id = null;\n $name = null;\n $class = null;\n $title = null;\n\n if (preg_match('/<widget(.*?)>/', $widget, $matches)) {\n if (preg_match('/id=\"(.*?)\"/', $matches[1], $ids)) {\n $id = $ids[1];\n }\n if (preg_match('/name=\"(.*?)\"/', $matches[1], $names)) {\n $name = $names[1];\n }\n if (preg_match('/class=\"(.*?)\"/', $matches[1], $classes)) {\n $class = $classes[1];\n }\n $widget = preg_replace('/<widget[^>]+>/', '', $widget);\n\n if (preg_match('/<title>(.*)<\\/title>/', $widget, $matches)) {\n $title = $matches[1];\n $widget = preg_replace('/<title>.*?<\\/title>/', '', $widget);\n }\n }\n $widget = str_replace('<ul class=\"product-categories\">', '<ul>', $widget);\n\n $widgets[] = array(\n 'id' => $id,\n 'name' => $name,\n 'class' => $class,\n 'title' => $title,\n 'content' => $widget\n );\n }\n return $widgets;\n }", "function wise_chat_widget_channel_users() {\n\tWiseChatContainer::get('WiseChatWidgetChannelUsers');\n\treturn register_widget(\"WiseChatWidgetChannelUsers\");\n}", "public function getWidgetInfos($id){\t\n\t\t$query = 'SELECT '.DB_PREFIX.'widget_category.name AS \"category\", '.DB_PREFIX.'widget.alias AS \"alias\", '.DB_PREFIX.'widget.language_id AS \"language_id\", '.DB_PREFIX.'widget.id AS \"id\", '.DB_PREFIX.'widget.status AS \"status\", '.DB_PREFIX.'widget.category_id AS \"category_id\", '.DB_PREFIX.'widget.name AS \"name\", '.DB_PREFIX.'widget.data AS \"data\" FROM '.DB_PREFIX.'widget LEFT JOIN '.DB_PREFIX.'widget_category ON '.DB_PREFIX.'widget_category.id = '.DB_PREFIX.'widget.category_id WHERE '.DB_PREFIX.'widget.id = \"'.$id.'\" LIMIT 0,1;';\n\t\t$rs = $this->reg->get('db')->query($query);\n\t\tif($rs->num_rows){\n\t\t\treturn $rs->rows[0];\n\t\t\t}\n\t\treturn false;\n\t\t}", "function my_add_dashboard_widgets() {\n $user = wp_get_current_user();\n if ( ! $user->has_cap( 'manage_options' ) ) {\n wp_add_dashboard_widget( 'my_dashboard_welcome', 'Benvenuto', 'my_add_welcome_widget' );\n }\n}", "public function getSidebars()\n {\n $sidebarsJson = $this->runWpCliCommand('sidebar', 'list', ['format' => 'json', 'fields' => 'id']);\n $sidebars = json_decode($sidebarsJson);\n $sidebarIds = array_map(function ($sidebar) {\n return $sidebar->id;\n }, $sidebars);\n $sidebarIds = array_filter($sidebarIds, function ($id) {\n return $id != 'wp_inactive_widgets';\n });\n return $sidebarIds;\n }", "public function getPermissionRoleByRoleID($id);", "function get_role_permission($role_id) {\n\t\t$sql = \"SELECT p.*, rp.entry_id, rp.allow_deny \"\n\t\t\t. \"FROM system_security.security_permission p \"\n\t\t\t. \"LEFT JOIN system_security.security_role_permission rp ON(rp.permission_id = p.permission_id AND rp.role_id = $role_id) \"\n\t\t\t. \"ORDER BY p.permission_id\";\n\t\treturn $this->db->query($sql);\n\t}", "public static function getWidget($id)\n {\n return (array) BackendModel::getContainer()->get('database')->getRecord(\n 'SELECT i.*\n FROM slideshow_widgets AS i\n WHERE i.id = ?',\n array((int) $id)\n );\n }", "public function widgets()\n {\n return view('pages.widgets');\n }", "public function get_widget_object($id_base)\n {\n }", "public function getByRole($id)\n {\n $permissions = $this->getBaseQuery()\n ->join('prv_role_permissions', 'prv_role_permissions.id_permission = prv_permissions.id')\n ->join('prv_roles', 'prv_role_permissions.id_role = prv_roles.id')\n ->where('prv_roles.id', $id);\n\n return $permissions->get()->result_array();\n }", "public function permissions_callback(){\n $wp_roles = new WP_Roles();\n\t\t$roles = $wp_roles->get_names();\n $checked_values = !isset($this->general_options['permissions']) ? array(BK_DEFAULT_ROLE) : $this->general_options['permissions'];\n\n\t\tforeach ($roles as $role_value => $role_name) {\n\t\t\t$checked = $role_value == 'administrator' || in_array($role_value, $checked_values) ? 'checked' : '';\n\n\t\t\techo '<p><input type=\"checkbox\"'.disabled(\"administrator\", $role_value, false).' name=\"fo_general_options[permissions][]\" value=\"' . $role_value . '\" '.$checked.'>'.translate_user_role($role_name).'</input></p>';\n \t\t}\n }", "public function getWidgetConfigs()\n {\n return $this->widgets;\n }", "function wpscSupportTickets_main_add_dashboard_widgets() {\r\n $this->checkPermissions();\r\n wp_add_dashboard_widget('wpscSupportTickets_main_dashboard_widgets', __('IDB Support Tickets Overview', 'wpsc-support-tickets'), array(&$this, 'wpscSupportTickets_main_dashboard_widget_function'));\r\n \r\n }", "public function getSupportWidgetList()\n { \n $widgets = HomePageWidget::where('status', HomePageWidget::ACTIVE)->where('type', HomePageWidget::TYPE_SUPPORT)->orderBy('id', 'asc')->take(3)->get();\n return $widgets;\n }", "public function actionPermissions()\n\t{\n\t\t$dataProvider = new RPermissionDataProvider('permissions',array(\n\t\t\t\t'pagination'=>array(\n\t\t\t\t\t\t'pageSize'=>5,\n\t\t\t\t),\n\t\t));\n\t\t// Get the roles from the data provider\n\t\t$roles = $dataProvider->getRoles();\n\t\t$roleColumnWidth = $roles!==array() ? 75/count($roles) : 0;\n\n\t\t// Initialize the columns\n\t\t$columns = array(\n\t\t\tarray(\n \t\t\t'name'=>'description',\n\t \t\t'header'=>Rights::t('core', 'Item'),\n\t\t\t\t'type'=>'raw',\n \t\t\t'htmlOptions'=>array(\n \t\t\t\t'class'=>'permission-column',\n \t\t\t\t'style'=>'width:25%',\n\t \t\t),\n \t\t),\n\t\t);\n\n\t\t// Add a column for each role\n \tforeach( $roles as $roleName=>$role )\n \t{\n \t\t$columns[] = array(\n\t\t\t\t'name'=>strtolower($roleName),\n \t\t\t'header'=>$role->getNameText(),\n \t\t\t'type'=>'raw',\n \t\t\t'htmlOptions'=>array(\n \t\t\t\t'class'=>'role-column',\n \t\t\t\t'style'=>'width:'.$roleColumnWidth.'%',\n \t\t\t),\n \t\t);\n\t\t}\n\n\t\t$view = 'permissions';\n\t\t$params = array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'columns'=>$columns,\n\t\t);\n\n\t\t// Render the view\n\t\tisset($_POST['ajax'])===true ? $this->renderPartial($view, $params) : $this->render($view, $params);\n\t}", "public function getAllTabAsPerRole($role_id)\n\t{\n\t\t$this->db->select('a.*, b.*');\n\t\t$this->db->from('tbl_user_permission a'); \n\t\t$this->db->join('tbl_sidebar_tabs b','a.tab_id = b.tab_id','inner');\n\t\t$this->db->where('a.role_id', $role_id);\n\t\t$this->db->where('b.status', 1);\n\t\t$this->db->order_by('b.tab_number', 'ASC');\n\t\t$query = $this->db->get();\t\t\n\t\treturn $query->result() ;\n\t}", "public function listPermissionByRole()\n {\n $roles = $this->roleRepository->all();\n $permissions = $this->permissionRepository->all();\n return view('admin.permission.permission_role', compact('roles', 'permissions'));\n }", "public function getWidgets($sidebar)\n {\n $widgetsJson = $this->runWpCliCommand('widget', 'list', [$sidebar, 'format' => 'json', 'fields' => 'id']);\n $widgets = json_decode($widgetsJson);\n $widgetIds = array_map(function ($widget) {\n return $widget->id;\n }, $widgets);\n return $widgetIds;\n }", "function get_roles_with_capability($capability, $permission=NULL, $context='') {\n\n global $CFG;\n\n if ($context) {\n if ($contexts = get_parent_contexts($context)) {\n $listofcontexts = '('.implode(',', $contexts).')';\n } else {\n $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n $listofcontexts = '('.$sitecontext->id.')'; // must be site\n }\n $contextstr = \"AND (rc.contextid = '$context->id' OR rc.contextid IN $listofcontexts)\";\n } else {\n $contextstr = '';\n }\n\n $selectroles = \"SELECT r.*\n FROM {$CFG->prefix}role r,\n {$CFG->prefix}role_capabilities rc\n WHERE rc.capability = '$capability'\n AND rc.roleid = r.id $contextstr\";\n\n if (isset($permission)) {\n $selectroles .= \" AND rc.permission = '$permission'\";\n }\n return get_records_sql($selectroles);\n}", "private function _get_crud_for_members($role_id=NULL) {\n\t\t$data = array(\n\t\t\t'select' => array(\n\t\t\t\tarray('name' => 'id', 'label' => 'ID', \n\t\t\t\t\t'rules' => array('key', 'hidden', 'trim'),),\n\t\t\t\tarray('name' => 'username', 'label' => 'Username', 'link' => 'example1/preference/show/{id}',\n\t\t\t\t\t'rules' => array('trim', 'htmlspecialchars'),),\n\t\t\t),\n 'search' => array('id', 'username'),\n\t\t\t'datasource' => array(\n\t\t\t\t'table' => 'oci_users',\n\t\t\t\t'where' => array('role_id' => $role_id),\n\t\t\t),\n\t\t\t'properties' => array(\n\t\t\t\t'name' => 'roles_members',\n\t\t\t\t'uri' => 'example1/roles/members/'.$role_id,\n\t\t\t\t'index_column' => TRUE,\n\t\t\t\t'index_column_start' => 1,\n 'pagination' => FALSE,\n\t\t\t\t'pagination_per_page' => 5,\n\t\t\t\t'crud_title' => NULL,\n\t\t\t\t'crud_form_title' => '<h2>'.t('List of Members').'</h2>',\n\t\t\t\t'insert_form_title' => '<h2>'.t('Insert Data').'</h2>',\n\t\t\t\t'update_form_title' => '<h2>'.t('Update Data').'</h2>',\n\t\t\t\t'delete_form_title' => '<h2>'.t('Delete Data').'</h2>',\n\t\t\t),\n\t\t);\n\t\t$this->crud->set_data($data);\n\t\treturn $this->crud->render();\n\t}", "function roles_dashboard_object_permissions_check($hook, $type, $return, $params) {\n\n\t$user = elgg_extract('user', $params);\n\t$entity = elgg_extract('entity', $params);\n\n\tif ($entity->getSubtype() == MultiDashboard::SUBTYPE && !empty($entity->roles_context)) {\n\t\treturn $user && $user->isAdmin();\n\t}\n\n\t$context = elgg_get_context();\n\tif ($entity->getSubtype() == 'widget' && strpos($context, 'role::') === 0) {\n\t\treturn $user && $user->isAdmin();\n\t}\n}", "public function getControls();", "public function get_profile_column_widgets($col)\r\n\t{\r\n\t\t\r\n\t\t$user_id = get_current_user_id();\r\n\t\t\t\t\r\n\t\t$col_widgets = 'uultra_profile_widget_col_'.$col;\t\t\t\t\r\n\t\t$widgets = get_user_meta($user_id, $col_widgets, true);\t\t\t\r\n\t\t\r\n\t\t//if display only 1 column we have to add the other's colum widgets\t\t\r\n\t\t$cols = $this->get_amount_of_cols_by_template();\r\n\t\t\r\n\t\tif($col == 1 && $cols==1) // this is a one column template\r\n\t\t{\r\n\t\t\t$all_widgets = array();\r\n\t\t\t\r\n\t\t\t$widgets_col_2 = array();\r\n\t\t\t$widgets_col_3 = array();\r\n\t\t\t// we have to get the widgets in column 2 and 3\t\t\t\r\n\t\t\t$col_to_get_2 =\"uultra_profile_widget_col_2\";\r\n\t\t\t$widgets_col_2 = $this->get_user_meta($col_to_get_2, $user_id );\r\n\t\t\t\r\n\t\t\t$col_to_get_3 =\"uultra_profile_widget_col_3\";\r\n\t\t\t$widgets_col_3= $this->get_user_meta($col_to_get_3, $user_id );\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(is_array($widgets_col_2) && is_array($widgets_col_3))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\t$all_widgets = array_merge($widgets_col_2, $widgets_col_3);\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(is_array($all_widgets) )\r\n\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t$widgets = array_merge($widgets, $all_widgets);\t\t\r\n\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($col == 2 && $cols==2) // this is a two column template\r\n\t\t{\r\n\t\t\t$widgets_col_3 = array();\r\n\t\t\t\t\t\t\r\n\t\t\t$col_to_get_3 =\"uultra_profile_widget_col_3\";\r\n\t\t\t$widgets_col_3= $this->get_user_meta($col_to_get_3, $user_id );\t\r\n\t\t\t\r\n\t\t\tif(is_array($widgets_col_3) && is_array($widgets))\r\n\t\t\t{\r\n\t\t\t\t$widgets = array_merge($widgets, $widgets_col_3);\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t$html = '';\r\n\t\r\n\t\tif(count($widgets)>0 && is_array($widgets))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tforeach($widgets as $key )\r\n\t\t\t{\r\n\t\t\t\tif(!$this->uultra_check_if_unused_widget($key))\r\n\t\t\t\t{\r\n\t\t\t\t\t$widget = $this->mWidgetsCol[$key];\r\n\t\t\t\t\t\r\n\t\t\t\t\t//check if can be disabled.\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<li class=\"uultra-profile-widget ui-state-default rounded\" id=\"'.$key.'\">\r\n\t\t\t\t\t<a class=\"uultra-btn-widget-elements\" href=\"#\" widget-id=\"'.$key.'\"><span><i class=\"fa '.$widget[\"icon\"].' fa-2x\"></i></span>'.$widget[\"title\"].' <span class=\"uultra-widgets-icon-close-open\" id=\"uultra-widgets-icon-close-open-id-'.$key.'\" style=\"background-position: 0px 0px;\" widget-id=\"'.$key.'\"></span></a>';\r\n\t\t\t\t\t$html .= '<div id=\"uultra-widget-adm-cont-id-'.$key.'\" class=\"uultra-widget-user-options-cont\" style=\"display:none\">';\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get widget options\t\t\t\t\t\r\n\t\t\t\t\t$html .= $this->get_widget_customization_options($key);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</div>';\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\t\t\t\r\n\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\t\r\n\t\treturn $html;\r\n\t\t\r\n\t}", "public function getWidget();", "public static function getBottomMenu(){\n return ObjectDB::getAllOnField(self::$table, __CLASS__, \"type\", false,\"id\");\n\n }", "private static function build_permissions_for_role($role_id)\n\t{\n\t\t$permissions = self::get_roles_permissions($role_id);\n\t\t$permissions_array = array();\n\t\t\n\t\tforeach($permissions as $permission)\n\t\t\t$permissions_array[] = $permission->permission_id;\n\t\t\n\t\t$permissions_not_in = array();\n\t\t\n\t\tif(count($permissions_array) > 0)\n\t\t\t$permissions_not_in = DB::select(\"*\")->from(self::TABLE_PERMISSIONS)\n\t\t\t\t->where(\"id\", \"not in\", $permissions_array)\n\t\t\t\t->as_object()->execute();\n\t\telse\n\t\t\t$permissions_not_in = DB::select(\"*\")->from(self::TABLE_PERMISSIONS)\n\t\t\t\t->as_object()->execute();\n\t\t\t\n\t\tforeach($permissions_not_in as $permission_not_in)\n\t\t{\n\t\t\tDB::insert(self::TABLE_ROLES_PERMISSIONS)\n\t\t\t\t->set(array(\n\t\t\t\t\t\"role_id\" => $role_id,\n\t\t\t\t\t\"permission_id\" => $permission_not_in->id,\n\t\t\t\t\t\"active\" => 0\n\t\t\t\t))->execute();\n\t\t}\n\t}", "public function getPermission($id) {\n\t\t$group = AdminGroup::findOrFail($id);\n\t\t$resources = \\AdminResource::$resources;\n\t\t$currentPers = json_decode($group['permissions']);\n\t\t$this->layout->content = View::make('admin.groups.permission', array(\n\t\t\t\t\t'group' => $group,\n\t\t\t\t\t'resources' => $resources,\n\t\t\t\t\t'currentPers' => $currentPers\n\t\t));\n\t}", "public function loadwidgetsAction() {\n\t\t$this->_helper->getHelper('layout')->disableLayout();\n\t\tif($this->getRequest()->isPost()) {\n\t\t\tif(!($widgetsData = $this->_helper->cache->load('widgetsData', 'wd_'))) {\n\t\t\t\t$widgetsData = Tools_Widgets_Tools::getAllowedOptions();\n\t\t\t\t$this->_helper->cache->save('widgetsData', $widgetsData, 'wd_', array(), Helpers_Action_Cache::CACHE_LONG);\n\t\t\t}\n\t\t\t$this->getResponse()->setBody(json_encode($widgetsData))->sendResponse();\n\t\t}\n\t\texit;\n\t}", "public function getWidgetsByType() {\n\t\t$types = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$targets = $widget['target'];\n\t\t\t\tforeach($targets as $target) {\n\t\t\t\t\tif ($target == 'all') {\n\t\t\t\t\t\t$list = Data::TYPES;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$list = [$target];\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($list as $type) {\n\t\t\t\t\t\tif (! isset($types[$type])) {\n\t\t\t\t\t\t\t$types[$type] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$types[$type][] = $name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "function list_permissions( $role_in ) {\n global $_SESSION;\n if (!isset($_SESSION)) {\n session_start();\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n if ($role_in !== null) { // return role names of the current user\n foreach ($d[\"roles\"] as $key => $value) {\n if ( $value[\"name\"] == $role_in ) {\n $permissions_names = array();\n foreach ($value[\"permissions\"] as $perm) {\n foreach ($d[\"permissions\"] as $r) {\n if ($perm == $r[\"id\"])\n $permissions_names[] = $r[\"name\"];\n }\n }\n return $permissions_names;\n }\n }\n } else { // return all role names\n $permissions_names = array();\n foreach ($d[\"permissions\"] as $r) {\n $permissions_names[] = $r['name'];\n }\n return $permissions_names;\n }\n return;\n }", "public function index($roleId)\n {\n //\n $permissions = Permission::where('guard_name', 'user')->get();\n $role = Role::findById($roleId, 'user');\n\n if ($role->permissions->count() > 0) {\n foreach ($permissions as $permission) {\n $permission->setAttribute('is_active', false);\n if ($role->hasPermissionTo($permission)) {\n $permission->setAttribute('is_active', true);\n }\n }\n }\n return response()->view('cms.spatie.roles.index-permissions', ['roleId' => $roleId, 'permissions' => $permissions]);\n }", "public function permissionOfRole($id)\n {\n return $getAllPermissionOfRole = DB::table('role_permission')->where('role_id',$id)->pluck('permission_id');\n }", "public function get_widget_control($args)\n {\n }", "private function get_widget_obj( $id_base ) {\n\t\tglobal $wp_widget_factory;\n\n\t\t$widget = wp_filter_object_list( $wp_widget_factory->widgets, array( 'id_base' => $id_base ) );\n\t\tif ( empty( $widget ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array_pop( $widget );\n\t}", "public static function get_roles_permissions($role_id)\n\t{\n\t\t$rows = DB::select(\"*\")->from(self::TABLE_ROLES_PERMISSIONS)\n\t\t\t->where(\"role_id\", \"=\", $role_id)\n\t\t\t->as_object()->execute();\n\t\t\t\n\t\treturn $rows;\n\t}", "public function Widgets()\n\t{\n\t\treturn $this->hasMany('App\\Models\\PersonWidget');\n\t}", "public function permissions($idr) {\n\n $stmt = $this->connection->prepare(\"SELECT id, permission_id FROM role_permissions WHERE role_id = ?\");\n $stmt->bind_param(\"s\", $idr);\n $stmt->execute();\n $result = $stmt->get_result();\n return $result->fetch_array();\n }", "function spyropress_builder_render_widgets() {\n global $wp_registered_widgets;\n $content = '';\n\n // Sorting\n $sort = $wp_registered_widgets;\n usort( $sort, 'builder_module_name_sort' );\n $done = array();\n\n foreach ( $sort as $widget ) {\n $callback = $widget['callback'];\n if ( in_array( $callback, $done, true ) )\n continue;\n\n $done[] = $callback;\n $widget_obj = $callback[0];\n $class = get_class( $widget_obj );\n\n if( $class=='WP_Widget_Media_Image' || $class=='WP_Widget_Media_Gallery' || $class=='WP_Widget_Media_Audio' || $class=='WP_Widget_Media_Video')\n continue;\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->\n widget_options['description'] ) );\n }\n\n echo tomato_html( $content );\n}", "public function get_selective_refreshable_widgets()\n {\n }", "function wp_find_widgets_sidebar($widget_id)\n {\n }", "function qrd_add_dashboard_widgets() {\n\twp_add_dashboard_widget('qrp_dashboard_widget', 'Quick REST Draft', 'qrd_widget_function');\n}", "function cera_grimlock_widget_area( $id ) {\n\t\tif ( is_active_sidebar( $id ) ) : ?>\n\t\t\t<div class=\"widget-area\">\n\t\t\t\t<?php if ( is_page_template( 'template-dashboard.php' ) ): ?>\n\t\t\t\t\t<div class=\"grid-sizer\"></div>\n\t\t\t\t\t<div class=\"gutter-sizer\"></div>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php dynamic_sidebar( $id ); ?>\n\t\t\t</div><!-- .widget-area -->\n\t\t\t<?php\n\t\tendif;\n\t}" ]
[ "0.622101", "0.5974379", "0.58389336", "0.58389336", "0.5833121", "0.5819376", "0.5814579", "0.5766606", "0.57638645", "0.568372", "0.5662139", "0.5602385", "0.5586383", "0.55735177", "0.555928", "0.55482394", "0.5543467", "0.55425495", "0.5511548", "0.5493753", "0.54492646", "0.544343", "0.5414689", "0.54077846", "0.5401044", "0.5363017", "0.53536755", "0.5315067", "0.53045106", "0.5286375", "0.5278612", "0.5278612", "0.5270078", "0.52699316", "0.5263758", "0.5245585", "0.52420807", "0.522708", "0.5221947", "0.52185184", "0.52102625", "0.52068156", "0.5206144", "0.5203062", "0.5193812", "0.5193495", "0.51816714", "0.5181193", "0.515517", "0.51250726", "0.51177293", "0.5113375", "0.50775397", "0.5047922", "0.5043193", "0.5035949", "0.5028779", "0.5025564", "0.5011757", "0.4997305", "0.49970528", "0.49817717", "0.49754408", "0.49724302", "0.49605164", "0.49306095", "0.49289104", "0.49272066", "0.49191535", "0.49180916", "0.4917361", "0.4916751", "0.49120745", "0.49092945", "0.48906755", "0.48904064", "0.4877329", "0.4874107", "0.48689714", "0.4862245", "0.48613012", "0.48604622", "0.48559862", "0.48557404", "0.48555747", "0.48502338", "0.48496655", "0.48471892", "0.4846904", "0.48439264", "0.48431617", "0.4843023", "0.4840487", "0.4835922", "0.48340064", "0.48339662", "0.48335686", "0.48271537", "0.4813343", "0.48131424" ]
0.73286635
0
/ viewAddResources Renders the add resources page
/ viewAddResources Отображает страницу добавления ресурсов
public function viewAddResources() { echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_resources()\n\t{\n\t\t\n\t}", "public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function addAction()\n {\n $this->templatelang->load($this->_controller.'.'.$this->_action);\n\n // Rendering view page\n $this->_view();\n }", "public function get_add()\n { \n // Render the page\n View::make($this->bundle . '::product.add')->render();\n }", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function add_new_resource() {\n // @codingStandardsIgnoreLine\n $add_resource_name = wc_clean( $_POST['add_resource_name'] );\n\n if ( empty( $add_resource_name ) ) {\n wp_send_json_error();\n }\n\n $resource = array(\n 'post_title' => $add_resource_name,\n 'post_content' => '',\n 'post_status' => 'publish',\n 'post_author' => dokan_get_current_user_id(),\n 'post_type' => 'bookable_resource',\n );\n $resource_id = wp_insert_post( $resource );\n $edit_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $resource_id;\n ob_start();\n ?>\n <tr>\n <td><a href=\"<?php echo $edit_url; ?>\"><?php echo $add_resource_name; ?></a></td>\n <td><?php esc_attr_e( 'N/A', 'dokan' ); ?></td>\n <td>\n <a class=\"dokan-btn dokan-btn-sm dokan-btn-theme\" href =\"<?php echo $edit_url; ?>\"><?php esc_attr_e( 'Edit', 'dokan' ); ?></a>\n <button class=\"dokan-btn dokan-btn-theme dokan-btn-sm btn-remove\" data-id=\"<?php echo $resource_id; ?>\"><?php esc_attr_e( 'Remove', 'dokan' ); ?></button>\n </td>\n </tr>\n\n <?php\n $output = ob_get_clean();\n wp_send_json_success( $output );\n }", "public function add()\n {\n //renderView('add');\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "public function addView()\n {\n return $this->render('Add');\n }", "public function addAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n return $this->renderAdmin('ZingComponentGoogleMapsBundle:Default:form.html.twig', array_merge(\n array(\n 'zing_form_action' => 'Create',\n 'zing_form_errors' => $errors\n ),\n $post_request\n ));\n\n }", "public function actionAdd() {\n $this->setView('edit');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "private function _addResource()\n {\n //Add Resource\n $this->assets->collection('css_header')\n ->addCss('/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n\n $this->assets->collection('js_footer')\n ->addJs('/plugins/nestable/jquery.nestable.js')\n ->addJs('/plugins/nestable/ui-nestable.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modal.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modalmanager.js')\n ->addJs('/templates/backend/default/js/ui-modals.js');\n }", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "public function resourceTemplateTeamsAdd(Event $event)\n {\n $view = $event->getTarget();\n\n if ($has_team = $this->currentTeam()){\n $team_id = $has_team->getId();\n\n } else {\n $messanger = new Messenger();\n $messanger->addError(\"You can only make a resource template after you have been added to a team\");\n $team_id = 0;\n echo '<script>$(\\'button:contains(\"Add\")\\').prop(\"disabled\",true);</script>';\n\n }\n echo $view->partial('teams/partial/resource-template/add', ['team_id' => $team_id]);\n\n }", "public function add() {\n if($this->user->access_level != 3) {\n # If not, redirect them to the films index\n\t \tRouter::redirect(\"/films\");\n }\n \n # Setup view\n $this->template->content = View::instance('v_films_add');\n $this->template->title = \"DER | Add New Film\";\n \n # Pass in template-specific CSS files\n\t $this->template->client_files_head = '<link rel=\"stylesheet\" href=\"/css/bootstrap.css\" type=\"text/css\">\n\t \t<link rel=\"stylesheet\" href=\"/css/signin.css\" type=\"text/css\">\n\t \t<script type=\"text/javascript\" src=\"/js/app.js\"></script>';\n\n # Render template\n echo $this->template;\n }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function addAction()\n {\n// $m = $this->baseView('view',['lside','passportAdmin'],['lside'=>['list' => $this->names,'base' => ''],'cont' => ['fsd']]);\n// $p = $cr->render($m,[]);\n $p = $this->add($this->model);\n return $this->baseView('view',['admin/lside','passport/admin/add'],['lside'=>['list' => $this->names,'base' => ''],'cont' => $p]);\n }", "public function addAction()\n {\n return $this->render('OCPlatformBundle:Default:index.html.twig', ['value' => 0]);\n }", "public function addRequiredResources() {\n // None\n }", "function showLevelResources()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;\n\n\t\t$ilToolbar->addButton(\n\t\t\t$lng->txt(\"skmg_add_resource\"),\n\t\t\t$ilCtrl->getLinkTarget($this, \"addLevelResource\"));\n\t\t\n\t\t$this->setLevelHead();\n\t\t$ilTabs->activateTab(\"level_resources\");\n\t\t\n\t\tinclude_once(\"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php\");\n\t\t$tab = new ilSkillLevelResourcesTableGUI($this, \"showLevelResources\",\n\t\t\t$this->base_skill_id, $this->tref_id, (int) $_GET[\"level_id\"]);\n\t\t\n\t\t$tpl->setContent($tab->getHTML());\n\t}", "public function addAction()\n {\n \t$form = MediaForm::create($this->get('form.context'), 'media');\n\n \treturn $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => new Media()));\n }", "public function add() {\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$model->add();\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->display();\r\n\t}", "public function add()\n\t{\n\t\treturn view('pages.add');\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "function add()\n\t{\n\t\t// hien thi form them san pham\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/add');\n\t}", "public function add() {\n\t\t\n\t\t$this->template->content = View::instance(\"v_posts_add\");\n\t\t\n\t\t$client_files_body = Array(\n\t\t\t'/js/jquery.form.js',\n\t\t\t'/js/posts_add.js'\n\t\t);\n\t\t\n\t\t$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\techo $this->template;\n\t\t\n\t}", "public function addAction() {\n\t\t$this->view->addLayoutVar(\"onglet\", 2);\n\t\t$uid = Annuaire_User::getCurrentUserId();\n\t\t$this->view->title = t_('Add');\n\t\t$db = Gears_Db::getDb();\n\t\t$clients = Array();\n\t\t$result = $db->fetchAll(\"SELECT * FROM ANNUAIRE_SOCIETE WHERE USER_ID = ?\", Array($uid));\n\t\tforeach ($result as $info) {\n\t\t\t$clients[$info['SOCIETE_ID']][0] = $info['SOCIETE_ID'];\n\t\t\t$clients[$info['SOCIETE_ID']][1] = $info['SOCIETE_NOM'];\n\t\t}\n\t\t$this->view->clients = ($clients);\n\t\t$this->view->addcontact = t_(\"Add a contact\");\n\t\t$this->view->name = t_(\"Name\");\n\t\t$this->view->firstname = t_(\"First Name\");\n\t\t$this->view->address = t_(\"Address\");\n\t\t$this->view->mail = t_(\"Mail\");\n\t\t$this->view->phone = t_(\"Phone Number\");\n\t\t$this->view->cell = t_(\"Cellphone number\");\n\t\t$this->view->fax = t_(\"Fax\");\n\t\t$this->view->site = t_(\"Website\");\n\t\t$this->view->comment = t_(\"Comment\");\n\t\t$this->view->society = t_(\"Companie\");\n\t\t$this->view->none = t_(\"none\");\n\t\t$this->view->send = t_(\"Send\");\n\t\t$this->view->addsociety = t_(\"Add a companie\");\n\t\t$this->view->activity = t_(\"Activity\");\n\t}", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }", "public function showAddPage(){\n return view('add');\n }", "public function add() {\n\t\n\t\t# Make sure user is logged in if they want to use anything in this controller\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect(\"/index/unauthorized\");\n\t\t}\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_teachers_add');\n\n\t\t$this->template->title = \"Add Teacher\";\n\n\t\t$client_files_head = array(\"/css/teachers_add.css\");\n\t\t$this->template->client_files_head = Utils::load_client_files($client_files_head);\n\n\t\t#$client_files_body = array(\"/js/ElementValidation.js\", \"/js/shout_out_utils.js\");\n\t\t#$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\t# Render template\n\t\techo $this->template;\n\t\t\n\t}", "public function getAdd()\n\t{\n\t $form = \\FormBuilder::create($this->form, [\n 'method' => 'POST',\n 'model' => $this->getModelInstance(),\n 'url' => ($this->url_prefix.'/add')\n ]);\n return view($this->tpl_prefix.'add',array('catalog'=>$this), compact('form'));\n\t}", "public function addNewAction()\n {\n // echo 'Hello from the addNew action in the Books controller!';\n View::renderTemplate('Books/addBook.html');\n }", "public function addResources(RouteCollection $i18nRouteCollection);", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function add() {\n // Load add template\n $add = new Views('templates/add.tpl.php');\n // Add header and footer template\n $add->set('header', $add->addHeader());\n $add->set('footer', $add->addFooter());\n $add->set('error', '');\n $add->set('success', '');\n\n //Check if user posted form\n if (isset($_POST['name'])) {\n $name = htmlspecialchars($_POST['name'], ENT_QUOTES);\n $file = new Files($_FILES['file']);\n //Manage uploaded file. If is something wrong with file return error\n if ($destination = $file->manageUploadedFile()) {\n $this->db->addProject($name, $destination);\n $add->set('success', ' <span class=\"button\">Your project has been created, go to project list page and start your scan!</span>');\n }\n else {\n $add->set('error', ' <span class=\"button error_button\">File error: Cannot extract file. Check archive or directory permissions.</span>');\n }\n }\n return $add->render();\n }", "public function add()\n { \n return view('admin.control.add_career',[\n 'jobs'=> Career::all(),\n 'categories'=>Category::all(),\n 'contents'=>Content::all(),\n ]);\n }", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "function lb_show_add_record_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'add',\n\t\t)\n\t);\n}", "public function addAction() {\n $this->form = new \\Application\\Form\\AddParentStudyForm($this->serviceLocator);\n $this->studyDataSave();\n return array('form' => $this->form, 'id' => 0, 'associateCompanyIds' => array(), 'submittedTo' => array());\n }", "public function add(): void\n {\n $exerciseforms = $this->exerciseformBLL->getAllExcerciseforms();\n\n $data = [\n 'exerciseforms' => $exerciseforms,\n 'name' => '',\n 'description' => '',\n 'repetitions' => '',\n 'sets' => ''\n ];\n\n $this->view('exercises/add', $data);\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function create()\n {\n return view('restful.add');\n }", "public function addAction()\r\n {\r\n $form = $this->getEditItemForm();\r\n $response = $this->getResponse();\r\n $content = $this->renderViewModel('dots-nav-block/item-add', array('form' => $form));\r\n $response->setContent($content);\r\n return $response;\r\n }", "function add_resource($resource, $id) {\n\t//Create the HTML content for the resource page\n\t$content = '';\n\tif (isset($resource['description']))\n\t\t$content .= '<p>' . esc_attr($resource['description']) . '</p>';\n\t\n\t$content .= '<p><b>URL:</b> <a href=\"' . $resource['url'] . '\" target=\"_blank\">' . $resource['url'] . '</a><br/>';\n\tif (isset($resource['about'])) \n\t\t$content .= '<b>Keywords:</b> ' . join(\", \", $resource['about']) . '<br/>';\n\tif (isset($resource['author'])) \n\t\t$content .= '<b>Author:</b> ' . $resource['author'] . '<br/>';\n\tif (isset($resource['publisher'])) \n\t\t$content .= '<b>Publisher:</b> ' . $resource['publisher'] . '<br/>';\n\tif (isset($resource['dateCreated'])) \n\t\t$content .= '<b>Date created:</b> ' . $resource['dateCreated'] . '<br/>';\n\tif (isset($resource['language'])) \n\t\t$content .= '<b>Language:</b> ' . $resource['language'] . '<br/>';\n\tif (isset($resource['timeRequired'])) \n\t\t$content .= '<b>Time required:</b> ' . $resource['timeRequired'] . '<br/>';\n\tif (isset($resource['educationalUse'])) {\n\t\tcheck_term($resource['educationalUse'], \"asn_educational_use\");\n\t\t$content .= '<b>Educational use: </b><a href=\"'. get_term_link($resource['educationalUse'], \"asn_educational_use\") . '\">' . $resource['educationalUse'] . '</a><br/>';\n\t}\n\tif (isset($resource['educationalAudience'])) {\n\t\tcheck_term($resource['educationalAudience'], \"asn_educational_audience\");\n\t\t$content .= '<b>Educational audience: </b><a href=\"'. get_term_link($resource['educationalAudience'], \"asn_educational_audience\") . '\">' . $resource['educationalAudience'] . '</a><br/>';\n\t}\n\tif (isset($resource['interactivityType'])) {\n\t\tcheck_term($resource['interactivityType'], \"asn_interactivity_type\");\n\t\t$content .= '<b>Interactivity type: </b><a href=\"'. get_term_link($resource['interactivityType'], \"asn_interactivity_type\") . '\">' . $resource['interactivityType'] . '</a><br/>';\n\t}\n\tif (isset($resource['proficiencyLevel'])) {\n\t\tcheck_term($resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t$content .= '<b>Proficiency level: </b><a href=\"'. get_term_link($resource['proficiencyLevel'], \"asn_proficiency_level\") . '\">' . $resource['proficiencyLevel'] . '</a><br/>';\n\t}\n\t\n\t$content .= '</p>';\n\t//Prepare the post attributes\t\n\t$post = array(\n\t 'post_content' => $content,\n\t 'post_name' => sanitize_title(str_replace('-', ' ',$resource['title'])),\n\t 'post_title' => esc_attr($resource['title']),\n\t 'post_status' => 'publish',\n\t 'post_type' => 'learning_resource'\n\t);\n\t\n\n\t//Update existing post if appropriate\n\tif ($id >= 0) {\n\t\t$post['ID'] = $id;\n\t\twp_update_post($post);\n\t\twp_set_post_terms( $id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t//$content .= '<b>Interactivity type:</b> ' . $resource['interactivityType'];\n\t\tif(get_post_meta($id, 'resource_uri', true)==\"\") {\n\t\t\tadd_post_meta($id, 'resource_uri', rawurlencode($resource['url']), true);\n\t\t}\n\t}\n\t//Create new post if appropriate\n\telse {\n\t\t$post_id = wp_insert_post( $post);\n\t\twp_set_post_terms( $post_id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $post_id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($post_id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($post_id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\tadd_post_meta($post_id, 'resource_uri', rawurlencode($resource['url']), true);\n\t}\n\t\n}", "private function add()\n {\n return $this->app->renderView(\n 'campaigns.add',\n array(\n 'flashMessages' => $this->flashMessages\n )\n );\n }", "public function add()\n {\n return view('add_project');\n }", "public function actionAdd()\n {\n $this->adminOnly();\n\n $model = new AddPageForm(['class' => $this->getPageClassName()]);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n return $this->redirect($this->contentContainer->createUrl('edit', ['type' => $model->type]));\n }\n\n return $this->render('@custom_pages/views/common/add', [\n 'model' => $model,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }", "public function action_add()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t//return Response::forge(View::forge('event/add'));\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント追加\";\n\t\t$this->template->content = View::forge('event/add',$data);\n\t}", "public function add() \r\n\t{\r\n\t\t$data['header']['title'] = 'Add a new country';\r\n\t\t$data['footer']['scripts']['homescript.js'] = 'home';\r\n\t\t$data['view_name'] = 'country/country_add_view';\r\n\t\t$data['view_data'] = '';\r\n\t\t$this->load->view('country/page_view', $data);\r\n\t}", "public function add()\n\t{\n\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n\t\t$this->data['option'] \t\t= \"add\";\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['Active']);\n $this->_f3->set('Resource', $availableResource);\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function add(){\n return view('survey::survey-add');\n\n }", "public function addAction() {\n\t\t$this->_forward('edit', null, null, array('id' => 0, 'model' => $this->_getParam('model')));\n\t}", "public function getAdd()\n {\n return view(\"Policy::add-edit\");\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['tarifForm']['save']->caption = 'Přidat';\r\n\t}", "public function add()\n {\n $categories = Category::all();\n return view('admin.product.add',compact('categories'));\n }", "public function addCoursesPage(){\n return View('admin.addcourse');\n }", "public function create()\n {\n return view(self::$folder . 'add')->withTitle(self::$mainTitle)->with('link', self::$link);\n }", "public function add()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular_add',\n 'title' => 'Tambah Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => [],\n ];\n\n $this->load->view('template', $data);\n }", "public function add()\n {\n $this->view->state = $this->request->has('id') ? 'Edit Row' : 'Add Row';\n return $this->view('add');\n }", "public function add(){\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/usuarios/add'); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "function insert_resouces($resources) {\r\n foreach ($resources['css'] as $css) {\r\n echo '<link rel=\"stylesheet\" href=\"'. $css .'\">';\r\n }\r\n foreach ($resources['js'] as $js) {\r\n echo '<script src=\"'. $js .'\"></script>';\r\n }\r\n }", "public function render(): void\n {\n $this->prepare_items();\n $this->handleFormAction();\n $this->loadAssets();\n\n $action = $_REQUEST['action'] ?? null;\n $primaryKey = $this->model->getPrimaryColumn();\n $resourceId = $_REQUEST[$this->singular]\n ?? $this->model->{$primaryKey}\n ?? null;\n\n echo $action && in_array($action, ['edit', 'create'])\n ? $this->getFormView($resourceId)\n : $this->getDefaultView();\n\n do_action('print_resource_page_assets');\n }", "public function addAction(){\n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t}", "function studentResources(){\n // show the student resources page\n echo Template::instance()->render('views/studentResources.php');\n}", "function add()\r\n\t{\r\n\t\t$data['main_content'] = 'policy_add';\r\n\t\t$opt_load = array(\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/dashboardui.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/css3-buttons.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/progress.css\" />',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery-1.6.4.min.js\"></script>',\r\n\t\t\t'<script src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery.easytabs.min.js\" type=\"text/javascript\"></script>',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/progress.js\"></script>',\r\n\t\t\t);\r\n\t\t$opt_head = array(\r\n\t\t\t\"title\" => \"Policies\",\r\n\t\t\t\"opt_load\" => $opt_load,\r\n\t\t\t);\r\n\t\t$data['opt_head'] = $opt_head;\r\n\t\t$this->load->view('includes/template-beta', $data);\t\r\n\t}", "public function index() {\n $data = array();\n \n //Create the scripts array\n $scripts = array();\n \n //Add script to the scripts array\n $scripts[] = base_url('js/add.js');\n \n //Add scripts array to the data array\n $data['scripts'] = $scripts;\n \n //Get modules\n $modules = $this->_getModules();\n $data['modules'] = $modules;\n \n //Get categories\n $users = $this->_getUsers();\n $data['users'] = $users;\n \n //Load the header\n $this->load->view('page/header',$data);\n \n //Load the page view\n $this->load->view('add',$data);\n \n //Load the footer\n $this->load->view('page/footer',$data);\n }", "public function addAction() {\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\tlist(, $subjects) = Client_Service_Subject::getAllSubject();\n\t\t$this->assign('subjects', $subjects);\n\t}", "public function addAction()\n {\n $this->getServiceLocator()->get('permissions')->enforce('projectAddAllowed');\n\n // force the 'id' field to have the value of name\n // the input filtering will reformat it for us.\n $request = $this->getRequest();\n $request->getPost()->set('id', $request->getPost('name'));\n\n return $this->doAddEdit(ProjectFilter::MODE_ADD);\n }", "public function index ()\n {\n return view('layouts.add');\n }", "public function add() {\n\n $this->set('add', true);\n\n if($this->request->is('post')){\n\n $result = $this->Task->save($this->request->data);\n if($result){\n $this->_setFlash('Task added successfully.', 'success');\n $this->redirect('/tasks');\n }\n else {\n $valError = $this->Task->validationErrorsAsString();\n $this->_setFlash(\"Unable to save this task. ${valError}\");\n }\n }\n\n $this->render('add-edit');\n }", "public function addView()\n {\n $translate = $this->getTranslate('CodeAddView');\n $this->setParam('translate', $translate);\n\n $codeModel = new codeModel();\n\n $statusList = $codeModel->getStatusList();\n $this->setParam('statusList', $statusList);\n\n $moldRefSpecs = $codeModel->getRefSpecsPossible('R1');\n $this->setParam('refSpecs', $moldRefSpecs);\n\n // traduction des statuts\n $translateStatusList = $this->getTranslate('Status_List');\n $this->setParam('translateStatusList', $translateStatusList);\n\n\n // Récupération de la liste des données avec leurs descriptions\n $dataModel = new dataModel();\n\n $dataList = $dataModel->getDataList('Code_App');\n $this->setParam('dataList', $dataList);\n\n $dataCategoryList = $dataModel->getDataCategoryListUser('Code_App');\n $this->setParam('dataCategoryList', $dataCategoryList);\n\n // traduction des données et des catégories\n $translateData = $this->getTranslate('Data_List');\n $this->setParam('translateData', $translateData);\n $translateDataCategory = $this->getTranslate('Data_Category_List');\n $this->setParam('translateDataCategory', $translateDataCategory);\n\n\n $this->setParam('titlePage', $this->getVerifyTranslate($translate, 'pageTitle'));\n $this->setView('codeAdd');\n $this->setApp('Code_App');\n\n\n // Vérification des droits utilisateurs\n if (frontController::haveRight('add', 'Code_App'))\n $this->showView();\n else\n header('Location: /code');\n }", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "public function add()\n\t{\t\n\t\t//Carrega o Model Categorias\t\t\t\n\t\t$this->load->model('CategoriasModel', 'Categorias');\n\t\n\t\t$data['categorias'] = $this->Categorias->getCategorias();\t\n\n\t\t// Editando texto do titulo do header\n\t\t$data['pagecfg']['Title'] = \"Adicionar Pessoa\";\t\t\n\n\t\t// Alterando o Estado da View Para Adicionar Pessoa\n\t\t$data['pagecfg']['viewState'] = \"Adicionar Pessoa\";\n\t\t$data['pagecfg']['btnState'] = \"Adicionar\";\n\t\t$data['pagecfg']['inputState'] = \"enable\";\n\t\t$data['pagecfg']['actionState'] = \"/ListarPessoas/salvar\";\n\t\t\n\t\t//Carrega a View\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('PessoaView', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "function add()\n\t{\n\t\t$companies = $this->company_model->get_many_by(array('active_status' => 1));\n\t\t$violation_levels = $this->violation_level_model->get_many_by(array('active_status' => 1));\n\t\t$violation_types = $this->violation_type_model->get_many_by(array('active_status' => 1));\n\t\t\n\t\t$this->data = array(\n 'page_header' \t=> 'Add New Violation',\n 'notification' \t=> array(\"sound\"=>false),\n\t\t\t'companies'\t\t=> $companies,\n\t\t\t'violation_levels'\t=>$violation_levels,\n\t\t\t'violation_types'\t=>$violation_types\n );\n\t\t$this->load_view('forms/violation-add');\n\t}", "public function add()\n {\n $title = 'Add Tags';\n return view('admin.modules.tags.edit',['title' => $title]);\n }", "public function add()\n {\n\n return view('admin.add_role',\n [ \n 'activeTab' => 'users', \n 'activeLink' => 'addRole',\n 'userRoles' => Role::get() \n ] \n );\n }", "public function add_asset_form(){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$categories = Category::all();\n \t\treturn view('storage.add_asset', compact('categories'));\n \t}", "public function showAdd()\n {\n return View::make('honeys.add');\n }", "public function addAction()\n {\n\n $this->view->headTitle()->prepend('Add Product');\n\n $this->_helper->viewRenderer->setRender('form');\n\n $request = $this->getRequest();\n\n $form = new Application_Form_Product();\n \n if ($request->isPost()) {\n if ($form->isValid($request->getPost())) {\n\n $this->loadModel('product');\n $this->modelProduct->insert($form->getValues());\n\n $this->view->success = true;\n $this->view->productName = $form->getValues()['name'];\n $this->view->actionPerformed = 'added';\n $form->reset();\n }\n }\n \n $this->view->form = $form;\n }", "public function action_add()\n\t{\n $data = $this->addSelectBoxMongoData();\n\t\tif (count(input::post()) > 0) {\n\t\t\t$params = input::post();\n\t\t\t$data['val'] = $params;\n\t\t\tif (empty($params['c_logo']) === false) {\n\t\t\t\tunlink(IMAGE_TEMP_PATH. $params['c_logo']);\n\t\t\t}\n\t\t}\n\t\t$this->common_view->set('content', View::forge('career/add', $data));\n\t\treturn $this->common_view;\n\t}", "public function getAdd()\n {\n return view('manage.content.help.action.add');\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function addAction(){\n return view('admin::service-group.add', [\n\n 'TITLE' =>'Thêm nhóm dich vụ',\n\n ]);\n }", "public function add() {\n return view('admin/screenshot/add');\n }", "protected function addResource(Resource $resource)\n {\n $this->view->addResource($resource);\n }", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function add()\n {\n $listCategories = Category::all();\n return view('admin.categories.add_category',compact('listCategories'));\n }", "public function view_adding_instruction(){\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_instructions';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Instructions',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function showCompany_ADD() \n\t{\n\t\treturn view('company_add');\n \t\n\t}", "public function addAction()\n {\n $entity = new Feed();\n // \\Doctrine\\Common\\Util\\Debug::dump($entity);\n $form = $this->createCreateForm($entity);\n\n return $this->render('APiszczekDemoBundle:Feeds:add.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function add()\n {\n $Categories = Category::all();\n return view('crud.categories.add')->with(compact('Categories'));\n }", "public function companyadd() {\r\n $contragent_types = $this->model->getContragentTypes();\r\n return $this->view('company/companyadd', $contragent_types);\r\n }" ]
[ "0.70956415", "0.686092", "0.67862123", "0.66067195", "0.65433717", "0.6538168", "0.6532919", "0.6522265", "0.6388805", "0.63888025", "0.62770903", "0.6261078", "0.62582153", "0.6235059", "0.6217802", "0.6195584", "0.61924314", "0.6179709", "0.61661065", "0.6148068", "0.61478364", "0.61468506", "0.6139856", "0.61157244", "0.6103925", "0.60861903", "0.605729", "0.604674", "0.60456693", "0.6045604", "0.60113037", "0.6009641", "0.6007848", "0.60033756", "0.5986209", "0.59769917", "0.5967128", "0.59651756", "0.59554464", "0.59449935", "0.59197515", "0.59187585", "0.5889137", "0.58870184", "0.58758956", "0.58752185", "0.5875078", "0.58727884", "0.58447593", "0.5842163", "0.5841493", "0.58329463", "0.58123595", "0.581068", "0.58089274", "0.5806043", "0.5797699", "0.579672", "0.5782064", "0.5778929", "0.57592875", "0.5757851", "0.5757312", "0.5752248", "0.5743069", "0.5739254", "0.5739168", "0.5728254", "0.57275856", "0.5719102", "0.57095313", "0.5694566", "0.56898236", "0.5676084", "0.56757593", "0.5671385", "0.56651586", "0.5663626", "0.5648344", "0.5627558", "0.5623491", "0.5615165", "0.5612353", "0.56057364", "0.5597028", "0.5585109", "0.55813223", "0.5578719", "0.5573362", "0.5570049", "0.5569074", "0.55689687", "0.55598557", "0.55568475", "0.55534834", "0.5549325", "0.5549106", "0.5536394", "0.55355465", "0.5533849" ]
0.79143375
0
/ viewEditResources Loads a specific resource for editing and renders the edit resources page
/ viewEditResources Загружает конкретный ресурс для редактирования и отображает страницу редактирования ресурсов
public function viewEditResources() { $database = new Database(); $id = $this->_params['id']; $resource = $database->getResourceById($id); $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['active']); $this->_f3->set('Resource', $availableResource); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['Active']);\n $this->_f3->set('Resource', $availableResource);\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit(Resource $resource)\n {\n //\n }", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function editAction()\n {\n $curriculumdocId = $this->getRequest()->getParam('id');\n $curriculumdoc = $this->_initCurriculumdoc();\n if ($curriculumdocId && !$curriculumdoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_curriculumdoc')->__('This curriculum doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCurriculumdocData(true);\n if (!empty($data)) {\n $curriculumdoc->setData($data);\n }\n Mage::register('curriculumdoc_data', $curriculumdoc);\n $this->loadLayout();\n\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Training List'))\n ->_title(Mage::helper('bs_curriculumdoc')->__('Curriculum Documents'));\n if ($curriculumdoc->getId()) {\n $this->_title($curriculumdoc->getCdocName());\n } else {\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Add curriculum doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd(intval($id));\n\t\t$game_info = Resource_Service_Games::getResourceGames($info['link']);\n\t\t$this->assign('game_info', $game_info);\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\t$this->assign('info', $info);\n\t}", "public function editAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getEditRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html') , array( 'tiles' => $tiles ));\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function editAction() {}", "public function edit()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n\n $project = Project::find($_GET['id']);\n require_once('views/projects/edit.php');\n }", "public function edit($id)\n {\n // include view file\n }", "public function editAction(): object\n {\n // Sets webpage title\n $title = \"Edit content\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $contentId = getGet(\"id\");\n\n // SQL statement\n $sql = \"SELECT * FROM content WHERE id = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$contentId]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"contentId\" => $contentId,\n \"content\" => $content,\n // \"filters\" => $filters\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function editAction()\n {\n $coursedocId = $this->getRequest()->getParam('id');\n $coursedoc = $this->_initCoursedoc();\n if ($coursedocId && !$coursedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_coursedoc')->__('This course doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCoursedocData(true);\n if (!empty($data)) {\n $coursedoc->setData($data);\n }\n Mage::register('coursedoc_data', $coursedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_coursedoc')->__('Course Document'))\n ->_title(Mage::helper('bs_coursedoc')->__('Course Documents'));\n if ($coursedoc->getId()) {\n $this->_title($coursedoc->getCourseDocName());\n } else {\n $this->_title(Mage::helper('bs_coursedoc')->__('Add course doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "abstract protected function renderEdit();", "public function actionEdit($id) { }", "public function editAction() {\n\t\t// Get all todos\n\t\t$todo = new todo;\n\t\t$todo = $todo->Get($this->get['id']);\n\t\t// Filter by passing an argument as array(array('done', '=', '0')) to\n\t\t// GetList. This would for example only select todos that are done.\n\n\t\t// Get template\n\t\t$template = $this->getTemplate('todo_edit');\n\n\t\t// Render template\n\t\treturn $template->render(array('todo' => $todo));\n\t}", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "public function editAction(){\n\t\t$id = $this->getInput('id');\n\t\t$info = Ola_Service_Area::get(intval($id)); \n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t $this->assign('info', $info);\t\n\t}", "public function edit()\n {\n // get resources for display \n $website = Website::where('name','flooflix')->first();\n if (!is_null($website) && !empty($website)) {\n $page = Page::where('website_id', $website->id)->where('name','modifier_carte')->first();\n if(!is_null($page) && !empty($page)){\n $datas = $page->getResourcesToDisplayPage($page);\n } \n }else{\n return view('errors.404');\n }\n return view('Flooflix.forms.editBankCard', compact('datas'));\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }", "public function editAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$layoutName = $this->_request->getParam('layout'); \n\t\t$this->view->objLayout = $model->getLayout($layoutName);\n\t }", "public function edit(){\n $factura = parent::find($_GET['id']);\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/edit.php';\n require_once 'views/employee/layouts/footer.php';\n\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit($module_id, $id)\n {\n $module = Module::find($module_id);\n $resource = Resource::find($id);\n if ($resource == null) {\n return back();\n }else{\n return view('resources/edit-resource-title', compact('resource', 'module'));\n }\n }", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "function edit() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "public function editAction($id = null)\r\n {\r\n $all = $this->users->findAll();\r\n\r\n $this->theme->setTitle(\"Visa fråga\");\r\n $this->views->add('question/listbyId', [\r\n 'users' => $this->users,\r\n 'title' => \"Visa fråga\",\r\n ]);\r\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function editAction($id)\n {\n }", "public function action_edit()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}", "public function editAction() {\n if ($this->getRequest()->isPost()) {\n // Save changes\n $this->_savePanel();\n } else {\n $panelsModel = new Datasource_Cms_Panels();\n $id = $this->getRequest()->getParam('id');\n $panel = $panelsModel->getByID($id);\n\n $passThrough = $this->_helper->getHelper('FlashMessenger')->getMessages();\n if (count($passThrough)>0) {\n if (isset($passThrough[0]['saved'])) {\n if ($passThrough[0]['saved'] == true) $this->view->saved=true;\n }\n if (isset($passThrough[0]['errorMessage'])) {\n $this->view->errorMessage = $passThrough[0]['errorMessage'];\n }\n }\n\n $this->view->key = $panel['key'];\n $this->view->description = $panel['description'];\n $this->view->content = $panel['content'];\n $this->view->id = $panel['id'];\n }\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function editAction()\n {\n parent::editAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\r\n\t{\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\r\n\t}", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n {\n return $this->editor($isEditAction=true);\n }", "public function resourceTemplateTeamsEdit(Event $event)\n {\n $view = $event->getTarget();\n $rt_id = $view->vars()->resourceTemplate->id();\n $entityManager = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $rt_teams = $entityManager->getRepository('Teams\\Entity\\TeamResourceTemplate')->findBy(['resource_template'=>$rt_id]);\n\n $team_ids = array();\n foreach ($rt_teams as $rt_team):\n $team_ids[] = $rt_team->getTeam()->getId();\n endforeach;\n echo $view->partial('teams/partial/resource-template/edit', ['rt_teams' => $rt_teams, 'team_ids' => $team_ids]);\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function edit()\n {\n return view('common::edit');\n }", "public function editAction()\n {\n echo 'Hello from the edit action in the Books controller!';\n echo '<p>Route parameters: <pre>' .\n htmlspecialchars(print_r($this->route_params, true)) . '</pre></p>';\n }", "public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}", "public function action_editar() {\r\n\t\tif(!Session::instance()->GetUsuario())\r\n \treturn $this->redirect(\"/\");\r\n $links = new Model_Link();\r\n $template = View::factory(\"base/menu\");\r\n $template->set(\"usuario\", Session::instance()->GetUsuario());\r\n $template->set(\"links\", $links->ObtenerLinks(Session::instance()->GetUsuario()));\r\n\t\t/***************************************/\r\n\t\t$template->body = View::factory(\"compromiso/editar\");\r\n\t\t\r\n\t\t$compromisoId = $this->request->param('id');\r\n\t\t$compromiso = new Model_Compromiso($compromisoId);\r\n\t\t$template->body->set(\"compromiso\", $compromiso);\r\n\t\t$template->set(\"scripts\", $this->scripts);\r\n\t \t$template->set(\"styles\", $this->styles);\r\n\t\t\r\n\t\t$this->response->body($template);\r\n\t}", "public function resourcecontentAction() {\n\t$resource_type = $this->_getParam('resource_type');\n\t$resource_id = $this->_getParam('resource_id');\n\t$is_spocerdStory = $this->_getParam('is_spocerdStory', null);\n\n\t$is_document = 0;\n\tif ($resource_type == 'document') {\n\t $is_document = 1;\n\t}\n \n if( strstr($resource_type, \"sitereview\") ) {\n // $resource_type = \"sitereview\";\n\n $sitereviewExplode = explode(\"_\", $resource_type);\n $tempAdModId = $sitereviewExplode[1];\n $module_info = Engine_Api::_()->getItem(\"communityad_module\", $tempAdModId);\n $tempModName = strtolower($module_info->module_title);\n $tempModName = ucfirst($module_info->module_title);\n \n $content_table = \"sitereview_listing\";\n $sub_title = \"View\" . \" \" . $tempModName;\n $content_data = Engine_Api::_()->getItem($content_table, $resource_id);\n }else {\n $field_info = Engine_Api::_()->getDbTable('modules', 'communityad')->getModuleInfo($resource_type);\n\n if (!empty($field_info)) {\n $content_data = Engine_Api::_()->getItem($field_info['table_name'], $resource_id);\n }\n }\n\n $base_url = Zend_Controller_Front::getInstance()->getBaseUrl();\n if( empty($sub_title) ) {\n $sub_title = Engine_Api::_()->communityad()->viewType($resource_type);\n }\n\t$photo_id_filepath = 0;\n\n\tif (empty($is_document)) {\n\t $photo_id_filepath = $content_data->getPhotoUrl('thumb.normal');\n\t} else {\n\t $photo_id_filepath = $content_data->thumbnail;\n\t}\n\n\tif (strstr($photo_id_filepath, '?')) {\n\t $explode_array = explode(\"?\", $photo_id_filepath);\n\t $photo_id_filepath = $explode_array[0];\n\t}\n\n\t$isCDN = Engine_Api::_()->seaocore()->isCdn();\n\n\tif (empty($isCDN)) {\n\t if (!empty($base_url)) {\n\t\t$photo_id_filepath = str_replace($base_url . '/', '', $photo_id_filepath);\n\t } else {\n\t\t$arrqay = explode('/', $photo_id_filepath);\n\t\tunset($arrqay[0]);\n\t\t$photo_id_filepath = implode('/', $arrqay);\n\t }\n\t}\n\n\tif (!empty($photo_id_filepath)) {\n\t if (strstr($photo_id_filepath, 'application/')) {\n\t\t$photo_id_filepath = 0;\n\t } else {\n\t\t$content_photo = $this->upload($photo_id_filepath, $is_document, $isCDN);\n\t }\n\t}\n\t// Set \"Title width\" acording to the module.\n\t$getStoryContentTitle = $title = $content_data->getTitle();\n\t$title_lenght = strlen($title);\n\t$tmpTitle = strip_tags($content_data->getTitle());\n\t$titleTruncationLimit = $title_truncation_limit = Engine_Api::_()->getApi('settings', 'core')->getSetting('ad.char.title', 25);\n\tif ($title_lenght > $title_truncation_limit) {\n\t $title_truncation_limit = $title_truncation_limit - 2;\n\t $title = Engine_String::strlen($tmpTitle) > $title_truncation_limit ? Engine_String::substr($tmpTitle, 0, $title_truncation_limit) : $tmpTitle;\n\t $title = $title . '..';\n\t}\n\n\t// Set \"Body width\" acording to the module.\n\t$body = $content_data->getDescription();\n\t$body_lenght = strlen($body);\n\t$tmpBody = strip_tags($content_data->getDescription());\n\t$body_truncation_limit = Engine_Api::_()->getApi('settings', 'core')->getSetting('ad.char.body', 135);\n\tif ($body_lenght > $body_truncation_limit) {\n\t $body_truncation_limit = $body_truncation_limit - 2;\n\t $body = Engine_String::strlen($tmpBody) > $body_truncation_limit ? Engine_String::substr($tmpBody, 0, $body_truncation_limit) : $tmpBody;\n\t $body = $body . '..';\n\t}\n\n\n\n\n\t$preview_title = $title . '<div class=\"cmaddis_adinfo\"><a href=\"javascript:void(0);\">' . $sub_title . '</a></div>';\n \t//$preview_title = $title . '<div class=\"cmaddis_adinfo cmad_show_tooltip_wrapper\" style=\"clear:none;\"><a href=\"javascript:void(0);\">' . $sub_title . '</a><div class=\"cmad_show_tooltip\"> <img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" />Viewers will be able to like this ad and its content. They will also be able to see how many people like this ad, and which friends like this ad.</div></div>';\n\n\t$remaning_body_limit = $body_truncation_limit - strlen($body);\n\tif ($remaning_body_limit < 0) {\n\t $remaning_body_limit = 0;\n\t}\n\t$remaning_title_limit = $title_truncation_limit - strlen($title);\n\tif ($remaning_title_limit < 0) {\n\t $remaning_title_limit = 0;\n\t}\n\n\t// Set the default image if no image selected.\n\tif (empty($content_photo)) {\n\t if (empty($is_spocerdStory)) {\n\t\t$path = $this->view->layout()->staticBaseUrl . '/application/modules/Communityad/externals/images/blankImage.png';\n\t\t$content_photo = '<img src=\"' . $path . '\" alt=\" \" />';\n\t } else {\n\t $content_photo = $this->view->itemPhoto($content_data, 'thumb.profile');\n\t if( in_array('music', array('music')) && in_array('blog', array('blog')) ) {\n\t $content_photo = $this->view->itemPhoto($content_data, 'thumb.icon');\n\t }\n\t }\n\t}\n\t$viewerTruncatedTitle = Engine_Api::_()->communityad()->truncation($this->_viewer->getTitle(), $titleTruncationLimit);\n\t\n\tif ($is_spocerdStory == 1) {\n\t $storyTrunLimit = Engine_Api::_()->getApi('settings', 'core')->getSetting('story.char.title', 35);\n\t $getStoryContentTitle = Engine_Api::_()->communityad()->truncation($getStoryContentTitle, $storyTrunLimit);\n\t $getTooltipTitle = $this->view->translate(\"_sponsored_viewer_title_tooltip\");\n\t $getContentTooltipTitle = $this->view->translate(\"_sponsored_content_title_tooltip\");\n\t $viewerTruncatedTitle = '<span class=\"cmad_show_tooltip_wrapper\"><b><a href=\"javascript:void(0);\">' . $viewerTruncatedTitle . '</a></b><div class=\"cmad_show_tooltip\"><img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" style=\"width:13px;height:9px;\" />'.$getTooltipTitle.'</div></span>';\n\t $main_div_title = $this->view->translate('%s likes <a href=\"javascript:void(0);\">%s.</a>', $viewerTruncatedTitle, $getStoryContentTitle);\n\t $footer_comment = '';\n\n$content_photo = '<a href=\"javascript:void(0);\">' . $content_photo . '</a><div class=\"cmad_show_tooltip\">\n\t\t\t\t\t\t\t<img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" />\n\t\t\t\t\t\t\t'. $this->view->translate(\"_sponsored_content_photo_tooltip\") .'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\t}else {\n\t $title = Engine_Api::_()->communityad()->truncation($title, $titleTruncationLimit);\n\t}\n\n\tif (empty($is_spocerdStory)) {\n\t $this->view->id = $content_data->getIdentity();\n\t $this->view->title = $title;\n\t $this->view->resource_type = $resource_type;\n\t $this->view->des = $body;\n\t $this->view->page_url = $content_data->getHref();\n\t $this->view->photo = $content_photo;\n\t $this->view->preview_title = $preview_title;\n\t $this->view->remaning_body_text = $remaning_body_limit;\n\t $this->view->remaning_title_text = $remaning_title_limit;\n\t $this->view->photo_id_filepath = $photo_id_filepath;\n\t} else {\n\t $this->view->main_div_title = $main_div_title;\n\t $this->view->photo = $content_photo;\n\t $this->view->temp_pre_title = $getStoryContentTitle; \n\t $getStoryContentTitle = str_replace(' ', '&nbsp;', $getStoryContentTitle);\n\t $this->view->preview_title = $getStoryContentTitle; \n\t $this->view->footer_comment = $footer_comment;\n\t $this->view->remaning_title_text = $remaning_title_limit;\n\t $this->view->modTitle = $field_info['module_title'];\n\t}\n }", "public function editAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n\t \t\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n //$id = sapp_Global::_decrypt($id);\n if(is_numeric($id) && $id>0)\n {\n $app_manager_model = new Default_Model_Appraisalmanager();\n $appraisal_init_model = new Default_Model_Appraisalinit();\n $appraisalQsModel = new Default_Model_Appraisalquestions();\n $tablename = 'main_pa_questions_privileges';\n \n $appraisal_data = $appraisal_init_model->getappdata_forview($id);\n if($appraisal_data['status'] == 1 && $appraisal_data['enable_step'] == 1)\n {\n\t \t$appraisal_data['process_status'] = '';\n\t if(!empty($appraisal_data))\n\t {\n\t \tif($appraisal_data['initialize_status'] == 1)\n\t \t{\n\t \t\tif($appraisal_data['enable_step'] == 1)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n\t \t\tif($appraisal_data['enable_step'] == 2)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n\t \t}\n\t \telse if($appraisal_data['initialize_status'] == 2)\n\t \t{\n\t \t\t$appraisal_data['process_status'] = 'Initialize Later';\n\t \t}else\n\t\t\t\t\t {\n\t\t\t\t\t \t $appraisal_data['process_status'] = 'In progress';\t\n\t\t\t\t\t }\n\t }\n\t $EmpCountArr = $app_manager_model->getManagerGroupCount($id,$loginUserId);\n\t\t\t\t\t\tif(!empty($EmpCountArr))\n\t\t\t\t\t\t\t$appraisal_data['empcount'] = $EmpCountArr[0]['empcount'];\n\t $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n\t \n\t $questionsArr = $appraisalQsModel->getQuestionsByCategory($appraisal_data['category_id'],'');\n\t \n\t $view = $this->getHelper('ViewRenderer')->view;\n\t $view->previ_data = 'no'; \n\t $view->data = $appraisal_data;\n\t $text = $view->render('appraisalinit/view.phtml');\n\t $this->view->appraisal_id = $id;\n\t $this->view->manager_id = $loginUserId;\n\t $this->view->manager_groups = $manager_groups;\n\t $this->view->appraisal_data = $appraisal_data;\n\t $this->view->app_text = $text; \n\t $this->view->questionsArr = $questionsArr;\n }\n else\n {\n \t$this->view->ermsg = 'nodata';\n } \n\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }", "public function edit()\n {\n return view(\"web_admin.books.edit\");\n }", "public function edit()\n {\n abort(404);\n }", "public function edit_action() {\n Utils\\verifyPermission($this->edit_permission);\n $this->actionHeader();\n $this->addScript('jquery.autosize-min.js');\n $this->addScript('vendor/jquery.ui.widget.js');\n $this->addScript('jquery.iframe-transport.js');\n $this->addScript('jquery.fileupload.js');\n $this->addScript('ckeditor/ckeditor.js');\n $this->renderBodyTemplate('edit');\n }", "public function editAction()\r\n {\r\n }", "protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }", "public function edit(Resena $resena)\n {\n //\n }", "public function edit()\n {\n $roles = new Role();\n $account = new User();\n\n if (!$account->find($_SESSION['user'])) {\n Abort::notFound();\n }\n\n $view = new View('account/edit.twig');\n return $view->setData([\n 'roles' => $roles->get(),\n 'account' => $account->find($_SESSION['user'])\n ])->build();\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editActionGet($id) : object\n {\n $title = \"Uppdatera innehåll\";\n\n // Check if not logged in, redirect to login page\n if (!$this->app->session->get('user')) {\n return $this->app->response->redirect(\"content/login\");\n }\n\n // Prepare and execute sql-statement\n $sql = \"SELECT * FROM content WHERE id = ?;\";\n $res = $this->app->db->executeFetch($sql, [$id]);\n\n // Save resultset\n $data[\"res\"] = $res;\n\n // Add and render page to edit content\n $this->app->page->add(\"content/edit\", $data);\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function viewAddResources()\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit($id)\n {\n $category = Programs::all();\n $data = Actions::where(\"id\", $id)->first();\n $files = Uploads::where(\"action_id\", $id)->get();\n $problems = Problem::where(\"actions_id\", $id)->get();\n return view(\n \"admin/action/edit\",\n compact(\"category\", \"data\", \"files\", \"problems\")\n );\n }", "public static function BackDisplayEdit()\n\t{\n\t\t$Object = Object::getById(\n\t\t\t$options = array(\n\t\t\t\t'object_id'\t => Util::getvalue('id'),\n\t\t\t\t'model' => 'ArticleModel',\n\t\t\t\t'table' => ArticleModel::$table,\n\t\t\t\t'state'\t\t => false, \n\t\t\t\t'relations'\t => true,\n\t\t\t\t'multimedas' => true,\n\t\t\t\t'categories' => true\n\t\t\t)\n\t\t);\n\n\t\tif(!$Object) Application::Route(array('modulename'=>'article'));\n\t\t\n\t\t$Locations = Location::getList($parent=0);\n\n\t\tparent::loadAdminInterface();\n\t\tself::$template->setcontent($Object, null, 'object');\n\t\tself::$template->setcontext($Locations, null, 'locations');\n\t\tself::$template->add(\"article.templates.xsl\");\n\t\tself::$template->add(\"article.edit.xsl\");\n\t\tself::$template->display();\n\t}", "public function testEditGet() {\n\t\tRolesControllerTest::login($this);\n\n\t\t$this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/181',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$this->assertTextEquals('edit', $this->controller->view);\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "public function edit($id)\n {\n $obj= Obj::where('id',$id)->first();\n $this->authorize('update', $obj);\n\n if($obj)\n return view('appl.'.$this->app.'.'.$this->module.'.createedit')\n ->with('stub','Update')\n ->with('obj',$obj)\n ->with('editor',true)\n ->with('app',$this);\n else\n abort(404);\n }", "public function editAction()\n {\n $module = $this->getModule();\n $config = Pi::config('', $module);\n $apps = $this->_getAppsList();\n $cases = $this->_getCasesList();\n\n $solution_apps = $data = array();\n\n if ($this->request->isPost()) {\n $data = $this->request->getPost();\n\n $id = $data['id'];\n $row = $this->getModel($module)->find($id);\n\n // Set form\n $form = new SolutionForm('solution-form');\n $form->setInputFilter(new SolutionFilter);\n $form->setData($data);\n if ($form->isValid()) {\n $values = $form->getData();\n\n if (empty($values['name'])) {\n $values['name'] = null;\n }\n if (empty($values['slug'])) {\n $values['slug'] = null;\n }\n\n $values['time_updated'] = time();\n\n // Fix upload icon url\n $iconImages = $this->setIconPath(array($data));\n\n if (isset($iconImages[0]['filename'])) {\n $values['icon'] = $iconImages[0]['filename'];\n }\n\n // Save\n $row->assign($values);\n $row->save();\n\n Pi::service('cache')->flush('module', $this->getModule());\n Pi::registry('solution', $this->getModule())->clear($this->getModule());\n Pi::registry('nav', $this->getModule())->flush();\n\n $message = _a('Solution data saved successfully.');\n\n // Try save apps.\n $apps = $data[SOLUTION_APP];\n foreach ($apps as $app) {\n $result = $this->_saveSolutionApp($id, $app);\n if ($result['message']) {\n $message .= '<li>' . $app['title'] . _a(' can\\'t save;') . '</li>';\n $message .= $result['message'];\n }\n }\n\n // Try save cases.\n $cases = $data[SOLUTION_CASE];\n foreach ($cases as $case) {\n $result = $this->_saveSolutionCase($id, $case);\n if ($result['message']) {\n $message .= '<li>' . $app['title'] . _a(' can\\'t save;') . '</li>';\n $message .= $result['message'];\n }\n }\n\n return $this->jump(array('action' => 'index'), $message);\n\n } else {\n $form_info = $this->_newSolutionForm($form, $data);\n $formGroups = $form_info['formGroups'];\n\n $data['image'] = $data['icon'];\n $json_data = json_encode($data);\n\n $message = _a('Invalid data, please check and re-submit.');\n }\n } else {\n $id = $this->params('id');\n $row = $this->getModel($module)->find($id);\n $data = $row->toArray();\n // Solution apps list.\n $solution_apps = $this->_getSolutionApps($id);\n $data[SOLUTION_APP] = $solution_apps;\n // Solution cases list.\n $solution_cases = $this->_getSolutionCases($id);\n $data[SOLUTION_CASE] = $solution_cases;\n\n $form = new SolutionForm('solution-edit-form');\n // Rebuild form.\n $form_info = $this->_newSolutionForm($form, $data);\n $form = $form_info['form'];\n $formGroups = $form_info['formGroups'];\n\n $form->setData($data);\n $form->setAttribute(\n 'action',\n $this->url('', array('action' => 'edit'))\n );\n $message = '';\n\n $rootUrl = $this->rootUrl();\n $data['image'] = $rootUrl . '/' . $data['icon'];\n $json_data = json_encode($data);\n }\n\n $this->view()->assign('formGroups', $formGroups);\n $this->view()->assign('solution_apps', $solution_apps);\n $this->view()->assign('solution_cases', $solution_cases);\n $this->view()->assign('module', $this->getModule());\n $this->view()->assign('form', $form);\n $this->view()->assign('content', $json_data);\n $this->view()->assign('title', _a('Solution Edit'));\n $this->view()->assign('message', $message);\n $this->view()->setTemplate('solution-edit');\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function edititemAction()\n {\n $this->defaultNoItemRoute = $this->toolboxRoute;\n\n //Run the editItem action method\n $viewList = parent::edititemAction();\n\n //Return the result\n return $viewList;\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "function edit($request){\r\n //get edit\r\n\r\n \t$obj= new $this->model;\r\n $validate=new Validator();\r\n $validate->validate($request->get,['id'=>'Requierd|Integer']);\r\n\r\n\r\n\r\n $data= $obj::find($request->get['id']);\r\n\r\n if(!$data){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n if($request->UseApi())\r\n {\r\n return json_error(\"Not found item\");\r\n }\r\n\r\n return $this->view(\"Error/index\",['ErrorNumber'=>404]);\r\n }\r\n $data->mode='edit';\r\n\r\n if($request->UseApi())\r\n {\r\n return json_success(\"Getting success\",$data);\r\n }\r\n return $this->view(compact('data'));\r\n\r\n\r\n\r\n }", "public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function edit_book_resault()\n\t{\n\t\t$this->edit_book_model->editBook();\n\t\t$this->load->view('edit_book_resault');\n\t}", "public function edit($id)\n\t{\n\t\t$nontax = Employeenontaxable::find($id);\n\t\t$employees = Employee::all();\n $nontaxables = Nontaxable::all();\n $currency = Currency::find(1);\n\t\treturn View::make('employeenontaxables.edit', compact('nontax','employees','nontaxables','currency'));\n\t}", "public function edit($id) {\r\n $model = TodoItemModel::findById($id);\r\n require $this->views_folder . 'edit.php';\r\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function editAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd(intval($id));\r\n\t\t$this->assign('ad_types', $this->ad_types[$info['channel_id']]);\r\n\t\t\r\n\t\tlist($info['module_id'], $info['cid']) = explode('_', $info['module_channel']);\r\n\t\t$this->assign('info', $info);\r\n\t\t\r\n\t\tif($info['channel_id'] == 2 || $info['channel_id'] == 6) {\r\n\t\t list(, $ptypes) = Type_Service_Ptype::getsBy(array('status'=>1,'pid'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\r\n\t\t $this->assign('ptype', $ptypes);\r\n\t\t}\r\n\t\t\r\n\t if($info['channel_id'] == 2) {\r\n\t\t $this->assign('actions', $this->client_actions);\r\n\t\t}\r\n\r\n $this->assign('channel_id', $info['channel_id']);\r\n $this->assign('ad_type', $info['ad_type']);\r\n\r\n\t\t//module channel\r\n\t\tlist($modules, $channel_names) = Gou_Service_ChannelModule::getsModuleChannel();\r\n\t\t$this->assign('modules', $modules);\r\n\t\t$this->assign('channel_names', $channel_names);\r\n\t}", "public function edit($edit_id)\n\t{\n\n\t\t\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n $this->data[\"edit_id\"] = $edit_id;\n\n\t\n $_USER_DETAILS \t= RolePermissions::where(\"pilot_role_id\", $edit_id);\n\t\t\n\t\t\n if ( $_USER_DETAILS -> count() <= 0 )\n {\n return GeneralHelper::show_error_page(\"404\");\n }\n\n\n \n \n\t\t$TMP_data\t\t\t\t\t\t\t\t\t\t= $_USER_DETAILS->get()->first()->toArray();\n $TMP_data['redirect_after_login']\t\t\t\t= \"\";\n\t\t\n\t\t\n\t\t$tmp_where\t\t\t\t\t\t\t\t\t\t= array('pilot_role_id'\t\t=> $edit_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 'project_id'\t\t\t=> $TMP_project_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'operation'\t\t\t\t=> 'redirect_after_login');\t\n\t\t$_redirect_to\t\t\t\t\t\t\t\t\t= RolePermissions::where( $tmp_where );\n\t\tif ( $_redirect_to -> count() > 0 )\n\t\t{\n\t\t\t$TMP_data['redirect_after_login']\t\t\t= $_redirect_to->get()->first()->directory;\n\t\t}\n\t\t\n\t\t\n \n \t$TMP_data[\"option\"]\t\t\t\t\t\t\t= \"edit\";\n\t\t$TMP_data[\"unique_formid\"]\t\t\t\t\t\t= \"\";\n\n\t\tGeneralHelper::form_fields_generator($this->data, true, $TMP_data, $this->input_fields, $this->fillable_inputs);\n $this->_create_child_for_form(true, $this->data, $_USER_DETAILS->get()->toArray() );\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "public function editAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $tagNames = array();\n foreach ($model->fetchTags($photo) as $tag) {\n $tagNames[] = $tag->name;\n }\n\n $form = $model->getForm();\n $form->setAction($this->_helper->url('update', null, null, array('id' => $photo->id)));\n $form->setDefault('tags', implode(',', $tagNames));\n $form->populate($photo->toArray());\n\n $this->view->photo = $photo;\n $this->view->photoForm = $form;\n }", "public function editAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid()) {\n return;\n }\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id', 0);\n\n $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIDEO OBJECT\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('video_id'));\n\n //GET TAB ID\n $this->view->tab_selected_id = $this->_getParam('content_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //SUPERADMIN, VIDEO OWNER AND LISTING OWNER CAN EDIT VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $canEdit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //FORM GENERATION\n $this->view->form = $form = new Sitereview_Form_Editvideo();\n\n //PREPARE TAGS\n $sitereviewTags = $sitereview_video->tags()->getTagMaps();\n $tagString = '';\n foreach ($sitereviewTags as $tagmap) {\n if ($tagString !== '') {\n $tagString .= ', ';\n }\n $tagString .= $tagmap->getTag()->getTitle();\n }\n $this->view->tagNamePrepared = $tagString;\n $form->tags->setValue($tagString);\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$this->getRequest()->isPost()) {\n $form->populate($sitereview_video->toArray());\n return;\n }\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$form->isValid($this->getRequest()->getPost())) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid data');\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n //PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $sitereview_video->setFromArray($values);\n\n // Add tags\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->setTagMaps($viewer, $tags);\n $sitereview_video->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview_video->getSlug(), 'video_id' => $sitereview_video->getIdentity(), 'user_id' => $sitereview_video->owner_id, 'content_id' => $this->view->tab_selected_id), \"sitereview_video_view_listtype_$listingtype_id\", true);\n }", "public function editAction() {\n\t\t$id = $this->getRequest()->getParam('id');\n\t\t$model = Mage::getModel('offermanager/offermanager')->load($id);\n\n\t\tif ($model->getId() || $id == 0) {\n\t\t\t$data = Mage::getSingleton('adminhtml/session')->getFormData(true);\n\t\t\tif (!empty($data)) {\n\t\t\t\t$model->setData($data);\n\t\t\t}\n\t\t\tMage::register('offermanager_data', $model);\n\n\t\t\t$this->loadLayout();\n\t\t\t$this->_setActiveMenu('offermanager/items');\n\t\t\t$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Offer Manager'), Mage::helper('adminhtml')->__('Offer Manager'));\n\t\t\t$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Offer News'), Mage::helper('adminhtml')->__('Offer News'));\n\t\t\t$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n\t\t\t$this->_addContent($this->getLayout()->createBlock('offermanager/adminhtml_offermanager_edit'))\n\t\t\t\t->_addLeft($this->getLayout()->createBlock('offermanager/adminhtml_offermanager_edit_tabs'));\n\t\t\t$this->renderLayout();\n\t\t} else {\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('offermanager')->__('Offer does not exist'));\n\t\t\t$this->_redirect('*/*/');\n\t\t}\n\t}", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit($id){\n\t\t@$this->loadModel(\"Products\");\n $this->view->myproduct = $this->model->getById($id) ;\n\t\t$this->view->render(\"products/edit\");\n\t}", "public function executeEdit()\n {\n $this->role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $this->forward404Unless($this->role);\n\n $this->langs = sfConfig::get('app_lang_array', array('es')); \n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EquipoBundle:CaracteristicasEquipo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find CaracteristicasEquipo entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EquipoBundle:CaracteristicasEquipo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id, HAsistenciaR $hAsistenciaR)\n\t{\n\t\t$hAsistenciaR=$hAsistenciaR->find($id);\n\t\treturn view('hAsistenciaRs.edit', compact('hAsistenciaR'))\n\t\t\t->with( 'list', HAsistenciaR::getListFromAllRelationApps() );\n\t}", "public function edit($id) {\n\t\t//\n\t\t$categories = $this->content->meta();\n\t\t$article = $this->content->edit($id, 'article');\n\t\t//已经findOrFail处理,如果不存在该id资源会抛出异常,再加is_null判定无意义\n\t\t//is_null($article) and abort(404);\n\t\t$flags = $this->flag->index();\n\t\treturn view('back.opera.edit', ['data' => $article, 'categories' => $categories, 'flags' => $flags]);\n\t}", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function editaAction(){\n $tarefa = $this->getEm()->getRepository('MyClasses\\Entities\\Tarefa')\n ->findOneBy(array(\"id\"=>$this->Params(\"id\")));\n return new ViewModel(array(\n \"tarefa\"=>$tarefa,\n \"usuarios\"=>$this->getEm()->getRepository('MyClasses\\Entities\\AclUsuario')->findAll(),\n \"projetos\"=>$this->getEm()->getRepository('MyClasses\\Entities\\Projeto')->findAll()\n ));\n }", "public function editAction() {\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->slideShowEnanle = $this->slideShowEnable($listingtype_id);\n\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $this->view->listing_singular_lc = strtolower($this->_listingType->title_singular);\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n $this->view->content_id = Engine_Api::_()->sitereview()->getTabId($listingtype_id, 'sitereview.video-sitereview');\n\n //SELECTED TAB\n $this->view->TabActive = \"video\";\n\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_videoedit_edit_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n }\n\n //GET VIDEOS\n $this->view->type_video = $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n\n if ($type_video && isset($sitereview->main_video['corevideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['corevideo_id'];\n } elseif (isset($sitereview->main_video['reviewvideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['reviewvideo_id'];\n }\n\n $this->view->videos = $videos = array();\n $this->view->integratedWithVideo = false;\n $sitevideoEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitevideo');\n if ($sitevideoEnabled && (Engine_Api::_()->getDbtable('modules', 'sitevideo')->getIntegratedModules(array('enabled' => 1, 'item_type' => \"sitereview_listing_$sitereview->listingtype_id\", 'item_module' => 'sitereview')))) {\n $params = array();\n $params['parent_type'] = $sitereview->getType() . '_' . $sitereview->listingtype_id;\n $params['parent_id'] = $sitereview->listing_id;\n $this->view->videos = $videos = Engine_Api::_()->getDbTable('videos', 'sitevideo')->getVideoPaginator($params);\n $this->view->integratedWithVideo = true;\n } else {\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n }\n\n $allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos), $uploadVideo = 1);\n $this->view->upload_video = 1;\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $this->view->upload_video = $allowed_upload_video;\n } else {\n if (empty($allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n\n $this->view->count = count($videos);\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Video_Editvideo();\n\n foreach ($videos as $video) {\n\n $subform = new Sitereview_Form_Video_Edit(array('elementsBelongTo' => $video->getGuid()));\n\n if ($video->status != 1) {\n if ($video->status == 0 || $video->status == 2):\n $msg = $this->view->translate(\"Your video is currently being processed - you will be notified when it is ready to be viewed.\");\n elseif ($video->status == 3):\n $msg = $this->view->translate(\"Video conversion failed. Please try again.\");\n elseif ($video->status == 4):\n $msg = $this->view->translate(\"Video conversion failed. Video format is not supported by FFMPEG. Please try again.\");\n elseif ($video->status == 5):\n $msg = $this->view->translate(\"Video conversion failed. Audio files are not supported. Please try again.\");\n elseif ($video->status == 7):\n $msg = $this->view->translate(\"Video conversion failed. You may be over the site upload limit. Try a smaller file, or delete some files to free up space.\");\n endif;\n\n $subform->addElement('dummy', 'mssg' . $video->video_id, array(\n 'description' => $msg,\n 'decorators' => array(\n 'ViewHelper',\n array('HtmlTag', array('tag' => 'div', 'class' => 'tip')),\n array('Description', array('tag' => 'span', 'placement' => 'APPEND')),\n array('Description', array('placement' => 'APPEND')),\n ),\n ));\n $t = 'mssg' . $video->video_id;\n $subform->$t->getDecorator(\"Description\")->setOption(\"placement\", \"append\");\n }\n $subform->populate($video->toArray());\n $form->addSubForm($subform, $video->getGuid());\n }\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n if (isset($_POST['corevideo_cover']) && !empty($_POST['corevideo_cover'])) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('corevideo_id' => $_POST['corevideo_cover']));\n } else {\n $sitereview->main_video = array('corevideo_id' => $_POST['corevideo_cover']);\n }\n } elseif (isset($_POST['reviewvideo_cover']) && $_POST['reviewvideo_cover']) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('reviewvideo_id' => $_POST['reviewvideo_cover']));\n } else {\n $sitereview->main_video = array('reviewvideo_id' => $_POST['reviewvideo_cover']);\n }\n }\n\n $sitereview->save();\n\n //VIDEO SUBFORM PROCESS IN EDITING\n foreach ($videos as $video) {\n $subform = $form->getSubForm($video->getGuid());\n\n $values = $subform->getValues();\n $values = $values[$video->getGuid()];\n if (isset($values['delete']) && $values['delete'] == '1') {\n Engine_Api::_()->getDbtable('videos', 'sitereview')->delete(array('video_id = ?' => $video->video_id, 'listing_id = ?' => $sitereview->listing_id));\n Engine_Api::_()->getDbtable('actions', 'activity')->delete(array('type = ?' => 'video_sitereview_listtype_' . $listingtype_id, 'object_id = ?' => $sitereview->listing_id));\n } else {\n $video->setFromArray($values);\n $video->save();\n }\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function render(): void\n {\n $this->prepare_items();\n $this->handleFormAction();\n $this->loadAssets();\n\n $action = $_REQUEST['action'] ?? null;\n $primaryKey = $this->model->getPrimaryColumn();\n $resourceId = $_REQUEST[$this->singular]\n ?? $this->model->{$primaryKey}\n ?? null;\n\n echo $action && in_array($action, ['edit', 'create'])\n ? $this->getFormView($resourceId)\n : $this->getDefaultView();\n\n do_action('print_resource_page_assets');\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit_template()\n\t{\n\t\t// Get post ID to edit\n\t\t$edit_id = ee()->input->get_post('id');\n\n\t\t// Get template data for edit_id\n\t\t$template_data = ee()->jsonld->template(NULL, $edit_id);\n\n\t\t$this->_data['template_id'] = $template_data['id'];\n\t\t$this->_data['template_name'] = $template_data['template_name'];\n\t\t$this->_data['template_data'] = $template_data['template_text'];\n\t\t$this->_data['action_url'] = ee('CP/URL')->make('addons/settings/json_ld/resavetemplate');\n\t\t$this->_data['types'] = ee()->jsonld->types();\n\t\t$this->_data['templates'] = ee()->jsonld->templates();\n\t\t\n\t\t// Load helpers, libraries, and theme stuff\n\t\tee()->load->library('table');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"'.$this->theme_url.'css/app.css\" type=\"text/css\" media=\"screen\">');\n\n\t\tee()->cp->add_to_foot('<script type=\"text/javascript\">var $token = 1;</script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/app.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\t\t// Load edit form js\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/load_edit_form.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/draganddrop.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\n\t\t// Send data to view\n\t\treturn ee('View')->make('json_ld:edit')->render($this->_data);\n\n\t}", "public function editar()\n {\n //Pega o id a partir da URL\n $id = $this->uri->segment(3);\n\n //Se o id for nulo, redireciona para a página inicial\n if(is_null($id))\n redirect();\n\n //Utitiliza o método getById para obter as informações da empresa\n $resultado = $this->EmpresasModel->getById($id);\n\n $dados['empresaid'] = $resultado; \n\n //Carrega a tela passando os dados da consulta\n $this->load->view(\"Empresas/altera\", $dados);\n }", "public function editAction()\n {\n // project exists and the user has rights to edit it.\n $project = $this->getRequestedProject();\n if (!$project) {\n return;\n }\n\n // ensure only admin/super or project members/owners can edit the entry\n $checks = $project->hasOwners()\n ? array('admin', 'owner' => $project)\n : array('admin', 'member' => $project);\n $this->getServiceLocator()->get('permissions')->enforceOne($checks);\n\n // ensure the id in the post is the value passed in the url.\n // we don't want to risk having differing opinions.\n $this->getRequest()->getPost()->set('id', $project->getId());\n\n return $this->doAddEdit(ProjectFilter::MODE_EDIT, $project);\n }" ]
[ "0.7460722", "0.69512355", "0.68485713", "0.6796208", "0.67901796", "0.67579526", "0.67425245", "0.6713578", "0.6629987", "0.6572274", "0.6498282", "0.64602315", "0.6423282", "0.6422785", "0.6415895", "0.6414357", "0.64009565", "0.63885695", "0.63796145", "0.6374096", "0.6373489", "0.6361037", "0.6314739", "0.6312496", "0.631174", "0.63032657", "0.628961", "0.62786764", "0.62737644", "0.627167", "0.6270579", "0.62576646", "0.62557536", "0.6244578", "0.6244578", "0.62360394", "0.62098587", "0.62094676", "0.62085986", "0.62082034", "0.62057835", "0.62034357", "0.61960495", "0.6194219", "0.61925775", "0.6190134", "0.6184987", "0.6184097", "0.6178696", "0.61770916", "0.61507595", "0.61467314", "0.6125236", "0.6122501", "0.6113627", "0.6112571", "0.6112403", "0.6111517", "0.6103155", "0.60921603", "0.6070964", "0.60616696", "0.60615337", "0.6060848", "0.6059265", "0.60574365", "0.6055394", "0.60517687", "0.60482293", "0.6046539", "0.6046008", "0.60439414", "0.60435176", "0.6034611", "0.60296494", "0.6024806", "0.6023382", "0.60230833", "0.60130346", "0.60118175", "0.6010419", "0.6005451", "0.60052836", "0.600164", "0.60005164", "0.59997654", "0.59985894", "0.5996618", "0.5977823", "0.59774846", "0.5973005", "0.59685117", "0.59683603", "0.59653735", "0.5958711", "0.59562206", "0.5952809", "0.59525084", "0.5952439", "0.5946517" ]
0.8596455
0
/ postAddResource Checks to see if the user data is valid if so it will add it to the DB if the user data is invalid will reload the add user page.
После добавления ресурса проверяет, является ли данные пользователя допустимыми. Если данные допустимы, они добавляются в базу данных. Если данные недопустимы, перезагружается страница добавления пользователя.
public function postAddResource() { $errors = validateAddResources(); if(!($errors === true)) { $this->_f3->set('errors', $errors); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); } else { $this->_f3->reroute('/Admin'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function post_add_users() {\n\t}", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "public function add()\n {\n $this->request->allowMethod(['post']);\n\n $user = $this->Users->newEmptyEntity();\n\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->getData());\n\n if (!$this->Users->save($user)) {\n throw new ValidationErrorException($user);\n }\n }\n\n $this->set('data', $user);\n }", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "public function add() {\n $user = $this->Users->newEntity();\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->data);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('The user has been saved.'));\n \n return $this->redirect(['action' => 'login']);\n } else {\n $this->Flash->error(__('The user could not be saved. Please, try again.'));\n }\n }\n \n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }", "public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }", "public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function add(){\n\t\tif($this->request->is('post'))\n\t\t{\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['role'] = 'user';\n\t\t\tif($this->User->save($this->request->data))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario creado');\n\t\t\t\treturn $this-redirect(array('action' =>'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario no creado');\n\t\t\t}\n\t\t}\n\n\t}", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function addUserAction()\n\t{\n\t\t$user = new User();\n\n\t\t$form = $this->createForm(new UserType, $user);\n\t\t\n\t\t$request = $this->get('request');\n\n\t\tif ($request->getMethod() == 'POST') {\n\t\t\t$form->bind($request);\n\n // Checking the validity of the submission\n\t\t\tif ($form->isValid()) {\n\t\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t\t$em->persist($user);\n\t\t\t\t$em->flush();\n\n // Redirection to the homepage of Bundle\n\t\t\t\treturn $this->redirect($this->generateUrl('valentin_films_manager_index'));\n\t\t\t}\n\t\t}\n\t\treturn $this->render('ValentinFilmsManagerBundle:Manager:addUser.html.twig', array(\n\t\t\t'form' => $form->createView(),\n\t\t\t));\n\t\t\n\t}", "public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }", "public static function addUser()\r\n { \r\n $app = \\Slim\\Slim::getInstance();\r\n $request = (object)$app->request->post();\r\n //validate input\r\n $validata = $app->validata;\r\n $validator = $validata::key('email', $validata::email()->notEmpty())\r\n ->key('first_name', $validata::stringType()->notEmpty())\r\n ->key('last_name', $validata::stringType()->notEmpty())\r\n ->key('password', $validata::stringType()->notEmpty())\r\n ->key('company', $validata::intVal())\r\n ->key('city', $validata::stringType()->notEmpty())\r\n ->key('province', $validata::stringType()->notEmpty())\r\n ->key('zip_code', $validata::stringType()->notEmpty())\r\n ->key('address', $validata::stringType()->notEmpty());\r\n $errors = array();\r\n try{\r\n $validator->assert((array) $request);\r\n } catch (\\InvalidArgumentException $e) {\r\n $errors = $e->findMessages(array(\r\n 'email' => '{{name}} must be a valid email',\r\n 'first_name' => '{{name}} is required',\r\n 'last_name' => '{{name}} is required',\r\n 'password' => 'Password is required',\r\n 'company' => 'Company is required',\r\n 'city' => 'City is required',\r\n 'province' => 'State/Province is required',\r\n 'address' => 'Address is required',\r\n 'zip_code' => 'Zipcode is required'\r\n ));\r\n }\r\n\r\n if ($validator->validate((array)$request)) {\r\n if(!PasswordController::isValid($request->password,$request->email)){\r\n $app->halt('400',json_encode(\"Password Formart Wrong\"));\r\n }\r\n \r\n if(!Company::find($request->company)){\r\n $app->halt('400',json_encode(\"Company does not exist\"));\r\n }\r\n if (self::isExist($request->email)){\r\n $app->response->setStatus(400);\r\n return json_encode(\"Email already taken\");\r\n }\r\n\r\n $user = new User;\r\n //$user->name = $request->name;\r\n $user->email = $request->email;\r\n $user->password = PasswordController::encryptPassword($request->password);\r\n $user->first_name = $request->first_name;\r\n $user->last_name = $request->last_name;\r\n if(isset($request->phone))$user->phone = $request->phone;\r\n $user->city = $request->city;\r\n $user->address = $request->address;\r\n $user->province = $request->province;\r\n $user->zip_code = $request->zip_code;\r\n $user->country = $request->country;\r\n $user->active = 0;\r\n $user->save();\r\n $app->response->setStatus(200);\r\n\r\n //send confirm email\r\n if ($user->id) {\r\n $user->companies()->attach($request->company);\r\n $link = WEBSITELINK.'/'.self::$active_api.openssl_encrypt ($user->id, 'AES-256-CBC', self::$pass, 0, self::$iv);\r\n EmailController::newUserConfirmation($user->id,$request->password,$link);\r\n }\r\n return $user->id;\r\n } else {\r\n $app->response->setStatus(400);\r\n $return = [];\r\n foreach (array_values($errors) as $key => $error) {\r\n if($error!=\"\") \r\n array_push($return,array(\"code\"=>$key,\"data\"=>$error));\r\n }\r\n return json_encode($return);\r\n }\r\n\r\n }", "function __addUser()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //flow control\n $next = true;\n\n if (!isset($_POST['submit'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('add-user', 'view', $this_url);\n redirect($redirect);\n }\n\n //validate form & display any errors\n $validation = $this->__flmFormValidation('add_user');\n if (!$validation) {\n //show error\n $this->notices('error', $this->form_processor->error_message, 'html');\n //halt\n $next = false;\n }\n\n //add to database\n if ($next) {\n $new_users_id = $this->users_model->addUser($this->client_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n\n //was adding successful\n if (!$new_users_id) {\n //show error\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n //halt\n $next = false;\n }\n }\n\n //update primary contact if selected\n if ($next) {\n if ($this->input->post('client_users_main_contact') == 'on') {\n $this->users_model->updatePrimaryContact($this->client_id, $new_users_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n }\n }\n\n //all is ok\n if ($next) {\n //success\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty');\n\n /*EMAIL - send user an email*/\n $this->__emailer('new_user');\n\n /*EMAIL - send admin notifications*/\n $this->__emailer('admin_notification_new_user');\n\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n }\n\n //load user page\n $this->__clientUsers();\n }", "function admin_add_user()\n{\n global $app;\n\n $user_data = $app->request()->post();\n $app->getLog()->debug('admin_add_user: ' . var_export($user_data, true));\n try {\n $user = $app->bbs->addUser($user_data['username'], $user_data['password']);\n } catch (Exception $e) {\n $app->getLog()->error('admin_add_user: error for adding user ' . var_export($user_data, true));\n $app->getLog()->error('admin_add_user: exception ' . $e->getMessage());\n $user = null;\n }\n $resp = $app->response();\n if (isset($user) && !is_null($user)) {\n $resp->status(200);\n $msg = getMessageString('admin_modified');\n $answer = json_encode(['user' => $user->getProperties(), 'msg' => $msg]);\n $resp->header('Content-type', 'application/json');\n } else {\n $resp->status(500);\n $resp->header('Content-type', 'text/plain');\n $answer = getMessageString('admin_modify_error');\n }\n $resp->header('Content-Length', strlen($answer));\n $resp->body($answer);\n}", "public function addAction() {\n $form = new Admin_Form_CreateAdminUser();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $values = $form->getValues();\n $adminMapper = new Application_Model_Table_AdminUsers();\n $userFound = $adminMapper->fetchByUsername($values['username']);\n if(!$userFound){\n $values['is_active'] = 1;\n $values['is_admin'] = 1;\n $adminUser = $adminMapper->createRow($values);\n $adminUser->hashPassword($values['new_password']);\n $adminUser->save();\n $this->_helper->FlashMessenger->addMessage('The user has been created' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-users', true);\n } else {\n $this->view->messages['error'] = \"This username already exists\";\n }\n }\n }\n $this->view->form = $form;\n }", "public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}", "protected function _addUser($data = null){\n $this->tempData['User'] = $data['User'];\n unset($this->tempData['User']['id']);\n if($this->tempData['User']) {\n return array('success' => true);\n } else {\n return array('success' => false);\n }\n }", "public function addUserAction()\n {\n $form = new Application_Form_UserEdit();\n $this->view->form = $form;\n\n if ($this->getRequest()->isPost())\n {\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n $username = $form->getValue('username');\n $password = $form->getValue('password');\n $role = $form->getValue('role');\n $first_name = $form->getValue('first_name');\n $last_name = $form->getValue('last_name');\n $email = $form->getValue('email'); \n $user = new Application_Model_DbTable_Users();\n $user->addUser($username, $password, $first_name,\n $last_name, $email, $role);\n $this->_helper->redirector('index', 'index');\n }\n else\n {\n $form->populate($formData);\n }\n }\n }", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "public function ajaxUserAdd() {\n if (!empty($_POST)) {\n $username = $_POST['username'];\n $password = $_POST['password'];\n $password_second = $_POST['password_second'];\n /** @var User $user */\n foreach ($this->entityManager->getRepository('Entity\\\\User')->findAll() as $user) {\n if (strtolower($user->getUsername()) == strtolower($username)) {\n header('HTTP/1.0 409 Conflict');\n echo 'Username already taken';\n exit();\n }\n }\n if ($password == $password_second) {\n $user = new User();\n $user->setUsername($username);\n $user->setPassword(password_hash($password, PASSWORD_ARGON2ID));\n\n $this->entityManager->persist($user);\n $this->entityManager->flush();\n\n $user_data = [\n 'id' => $user->getId(),\n 'username' => $user->getUsername(),\n ];\n header('HTTP/1.0 200 OK');\n header('Content-Type: application/json');\n echo json_encode($user_data);\n } else {\n header('HTTP/1.0 418 Password');\n echo 'Passwords should be the same';\n exit();\n }\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo 'Post Data is empty';\n exit();\n }\n }", "public function addAction()\n {\n $viewModel = new ViewModel(['title' => 'add a user']);\n // if they are trying to add a user account for an existing person...\n $person_id = $this->params()->fromRoute('id');\n // or if there's no person_id route parameter...\n if (! $person_id && isset($this->params()->fromPost()['user'])) {\n // try post parameters\n $user = $this->params()->fromPost()['user'];\n if (isset($user['person']) && ! empty($user['person']['id'])) {\n $person_id = $user['person']['id'];\n }\n }\n $options = [\n 'action' => 'create',\n 'auth_user_role' => $this->auth_user_role,\n 'constrain_email' => true,\n ];\n\n if ($person_id) {\n /** @todo better db efficiency... */\n $person = $this->entityManager\n ->find('InterpretersOffice\\Entity\\Person', $person_id);\n if (! $person) {\n return $viewModel->setVariables(\n ['errorMessage' => \"person with id $person_id not found\"]\n );\n }\n $options['existing_person'] = $person;\n } else {\n $person = null;\n }\n $form = new UserForm($this->entityManager, $options);\n $user = new Entity\\User();\n if ($person) {\n $this->events->trigger(\n 'load-person',\n $this,\n compact('person', 'form')\n );\n $user->setPerson($person);\n $form->get('user')->get('person')->setObject($person);\n }\n\n $form->bind($user);\n $viewModel->form = $form;\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n $user->setCreated(new \\DateTime());\n $this->entityManager->persist($user);\n if (! $person_id) {\n $this->entityManager->persist($user->getPerson());\n }\n // we could do this in the model instead, with lifecycle callback (?)\n $user->setPassword(bin2hex(openssl_random_pseudo_bytes(8)));\n $this->entityManager->flush();\n $person = $user->getPerson();\n $this->flashMessenger()->addSuccessMessage(\n sprintf(\n 'A user account has been created for %s <strong>%s %s</strong>.',\n $user->getRole(),\n $person->getFirstName(),\n $person->getLastname()\n )\n );\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }", "protected function _post_validate ($obj)\n {\n parent::_post_validate ($obj);\n\n if (sizeof ($this->_errors) == 0)\n {\n if (! $this->object_exists () || $this->app->user_options->users_can_change_name)\n {\n $name = $this->value_for ('title');\n if (empty ($obj->title) || (strcasecmp ($obj->title, $name) != 0))\n {\n // new user or name has been changed\n\n $user_query = $this->app->user_query ();\n $existing_user = $user_query->object_at_name ($name);\n\n // see if there is a user with that name\n\n if ($existing_user)\n {\n $this->record_error ('title', \"Someone is already using that name.\");\n }\n }\n }\n\n if (! $obj->exists ())\n {\n $password1 = $this->value_for ('password1');\n $password2 = $this->value_for ('password2');\n if (strcasecmp ($password1, $password2))\n {\n $this->record_error ('password2', \"Please make sure the passwords are the same.\");\n }\n }\n }\n }", "public function postRegister()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n $validate = $this->Client->newEntity($input);\n\n if ($validate->errors()) {\n $this->set($validate->errors());\n } else {\n $this->Client->insert($input);\n $this->Flash->success('Sign up success');\n }\n $this->register();\n }\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function add(){\n Auth::checkUserLogin();\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Add';\n\n $this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n\t\t\t Url::redirect('users/index');\n\t\t }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else{\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/index');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "public function addUser(){}", "public function addUser( $userdata ) {\r\n /* $userdata = [\r\n [ProductCode] => IG7985\r\n [ClientMemberID] => R27586351\r\n [FirstName] => TEST\r\n [LastName] => MURRAY\r\n [Address] => Abb\r\n [City] => Abbivlie\r\n [State] => AL\r\n [Zipcode] => 36310\r\n [Phone] => 3017874905\r\n [Email] => test563@test.com\r\n [DOB] => 1938-02-19\r\n [Gender] => M\r\n [RepID] => E104509\r\n [ocenture] => stdClass Object\r\n (\r\n [Status] => Account Created\r\n [ClientMemberID] => R27586351\r\n [MembershipID] => 111849849\r\n [ProductCode] => IG7985\r\n )\r\n ]\r\n */\r\n Logger::log(\"Adding ocenture user to db\"); \r\n\r\n $ocentureData = $userdata['ocenture'];\r\n //ocenture sends us following in case of error, please note spelling of error, it should be Error but it is Erorr from Ocenture.\r\n /*\r\n stdClass::__set_state(array(\r\n 'Status' => 'Erorr',\r\n 'Erorr' => 'DuplicateRecordFault',\r\n ))\r\n */\r\n \r\n if ($ocentureData->Status != 'Erorr') \r\n {\r\n try {\r\n\r\n //insert new user as post \r\n $postId = wp_insert_post([\r\n 'post_title' => \"[{$ocentureData->MembershipID} - {$ocentureData->ProductCode}] {$userdata['FirstName']} {$userdata['LastName']}\", \r\n 'post_type'=>'ocenture',\r\n 'post_status' => 'publish',\r\n ]);\r\n\r\n //adding user meta, to avoid it showing as custom fields \r\n add_post_meta($postId, '_membership_id', $ocentureData->MembershipID);\r\n add_post_meta($postId, '_product_code', $ocentureData->ProductCode);\r\n add_post_meta($postId, '_status', $ocentureData->Status == 'Account Created' ? 1 : 0);\r\n add_post_meta($postId, '_client_member_id', $ocentureData->ClientMemberID); //youngevity id\r\n\r\n add_post_meta($postId, '_rep_id', $userdata['RepID']); \r\n add_post_meta($postId, '_fname', $userdata['FirstName']);\r\n add_post_meta($postId, '_lname', $userdata['LastName']);\r\n add_post_meta($postId, '_email', $userdata['Email']);\r\n add_post_meta($postId, '_phone', $userdata['Phone']);\r\n add_post_meta($postId, '_address', $userdata['Address']);\r\n add_post_meta($postId, '_city', $userdata['City']);\r\n add_post_meta($postId, '_state', $userdata['State']);\r\n add_post_meta($postId, '_zip', $userdata['Zipcode']);\r\n add_post_meta($postId, '_date', time());\r\n\r\n Logger::log(\"Ocenture user added to db, post_id : $postId\");\r\n \r\n } catch (Exception $e) {\r\n\r\n }\r\n }\r\n }", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function add()\n {\n $storedPassword = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\n $data = [];\n $data['username'] = $_POST[\"username\"];\n $data['password'] = $storedPassword;\n $data['email'] = $_POST['email'];\n $data['profile_picture'] = $_FILES['profile']['tmp_name'];\n $data['mime'] = $_FILES['profile']['type'];\n $data['phone_num'] = $_POST['phone-number'];\n\n if ($this->model('User')->addNewUser($data) > 0) {\n $this->redirect(BASE_URL . \"/home/index/{$data['username']}\");\n }\n }", "public function registerUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$registered = Application_Model_User::registerUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($registered) {\n\t\t\t\t\t\techo json_encode($registered);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "function addUser(){\n\t$conn = db_connect();\n\n\tif(isset($_GET['id']) && (int)$_GET['id'] > 0){#proper data must be on querystring\n\t\t$myID = (int)$_GET['id']; #Convert to integer, will equate to zero if fails\n\t}\n \n\tif(isset($_POST['firstname'])){$firstName=$_POST['firstname'];}else{$firstName = '';}\n if(isset($_POST['lastName'])){$lastName=$_POST['lastName'];}else{$lastName = '';}\n if(isset($_POST['userPhone'])){$userPhone=$_POST['userPhone'];}else{$firstName = '';}\n if(isset($_POST['userEmail'])){$userEmail=$_POST['userEmail'];}else{$lastName = '';}\n if(isset($_POST['type'])){$type=$_POST['type'];}else{$type = '';}\n \n if(strlen($firstName) >=3)#check if users last name is smaller than 3 characters\n { \n $userName = substr($firstName,0,3) . substr($lastName,0,2);\n }else{#if first name is shorter use as is for username\n $userName = $firstName . substr($lastName,0,2);\n }\n $userName = strtolower($userName); #format users name to site standards\n $userPW = $userName; #default pw is userName\n \n\t$sql = \"INSERT INTO users(FirstName,LastName,PhoneNumber,EmailAddress,TypeId,UserName,UserPassword) VALUES('%s','%s','%s','%s',%d,'%s','%s')\";\n\t$sql = sprintf($sql,$firstName,$lastName,$userPhone,$userEmail,$type,$userName,$userPW);\n\t$result = mysqli_query($conn,$sql); \n\n\tif ($result)\n\t{#successful update!\n\t\t$newURL = 'list.php';\n\t}else{\n\t\t$newURL = 'add.php';\n\t}\n\theader('Location: '.$newURL);\n\tdie();\n}", "public function addResourceUserAction(Request $request, $userId)\n {\n\n $em = $this->getDoctrine()->getManager();\n $form = $request->get(\"form\");\n $base = $this->getBaseById(intval($form['base']));\n $resource = new Resource();\n $baseId = strval($form['base']);\n\n if ($em->getRepository('GrtResBundle:Resource')->getFindUserBase($baseId,$userId)){\n $this->addFlash('warning', $this->get('translator')->trans('Base already exist!'));\n return $this->redirect($this->generateUrl('grt_user_show',array('userId' => $userId)));\n }\n\n //$form = $this->createForm(ResourceType::class, $resource);\n $formRes = $this->createFormBuilder($resource);\n\n $fields = explode(\",\", $base->getFields());\n foreach ($fields as $field){\n if ($field == 'term'){\n $formRes->add('term', DateType::class, array('label' => 'Срок действия(YYYY-MM-DD)',\n 'widget' => 'single_text','format' => 'yyyy-mm-dd','attr'=> array('class'=>'input-group date form-control')));\n } else {\n $formRes->add($field,TextType::class, array('label' => $field,'attr'=> array('class'=>'form-control')));\n }\n }\n\n\n return $this->render('GrtResBundle:Resource:form.html.twig', array(\n 'form' => $formRes->getForm()->createView(),\n 'userId' => $userId,\n 'baseId' => $baseId,\n\n ));\n }", "public function add_user() {\n try {\n //Retrieve user details.\n if (filter_has_var(INPUT_POST, 'username') && filter_has_var(INPUT_POST, 'password') && filter_has_var(INPUT_POST, 'firstname') && filter_has_var(INPUT_POST, 'lastname')) {\n $firstname = trim(filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING));\n $lastname = trim(filter_input(INPUT_POST, 'lastname', FILTER_SANITIZE_STRING));\n $username = trim(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING));\n $password = trim(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING));\n }\n\n if ($firstname == \"\" || $lastname == \"\" || $username == \"\" || $password == \"\") {\n throw new DataMissingException(\"Please fill in all fields.\");\n }\n //Hash password.\n $hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\n //Add user details to database.\n $sql = \"INSERT INTO \" . $this->tblUser . \" VALUES (NULL, 2, '$firstname', '$lastname', '$username', '$hashed_password')\";\n\n\n //Execute the insert query.\n $query = $this->dbConnection->query($sql);\n\n //If the query failed, return false. \n if (!$query) {\n throw new DatabaseException(\"There was an error adding the user.\");\n }\n //Return true if successful.\n return true;\n } catch (DataMissingException $e) {\n return $e->getMessage();\n } catch (DatabaseException $e) {\n return $e->getMessage();\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "public function add(){\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n Url::redirect('backoffice/users/index');\n }\n $_POST['salt'] = null;\n\n if(!isset($_FILES) || empty($_FILES['image']['name'])){\n $_POST['image'] = null;\n }else{\n $this->uploadFile($_FILES);\n }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else {\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "public function add($id=null){\n \t$this->layout = 'largeLayout';\n \t\n if($this->request->is('post')){\n $this->User->create();\n\n //Add missing data on the request object before save to the database\n //Set default user role when register is: author.\n $this->request->data['User']['role']= 'author';\n\n // Set default user status is: 1(actived) 1(deleted)\n $this->request->data['User']['status'] = 1;\n\n //Set default user ban status is: 0 (actived) 1(banned)\n $this->request->data['User']['banned'] = 0;\n\n //If user is not submit an avatar then set avatar to default\n // if(isset($this->request->data['User']['avatar'])){\n // $this->request->data['User']['avatar']='avatar.png';\n // $this->request->data['User']['avatar_dir']='default';\n // }\n\n if($this->User->save($this->request->data)){\n\n $this->Session->setFlash(__('User have been saved'));\n $this->redirect(array('action'=>'login'));\n\n } else {\n $this->Session->setFlash(__('User cannot be saved'));\n }\n\n }\n\n }", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}", "function add() {\n RR_Session::start();\n $get = RR_Session::get('loggedin');\n if ($get == true) {\n // blijf op de pagina\n // en laad de admin view\n $this->validateUser(true, 'newuser');\n } else {\n // anders redirect trug naar de login pagina\n $this->validateUser(false);\n }\n }", "function addsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n // Use the add action's post form variables and the current precise time to insert an article.\n // validate all post variables before inserting them to avoid a\n // SQL Injection attack and ensure that we've working with clean data. \n\t\t$email=$_POST['email'];\n\t\t$password=$_POST['password'];\n\t\ttry\n\t\t{\n\t\t if (!empty($_POST['username'])&& !empty($_POST['firstname'])&& !empty( $_POST['role']) && !empty($_POST['email']) && !empty($_POST['password']))\n\t\t { \n\t\t\t$result= UserModel::Create()->InsertUser($_POST['username'],$_POST['email'], $password, $_POST['firstname'],$_POST['middlename'],$_POST['lastname'],$_POST['role'], $_POST['phoneres'], $_POST['phonecell'], $_POST['status'], $_POST['comments']);\n\t\t\t\n\t\t\tif(empty($result))\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t\t$this->viewData['error']= \"Failed to Add the user\";\n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse // invite the user by sending email \n\t\t\t{\n\t\t\t\tMailModel::SendInvitation($_POST['email'], $_POST['firstname'],$result);\n\t\t\t\t$this->renderWithTemplate('users/addsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t }\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t$this->viewData['error']= $ex->getMessage();\n\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\n\t}", "public function addUser() {\n\t\tif (!empty($_POST['username']) AND !empty($_POST['password']) AND !empty($_POST['email']) AND !empty($_POST['nom']) AND !empty($_POST['prenom']) AND !empty($_POST['adresse']) AND !empty($_POST['code_postal'])) {\n\t\t\t$errors = array();\n\t\t\t$username = $_POST['username'];\n\t\t\t$password = sha1($_POST['password']);\n\t\t\t$email = $_POST['email'];\n\t\t\t$nom = $_POST['nom'];\n\t\t\t$prenom = $_POST['prenom'];\n\t\t\t$adresse = $_POST['adresse'];\n\t\t\t$code_postal = $_POST['code_postal'];\n\n\t\t\t$users = new Model_Users();\n\t\t\t\n\t\t\tif(empty($_POST['username']) || !preg_match('/^[a-zA-Z0-9_]+$/', $_POST['username'])) {\n\t\t\t\t$errors['username'] = \"Votre pseudo n'est pas valide (alphanumérique)\";\n\t\t\t} else {\n\t\t\t\t$userExist = $users->userExist($username);\n\t\t\t\tif($userExist == true) {\n\t\t\t\t\t$errors['username'] = \"Ce pseudo est déjà pris\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (empty($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t$errors['email'] = \"Votre email n'est pas valide\";\n\t\t\t} else {\n\t\t\t\t$emailExist = $users->emailExist($email);\n\t\t\t\tif($emailExist == true) {\n\t\t\t\t\t$errors['email'] = \"Cet email est déjà utilisée\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (empty($_POST['password']) || $_POST['password'] != $_POST['password_confirm']) {\n\t\t\t\t$errors['password'] = \"Vous devez rentrer un mot de passe valide\";\n\t\t\t}\n\t\t\t$utilisateurDetails = $users->newUsers($username, $password, $email, $nom, $prenom, $adresse, $code_postal, $errors);\n\t\t\theader('Location: /ecommerce/admin/users/list');\n\t\t}\n\t\t\n\t\trequire_once ($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/create_users.php\");\n\t}", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "private function preAddUser(){\n $LMS = new LMS();\n $api = $LMS->getDataXUserPass($this->_user, $this->_pass, 'https://www.sistemauno.com/source/ws/uno_wsj_login.php');\n $this->_person = \"\";\n if ($this->isObjectAPI($api)) {\n //validar Permisos\n $FilterAPI = new FilterAPI($api);\n $this->_datPerson = $FilterAPI->runFilter($this->_user, $this->_pass);\n if (is_array($this->_datPerson)) {\n //si el usuario cuenta con un perfil apropiado se le pide que valide sus coreo\n $this->validateEmailUser();\n if($this->validUniqueMail()){\n $this->sendMail();\n $this->_response = \"1|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }else{\n $this->_response = \"2|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }\n } else {\n $this->_response = $this->_datPerson;\n }\n } else {\n $this->_response = $api;\n }\n }", "public static function addUser()\n {\n if(empty($_POST))\n {\n require_once(__DIR__.'/../views/form.php');\n exit;\n }\n\n // add user to database\n $user = UserModel::addUser();\n\n if (!$user)\n {\n session_start();\n $_SESSION['message'] = 'Error occurred while saving user. Please try again later.';\n header('Location: /form');\n exit;\n }\n\n // update text file\n if (!self::updateTextFile($_SERVER['DOCUMENT_ROOT'] . $user['about'], $user['euro2016']))\n {\n header('Location: /form');\n exit;\n }\n\n session_start();\n $_SESSION['message'] = 'Successfully saved user';\n\n require_once(__DIR__.'/../views/form.php');\n }", "public function postAdd() {\n try {\n $this->_adminUserRepository->addOrUpdateUsers ();\n } catch ( Exception $e ) {\n $this->logger->error ( $e->getMessage () );\n }\n \n return redirect ( StringLiterals::ADMIN_USERS )->withSuccess ( trans ( 'user::adminuser.success' ) );\n }", "public function add(){\n\t\tif($_POST){\n\n\n\t\t$filter = new validations;\n\t\tvar_dump($filter->isInt($_POST['age' ], 18, 99));\n\t}\n/*\n\t\t$groups = $this->User->find(\"groups\", \"all\");\t\n\t\t$this->set(\"groups\", $groups);\n\t\tif($_POST){\n\t\t\tif($this->User->save(\"users\", $_POST)){\n\t\t\t\t$this->redirect(array(\"controller\"=>\"users\", \"action\"=>\"index\"));\n\t\t\t}else{\n\t\t\t\t$this->redirect(array(\"controller\"=>\"users\", \"action\"=>\"add\"));\n\t\t\t}\n\t\t}\n\t\t*/\n\t}", "protected function loadObjects() { \n parent::loadObjects(); \n $factory = I2CE_FormFactory::instance();\n $user = null;\n $user_map = null;\n if ($this->isPost()) {\n if ($this->creatingNewUser()) {\n if (! ($user = $factory->createContainer( 'user')) instanceof I2CE_User_Form) {\n I2CE::raiseError(\"bad user form\");\n return false;\n }\n $user->load( $this->post );\n $user_map = $factory->createContainer( 'user_map');\n $user_map->load( $this->post );\n if ( !($username = $user->username) ) {\n I2CE::raiseError(\"bad user name\");\n return false;\n }\n $this->setEditing();\n if ( !$this->isSave(false) ) {\n $user->tryGeneratePassword();\n }\n $this->getPrimary()->username = array('user' , $username);\n }\n } else {\n $this->parent = $this->getParent();\n $user = $factory->createContainer( \"user\".'|0');\n if (( ($personObj = $this->getParent()) instanceof iHRIS_Person) && ($personObj->surname)) {\n $username = $this->generateUserName($personObj);\n $accessMech = I2CE::getUserAccess();\n $details = $accessMech->getAllowedDetails();\n $user->username = $username;\n if (in_array('lastname',$details)) {\n $user->lastname = $personObj->surname;\n }\n $role = false;\n if (I2CE::getConfig()->setIfIsSet($role,\"/modules/SelfService/default_user_role\") && I2CE_MagicDataNode::checkKey($role) && I2CE::getConfig()->is_parent(\"/I2CE/formsData/forms/role/$role\")) {\n $user->getField('role')->setFromDB('role|' . $role);\n }\n foreach($details as $detail) {\n if ($personObj->hasField($detail)) {\n $user->getField($detail)->setFromDB( $personObj->getField($detail)->getDBValue());\n }\n }\n if (I2CE_ModuleFactory::instance()->isEnabled('PersonContact')) {\n $contact_form = false;\n if (I2CE::getConfig()->setIfIsSet($contact_form,\"/modules/SelfService/default_user_contact_form\") && $contact_form) {\n $personObj->populateChildren($contact_form);\n foreach ($personObj->getChildren($contact_form) as $contactObj) {\n foreach($details as $detail) {\n if ($contactObj->hasField($detail)) {\n $user->getField($detail)->setFromDB( $contactObj->getField($detail)->getDBValue());\n }\n } \n break;\n }\n }\n }\n }\n }\n if ($user instanceof I2CE_User_Form) {\n $this->userObj = $user;\n $this->userMapObj = $user_map;\n $this->setObject( $user, I2CE_PageForm::EDIT_SECONDARY, 'user_fields');\n } \n return true;\n }", "public function add_new_resource() {\n // @codingStandardsIgnoreLine\n $add_resource_name = wc_clean( $_POST['add_resource_name'] );\n\n if ( empty( $add_resource_name ) ) {\n wp_send_json_error();\n }\n\n $resource = array(\n 'post_title' => $add_resource_name,\n 'post_content' => '',\n 'post_status' => 'publish',\n 'post_author' => dokan_get_current_user_id(),\n 'post_type' => 'bookable_resource',\n );\n $resource_id = wp_insert_post( $resource );\n $edit_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $resource_id;\n ob_start();\n ?>\n <tr>\n <td><a href=\"<?php echo $edit_url; ?>\"><?php echo $add_resource_name; ?></a></td>\n <td><?php esc_attr_e( 'N/A', 'dokan' ); ?></td>\n <td>\n <a class=\"dokan-btn dokan-btn-sm dokan-btn-theme\" href =\"<?php echo $edit_url; ?>\"><?php esc_attr_e( 'Edit', 'dokan' ); ?></a>\n <button class=\"dokan-btn dokan-btn-theme dokan-btn-sm btn-remove\" data-id=\"<?php echo $resource_id; ?>\"><?php esc_attr_e( 'Remove', 'dokan' ); ?></button>\n </td>\n </tr>\n\n <?php\n $output = ob_get_clean();\n wp_send_json_success( $output );\n }", "public function addUser(){\n $mysqli = $this->Connect();\n\n //if the register button is clicked proceed with adding the user\n if(isset($_POST['register'])){\n\n //real_escape_string to prevent sql injection\n $email = $mysqli->real_escape_string($_POST['email']);\n $password = $mysqli->real_escape_string($_POST['password']);\n $repeated = $mysqli->real_escape_string($_POST['repeatpass']);\n $firstname = $mysqli->real_escape_string($_POST['firstname']);\n $prepos = $mysqli->real_escape_string($_POST['preposition']);\n $lastname = $mysqli->real_escape_string($_POST['lastname']);\n $telnumber = $mysqli->real_escape_string($_POST['telnumber']);\n $city = $mysqli->real_escape_string($_POST['city']);\n $address = $mysqli->real_escape_string($_POST['address']);\n $zipcode = $mysqli->real_escape_string($_POST['zipcode']);\n $userlvl = $mysqli->real_escape_string($_POST['userlvl']);\n\n //check if the passwords match\n if ($password === $repeated) {\n //hashing the password\n $password = hash('sha512', $password);\n\n //check if mail exists\n $checkEmail = $mysqli->query(\"SELECT email FROM tbl_users WHERE email = '$email'\");\n\n //check if the email/user already exists\n if($checkEmail->num_rows === 0){\n $prepos = !empty($prepos) ? \"'$prepos'\" : \"NULL\";\n\n $insertUser = $mysqli->query(\"INSERT INTO tbl_users (email, password, userlevel, tel, firstName, lastName, preposition, city, address, zipCode) \n VALUES ('$email','$password','$userlvl','$telnumber','$firstname',$lastname,$prepos,$city,$address,$zipcode)\");\n\n header('Location: index.php');\n } else {\n $this->alert('Het email dat u heeft ingevoerd bestaat al.','danger');\n }\n } else {\n $this->alert('De wachtwoorden komen niet overeen, probeer het opnieuw.','danger');\n }\n }\n }", "function RegisterUser(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateRegistrationSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadUserPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Upic'] = $this->upLoadUserPic();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectRegistrationSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->comparePswd($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!$this->SaveToEventAdvDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/*if(!$this->sendConfimMail($formvars)){\r\n\t\t\treturn false;\r\n\t\t}*/\r\n\r\n\t\t//$this->SendAdminIntimationEmail($formvars);\r\n\r\n\t\treturn true;\r\n\t}", "public function add($data)\r\n {\r\n // Adds a user into the database.\r\n global $db;\r\n // Get what we need.\r\n $stamp = time();\r\n if (isset($_SERVER['REMOTE_ADDR'])) {\r\n $user_ip = $_SERVER['REMOTE_ADDR'];\r\n } else {\r\n $user_ip = false;\r\n }\r\n if (!isset($data['admin'])) {\r\n $admin = false;\r\n } else {\r\n $admin = $data['admin'];\r\n }\r\n $name = $data['name'];\r\n $username = $data['username'];\r\n $email = $data['email'];\r\n $password = $data['password'];\r\n $key = md5($email . $stamp . rand(0, 999));\r\n\r\n // Play with our food.\r\n $salted = $this->salt($password);\r\n // We only want letters and numbers.\r\n $username = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $username);\r\n\r\n // Scrub up and clean up.\r\n $sql = array();\r\n $sql['name'] = $name;\r\n $sql['username'] = $username;\r\n $sql['email'] = $email;\r\n $sql['password'] = $salted;\r\n $sql['regstamp'] = $stamp;\r\n $sql['regip'] = $user_ip;\r\n $sql['verified'] = false;\r\n $sql['verifykey'] = $key;\r\n\r\n $users_uname = db::get_array(\"users\", array(\"username\" => $username));\r\n $users_email = db::get_array(\"users\", array(\"email\" => $email));\r\n $users = (count($users_uname) + count($users_email));\r\n\r\n if ($users > 0) {\r\n if (count($users_uname) > 0) {\r\n return array(\"res\" => false, \"msg\" => \"A user with that Username already exists!\");\r\n } else {\r\n return array(\"res\" => false, \"msg\" => \"A user with that E-Mail already exists!\");\r\n }\r\n } else {\r\n // Insert the data.\r\n db::insert(\"users\", $sql);\r\n do_email($email, $username, \"Email Validation\", \"To begin using your SmallURL account, you need your email verifying. <br /> Please visit <a href='http://account.smallurl.in/verify/{$key}'> http://account.smallurl.in/verify/{$key} </a> to validate your account.\");\r\n\t\t\treturn array(\"res\" => true, \"msg\" => \"Registered!\");\r\n }\r\n }", "function addUser($data){\n\t$username = secure($data['username']);\n\t$password = secure($data['password']);\n\t$level = secure($data['level']);\n\t$users = getJSON(USERS);\n\t$id = getId($users);\n\t$callback = \"LOGIN_CHECKCHAR_FAILED\";\n\tif(!checkChar($username)){\n\t\n\t\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t\t//password encryption\t\t\n\t\t$password= md5($password.$salt);\n\t\t$newUser= array(\n\t\t\t\"id\" => $id,\n\t\t\t\"username\" => $username,\n\t\t\t\"password\" => $password,\n\t\t\t\"level\" => $level\n\t\t);\n\t\tarray_push($users,$newUser);\n\t\texport($users, USERS);\n\t\t$callback=\"\";\n\t}\n\treturn $callback; \n}", "public function addUser(){\n\n\t\ttry {\n\n\t\t\t$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\n\t\t\t$password = $_POST['password'];\n\n\t\t\t$password = hash('sha256', $password);\n\n\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\n\t\t\t$result = $db->query('SELECT * FROM users WHERE username=\"'.$username.'\"');\n\n\t\t\tif ($username && $password) {\n\n\t\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif($row == 0){\n\t\t\t\t\t$statement = $db->query(\"INSERT INTO users (username,password) VALUES ('$username', '$password')\" );\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"Username already taken, pick something else! <br><a href='/userlist'> Go back to user list\");\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "public function add_postAction() {\n $info = $this->getPost(array('username', 'password', 'r_password', 'email', 'groupid'));\n if (strlen($info['username']) < 5 || strlen($info['username']) > 16) $this->output(-1, '用户名长度5-16位之间');\n if (strlen($info['password']) < 5 || strlen($info['password']) > 16) $this->output(-1, '用户密码长度5-16位之间.');\n if ($info['password'] !== $info['r_password']) $this->output(-1, '两次密码输入不一致.');\n if ($info['email'] == '') $this->output(-1, '用户EMAIL必填.');\n if (Admin_Service_User::getUserByName($info['username'])) $this->output(-1, '用户名已经存在.');\n if (Admin_Service_User::getUserByEmail($info['email'])) $this->output(-1, '邮件地址已经存在.');\n $info['registerip'] = Util_Http::getClientIp();\n $result = Admin_Service_User::addUser($info);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }", "public function addUser(){\n\t}", "static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}", "public function postSaveuser(){\n\n $validator4 = Validator::make(Input::all(), User::$userRules);\n $userMail = Input::get('useremail');\n \n if ($validator4->passes()) {\n $user = new User;\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->userType = \"user\";\n $user->save();\n\n return Redirect::to('admin/userlist')->with('message', 'User added succesfully!');\n }else{\n return Redirect::to('admin/newuser')->with('message', 'The following errors occurred')\n ->withErrors($validator4)->withInput(); \n }\n }", "public function initializeCreateAction() {\n\t\t$fieldConfigurationWithValues = $this->fieldConfiguration;\n\t\tif ($this->request->hasArgument('frontendUser')) {\n\t\t\t$frontendUserData = $this->request->getArgument('frontendUser');\n\t\t\t$errors = 0;\n\t\t\tforeach ($frontendUserData as $fieldName => $value) {\n\t\t\t\t// XSS sanitation\n\t\t\t\t$value = htmlspecialchars(strip_tags(trim($value)));\n\t\t\t\tif (array_key_exists($fieldName, $this->fieldConfiguration)) {\n\t\t\t\t\t// the field is allowed\n\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['value'] = $value;\n\t\t\t\t\tif ($this->fieldConfiguration[$fieldName]['mandatory']) {\n\t\t\t\t\t\t// the field is mandatory, thus it must not be empty\n\t\t\t\t\t\tif (empty($value)) {\n\t\t\t\t\t\t\t// Error: Empty mandatory field\n\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t$errors++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Validate e-mail address\n\t\t\t\t\t\t\tif ($fieldName === 'email' && GeneralUtility::validEmail($value) === FALSE) {\n\t\t\t\t\t\t\t\t// Error: Invalid e-mail address\n\t\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t\t$errors++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Unset fields that are not allowed for security reasons\n\t\t\t\t\tunset($frontendUserData[$fieldName]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($errors > 0) {\n\t\t\t\t$this->forward('new', NULL, NULL, array('fieldConfiguration' => $fieldConfigurationWithValues));\n\t\t\t} else {\n\t\t\t\t$this->forward('addAccountAndLogin', NULL, NULL, array('frontendUserData' => $frontendUserData));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->forward('new');\n\t\t}\n\n\t}", "public function postRegister()\n\t{\n\t\t$user = new \\User;\n\n\t\t$user->email = \\Input::get( 'email' );\n\t\t$user->password = \\Input::get( 'password' );\n\n\t\t// The password confirmation will be removed from model\n\t\t// before saving. This field will be used in Ardent's\n\t\t// auto validation.\n\t\t$user->password_confirmation = \\Input::get( 'password_confirmation' );\n\n\t\t// Save if valid. Password field will be hashed before save\n\t\t$user->save();\n\n\t\tif ( $user->id )\n\t\t{\n\t\t\t//Assign the company role to this person\n\t\t\t$roleId = \\Role::where('name', '=', 'Company')->first()->id;\n\t\t\t$user->attachRole($roleId);\n\n\t\t\t// Redirect with success message, You may replace \"Lang::get(...\" for your custom message.\n\t\t\treturn \\Redirect::action('controllers\\company\\AuthController@getLogin')\n\t\t\t\t->with( 'notice', \\Lang::get('confide::confide.alerts.account_created') );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get validation errors (see Ardent package)\n\t\t\t$error = $user->errors()->all(':message');\n\n\t\t\treturn \\Redirect::action('controllers\\company\\AuthController@getRegister')\n\t\t\t\t->withInput(\\Input::except('password'))\n\t\t\t\t->with( 'error', $error );\n\n\t\t}\n\n\t}", "function procAddUser() {\n\t\tglobal $session, $database, $form;\n\t\t/* Convert username to all lowercase (by option) */\n\t\tif(ALL_LOWERCASE){\n\t\t $_POST['user'] = strtolower($_POST['user']);\n\t\t}\n\t\t/* Registration attempt */\n\t\t$retval = $session->register($_POST['user'], $_POST['pass'], $_POST['email'], $_POST['fullname'], $_POST['ulevel']);\n\n\t\t/* Registration Successful */\n\t\tif($retval == 0){\n\t\t $_SESSION['reguname'] = $_POST['user'];\n\t\t $_SESSION['regsuccess'] = true;\n\t\t header(\"Location: \".$session->referrer);\n\t\t}\n\t\t/* Error found with form */\n\t\telse if($retval == 1){\n\t\t $_SESSION['value_array'] = $_POST;\n\t\t $_SESSION['error_array'] = $form->getErrorArray();\n\t\t header(\"Location: \".$session->referrer);\n\t\t}\n\t\t/* Registration attempt failed */\n\t\telse if($retval == 2){\n\t\t $_SESSION['reguname'] = $_POST['user'];\n\t\t $_SESSION['regsuccess'] = false;\n\t\t header(\"Location: \".$session->referrer);\n\t\t}\n }", "public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}", "public function addAction() \n { \n $user = $this->currentUser();\n // Check the post limit and redirect accordingly.\n// if($this->postManager->postLimitReached($user)){\n// // Redirect the user to the \"membership\" page.\n// return $this->redirect()->toRoute('membership');\n// }\n \n $stepParam = $this->params()->fromRoute('step', 1);\n // Determine the current step.\n $step = 1;\n if ((isset($this->sessionContainer->addUserChoices['addStepCount']))&&($stepParam==2)) {\n $step = $this->sessionContainer->addUserChoices['addStepCount']; \n }\n \n // Ensure the step is correct (between 1 and 2).\n if ($step<1 || $step>4)\n $step = 1;\n \n if ($step==1) {\n // Init user choices.\n $this->sessionContainer->addUserChoices = [];\n $this->sessionContainer->addUserChoices['addStep2Dirty'] = false;\n $this->sessionContainer->addUserChoices['addStep3Dirty'] = false;\n $this->sessionContainer->addUserChoices['addStep4Dirty'] = false;\n $this->sessionContainer->addUserChoices['addParentPostId'] = \n $this->params()->fromQuery('id', false);\n }\n \n // Create image holder.\n $files = null;\n $fileTitles = null;\n \n // Create the form.\n $form = new AddPostForm($step, $user->getId(), $this->translator);\n \n // Check whether this post is a POST request.\n if ($this->getRequest()->isPost()) {\n \n // Make certain to merge the files info!\n $request = $this->getRequest();\n $data = array_merge_recursive(\n $request->getPost()->toArray(),\n $request->getFiles()->toArray()\n );\n \n // Fill form with data.\n $form->setData($data);\n if ($form->isValid()) {\n \n // Get validated form data.\n $data = $form->getData();\n \n // Save user choices in session.\n $this->sessionContainer->addUserChoices[\"addStep$step\"] = $data;\n \n // Increase step if photo has not been selected.\n $fileExists = $this->postManager->checkFileExists($data); \n \n if($fileExists == false){\n $step ++;\n $this->sessionContainer->addUserChoices['addStepCount'] = $step;\n } else{\n // Create the title file.\n $this->imageManager->createAddTitleFile($user->getId(), $data);\n }\n \n if ($step>4) {\n \n // Use post manager service to add new post to database.\n $data = $this->sessionContainer->addUserChoices['addStep1'];\n $this->postManager->addNewPost(\n $data, $user, $this->sessionContainer->addUserChoices['addParentPostId']);\n $posts = $this->entityManager->getRepository(Post::class)\n ->findPostsByUser($user);\n $post = $posts[0]; \n $postId = $post->getId();\n $this->imageManager->saveAddTempFiles($post, $user->getId());\n $this->videoManager->saveAddTempFiles($post, $user->getId());\n $this->audioManager->saveAddTempFiles($post, $user->getId());\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']);\n }\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'add', \n 'id'=>0, 'step'=>2]);\n }\n } \n\n if ($step==2) {\n\n // Get the list of already saved files.\n $files = $this->imageManager->getAddTempFiles($user->getId(), \n $this->sessionContainer->addUserChoices['addStep2Dirty']);\n $fileTitles = $this->imageManager->getAddTempFileTitles($user->getId(), \n $this->sessionContainer->userChoices['step2Dirty']);\n $this->sessionContainer->addUserChoices['addStep2Dirty'] = true; \n }\n\n if ($step==3) {\n\n // Get the list of already saved files.\n $files = $this->videoManager->getAddTempFiles($user->getId(), \n $this->sessionContainer->addUserChoices['addStep3Dirty']);\n $this->sessionContainer->addUserChoices['addStep3Dirty'] = true; \n } \n \n if ($step==4) {\n\n // Get the list of already saved files.\n $files = $this->audioManager->getAddTempFiles($user->getId(), \n $this->sessionContainer->addUserChoices['addStep4Dirty']);\n $this->sessionContainer->addUserChoices['addStep4Dirty'] = true; \n } \n \n \n \n // Render the view template.\n $viewModel = new ViewModel([\n 'files' => $files,\n 'fileTitles' => $fileTitles,\n 'form' => $form,\n 'user' => $user\n ]);\n $viewModel->setTemplate(\"application/post/add$step\");\n \n return $viewModel;\n }", "public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "public function addSecondaryUver() {\n $this->autoRender = false;\n if ($this->request->is('post')) {\n $this->GeneralFunctions = $this->Components->load('GeneralFunctions');\n $company = $this->Session->read('CompanyLoggedIn');\n $password = $this->GeneralFunctions->generateRandomPassword();\n $param['SecondaryUser']['name'] = $this->request->data['SecondaryUser']['name'];\n $param['SecondaryUser']['email'] = $this->request->data['SecondaryUser']['email'];\n $param['SecondaryUser']['type'] = $this->request->data['SecondaryUser']['type'];\n $param['SecondaryUser']['company_id'] = $company['Company']['id'];\n $param['SecondaryUser']['normalPass'] = $password;\n $param['SecondaryUser']['hashPass'] = md5($password);\n\n $query = \"INSERT INTO secondary_users(name, email, password, company_id, secondary_type_id)\"\n . \" VALUES('\" . $param['SecondaryUser']['name'] . \"'\"\n . \",'\" . $param['SecondaryUser']['email'] . \"'\"\n . \",'\" . $param['SecondaryUser']['hashPass'] . \"'\"\n . \",\" . $param['SecondaryUser']['company_id'] . \"\"\n . \",\" . $param['SecondaryUser']['type'] . \");\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->AccentialApi->urlRequestToGetData('users', 'query', $params);\n\t\t\t\n\t\t\t$this->sendEmailNewUserTWO($param['SecondaryUser']['email'], $password);\n\t\t\t\n if (is_null($addUserOffer)) {\n //TODO: enviar email ao adicionar o usuario com sucesso.\n $data['normalPass'] = $param['SecondaryUser']['normalPass'];\n $data['name'] = $param['SecondaryUser']['name'];\n $data['email'] = $param['SecondaryUser']['email'];\n $msgReturn = $this->GeneralFunctions->postEmail('companies', 'secondaryUser', $data);\n $newUser = $this->getSecundaryUserByLoginAndPassword($param['SecondaryUser']['email'], $param['SecondaryUser']['hashPass'], $company['Company']['id']);\n return json_encode($newUser[0]);\n }\n\n // $this->sendEmail(\"matheusodilon0@gmail.com\", \"esse é o corpo do email\", \"esse é o assunto\");\n }\n return 0;\n }", "public function registerPost()\n {\n $this->response->getHeaders()->setStatusCode(302);\n\n $regForm = $this->_getRegisterForm();\n $request = $this->getRequest();\n\n $failRedirect = $this->_router->assemble(\n array('controller' => 'user', 'action' => 'register'), \n array('name' => 'default')\n );\n\n if (!$this->getRequest()->isPost() || !$regForm->isValid($request->post()->toArray())) {\n $this->_flashMessenger->addMessage($regForm);\n $this->response->getHeaders()->addHeader('Location', $failRedirect);\n return $this->response;\n }\n $user = self::$di->get('userService')->createFromForm($regForm);\n var_dump($user);\n die('success!');\n }", "public function add($data, Resource $resource);", "function add_user(){\n //data is retrieved from the POST array, It is passed to here from the index/register page.\n //check if we have a full array => expecting 9 entities, at least 2 will be \"\" strings.\n //this is due to the hidden field and the cancel button. so we will verify if the register button is been clicked.\n //this will be done in the index/register page...\n\n //setting vars\n global $db;\n\n //validating passed data to ensure that all fields are entered and all match the needed requirements\n if (strlen($_POST[\"Username\"]) > 4){\n $uName = $_POST[\"Username\"];\n }else{\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n if (strlen($_POST[\"Password\"]) > 5){\n $pw1 = $_POST[\"Password\"]; //unsalted yet\n }else{\n $pw1 = \"b\";\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n if(strlen($_POST[\"Passwordconf\"])>5){\n $pw2 = $_POST[\"Passwordconf\"]; //pw verification\n }else{\n $pw2 =\"a\";\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n if(strlen($_POST[\"emailAddress\"])>8){\n $email = $_POST[\"emailAddress\"];\n }else{\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n if(strlen($_POST[\"Fname\"])>0){\n $firstName = $_POST[\"Fname\"]; //users first name\n }else{\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n if(strlen($_POST[\"Lname\"])>0){\n $lastName = $_POST[\"Lname\"]; //obviously the last name\n }else{\n $message = \"A required field is missing data needed or is too short to continue, please try again.\";\n }\n $encoded = \"\"; //empty string here - dont need to validate it.\n //The following is just a test... I want to see if i can catch this error and spit it back out...\n if ($pw1 === $pw2){\n $salt = bin2hex(random_bytes(256));\n @ $encoded = crypt($_POST[\"Password\"],$salt);\n }else{\n //var_dump($message);\n //this should catch any messages and force an exit code with errors...\n if (empty($message)){\n $message = \"The two password fields must be the same. Please start over.\";\n }\n //var_dump($message);\n include(\"partial/user/_register.php\");\n exit(); //jic something goes wrong we do not want to have the script resume.\n }\n //final catch for the $message string being full... meaning that there was an error and to halt code... even if passwords match.\n if (!empty($message)){\n include(\"partial/user/_register.php\");\n exit(); //jic something goes wrong we do not want to have the script resume.\n }\n\n @ $query = \"INSERT INTO users\n (\n Username , Password , pwsecret , emailAddress , Fname , Lname , Joined_Date , HelpVotes , NegVotes , Posts, WarnCnt\n )\n VALUES\n (\n ? , ?, ? , ? , ? , ?, CURRENT_TIMESTAMP,0,0,0,0\n )\";\n\n $stmnt = $db -> prepare($query);\n @ $stmnt -> bind_param(\"ssssss\",$uName,$encoded,$salt,$email,$firstName,$lastName);\n $resultQ1 = $stmnt -> execute();\n\n if (!$resultQ1){\n $error_message = \"There was a problem when attempting to add you as a user, please try again and if the issue persists please contact the webadmin.\";\n //clear vars for reuse::\n $_POST = array(); //should stop data from persisting.\n $uName = \"\";\n $pw1 = \"\";\n $pw2 = \"\";\n $encoded = \"\";\n $email = \"\";\n $firstName = \"\";\n $lastName = \"\";\n include(\"partial/user/_register.php\");\n exit(); //jic something goes wrong we do not want to have the script resume.\n }else{\n //the following should add a newly generated user to the roles table.\n $select=\"(SELECT userID FROM users WHERE Username = ?)\"; //sub query to return a user ID\n $insert=\"INSERT INTO roles (userID , isAdmin , isMod , isFormerStaff , isUser , isBanned) VALUES (? , 0 , 0 , 0 , 1 , 0)\"; //insert query to add user to roles table\n //I tested this code in mysql phpmyAdmin and it worked with out error...\n $stmnt = $db -> prepare($select);\n @ $stmnt -> bind_param(\"s\",$uName);\n $resultQ2 = $stmnt -> execute();\n\n if (!$resultQ2){\n echo \"<p class='alert alert-danger'>User role not created - please add user manually.</p>\";\n }else{\n $resultQ2 = $stmnt -> get_result();\n $data = $resultQ2 -> fetch_assoc();\n $newUser = $data[\"userID\"];\n $stmnt2 = $db -> prepare($insert);\n $stmnt2 -> bind_param(\"i\",$newUser);\n $resultQ3 = $stmnt2 -> execute();\n\n if (!$resultQ3){\n echo \"<p class='alert alert-danger'>There was an error while attempting to update user role table for userID: \" . $newUser . \" please verify that the data is correct, or contact your webadmin.</p>\";\n }else {\n echo \"<p class='alert alert-success'>User and user roles updated successfully!</p>\";\n }\n }\n\n //clear vars for reuse::\n $_POST = array(); //should stop data from persisting.\n $uName = \"\";\n $pw1 = \"\";\n $pw2 = \"\";\n $encoded = \"\";\n $email = \"\";\n $firstName = \"\";\n $lastName = \"\";\n }\n}", "public function registerAction(){\n\t\t$user = new User();\n\t\n\t \tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateUser();\n\t\t\t//if no errors validating fields insert user\n\t\t\tif ($this->view->errorMsg == null) {\n\t\n\t\t\t\t//verify user is not already registered\n\t\t\t\t$user_row = $user->fetchRow($user->select()->where('email = ?', $data['email']));\n\t\t\t\n\t\t\t\t//user already registered\n\t\t\t\tif($user_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Email address has already been registered.';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t'email' => $data['email'],\n\t\t\t\t\t\t'pass' => $data['pass'],\n\t\t\t\t 'name' => $data['name'],\n\t\t\t\t\t\t'url' => $data['url']\n\t\t\t\t\t);\n\t\t\n\t\t\t\t\t$user_id = $user->insert($user_data);\n\t\t\t\t\t$user_data['id'] = $user_id;\n\t\t\t\t\t\n\t\t\t\t\t//create default options\n\t\t\t\t\t$options = new Options();\n\t\t\t\t\t//breakfast\n\t\t\t\t\t$options_data = array();\n\t\t\t\t\t$options_data['user_id'] = $user_id;\n\t\t\t\t\t$options_data['meal_type'] = 'B';\n\t\t\t\t\t$options_data['meal_generation'] = 'A';\n\t\t\t\t\t$options_data['auto_options'] = 'C';\n\t\t\t\t\t$options->insert($options_data);\n\t\t\t\t\t//lunch\n\t\t\t\t\t$options_data['meal_type'] = 'L';\n\t\t\t\t\t$options->insert($options_data);\n\t\t\t\t\t//dinner\n\t\t\t\t\t$options_data['meal_type'] = 'D';\n\t\t\t\t\t$options->insert($options_data);\n\t\t\t\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t\t$this->session->user_email = $data['email'];\n\t\t\t\t\t$this->session->user_id = $user_id;\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/main');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->user_data = $data;\n\t\t\t\n\t\t}\n\t\n\t\n\t\t// additional view fields required by form\n\t\t$this->view->action = 'register';\n\t\t$this->view->buttonText = 'Register';\n\n }", "public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }", "public function addUser($data) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t\n\t\tforeach ($data as $key=>$val) {\n\t\t\tif ($key != 'password') {\n\t\t\t\t$values[$key] = $db->sqlify($val);\n\t\t\t} else {\n\t\t\t\t$values[$key] = $db->sqlify(crypt($val)); \n\t\t\t}\n\t\t}\n\t\t$values['date_created'] = $db->sqlify(date('Y-m-d H:i:s')); \n\t\t\n\t\t$check = false;\n\t\tif (!empty($data['email'])) {\n\t\t\t$check = $this->getUserByEmail($data['email']);\n\t\t} elseif (!empty($data['twitter_id'])) {\n\t\t\t$check = $this->getUserByTwitterId($data['twitter_id']);\n\t\t}\n\t\t\n\t\tif (!$check) {\n\t\t\t$db->insert('users', $values);\n\t\t\t$db->doCommit();\n\t\t}\n\t}", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', 'djdj3hdhy2hshsj2@gmail.com', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function route_useradd(array $args) {\n\t\tif (!self::$ctrl->get_user_data())\n\t\t\treturn self::$core::pj([Error::USER_NOT_LOGGED_IN], 401);\n\t\treturn self::$core::pj(\n\t\t\tself::$manage->add($args['post'], false, true, true), 403);\n\t}", "function register(){\n\t\t\t$this->__dataDecode();\n\t\t\t\t$data = $this->data;\n\t\t\t\t$username = $data['User']['userName'];\n\t\t\t\t$response\t= array();\n\t\t\t\t$emptyuserName = $this->User->findByUsername($username);\n\t\t\t \t$emptyEmail = $this->User->findByEmail($this->data['User']['email']);\n\t\t\t\n\t\t\t \t\n\t\t\tif(isset($this->data['User']['password']))\n\t\t\t{\n\t\t\t\t$this->data['User']['confirm_password'] = $this->data['User']['password'] \t= md5($this->data['User']['password']);\n\t\t\t\t$this->data['User']['email_confirmation']\t= 1;\n\t\t\t\t$this->data['User']['status']\t\t\t= 1;\n\t\t\t\t$data = $this->data;\n\t\t\t\t$data['User']['firstname']=$this->data['User']['firstName'];\n\t\t\t\t$data['User']['lastname']=$this->data['User']['lastName'];\n\t\t\t\t$data['User']['username']=$this->data['User']['userName'];\n\t\t\t\t}\n\n\t\t\tif(!($this->__validEmail($this->data['User']['email'])) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Please enter a valid email.';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t \t}\n\t\t\tif(!empty($emptyuserName) && !empty($data['User']['username']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'userName Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\n\t\t\t}\n\t\t\tif(!empty($emptyuserName) && !empty($data['User']['username']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'userName Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\n\t\t\tif(!empty($emptyEmail) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Email Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\n\t\t\t}\n\t\t\tif(!empty($emptyemail) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'email Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\tif(!($this->validateUSAZip($this->data['User']['zip'])) && !empty($this->data['User']['zip']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Please enter a valid Zip Code.';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t \t}\n\t\t\n\t\t\telse if($this->User->save($data))\n\t\t\t{\n\t\t\t\t$message\t= \"registered successfully\";\n\t\t\t\t$response['error']\t= 0;\n\t\t\t\t$response['response']['result'] = 'success';\n\t\t\t\t$response['response']['message'] = 'registered successfully';\n\t\t\t\t$this->set('response', $response);\t\t\t\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['result'] = 'failure';\n\t\t\t\t$response['response']['message']\t= 'registered unsuccessfully';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\n\t\t\techo json_encode($response);\n\t\t\tdie();\n\t\t}", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function registerAction()\n {\n // specify required fields\n $requirements = array(\n 'userName',\n 'password',\n 'email'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n //we need to match what's in the database\n $fields = array(\n 'yourEmail' => 'email',\n 'yourUserName' => 'userName',\n 'yourPassword' => 'password',\n 'fname' => 'fname',\n 'lname' => 'lname',\n 'yourIP' => 'ip',\n 'yourCountry' => 'countryAbbreviation',\n 'yourBday' => 'birthdate',\n 'accountId' => 'accountId',\n 'gender' => 'gender',\n 'cmsUserGroupId' => 'userRole',\n 'isChannel' => 'isChannel',\n );\n\n $params = array();\n $params['userId'] = 0;\n\n foreach ($fields as $key => $val) {\n if (isset($post[$val]) && $post[$val]) $params[$key] = $post[$val];\n }\n\n if (isset($params['yourEmail']) && $params['yourEmail']) {\n if ($this->get('UserServices')->checkDuplicateUserEmail($params['userId'], $params['yourEmail'])) {\n throw new HttpException(422, $this->translator->trans('This email address belongs to an existing Tourist Tuber.'));\n }\n }\n\n if (isset($params['yourUserName']) && $params['yourUserName']) {\n if ($this->get('UserServices')->checkDuplicateUserName($params['userId'], $params['yourUserName'])) {\n $suggestedNewUserNames = $this->get('UserServices')->suggestUserNameNew($params['yourUserName']);\n throw new HttpException(422, $this->translator->trans('Your username is already taken. try:') . ' ' . implode(' or ', $suggestedNewUserNames));\n }\n }\n\n if (isset($params['yourPassword']) && $params['yourPassword']) {\n //validate first for invalid password\n $validatePass = $this->get('UserServices')->validateUserLengthPassword($params['yourPassword']);\n if (isset($validatePass['success']) && $validatePass['success'] == false) {\n throw new HttpException(422, $validatePass['message']);\n }\n }\n\n if ((isset($params['fname']) && $params['fname']) || (isset($params['lname']) && $params['lname'])) {\n $fullname = '';\n if ($params['fname']) {\n $fullname .= $params['fname'];\n }\n if ($params['lname']) {\n $fullname .= $params['lname'];\n }\n } else {\n $fullname = $params['fname'] = $params['yourUserName'];\n }\n\n $params['fullName'] = $fullname;\n $params['defaultPublished'] = 0;\n $result = array();\n\n\n\n $insert = $this->get('UserServices')->generateUser($params);\n\n if (is_array($insert) && isset($insert['error']) && !empty($insert['error'])) {\n throw new HttpException(422, $insert['error']);\n } else {\n $this->get('UserServices')->sendRegisterActivationEmail(array('userId' => $insert->getId(), 'activationLink' => '/api/users/activate/'));\n $result['status'] = \"success\";\n $result['message'] = $this->translator->trans('An email is sent to you to activate your account.');\n }\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "function addUser(){\n\t$request = Slim::getInstance()->request();\n\t$evaluation = $request->getBody();\n\t$user = array(\"user_id\"=>\"\", \"user_name\"=>\"\", \"user_image\"=>\"\", \"user_twitterhandle\"=>\"\", \"user_facebookid\"=>\"\", \"user_active\"=>\"\");\n\t\n\t// construct data object\n\tforeach (explode('&', $evaluation) as $chunk) {\n\t $param = explode(\"=\", $chunk);\n\n\t if ($param) {\n\t \t$user[$param[0]] = $param[1];\n\t }\n\t}\n\n\t// check if the user exists\n\t$sql = \"SELECT * FROM mercury_users WHERE user_name = :user_name\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"user_name\", $user[\"user_name\"]);\n\t\t$stmt->execute();\n\t\t$matchingEvaluation = $stmt->fetchObject(); \n\n\t\tif($matchingEvaluation){\n\n\t\t}else{\n\t\t\t$sql = \"INSERT INTO mercury_users (user_name, user_image, user_twitterhandle, user_facebookid) VALUES (:user_name, :user_image, :user_twitterhandle, :user_facebookid)\";\n\t\t\ttry {\n\t\t\t\t$db = getConnection();\n\t\t\t\t$stmt = $db->prepare($sql); \n\t\t\t\t$stmt->bindParam(\"user_name\", $user[\"user_name\"]);\n\t\t\t\t$stmt->bindParam(\"user_image\", $user[\"user_image\"]);\n\t\t\t\t$stmt->bindParam(\"user_twitterhandle\", $user[\"user_twitterhandle\"]);\n\t\t\t\t$stmt->bindParam(\"user_facebookid\", $user[\"user_facebookid\"]);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$user[\"user_id\"] = $db->lastInsertId();\n\t\t\t\t$db = null;\n\t\t\t\techo json_encode($user); \n\t\t\t} catch(PDOException $e) {\n\t\t\t\terror_log($e->getMessage(), 3, '/var/tmp/php.log');\n\t\t\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t\t\t}\n\t\t}\n\t}catch(PDOException $e) {\n\t\terror_log($e->getMessage(), 3, '/var/tmp/php.log');\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function add() {\n if ($_POST){\n \n $username = filter_input(INPUT_POST, 'username');\n $password = filter_input(INPUT_POST, 'password');\n $password2 = filter_input(INPUT_POST, 'password2');\n $fullname = filter_input(INPUT_POST, 'fullname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('/[A-z 0-9\\-]+$/', $fullname) or $email == '' or $password != $password2) {\n $this->setData('message', 'Podaci nisu tačno uneti.');\n } else {\n $passwordHash = hash('sha512', $password . Configuration::SALT);\n $res = HomeModel::add($username, $passwordHash , $fullname, $email);\n if ($res){\n Misc::redirect('successfull_registration');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom dodavanja. Korisničko ime je verovatno zauzeto.');\n }\n } \n }\n }", "function action_register() {\n if(model_user::userLoggedIn()) {\n header('Location: /home/track');\n }\n $jobs = model_job::getAllJobs();\n $displayError = FALSE;\n\n if (isset($_POST['btn-register'])) {\n $user_data = array(\n 'lastname' => model_user::sanitizeInput($_POST['form']['lastname']),\n 'firstname' => model_user::sanitizeInput($_POST['form']['firstname']),\n 'email' => $_POST['form']['email'],\n 'password' => $_POST['form']['password'],\n 'confirmPassword' => $_POST['form']['confirmPass'],\n 'job' => $_POST['form']['job'],\n );\n\n $form_errors = array(\n 'emailMessage' => '',\n 'limitMessage' => '',\n 'errorEmail' => FALSE,\n 'errorPassword' => FALSE,\n 'errorConfirmPass' => FALSE,\n 'errorLastName' => FALSE,\n 'errorFirstName' => FALSE,\n 'isPasswordNotMatching' => FALSE,\n );\n\n // Check user's lastname and firstname.\n model_user::validateUserName($form_errors, $user_data, $displayError);\n\n // Check user's email.\n model_user::validateUserEmail($form_errors, $user_data, $displayError);\n\n // Check user's password and user's confirm password.\n model_user::validatePassword($form_errors, $user_data, $displayError);\n\n // If there are no errors displayed, attempt to add the user.\n if (!$displayError) {\n try {\n $user = model_user::addUser(\n $user_data['lastname'],\n $user_data['firstname'],\n $user_data['email'],\n $user_data['password'],\n $user_data['job']\n );\n header('Location: /home/login');\n } catch (Exception $e) {\n header('Location: /500/index');\n }\n }\n }\n @include_once APP_PATH . 'view/user_register.tpl.php';\n }", "public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with something@place.com, goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }", "public function store($user_data)\n\t{\n\t\t$new_user = new User;\n\t\t$new_user->role_id \t\t\t= $user_data['role_id'];\n\t\t$new_user->first_name \t\t= (isset($user_data['first_name']) && !empty($user_data['first_name'])) \t\t? $user_data['first_name'] \t: null;\n\t\t$new_user->last_name \t\t= (isset($user_data['last_name']) && !empty($user_data['last_name'])) \t\t\t? $user_data['last_name'] \t: null;\n\t\t$new_user->username \t\t= $user_data['username'];\n\t\t$new_user->password \t\t= (Hash::needsRehash($user_data['password'])) ? Hash::make($user_data['password']) : $user_data['password'];\n\t\t$new_user->email \t\t\t= $user_data['email'];\n\t\t$new_user->birthdate \t\t= (isset($user_data['birthdate']) && !empty($user_data['birthdate'])) \t\t\t? $user_data['birthdate'] \t\t: null;\n\t\t$new_user->phone \t\t\t= (isset($user_data['phone']) && !empty($user_data['phone'])) \t\t\t\t\t? $user_data['phone'] \t\t\t: null;\n\t\t$new_user->facebook \t\t= (isset($user_data['facebook']) && !empty($user_data['facebook']))\t\t\t\t? $user_data['facebook'] \t\t: null;\n\t\t$new_user->twitter \t\t\t= (isset($user_data['twitter']) && !empty($user_data['twitter'])) \t\t\t\t? $user_data['twitter'] \t\t: null;\n\t\t$new_user->profile_image \t= (isset($user_data['profile_image']) && !empty($user_data['profile_image'])) \t? $user_data['profile_image'] \t: null;\n\t\t$new_user->cover_image \t\t= (isset($user_data['cover_image']) && !empty($user_data['cover_image'])) \t\t? $user_data['cover_image'] \t: null;\n\t\t$new_user->cover_text \t\t= (isset($user_data['cover_text']) && !empty($user_data['cover_text']))\t\t\t? $user_data['cover_text'] \t\t: null;\n\t\tif($new_user->save())\n\t\t\treturn $new_user;\n\t\telse\n\t\t\treturn false;\n\t}", "public function userAdd($userModel) {\n // Validating the input on back-end\n $validateEmail = $this->validate->validateEmail($userModel->getEmail());\n $validateUsername = $this->validate->validateInput($userModel->getUsername(), \"/^[a-zA-Z0-9_.-]*$/\", 1, 25);\n $validatePassword = $this->validate->validateInput($userModel->getPassword(), \"/^[a-zA-Z0-9@+_.!?|]*$/\", 8, 20);\n\n // Checking if they all return true\n if ($validateEmail && $validateUsername && $validatePassword) {\n // Checking if email or username is already used\n $emailExist = $this->userDB->checkUserEmailUsed($userModel->getEmail());\n $usernameExist = $this->userDB->checkUsernameUsed($userModel->getUsername());\n\n if ($emailExist != 1) {\n // Returning error if one or more failes\n header(\"Location: create-account?error=3\");\n } else if ($usernameExist != 1) {\n // Returning error if one or more failes\n header(\"Location: create-account?error=4\");\n } else {\n // Sending the model to the database layer create the account\n if ($this->userDB->userAdd($userModel)) {\n // Getting the user info by username and filling the userModel with it\n $userModel = $this->userDB->getUserByUsername($userModel);\n\n // Achievements ophalen\n $achievementList = $this->achievementDB->getAchievements();\n\n // Checking if achievements are connected\n if($this->userDB->connectAchievementsToUser($userModel, $achievementList)) {\n // Logging the user in with session\n session_start();\n $_SESSION['userID'] = $userModel->getID();\n\n // Sending user to home page\n header(\"Location: index\");\n } else {\n // Returning with error\n header(\"Location: create-account?error=5\");\n }\n } else {\n // Returning error if user account is not added\n header(\"Location: create-account?error=5\");\n }\n }\n } else {\n // Returning error if one or more failes\n header(\"Location: create-account?error=5\");\n } \n }", "function add()\n { \n\t\tif ($this->auth->loggedin()) {\n\t\t\t$id = $this->auth->userid();\n\t\t\tif(!($this->User_model->hasPermission('add',$id)&&($this->User_model->hasPermission('person',$id)||$this->User_model->hasPermission('WILD_CARD',$id)))){\n\t\t\t\tshow_error('You Don\\'t have permission to perform this operation.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->form_validation->set_rules('username', '<b>Username</b>', 'trim|required|min_length[5]|max_length[12]');\n\t\t\t$this->form_validation->set_rules('password', '<b>Password</b>', 'trim|required');\n\t\t\t$this->form_validation->set_rules('first_name', '<b>First Name</b>', 'trim|required|min_length[2]|max_length[12]');\n\t\t\t$this->form_validation->set_rules('Last_name', '<b>Last Name</b>', 'trim|required|min_length[2]|max_length[12]');\n\t\t\t\n\t\t\t$this->form_validation->set_rules('gender', '<b>Gender</b>', 'trim|required');\n\t\t\t$this->form_validation->set_rules('mobile', '<b>Mobile</b>', 'trim|required|integer|min_length[10]|max_length[11]');\n\t\t\t$this->form_validation->set_rules('role_id', '<b>Role</b>', 'trim|required|integer|min_length[1]|max_length[4]');\n\t\t\t$this->form_validation->set_rules('location_id', '<b>Location</b>', 'trim|required|integer|min_length[1]|max_length[4]');\n\t\t\t$this->form_validation->set_rules('status_id', '<b>Status</b>', 'trim|required|integer|min_length[1]|max_length[4]');\n\t\t\t\t\t\t\n\t\t\tif(isset($_POST) && count($_POST) > 0 && $this->form_validation->run()) \n\t\t\t{ \n\t\t\t\t$person_id = $this->User_model->register_user(); \n\t\t\t\t//$person_id = $this->Person_model->add_person($params);\n\t\t\t\t$params1 = array(\n\t\t\t\t\t\t\t'person_id' => $person_id,\n\t\t\t\t\t\t\t'role_id' => $this->input->post('role_id'),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->Person_role_model->update_person_role($person_id,$params1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$params2 = array(\n\t\t\t\t\t\t\t'person_id' => $person_id,\n\t\t\t\t\t\t\t'location_id' => $this->input->post('location_id'),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->Person_location_model->update_person_location($person_id,$params2);\t\n\t\t\t\tredirect('person/index');\n\t\t\t}\n\t\t\telse\n\t\t\t{ \n\t\t\t\t\n\t\t\t\t$user = $this->User_model->get('person_id', $id);\n\t\t\t\tunset($user['password']);\n\t\t\t\t\n\t\t\t\t$user_role = $this->User_model->loadRoles($user['person_id']);\n\t\t\t\t\t$this->data['user'] = $user['username'];\n\t\t\t\t\t$this->data['role'] = $user_role;\n\t\t\t\t\t$this->data['gender'] = $user['gender'];\n\t\t\t\t\t$specialPerm = $this->User_model->loadSpecialPermission($id);\n\t\t\t\t\t\n\t\t\t\t\t$this->data['pp'] = $specialPerm;\n\t\t\t\t\t$this->data['p_role'] = $this->Person_role_model->get_person_role($id);\n\t\t\t\t\t$this->data['role'] = $this->Role_model->get_all_role();\n\t\t\t\t\t$this->data['location'] = $this->Location_model->get_all_location();\n\t\t\t\t\t$this->data['status'] = $this->Statu_model->get_all_status();\n\t\t\t\t\t\n\t\t\t\t$this->template\n\t\t\t\t\t->title('Welcome','My Aapp')\n\t\t\t\t\t->build('person/add',$this->data);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->template\n\t\t\t\t\t->title('Login Admin','Login Page')\n\t\t\t\t\t->set_layout('access')\n\t\t\t\t\t->build('access/login');\n\t\t}\n }", "public function addUser($data)\n {\n $request = $this->bdd->prepare('INSERT INTO users(Name, FirstName, Mail, Password, Phone, Subcription_ID) VALUES (:name, :firstname, :mail, :password, :phone, :subid)');\n $request->execute([\n 'name' => $data['lastName'],\n 'firstname' => $data['firstName'],\n 'mail' => $data['mail'],\n 'password' => sha1($data['password']),\n 'phone' => $data['tel'],\n 'subid' => (int) $data['radio']\n ]);\n return true;\n }", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "public function register()\n {\n // Invoke the base class save method to do any preparation work\n parent::save(\"\");\n \n /************ VALIDATION **************/\n $profile = new \\DataFilter\\Profile();\n \n // Set global validation checks\n $profile->addPreFilters(['Trim', 'StripHtml']);\n $profile->setAttribs($this->getValidationAttribs(true));\n \n // Perform validation checks\n if (!$profile->check($_POST)) {\n // The form is NOT valid.\n $message = \"Validation Error:\\n\";\n $res = $profile->getLastResult();\n foreach ($res->getAllErrors() as $error) {\n $message .= \"Err: $error\\n\";\n } \n \n // Send the validation errors back to the browser\n $this->result[\"message\"] = $message;\n $this->send();\n }\n \n // The form was valid. Get the validated and transformed data from the profile.\n $data = $profile->getLastResult()->getValidData();\n \n // If we're adding a new user, ensure this email address does NOT already exist\n $email = INPUT::post(\"email\");\n $users = $this->model->getList(array(\"email\" => $email));\n if(count($users) > 0) {\n $this->result[\"message\"] = \"Sorry, an account with this email address already exists\";\n $this->send(); \n }\n \n // Hash the password\n $this->model->hashPassword($data[\"password\"], $hashed_password, $salt);\n $data[\"password\"] = $hashed_password;\n $data[\"salt\"] = $salt;\n \n // Save the client record (if id = 0 then a new record will be created)\n $id = $this->model->save(0, $data);\n \n // If we're adding a new user, we also need to add the user role.\n // Tthe role is set as the DEFAULT user role which is MYNDIE_ROLE_MEMBER (id 2) as we can't allow\n // unsecure sources to add ADMIN user roles. \n\n // Load the user bean\n $user = $this->model->get($id);\n if(!$user) {\n $this->result[\"message\"] = \"Your account could not be created\";\n $this->send(); \n }\n \n // Create the default role.\n $objRole = new \\Myndie\\Model\\Role($this->app);\n $roleBean = $objRole->get(MYNDIE_DEFAULT_USER_ROLE);\n if(!$roleBean) {\n $this->result[\"message\"] = \"Default role is invalid\";\n $this->send(); \n }\n \n $user->sharedRole[] = $roleBean; // Users to Roles is a many to many relationship so we use a shared list.\n R::store($user);\n\n // Send the OK result back, along with the ID of the new user.\n $this->OK($id); \n }", "public function saveAction(){\n\t\t$request = $this->_request->getParams();\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\t$error = false;\n\t\tif(!$oValidationHelper->ifEmailAvailable($request['user_email'],$this->_auth->user_id)){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('User with such email already exists','error','user_email');\n\t\t}\n\n\t\tif(!$oValidationHelper->ifUsernameAvailable($request['user_login'],$this->_auth->user_id)){\n\t\t\t$this->_messages->setMessage('User with such username already exists','error','user_login');\n\t\t\t$error = true;\n\t\t}\n\t\t\t\t\n\t\tif($this->_validator->validate('registration_form',$request) && !$error){\n\t\t\t\n\t\t\tif($request['user_email']!=$this->_auth->user_email){\n\t\t\t\t$request['user_confirmation_code'] = md5(time()+rand(10000,99999));\n\t\t\t\t$request['user_active'] = 0;\n\t\t\t\t$this->_sendConfirmationEmail($request['user_email'],$request['user_login'],$request['user_confirmation_code']);\n\t\t\t\t$this->_messages->setMessage('WARNING!!! Your email has been changed and your account has been disabled. Instructions on how to activate account were sent to you','error');\n\t\t\t}\n\t\t\t\n\t\t\t$request['user_id'] = $this->_auth->user_id;\n\t\t\t$oUsers = new Models_Usermanagement_Users();\n\t\t\t$oUsers->updateEntry($request);\t\t\t\n\t\t\t\n\t\t\t$this->_messages->setMessage('Account has been updated');\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/?error=1');\n\t\t}\n\t}", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}", "public function add()\n {\n admin_session_check();\n $this->form_validation->set_rules('username', $this->lang->line('validation_username'), 'trim|required|callback_username_check');\n $this->form_validation->set_rules('email', $this->lang->line('validation_email_address'), 'trim|required|valid_email|callback_email_check');\n $this->form_validation->set_rules('usertype', $this->lang->line('validation_usertype'), 'trim|required');\n $this->form_validation->set_rules('password', $this->lang->line('validation_password'), 'trim|required|callback_password_check');\n $this->form_validation->set_rules('confirm_password', $this->lang->line('validation_confirm_password'), 'trim|required');\n $this->form_validation->set_rules('page_limit', $this->lang->line('validation_page_limit'), 'trim|required|numeric');\n $this->form_validation->set_message('required','%s '.$this->lang->line('validation_required'));\n $this->form_validation->set_message('valid_email', $this->lang->line('validation_invalid_email'));\n if(!$this->form_validation->run())\n {\n $data['page_title'] = $this->lang->line('add_user_title');\n $data['view'] = 'add_user';\n $this->load->view('template', $data);\n }else\n {\n $this->users_model->insert();\n $user_data = array(\n 'email' => $this->input->post('email', TRUE),\n 'username' => $this->input->post('username', TRUE),\n 'password' => $this->input->post('password', TRUE)\n );\n send_email($user_data['email'], $this->lang->line('email_signup_welcome').' '.$this->config->item('site_name'), 'signup', $user_data );\n $this->session->set_flashdata('alert', get_alert_html($this->lang->line('success_user_created'), ALERT_TYPE_SUCCESS));\n redirect('users/list_users');\n }\n }", "public function registerAction()\n\t{\n\t\tif($this->loggedEmail){\n\t\t\t$this->_redirect('/');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//get referrer\n\t\t$ns = new Zend_Session_Namespace('referrer');\n\t\t$this->view->referby = $ns->referrer;\n\t\t\t\n\t\tif($this->getRequest()->isPost()){\n\t\t\t//Validation\n\t\t\t// Valid email address?\n\t\t\tif (! Zend_Validate::is($this->_request->getPost('email'), 'EmailAddress')\n\t\t\t\t&& $this->_request->getPost('email') != 'me2@localhost'){\n\t\t\t\t$this->view->errors[] = \"Invalid e-mail address.\";\n\t\t\t} \n\t\t\t//E-mail cannot already exist in the database\n\t\t\t$user = new Default_Model_User();\n\t\t\t$foundUser = $user->getUserByEmail($this->_request->getPost('email'));\n\t\t\tif(isset($foundUser->id)){\n\t\t\t\t$this->view->errors[] = \"Email address already in database.\";\n\t\t\t}\n\t\t\t\n\t\t\t//Handle must be between 2-20 characters\n\t\t\t$validator = new Zend_Validate_StringLength(2, 20);\n\t\t\tif(! $validator->isValid($this->_request->getPost('handle'))){\n\t\t\t\t$this->view->errors[] = \"Handle must be between 2 and 14 characters.\";\n\t\t\t}\n\t\t\t\n\t\t\t// Handle must consist solely of alphanumeric characters\n\t\t\t$validHandle = new Zend_Validate_Alnum();\n\t\t\tif (! $validHandle->isValid($this->_request->getPost('handle'))) {\n\t\t\t\t$this->view->errors[] = \"Handle must consist of letters and numbers.\";\n\t\t\t} // end valid handle\n\t\t\t\n\t\t\t// Handle cannot already exist in database\n\t\t\t$foundUser = $user->getUserByHandle($this->_request->getPost('handle'));\n\t\t\tif (isset($foundUser->id)) {\n\t\t\t\t$this->view->errors[] = \"Handle already exists in database.\";\n\t\t\t}\n\t\t\t\n\t\t\t// Password must between 6 to 20 characters\n\t\t\t$validPswd = new Zend_Validate_StringLength(6,20);\n\t\t\tif (! $validPswd->isValid($this->_request->getPost('password'))) {\n\t\t\t\t$this->view->errors[] = \"Password must be at least 6 characters.\";\n\t\t\t} // end valid password\n\t\t\t\n\t\t\t// First name must not be empty\n\t\t\t$validFirstName = new Zend_Validate_NotEmpty();\n\t\t\tif (! $validFirstName->isValid($this->_request->getPost('first_name'))) {\n\t\t\t\t$this->view->errors[] = \"Please provide your first name.\";\n\t\t\t} // end valid first name\n\t\t\t\n\t\t\t// Last name must not be empty\n\t\t\t$validLastName = new Zend_Validate_NotEmpty();\n\t\t\tif (! $validLastName->isValid($this->_request->getPost('last_name'))) {\n\t\t\t\t$this->view->errors[] = \"Please provide your last name.\";\n\t\t\t} // end valid last name\n\t\t\t\n\t\t\t// Valid gender?\n\t\t\tif (! Zend_Validate::is($this->_request->getPost('gender'), 'NotEmpty')) {\n\t\t\t\t$this->view->errors[] = \"Please identify your gender.\";\n\t\t\t} // end valid gender\n\t\t\t\n\t\t\t//Address not empty?\n\t\t\tif(! Zend_Validate::is($this->_request->getPost('address'), 'NotEmpty')){\n\t\t\t\t$this->view->errors[] = \"Please enter your address.\";\n\t\t\t}\n\t\t\t\n\t\t\t\t//if errors exist, prepopulate the form\n\t\t\t\tif(count($this->view->errors) > 0){\n\t\t\t\t$this->view->email = $this->_request->getPost('email');\n\t\t\t \t$this->view->handle = $this->_request->getPost('handle');\n\t\t\t \t$this->view->first_name = $this->_request->getPost('first_name');\n\t\t\t \t$this->view->last_name = $this->_request->getPost('last_name');\n\t\t\t \t$this->view->gender = $this->_request->getPost('gender');\n\t\t\t\t$this->view->address = $this->_request->getPost('address');\n\t\t\t\t}else{ //No errors, add user to the database and send confirmation e-mail\n\t\t\t\t\n\t\t\t\t//Generate random keys used for registration confirmation\n\t\t\t\t$registrationKey = $this->_helper->generator(32, 'alpha');\n\t\t\t\t\n\t\t\t\t// Prepare the data array for database insertion\n\t\t\t\t$data = array (\n\t\t\t\t\t'email' => $this->_request->getPost('email'),\n\t\t\t\t\t'password' => md5($this->_request->getPost('password')),\n\t\t\t\t\t'registration_key' => $registrationKey,\n\t\t\t\t\t'handle' => $this->_request->getPost('handle'),\n\t\t\t\t\t'first_name' => $this->_request->getPost('first_name'),\n\t\t\t\t\t'last_name' => $this->_request->getPost('last_name'),\n\t\t\t\t\t'gender' => $this->_request->getPost('gender'),\n\t\t\t\t\t'address' => $this->_request->getPost('address'),\n\t\t\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'updated_at' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'last_login' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'referby' => $this->_request->getPost('referrer')\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t//Create a new mail object\n\t\t\t\t try {\n\t\t\t\t\t $mail = new Zend_Mail();\n\t\t\t\t\t\n\t\t\t\t\t // Set the From, To, and Subject headers\n\t\t\t\t\t $mail->setFrom($this->config->email->from_admin);\n\t\t\t\t\t $mail->addTo($this->_request->getPost('email'),\n\t\t\t\t\t \"{$this->_request->getPost('first_name')}\n\t\t\t\t\t {$this->_request->getPost('last_name')}\");\n\t\t\t\t\t $mail->setSubject('Your game account has been created');\n\t\t\t\t\t\n\t\t\t\t\t // Retrieve the e-mail template\n\t\t\t\t\t include \"emailTemplates/_email-confirm-registration.phtml\";\n\t\t\t\t\t\n\t\t\t\t\t // Attach the e-mail template to the e-mail and send it\n\t\t\t\t\t $mail->setBodyText($email);\n\t\t\t\t\t $mail->send();\n\t\t\t\t\t\n\t\t\t\t\t $this->view->success = 1;\n\t\t\t\t\t } catch (Exception $e) {\n\t\t\t\t\t\t $this->view->errors[] = \"We were unable to send your confirmation \t\t\n\t\t\t\t\t\t e-mail.\n\t\t\t\t\tPlease contact {$this->config->email->support}.\";\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t //If succcessful at sending mail, insert into database\n\t\t\t\t if($this->view->success == 1){\n\t\t\t\t\t// Insert the registration data into the database\n\t\t\t\t\t$user = new Default_Model_User();\n\t\t\t\t\t$user->insert($data);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\n\t\t\t\t} //end else (w/ no errors)\n\t\t} //end if isPost()\n\t}", "function createUser()\n{\n $userCheck = UsersQuery::create()->findOneByUsername($_POST['username']);\n if ($userCheck == \"\") {\n // next add user to db\n $user = new Users();\n $user->setUsername($_POST['username']);\n $user->setPassword($_POST['password']);\n $user->setName($_POST['name']);\n $user->setEmail($_POST['email']);\n $user->setStatus(\"active\");\n $user->setPicture(\"none\");\n $user->setCreated(time());\n $user->setModified(time());\n\n $user->save();\n\n if ($user != null) {\n echo \"user added successfully\";\n }\n } else {\n echo \"user already registered\";\n }\n}", "public function add() {\n if ($this->User->isLoggedIn() && $this->User->isAdmin()) {\n $flash = null;\n if (isset($_POST['email'])&&isset($_POST['password'])) {\n if ($this->User->insert(\n $_POST['email'],\n $_POST['password']\n )) {\n $flash = \"User {$_POST['email']} added.\";\n }\n }\n return array(\n 'flash' => $flash,\n 'title' => 'Add user'\n );\n } else {\n header(\"Location: \".app::site_url(array('users','login')));\n exit(0);\n }\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "function registerAction() {\n if ($this->request->isPost() && $this->request->isAjax()) {\n try {\n $userObj = new User(\n $this->request->getQuery('username')\n , $this->request->getQuery('password')\n );\n $userObj->save();\n\n return parent::httpResponse(json_encode($userObj));\n } catch (Exception $e) {\n return parent::httpResponse($e->getMessage());\n }\n }\n }", "function sdds_add_new_member()\n{\n if (isset($_POST['aff-user-email']) && wp_verify_nonce($_POST['aff-register-nonce'], 'aff-reg-nonce'))\n {\n $user_email = $_POST['aff-user-email'];\n $user_first = $_POST['aff-user-first'];\n $user_last = $_POST['aff-user-last'];\n $user_phone = $_POST['aff-user-phone'];\n\n //required for username checks\n // require_once(ABSPATH . WPINC . '/registration.php');\n if ($user_email == '')\n {\n aff_errors()->add('email_empty', __('Please enter your email address'));\n }\n if ($user_first == '')\n {\n aff_errors()->add('name_empty', __('Please enter your first name'));\n }\n if ($user_last == '')\n {\n aff_errors()->add('name_empty', __('Please enter your last name'));\n }\n if ($user_phone == '')\n {\n aff_errors()->add('phone_empty', __('Please enter your phone number'));\n }\n if (!is_email($user_email))\n {\n aff_errors()->add('email_invalid', __('Looks like this email address is not valid!'));\n }\n if (email_exists($user_email))\n {\n aff_errors()->add('email_used', __('Looks like this email address is already registered! Please login to access your dashboard'));\n }\n\n $errors = aff_errors()->get_error_messages();\n\n //only create user if errors are empty\n $user_pass = \"6Tr%#lKG_#@$%%7\";\n if (empty($errors))\n {\n $new_user_id = wp_insert_user(array(\n 'user_login' => $user_email, //idk if an email can be a valid username\n 'user_pass' => $user_pass, //autogenerate?\n 'user_email' => $user_email,\n 'first_name' => $user_first,\n 'last_name' => $user_last, //maybe separate first and last to avoid explosion\n 'user_registered' => date('Y-m-d H:i:s') ,\n 'role' => 'affiliate'\n ));\n\n if ($new_user_id)\n {\n //send alert to admin\n wp_new_user_notification($new_user_id, null, 'both');\n //log new user in\n wp_set_auth_cookie($user_email, true);\n wp_set_current_user($new_user_id, $user_email);\n do_action('wp_login', $user_email, $new_user_id);\n\n //send user to dashboard page\n wp_redirect(home_url() . '/affiliate-thank-you');\n exit;\n }\n }\n }\n}", "function validate_form() \n{\n $firstname = $_POST[\"fname\"];\n $lastname = $_POST[\"lname\"];\n $username = $_POST[\"uname\"];\n $email = $_POST[\"email\"];\n $password = $_POST[\"pword\"];\n\n $user = new userClass($firstname, $lastname, $username, $email, $password);\n $count = countUser($user);\n include 'header.php'; ?>\n\n <body>\n <div class=\"w3-container logisTixContainerAlpha\">\n <div class=\"w3-container w3-center logisTixBorderLineDGray\">\n <img class=\"w3-center\" src=\"images/logistixlogotrue.png\" width=\"50%\"><br><?php\n if ($count == 0) {\n $res = createUser($user); \n if ($res) { ?>\n <span><strong><?php echo $username; ?></strong> has been added successfully</span><?php \n } else { ?>\n <span><strong><?php echo $username; ?></strong> was not added. There was an error please try again.</span><?php \n }\n } else { ?>\n <span>User already exists.</span><?php \n } ?>\n </div>\n </div><?php\n}", "public function register(){\n if(Input::has('username') && Input::has('name') && Input::has('email') && Input::has('password')){\n\n $comprobate = DB::collection('users')->where('username', Input::get('username'))->orWhere('email', Input::get('email'))->first();\n\n \n if($comprobate == null){\n $user = new User;\n $user->username = Input::get('username');\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->password = Hash::make(Input::get('password'));\n $user->isCompleted = false;\n $user->card = null;\n $user->activeEvent = null;\n\n $user->save();\n\n return Response::json(array(\n 'reason' => 'user add succesfully', 'status' => 0 ))->setCallback(Input::get('callback'));\n }\n return Response::json(array(\n 'reason' => 'username or email are being used', 'status' => 1 ))->setCallback(Input::get('callback'));\n }\n\n return Response::json(array(\n 'reason' => 'fields arguments are icorrect', 'status' => 2 ))->setCallback(Input::get('callback'));\n }", "public function add()\n\t{\n\n\t\t$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]');\n\t\t$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[5]');\n\t\t$this->form_validation->set_rules('name', 'Name', 'trim|required|min_length[5]');\n\t\t$this->form_validation->set_rules('email', 'E-mail', 'trim|required|min_length[5]');\n\t\t$this->form_validation->set_rules('confpassword','Confirm Password'\n\t\t\t, 'trim|required|min_length[5]|matches[password]');\n\n\n\t\t$data=$this->input->post();\n\t\t\n\n\t\t$username=$data['username'];\n\t\t$password=md5($data['password']);\n\t\t$name=$data['name'];\n\t\t$email=$data['email'];\n\t\t$phone=$data['phone'];\n\t\t\n\n\t\t$new_user = [\n\t\t\t'username' => $username,\n\t\t\t'password' => $password,\n\t\t\t'hoten' => $name,\n\t\t\t'email' => $email,\n\t\t\t'sdt' => $phone,\n\t\t];\n\n\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t$chk_username=$this->User_Model->check_username($username);\n\t\t\t$chk_email=$this->User_Model->check_mail($email);\n\n\t\t\tif ($chk_username==true&&$chk_email==true) {\n\t\t\t\t$this->session->set_flashdata('Mail','This email already exists');\n\t\t\t\t$this->session->set_flashdata('UserWel','');\n\t\t\t\t$this->session->set_flashdata('UserEx','This user already exists');\n\n\t\t\t\t$this->toList_userview();\n\t\t\t}\n\t\t\telse if ($chk_username==true&&$chk_email==false) {\n\n\t\t\t\t$this->session->set_flashdata('UserWel','');\n\t\t\t\t$this->session->set_flashdata('Mail','');\n\t\t\t\t$this->session->set_flashdata('UserEx','This user already exists');\n\t\t\t\t\n\t\t\t\t$this->toList_userview();\n\t\t\t}\n\t\t\telse if ($chk_username==false&&$chk_email==true) {\n\n\t\t\t\t$this->session->set_flashdata('UserWel','');\n\t\t\t\t$this->session->set_flashdata('Mail','This email already exists');\n\t\t\t\t$this->session->set_flashdata('UserEx','');\n\t\t\t\t\n\t\t\t\t$this->toList_userview();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->User_Model->insert($new_user);\n\n\t\t\t\t$this->session->set_flashdata('UserEx','');\n\t\t\t\t$this->session->set_flashdata('Mail','');\n\t\t\t\t$this->session->set_flashdata('UserWel','Success !!! '.$username.' is new member');\n\n\t\t\t\t$this->addNotification($_SESSION['user'].' đã thêm 1 tài khoản',$_SESSION['username']);\n\n\t\t\t\t$this->toList_userview();\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this->toList_userview();\n\t\t}\n\n\t}", "public function doCreate() {\n if(\n isset($_POST['email']) &&\n isset($_POST['password']) &&\n isset($_POST['lastName']) &&\n isset($_POST['firstName']) &&\n isset($_POST['address']) &&\n isset($_POST['postalCode']) &&\n isset($_POST['city'])\n ) {\n $alreadyExist = $this->userManager->findByEmail($_POST['email']);\n\n if(!$alreadyExist) {\n $newUser = new User($_POST);\n $this->userManager->create($newUser);\n $page = 'login';\n }\n else {\n $error = \"ERROR : This email (\".$_POST['email'].\") is used by another user\";\n $page = 'create';\n }\n }\n\n require('./View/default.php');\n }" ]
[ "0.6500552", "0.6489134", "0.6451038", "0.6303201", "0.61842513", "0.6104865", "0.6099151", "0.605396", "0.6046741", "0.603245", "0.59373516", "0.59210557", "0.59074485", "0.59061795", "0.59047186", "0.5889217", "0.58758897", "0.5873581", "0.58488464", "0.5834428", "0.5826928", "0.58244485", "0.5815354", "0.58090633", "0.58026814", "0.5785692", "0.57701486", "0.5743747", "0.5733868", "0.5708594", "0.5702965", "0.5701556", "0.57009906", "0.56760097", "0.565578", "0.56533355", "0.56518686", "0.5646584", "0.5643843", "0.5631552", "0.56266594", "0.56217915", "0.56183726", "0.5609993", "0.5605404", "0.56026924", "0.560014", "0.55995256", "0.55885327", "0.55879533", "0.5582089", "0.55718994", "0.55635154", "0.5562261", "0.55560315", "0.55463415", "0.55450016", "0.55251634", "0.5517131", "0.5511158", "0.5508142", "0.5502025", "0.550022", "0.54967433", "0.5490055", "0.5483878", "0.548205", "0.5481223", "0.5468905", "0.5467179", "0.54579145", "0.545545", "0.54515046", "0.54499793", "0.5447225", "0.54385155", "0.54326886", "0.54291505", "0.5423758", "0.5417794", "0.5415175", "0.5412705", "0.54102206", "0.5408808", "0.5408488", "0.54061997", "0.5405981", "0.5405842", "0.5405186", "0.5404415", "0.5403582", "0.5402698", "0.540248", "0.539754", "0.5396162", "0.5390704", "0.53880936", "0.5382874", "0.5381379", "0.5380859" ]
0.70471954
0
/ postEditResources Checks to see if the user data is valid if so it will update the DB if the user data is invalid will reload the edit user page.
После редактирования ресурсов проверяет, является ли данные пользователя корректными. Если данные корректны, обновляет базу данных. Если данные некорректны, перезагружает страницу редактирования пользователя.
public function postEditResources() { $id = $this->_params['id']; $errors = validateEditResource($id); if(!($errors === true)) { $database = new Database(); $resource = $database->getResourceById($id); /*construct($resourceID = "0", $resourceName = "Resource", $description = "Info", $contactName ="",$contactEmail = "",$contactPhone = "",$link = "", $active = "1" )*/ $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['Active']); $this->_f3->set('Resource', $availableResource); $this->_f3->set('errors', $errors); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); } else { // fixme add routing $this->_f3->reroute('/Admin'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"No data was updated, Please confirm that you change at least one field\");</script>';\n Response::redirect('/user/edit', 'refresh');\n }\n }", "public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }", "public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function postEdit()\n {\n // If we are not authentified, redirect to the login page.\n if(Auth::guest()) return Redirect::action('frontend\\UserController@getLogin');\n\n $loggedUser = Auth::user();\n\n $user = API::put('api/v1/user/' . $loggedUser->id, Input::all());\n\n // If the API throws a ValidationException $user will be a JSON string with our errors.\n if(is_string($user)) {\n $errors = json_decode($user, true);\n return Redirect::action('frontend\\UserController@getIndex')\n ->withErrors($errors);\n } else {\n return Redirect::action('frontend\\UserController@getIndex')\n ->with('success', 'Profile edited!');\n }\n }", "public function actionEdit()\n {\n $userId = User::checkLogged();\n if ($userId == true) {\n $user = User::getUserById($userId);\n } else {\n header (\"Location: /login\");\n }\n\n // Variables for the form\n $firstName = $user['first_name'];\n $lastName = $user['last_name'];\n $email = $user['email'];\n $password = md5($user['password']);\n $birth = $user['birth'];\n $company = $user['company'];\n $address = $user['address'];\n $city = $user['city'];\n $state = $user['state'];\n $postcode = $user['postcode'];\n $country = $user['country'];\n $phone = $user['phone'];\n \n $result = false;\n \n if (isset($_POST['submit'])) {\n $firstName = $_POST['firstName'];\n $lastName = $_POST['lastName'];\n $email = $_POST['email'];\n $password = md5($_POST['password']);\n $birth = $_POST['birth'];\n $company = $_POST['company'];\n $address = $_POST['address'];\n $city = $_POST['city'];\n $state = $_POST['state'];\n $postcode = $_POST['postcode'];\n $country = $_POST['country'];\n $info = $_POST['info'];\n $phone = $_POST['phone'];\n \n // Flag of errors\n $errors = false;\n\n // Validation the fields\n if (!User::checkFirstName($firstName)) {\n $errors[] = 'First name must be at least 2 characters';\n }\n if (!User::checkLastName($lastName)) {\n $errors[] = 'Last name must be at least 2 characters';\n }\n if (!User::checkEmail($email)) {\n $errors[] = 'Email is wrong';\n }\n if (!User::checkPassword($password)) {\n $errors[] = 'Password must be at least 6 characters';\n }\n if (!User::checkPhone($phone)) {\n $errors[] = 'Phone must be at least 10 characters';\n }\n \n if ($errors == false) {\n // If there are no errors\n // Registrate a new user\n $result = User::update($userId, $firstName, $lastName, $email,\n $password, $birth, $company, $address, $city, \n $state, $postcode, $country, $info, $phone);\n } \n }\n \n require_once(ROOT . '/views/cabinet/edit.php');\n return true;\n }", "function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }", "function editsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\ttry\n\t\t{\n\t\t\n\t\t\tif (!empty($_POST['username'])&& !empty($_POST['firstname']) && !empty( $_POST['role']) && !empty($_POST['email']))\n\t\t\t{\n\t\t\t\t$userId=$_POST['userid'];\n\t\t\t\t$userName=$_POST['username'];\n\t\t\t\t$email=$_POST['email'];\n\t\t\t\n\t\t\t\t$firstname=$_POST['firstname'];\n\t\t\t\t$middlename=$_POST['middlename'];\n\t\t\t\t$lastname=$_POST['lastname'];\n\t\t\t\t$role=$_POST['role'];\n\t\t\t\t$phoneres=$_POST['phoneres'];\n\t\t\t\t$phonecell=$_POST['phonecell'];\n\t\t\t\t$isActive=$_POST['status'];\n\t\t\t\t$isLocked=$_POST['locked'];\n\t\t\t\t$comments=$_POST['comments'];\n\t\t\t\t\n\t\t\t \n\t\t\t\tUserModel::Create()->UpdateUser( $userId, $userName,$email, $firstname, $middlename, $lastname, $role, $phoneres, $phonecell, $isActive, $isLocked, $comments);\n\t\t\t\t\n\t\t\t\t$this->renderWithTemplate('users/editsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t\t$this->viewData['error']= \"Please Enter all the Required Fields and submit\"; \n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t$this->viewData['error']= $ex->getMessage(); \n\t\t\t$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\t\n\t\t\t\n\t}", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "private function editResource($request, $resourceForm, $post, $version, $isLastVersion)\n {\n $coAuthors = null;\n $sendNotif = true;\n if (count($post->getCoAuthors())) {\n $coAuthors = clone $post->getCoAuthors();\n }\n if ($request->isMethod('POST')) {\n if ($resourceForm->handleRequest($request)->isValid()) {\n $em = $this->getOEM();\n $em->getConnection()->beginTransaction();\n $postDate = new \\DateTime();\n $create = true;\n\n $postContent = $post->getContent();\n // Purify HTML Content (remove scripts, onclick, etc.)\n $config = \\HTMLPurifier_Config::createDefault();\n // $config->set('HTML.TargetBlank', true);\n $config->set('Attr.AllowedFrameTargets', array('_blank'));\n $config->set('HTML.SafeIframe', true);\n $config->set('URI.SafeIframeRegexp', '%^(http:|https:)?//(www.youtube.com/embed/|player.vimeo.com/video/|www.flickr.com/services/oembed|www.hulu.com/embed|www.google.com/maps/embed|www.dailymotion.com/embed|w.soundcloud.com/player|www.slideshare.net|prezi.com|webtv.ac-versailles.fr|scolawebtv.crdp-versailles.fr|www.audio-lingua.eu|www.xmind.net)%');\n $config->set('Cache.SerializerPermissions', 0775);\n $config->set('Cache.SerializerPath', $this->get('kernel')->getCacheDir().'/htmlpurifier');\n $purifier = new \\HTMLPurifier($config);\n $cleanPostContent = $purifier->purify($postContent);\n\n // User\n $user = $this->getUser();\n\n // Post\n $post\n ->setContent($cleanPostContent)\n ->setStatus($resourceForm->get('submit_draft')->isClicked() ? PostVersion::STATUS_DRAFTING : PostVersion::STATUS_PUBLISHED);\n // reset coauthor if not author of post\n if ($user != $post->getAuthor()) {\n foreach ($coAuthors as $coAuthor) {\n $post->addCoAuthor($coAuthor);\n }\n }\n\n // New version or current ( current if last edit done less than 30 min ago)\n $recentUpdate = ($postDate->getTimestamp() - $version->getUpdateDate()->getTimestamp()) <= 1800;\n if ($isLastVersion && $recentUpdate && $version->getAuthor() == $user) {\n $postVersion = $version;\n $create = false;\n $sendNotif = false;\n } else {\n $postVersion = $this->createObject('post_version');\n }\n $postVersion\n ->setAuthor($user)\n ->setStatus($post->getStatus())\n ->setName($post->getName())\n ->setContent($cleanPostContent)\n ->setUpdateDate($postDate)\n ->setPost($post)\n ;\n\n if ($create) {\n $postVersion->setCreateDate($postDate);\n }\n\n // Group\n $group = false;\n $type = $resourceForm->get('where')->getData();\n\n switch ($type) {\n case Post::TYPE_WALL:\n $post\n ->setType(Post::TYPE_WALL)\n// ->setTargetUser($user)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n break;\n\n case Post::TYPE_EDITOR:\n if (null !== $editor = $user->getEditor()) {\n $editor->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor($editor)\n ;\n } else {\n return $this->redirect($this->generateUrl('publish_publications'));\n }\n break;\n\n case Post::TYPE_BLOG:\n if (null !== $blog = $user->getBlog()) {\n $blog->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog($blog)\n ->setPublishedEditor(null)\n ;\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n case Post::TYPE_GROUP:\n if (null !== $group = $post->getPublishedGroup()) {\n $post\n ->setType(Post::TYPE_GROUP)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n $group->addPost($post);\n $this->persist($group);\n\n $this->get('rpe.logs')->create($user, Log::TYPE_POST_RESOURCE, $user, $group);\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n default:\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n\n // MEDIAS\n // if (!$create) {\n // foreach ($postVersion->getMedias() as $media) {\n // $postVersion->removeMedia($media);\n // }\n // }\n\n foreach ($post->getMedias() as $media) {\n // Post\n $media\n ->setUser($user)\n ->setType(RpeMedia::TYPE_POST)\n ->setDate($postDate)\n // ->setDescription($post->getName())\n ;\n\n if (false === $media->getPosts()->contains($post)) {\n $media->addPost($post);\n // Version\n }\n $media->addPostVersion($postVersion);\n if (false === $user->getMedias()->contains($media)) {\n $user->addMedia($media);\n }\n };\n\n // Medias added from Library\n $libraryMedias = array_unique($resourceForm->get('library_medias')->getData());\n $userLibraryMedias = $user->getMediasFromIDs($libraryMedias);\n\n foreach ($userLibraryMedias as $media) {\n $media\n ->addPost($post)\n ->addPostVersion($postVersion)\n ;\n };\n\n $post->setUpdateDate($postDate);\n\n if ($post->isCollaborative()) {\n // close or re-open pad editing\n if ($resourceForm->get('pad_close')->getData() or true) {\n // Send \"close\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_CLOSE, $user, $post);\n } elseif ($padOldStatus = $post->getMeta('pad_is_closed')) {\n if ($padOldStatus->getValue()) {\n // Send \"re-open\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_REOPEN, $user, $post);\n }\n }\n $this->setPostMeta($post, 'pad_is_closed', $resourceForm->get('pad_close')->getData(), 'etherpad');\n }\n\n // Persis & Flush\n $this->persist($user, $post, $postVersion)->flush();\n\n // check media quota\n $user_quota = $user->getDiskQuota();\n foreach ($post->getMedias() as $media) {\n $check_media = $this->checkMediaSize($media, $user_quota);\n if ($check_media === false) {\n $em->getConnection()->rollback();\n return false;\n } else {\n $user_quota += $check_media;\n }\n }\n $this->setUserMeta($user, User::META_MEDIA_DISK_QUOTA, $user_quota);\n $em->getConnection()->commit();\n\n if (false === $resourceForm->get('submit_draft')->isClicked() && $create && $sendNotif) {\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_EDIT, $user, $post);\n }\n return $this->redirect($this->generateUrl('publication', array('id' => $post->getId())));\n\n } else {\n throw new \\RuntimeException('Form is not valid...');\n }\n }\n return false;\n }", "public function editAction()\n {\n\n $id = $this->params()->fromRoute('id');\n $viewModel = new ViewModel(['title' => 'edit a user','id' => $id]);\n $entity = $this->params()->fromRoute('entity', 'user');\n /** @var InterpretersOffice\\Entity\\Repository\\UserRepository $repo */\n $repo = $this->entityManager->getRepository('InterpretersOffice\\Entity\\User');\n $user = $repo->getUser($id, $entity);\n if (! $user) {\n return $viewModel->setVariables(['errorMessage' =>\n \"user with id $id was not found in your database.\"]);\n }\n $this->getEventManager()->trigger('load-user', $this, ['user' => $user,]);\n $form = new UserForm($this->entityManager, [\n 'action' => 'update',\n 'auth_user_role' => $this->auth_user_role,\n 'user' => $user,'constrain_email' => true,\n ]);\n /** @var $person \\InterpretersOffice\\Entity\\Person */\n $person = $user->getPerson();\n\n /** @todo do this initialization somewhere else? */\n $form->get('user')->get('person')->setObject($person);\n /* -------------------------- */\n $viewModel->form = $form;\n $has_related_entities = $this->entityManager\n ->getRepository(Entity\\Person::class)\n ->hasRelatedEntities($person->getId());\n $viewModel->has_related_entities = $has_related_entities;\n\n if ($has_related_entities) {\n $user_input = $form->getInputFilter()->get('user');\n $user_input->get('person')->get('hat')->setRequired(false);\n $user_input->get('role')->setRequired(false);\n }\n $form->bind($user);\n $request = $this->getRequest();\n if ($request->isPost()) {\n $was_disabled = ! $user->isActive();\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n // if they re-enabled the account\n if ($was_disabled && $user->isActive()) {\n $user->setFailedLogins(0);\n }\n $this->entityManager->flush();\n $this->flashMessenger()\n ->addSuccessMessage(sprintf(\n 'The user account for <strong>%s %s</strong> has been updated.',\n $person->getFirstname(),\n $person->getLastname()\n ));\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "private function editAccount()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n //country\n if(!isset($request['country']) || $request['country']==\"\")\n throw_error_msg(\"provide country\");\n\n //sex\n if(!isset($request['sex']) || $request['sex']==\"\")\n throw_error_msg(\"provide sex\");\n\n if(!in_array($request['sex'], array('male','female')))\n throw_error_msg(\"sex must be male/female\");\n\n //dob\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n $is_valid_date = DateTime::createFromFormat('Y-m-d', $request['dob']);\n\n if(!$is_valid_date)\n throw_error_msg(\"dob must be in Y-m-d like 1990-11-18 format\");\n\n if(!isset($request['category']) || $request['category']==\"\")\n throw_error_msg(\"provide category\");\n\n $request['userid'] = userid();\n $userquery->update_user($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($request['userid']);\n \n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function edit_postAction() {\n $info = $this->getPost(array('uid', 'groupid', 'password', 'r_password', 'status'));\n if ($info['password']) {\n //if ($info['password'] == '') $this->output(-1, '密码不能为空.');\n if (strlen($info['password']) < 5 || strlen($info['password']) > 16) $this->output(-1, '用户密码长度5-16位之间');\n if ($info['password'] !== $info['r_password']) $this->output(-1, '两次密码输入不一致');\n }else {\n unset($info['password']);\n }\n $ret = Admin_Service_User::updateUser($info, intval($info['uid']));\n if (!$ret) $this->output(-1, '更新用户失败');\n $this->output(0, '更新用户成功.');\n }", "function wp_editUser( $args ) {\n\n global $wp_xmlrpc_server, $wp_roles;\n $wp_xmlrpc_server->escape( $args );\n\n $blog_ID = (int) $args[0];\n $user_ID = (int) $args[1];\n $username = $args[2];\n $password = $args[3];\n $content_struct = $args[4];\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n $user_info = get_userdata( $user_ID );\n\n if( ! $user_info )\n return new IXR_Error(404, __('Invalid user ID'));\n\n if( ! ( $user_ID == $user->ID || current_user_can( 'edit_users' ) ) )\n return new IXR_Error(401, __('Sorry, you cannot edit this user.'));\n\n // holds data of the user\n $user_data = array();\n $user_data['ID'] = $user_ID;\n\n if ( isset( $content_struct['user_login'] ) )\n return new IXR_Error(401, __('Username cannot be changed'));\n\n if ( isset( $content_struct['user_email'] ) ) {\n\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'Email id is not valid' ) );\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n $user_data['user_email'] = $content_struct['user_email'];\n \n }\n\n if( isset ( $content_struct['role'] ) ) {\n\n if ( ! current_user_can( 'edit_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to change roles for this user' ) );\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( !array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n // only set the user details if it was given\n if ( isset( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n if ( isset( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n if ( isset( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n if ( isset( $content_struct['nickname'] ) )\n $user_data['nickname'] = $content_struct['nickname'];\n\n if ( isset( $content_struct['user_nicename'] ) )\n $user_data['user_nicename'] = $content_struct['user_nicename'];\n\n if ( isset( $content_struct['description'] ) )\n $user_data['description'] = $content_struct['description'];\n\n if( isset ( $content_struct['usercontacts'] ) ) {\n\n $user_contacts = _wp_get_user_contactmethods( $user_data );\n foreach( $content_struct['usercontacts'] as $key => $value ) {\n\n if( ! array_key_exists( $key, $user_contacts ) )\n return new IXR_Error( 401, __( 'One of the contact method specified is not valid' ) );\n $user_data[ $key ] = $value;\n\n }\n\n }\n\n if( isset ( $content_struct['user_pass'] ) )\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n $result = wp_update_user( $user_data );\n\n if ( is_wp_error( $result ) )\n return new IXR_Error( 500, $result->get_error_message() );\n\n if ( ! $result )\n return new IXR_Error( 500, __( 'Sorry, the user cannot be updated. Something wrong happened.' ) );\n\n return $result;\n \n}", "public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}", "public function edit_post($user_id)\n {\n $auth_token = $this->post('auth_token');\n //$user_id = $this->post('user_id');\n $userData['fname'] = $this->post('fname');\n $userData['lname'] = $this->post('lname');\n $userData['dob'] = $this->post('dob');\n $userData['gender'] = $this->post('gender'); /* Male/Female */\n $userData['address'] = $this->post('address');\n $userData['contact_no'] = $this->post('contact_no');\n $userData['about'] = $this->post('about');\n $userData['updated_date']= time();\n \n //checking auth token\n $record = $this->artists_model->is_valid_token($user_id,$auth_token);\n if($record == 0){\n //redirect to login\n $this->response([\n 'status' => FALSE,\n 'message' => 'Unauthorize user,please login again',\n 'status_code' => 401\n ], REST_Controller::HTTP_UNAUTHORIZED); // UNAUTHORIZED (401) being the HTTP response code\n }\n \n \n \n if( $user_id != '' && $userData['fname'] != '' && $userData['lname'] != '' && $userData['dob'] != '' && $userData['gender'] != '' \n && $userData['address'] != '' && $userData['contact_no'] != '' && $userData['about'] != '')\n {\n $record = $this->artists_model->update_user($user_id,$userData);\n $user_data = $this->artists_model->get_user_details($user_id);\n $message = [\n 'status' => TRUE,\n 'message' => 'User information updated successfully',\n 'user_data' => $user_data,\n 'status_code'=> 200 \n ];\n $this->set_response($message, REST_Controller::HTTP_OK);\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'User information not updated,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n }\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}", "public function testEditPostBadDataForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t\t'data' => [\n\t\t\t\t'BAD_MODEL' => []\n\t\t\t]\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'2'\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('The deferred save not be saved. Please, try again.'));\n\t\t}\n\t}", "public function postUserupdate(){\n \n $uid = Input::get('user_id');\n $user = User::find($uid);\n if($user != ''){\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->category = Input::get('category');\n $user->language = Input::get('language');\n $user->enable = Input::get('enable');\n $user->save();\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'User data updated!');\n }else{\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'No such user!');\n }\n\n }", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function edituserActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n // Retrieves contentId\n $username = getPost(\"username\");\n\n if (hasKeyPost(\"doDelete\")) {\n return $this->app->response->redirect(\"admin/deleteuser&username=$username\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $params = getPost([\n \"firstname\",\n \"lastname\",\n \"email\",\n \"password\",\n \"username\"\n ]);\n\n // Calls editUser method\n $this->admin->editUser($params);\n\n // Redirects\n return $this->app->response->redirect(\"admin/users\");\n }\n }", "function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $editedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $id );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $editedUser->getRole(),\n ));\n\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()->phone,\n 'birthDate' => $request->getPost()->birthDate,\n 'height' => $request->getPost()->height,\n 'tmrModifier' => $request->getPost()->tmrModifier,\n 'goalWeight' => $request->getPost()->goalWeight,\n 'personality' => $request->getPost()->personality,\n 'activityLevel' => $request->getPost()->activityLevel,\n 'isFemale' => $request->getPost()->isFemale,\n 'status' => $request->getPost()->status,\n 'role' => $request->getPost()->role,\n );\n\n if($request->getPost()->password!='')\n {\n $data['password'] = $request->getPost()->password;\n }\n\n $form->setData($data);\n\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n if($request->getPost()->password!='')\n {\n $user->setPassword($request->getPost()->password);\n }\n\n $userFromEmail = $entityManager\n ->getRepository('Core\\Entity\\User')\n ->findOneBy(array('email' => $user->getEmail()));\n\n if($userFromEmail==null || $userFromEmail->getId()==$user->getId())\n {\n $entityManager->persist($user);\n $entityManager->flush();\n\n $this->flashMessenger()->addSuccessMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User has been modified.\")\n );\n\n if( $id)\n {\n return $this->redirect()->toRoute(\n 'panel/user/:id', array('id' => $id)\n );\n }\n else\n {\n return $this->redirect()->toRoute('panel/user');\n }\n }\n else\n {\n $form->setData($request->getPost());\n\n $this->flashMessenger()->addErrorMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User hasn't been modified. E-mail already exists.\")\n );\n }\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('user', $form->getObject());\n $view->setVariable('form', $form);\n\n return $view;\n }", "function update ( $post ) {\n if ( !isset($post['id']) || !User::exists($post['id']) ) {\n \t$_SESSION['fail'] = \"You must select a user\";\n \theader( 'Location: index.php?action=index');\n \texit;\n }\n \n // get the existing user\n $user = User::find( 'first', $post['id']);\n \n // update the values\n $user->first_name = $post['first_name'];\n $user->last_name = $post['last_name'];\n $user->email = $post['email'];\n \n // if the password has been set\n if ( !empty($post['password'])) {\n \t$user->password = $post['password'];\n \t$user->confirm_password = $post['confirm_password'];\n }\n \n \n $user->role = $post['role'];\n \n //save the user\n $user->save(false);\n \n // check if save method\n if ($user->is_invalid()) {\n \t// set the massage\n \t$_SESSION['fail'][] = $user->error->full_messagr();\n \t$_SESSION['fail'][] = 'The user could not be updated.';\n \t\n \t// redirect\n \theader( 'Location: index.php?action=edit&id=' . $user->id);\n \texit;\n }\n \n // refresh session (when login user and updated user are same user)\n if ($user->id == $_SESSION['id']) {\n \t$_SESSION['role'] = $user->role;\n \t$_SESSION['email'] = $user->email;\n }\n \n // set the success message and redirect\n $_SESSION['success'] = 'User was updated successfully.';\n header('Location: index.php?action=index');\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function actionEditUser($templateVars) {\n\n\t$currentProperty = propertiesGetCurrent();\n\t$currentDivision = divisionsGetCurrent();\n\t$currentDepartment = departmentsGetCurrent();\n\t$currentUser = usersGetCurrent();\n\t\n\tif(!empty($_POST) && isset($_POST['editPropertyForm'])) {\n\t\t\n\t\t$validForm = true;\n\n\t\t$currentUser['firstname'] = $_POST['firstname'];\n\t\tif(empty($currentUser['firstname'])) {\n\t\t\t$templateVars['userFirstnameError'] = 'Please enter a first name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['lastname'] = $_POST['lastname'];\n\t\tif(empty($currentUser['lastname'])) {\n\t\t\t$templateVars['userLastnameError'] = 'Please enter a last name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['email'] = $_POST['emailname'];\n\t\tif(empty($currentUser['email'])) {\n\t\t\t$templateVars['userEmailError'] = 'Please enter an email for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\tif($validForm == true) {\n\t\t\t$property['name'] = $newPropertyName;\n\t\t\tpropertiesUpdateRecord($property);\n\t\t\tredirectToPage('settings/properties/listing');\n\t\t}\n\t}\n\n\t$templateVars['accessLevels'] = accessLevelsGetAll();\n\t$templateVars['currentProperty'] = $currentProperty;\n\t$templateVars['currentDivision'] = $currentDivision;\n\t$templateVars['currentDepartment'] = $currentDepartment;\n\t$templateVars['currentUser'] = $currentUser;\n\n\treturn $templateVars;\n}", "public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }", "function editUser()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->library('form_validation');\n \n $userId = $this->input->post('userId');\n \n $this->form_validation->set_rules('fname','Full Name','trim|required|max_length[128]');\n $this->form_validation->set_rules('email','Email','trim|required|valid_email|max_length[128]');\n $this->form_validation->set_rules('password','Password','matches[cpassword]|max_length[20]');\n $this->form_validation->set_rules('cpassword','Confirm Password','matches[password]|max_length[20]');\n $this->form_validation->set_rules('role','Role','trim|required|numeric');\n $this->form_validation->set_rules('mobile','Mobile Number','required|min_length[10]');\n \n if($this->form_validation->run() == FALSE)\n {\n $this->editOld($userId);\n }\n else\n {\n $name = ucwords(strtolower($this->security->xss_clean($this->input->post('fname'))));\n $email = $this->security->xss_clean($this->input->post('email'));\n $password = $this->input->post('password');\n $roleId = $this->input->post('role');\n $mobile = $this->security->xss_clean($this->input->post('mobile'));\n \n $userInfo = array();\n \n if(empty($password))\n {\n $userInfo = array('email'=>$email, 'roleId'=>$roleId, 'name'=>$name,\n 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n }\n else\n {\n $userInfo = array('email'=>$email, 'password'=>getHashedPassword($password), 'roleId'=>$roleId,\n 'name'=>ucwords($name), 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, \n 'updatedDtm'=>date('Y-m-d H:i:s'));\n }\n \n $result = $this->user_model->editUser($userInfo, $userId);\n \n if($result == true)\n {\n $this->session->set_flashdata('success', 'User updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'User updation failed');\n }\n \n redirect('userListing');\n }\n }\n }", "public function edit($id = false){\n\t\tif(!empty($id)){\n\t\t\t$selectDataByID = $this->_model->selectDataByID($id);\n\t\t\tif(isset($selectDataByID[0]['id']) && !empty($selectDataByID[0]['id'])){\n $this->_view->stored_data = $selectDataByID[0];\n if(isset($_POST['is_active']) && ($_POST['is_active'] == 1 || $_POST['is_active'] == 0)){\n $this->_view->stored_data['is_active'] = $_POST['is_active'];\n }\n\t\t\t}else{\n $this->_view->flash[] = \"No Users matches this id\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\t\tUrl::redirect('users/');\n\t\t\t}\n\t\t}else{\n $this->_view->flash[] = \"No ID was provided\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\tUrl::redirect('users/');\n\t\t}\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Edit User', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Edit User';\n\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST['save'])){\n $_POST['id'] = $id;\n $_POST['salt'] = $selectDataByID[0]['salt'];\n $_POST['user_pass'] = $selectDataByID[0]['password'];\n $_POST['stored_user_email'] = $selectDataByID[0]['email'];\n\n // Update user details\n $updateData = $this->_model->updateData($_POST);\n\n if(isset($updateData['error']) && $updateData['error'] != null){\n foreach($updateData['error'] as $key => $error) {\n $this->_view->error[$key] = $error;\n }\n } else {\n $this->_view->flash[] = \"User updated successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/');\n }\n\t\t}\n\n\t\tif(!empty($_POST['cancel'])){\n\t\t\tUrl::redirect('users/');\n\t\t}\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "function edit($iAccountNo=0) {\n\n\n\t\t$this->authentication->is_admin_logged_in(true);\n\n\t\tif( !$this->mcontents['oUser'] = $this->user_model->getUserBy('account_no', $iAccountNo) ) {\n\n\t\t\tsf('error_message', 'Invalid user');\n\t\t\tredirect('user/listing');\n\n\t\t}\n\n\t\tisAdminSection();\n\n\t\t$this->mcontents['page_heading'] = $this->mcontents['page_title'] = 'Edit User';\n\t\t$this->mcontents['aExistingRoles'] = getUserRoles( $this->mcontents['oUser']->account_no );\n\n\t\tif ( isset($_POST) && !empty($_POST)) {\n\n\n\t\t\t$this->form_validation->set_rules('status', 'Status', 'trim|required');\n\t\t\t//$this->form_validation->set_rules('user_roles','User Roles', '');\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$aData = array(\n\t\t\t\t\t\t\t'email_id' => safeText('email_id'),\n\t\t\t\t\t\t\t'status' => safeText('status'),\n\t\t\t\t\t\t\t'gender' => safeText('gender'),\n\t\t\t\t\t\t);\n\n\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t$this->db->update('users', $aData);\n\n\t\t\t\t//update roles.\n\t\t\t\t$aRoles \t\t\t= array_trim( safeText('user_roles') );\n\n\t\t\t\t$aDeletedRoles \t= array_diff($this->mcontents['aExistingRoles'], $aRoles);\n\t\t\t\t$aNewRoles \t\t= array_diff($aRoles, $this->mcontents['aExistingRoles']);\n\n\n\t\t\t\t//echo 'EXISTING : ';p( $this->mcontents['aExistingRoles']);\n\t\t\t\t//echo 'DELETED : ';p( $aDeletedRoles );\n\t\t\t\t//echo 'NEW : ';p( $aNewRoles );\n\n\t\t\t\t//p($aNewRoles);\n\t\t\t\t$this->_createRoles($aNewRoles, $this->mcontents['oUser']->account_no);\n\t\t\t\t$this->_deleteRoles($aDeletedRoles, $this->mcontents['oUser']->account_no);\n\n\t\t\t\tsf('success_message', 'The user data has been updated');\n\t\t\t\tredirect('user/edit/'.$iAccountNo);\n\n\t\t\t}\n\t\t}\n\n\t\t//p($this->mcontents['aExistingRoles']);\n\n\t\t$this->mcontents['aUserRolesTitles'] \t= $this->config->item('user_roles_title');\n\t\t$this->mcontents['iTotalNumRoles'] \t\t= count( $this->mcontents['aUserRolesTitles'] );\n\t\t$this->mcontents['aUserStatusFlipped'] \t= array_flip( $this->config->item('user_status') );\n\t\t$this->mcontents['iAccountNo'] \t\t\t= $iAccountNo;\n\n\t\tloadAdminTemplate('user/edit');\n\t}", "public function editAction()\n {\n // Check logged\n $userId = UserModel::checkLogged();\n \n //We get user data\n $user = UserModel::getUserById($userId);\n \n \n $name = $user['name'];\n \n \n $result = false;\n \n // Form processing\n if (isset($_POST['submit'])) {\n \n // Getting data from the form\n $name = $_POST['name'];\n $password = $_POST['password'];\n \n \n // Form error flag\n $errors = false;\n \n // If necessary, you can validate the values as needed\n if (!UserModel::checkName($name)) {\n $errors[] = 'The name must not be shorter than 2 characters';\n }\n \n if (!UserModel::checkPassword($password)) {\n $errors[] = 'Password must not be shorter than 6 characters';\n }\n \n if ($errors == false) {\n $result = UserModel::edit($userId, $name, $password);\n }\n }\n \n // Connect the view\n $this->view('header.tpl');\n $this->view('view.tpl', ['user' => $user,\n 'result' => $result]\n );\n $this->view('footer.tpl');\n \n return true;\n }", "public function edit($userId = null, $postData = null) {\n\t\t$user = $this->getUserForEditing($userId);\n\t\t$this->set($user);\n\t\tif (empty($user)) {\n\t\t\tthrow new NotFoundException(__d('users', 'Invalid User'));\n\t\t}\n\n\t\tif (!empty($postData)) {\n\t\t\t$this->set($postData);\n\t\t\t$result = $this->save(null, true);\n\t\t\tif ($result) {\n\t\t\t\t$this->data = $result;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn $postData;\n\t\t\t}\n\t\t}\n\t}", "function user_action_user_edit($env, $vars) {\n $response_json = UserFactory::requestAction($env, $vars['data']['action'], $vars['data']);\n exit($response_json);\n}", "public function edit($id = false){\n\t\tif(!empty($id)){\n\t\t\t$selectDataByID = $this->_model->selectDataByID($id);\n\t\t\tif(isset($selectDataByID[0]['id']) && !empty($selectDataByID[0]['id'])){\n $this->_view->stored_data = $selectDataByID[0];\n if(isset($_POST['is_active']) && ($_POST['is_active'] == 1 || $_POST['is_active'] == 0)){\n $this->_view->stored_data['is_active'] = $_POST['is_active'];\n }\n\t\t\t}else{\n $this->_view->flash[] = \"No Users matches this id\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\t\tUrl::redirect('backoffice/users/');\n\t\t\t}\n\t\t}else{\n $this->_view->flash[] = \"No ID was provided\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\tUrl::redirect('backoffice/users/');\n\t\t}\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Edit User', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST['save'])){\n $_POST['id'] = $id;\n $_POST['salt'] = $selectDataByID[0]['salt'];\n $_POST['user_pass'] = $selectDataByID[0]['password'];\n $_POST['stored_user_email'] = $selectDataByID[0]['email'];\n\n if(!isset($_FILES) || $_FILES['image']['name'] == null) {\n $_POST['image'][0] = $this->_view->stored_data['logo_image'];\n }else{\n //calls function that moves resourced documents\n $this->uploadFile($_FILES);\n }\n\n // Update user details\n $updateData = $this->_model->updateData($_POST);\n\n if(isset($updateData['error']) && $updateData['error'] != null){\n foreach($updateData['error'] as $key => $error) {\n $this->_view->error[$key] = $error;\n }\n } else {\n \tif (isset($_FILES) && $_FILES['image']['name'] != null) {\n //remove old file\n unlink(ROOT . UPLOAD_DIR . '/' . $this->_view->stored_data['logo_image']);\n }\n $this->_view->flash[] = \"User updated successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\n\t\tif(!empty($_POST['cancel'])){\n\t\t\tUrl::redirect('backoffice/users/');\n\t\t}\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "public function updateProfile(){\n\n\t\t$user_id = Auth::user()->get()->id;\n\t\t$user = User::with('consultant')->find($user_id);\n\t\t\n\t\t$consultant = Consultant::find(Auth::user()->get()->id);\n\t\t$website_url = $consultant['website_url'];\n\n\t\t$user_name = $consultant['other_names'];\n\t\t$user_surname = $consultant['surname'];\n\t\n\t\t$post_data = Input::all();\n\n\t\t$nationalities = Input::get('nationality');\n\t\t\n\t\t$skills = Input::get('skill', array());\n\t\t$specializations = Input::get('specialization',array());\n\t\t$worked_countries = Input::get('country_worked',array());\n\t\t$consultant_agencies = Input::get('consultant_agencies',array());\n\t\t$languages = $post_data['languages']['languages'];\n\n\t\t$rules = Consultant::editRules();\n\n\t\tif ($consultant->resume == null) {\n\t\t\tif (!Input::hasFile('resume')) {\n\t\t\t\t$rules['linkedin_url'] = 'url|required_without_all:resume,website_url';\n\t\t\t\t$rules['website_url'] = 'url|required_without_all:resume,linkedin_url';\n\t\t\t}\n\t\t\t$rules['resume'] = 'mimes:doc,docx,txt,pdf|max:1024|extension:txt,doc,docx,pdf|required_without_all:linkedin_url,website_url';\n\t\t}\n\n\t\t$validation = Validator::make($post_data, $rules,Consultant::$messages);\n\n\t\tif ($validation->passes()){\n\n\t\t\t$old_resume = $consultant->resume;\n\n\t\t\t$consultant->fill(Input::except('resume','terms_conditions','email'));\n\t\t\t\n\t\t\tif(Input::hasFile('resume')){\n\n\t \t$destinationPath = public_path().'/upload/resume/';\n\n\t \tif($old_resume != \"\"){\n\t \t\t$resume_to_delete = $destinationPath . $old_resume;\n\t \t\t@unlink($resume_to_delete);\n\t \t}\n\n\t $file = Input::file('resume');\n\t \n\t $extension = $file->getClientOriginalExtension();\n\t $user_fullname = $user_name.\" \".$user_surname;\n\t \t$user_fullname = $user_name.\" \".$user_surname;\n\t\t\t\t$file_name = Str::slug($user_fullname,'_');\n\t $doc_name = $file_name.'.'.$extension;\n\n\t $file->move($destinationPath,$doc_name);\n\t \n\t $consultant->resume = $doc_name;\n\t\t\t}\n\t\t\t$consultant->save();\n\n\t\t\tif($languages)\n\t\t\t{\n\n\t\t\t\tConsultantLanguage::where('consultant_id', $user_id)->delete();\n\t\t\t\tforeach ($languages as $key => $language) \n\t\t\t\t{\n\t\t\t\t\tif($language['language'] != \"\"){\n\n\t\t\t\t\t\t$consultant_language = new ConsultantLanguage();\n\t\t\t\t\t\t$consultant_language->consultant_id = $user->id;\n\t\t\t\t\t\t$consultant_language->language_id = $language['language'];\n\t\t\t\t\t\t// $consultant_language->language_level = $language['lang_level'];\n\t\t\t\t\t\t$consultant_language->speaking_level = $language['speaking_level'];\n\t\t\t\t\t\t$consultant_language->reading_level = $language['reading_level'];\n\t\t\t\t\t\t$consultant_language->writing_level = $language['writing_level'];\n\t\t\t\t\t\t$consultant_language->understanding_level = $language['understanding_level'];\n\t\t\t\t\t\t$consultant_language->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$nationality_list = array();\n\t\t\t\n\t\t\tif( count($nationalities) > 0 ){\n\n\t\t\t\tforeach ($nationalities as $nationality_id) {\n\t\t\t\t\t$nationality['country_id'] = $nationality_id;\n\t\t\t\t\tarray_push($nationality_list, $nationality);\n\t\t\t\t}\n\n\t\t\t\tConsultantNationality::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantNationality()->createMany($nationality_list);\n\t\n\t\t\t}\n\t\t\t\n\t\t\t$skill_list = array();\n\t\t\t\n\t\t\tif( count($skills) > 0 ){\n\n\t\t\t\tforeach ($skills as $skill_id) {\n\t\t\t\t\t$skill['skill_id'] = $skill_id;\n\t\t\t\t\tarray_push($skill_list, $skill);\n\t\t\t\t}\n\n\t\t\t\tConsultantSkill::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSkill()->createMany($skill_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$specialization_list = array();\n\t\t\t\n\t\t\tif( count($specializations) > 0 ){\n\n\t\t\t\tforeach ($specializations as $specialization_id) {\n\t\t\t\t\t$specialization['specialization_id'] = $specialization_id;\n\t\t\t\t\tarray_push($specialization_list, $specialization);\n\t\t\t\t}\n\n\t\t\t\tConsultantSpecialization::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSpecialization()->createMany($specialization_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$worked_country_list = array();\n\t\t\t\n\t\t\tif( count($worked_countries) > 0 ){\n\n\t\t\t\tforeach ($worked_countries as $worked_country_id) {\n\t\t\t\t\t$worked_country['country_id'] = $worked_country_id;\n\t\t\t\t\tarray_push($worked_country_list, $worked_country);\n\t\t\t\t}\n\t\t\t\tConsultantWorkedCountry::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantWorkedCountry()->createMany($worked_country_list);\n\t\t\t}\n\n\t\t\t$consultant_agency_list = array();\n\t\t\t\n\t\t\tif( count($consultant_agencies) > 0 ){\n\n\t\t\t\tforeach ($consultant_agencies as $consultant_agency_id) {\n\t\t\t\t\t$consultant_agency['agency_id'] = $consultant_agency_id;\n\t\t\t\t\tarray_push($consultant_agency_list, $consultant_agency);\n\t\t\t\t}\n\t\t\t\tConsultantAgency::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantAgencies()->createMany($consultant_agency_list);\n\t\t\t}\n\n\t\t\treturn Redirect::route('user.profile')->with('message', 'You have successfully updated your profile')\n\t\t\t\t\t\t\t\t ->with('message_type', 'success');\n\t\t }else{\n\n\t\t\t\t$errors = $validation->errors()->toArray();\n\t\t\t\t// echo \"<pre>\";\n\t\t\t\t// print_r($errors);exit;\n\t\t\t\treturn Redirect::back()\n\t\t\t\t->withInput(Input::all())\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->with('message', 'Some required field(s) have been left blank. Please correct the error(s)!')\n\t\t\t\t->with('message_type', 'danger');\n\t\t}\n\t}", "public function actionUpdate()\n\t{\n\t if (!Yii::app()->user->checkAccess('admin')){\n\t\t\treturn $this->actionView();\n\t }\n\t\t$this->model = DrcUser::loadModel();\n\t\tif($this->model===null)\n\t\t\tthrow new CHttpException(404,'The requested user does not exist.');\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '../drcUser/_edit',\n\t\t\t'contentTitle' => 'Update User Data',\n\t\t\t'createNew'=>false,\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'action'=>Yii::app()->createUrl(\"user/save\", array('username'=>$this->model->username)),\n\t\t));\n\t}", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }", "public function testPostUpdateUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => 'crynobone@gmail.com',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$response = $this->call('orchestra::users@view', array($user->id), 'POST', array(\n\t\t\t'id' => $user->id,\n\t\t\t'email' => 'crynobone@gmail.com',\n\t\t\t'fullname' => 'crynobone',\n\t\t\t'password' => '345678',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$updated_user = Orchestra\\Model\\User::find($user->id);\n\n\t\t$this->assertEquals('crynobone@gmail.com', $updated_user->email);\n\t\t$this->assertEquals('crynobone', $updated_user->fullname);\n\t\t$this->assertTrue(Hash::check('345678', $updated_user->password));\n\n\t\t$updated_user->delete();\n\t}", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "public function editUser($id=0){\n\t if(Input::isMethod('post')){\n\t\t\t$rules = array(\n\t\t\t'first_name' \t=> 'required',\n\t\t\t'last_name' \t\t=> 'required',\n\t\t\t'username' \t=> 'required',\n\t\t\t'email' \t\t=> 'required|email|unique:users,id',\n\t\t\t'phone' \t\t\t=> 'required',\n\t\t\t);\n\t\t$validator = Validator::make(Input::all(),$rules);\n\t\t if ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t } else {\n\t\t\t\t\t\t\tif(Input::file('image')){\n\t\t\t\t\t\t\t\t$image \t\t\t\t\t= \tInput::file('image');\n\t\t\t\t\t\t\t\t$filename \t\t\t= \ttime() . '_'.$image->getClientOriginalName();\n\t\t\t\t\t\t\t\t$path \t\t\t\t\t= \tpublic_path('uploads/users/' . $filename);\n\t\t\t\t\t\t\t\t$path2 \t\t\t\t\t= \tpublic_path('uploads/users/50x50/' . $filename);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize(50,50)->save($path2);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->save($path);\n\t\t\t\t\t\t\t\t\t$x \t\t= \t100;\n\t\t\t\t\t\t\t\t\t$y \t\t= \t100;\n\t\t\t\t\t\t\t\tfor($i=1;$i<6;$i++){\n\t\t\t\t\t\t\t\t\t$path \t=\tpublic_path('uploads/users/'.$x.'x'.$y.'/'. $filename);\n\t\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize($x,$y)->save($path);\n\t\t\t\t\t\t\t\t\t$x = $x+100;\n\t\t\t\t\t\t\t\t\t$y = $y+100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$user\t\t\t=\tAdminUser::GetById($id); // getting user data by id.\n\t\t\t\t\t\t\t\t$filename\t=\t$user->image;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$update_user = AdminUser::UpdateUser($id,$filename); // calls function for update user data.\n\t\t\t\t\t\t\t\tif($update_user){\n\t\t\t\t\t\t\t\t\tSession::flash('flash_success', trans(\"User successfully updated.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tSession::flash('flash_error', trans(\"Technical error while updating user.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t }else{\n\t\t\t\t\t\t$user = AdminUser::GetById($id); // calls function for getting user data by id.\n\t\t\t\t\t\treturn view('admin.pages.users.edit', ['user' => $user]);\n\t }\n\t}", "public function editAction()\n {\n $request = $this->getRequest();\n $pageId = $user_id = $this->_getParam('pageId'); \n /*echo \"<pre>ooo\";\n\t\tprint_r($_POST); die;*/\n $model = new User_Models_UserUser(); \n $rrr = $model->getRecord($pageId); \n $form = new User_Form_UserUser(); \n foreach ($form->getElements() as $value) {\n $nnn = $value->getName();\n $value->setValue($rrr->$nnn);\n }\n $modelInfo = new User_Models_UserInfo();\n $ooo = $modelInfo->getUserInfo($pageId);\n $formInfo = new User_Form_UserInfo();\n $formInfo->removeElement('vip');\n foreach ($formInfo->getElements() as $value) {\n $nnn = $value->getName();\n $value->setValue($ooo->$nnn);\n }\n /*$form->email->addValidator(new Zend_Validate_Db_NoRecordExists(\n array(\n 'table' => 'total_user',\n 'field' => 'email',\n 'exclude' => array(\n 'field' => 'id',\n 'value' => $user_id\n )\n )\n ));*/\t\t\n\t\t$uLogin = $form->login->getValue();\n $form->removeElement('password');\n $form->removeElement('verifypassword');\n $form->removeElement('salt');\n $form->removeElement('creation_date');\n $form->removeElement('login');\n $form->removeElement('manager');\n $form->removeElement('user_hash');\n if ($request->isPost()) {\t\t\t\n if ($form->isValid($request->getPost())) {\n $form->type->setValue($rrr->type);\t\t\t\t\n $model->save($form->getElements(), $pageId);\n $formInfo->removeElement('user_id');\n $formInfo->populate($request->getPost());\n $modelInfo->save($formInfo->getElements(), $ooo->id/*$pageId*/);\n\t\t\t\tif ($_POST['manager_id'] != \"\") {\n\t\t\t\t\t//echo $form->login->getValue(); die;\n\t\t\t\t\t$modelOrder = new Shop_Models_OrderOrder();\n\t\t\t\t\t$orders = $modelOrder->getUserOrders($uLogin);\n\t\t\t\t\tforeach ($orders as $order) {\n\t\t\t\t\t\t$modelOrder->setSmsStatus($order['id']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$accHref = \"?\";\n\t\t\t\tif (isset($_GET['account'])) \n\t\t\t\t\t$accHref .= \"account=\" . $_GET['account'];\n\t\t\t\tif (isset($_GET['page'])) \n\t\t\t\t\t$accHref .= \"&page=\" . $_GET['page'];\n\t\t\t\tif(isset($_POST['_continue'])) {\n\t\t\t\t\t$this->_redirector->gotoActionUrl('/admin/', $pageId . $accHref);\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t$this->_redirect('/admin/user/' . $accHref);\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\n }\n }\n $this->view->module = $this->_getParam('module');\n $this->view->id = $pageId;\n $this->view->elements = $form->getElements();\n $this->view->form = $form;\n $this->view->elementsInfo = $formInfo->getElements();\n }", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "public function edituserAction($id){\n\t\t$user = $this->getUser(); if ($user == '') { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n\t\t$session = $this->get('session');\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$entity = $em->getRepository('LIHotelBundle:Reserva')->find($id);\n\n\t\tif (!$entity) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No existe esta reserva.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\tif ($entity->getCliente()->getId() != $user->getId()) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No tiene permisos para ver las reservas de otros usuarios. Este incidente será reportado.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\t/* VERIFICAR SI NO HA PASADO LA FECHA DE CULMINADO, PORQUE SI NO NO SE PUEDE EDITAR */\n\t\t$dias_reserva = $entity->getDiasReserva() - 1;\n\t\t$fecha_reserva = $entity->getFechaDesde();\n\t\t$fecha_inicio_ = new \\DateTime($fecha_reserva->format('Y-m-d'));\n\t\t$fecha_final_ = new \\DateTime($fecha_inicio_->format('Y-m-d'));\n\t\t$fecha_final_->add(new \\DateInterval('P'.$dias_reserva.'D'));\n\t\t$hoy = new \\DateTime('today');\n\n\t\tif ($hoy > $fecha_final_) {\n\t\t\t$session->getFlashBag()->add('reserva_malos', 'Esta reserva ya ha culminado y no se puede modificar.');\n\t\t\treturn $this->showuserAction($entity->getId());\n\t\t}else{\n\n\t\t\t$editForm = $this->createEditForm($entity);\n\t\t\t$deleteForm = $this->createDeleteForm($id);\n\t\t\t$user = $this->getUser();\n\n\t\t\treturn $this->render('LIHotelBundle:Reserva:edituser.html.twig', array(\n\t\t\t\t'entity' => $entity,\n\t\t\t\t'edit_form' => $editForm->createView(),\n\t\t\t\t'delete_form' => $deleteForm->createView(),\n\t\t\t\t'user' => $user,\n\t\t\t));\n\t\t}\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "function editUser($argArrPost) {\n\n // pre($argArrPost);\n //@extract($argArrPost);\n $objCore = new Core;\n $varName = $argArrPost['frmName'];\n $varEmail = $argArrPost['frmUserEmail'];\n $logisticUserName = addslashes($argArrPost['frmName']);\n $varUserWhere = \" logisticportalid != \" . $argArrPost['frmUserID'] . \" AND ( logisticTitle='\" . $argArrPost['frmTitle'] . \"' OR logisticEmail='\" . $argArrPost['frmUserEmail'] . \"'OR logisticUserName='\" . $argArrPost['frmName'] . \"')\";\n //$varUserWhere = \" logisticTitle='\" . $varName . \"' OR logisticEmail='\" . $argArrPost['frmUserEmail'] . \"'OR logisticUserName='\" . $argArrPost['frmName'] . \"'\";\n $arrClms = array('logisticportalid', 'logisticTitle', 'logisticEmail', 'logisticUserName');\n $arrUserList = $this->select(TABLE_LOGISTICPORTAL, $arrClms, $varUserWhere);\n\n // pre($arrUserList);\n //echo '<pre>';print_r($arrUserList);die;\n if (isset($arrUserList[0]['logisticportalid']) && $arrUserList[0]['logisticportalid'] <> '') {\n\n //pre('here');\n $arrUserName = array();\n $arrUserEmail = array();\n $arrUserNames = array();\n foreach ($arrUserList as $key => $val) {\n if ($val['logisticTitle'] == $varName) {\n $arrUserName[] = $val['logisticTitle'];\n }\n if ($val['logisticEmail'] == $varEmail) {\n $arrUserEmail[] = $val['logisticEmail'];\n }\n if ($val['logisticUserName'] == $logisticUserName) {\n $arrUserNames[] = $val['$logisticUserName'];\n }\n }\n $varCountName = count($arrUserName);\n $varCountEmail = count($arrUserEmail);\n $varCountusername = count($arrUserNames);\n if ($varCountName > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal Company Name Already Exist ');\n return false;\n } else if ($varCountEmail > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal Email Already Exist ');\n return false;\n } else if ($varCountusername > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal User Name Already Exist ');\n return false;\n }\n } else {\n //$varPass = trim($argArrPost['frmPassword']);\n //$varUserPass = $arrUserList[0]['oldPass'];\n if (trim($argArrPost['frmPassword']))\n $varUsersWhere = ' logisticportalid =' . $argArrPost['frmUserID'];\n $arrUser = $this->select(TABLE_LOGISTICPORTAL, array('logisticPassword', 'logisticOldPass'), $varUsersWhere);\n// pre($arrUser);\n\n if ($arrUser[0]['logisticPassword'] == $argArrPost['frmPassword']) {\n $adminPassword = $arrUser[0]['logisticPassword'];\n $adminOldPass = $arrUser[0]['logisticOldPass'];\n $finalPass = '';\n } else {\n $adminPassword = md5(trim($argArrPost['frmPassword']));\n $adminOldPass = $argArrPost['frmPassword'];\n $finalPass = $argArrPost['frmPassword'];\n }\n\n\n\n $arrColumnAdd = array(\n 'logisticTitle' => trim($argArrPost['frmTitle']),\n 'logisticUserName' => trim(stripslashes($argArrPost['frmName'])),\n 'logisticEmail' => trim(stripslashes($argArrPost['frmUserEmail'])),\n 'logisticPassword' => $adminPassword,\n 'logisticportal' => trim($argArrPost['CountryPortalID']),\n 'logisticStatus' => trim($argArrPost['frmStatus']),\n 'logisticOldPass' => $adminOldPass,\n );\n// pre($arrColumnAdd);\n\n $this->update(TABLE_LOGISTICPORTAL, $arrColumnAdd, $varUsersWhere);\n\n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $argArrPost['frmUserEmail'];\n $varFromUser = SITE_EMAIL_ADDRESS;\n $sitelink = SITE_ROOT_URL . 'logistic/';\n $varSubject = SITE_NAME . ':Login Details for Logistic Portal';\n $varBody = '\n \t\t<table width=\"700\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">\n\t\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <td width=\"600\" style=\"padding-left:10px;\">\n\t\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\tWelcome! <br/><br/>\n\t\t\t\t\t\t\t<strong>Dear ' . $varName . ',</strong>\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\tYour Logistic Portal account has been successfully updated with ' . $sitelink . '. \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />Here is your access information:\n\t\t\t\t\t\t\t <br />Username/Email : ' . $varEmail . ' ';\n if (!empty($finalPass)) {\n $varBody .= '<br />Password : ' . $finalPass;\n }\n\n $varBody .= '<br /><br />\n\t\t\t\t\t\t\tIf there is anything that we can do to enhance your Tela Mela experience, please feel free to <a href=\"{CONTACT_US_LINK}\">contact us</a>.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t </p>\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t\t </table>\n \t\t';\n// $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_registration.html');\n// $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n// $varActivationLink = '';\n// $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n// $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($argArrPost['frmPassword']), trim(stripslashes($argArrPost['frmUserEmail'])), 'Country Portal', SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n// $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n\n $objCore->setSuccessMsg(\"Logistic Portal details have been updated successfully.\");\n return true;\n }\n }", "public function editAction()\n\t {\n\t \t$id \t\t\t= (int) $this->getRequest()->getParam('id');\n\t \t$userService \t= new User_Service_User();\n\t \t$user\t\t\t= $userService->read( $id );\n\t \tif( !$user instanceof User_Model_User){\n\t \t\t$this->addSystemError('L\\'utilisateur n\\'existe pas');\n\t \t\t$this->_redirect( '/User/index/list');\n\t \t}\n\t \t$form \t\t\t= new User_Form_Edituser();\n\t \t$form->setAction( '/User/index/edit/id/' . $id);\n\t \tif( $this->getRequest()->isPost() ){\n\t \t\tif( $form->isValid( $this->getRequest()->getPost() ) ){\n\t\t\t\tif( $userService->update( $id, $form->getValues() )){\n\t\t\t\t\t$this->addSystemSuccess('Utilisateur mis à jour');\n\t\t\t\t} else {\n\t\t\t\t\t$this->addSystemError('Echec de la mise à jour');\n\t\t\t\t}\n\t \t\t} else {\n\t \t\t\t$this->addSystemError('Le formulaire contient des erreurs');\n\t \t\t}\n\t \t} else {\n\t\t\t$userData \t\t= array( 'login' => $user->getLogin(),\n\t\t\t\t\t\t\t\t\t 'nom' => $user->getNom(),\n\t\t\t\t\t\t\t\t\t 'prenom' => $user->getPrenom(),\n\t\t\t\t\t\t\t\t\t 'email' => $user->getEmail(),\n\t\t\t\t\t\t\t\t\t 'telephone' => $user->geTtelephone(),\n\t\t\t\t\t\t\t\t\t 'civilite' => $user->getcivilite() \n\t\t\t\t\t\t\t\t\t);\n\t\t\t$form->populate( $userData );\n\t \t}\n\t\t$this->view->form = $form;\n\t }", "public function edit($edit_id = NULL) { \r\n $page_title = 'Edit User Info';\r\n $page_link = 'users/addnew';\r\n $breadcrumb = array(\r\n 'User Info Edit' => '',\r\n 'Edit' => $page_link\r\n );\r\n $data = array();\r\n $data['class'] = 'users';\r\n $data['method'] = 'edit';\r\n/************************************** Form validation of the form ***********************************/ \r\n if($_POST){\r\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\r\n $this->form_validation->set_rules('user_role', 'User Role', 'trim|required');\r\n $this->form_validation->set_rules('user_email', 'User Email', 'trim|required');\r\n $this->form_validation->set_rules('user_first_name', 'User First Name', 'trim|required');\r\n $this->form_validation->set_rules('user_last_name', 'User Last Name', 'trim|required');\r\n $this->form_validation->set_rules('user_company_name', 'User Company Name', 'trim|required');\r\n $this->form_validation->set_rules('user_address', 'User Address', 'trim|required');\r\n $this->form_validation->set_rules('user_zipcode', 'User Zip Code', 'trim|required');\r\n $this->form_validation->set_rules('user_city', 'User City', 'trim|required');\r\n $this->form_validation->set_rules('user_country', 'User Country', 'trim|required');\r\n $this->form_validation->set_rules('user_password', 'User Password', 'trim|required');\r\n\r\n if ( $this->form_validation->run() == FALSE ) {\r\n\r\n $data['error'] = \"error occured\";\r\n } else {\r\n\r\n $post_data = Array(\r\n 'user_role' => $this->input->post('user_role'),\r\n 'user_email' => $this->input->post('user_email'),\r\n 'user_first_name' => $this->input->post('user_first_name'),\r\n 'user_last_name' => $this->input->post('user_last_name'),\r\n 'user_company_name' => $this->input->post('user_company_name'),\r\n 'user_address' => $this->input->post('user_address'),\r\n 'user_zipcode' => $this->input->post('user_zipcode'),\r\n 'user_city' => $this->input->post('user_city'),\r\n 'user_country' => $this->input->post('user_country'),\r\n 'user_password' => $this->input->post('user_password'),\r\n 'created_by' => $this->session->userdata['logged_in']['user_id'],\r\n 'created_at' => date(\"Y-m-d H:i:s \")\r\n );\r\n\r\n $this->common_model->update_data(\"user_id\",$edit_id,\"uc_users\", $post_data);\r\n $this->session->set_flashdata('success','Information updated successfully' );\r\n redirect(\"users/index\", 'refresh');\r\n }\r\n }\r\n $data['all_data'] = $this->common_model->query_all_data(\"uc_users\",'user_id',$edit_id);\r\n $data_param = array( 'page_title' => $page_title, 'breadcrumb' => $breadcrumb, 'data' => $data );\r\n $this->be_page->generate(true, $page_link, $data_param, $response);\r\n }", "public function editAction()\n {\n $identity = Zend_Auth::getInstance()->getIdentity();\n $users = new Users_Model_User_Table();\n $row = $users->getById($identity->id);\n\n $form = new Users_Form_Users_Profile();\n $form->setUser($row);\n\n if ($this->_request->isPost()\n && $form->isValid($this->_getAllParams())) {\n\n $row->setFromArray($form->getValues());\n $row->save();\n\n $row->login(false);\n\n $this->_helper->flashMessenger('Profile Updated');\n $this->_helper->redirector('index');\n }\n $this->view->form = $form;\n }", "public function editRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->user_type;\n $this->data['result'] = $user;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function editAccountAction()\n {\n //Current customer Data.\n $cst = $this->model->getByUserName($_SESSION['userName']);\n if (empty($_POST) === false) {\n //User want to Update his Data.\n if (isset($_POST['update'])) {\n $message = \"\";\n $currentUserName = $cst->getuserName();\n //Check if customer`s new User Name or \n //new Email exists in Data Base.\n if ($currentUserName != $_POST['userName'])\n $message = $this->checkIfExists($_POST['userName'], \"\");\n if (!$message)\n if ($cst->getemail() != $_POST['email'])\n $message = $this->checkIfExists(\"\", $_POST['email']);\n if ($message != \"\")\n $this->regMassage($message);\n //Upadating Customer`s Data.\n else {\n $cst = $this->customerCreate();\n $this->update($cst, $currentUserName);\n $_SESSION['userName'] = $_POST['userName'];\n }\n }\n }\n\n $vars['update'] = \"\";\n $vars['customer'] = $cst;\n $this->view->render('edit profile', $vars);\n }", "public function actionEdit()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t\t$profile=$model->profile;\r\n\t\t\r\n\t\t// ajax validator\r\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='profile-form')\r\n\t\t{\r\n\t\t\techo UActiveForm::validate(array($model,$profile));\r\n\t\t\tYii::app()->end();\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_POST['User']))\r\n\t\t{\r\n\t\t\t\r\n \r\n\t\t\t$model->attributes=$_POST['User'];\r\n\t\t\t$profile->attributes=$_POST['Profile'];\r\n\t\t\tif($model->validate()&&$profile->validate()) {\r\n\t\t\t\t$model->save();\r\n\t\t\t\t$profile->save();\r\n \r\n $usermodel= $this->Usermodel();\r\n if($usermodel)\r\n {\r\n if($usermodel==1)\r\n {\r\n $usr_model= Guardians::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email; \r\n $usr_model->save();\r\n }\r\n if($usermodel==2)\r\n {\r\n $usr_model= Students::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email=$model->email;\r\n $usr_model->save();\r\n }\r\n if($usermodel==3)\r\n {\r\n $usr_model= Employees::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email;\r\n $usr_model->save();\r\n }\r\n }\r\n \r\n //Yii::app()->user->updateSession();\r\n\t\t\t\tYii::app()->user->setFlash('profileMessage',Yii::t('app',\"Changes is saved.\"));\r\n\t\t\t\t$this->redirect(array('/user/accountProfile'));\r\n\t\t\t} else $profile->validate();\r\n\t\t}\r\n\r\n\t\t$this->render('edit',array(\r\n\t\t\t'model'=>$model,\r\n\t\t\t'profile'=>$profile,\r\n\t\t));\r\n\t}", "public function postEdit(GenUserEditRequest $gen_user_edit_request, $id) {\n $gen_user = GenUser::find($id);\n $gen_user->confirmed = $gen_user_edit_request->confirmed;\n\n //check if the user changes the existing email\n if($gen_user->username !== $gen_user_edit_request->username){\n //check if the new email is already present in the database\n if(GenUser::where('username','=',$gen_user_edit_request->username)->first() != null){\n //create error message here\n }\n else{\n $gen_user->username = $gen_user_edit_request->username;\n } \n }\n\n $password = $gen_user_edit_request->password;\n\n if (!empty($password)) {\n $gen_user->password = Hash::make($password);\n $gen_user->secret = $password; }\n //var_dump($gen_user_edit_request);\n $gen_user -> save();\n \n // GenUserRole::where('gen_user_id','=',$gen_user->id)->delete();\n // foreach($gen_user_edit_request->roles as $item)\n // {\n // $gen_user_role = new GenUserRole;\n // $gen_user_role->gen_role_id = $item;\n // $gen_user_role->gen_user_id = $gen_user->id;\n // $gen_user_role-> save();\n // }\n\n // return redirect('gen_user');\n\n\n\n $value = $gen_user_edit_request->roles;\n if($value)\n {\n foreach($gen_user_edit_request->roles as $item)\n {\n $gen_user_role = new GenUserRole();\n $gen_user_role->gen_role_id = $item;\n $gen_user_role->gen_user_id = $gen_user->id;\n $gen_user_role->save();\n }\n }\n\n $success_edit = \\Lang::get('gen_user.edit_success').' : '.$gen_user->username ; \n return redirect('gen_user/'.$id.'/edit')->withSuccess( $success_edit);\n \n // $success_edit = \\Lang::get('registrar.create_success_edit_guardian').' : '.$gen_user->username ; \n // return redirect('registrar/register_guardian/'.$id.'/edit')->withSuccess( $success_edit);\n // return redirect('registrar/register_guardian/'.$id.'/edit');\n }", "public function afterValidation($inputs) {\n if (!User::canAdminPersonas()) {\n $id = (int)Input::get('id');\n if ($id > 0) {\n //if the user to be modified is not the current one, then abort\n if ($id != Auth::user()->paciente->id) {\n return false;\n }\n } else {\n //if creating a new profile it needs to be for the current one only\n if (!Auth::user()->admin && Input::get('usuario_id') != Auth::user()->id) {\n return false;\n }\n }\n }\n return true;\n }", "public function updateAction($userId) {\r\n\t\t// When submit information of user\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$updateUser = Users::findFirst ( $this->request->get ( \"id\" ) );\r\n\t\t\t$updateUser->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$updateUser->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$updateUser->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$updateUser->save ();\r\n\t\t\treturn $this->dispatcher->forward ( array (\r\n\t\t\t\t\t'action' => 'index' \r\n\t\t\t) );\r\n\t\t} else {\r\n\t\t\t// When click to select user to update\r\n\t\t\t$this->view->user = Users::findFirst ( $userId );\r\n\t\t}\r\n\t}", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "public function manageroleandresourceAction()\n {\n if ($this->_request->isPost()) {\n $rid = (int)$this->_request->getPost('rid');\n $aryChecked = $this->_request->getPost('chkRes');\n\n require_once 'Admin/Bll/Role.php';\n $bllRole = Admin_Bll_Role::getDefaultInstance();\n $result = $bllRole->updateRoleOfResource($rid, $aryChecked);\n\n echo $result ? 'true' : 'false';\n }\n }", "function EditModeratorUser($argArrPost) {\n// pre($argArrPost);\n //@extract($argArrPost);\n $objCore = new Core;\n $varName = $argArrPost['frmName'];\n $varEmail = $argArrPost['frmUserEmail'];\n\n $varUserWhere = \" pkAdminID != \" . $argArrPost['frmUserID'] . \" AND ( AdminUserName='\" . $argArrPost['frmName'] . \"' OR AdminEmail='\" . $argArrPost['frmUserEmail'] . \"')\";\n $arrClms = array('pkAdminID', 'AdminUserName', 'AdminPassword', 'AdminEmail', 'AdminOldPass', 'AdminCountry', 'AdminRegion');\n $arrUserList = $this->select(TABLE_ADMIN, $arrClms, $varUserWhere);\n //echo '<pre>';print_r($arrUserList);die;\n if (isset($arrUserList[0]['pkAdminID']) && $arrUserList[0]['pkAdminID'] <> '') {\n $arrUserName = array();\n $arrUserEmail = array();\n foreach ($arrUserList as $key => $val) {\n if ($val['AdminUserName'] == $varName) {\n $arrUserName[] = $val['AdminUserName'];\n }\n if ($val['AdminEmail'] == $varEmail) {\n $arrUserEmail[] = $val['AdminEmail'];\n }\n }\n $varCountName = count($arrUserName);\n $varCountEmail = count($arrUserEmail);\n if ($varCountName > 0) {\n //$_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USER_NAME_ALREADY_EXIST);\n return false;\n } else if ($varCountEmail > 0) {\n //$_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USE_EMAIL_ALREADY_EXIST);\n return false;\n }\n } else {\n //$varPass = trim($argArrPost['frmPassword']);\n //$varUserPass = $arrUserList[0]['oldPass'];\n if (trim($argArrPost['frmPassword']))\n $varUsersWhere = ' pkAdminID =' . $argArrPost['frmUserID'];\n $arrUser = $this->select(TABLE_ADMIN, array('AdminPassword', 'AdminOldPass'), $varUsersWhere);\n //pre($arrUser);\n\n if ($arrUser[0]['AdminPassword'] == $argArrPost['frmPassword']) {\n $adminPassword = $arrUser[0]['AdminPassword'];\n $adminOldPass = $arrUser[0]['AdminOldPass'];\n $finalPass = '';\n } else {\n $adminPassword = md5(trim($argArrPost['frmPassword']));\n $adminOldPass = $arrUser[0]['AdminPassword'];\n $finalPass = $argArrPost['frmPassword'];\n }\n\n $varUserWhere = \" pkAdminRoleId='\" . $argArrPost['frmAdminRoll'] . \"'\";\n $arrClms = array('AdminRoleName');\n $arrRoleName = $this->select(TABLE_ADMIN_ROLL, $arrClms, $varUserWhere);\n //pre($arrRoleName[0]['AdminRoleName']);\n\n $arrColumnAdd = array(\n 'AdminTitle' => trim($argArrPost['frmTitle']),\n 'AdminUserName' => trim(stripslashes($argArrPost['frmName'])),\n 'AdminEmail' => trim(stripslashes($argArrPost['frmUserEmail'])),\n 'AdminPassword' => $adminPassword,\n 'fkAdminRollId' => $argArrPost['frmAdminRoll'],\n 'AdminOldPass' => $adminOldPass,\n 'AdminCountry' => trim($argArrPost['frmCountry']),\n );\n //pre($arrColumnAdd);\n $this->update(TABLE_ADMIN, $arrColumnAdd, $varUsersWhere);\n\n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $argArrPost['frmUserEmail'];\n $varFromUser = SITE_EMAIL_ADDRESS;\n $varSubject = SITE_NAME . ':Updated Login Details';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_edit.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($finalPass), trim(stripslashes($argArrPost['frmUserEmail'])), $arrRoleName[0]['AdminRoleName'], SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n $objCore->setSuccessMsg(ADMIN_USER_UPDATE_SUCCUSS);\n return true;\n }\n }", "public function act_edit_user()\n {\n $id = strip_tags($this->input->post('id'));\n $email = strip_tags($this->input->post('email'));\n $pass = strip_tags(hash('sha256',$this->input->post('password')));\n\n\n if (validation_edit_admin()) {\n $update_user = $this->dashboard->update('m_admin', array('id' => $id), array('email' => $email, 'password' => $pass));\n if ($update_user) {\n $response = array('error'=>false,'title'=>'Update Berhasil','pesan'=>'');\n echo json_encode($response);\n }\n\n }else{\n $response = array('error'=>true,'title'=>'Update Gagal!','pesan'=>strip_tags(validation_errors()));\n echo json_encode($response);\n }\n }", "function editOld($userId = NULL)\n {\n if($this->isAdmin() == TRUE || $userId == 1)\n {\n $this->loadThis();\n }\n else\n {\n if($userId == null)\n {\n redirect('userListing');\n }\n \n $data['roles'] = $this->user_model->getUserRoles();\n $data['userInfo'] = $this->user_model->getUserInfo($userId);\n \n $this->global['pageTitle'] = 'Garuda Informatics : Edit User';\n \n $this->loadViews($this->view.\"editOld\", $this->global, $data, NULL);\n }\n }", "function validate_user_edit(array $inputs, array &$form): bool\n{\n if (App::$db->getRowById('wall', $_GET['id'])['poster'] !== $_SESSION['email']) {\n $form['error'] = 'ERROR YOU\\'RE NOT ALLOWED TO EDIT THAT';\n return false;\n }\n\n return true;\n}", "public function edit($user_id) {\n if ($_POST){\n #izmena vrednosti\n #redirekcija na listu\n \n $username = filter_input(INPUT_POST, 'username');\n $lastname = filter_input(INPUT_POST, 'lastname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('[A-z 0-9\\-]+', $fullname) or $email == '') {\n $this->setData('message', 'Izmene nisu tačno unete.');\n } else {\n $res = HomeModel::editById($user_id, $username, $lastname, $email);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom izmene.');\n }\n }\n \n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\n }", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function editUser(){\n\n\t\t$username = filter_input(INPUT_POST, 'newusername', FILTER_SANITIZE_STRING);\n\t\t$id = $_POST[\"id\"];\n\t\ttry {\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\t\t\t$result = $db->query('SELECT * FROM users WHERE id=\"'.$id.'\"');\n\n\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif(!$row == 0){\n\t\t\t\t\t$statement = $db->prepare(\"UPDATE users SET username=:username WHERE id=:id\");\n\t\t\t\t\t$statement->bindParam(':username', $username, PDO::PARAM_STR);\n\t\t\t\t\t$statement->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t\t\t\t$statement->execute();\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"No data present.\");\n\t\t\t\t}\t\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function edit() {\n\n\t\t\t\t// Si on reçoit des données post\n\t\t\t\tif(!empty($this->request->data)){\n\t\t\t\t\t$this->User->id = $this->Session->read('Auth.User.id'); // On associe l'id du bac à l'objet \n\n\t\t\t\t\t// On valide les champs envoyés\n\t\t\t\t\tif($this->User->validates() ){\n\n\n\t\t\t\t\t\t$this->Session->setFlash('Données correctement sauvegardées', 'alert', array('class' => 'success'));\n\n\t\t\t\t\t\t// On enregistre les données\n\t\t\t\t\t\t$this->User->save(array(\n\t\t\t\t\t\t\t'email'\t\t\t=> $this->request->data['Users']['email'],\n\t\t\t\t\t\t\t'password' \t\t=> $this->Auth->password($this->request->data['Users']['password']),\n\t\t\t\t\t\t));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// On affiche les données déjà entré par l'user\n\t\t\t\t$user= $this->User->find('first',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'conditions' =>\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id' => $this->Session->read('Auth.User.id'),\n\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t$this->set(compact('user'));\n\t\t}", "protected function process() {\n\t\t// Build error link.\n\t\tif (empty($_POST['user_id'])) {\n\t\t\t$link = 'management/users/create';\n\t\t} else {\n\t\t\t$link = 'management/users/edit/' . $this->user['username'];\n\t\t}\n\n\t\t// Validate.\n\t\tif (!$this->validateForm()) {\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tnonce_generate();\n\n\t\t// Validate required fields.\n\t\tif (empty($_POST['username'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'A username must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif (empty($_POST['user_id']) && empty($_POST['password'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'A password must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif ($_POST['password'] !== $_POST['password_confirm']) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The passwords did not match.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif (empty($_POST['email'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'An email address must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Build array of user information to update.\n\t\t$user = array(\n\t\t\t'username' => $_POST['username'],\n\t\t\t'email' => $_POST['email'],\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t\t'expires_on' => $_POST['expires_on']\n\t\t);\n\t\tif (!empty($_POST['password'])) {\n\t\t\t$user['password'] = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\t\t}\n\n\t\tif (empty($_POST['user_id'])) {\n\t\t\t// Create the user.\n\t\t\t$this->Users->create($user);\n\t\t} else {\n\t\t\t// Update the user.\n\t\t\t$this->Users->update($_POST['user_id'], $user);\n\t\t}\n\n\t\t// Forward to the users page.\n\t\tredirect(ABSURL . 'management/users');\n\t}", "public function processAction() {\n $post = $this->request->getPost();\n $userTable = $this->getServiceLocator()->get('UserTable');\n// Load User entity\n $user = $userTable->getUser($post->id);\n// Bind User entity to Form\n $form = $this->getServiceLocator()->get('UserEditForm');\n $form->bind($user);\n $form->setData($post);\n// Save user\n $this->getServiceLocator()->get('UserTable')->saveUser($user);\n }", "public function editAction($userId)\n {\n $request = $this->get('request');\n $service = $this->get('users.users_list_service');\n\n try {\n $userDetails = $service->getUserDetails($userId);\n } catch (\\Exception $ex) {\n throw $ex;\n }\n\n $user = new User();\n $user->setFirstName($userDetails['first_name']);\n $user->setLastName($userDetails['last_name']);\n\n $form = $this->createFormBuilder($user)\n ->add('first_name', 'text')\n ->add('last_name', 'text')\n ->add('save', 'submit', array('label' => 'Update'))\n ->getForm();\n if ($request->getMethod() == 'POST') {\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n $user = new User;\n $user->setId($userId);\n $user->setFirstName($form[\"first_name\"]->getData());\n $user->setLastName($form[\"last_name\"]->getData());\n $service->updateUser($user);\n\n return $this->redirectToRoute('users_homepage');\n }\n }\n\n return $this->render('UsersBundle:Users:list_edit.html.twig', array(\n 'form' => $form->createView(),\n ));\n }", "public function update()\n {\n $headerscripts['header_scripts'] = array(\n ''\n );\n\n $footerscripts['footer_scripts'] = array(\n '<script src=\"'.base_url().'assets/appjs/Users/users.js\"></script>'\n );\n\n // Samo Admin moze mjenjat i kreirat nove usere\n if(!$this->user->checkIfAdmin())\n {\n redirect('/home');\n }\n else\n {\n $viewData['empty'] = '';\n\n $this->load->helper('form');\n $this->load->library('form_validation');\n\n $this->form_validation->set_rules('avatar', 'Avatar', 'trim|required');\n $this->form_validation->set_rules('name', 'Ime', 'trim|required');\n $this->form_validation->set_rules('username', 'Ime', 'trim|required');\n $this->form_validation->set_rules('surname', 'Prezime', 'trim|required');\n $this->form_validation->set_rules('email', 'Email', 'trim|required');\n $this->form_validation->set_rules('username', 'KorisnickoIme', 'trim|required');\n // $this->form_validation->set_rules('password', 'Lozinka', 'trim|required');\n $this->form_validation->set_rules('user_type', 'Tip Korisnika', 'trim|required');\n\n if ($this->form_validation->run() === FALSE)\n {\n $viewData['avatars'] = $this->dbQueries->getAvatarImages();\n $viewData['userTypes'] = $this->dbQueries->getUserTypes();\n $id = $this->input->post('id');\n $viewData['user'] = $this->user->get($id);\n $this->load_views($headerscripts, $footerscripts, $viewData, 'Users/edit_view');\n }\n else\n {\n //Uredjuje se postojeci korisnik, informacije se dobivaju iz POST metode servera\n $this->user->update();\n\n redirect('/users');\n }\n }\n }", "public function actionUpdate() {\r\n\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n \r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n \r\n if(!$user) {\r\n $errors['firstname'][0] = 'Unable to find user. Please, try again later';\r\n } else {\r\n //user properties\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n } \r\n \r\n //check if the form has been submitted\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n \r\n $firstname = $this->test_input($_POST['firstname']);\r\n $lastname = $this->test_input($_POST['lastname']);\r\n $email = $this->test_input($_POST['email']);\r\n \r\n //create form model, validate it and if success - update user profile\r\n $model = new EditProfileForm($userID, $firstname, $lastname, $email);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else {\r\n #!!!!!!!!!!!!!\r\n $success = $model->updateProfile() ? 'USER DATA SUCCESFULLY UPDATED': 'UNABLE TO UPDATE USER PROFILE. TRY AGAIN LATER';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/update.php';\r\n }", "public function editUser(UserEditForm $form, User $user);", "public function edit() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error404');\n\n \n $schools= School::find($_GET['id']);\n require_once('views/school/edit.php');\n\n\n if (isset($_POST['mail']) and $_POST['mail']!= \"\")\n {\n $schools = School::update_mail($_GET['id'],$_POST['mail']); \n }\n \n if (isset($_POST['street']) and $_POST['street']!= \"\")\n {\n $schools = School::update_street($_GET['id'],$_POST['street']); \n } \n\n if (isset($_POST['town']) and $_POST['town']!= \"\")\n {\n $schools = School::update_town($_GET['id'],$_POST['town']); \n }\n\n if (isset($_POST['continent']) and $_POST['continent']!= \"\")\n {\n $schools = School::update_continent($_GET['id'],$_POST['continent']); \n }\n\n if (isset($_POST['postcode']) and $_POST['postcode']!= \"\")\n {\n $schools = School::update_postcode($_GET['id'],$_POST['postcode']); \n }\n\n if (isset($_POST['phone_num']) and $_POST['phone_num']!= \"DEFAULT\")\n {\n $schools = School::update_phone_num($_GET['id'],$_POST['phone_num']); \n }\n\n if (isset($_POST['director']) and $_POST['director']!= \"\")\n {\n $schools = School::update_director($_GET['id'],$_POST['director']); \n } \n\n print_r($_POST); \n\n if (isset($_POST['password'])){\n\n if (isset($_POST['password']) and $_POST['password']!= \"DEFAULT\")\n {\n $schools = School::update_password($_GET['id'],$_POST['password']); \n } \n }\n \n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function update($userID)\n\t{\n\t\n\t\t$this->data['page'] = \"users\";\n\t\t\n\t\t//get all users\n\t\t$this->data['users'] = $this->usermodel->getAll();\n\t\t\n\t\t//get roles\n\t\t$this->data['roles'] = $this->rolemodel->getAll();\n\t\t\n\t\t$this->data['theUser'] = $this->usermodel->getUser($userID);\n\t\t\n\t\t$this->form_validation->set_rules('firstname', 'First name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('lastname', 'Last name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('group', 'User role', 'trim|required|xss_clean');\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\n\t\t\t$this->load->view('users/users', $this->data);\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t$data = array(\n\t\t\t\t'first_name' => $_POST['firstname'],\n\t\t\t\t'last_name' => $_POST['lastname'],\n\t\t\t\t'company' => $_POST['company'],\n\t\t\t\t'phone' => $_POST['phone']\n\t\t\t);\n\t\t\t\n\t\t\t$this->ion_auth->update($userID, $data);\n\t\t\n\t\t\t//update user role/group\n\t\t\t$data = array(\n\t\t\t\t'group_id' => $_POST['group']\n\t\t\t);\n\t\t\t\n\t\t\t$this->db->where('user_id', $userID);\n\t\t\t$this->db->update('dbapp_users_groups', $data);\n\t\t\t\n\t\t\t//if the new role is Adminisiatrtor, we'll need to take of the MySQL site of things\n\t\t\t\n\t\t\tif( $_POST['group'] == 1 ) {\n\t\t\t\t\t\t\n\t\t\t\t$this->usermodel->makeAdmin($userID);\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t//setup the permissions for the new user\n\t\t\t\t\n\t\t\t\t$temp = $this->db->from('dbapp_groups')->where('id', $_POST['group'])->get()->result();\n\t\t\t\t\n\t\t\t\t$permissions = json_decode( $temp[0]->permissions, true );\n\t\t\t\t\n\t\t\t\t$this->rolemodel->applyPermissions($permissions, $mysqlUser = $this->ion_auth->user($userID)->row()->mysql_user);\n\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$this->session->set_flashdata('success_message', $this->lang->line('users_update_success'));\n\t\t\t\n\t\t\tredirect(\"/users/\".$userID, \"refresh\");\n\t\t\t\n\t\t}\n\t\n\t}", "public function editionAction() {\r\n //inactivate header/footer\r\n $this->_includeTemplate = false;\r\n\r\n if ($_GET['checkboxAd'] == 'false') {\r\n $typeU = \"child\";\r\n } else {\r\n $typeU = \"adult\";\r\n }\r\n\r\n if ($_GET['checkboxAdmin'] == 'false') {\r\n $admin = \"0\";\r\n } else {\r\n $admin = \"1\";\r\n }\r\n\r\n //test to know if the user already exists\r\n $cpt = true;\r\n foreach ($_SESSION['members'] as $member) {\r\n\r\n if (($_GET['Name'] == $member->getName()) && ($_GET['CurrName'] != $member->getName() )) {\r\n $cpt = false;\r\n }\r\n }\r\n\r\n //if user doesn't exist\r\n if ($cpt) {\r\n //sql connection\r\n\r\n if ($_SESSION['Name'] == $_GET['CurrName'])//Current edit current\r\n $_SESSION['Name'] = $_GET['Name'];\r\n\r\n $connect = connection::getInstance();\r\n $_GET['Name'] = Users::secure($_GET['Name']);\r\n $_GET['Pass'] = Users::secure($_GET['Pass']);\r\n $_GET['Id'] = Users::secure($_GET['Id']);\r\n\r\n $sql = \"UPDATE users SET nameU='\" . $_GET['Name'] . \"', typeU='\" . $typeU . \"',password='\" . $_GET['Pass'] . \"', admin='\" . $admin . \"' where IDU ='\" . $_GET['Id'] . \"'\"; //on recupere tout les utilisateurs\r\n //sending request\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n \r\n $_SESSION['admin'] = $admin;\r\n $_SESSION['current'] = 'members';\r\n $this->members = Users::Getuser(); //give data to view\r\n } else {\r\n $this->members = $_SESSION['members']; //give data to view\r\n }\r\n }", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "function postEdit($request){\r\n global $context;\r\n $data=new $this->model;\r\n try\r\n {\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many')\r\n $data->data[$key]=$request->post[$key];\r\n }\r\n\r\n //print_r($data);\r\n if(!$data->update()){\r\n\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n\r\n }\r\n\r\n\r\n if($request->isAjax()) return json_success(\"Save Success !!\");\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }", "public function updateRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = trim($this->input->post('id'));\n $first_name = trim($this->input->post('first_name'));\n $last_name = trim($this->input->post('last_name'));\n $id_no = trim($this->input->post('id_no'));\n $user_role = trim($this->input->post('user_role'));\n $phone_no = trim($this->input->post('phone_no'));\n $email = trim($this->input->post('email'));\n $password = trim($this->input->post('password'));\n\n $user = $this->UserModel->getRecord($id);\n if ($id_no != $user->id_no) {\n $this->form_validation->set_rules('id_no', 'ID No',\n 'required|is_unique[users_tb.id_no]',\n array('is_unique' => 'This %s already exist.'));\n }\n \n $this->form_validation->set_rules('user_role','User Role',\n 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $this->data['id'] = $id;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n if ($password == '') {\n $data = array(\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'id_no' => $id_no,\n 'phone_no' => $phone_no,\n 'email' => $email,\n );\n }else{\n $hash = $this->bcrypt->hash_password($password);\n $data = array(\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'id_no' => $id_no,\n 'phone_no' => $phone_no,\n 'email' => $email,\n 'password' => $hash\n );\n }\n $result = $this->UserModel->updateRecordData($id, $data);\n \n $permissions_group = $this->UserModel->getGroupId($user_role);\n \n $this->UserModel->updateUserPermission(array('group_id' => \n $permissions_group->id),$id);\n\n $this->session->set_flashdata('message', '1');\n redirect('UserCon/showAllRecordsPage');\n }\n } else {\n echo \"access denied\";\n }\n }", "public function formUserEdit($user_id){\n // Get the user to edit\n $target_user = UserLoader::fetch($user_id); \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_users') && !$this->_app->user->checkAccess('uri_group_users', ['primary_group_id' => $target_user->primary_group_id])){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Determine which groups this user is a member of\n $user_groups = $target_user->getGroups();\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($user_groups[$group_id]))\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields\n $fields = ['display_name', 'email', 'title', 'password', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else if ($this->_app->user->checkAccess(\"view_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $disabled_fields[] = $field;\n else\n $hidden_fields[] = $field;\n }\n \n // Always disallow editing username\n $disabled_fields[] = \"user_name\";\n \n // Hide password fields for editing user\n $hidden_fields[] = \"password\";\n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-update.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Edit User\",\n \"submit_button\" => \"Update user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users/u/$user_id\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "function user_can_edit_user($user_id, $other_user)\n {\n }", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function edit(){\n\t\t# If user is blank, they're not logged in; redirect them to the login page\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# If they weren't redirected away, continue:\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_posts_edit');\n\t\t$this->template->title = \"Posts of \".$this->user->first_name;\n\n\t\t#query to only show users posts\n\t\t$q = \"SELECT\n\t\t\t\tposts.content, \n\t\t\t\tposts.created, \n\t\t\t\tposts.post_id,\n\t\t\t\tusers.first_name, \n\t\t\t\tusers.last_name\n\t\t\tFROM posts\n\t\t\tINNER JOIN users\n\t\t\t\tON posts.user_id = users.user_id\n\t\t\tWHERE users.user_id =\".$this->user->user_id;\n\n\t\t# Execute the query to get all the posts. \n\t\t# Store the result array in the variable $posts\n\t\t# Run the query, store the results in the variable $posts\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# Pass data (posts) to the view\n\t\t$this->template->content->posts = $posts;\n\n\t\t# Render template\n\t\techo $this->template;\n\t}", "public function edit_user()\n {\n //make sure user logged in or pending\n if (Session::has('user') || Session::has('pending_user'))\n {\n //check to make sure phone number in correct format\n $number = Input::get('phone_number');\n\n //took pattern from http://www.w3resource.com/javascript/form/phone-no-validation.php\n $pattern = \"/^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/\";\n\n //if phone entered correctly\n if (preg_match ($pattern, $number))\n {\n\n // Input doesn't return zero for unchecked boxes, so change these to zero\n $hours_notification = (Input::get('hours_notification') ? 1 : 0);\n $deals_notification = (Input::get('deals_notification') ? 1 : 0);\n\n //strip any punctuation from phone number, if exists\n $phone = str_replace(array(\"-\",\".\",\"(\",\")\",\" \"), \"\", Input::get('phone_number'));\n\n //if user already logged in\n if (Session::has('user'))\n {\n $user_session = Session::get('user');\n $user = User::find($user_session->id);\n $user->preferred_name = Input::get('preferred_name');\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //put updated user on to session\n\n Session::put('user', $user);\n\n }\n //else create new user\n else\n {\n //create user based on session data and input\n $pending = Session::get('pending_user');\n\n $user = new User();\n $user->cs50_id = $pending[\"cs50_id\"];\n $user->name = $pending[\"fullname\"];\n $user->preferred_name = Input::get('preferred_name');\n $user->email = $pending[\"email\"];\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //remove pending user from session\n Session::forget('pending_user');\n\n //log user in\n Session::put('user', $user);\n Auth::loginUsingId($user->id);\n\n //send user text message about signing up\n\n $grille_name = Grille::where('id', $this->grille_id)->pluck('name');\n $message = \"Thanks for signing up for \" . $grille_name . \"'s online ordering!\n If you received this message by accident, reply 'STOP'\";\n\n Sms::send_sms($phone, $message);\n }\n\n //redirect to most recent page\n $url = Session::get('redirect');\n Session::forget('redirect');\n return Redirect::to($url);\n }\n //else alert user to enter correct phone number\n else\n {\n $failure = 'Please enter a 10-digit phone number';\n\n //if user already has account\n if (Session::has('user'))\n {\n $user = Session::get('user');\n $user->new = 0;\n $user->grille_number = Grille::where('id', $this->grille_id)->pluck('phone_number');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n //if user is logging in for first time\n else\n {\n $user = Session::get('pending_user');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n }\n }\n\n //if not user or pending user, redirect\n else\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n }", "public function editUser($id) {\n $postData = Input::all();\n$user_permission = '';\n if (!empty($postData)) {\n\n $username = trim(Input::get('username'));\n $user_result = DB::table('hr_login_credentials')->select('username')->where('username', '=', $username)->where('id', \"!=\", $id)->get();\n if ($user_result) {\n return Redirect::back()->with('erroralert', 'Username already exist.Please try with different username.');\n } else {\n if (Input::has('password_change')) {\n $user_pass = md5(trim(Input::get('old_password')));\n $password = DB::table('hr_login_credentials')->select('password')->where('id', \"=\", $id)->first();\n\n if ($password->password == $user_pass) {\n\n $pass_update = DB::table('hr_login_credentials')->where('id', \"=\", $id)->update(array('password' => md5(Input::get('new_password'))));\n } else {\n return Redirect::back()->with('erroralert', 'Old password did not match.');\n }\n }\n\t\t\t\n\t\t\t\n\t\t\t\t$permission = isset($postData['check']) ? 1 : 2 ;\n\n if (Input::has('company_name')) {\n $updatedBy = 2;\n } else {\n $updatedBy = 1;\n }\n if (Input::has('ac_type')) {\n $acct_types = Input::get('ac_type');\n } else {\n $acct_types = Input::get('hidden_account_type');\n }\nif (isset($postData['permission'])) {\n $user_permission = serialize($postData['permission']);\n }\n\n if (!Input::has('company_name')) {\n $update_array = array('fkCompany_id' => Input::get('company'), 'username' => Input::get('username'), 'muliple_option' => isset($postData['muliple_option']) ? $postData['muliple_option'] : 0, 'account_type' => $acct_types, 'updated_by' => $updatedBy ,'permission'=>$permission, 'user_permission' => $user_permission);\n } else {\n $update_array = array('username' => Input::get('username'), 'account_type' => $acct_types, 'muliple_option' => $postData['muliple_option'], 'updated_by' => $updatedBy,'permission'=>$permission, 'user_permission' => $user_permission);\n }\n\n\n $result = DB::table('hr_login_credentials')->where('id', '=', $id)->update($update_array);\n $getUserDetails = DB::table('hr_login_credentials as t1')\n ->join('hr_company_database as t2', 't2.fkCompany_id', '=', 't1.fkCompany_id')\n ->select('t2.host_address', 't2.db_name', 't2.user_name', 't2.password', 't1.fkUserId')\n ->where('t1.id', $id)\n ->first();\n\n $this->db2->table('hr_emp_info')->where('id', $getUserDetails->fkUserId)->update(array('email_id' => Input::get('username')));\n\n\n if (!Input::has('company_name')) {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n } else {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n }\n }\n }\n\n\n $companies = DB::table('hr_company_dtls as cmp')->select('id', 'company_name', 'customize_approve')->where(array('is_active' => 1, 'delete_status' => 0))->get();\n $user = DB::table('hr_login_credentials as user')\n ->join('hr_company_dtls as comp', 'comp.id', \"=\", 'user.fkCompany_id')\n ->select('user.id', 'user.username', 'user.password', 'user.muliple_option', 'user.ml_settings','user.permission', 'user.account_type', 'comp.id as comp_id')->where('account_status', 1)->where('user.id', '=', $id)->get();\n\n $role = array(1, 2, 3, 4, 5);\n $role_type = Session::has('proxy_user_role') ? Session::get('proxy_user_role') : Session::get('user_role');\n $user_permission = DB::table('hr_login_credentials')\n ->select('user_permission')\n ->where('account_status', 1)->where('id', '=', $id)->first();\n if ($user_permission) {\n $user_permission = unserialize($user_permission->user_permission);\n }\n $cmpny_Id = Session::has('proxy_cpy_id') ? Session::get('proxy_cpy_id') : Session::get('cpy_id');\n $users = DB::table('hr_login_credentials')->select('fkUserId as uid')->whereIn('account_type', $role)->where('account_status', 1)->where('fkCompany_id', $cmpny_Id)->orderBy('fkUserId')->get();\n\n $auth = array();\n if (!empty($users)) {\n foreach ($users as $u) {\n if ($u->uid != 0) {\n $auth[] = $u->uid;\n }\n }\n }\n\n if (in_array($role_type, $role)) {\n if ($auth) {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->whereIn('id', $auth)->where('local_del', 0)->get();\n } else {\n $reportTo = '';\n }\n } else {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->where('id', '!=', $id)->whereIn('id', $auth)->where('local_del', 0)->get();\n }\n\t\t$approve = $this->db2->table('hr_multi_approve')->select('approve_module')->orderBy('sort_order')->get();\n\n return View::make('settings.company.editUser')->with(array('user' => $user, 'company' => $companies, 'report' => $reportTo, 'multi'=>$approve, 'user_permission' => $user_permission));\n //return View::make('settings.company.editUser')->with(array('company' => $companies, 'user' => $user));\n }", "function editTableRow($tableName)\n{\n\n if ($tableName == \"userdata\") {\n $errorUpdate = $errorFirstName = $errorLastName = $errorEmail = \"\";\n global $dataRights;\n //$result = database::getConnections()->viewByID($_POST[\"tableName\"], $_POST[\"userId\"]);\n $result = database::getConnections()->view('userdata INNER JOIN userinfo ON userdata.id=userinfo.userid', 'userdata.id=:userid', [':userid' => $_POST[\"userId\"]]);\n\n $tokenClass = new token();\n $xsrfType = \"AdminUpdateUserForm\";\n $xsrfExpires = date(\"Y-m-d H:i:s\", strtotime(date(\"Y-m-d H:i:s\") . \" +8 minutes\"));\n\n $xsrfToken = $tokenClass->generateXSRFToken();\n database::getConnections()->tokenInsert($xsrfToken, $xsrfType, $xsrfExpires, $xsrfId = null);\n\n if ($dataRights[\"rights\"] >= 90) {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['userid'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"userdata\">\n <input type=\"hidden\" name=\"rights\" value=\"' . $result['rights'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"firstname\">Vorname:</label>\n <input type=\"text\" name=\"firstname\" id=\"firstname\" placeholder=\"Max\" autofocus maxlength=\"75\" value=\"' . $result['firstname'] . '\">\n <div>' . $errorFirstName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"lastname\">Nachname:</label>\n <input type=\"text\" name=\"lastname\" id=\"lastname\" placeholder=\"Mustermann\" maxlength=\"75\" value=\"' . $result['lastname'] . '\">\n <div>' . $errorLastName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"email\">E-Mail Adresse:</label>\n <input type=\"email\" name=\"email\" id=\"email\" placeholder=\"max-Mustermann@gmail.com\" maxlength=\"255\" value=\"' . $result['email'] . '\">\n <div>' . $errorEmail . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Rechte:</label>\n <select class=\"\" name=\"editRights\">\n\t\t\t\t <optgroug name=\"editRights\">\n <option value=\"\" disabled selected>' . $result['rights'] . '</option>\n <option value=\"0\">Freie Nutzung/User</option>\n <option value=\"10\">Vollversion/User</option>\n <option value=\"20\">NLP Coach</option>\n <option value=\"30\">NLP Moderator</option>\n <option value=\"50\">Support</option>\n <option value=\"60\">Admin</option>\n <option value=\"99\">Besitzer</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n }\n\n } else {\n $errorUpdate = $errorAutor = $errorTitle = $errorDescription = $errorTextMessage = $errorSoundcloudLink = $errorYouTubeLink = $errorImage = \"\";\n global $dataRights, $userid;\n\n $result = database::getConnections()->viewByID($_POST[\"tableName\"], $_POST[\"userId\"]);\n\n $tokenClass = new token();\n $xsrfType = \"AdminUpdateNLPForm\";\n $xsrfExpires = date(\"Y-m-d H:i:s\", strtotime(date(\"Y-m-d H:i:s\") . \" +8 minutes\"));\n\n $xsrfToken = $tokenClass->generateXSRFToken();\n database::getConnections()->tokenInsert($xsrfToken, $xsrfType, $xsrfExpires, $xsrfId = null);\n\n $profilPic = database::getConnections()->view(\"images\", \"nlpid=:nlpid AND tablename=:tablename\", [':nlpid' => $_POST[\"userId\"], ':tablename' => 'Nlp']);\n\n\n if ($dataRights[\"rights\"] >= 30) {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['id'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"nlp\">\n <input type=\"hidden\" name=\"valueNlpImage\" value=\"' . $profilPic['src'] . '\">\n <input type=\"hidden\" name=\"valueGenre\" value=\"' . $result['genre'] . '\">\n <input type=\"hidden\" name=\"unlocked\" value=\"' . $result['unlocked'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"nlpImage\">Übungsbild:</label>\n <input type=\"file\" accept=\"image/*\" name=\"appImage\" id=\"nlpImage\">\n <div>' . $errorImage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"title\">Titel:</label>\n <input type=\"text\" name=\"title\" id=\"title\" placeholder=\"Titel\" autofocus maxlength=\"75\" value=\"' . $result['title'] . '\">\n <div>' . $errorTitle . '</div>\n </div>\n <div class=\"field\">\n <label for=\"description\">Beschreibung:</label>\n <input name=\"description\" id=\"description\" placeholder=\"Beschreibung\" maxlength=\"150\" value=\"' . $result['description'] . '\">\n <div>' . $errorDescription . '</div>\n </div>\n <div class=\"field\">\n <label for=\"text\">Text:</label>\n <textarea name=\"text\" id=\"text\" placeholder=\"Text\" rows=\"4\" cols=\"60\" value=\"\">' . $result['text'] . '</textarea>\n <div>' . $errorTextMessage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Genre:</label>\n <select class=\"\" name=\"editGenre\">\n\t\t\t\t <optgroug name=\"editGenre\">\n <option value=\"\" disabled selected>' . $result['genre'] . '</option>\n <option value=\"A\">A</option>\n <option value=\"B\">B</option>\n <option value=\"C\">C</option>\n <option value=\"D\">D</option>\n <option value=\"E\">E</option>\n <option value=\"F\">F</option>\n <option value=\"G\">G</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n <div class=\"field\">\n <label for=\"soundcloudLink\">Soundcloud Link:</label>\n <input type=\"url\" name=\"soundcloudLink\" id=\"soundcloudLink\" placeholder=\"Soundcloud Link\" maxlength=\"255\" value=\"' . $result['soundcloud'] . '\">\n <div>' . $errorSoundcloudLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"youtubeLink\">YouTube Link:</label>\n <input type=\"url\" name=\"youtubeLink\" id=\"youtubeLink\" placeholder=\"YouTube Link\" maxlength=\"255\" value=\"' . $result['youtube'] . '\">\n <div>' . $errorYouTubeLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"editUnlocked\">Freischalten:</label>\n <select class=\"\" name=\"editUnlocked\">\n <optgroug name=\"editUnlocked\">\n <option value=\"' . $result['unlocked'] . '\" disabled selected>' . $result['unlocked'] . '</option>\n <option value=\"1\">ONLINE</option>\n <option value=\"0\">OFFLINE</option>\n </optgroup>\n </select>\n </div>\n\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n } else {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['id'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"nlp\">\n <input type=\"hidden\" name=\"valueNlpImage\" value=\"' . $profilPic['src'] . '\">\n <input type=\"hidden\" name=\"valueGenre\" value=\"' . $result['genre'] . '\">\n <input type=\"hidden\" name=\"unlocked\" value=\"' . $result['unlocked'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"title\">Titel:</label>\n <input type=\"text\" name=\"title\" id=\"title\" placeholder=\"Titel\" autofocus maxlength=\"75\" value=\"' . $result['title'] . '\">\n <div>' . $errorTitle . '</div>\n </div>\n <div class=\"field\">\n <label for=\"description\">Beschreibung:</label>\n <input name=\"description\" id=\"description\" placeholder=\"Beschreibung\" maxlength=\"150\" value=\"' . $result['description'] . '\">\n <div>' . $errorDescription . '</div>\n </div>\n <div class=\"field\">\n <label for=\"text\">Text:</label>\n <textarea name=\"text\" id=\"text\" placeholder=\"Text\" value=\"\">' . $result['text'] . '</textarea>\n <div>' . $errorTextMessage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Genre:</label>\n <select class=\"\" name=\"editGenre\">\n\t\t\t\t <optgroug name=\"editGenre\">\n <option value=\"\" disabled selected>' . $result['genre'] . '</option>\n <option value=\"A\">A</option>\n <option value=\"B\">B</option>\n <option value=\"C\">C</option>\n <option value=\"D\">D</option>\n <option value=\"E\">E</option>\n <option value=\"F\">F</option>\n <option value=\"G\">G</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n <div class=\"field\">\n <label for=\"title\">Soundcloud Link:</label>\n <input type=\"url\" name=\"soundcloudLink\" id=\"soundcloudLink\" placeholder=\"Soundcloud Link\" maxlength=\"255\" value=\"' . $result['soundcloud'] . '\">\n <div>' . $errorSoundcloudLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"title\">YouTube Link:</label>\n <input type=\"url\" name=\"youtubeLink\" id=\"youtubeLink\" placeholder=\"YouTube Link\" maxlength=\"255\" value=\"' . $result['youtube'] . '\">\n <div>' . $errorYouTubeLink . '</div>\n </div>\n <input class=\"btn-input\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n }\n }\n\n}", "public function edit()\n {\n $user = User::findOne(Yii::$app->user->id);\n $user->username = $this->username;\n $user->email = $this->email;\n try {\n $user->save();\n return true;\n } catch(IntegrityException $e) {\n return false;\n }\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edituserAction(): object\n {\n // Sets webpage title\n $title = \"Edit user\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $username = getGet(\"username\");\n\n // SQL statement\n $sql = \"SELECT * FROM users WHERE username = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$username]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"username\" => $username,\n \"content\" => $content\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit_user\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function edit(User $user)\n {\n $this->authorize('haveaccess','misdatos');\n\n\n $adicional = Adicional::where('user_id', $user->id)->orderBy('id', 'DESC')\n ->first();\n $direactual = DB::table('usercontacto')\n ->where('user_id', $user->id)\n ->orderBy('id', 'DESC')\n ->first();\n $soportes = Soporte::where('user_id', $user->id)\n ->orderBy('vencimiento', 'ASC')\n ->orderBy('estado', 'ASC')\n ->paginate(50);\n $salarios = Salario::where('user_id', $user->id)\n ->orderBy('created_at', 'DESC')\n ->paginate(20);\n $empresas = DB::table('empresa_users')\n ->join('empresas', 'empresa_users.empresa_id', '=', 'empresas.id')\n ->join('roles', 'empresa_users.role_id', '=', 'roles.id')\n ->join('sucursales', 'empresa_users.sucursal_id', '=', 'sucursales.id')\n ->join('areas', 'empresa_users.area_id', '=', 'areas.id')\n ->select(\n 'empresas.id as emid', 'empresas.nombre as emnombre', 'empresas.logo', 'roles.id as rolid',\n 'roles.name', 'sucursales.id as sucid', 'sucursales.nombre as sucnombre',\n 'areas.id as areaid', 'areas.area'\n )\n ->where('empresa_users.user_id', $user->id)\n ->get();\n $disponibles = Empresa::where('estado', '1' )\n ->select('id as dispoid', 'nombre')\n ->orderBy('nombre', 'ASC')\n ->get();\n\n $roles = Role::select('id', 'name')\n ->where('id', '>', '2')\n ->orderBy('id', 'ASC')\n ->get();\n\n $ubicacion = DB::table('empresa_users')\n ->join('empresas', 'empresa_users.empresa_id', '=', 'empresas.id')\n ->join('roles', 'empresa_users.role_id', '=', 'roles.id')\n //->join('sucursales', 'empresa_users.sucursal_id', '=', 'sucursales.id')\n //->join('areas', 'empresa_users.area_id', '=', 'areas.id')\n ->select(\n 'empresas.id as emid', 'empresas.nombre as emnombre', 'roles.id as rolid',\n 'roles.name', 'empresa_users.sucursal_id as sucid', 'empresa_users.sucursal as sucnombre',\n 'empresa_users.area_id as areaid', 'empresa_users.area'\n )\n ->where('empresa_users.user_id', $user->id)\n ->where('empresa_users.empresa_id', $user->empresa)\n ->first();\n\n $sucursales = DB::table('sucursales')\n ->where('empresa_id', $user->empresa)\n ->where('estado', '1')\n ->orderBy('nombre', 'ASC')\n ->get();\n\n $areas = DB::table('areas')\n ->where('empresa_id', $user->empresa)\n ->where('estado', '1')\n ->orderBy('area', 'ASC')\n ->get();\n\n\n\n //return compact('user', 'adicional', 'soportes', 'salarios', 'empresas', 'roles', 'disponibles', 'ubicacion');\n return view('user.edit', compact(\n 'user', 'adicional', 'direactual', 'soportes', 'salarios', 'empresas', 'disponibles', 'roles', 'ubicacion', 'sucursales', 'areas'\n ));\n }", "function render_edit($user)\n {\n }" ]
[ "0.6944832", "0.6506544", "0.64835507", "0.6443123", "0.63922614", "0.637695", "0.63103336", "0.6148198", "0.61414236", "0.6123014", "0.6107582", "0.6100233", "0.6037071", "0.60338557", "0.6010923", "0.5978386", "0.59742177", "0.5962707", "0.5936845", "0.59142584", "0.5901627", "0.58937055", "0.58858156", "0.58852243", "0.5874045", "0.58686537", "0.5856295", "0.57973945", "0.5794734", "0.57757527", "0.5760305", "0.5759078", "0.5756632", "0.574416", "0.5728667", "0.5725562", "0.5689976", "0.56841713", "0.56838757", "0.5682225", "0.5674613", "0.56703", "0.56696725", "0.5668876", "0.5653872", "0.5645779", "0.56384754", "0.56233346", "0.56228316", "0.5621272", "0.5613203", "0.56043965", "0.56028104", "0.56024915", "0.5591672", "0.55895627", "0.5587346", "0.5585433", "0.5584822", "0.55774784", "0.55762464", "0.5571623", "0.55702746", "0.556929", "0.55671567", "0.55652153", "0.5563632", "0.5561789", "0.5561374", "0.55565023", "0.5555966", "0.55379564", "0.5533857", "0.5533698", "0.5517949", "0.5517035", "0.5512276", "0.55104655", "0.55004007", "0.5494276", "0.54937637", "0.5493211", "0.54801244", "0.5478749", "0.5477958", "0.5475517", "0.5473485", "0.54656756", "0.5465522", "0.54578817", "0.54571134", "0.54543424", "0.54479647", "0.54459673", "0.5445115", "0.5440947", "0.5438728", "0.54382426", "0.54377365", "0.54375094" ]
0.71640736
0
/ deleteResource Does not delete resource rather deactivates the resources
/ deleteResource Не удаляет ресурс, а деактивирует ресурсы
public function deleteResource() { $database = new Database(); $id = $this->_params['id']; $database->deleteResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDeleteResource();", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function destroy(Resource $resource)\n {\n //\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }", "public function reactivateResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->reactivateResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function undeleteAction(){\n\t}", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function deleteResources($id) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM resources_activity WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t}", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }", "protected function DELETE(ResourceObject $resource) {\n\t\tif ($this->request->headers['Depth'] != null &&\n\t\t $this->request->headers['Depth'] != 'infinity')\n\t\t\tthrow new HTTPStatusException(400, 'Bad Request');\n\n#[TODO]\t\t// check lock status\n#\t\tif (!$this->_check_lock_status($this->path))\n#\t\t\tthrow new HTTPStatusException(423, 'Locked');\n\n\t\t// delete the resource\n\t\tif (!$resource->getParent()->deleteChild(basename($resource->getPath())))\n\t\t\tthrow new HTTPStatusException(424, 'Failed Dependency');\n\t\t// return no content\n\t\t$this->response->status->set(204);\n\t}", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "protected function delete() {\n\t}", "public function onPreDelete(ResourceEventInterface $event): void\n {\n $member = $this->getMemberFromEvent($event);\n\n $this->getGateway($member->getAudience()->getGateway(), GatewayInterface::DELETE_MEMBER);\n }", "public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "function deleteResourceRoot(){\n // Load the appropriate helpers\n $ci =& get_instance(); $ci->load->helper('error_code');\n return array(\n \"code\" => PROHIBITED,\n \"message\"=>\"Deleting a resource collection is prohibited.\"\n );\n}", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public static function delete() {\n\n\n\t\t}", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "protected function _preDelete() {}", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }", "protected function _delete()\n\t{\n\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "protected function deleteAction()\n {\n }", "function deleteResourceByID($id)\n{\n\t$sql = \"DELETE FROM `\".DB_NAME.\"`.`resources` WHERE `resources`.`rid` = \".$id;\n\t\n\t$result = mysql_query($sql);\n\t\n\treturn $result;\n}", "public function deleteAction() {\n \n }", "protected function _delete()\r\n {\r\n parent::_delete();\r\n }", "function delete() ;", "function delete() ;", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public static function delete() {\r\n\t\t\r\n\t}", "public function erase()\n {\n ActionHandler::getInstance()->deleteAction($this->deleteAction);\n ActionHandler::getInstance()->deleteAction($this->deleteActionf);\n $this->saveButton->destroy();\n $this->loadButton->destroy();\n $this->frame->clearComponents();\n $this->frame->destroy();\n $this->destroyComponents();\n\n parent::destroy();\n }", "function delete()\n {\n }", "public function delete(): void;", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public final function delete() {\n }", "public abstract function delete();", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delete() {\r\n }", "public function taskDelete(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n $object = null;\n try {\n $object = $this->getObject();\n if ($object && $object->exists()) {\n $authorized = $object instanceof FlexAuthorizeInterface\n ? $object->isAuthorized('delete', 'admin', $this->user)\n : $directory->isAuthorized('delete', 'admin', $this->user);\n\n if (!$authorized) {\n throw new RuntimeException($this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' delete.', 403);\n }\n\n $object->delete();\n\n $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_SUCCESS'));\n if ($this->currentRoute->withoutGravParams()->getRoute() === $this->referrerRoute->getRoute()) {\n $redirect = dirname($this->currentRoute->withoutGravParams()->toString(true));\n } else {\n $redirect = $this->referrerRoute->toString(true);\n }\n\n $this->setRedirect($redirect);\n\n $this->grav->fireEvent('onFlexAfterDelete', new Event(['type' => 'flex', 'object' => $object]));\n }\n } catch (RuntimeException $e) {\n $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()]), 'error');\n\n $this->setRedirect($this->referrerRoute->toString(true), 302);\n }\n }", "public function deleteAction()\n {\n }", "public function delete()\r\n\t{\r\n\t}", "public function deleteResourceRelations($resourceID) {\n\n $query = \"UPDATE related_resource set is_deleted = 't' WHERE resource_id = $1\";\n $result = $this->sdb->query($query, array( $resourceID ));\n\n return true;\n }", "public function deleting()\n {\n # code...\n }", "function sendDeleteCmd($resource) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($request, CURLOPT_FAILONERROR, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n\n $result = curl_exec($request);\n return json_decode($result, true);\n }", "public function destroy($id)\n {\n $action=Action::find($id);\n $existingInPivot=Action::with('getResources')->where('id',$action->id)->get();\n foreach ($existingInPivot as $e) {\n $existingResources=[];\n foreach ($e->getResources as $existingResource) {\n $existingResources[]=$existingResource->id;\n }\n }\n\n try {\n DB::transaction(function () use ($action,$existingResources) {\n $action->delete();\n for ($i=0; $i <count($existingResources) ; $i++) { \n $action->getResources()->detach($existingResources[$i]);\n }\n });\n } catch (Exception $exc) {\n session()->flash('message.type', 'danger');\n session()->flash('message.content', 'Erreur lors de la suppression');\n// echo $exc->getTraceAsString();\n }\n session()->flash('message.type', 'success');\n session()->flash('message.content', 'Action supprimer avec succès!');\n return redirect()->route('actions.index');\n}", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public static function delete(){\r\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function deleteAction()\n {\n \n }", "public function deleteAction()\n {\n // delete file resources via Post array\n if ($this->_request->isPost()) {\n foreach ($this->_request->getPost('selectedFiles') as $fileUri) {\n $fileUri = rawurldecode($fileUri);\n $this->_deleteFile($fileUri);\n }\n\n $url = new OntoWiki_Url(array('controller' => 'files', 'action' => 'manage'), array());\n $this->_redirect((string)$url);\n } else if (isset($this->_request->setResource)) {\n // delete a resource via get setResource parameter\n $fileUri = rawurldecode($this->_request->setResource);\n $this->_deleteFile($this->_request->setResource);\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment deleted', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n // action just requested without anything\n $this->_forward('manage', 'files');\n }\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->resource);\n\t\t\tunset($this->methods);\n\t\t\tunset($this->name);\n\t\t}", "public function destroy($id)\n {\n /*// Get article\n $article = Article::findOrFail($id);\n\n if($article->delete()) {\n return new ArticleResource($article);\n }*/ \n }", "public function delete()\n\t{\n\t}", "function destroy(){\n\t\tif(!$this->id)\n\t\t\tthrow new APortalException(\"Can't destroy object does not exist in database\",$this);\n\n\t\t$this->hook('destroy'); // can be used for access control or cache deletion\n\n\t\t// STEP1 - destroy relations\n\t\t$this->api->deleteRel($this,null);\n\t\t$this->api->deleteRel(null,$this);\n\n\t\t// STEP2 - destroy supplimentary table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table($this->table_name)\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\n\t\t// STEP3 - delete obj table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table('obj')\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\t}", "function testDeleteHard() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\");\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$cid = $obj->save(false);\r\n\t\t$obj->remove(); // Soft delete\r\n\t\tunset($obj);\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$obj->remove(); // Hard delete\r\n\r\n\t\tif (!$dbh->GetNumberRows($dbh->Query(\"select id from customers where id='$cid'\")))\r\n\t\t\t$this->assertFalse(false);\r\n\t\telse\r\n\t\t\t$this->assertFalse(true);\r\n\t}", "public function forceDelete();", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}" ]
[ "0.7185629", "0.6980644", "0.66985935", "0.6495744", "0.64732426", "0.6464758", "0.6454451", "0.63758194", "0.63742036", "0.6359977", "0.62655574", "0.6264933", "0.6247014", "0.61904836", "0.61854434", "0.6162815", "0.61621654", "0.6136099", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.60952383", "0.60841507", "0.606476", "0.6051856", "0.60326695", "0.60222876", "0.60202885", "0.60185766", "0.5995643", "0.59944695", "0.5993605", "0.59926695", "0.59926015", "0.59926015", "0.5981016", "0.59568405", "0.59482306", "0.5944841", "0.5933248", "0.59059054", "0.59059054", "0.5891479", "0.5886918", "0.58841777", "0.5878271", "0.5876752", "0.58757806", "0.5863605", "0.582153", "0.582153", "0.5814864", "0.5814061", "0.5814061", "0.5814061", "0.5814061", "0.580964", "0.58090436", "0.58086574", "0.578154", "0.5780844", "0.5779181", "0.57694757", "0.5764186", "0.5760238", "0.57552344", "0.57544696", "0.5743851", "0.57393485", "0.5734905", "0.5727449", "0.5726768", "0.5722062", "0.57193613", "0.57193613", "0.57133734", "0.5711241", "0.5711241", "0.5711212", "0.57058984", "0.5684402", "0.5683509", "0.56806356", "0.567805", "0.56761694", "0.5669041", "0.5666816", "0.5666052" ]
0.7421805
0
/ reactivateResource reactivates resources
/ reactivateResource повторно активирует ресурсы
public function reactivateResource() { $database = new Database(); $id = $this->_params['id']; $database->reactivateResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reactivateAction()\n {\n $this->reactivateParameters = $this->reactivateParameters + $this->_reactivateExtraParameters;\n\n parent::reactivateAction();\n }", "public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeActive', array(\n 'title' => t('Reactivate recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "function _deactivate() {}", "public function deactivate_resource($resource_id, $page)\n\t{\n\t\tif($this->resource_model->deactivate_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been disabled');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be disabled');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function _deactivate() {\r\n\t\t// Add deactivation cleanup functionality here.\r\n\t}", "public function recycle(){\n $qry = new InvokePostMethodQuery($this->getResourcePath(),\"recycle\");\n $this->getContext()->addQuery($qry);\n }", "private function activateResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->activateResource($resource);\n $this->validateActivatedResource($blueprint, $resource);\n }", "public function deactivate(): void;", "public function deactivate();", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "abstract public function deactivate();", "public static function deactivate() {\n\t}", "public static function deactivate() {\n\n }", "public static function deactivate()\n\t{\n\n\t}", "public static function deactivate ()\n\t{\n\t}", "function deactivate() {\n\t}", "public function deactivate() {\n\n }", "public function deactivate() {\n\n }", "function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }", "public static function deactivate()\n {\n }", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "public function refresh()\n {\n // Several refresh() calls might happen during one request. If that is the case, the Resource Manager can't know\n // that the first created resource object doesn't have to be persisted / published anymore. Thus we need to\n // delete the resource manually in order to avoid orphaned resource objects:\n if ($this->resource !== null) {\n $this->resourceManager->deleteResource($this->resource);\n }\n\n parent::refresh();\n $this->renderResource();\n }", "public static function activate() {\n\t\t\tdelete_site_transient('update_themes');\n\t\t\tdelete_site_transient('storefront_latest_tag');\n\t\t}", "protected function deactivateSelf() {}", "public function deactivateAction()\n {\n $this->deactivateParameters = $this->deactivateParameters + $this->_deactivateExtraParameters;\n\n parent::deactivateAction();\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function register_deactivation();", "public function deallocate_resource_from_user($resource_id) {\n $sql = 'UPDATE resources\n SET is_allocated = :is_allocated\n WHERE id = :id';\n\n $data = [\n ':id' => $resource_id,\n ':is_allocated' => false,\n ];\n\n $query = $this->pdo->prepare($sql);\n $query->execute($data);\n }", "function revoke()\n\t{\n\t}", "function sunrail_api_deactivation() {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n}", "public static function deactivate(){\n // Do nothing\n }", "public function manageroleandresourceAction()\n {\n if ($this->_request->isPost()) {\n $rid = (int)$this->_request->getPost('rid');\n $aryChecked = $this->_request->getPost('chkRes');\n\n require_once 'Admin/Bll/Role.php';\n $bllRole = Admin_Bll_Role::getDefaultInstance();\n $result = $bllRole->updateRoleOfResource($rid, $aryChecked);\n\n echo $result ? 'true' : 'false';\n }\n }", "public static function deactivate() {\n\t\t// Do nothing.\n\t}", "function deactivate() {\n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }", "public function activate_resource($resource_id, $page)\n\t{\n\t\tif($this->resource_model->activate_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been activated');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be activated');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['Active']);\n $this->_f3->set('Resource', $availableResource);\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function deactivate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 0]);\n }\n\n $this->resetSelected();\n }", "public function deactivate()\n {\n $this->op->request('DELETE', '/api/prom/configs/deactivate', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate() {\n\t\t\t// Do nothing\n\t\t}", "public function reactivate(Deshabilitar_horarios_especialista $deshabilitar_horarios_especialista)\n\t{\n\t\t$deshabilitar_horarios_especialista->active_flag = 1;\n\t\t$deshabilitar_horarios_especialista->save();\n\n\t\treturn redirect()->route('deshabilitar_horarios_especialistas.index');\n\t}", "function emp_activate() {\n\tglobal $wp_rewrite;\n \t$wp_rewrite->flush_rules();\n}", "public function deactivateService() {}", "public function setResource($resource);", "function recycle()\n\t{\n\t\t$table_linked_resources = Database :: get_course_table(TABLE_LINKED_RESOURCES, $this->course->destination_db);\n\t\t$table_item_properties = Database::get_course_table(TABLE_ITEM_PROPERTY);\n\t\tforeach ($this->course->resources as $type => $resources)\n\t\t{\n\t\t\tforeach ($resources as $id => $resource)\n\t\t\t{\n\t\t\t\t$sql = \"DELETE FROM \".$table_linked_resources.\" WHERE (source_type = '\".$type.\"' AND source_id = '\".$id.\"') OR (resource_type = '\".$type.\"' AND resource_id = '\".$id.\"') \";\n\t\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t\t$sql = \"DELETE FROM \".$table_item_properties.\" WHERE tool ='\".$resource->get_tool().\"' AND ref=\".$id;\n\t\t\t\tapi_sql_query($sql);\n\t\t\t}\n\t\t}\n\t\t$this->recycle_links();\n\t\t$this->recycle_link_categories();\n\t\t$this->recycle_events();\n\t\t$this->recycle_announcements();\n\t\t$this->recycle_documents();\n\t\t//$this->recycle_forums();\n\t\t//$this->recycle_forum_categories();\n\t\t$this->recycle_quizzes();\n\t\t$this->recycle_surveys();\n\t\t$this->recycle_learnpaths();\n\t\t$this->recycle_cours_description();\n\t}", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "public function revert(){\n\t}", "public function deactivate($id)\n {\n // Get the resource\n $object = $this->find($id);\n // Make sure we can deactivate\n if (! $object->isDeactivationAllowed()) {\n $this->throwException($this->error('deactivation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('deactivating', [$object]);\n\n // Deactivate the resource\n $object->active = false;\n $object->activated_at = null;\n\n // Validate the resource\n if ($object->isInvalid('deactivating') || !$object->save()) {\n $this->throwException($object->getErrors(), $this->error('deactivate'));\n }\n\n // Fire after listeners\n $this->eventFire('deactivated', [$object]);\n\n return $object;\n }", "public static function deactivate() {\n\n\t\tflush_rewrite_rules();\n\n\t}", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}", "public static function deactivate()\n {\n // Do nothing\n }", "public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "function deactivate_wp_book() {\n Inc\\Base\\Deactivate::deactivate();\n}", "public function deactivate($id = null, $delete_superfluous_associations = false)\n { \n // Find the requested item\n $recipe = $this->find('first', array('conditions' => array('Recipe.id' => $id)));\n\n // Does the item exist?\n if(empty($recipe))\n {\n // Tell the user that the requested item did not exist \n SessionComponent::setFlash(' Denne opskrift findes ikke. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n // Is the item active?\n else if(!$recipe['Recipe']['is_active'])\n {\n // Tell the user that the requested item already is inactive\n SessionComponent::setFlash(' Denne opskrift er allerede inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Was the save a failure?\n $this->id = $recipe['Recipe']['id'];\n\n if(!$this->saveField('is_active', 0))\n { \n // Tell the user that the is_active property was not changed.\n SessionComponent::setFlash(' Opskriften blev ikke sat som inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Delete all associations that are superfluous\n if($delete_superfluous_associations)\n {\n if(!$this->RecipesYarn->deleteAll(array('RecipesYarn.recipe_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive opskrift til garnkvaliteterne blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n }\n }\n\n // If the image of this recipe exists_delete it\n if(FileComponent::fileExists($recipe['Recipe']['id'], 'png', true , 'recipes'))\n {\n if(!FileComponent::deleteFile($recipe['Recipe']['id'], 'png', true , 'recipes'))\n {\n // Inform the user that the file is still on the server\n SessionComponent::setFlash('Billedet til dette opskrift blev ikke slettet og ligger stadig på serveren.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n } \n }\n\n // If the file of this recipe exists_delete it\n if(FileComponent::fileExists($recipe['Recipe']['id'], 'pdf', false , 'recipes'))\n {\n if(!FileComponent::deleteFile($recipe['Recipe']['id'], 'pdf', false , 'recipes'))\n {\n // Inform the user that the file is still on the server\n SessionComponent::setFlash('PDF-filen til dette opskrift blev ikke slettet og ligger stadig på serveren.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n } \n }\n\n // It went well\n return true;\n }", "public function reinit()\n {\n }", "function egsr_deactivation(){\n egsr_add_default_wp_roles();\n}", "public function plugin_deactivate(){\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "public function plugin_deactivate(){\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "public static function es_deactivation() {\n\t}", "public function reactivateUser($userId)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->urlParameter(\"reactivate\", true)\n ->put()\n ->go();\n }", "function deactivate() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t$scheduler->clear();\n}", "public function deactivate($username);", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function deactivate() {\n\t\tflush_rewrite_rules();\n\t}", "public function reActivate()\n {\n $response = $this->response();\n $config = [\n ['field' => 'userid', 'label' => '', 'rules' => 'trim|required|integer'],\n ['field' => 'activationemail', 'label' => '', 'rules' => 'trim|required|min_length[4]|max_length[100]|valid_email']\n ];\n $this->form_validation->set_rules($config);\n if ($this->form_validation->run() === false) {\n $response[\"errors\"] = $this->form_validation->error_array();\n $this->output->set_output(json_encode($response));\n return false;\n }\n $userID = $this->input->post('userid');\n $email = $this->input->post('activationemail');\n if ($this->oauth_web->reActivate($userID, $email) === true) {\n $response[\"status\"] = true;\n $response[\"msg\"] = $this->lang->line(\"reActivate_ok\");\n }\n $this->output->set_output(json_encode($response));\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public static function reassign() {\n\n\t\t}", "function deactivate_aws_qrc() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class_aws_qrc_deactivator.php';\n\tAws_Qrc_Deactivator::deactivate();\n}", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public function revert();", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "function activate() {\n\t\tregister_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );\n\t}", "function deactivator()\n{\n require_once plugin_dir_path( __FILE__ ) . 'includes/Deactivator.php';\n\tDeactivator::deactivate();\n}", "public function plugin_deactivate() {\r\n\r\n\t}", "public function deactivate($id = null)\n { \n // Find the requested item\n $yarn = $this->find('first', array('conditions' => array('Yarn.id' => $id)));\n\n // Does the item exist?\n if(empty($yarn))\n {\n // Tell the user that the requested item did not exist \n SessionComponent::setFlash(' Denne garnkvalitet findes ikke. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n // Is the item active?\n else if(!$yarn['Yarn']['is_active'])\n {\n // Tell the user that the requested item already is inactive\n SessionComponent::setFlash(' Denne garnkvalitet er allerede inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Was the save a failure?\n $this->id = $yarn['Yarn']['id'];\n\n if(!$this->saveField('is_active', 0))\n { \n // Tell the user that the is_active property was not changed.\n SessionComponent::setFlash(' Garnkvaliteten blev ikke sat som inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Deactivate its children\n if(!empty($yarn['YarnVariant']))\n { \n // Run through every relation\n foreach ($yarn['YarnVariant'] as $i => $yarn_variant)\n { \n // Check if the yarn_variant is active\n if($yarn_variant['is_active'] == 1)\n { \n $this->YarnVariant->deactivate($yarn_variant['id']); \n }\n } \n }\n\n\n if(!$this->CareLabelsYarn->deleteAll(array('CareLabelsYarn.yarn_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive garnkvalitet til vaskemærker blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n if(!$this->YarnPart->deleteAll(array('YarnPart.yarn_id' => $id)))\n {\n // Tell the user that the relations to yarn_parts was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive garnkvalitet til dets bestanddele blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n if(!$this->RecipesYarn->deleteAll(array('RecipesYarn.yarn_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive opskrift til garnkvaliteterne blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n \n\n // It went well\n return true;\n }", "public function restored(SecKillAppliesRegister $secKillAppliesRegister)\n {\n //\n }", "public function restoreOriginalService(): void;", "public function setReactivated(\\DateTime $reactivated) {\n\n $this->reactivated = $reactivated->format('Y-m-d H:i:s');\n\n }", "function deactivation_hook() {\n\n\t}", "protected function releaseResource($process, $resource)\n {\n $processLoc = $process;\n $resourceLoc = ($this->np - 1) + $resource;\n\n // $this->graph->removeEdge($processLoc, $resourceLoc);\n $this->graph->removeEdge($resourceLoc, $processLoc);\n\n }", "public function deactivate()\n {\n $this->setTheme(null);\n $this->removeSymlink();\n }", "private function releaseResource(DrydockResource $resource) {\n $viewer = $this->getViewer();\n $drydock_phid = id(new PhabricatorDrydockApplication())->getPHID();\n\n $resource->openTransaction();\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_RELEASED)\n ->save();\n\n // TODO: Hold slot locks until destruction?\n DrydockSlotLock::releaseLocks($resource->getPHID());\n $resource->saveTransaction();\n\n $statuses = array(\n DrydockLeaseStatus::STATUS_PENDING,\n DrydockLeaseStatus::STATUS_ACQUIRED,\n DrydockLeaseStatus::STATUS_ACTIVE,\n );\n\n $leases = id(new DrydockLeaseQuery())\n ->setViewer($viewer)\n ->withResourcePHIDs(array($resource->getPHID()))\n ->withStatuses($statuses)\n ->execute();\n\n foreach ($leases as $lease) {\n $command = DrydockCommand::initializeNewCommand($viewer)\n ->setTargetPHID($lease->getPHID())\n ->setAuthorPHID($drydock_phid)\n ->setCommand(DrydockCommand::COMMAND_RELEASE)\n ->save();\n\n $lease->scheduleUpdate();\n }\n\n $this->destroyResource($resource);\n }", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}", "function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}", "function activate() {\n }", "public static function _deactivate()\n\t{\n\t\tif( empty(self::$page_ids) )\n\t\t\terror_log('ABNOT@deactivate: Empty $page_ids!');\n\n\t\tforeach( self::$tools as $tool => $t )\n\t\t{\n\t\t\t$pid = get_page_by_title($t['title'], 'OBJECT', 'page');\n\t\t\twp_update_post(array('ID' => $pid->ID, 'post_status' => 'draft'));\n\t\t}\n\t}", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "public function setOriginalResource($originalResource) {\n\t\t$this->originalResource = $originalResource;\n\t}", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }", "public static function setCurrentAclResources(array $resources)\n {\n self::$currentAclResources = $resources; \n }", "public function fix_after_deactivation() {\n\t\t$exs = new Util_Environment_Exceptions();\n\n\t\ttry {\n\t\t\t$this->delete_addin();\n\t\t} catch ( Util_WpFile_FilesystemOperationException $ex ) {\n\t\t\t$exs->push( $ex );\n\t\t}\n\n\t\t$this->unschedule();\n\n\t\tif ( count( $exs->exceptions() ) > 0 )\n\t\t\tthrow $exs;\n\t}" ]
[ "0.64953566", "0.6302144", "0.60357034", "0.589782", "0.5866548", "0.58366936", "0.5817751", "0.5729667", "0.5701669", "0.5700907", "0.5700907", "0.5695641", "0.569047", "0.56877214", "0.5616308", "0.559881", "0.5586113", "0.55649954", "0.55649954", "0.554401", "0.55416965", "0.5470191", "0.5430438", "0.54117596", "0.5391087", "0.5388591", "0.5374472", "0.53197235", "0.53017205", "0.52997714", "0.52931684", "0.5266092", "0.5251839", "0.52337635", "0.52303475", "0.520124", "0.5195637", "0.5193949", "0.5192909", "0.5182277", "0.5182224", "0.5181582", "0.5179078", "0.5179078", "0.517859", "0.5156866", "0.5153019", "0.5145458", "0.5138998", "0.5096731", "0.5086186", "0.5086186", "0.50687486", "0.5064011", "0.5036331", "0.5027125", "0.50206363", "0.5016872", "0.5006951", "0.50022906", "0.49854895", "0.49641564", "0.4964036", "0.4964036", "0.49549073", "0.49511454", "0.49480116", "0.4933769", "0.49304503", "0.49226084", "0.4912256", "0.49107212", "0.49047133", "0.49046046", "0.4903227", "0.49007264", "0.49001396", "0.48964897", "0.48947206", "0.48862344", "0.48845476", "0.48347872", "0.48142397", "0.48056987", "0.4800549", "0.479662", "0.47925672", "0.47878525", "0.47855765", "0.4785162", "0.47780725", "0.47743112", "0.47738603", "0.474662", "0.47451574", "0.47366762", "0.47332478", "0.47311535", "0.4731134", "0.47181845" ]
0.8236729
0
/ viewResources Loads from the db all active AND current events and renders the resources page
/ viewResources Загружает из базы данных все активные и текущие события и отображает страницу ресурсов
public function viewResources() { $database = new Database(); $resources = $database->getAllActiveResourcesNoLimit(); $resourceArray = array(); $i = 1; foreach ($resources as $resource) { $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['active']); array_push($resourceArray, $availableResource); $i += 1; } $resourceSize = sizeof($resourceArray); $this->_f3->set('resourcesByActive', $resourceArray); $this->_f3->set('resourcesSize', $resourceSize); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "public function LoadAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n return $this->render('events/updatesAjax.html.twig', array(\n 'events' => $events,\n ));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function loadEvents() {\n $events = Event::orderBy('date', 'desc')->paginate(10);\n \n return view('cms.events', ['events' => $events]);\n }", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "public function viewAllEvents();", "public function index()\n {\n \n return EventResource::collection(Event::all());\n\n\n }", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n\n return $this->render('events/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function viewEvents();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function index() {\n $this->seo(array(\n \"title\" => \"All Events List\",\n \"keywords\" => \"events, new events, event management, create event, event tickets, book event tickets\",\n \"description\" => \"Display all the latest events. Filter the events by categories, location and much more. Register yourself to turn your passion into your business\",\n \"view\" => $this->getLayoutView()\n ));\n $view = $this->getActionView();\n\n $title = RequestMethods::get(\"title\", \"\");\n $category = RequestMethods::get(\"category\", \"\");\n $type = RequestMethods::get(\"type\", \"\");\n $limit = RequestMethods::get(\"limit\", 10);\n $page = RequestMethods::get(\"page\", 1);\n $where = array(\n \"title LIKE ?\" => \"%{$title}%\",\n \"category LIKE ?\" => \"%{$category}%\",\n \"type LIKE ?\" => \"%{$type}%\",\n \"live = ?\" => true\n );\n $events = Event::all($where, array(\"*\"), \"created\", \"desc\", $limit, $page);\n $count = Event::count($where);\n\n $view->set(\"events\", $events);\n $view->set(\"limit\", $limit);\n $view->set(\"page\", $page);\n $view->set(\"count\", $count);\n $view->set(\"title\", $title);\n $view->set(\"type\", $type);\n $view->set(\"category\", $category);\n }", "public function index() {\n\t\t$this->load->helper('date');\n\t\t$data['events'] = $this->event_model->get();\n\t\tfor($iii = 0; $iii < sizeof($data['events']); $iii++) {\n\t\t\t$event_info = $this->event_info_model->get_event($data['events'][$iii]['event_id']);\n\t\t\t$data['events'][$iii]['info'] = $event_info;\n\t\t\tif($event_info != NULL) {\n\t\t\t\t$data['events'][$iii]['account'] = $this->account_model->get($event_info->event_accounts_account_id);\n\t\t\t} else {\n\t\t\t\t$data['events'][$iii]['account'] = NULL;\n\t\t\t}\n\t\t}\n\n\t\t$data['content'] = 'events/index';\n\t\t$data['stylesheets'] = 'events/index_stylesheets';\n\t\t$data['scripts'] = 'events/index_scripts';\n\t\t$data['title'] = 'Events';\n\t\t$data['sub_title'] = 'The page for the events';\n\t\t$this->load->view($this->layout, $data);\n\t}", "public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }", "public function viewAddResources()\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }", "public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $dataProvider = new CActiveDataProvider(\n Events::model()->upcoming()->active()\n );\n //$events = Events::model()->findAll(\"start_date>= '\" . date('Y-m-d') . \"' AND is_active=1\");\n $this->render('//events/index', array('dataProvider' => $dataProvider));\n }", "public function listEventsAction()\n {\n $events = $this->getDoctrine()->getRepository('AppBundle:Event')->findEventsByManager($this->getUser());\n\n return $this->render('AppBundle:frontend/manager:event_list.html.twig', [\n 'events' => $events,\n ]);\n }", "public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }", "public function index()\n {\n return view(\"admin.event\")->with([\n \"events\" => Event::query()->orderBy(\"created_at\", \"desc\")->paginate()\n ]);\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function action_index()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t//return Response::forge(View::forge('event/index',$data));\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "public function indexAction()\n {\n /* $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('EventBundle:Event')->findAll();\n\n return array(\n 'events' => $events,\n );*/\n return array();\n }", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public function getAllAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $thisEventDate = $em->getRepository('AtkRegistrationBundle:EventDate')->findAll();\n \n if (!$thisEventDate) {\n throw $this->createNotFoundException('Unable to find EventDate entity.');\n }\n \n return $this->render('AtkRegistrationBundle:EventDate:eventdate.html.twig', array('eventdate' => $thisEventDate));\n }", "public function actionEventManagement(){\n $accessUser = [role::ADMIN, role::MEMBER]; // which user(role_id) has permission to join the page\n User::checkUserPermissionForPage($accessUser);\n\n\n $this->_params['title'] = 'Eventverwaltung';\n\n if(isset($_GET['eventId'])) {\n $dataDir = 'assets/images/upload/events/';\n unlink($dataDir . $_GET['pictureName']);\n Booking::deleteWhere('EVENT_ID = '.$_GET['eventId']);\n Event::deleteWhere('ID = ' . $_GET['eventId']);\n sendHeaderByControllerAndAction('event', 'EventManagement');\n }\n\n\n $sortEvent = 'ORDER BY DATE';\n $sortEventOld = 'ORDER BY DATE';\n\n if(isset($_GET['sortEvent'])) {\n $sortEvent = Event::generateSortClauseForEvent($_GET['sortEvent']);\n }\n\n if(isset($_GET['sortEventOld'])) {\n $sortEventOld = Event::generateSortClauseForEvent($_GET['sortEventOld']);\n }\n\n\n $this->_params['eventList'] = Event::find('DATE >= CURDATE()', null, $sortEvent);\n $this->_params['eventListOld'] = Event::find('DATE < CURDATE()', null, $sortEventOld);\n\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function actionIndex()\n {\n $featured = Event::find()->where(['is_featured' => 1])->all();\n return $this->render('index', compact('featured'));\n }", "public function viewAction()\n {\n \t$idEmployee = EmployeeCatalog::getInstance()->getIdEmployeeByIdUser($this->getUser()->getBean()->getIdUser());\n \t$projects = ProjectCatalog::getInstance()->getIdProjectByIdEmployee($idEmployee); \t\n \tforeach ($projects as $project)\n \t{\n \t\t$tmp[]=$project['id_project'];\n\t\t}\n\t\t$stringProjects = implode(\",\",$tmp);\n\t\t$strProjects='\"';\t\n\t\t$strProjects.= implode(\",\",$tmp);\n\t\t$strProjects.='\"';\t\n\t\t$dates = TimetableHourCatalog::getInstance()->getDisctinctDateByIdProjects($stringProjects);\n \tforeach ($dates as $date)\n \t{\n \t\t$date = $date['date'];\n \t\t$statusTask= TimetableHourCatalog::getInstance()->getStatusByDate($date);\n \t\tif ($statusTask == 2)\n \t\t\t$dateArray2[] = $date;\n \t\tif ($statusTask == 3)\n \t\t\t$dateArray3[] = $date;\n \t\tif ($statusTask == 4)\n \t\t\t$dateArray4[] = $date;\n \t\tif ($statusTask == 1)\n \t\t\t$dateArray1[] = $date;\n\t\t}\t\t\n\t\t$datesStatus2=CalendarDayManager::getInstance()->getCalendarDays($dateArray2);\n\t\t$datesStatus3=CalendarDayManager::getInstance()->getCalendarDays($dateArray3);\n\t\t$datesStatus4=CalendarDayManager::getInstance()->getCalendarDays($dateArray4);\n\t\t$datesStatus1=CalendarDayManager::getInstance()->getCalendarDays($dateArray1);\n\t\t$this->view->daysStaus2= json_encode($datesStatus2);\n\t\t$this->view->daysStaus3= json_encode($datesStatus3);\n\t\t$this->view->daysStaus4= json_encode($datesStatus4);\n\t\t$this->view->daysStaus1= json_encode($datesStatus1); \n\t\t$this->view->projects = $strProjects; \t\t\n $this->setTitle('Calendario de Tareas');\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function index()\n\t{\n\n\t\t$data['events'] = Event_Manager::paginate(15);\n\t\t$data['page_title'] = 'Events';\n\t\treturn View::make('clientside.events.index',$data);\n\t\t\n\t}", "function showEvents() {\r\n\r\n\t// Lets import some globals, shall we?\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\tglobal $TIMEMARK;\r\n\t$delta = $TIMEMARK -259200;\r\n\t\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\r\n\t// Load all events.\r\n\t$EVENTS_DS = $DB->query(\"SELECT * FROM events WHERE starttime >= '\" . $delta . \"' ORDER BY starttime ASC\");\r\n\r\n\t// .. right?\r\n\tif ($EVENTS_DS->numRows() >= 1) {\r\n\r\n\t\t// Lets keep in mind: We have events.\r\n\t\t$haveEvents = true;\r\n\r\n\t\twhile ($event = $EVENTS_DS->fetchRow()) {\r\n\r\n\t\t\t// get the date.\r\n\t\t\t$date = date(\"d.m.y\", $event[starttime]);\r\n\r\n\t\t\t// open up a new table for each day.\r\n\t\t\tif ($date != $previousdate) {\r\n\r\n\t\t\t\t$workday = date(\"l\", $event[starttime]);\r\n\r\n\t\t\t\tif ($beenhere) {\r\n\t\t\t\t\t$html .= $temp->flush();\r\n\t\t\t\t\t$html .= \"<br>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$beenhere = true;\r\n\r\n\t\t\t\t// We need an additional row if we are allowed to delete events.\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp = new table(8, true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$temp = new table(7, true);\r\n\t\t\t\t}\r\n\t\t\t\t$temp->addHeader(\">> Events for \" . $workday . \", the \" . $date);\r\n\t\t\t\t$previousdate = $date;\r\n\r\n\t\t\t\t$temp->addRow(\"#060622\");\r\n\t\t\t\t$temp->addCol(\"ID\");\r\n\t\t\t\t$temp->addCol(\"Starttime\");\r\n\t\t\t\t$temp->addCol(\"Starts in / Runs for\");\r\n\t\t\t\t$temp->addCol(\"Mission Type\");\r\n\t\t\t\t$temp->addCol(\"Short Description\");\r\n\t\t\t\t$temp->addCol(\"System\");\r\n\t\t\t\t$temp->addCol(\"Security\");\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp->addCol(\"Delete\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Add Event to the current database.\r\n\t\t\t$temp->addRow();\r\n\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=showevent&id=\" . $event[id] . \"\\\">\" . str_pad($event[id], 4, \"0\", STR_PAD_LEFT) . \"</a>\");\r\n\t\t\t$temp->addCol(date(\"d.m.y H:i\", $event[starttime]));\r\n\r\n\t\t\t$delta = $TIMEMARK - $event[starttime];\r\n\t\t\tif ($TIMEMARK > $event[starttime]) {\r\n\t\t\t\t// Event underway.\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#00ff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t} else {\r\n\t\t\t\t// Event not started yet.\r\n\t\t\t\t$delta = $delta * -1;\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#ffff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t}\r\n\r\n\t\t\t$temp->addCol($event[type]);\r\n\t\t\t$temp->addCol($event[sdesc]);\r\n\t\t\t$temp->addCol($event[system]);\r\n\t\t\t$temp->addCol($event[security]);\r\n\t\t\t\r\n\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=deleteevent&id=$event[id]\\\">delete event</a>\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Lets recall, did we have events scheduled?\r\n\tif ($haveEvents) {\r\n\t\t// We do!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2>\" . $html . $temp->flush();\r\n\t} else {\r\n\t\t// We dont!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2><b>There are currently no scheduled events in the database.</b>\";\r\n\t}\r\n\t// Return what we got.\r\n\treturn ($html);\r\n\r\n}", "public function actionIndex()\r\n\t{\r\n\t\t$account_id = Yii::app()->user->id;\r\n\r\n\t\tif($account_id != null)\r\n\t\t{\r\n\t\t\t$events = Event::model()->findAll(\"status_id = 1\");\r\n\t\t\t\t\r\n\t\t\t$eventsDP = new CArrayDataProvider($events, array(\r\n\t\t\t\t\t'pagination' => array(\r\n\t\t\t\t\t\t'pageSize' => 10,\r\n\t\t\t\t\t)\r\n\t\t\t));\r\n\r\n\t\t\t$this->render('index',array(\r\n\t\t\t\t'eventsDP'=>$eventsDP,\r\n\t\t\t\t'events'=>$events,\r\n\t\t\t));\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->redirect(array('site/login'));\r\n\r\n\t}", "function studentResources(){\n // show the student resources page\n echo Template::instance()->render('views/studentResources.php');\n}", "public function index()\n {\n $events = Event::get();\n return response()->view('admin.events.index', ['events' => $events ]);\n }", "public function index($resourceId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n return view('events.eventables.index', compact('eventable', 'routes'));\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n $events = Event::all();\n return view('events::list_events',compact('events'));\n\n }", "public function index()\n {\n\n $sidebar_items = array(\n \"List Events\" => array('url' => URL::route('event.index'), 'icon' => '<i class=\"fa fa-users\"></i>'),\n );\n $FillableDropdown = new FillableDropdown();\n $active = $FillableDropdown->active($default = 2);\n $accessibility = $FillableDropdown->accessibility($default = 2);\n $operations = $FillableDropdown->eventOperations($default = 2);\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n }\n\n if (isset($user_id)) {\n\n $users = User::findOrFail($user_id);\n }\n $events = Events::orderBy('name', 'asc')->paginate(20);\n\n return view('events.event_listing_page', compact('events', 'users', 'active', 'accessibility', 'operations', 'sidebar_items'));\n\n }", "public function actionIndex()\n {\n $query_event = Event::find()->where(['>', 'start_date', date('Y-m-d')]);\n\n $data['total_event'] = $query_event->count();\n $data['events'] = $query_event->limit(10)->orderBy(['start_date'=>SORT_ASC])->all();\n\n $data['total_speaker'] = Speaker::find()->count();\n\n $data['total_joined_event'] = EventJoin::find()->where(['user_id' => Yii::$app->user->id])->count();\n\n\n return $this->render('index', $data);\n }", "public function index()\n {\n Event::all();\n }", "function displayLatestEvents()\n\t{\n\t\t$viewname = $this->getTheme();\n\n\t\t$cfg = JEVConfig::getInstance();\n\n\t\t// override global start now setting so that timelimit plugin can use it!\n\t\t$compparams = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t$startnow = $compparams->get(\"startnow\", 0);\n\t\t$compparams->set(\"startnow\", $this->modparams->get(\"startnow\", 0));\n\t\t$this->getLatestEventsData();\n\t\t$compparams->set(\"startnow\", $startnow);\n\n\t\t$content = \"\";\n\n\t\t$k = 0;\n\t\tif (isset($this->eventsByRelDay) && count($this->eventsByRelDay))\n\t\t{\n\t\t\t$content .= $this->getModuleHeader('<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">');\n\n\t\t\t// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array\n\t\t\t// and work our way up.\n\n\t\t\t$firstTime = true;\n\n\t\t\t// initialize name of com_jevents module and task defined to view\n\t\t\t// event detail. Note that these could change in future com_event\n\t\t\t// component revisions!! Note that the '$this->itemId' can be left out in\n\t\t\t// the link parameters for event details below since the event.php\n\t\t\t// component handler will fetch its own id from the db menu table\n\t\t\t// anyways as far as I understand it.\n\n\t\t\t$this->processFormatString();\n\n\t\t\tforeach ($this->eventsByRelDay as $relDay => $daysEvents)\n\t\t\t{\n\n\t\t\t\treset($daysEvents);\n\n\t\t\t\t// get all of the events for this day\n\t\t\t\tforeach ($daysEvents as $dayEvent)\n\t\t\t\t{\n\n\t\t\t\t\tif ($this->processTemplate($content, $dayEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$eventcontent = \"\";\n\n\t\t\t\t\t// generate output according custom string\n\t\t\t\t\tforeach ($this->splitCustomFormat as $condtoken)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (isset($condtoken['cond']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($condtoken['cond'] == 'a' && !$dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!a' && $dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate() != $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ($condtoken['data'] as $token)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($match);\n\t\t\t\t\t\t\tunset($dateParm);\n\t\t\t\t\t\t\t$dateParm = \"\";\n\t\t\t\t\t\t\t$match = '';\n\t\t\t\t\t\t\tif (is_array($token))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token['keyword'];\n\t\t\t\t\t\t\t\t$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (strpos($token, '${') !== false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$eventcontent .= $token;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->processMatch($eventcontent, $match, $dayEvent, $dateParm, $relDay);\n\t\t\t\t\t\t} // end of foreach\n\t\t\t\t\t} // end of foreach\n\n\t\t\t\t\tif ($firstTime)\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest_first\">%s' . \"</td></tr>\\n\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest\">%s' . \"</td></tr>\\n\";\n\n\t\t\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : $eventrow;\n\t\t\t\t\t$content .= str_replace(\"%s\", $eventcontent, $templaterow);\n\n\t\t\t\t\t$firstTime = false;\n\t\t\t\t} // end of foreach\n\t\t\t\t$k++;\n\t\t\t\t$k %= 2;\n\t\t\t} // end of foreach\n\t\t\t$content .= $this->getModuleFooter(\"</table>\\n\");\n\t\t}\n\t\telse if ($this->modparams->get(\"modlatest_NoEvents\", 1))\n\t\t{\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatetop\") || $this->modparams->get(\"modlatest_templatetop\") ? $this->modparams->get(\"modlatest_templatetop\") : '<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">';\n\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : '<tr><td class=\"mod_events_latest_noevents\">%s</td></tr>' . \"\\n\";\n\t\t\t$content .= str_replace(\"%s\", Text::_('JEV_NO_EVENTS'), $templaterow);\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatebottom\") ? $this->modparams->get(\"modlatest_templatebottom\") : \"</table>\\n\";\n\t\t}\n\n\t\t$callink_HTML = '<div class=\"mod_events_latest_callink\">'\n\t\t\t. $this->getCalendarLink()\n\t\t\t. '</div>';\n\n\t\tif ($this->linkToCal == 1)\n\t\t\t$content = $callink_HTML . $content;\n\t\tif ($this->linkToCal == 2)\n\t\t\t$content .= $callink_HTML;\n\n\t\tif ($this->displayRSS)\n\t\t{\n\t\t\t$rssimg = Uri::root() . \"media/system/images/livemarks.png\";\n\t\t\t$callink_HTML = '<div class=\"mod_events_latest_rsslink\">'\n\t\t\t\t. '<a href=\"' . $this->rsslink . '\" title=\"' . Text::_(\"RSS_FEED\") . '\" target=\"_blank\">'\n\t\t\t\t. '<img src=\"' . $rssimg . '\" alt=\"' . Text::_(\"RSS_FEED\") . '\" />'\n\t\t\t\t. Text::_(\"SUBSCRIBE_TO_RSS_FEED\")\n\t\t\t\t. '</a>'\n\t\t\t\t. '</div>';\n\t\t\t$content .= $callink_HTML;\n\t\t}\n\n\t\tif ($this->modparams->get(\"contentplugins\", 0))\n\t\t{\n\t\t\t$eventdata = new stdClass();\n\t\t\t$eventdata->text = $content;\n\t\t\tFactory::getApplication()->triggerEvent('onContentPrepare', array('com_jevents', &$eventdata, &$this->modparams, 0));\n\t\t\t$content = $eventdata->text;\n\t\t}\n\n\t\treturn $content;\n\n\t}", "function ShowEvents()\n {\n $this->ReadEvents();\n echo\n $this->H(1,$this->MyLanguage_GetMessage(\"Events_Table_Title\")).\n $this->EventsHtmlTable(),\n \"\";\n }", "public function index()\n {\n\n $events = DB::table('events')\n ->where('event_date', '>', date('Y-m-d').' 00:00:00')\n ->orderBy('event_date', 'asc')\n ->take(8)\n ->get();\n\n return view('events.index')->withEvents($events);\n\n }", "function showGetEventSources() {\n\t\t$this->getEngine()->assign('oModel', utilityOutputWrapper::wrap($this->getModel()));\n\t\t$this->render($this->getTpl('sourceList', '/account'));\n\t}", "public function user_event() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $this->set('image', $allImage);\n $data = $this->User->userData($id);\n $this->set('user', $data);\n $this->loadModel('Event');\n $event = $this->Event->eventList();\n $this->set('events', $event);\n $this->render('/Users/user_event');\n }", "public function index()\n {\n \n $events = Event::all();\n return view('pages.events.index')->with(compact('events'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $ressources = $em->getRepository('AppBundle:Ressource')->findAll();\n\n return $this->render('ressource/index.html.twig', array(\n 'ressources' => $ressources,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $eventInscriptions = $em->getRepository('EHSBundle:EventInscription')->findAll();\n\n return $this->render('eventinscription/index.html.twig', array(\n 'eventInscriptions' => $eventInscriptions,\n ));\n }", "public function manage_resources($event) {\n global $DB;\n switch($event->eventname) {\n case '\\core\\event\\course_category_updated':\n $this->course_category_updated($event);\n break;\n case '\\core\\event\\course_updated':\n $this->course_updated($event);\n break;\n case '\\core\\event\\course_content_deleted':\n $this->course_content_deleted($event);\n break;\n case '\\core\\event\\course_restored':\n $this->course_restored($event);\n break;\n case '\\core\\event\\course_section_updated':\n $this->course_section_updated($event);\n break;\n case '\\core\\event\\course_module_created':\n $this->course_module_created($event);\n break;\n case '\\core\\event\\course_module_updated':\n $this->course_module_updated($event);\n break;\n case '\\core\\event\\course_module_deleted':\n $this->course_module_deleted($event);\n break;\n case '\\tool_recyclebin\\event\\course_bin_item_restored':\n $this->course_bin_item_restored($event);\n break;\n case '\\core\\event\\role_assigned':\n $this->role_assigned($event);\n break;\n case '\\core\\event\\role_unassigned':\n $this->role_unassigned($event);\n break;\n case '\\core\\event\\role_capabilities_updated':\n $this->role_capabilities_updated($event);\n break;\n case '\\core\\event\\group_member_added':\n case '\\core\\event\\group_member_removed':\n $this->group_member_added($event);\n break;\n case '\\core\\event\\grouping_group_assigned':\n case '\\core\\event\\grouping_group_unassigned':\n $this->grouping_group_assigned($event);\n break;\n case '\\core\\event\\user_enrolment_created':\n $this->user_enrolment_created($event);\n break;\n case '\\core\\event\\user_enrolment_updated':\n $this->user_enrolment_updated($event);\n break;\n case '\\core\\event\\user_enrolment_deleted':\n $this->user_enrolment_deleted($event);\n break;\n case '\\core\\event\\user_deleted':\n $this->user_deleted($event);\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_created':\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_deleted':\n break;\n default:\n return false;\n }\n return true;\n }", "public function index()\n {\n $eventTypeList = $this->EventType->getAll();\n $eventCategoryList = $this->EventCategory->getAll();\n $eventGroupList = $this->EventGroup->getAll();\n $eventPriorityList = $this->EventPriority->getAll();\n $statusList = $this->Status->getAll();\n $groupEmployee = $this->EmployeeGroup->getAll();\n $data = [\n 'eventTypeList' => $eventTypeList,\n 'eventCategoryList' => $eventCategoryList,\n 'eventGroupList' => $eventGroupList,\n 'eventPriorityList' => $eventPriorityList,\n 'statusList' => $statusList,\n 'groupEmployee' => $groupEmployee\n ];\n return view('event::index', $data);\n }", "public function index()\n {\n $data['events'] = Event::orderBy('id', 'DESC')->get();\n return view(\"Event::index\", $data);\n }", "public function onPageLoad() {\n $eventsForUser = DB::table('events')\n ->select()\n ->where('eventOrganiserId', Auth::id())\n ->get();\n return view('myEvents', array('events' => $eventsForUser));\n }", "public function indexAction() {\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t\t\n\t //Get viewer, event, search form\n\t \t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t \t$this -> view -> event = $event = Engine_Api::_() -> core() -> getSubject();\n\t\t$this -> view -> form = $form = new Ynevent_Form_Video_Search;\n\t\n\t\tif ( !$event->authorization()->isAllowed($viewer, 'view') ) { return; }\n\t \n\t // Check create video authorization\n\t\t$canCreate = $event -> authorization() -> isAllowed($viewer, 'video');\n\t\t$levelCreate = Engine_Api::_() -> authorization() -> getAdapter('levels') -> getAllowed('event', $viewer, 'video');\n\n\t\t//print_r($canCreate); exit;\n\t\t\n\t\tif ($canCreate && $levelCreate) {\n\t\t\t$this -> view -> canCreate = true;\n\t\t} else {\n\t\t\t$this -> view -> canCreate = false;\n\t\t}\n\t\n\t //Prepare data filer\n\t $params = array();\n\t $params = $this->_getAllParams();\n\t $params['title'] = '';\n\t $params['parent_type'] = 'event';\n\t $params['parent_id'] = $event->getIdentity();\n\t $params['search'] = 1;\n\t $params['limit'] = 12;\n\t $form->populate($params);\n\t $this->view->formValues = $form->getValues();\n\t //Get data\n\t //print_r($params); exit;\n\t $this -> view -> paginator = $paginator = Engine_Api::_() -> ynvideo() -> getVideosPaginator($params);\n\t if(!empty($params['orderby'])){\n\t switch($params['orderby']){\n\t case 'most_liked':\n\t $this->view->infoCol = 'like';\n\t break;\n\t case 'most_commented':\n\t $this->view->infoCol = 'comment';\n\t break;\n\t default:\n\t $this->view->infoCol = 'view';\n\t break;\n\t }\n\t }\n\t \n\t\t// Add count to title if configured\n\t if( $this->_getParam('titleCount', false) && $paginator->getTotalItemCount() > 0 ) {\n\t $this->_childCount = $paginator->getTotalItemCount();\n\t }\n\t}", "public function index()\n {\n $events = $this->eventRepository->all();\n return view('admin.event.index',compact('events'));\n }", "public function ajaxevents() {\n\t\t$pageTitle = 'Events';\n\t\t$this->autoRender = false;\n\t\t$this->viewBuilder()->setLayout(false);\n\t\t$this->loadModel('Events');\n\t\t$today = date(\"Y-m-d\");\n\t\tif ($this->request->is('ajax')) {\n\n\t\t\t$events = $this->Events->find()->where(['Events.published' => 1, 'DATE(Events.start_date) >' => $today])->order(['Events.start_date' => 'ASC'])->limit(3)->offset($this->request->getData()['offset'])->all();\n\t\t\techo json_encode(array(\"status\" => \"success\", \"data\" => $events));\n\t\t\texit;\n\n\t\t}\n\n\t}", "public function index()\n {\n $eventList = Event::all();\n return view('backEnd.events.events',compact('eventList'));\n }", "function index()\n\t\t{\n\t\t\t// get every event record\n\t\t\t$all_events = $this->calendar->get_calendar_data();\n\t\t\t\n\t\t\t$veiw_data['all_events'] = $all_events;\n\t\t\t\n\t\t\t// load the view and send the data\n\t\t\t$this->load->view('index', $veiw_data);\n\t\t}", "public function index()\n {\n $events = Event::latest()->paginate(10);\n return view('event.events', compact('events'));\n }", "public function index()\n {\n $events = Event::with('Teams', 'Teams.Members', 'Teams.Members.User', 'Teams.Members.User.Occupation', 'Teams.Members.Role', 'Teams.Category')->where([\n ['to', '>', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n $pastEvents = Event::with('Teams', 'Teams.Members', 'Teams.Category')->where([\n ['to', '<', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n\n return view('layouts.events', ['events' => $events, 'pastEvents' => $pastEvents]);\n }", "public function index()\n {\n // get all published event and 3 recent published event\n $events = Event::all()->where('status', '=', 1);\n $threeRecentEvent = Event::orderBy('created_at', 'desc')->where('status', '=', 1)->take(3)->get();\n\n return view('home')\n ->withEvents($events)\n ->withThreeRecentEvent($threeRecentEvent);\n }", "public function eventsAction(Request $request)\n {\n return $this->render('version0/events.html.twig');\n\n }", "public function index()\n {\n $navTitle = '<span class=\"micon dw dw-rocket mr-2\"></span>Event Internal';\n $eias = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->where('status', 1)->get();\n $eis = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->get();\n $eiss = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->where('status', 0)->get();\n\n return view('ormawa.event_internal.index', compact('eis', 'navTitle', 'eias', 'eiss'));\n }", "public function backend_resources()\n\t{\n\t\t$data['title'] = 'backend resources';\n\n\t\t$instructorId = $this->session->userdata('id');\n\n\t\t$data['instructorDetail'] = $this->scheduledCalendar_model->instructor_detail($instructorId);\n\t\t\n\t\t$this->load->view('instructor/include_calendar/backend_resources.php',$data);\n\t}", "public function index()\n\t{\n $events = $this->events->paginate(10);\n $no = $events->getFrom();\n return $this->view('events.index', compact('events', 'no'));\n\t}", "public function index()\n\t{\n\t\t$events = Event::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('events.index', compact('events'));\n\t}", "public function index()\n {\n $events = Events::where([\n ['event_date', '>', Carbon::now()->toDateString()],\n ['status', '=', 'PUBLISHED']\n ])\n ->latest()\n ->get();\n $items = menu('guest', '_json');\n $segment = 'Events';\n return view('pages.events', [\n 'events' => $events,\n 'items' => $items,\n 'segment' => $segment,\n ]);\n }", "public function index()\n {\n if (! Gate::allows('event_access')) {\n return abort(401);\n }\n\n $events = Event::all();\n // foreach($events as $event){\n // dd($event->subcategories);\n // }\n\n return view('admin.events.index', compact('events'));\n }", "public function show(Events $events)\n {\n //\n }", "public function index()\n {\n $events = Event::get();\n\n return view('event.index', compact('events'));\n }", "public function index()\n\t{\n\t\t$events = Eventadd::orderBy('date', 'asc')->get();\n return View::make('events.index', compact('events'));\n\t}", "public function index()\n {\n $user = auth()->user();\n\n $userUpcomingEvents = $user->interestedEvents()->current()->orderBy('start_datetime')->get();\n\n return view('auth.residents.events.index', compact('events', 'userUpcomingEvents'));\n }", "public function index()\n {\n $events = \\App\\Event::orderBy('id','DESC')->paginate(10);\n return view('admin.events.index', ['events' => $events]);\n }", "public function index()\n {\n $e = Event::all();\n return view('admin.events.index' , compact('e'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $dqlsurvey = \"SELECT sy.id,sy.title,sy.descriptions,sy.active,sy.createdOn,ev.title as event_title FROM DroidInfotechDroidBundle:Survey sy JOIN DroidInfotechDroidBundle:Events ev WITH sy.eventId=ev.id\";\n\n $surveys = $em->createQuery($dqlsurvey)->getResult();\n // print_r($surveys); \n //$surveys = $em->getRepository('DroidInfotechDroidBundle:Survey')->findAll();\n return $this->render('survey/index.html.twig', array(\n 'surveys' => $surveys,\n ));\n }", "public function index()\n\t{\n\t\treturn view('evento')->with('paginaAtual','evento');\n\t}", "public function view(){\n if (!isset($_GET[\"idactivity\"])) {\n throw new Exception(\"idactivity is mandatory\");\n }\n\n\n $activityid = $_GET[\"idactivity\"];\n\n // Recuperar distintas actividades según usuario.\n $activity = $this->activityMapper->findById($activityid);\n $activity_resources = $this->activity_resourceMapper->findAll($activityid);\n $resources = array();\n if ($activity_resources !=NULL){\n foreach ($activity_resources as $activity_resource) {\n if ($activity_resource->getId() != $activity->getPlace()){\n $resource = $this->resourceMapper->findById($activity_resource->getIdresource());\n if ($resource != NULL && ($resource->getType() == resourcetype::Resource)){\n array_push($resources, $resource);\n }\n }\n }\n }\n $place = $this->resourceMapper->findById($activity->getPlace());\n // Recupera el array de rutas a las imágenes.\n $images = json_decode($activity->getImage());\n //$trainer = $this->activityMapper->findTrainerById($activity->getIduser());\n $trainer = $this->userMapper->findById2($activity->getIduser());\n if ($activity == NULL) {\n throw new Exception(\"->no such activity with id: \".$activityid);\n }\n\n if (!isset($this->currentUser)) {\n $isReserved = 0;\n }else{\n if($this->user_activityMapper->countByIdActivityAndIdUser($activityid,$this->currentUser->getId()) != 0){\n $isReserved = 1;\n }else{\n $isReserved = 0;\n }\n }\n\n $plazasOcupadas = $this->user_activityMapper->countAllByIdActivity($activityid);\n $plazasDisponibles = $activity->getSeats() - $plazasOcupadas;\n\n // put the Activity object to the view\n $this->view->setVariable(\"isReserved\", $isReserved);\n $this->view->setVariable(\"activity\", $activity);\n $this->view->setVariable(\"images\", $images);\n $this->view->setVariable(\"trainer\", $trainer);\n $this->view->setVariable(\"place\", $place);\n $this->view->setVariable(\"resources\", $resources);\n $this->view->setVariable(\"plazasDisponibles\", $plazasDisponibles);\n\n // render the view (/view/activities/view.php)\n\n $this->view->render(\"activities\", \"view\");\n\n }", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function index()\n {\n $events = Event::all();\n return view('indexEvent')->with(compact('events'));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => EventsCategories::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}", "public function getindex()\n\t{\n\t\t$id = Sentry::getUser()->id;\n\t\tif(!$id)\n\t\t{\n\t\t\techo \"please login first\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t$events = Calender::all(); \n\t\t\n\t\treturn View::make('event.index')->with('events',$events);\n\t}\n\t}", "public function index()\n {\n $events=Event::orderby('id','desc')->paginate(20);\n\n return view('backend.events.index',compact('events'));\n }", "public function eventsList()\n {\n $alumniId = session('alumni_id');\n $alumni = AlumniBasicInfo::find($alumniId);\n $events = Event::where('dept_info_id',$alumni->dept_info_id)->latest()->paginate(3);\n return view('frontend.events.events-list',compact('events'));\n }", "public function actionRenderDataEvents($claster,$start,$end)\n { \n $end_1 = strtotime($end);\n $dep_id1 = Yii::$app->getUserOpt->Profile_user()->emp->DEP_ID;\n $emp_email = Yii::$app->getUserOpt->Profile_user()->emp->EMP_EMAIL;\n $gf_id = Yii::$app->getUserOpt->Profile_user()->emp->GF_ID;\n\t\t\n if($gf_id <= 4)\n {\n\t\t\t $sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$dep_id1.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n\t\t\t}else{\n\t\t\t\t$sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$emp_email.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n }\n $aryEvent = Yii::$app->db_widget->createCommand($sql)->queryAll();\t\n\t\treturn Json::encode($aryEvent);\n\t}", "function view()\n {\n $data['title'] = 'Cadet Events';\n $this->load->model('cadetevent_model');\n $data['events'] = $this->cadetevent_model->get_all_cadetevents();\n \n // Loads the home page \n $this->load->view('templates/header', $data);\n $this->load->view('pages/attendance.php');\n $this->load->view('templates/footer'); \n }", "public function index()\n\t{\n\t\t$events = Events::all();\n\t\treturn view('admin.showTagamo3',array('events'=>$events));\n\t}", "public function index()\n {\n $sideevents = $this->event->take(3)->get();\n return view('front.home',compact('sideevents'));\n }", "public function index()\n {\n $aux = new Evento();\n $this->authorize('view', $aux);\n $eventos = Evento::orderBy('fecha', 'desc')->get();\n $estados = Evento::ESTADO;\n return view('evento.index')\n ->with('eventos', $eventos)\n ->with('estados', $estados)\n ->with('aux', $aux);\n }", "public function index()\n\t{\n\n\t\t$events = Vent::orderBy('date','desc')->paginate(10);\n\t\t\n\t\t\n\t\t//$files = File::files($public_path);\n\t\t$data = array(\n\t\t\t//'files'=> $images_path,\n\t\t\t'events'=> $events\n\n\t\t\t);\n\t\treturn View::make('events.index',$data);\n\t}", "public function index()\n {\n $listing=Event::all();\n return view('events.list', compact('listing'));\n }", "public function show(events $events)\n {\n //\n }", "public function index()\n {\n // $adminevent = Event::all();\n // return view('admin.adminevent.list')->with('adminevent', $adminevent);\n return view('admin/adminevent/list', ['adminevent' => Event::orderBy('start')->get()]);\n }", "public function actionIndex()\n\t{\n\t\t$selectedEvent=User::getUserSelectedEvent();\n\t\tif ($selectedEvent!=NULL)\n\t\t{\n\t\t\t// If the user has a selected event, retrieve that event\n\t\t\t$model=Event::model()->findByPk($selectedEvent);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the user does not have a selected event, choose the first event available\n\t\t\t$model=Event::model()->find();\n\t\t\t$user=User::model()->find('LOWER(username)=?',array(Yii::app()->user->name));\n\t\t\t$user->selectedevent=$model->id;\n\t\t\t$user->save();\n\t\t}\n\n\t\t// if there are no events, navigate back to splash screen\n\t\tif(is_null($model) || !isset($model))\n\t\t{\n\t\t\t$this->redirect('splash');\n\t\t}\n\t\telse\n\t\t$this->render('index',array('model'=>$model));\n\t}" ]
[ "0.68937624", "0.6832855", "0.6737387", "0.66969204", "0.6687211", "0.66647995", "0.6630551", "0.6605819", "0.65798235", "0.65522707", "0.6503299", "0.64920044", "0.64855295", "0.64187247", "0.6392682", "0.6380522", "0.6375011", "0.63708305", "0.6357326", "0.6346072", "0.6332452", "0.628499", "0.62772816", "0.62079144", "0.61855423", "0.6155567", "0.61506844", "0.6141002", "0.61260206", "0.6114621", "0.61138934", "0.6101915", "0.6095432", "0.60663545", "0.6064354", "0.60421973", "0.6003558", "0.59868526", "0.5986589", "0.598629", "0.59845763", "0.5983694", "0.59823495", "0.5968927", "0.59609735", "0.59569234", "0.5953661", "0.59510154", "0.59369326", "0.59229386", "0.5922769", "0.5921979", "0.5916957", "0.5907248", "0.5905819", "0.589625", "0.5889614", "0.5880806", "0.5879143", "0.5876326", "0.58750266", "0.5873922", "0.5858375", "0.5855937", "0.5852436", "0.5843217", "0.5841507", "0.584066", "0.5836016", "0.58241045", "0.5817706", "0.58090436", "0.5805316", "0.5801415", "0.57890856", "0.5775833", "0.5772307", "0.5772232", "0.57695204", "0.5756927", "0.57509655", "0.5746847", "0.5743148", "0.5742704", "0.57424104", "0.57409614", "0.57376295", "0.5735505", "0.5728384", "0.57253444", "0.57246274", "0.57240564", "0.57240164", "0.5722017", "0.5720709", "0.5718495", "0.571788", "0.57175", "0.57161325", "0.5715838" ]
0.7391225
0
Get the class name for the filters, the part after _Agenda_Filter_
Получите имя класса для фильтров, часть после _Agenda_Filter_
abstract public function getFilterClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getFilterClassName($string);", "abstract public function getFilterName();", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "public function getFilterClass()\n {\n return 'XorAppointmentFilter';\n }", "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public function getClassFilter()\n {\n return $this->get(self::CLASS_FILTER, null);\n }", "public static function GET_FILTERS_CLASS(): array\n\t{\n\t\treturn self::$filtersClass;\n\t}", "public function getName()\n {\n return \"apihour_contractors_filters_type\";\n }", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.paracite.filter.ParaciteRawCitationNlm30CitationSchemaFilter';\n\t}", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.parscit.filter.ParscitRawCitationNlm30CitationSchemaFilter';\n\t}", "public function getName() {\n return 'apihour_product_list_filters_type';\n }", "protected function classFilterName($class)\n {\n if (is_object($class)) {\n $class = get_class($class);\n }\n return substr($class, strrpos($class, '\\\\') + 1);\n }", "function getFilterFileName($filter_name)\n {\n return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Filter'\n . DIRECTORY_SEPARATOR . $filter_name . '.php';\n }", "public function getFormClassToExtend() {\n return null === ($model = $this->getParentModel()) ? 'BaseFormFilterDoctrine' : sprintf('%sFormFilter', $model);\n }", "static public function rootNameSpaceForFilters()\n {\n return __NAMESPACE__ .\"\\\\Filter\";\n }", "public function getFilter(): string;", "public function getName() {\n return 'apihour_settings_datagrid_filters_type';\n }", "public function name()\n {\n return __('nova.filters.log_type');\n }", "function getName($filter=null)\n {\n return _transform('SQLite',$filter);\n }", "public function getFilterFormClass()\n {\n return 'ClientListFormFilter';\n }", "public function getName()\n {\n return 'fibe_content_topicfiltertype';\n }", "public function getConvertedBy()\n {\n return FilterConverter::class;\n }", "public function getFilter();", "public function getFilter();", "function vcex_image_filter_class( $filter = '' ) {\n\tif ( function_exists( 'wpex_image_filter_class' ) ) {\n\t\treturn wpex_image_filter_class( $filter );\n\t}\n}", "public function getSortFilterName(): string\n {\n return $this->sortFilterName;\n }", "public function getUllFilterClassName()\n {\n return 'ullPhoneQuickSearchForm';\n }", "function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }", "public static function getAfterFilterName()\n {\n return self::$afterFilterName;\n }", "public function getFilter(){ }", "private function get_filter_search($filter) {\n $names = array();//assume no mod names\n $modnames = get_module_types_names(); //get all the names avaliable\n $mods = $filter->mods;//get all mods in this filter\n\n //go through each mod in the filter and and keep its name\n foreach ($mods as $mod) {\n array_push($names, $modnames[$mod]);\n }\n\n //convert list of names into a comma deliminated string of names\n return implode(\",\", $names);\n }", "public function getTag()\n\t{\n\t\treturn 'filter';\n\t}", "public function onGetFilterKey()\n\t{\n\t\t$this->filterKey = JString::strtolower(str_ireplace('PlgFabrik_List', '', get_class($this)));\n\t\treturn $this->filterKey;\n\t}", "public function getFilters()\n\t{\n\t\treturn [\n\t\t\tnew \\Twig_SimpleFilter('basename', 'basename'),\n\t\t\tnew \\Twig_SimpleFilter('get_class', 'get_class'),\n\t\t\tnew \\Twig_SimpleFilter('json_decode', 'json_decode'),\n\t\t\tnew \\Twig_SimpleFilter('_', 'echo'),\n\t\t];\n\t}", "public function get_name()\n {\n return 'post-filter';\n }", "public function dumpDefinition()\n {\n $definition = array();\n\n foreach ($this->filters as $index => $filter)\n {\n $definition[] = get_class($filter);\n }\n\n return $definition;\n }", "abstract protected function getFilters();", "public function getAttributeName()\n\t{\n\t\treturn 'FilterBase';\n\t}", "public function getClassName() ;", "public function getFilter()\n {\n return $this->get(self::FILTER);\n }", "public function getName() : string\n {\n return (string) DefaultOkFileFilter::class;\n }", "public function getFilterString()\n {\n return $this->filterString;\n }", "protected function getFilterQueryMethod(FilterContract $filter): string\n {\n return match ($filter->getOperator()) {\n FilterOperator::INCLUDED_IN => 'whereIn',\n FilterOperator::NOT_INCLUDED_IN => 'whereNotIn',\n FilterOperator::IN_RANGE => 'whereBetween',\n FilterOperator::NOT_IN_RANGE => 'whereNotBetween',\n FilterOperator::IS_NULL => 'whereNull',\n FilterOperator::IS_NOT_NULL => 'whereNotNull',\n FilterOperator::CONTAINS => 'whereJsonContains',\n FilterOperator::DOES_NOT_CONTAIN => 'whereJsonDoesntContain',\n default => 'where',\n };\n }", "public function GetFilters ();", "public function filters()\n {\n return [\n 'name' => 'trim|capitalize|escape'\n ];\n }", "public function getFilter(string $name);", "public static function getFilterType() {\n return array(\n self::RG_FILTER_TYPE_DROPDN => Yii::t('RgdesignerModule.rgattr', 'DropDown List'),\n self::RG_FILTER_TYPE_TEXTINP => Yii::t('RgdesignerModule.rgattr', 'Text filter'),\n self::RG_FILTER_TYPE_NONE => Yii::t('RgdesignerModule.rgattr', 'Not specified'),\n );\n }", "public function getFilterName()\n {\n return $this->_('NOT ANY (XOR) combination filter');\n }", "function GetFilter ( )\n{\n\treturn $this->FilterExp();\n}", "public function getEventClass() :string {\n $class = get_class($this);\n $classParts = explode(\"\\\\\", $class);\n\n return $classParts[count($classParts) - 1];\n }", "public function makeFilter($class = '\\Nayjest\\Grids\\FilterConfig')\n {\n $filter = new $class;\n $this->addFilter($filter);\n return $filter;\n }", "function filter_method_name()\r\n\t{\r\n\t\t// TODO:\tDefine your filter method here\r\n\t}", "protected function getRouteNameFilter()\n {\n if ($this->routeNameFilter instanceof FilterChain) {\n return $this->routeNameFilter;\n }\n\n $this->routeNameFilter = new FilterChain();\n $this->routeNameFilter->attachByName('WordCamelCaseToDash')\n ->attachByName('StringToLower');\n return $this->routeNameFilter;\n }", "public function getClassName();", "public function getClassName();", "public function getFullQualifiedClassname() : string\n {\n return $this->fqcn;\n \n }", "public function component()\n {\n return 'mega-filter';\n }", "private function buildFilters()\n {\n $return = '';\n\n if (count($this->filters) > 0) {\n $return = 'f=' . implode(',', array_values($this->filters));\n }\n\n return $return;\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public static function getBeforeFilterName()\n {\n return self::$beforeFilterName;\n }", "public function getMetaPropertyFilterName(): string\n {\n return $this->metaPropertyFilterName;\n }", "function getName($filter=null)\n {\n return _transform(\"PostgreSQL\",$filter);\n }", "public static function fqcn(): string {\n return self::class;\n }", "public static function fqcn(): string {\n return self::class;\n }", "public function getFilters();", "public function getFilter()\n\t{\n\t\treturn $this->filter;\n\t}", "public function getName()\n {\n return \"MJanssen_Filters_LikeFilter\";\n }", "public function getFormattedEventTypes(): string\n {\n return $this->getFormattedFilter($this->event_type_filter);\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function createFilter();", "public function genFilter($filter = array())\n {\n $filter = $this->genFilterPreProcess ($filter);\n return '';\n }", "function flatsome_main_classes(){\n echo implode(' ', apply_filters( 'flatsome_main_class', array() ) );\n}", "public function getFilter()\n\t{\n\t\treturn 'array';\n\t}", "public function getOptionalFilterType(): string\n {\n return $this->filterType;\n }", "private static function _getFilter() {}", "protected function getFilter()\n {\n return $this->filter;\n }", "public function getSbFilter()\n {\n return $this->getAdditionalParam('shortBreak', '');\n }", "private function getPluralizedName($filterType)\n {\n if($filterType === 'Category')\n return 'Categories';\n return 'Products';\n }", "function getFilter()\n\t{\n\t\treturn $this->_filter;\n\t}", "function getFilter() {\n\t\treturn $this->_filter;\n\t}", "public function getBusinessNameFilter()\n {\n return $this->business_name_filter;\n }" ]
[ "0.76527405", "0.73842394", "0.72981423", "0.72673875", "0.70962036", "0.70402944", "0.6758032", "0.6728297", "0.65830535", "0.6531211", "0.6508014", "0.64513385", "0.6425756", "0.64106566", "0.6368361", "0.6333866", "0.632712", "0.6317778", "0.6281755", "0.62220657", "0.6213948", "0.61842644", "0.6152717", "0.6152717", "0.61476743", "0.61445767", "0.60811454", "0.6073757", "0.6026578", "0.5997935", "0.59905183", "0.5969629", "0.5966616", "0.5927236", "0.59238243", "0.59162116", "0.5852821", "0.5851935", "0.5849182", "0.5816471", "0.5806842", "0.580601", "0.57864064", "0.5780424", "0.5775789", "0.5759569", "0.57465345", "0.5725477", "0.5717028", "0.5715178", "0.56851345", "0.5683844", "0.56815064", "0.5678886", "0.5678886", "0.5671069", "0.5657435", "0.56559163", "0.5653075", "0.5653075", "0.5653075", "0.5653075", "0.56449056", "0.56410277", "0.5619992", "0.56063473", "0.56063473", "0.55815154", "0.5579545", "0.55745614", "0.55649847", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5558905", "0.55366063", "0.5514226", "0.5504774", "0.55031675", "0.54995733", "0.54988796", "0.54936016", "0.5475513", "0.5468406", "0.5462977", "0.5459517" ]
0.77549744
0
Set the maximum length of the calculated name field
Установите максимальную длину поля вычисленного имени
public function setMaximumCalcLength($length = 200) { $this->_maxNameCalcLength = $length; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxLength($maxLength) {}", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "public function setMaxLength($length);", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "public function setMaxUsernameLength($length);", "public function getMaxLength() {}", "public function getMaxLength();", "public function setMaxLength($length) {\n $this->maxlength = $length;\n }", "public function getMaxUsernameLength();", "public function setMaxLength($max)\n {\n $this->__set(self::FIELD_MAXLENGTH,$max);\n return $this;\n }", "public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "public function getLengthLimit()\n {\n }", "public function getMaxColumnNameLength();", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function setLengthMax($length)\n {\n if (!$length) {\n $length = self::LENGTH_MAX_MAX;\n }\n \n $this->lengthMax = \\RandData\\Checker::int(\n $length,\n self::LENGTH_MAX_MIN,\n self::LENGTH_MAX_MAX,\n \"lengthMax\"\n );\n }", "protected function max($length, $field_name, $data)\n {\n if (strlen($data) <= $length) {\n return true;\n } else {\n $this->errors[$field_name][] = \"maximum {$length} char\";\n }\n// $this->errors[$field_name][] = \"maximum {$length} char\";\n// return empty(strlen($data) <= $length) ? false : true;\n }", "public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}", "public function max($field_name, $value, $max_length)\n {\n if (strlen($value) <= $max_length) {\n return true;\n }\n return ucfirst($field_name).' must have max length of '.$max_length.'.';\n }", "public function setMaxLength($maxLength) {\n $this->maxLength = $maxLength;\n return $this;\n }", "function edd_stripe_max_length_statement_descriptor( $html, $args ) {\n\tif ( 'stripe_statement_descriptor' !== $args['id'] ) {\n\t\treturn $html;\n\t}\n\n\t$html = str_replace( '<input type=\"text\"', '<input type=\"text\" maxlength=\"22\"', $html );\n\n\treturn $html;\n}", "public function getMaxLength() {\n return $this->maxLength;\n }", "public function setMaxLength($maxLength)\n {\n $this->maxLength = $maxLength;\n return $this;\n }", "function setLongName($longName)\n {\n if (strlen($longName) > 48) {\n throw new InvalidArgumentException(\"Input must be 48 characters or less\n in length!\");\n }\n $this->_longName = $longName;\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "public function setLength($length);", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "public function increaseLength($minLength = 100) {}", "public function increaseLength($minLength = 100) {}", "public function getMaxCustomEntityFieldNameSize()\n {\n $subtractSize = max(\n strlen(self::RELATION_DEFAULT_COLUMN_PREFIX),\n strlen(self::RELATION_COLUMN_SUFFIX),\n strlen(self::SNAPSHOT_COLUMN_SUFFIX)\n );\n\n return $this->getMaxIdentifierSize() - $subtractSize;\n }", "function setMaxWidth($width) {\n $this->field['max_width'] = $width;\n\n return $this;\n }", "public function getMaxLength()\n {\n return 254;\n }", "public function setMaxLength($length)\n {\n $this->max_length = $length;\n return $this;\n }", "function set_length($length) {\n $this->length = $length;\n }", "public function getMaxCustomEntityNameSize()\n {\n return $this->getMaxIdentifierSize() - strlen(self::CUSTOM_TABLE_PREFIX);\n }", "public function setLenom(string $lenom):string\n {\n //checking the name for injection in db with strip_tags and trim\n $lenom = strip_tags(trim($lenom));\n // checking is empty\n if(empty($lenom)){\n trigger_error(\"The name can't be empty\",E_USER_NOTICE);\n //checking lenght name is not superieur for 45caratcters\n }else if (strlen($lenom) > 45){\n trigger_error(\"The lenght of your name cannot exceed 45 characters!!\",E_USER_NOTICE);\n }else{\n\n $this->lenom = $lenom;\n }\n }", "function __construct($name, $title = null, $value = \"\", $maxLength = null) {\n\t\t$this->maxLength = $maxLength;\n\t\tparent::__construct($name, $title, $value);\n\t}", "public function increaseLength($minLength = 100);", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}", "function shortenName($name, $maxChars=10, $ellipse='...') {\n\tif (strlen($name) - strlen($ellipse)>$maxChars) {\n\t\treturn substr($name, 0, $maxChars).$ellipse;\n\t} else {\n\t\treturn $name;\n\t}\n}", "public function getMaxAttributeLength()\n {\n return (int)$this->floatValue('recorded.value.max.length', 1200);\n }", "public function setMinUsernameLength($length);", "function adr_link_length($link, $max)\n{\n\tif (strlen($link) > $max)\n\t\t$newlink = substr($link, 0, ($max - 3)) .'...';\n\telse\n\t\t$newlink = $link;\nreturn $newlink;\n}", "function max_length($array){\n\t$message = [];\n\tforeach($array as $field=>$limit){\n\t\t$length = strlen(trim($_POST[$field]));\n\t\tif($length > $limit){\n\t\t\t$message[$field] = readable_name($field).\" cannot exceed \".$limit.\" characters. \";\n\t\t}\n\t}\n\n\treturn $message;\n}", "public function field_len($result, $index){\r\n\t\t$obj_field = new ADOFieldObject();\r\n\t\t$obj_field = $result->FetchField($index);\r\n\t\treturn isset($obj_field->max_length) ? $obj_field->max_length : \"\";\r\n\t}", "public function setMaxLength(int $maxLength)\n {\n $this->getElement()->setAttribute('maxlength', $maxLength);\n return $this;\n }", "public function length($name, $length, $type = 'min', $message = 'The field need more')\n {\n //StringLength \n $msgkey = 'messageMinimum';\n if($type !== 'min')\n {\n $msgkey = 'messageMaximum';\n }\n $this->validation->add($name, new \\Phalcon\\Validation\\Validator\\StringLength(array(\n $type => $length,\n $msgkey => $message\n )));\n return $this;\n }", "public function setMaximumStringKeyLength($value)\n {\n $this->maximumStringKeyLength = (int) $value;\n\n return $this;\n }", "public function longestFieldLength($idless=false) {\n $len = 0;\n foreach ($this->fields as $field) {\n if ($len < strlen($idless ? $field->getNameWithoutId() : $field->getName())) {\n $len = strlen($idless ? $field->getNameWithoutId() : $field->getName());\n }\n }\n return $len;\n }", "private static function add_html_length( $field, array &$add_html ) {\n\t\tif ( FrmField::is_option_empty( $field, 'max' ) || in_array( $field['type'], array( 'textarea', 'rte', 'hidden', 'file' ) ) ) {\n return;\n }\n\n if ( FrmAppHelper::is_admin_page('formidable' ) ) {\n // don't load on form builder page\n return;\n }\n\n\t\t$add_html['maxlength'] = 'maxlength=\"' . esc_attr( $field['max'] ) . '\"';\n }", "public function getMinUsernameLength();", "function adjustLength($string, $max)\r\n {\r\n if (strlen($string) <=$max)\r\n {\r\n return $string;\r\n }\r\n else\r\n {\r\n return substr($string, 0, $max) . '..';\r\n }\r\n }", "public function setMaxChars($value)\n {\n if (is_int($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if ($value <= 0)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value; value must be greater than 0.');\n \n $this->maxChars = $value;\n }", "public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "public function param_character_limit($value = 0)\n {\n return form_input(array(\n 'type' => 'text',\n 'name' => 'character_limit'\n ), $value);\n }", "function _get_field_size() \n {\n if (isset($this->attribs['size'])) {\n return $this->attribs['size'];\n }\n elseif ($this->attribs['maxlength'] > $this->max_size) {\n return $this->max_size;\n }\n else {\n return $this->attribs['maxlength'];\n }\n }", "public function setMaxlength(int $maxlength): self\n {\n $this->maxlength = $maxlength;\n\n return $this;\n }", "function wp_get_comment_fields_max_lengths()\n {\n }", "public function testRegisterWithLongName()\n {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'name', 255);\n }", "public function maxTextFields(): self\n {\n $this->arguments[] = 'MAXTEXTFIELDS';\n\n return $this;\n }", "public function __construct($objectName, $maxLength, $message = '')\n {\n //$this->setMaxLength($maxLength);\n parent::__construct($objectName, $message);\n }", "abstract public function increaseLength($length = 100);", "public function maxLength($name, $maxLength, $displayName = null)\n {\n if (trim($this->data[$name]) != ''\n && strlen($this->data[$name]) > $maxLength\n ) {\n $this->errors->add(\n '<b>' .\n $this->displayName($name, $displayName) .\n '</b> must be ' . $maxLength . ' characters or shorter.'\n );\n return false;\n }\n return true;\n }", "function has_max_length($value, $max) {\n\t\treturn strlen($value) <= $max;\n\t\t}", "public function setLength($length) {\r\n $this->length = $length;\r\n }", "public function setTextLimit($l = 150)\n {\n $this->shorteningLimit = $l;\n }", "function has_max_length($value, $max) {\r\n\treturn strlen($value) <= $max;\r\n}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function setLength($length)\n {\n $this->length = $length;\n }", "public function setLength($length)\n {\n $this->length = $length;\n }", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "public function lengthMax($lengthMax, $error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::LENGTHMIN, 'value' => $lengthMax, 'message' => $error]);\n }\n\n return $this;\n }", "public static function _maxlength($value, $field, $max_length) {\n\t\treturn strlen($value) <= $max_length;\n\t}", "function clean($name, $max) {\n\t\t# fake other fields or extra entries\n\t\t$name = ereg_replace(\"[[:space:]]\", ' ', $name);\n\t\t# Escape < > and and & so they \n\t\t# can't mess withour HTML markup\n\t\t$name = ereg_replace('&', '&amp;', $name);\n\t\t$name = ereg_replace('<', '&lt;', $name);\n\t\t$name = ereg_replace('>', '&gt;', $name);\n\t\t# Don't allow excessively long entries\n\t\t$name = substr($name, 0, $max);\n\t\t# Undo PHP's \"magic quotes\" feature, which has\n\t\t# inserted a \\ in front of any \" characters.\n\t\t# We undo this because we're using a file, not a\n\t\t# database, so we don't want \" escaped. Those\n\t\t# using databases should do the opposite:\n\t\t# call addslashes if get_magic_quotes_gpc()\n\t\t# returns false.\n\t\treturn $name;\n\t}", "function addMax($field, $name) {\n\t\t$name = \"`\".$this->db->escape_string($name).\"`\";\n\t\t$this->fields[] = array(\"MAX(\".$name.\")\", $this->db->escape_string($field));\n\t\treturn $this;\n\t}", "public function setMaxLineLength(?int $maxLineLength): void {\n\t\t$this->maxLineLength = $maxLineLength;\n\t}", "public function setMaxKeyLength($length)\n {\n $this->maxKeyLength = $length;\n\n return $this;\n }", "public function install_create_custom_field($name, $length)\n {\n $this->connection->query('ALTER TABLE ' . $this->connection->get_table_prefix() . 'users ADD cms_' . $name . ' TEXT', null, null, true);\n return true;\n }", "public function maxAlias($maxdigits=8){\n $alias = '';\n for ($bit=0;$bit<$maxdigits;$bit++){\n $alias .= substr($this->base[$bit % $this->l],-1);\n }\n return $alias;\n }", "public function setMaximumWordLength($maximum)\n {\n return $this->setOption('maximumwordlength', $maximum);\n }", "public function __construct($name, $caption, $value = '', $isRequired = true, $helpMessage = '')\n {\n $this->maxChars = 255;\n parent::__construct($name, $caption, $value, $isRequired, $helpMessage);\n }", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "public function setMaxLength($maxLength) {\n if (!is_integer($maxLength) || $maxLength < 0) {\n throw new \\InvalidArgumentException('Maximal length must be numeric and greather or equal to zero. Get: \"' . $maxLength . '\"');\n }\n $this->maxLength = $maxLength;\n return $this;\n }", "function setMax($max) {\n $this->field['max'] = (int) $max;\n\n return $this;\n }", "protected function maxLen(string $field, string $value, $param = null)\n {\n if (!empty($value)) {\n\n $error = false;\n\n if (function_exists('mb_strlen')) {\n if (mb_strlen($value) > (int)$param) {\n $error = true;\n }\n } else {\n if (strlen($value) > (int)$param) {\n $error = true;\n }\n }\n\n if ($error) {\n $this->addError($field, 'maxLen', $param);\n }\n }\n\n }", "public function setMaxChars($value)\n {\n if (!is_int($value))\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter \\'value\\' must be of type \\'int\\'');\n $this->maxChars = $value;\n }", "abstract protected function validateFieldLength($fieldLength);", "public function setMaxSize($max){\n $this->maxSize = $max;\n return $this;\n }", "function medigroup_mikado_excerpt_length($length) {\n\n if(medigroup_mikado_options()->getOptionValue('number_of_chars') !== '') {\n return esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n } else {\n return 45;\n }\n }", "function set_leng_description($leng = 150)\t{\n \t\t$this->description= substr($this->description, 0, $leng).'...';\n \t\t \t\t\t\n \t}", "public function setAdvanceWidthMax($value) {}", "public function limitLength($days)\n {\n $this->_maxDays = $days;\n }", "public function maxLength($field, $length) {\n\t\t$length = intval($length);\n\t\t$postData = $_POST[$field['name']];\n\t\t\n\t\tif ( ! is_string($postData))\n\t\t\tstrval($postData);\n\t\t\t\n\t\tif (strlen($postData) > intval($length)) {\n\t\t\t$this->_errors[$field['name']]['param'] = $length;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function set_max_font_size($val) \n {\n $this->max_font_size = $val;\n }" ]
[ "0.74492687", "0.73886585", "0.7307014", "0.7132721", "0.6975488", "0.6970148", "0.68450147", "0.6787955", "0.67832434", "0.6746053", "0.6727918", "0.67233795", "0.66960144", "0.65862185", "0.6548397", "0.65476453", "0.6528528", "0.65157795", "0.6489467", "0.6470448", "0.6462307", "0.64474016", "0.64416933", "0.6405121", "0.6366826", "0.63519627", "0.6342862", "0.6339687", "0.63129395", "0.63126343", "0.6292552", "0.62914777", "0.62885636", "0.6273262", "0.62330705", "0.6188671", "0.615569", "0.6135605", "0.61320263", "0.61090064", "0.6092065", "0.60739297", "0.6067129", "0.6051941", "0.60357094", "0.6009429", "0.600611", "0.5984218", "0.596459", "0.5960936", "0.59278756", "0.5904747", "0.5884744", "0.58798176", "0.58747894", "0.58652365", "0.58651", "0.58612007", "0.58610475", "0.5815669", "0.5815217", "0.58092993", "0.57992446", "0.57981384", "0.57965326", "0.57851404", "0.578148", "0.57677764", "0.5760978", "0.57518685", "0.57501096", "0.57501096", "0.57501096", "0.5747241", "0.5747241", "0.5745537", "0.5745006", "0.57209074", "0.5718261", "0.5711777", "0.5709907", "0.5704149", "0.5701044", "0.56977123", "0.5686128", "0.56773496", "0.5669776", "0.5669776", "0.5664738", "0.56598794", "0.5655312", "0.5644025", "0.5637528", "0.5632761", "0.5625487", "0.5609198", "0.56046313", "0.55952406", "0.5590177", "0.55779785" ]
0.7674192
0
Sanitize key, removing spaces and replace them to underscore
Очистить ключ, удалив пробелы и заменив их на подчеркивание
protected function sanitize($key) { return strtolower(str_replace(' ', '_', $key)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize_key( $key ) {\n\t$raw_key = $key;\n\t$key = strtolower( $key );\n\t$key = preg_replace( '/[^a-z0-9_\\-]/', '', $key );\n\n\t/**\n\t * Filter a sanitized key string.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $key Sanitized key.\n\t * @param string $raw_key The key prior to sanitization.\n\t */\n\treturn apply_filters( 'sanitize_key', $key, $raw_key );\n}", "function parse_clean_key($key)\n {\n \tif ($key == \"\")\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t$key = htmlspecialchars(urldecode($key));\n \t$key = str_replace( \"..\" , \"\" , $key );\n \t$key = preg_replace( \"/\\_\\_(.+?)\\_\\_/\" , \"\" , $key );\n \t$key = preg_replace( \"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $key );\n \t\n \treturn $key;\n }", "protected function normalize($key)\n {\n return str_replace('_', '', strtoupper($key));\n }", "protected function _normalizeKey($key)\n {\n $option = str_replace('_', ' ', strtolower($key));\n $option = str_replace(' ', '', ucwords($option));\n return $option;\n }", "function sanitize_key($key)\n {\n }", "function parseCleanKey($k){\r\n\t\tif($k<0){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$k = htmlspecialchars(urldecode($k));\r\n\t\t$k = preg_replace(\"/\\.\\./\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/\\_\\_(.+?)\\_\\_/\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $k);\r\n\t\treturn $k;\r\n\t}", "public static function filterDataKey($key)\n {\n return preg_replace(\"/[^a-zA-Z0-9_]+/\", '_', $key);\n }", "protected function sanitizeKey($key)\n {\n return $key;\n }", "public static function normalizeKeyDelimiters($key)\r\n {\r\n return str_replace(array(' ', '_'), '-', $key);\r\n }", "function _CleanKey($key) {\n\t\t$this->_Log('Cache: cleaning ' . ($key ?? '<NULL>') );\n\n\t\t$new_key = preg_replace( '/[^a-z0-9]+/', '-', strtolower( $key ?? '' ) );\n\n\t\treturn $new_key;\n\t}", "public static function sanitizeCacheKey($key)\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }", "public static function sanitizeCacheKey($key): string\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }", "private function formatKey($key)\n {\n $key = ucwords(strtolower($key));\n $key = str_replace(' ', '', $key);\n return $key;\n }", "public static function alm_filters_revert_underscore($key){\n\t \t// If value is _year, _month, _day or _author remove the '_'\n\t \t$key = ($key === '_year' || $key === '_month' || $key === '_day' || $key === '_author') ? str_replace('_', '', $key) : $key;\n\t \treturn $key;\n \t}", "public static function alm_filters_replace_underscore($value){\n\t \t$underscore = strpos($value, '_');\n\t \tif($underscore){\n\t\t \t$charToReplace = substr($value, $underscore+1, 1);\n\t\t \t$value = str_replace('_'.$charToReplace, strToUpper($charToReplace), $value);\n\t \t}\n\n\t \t// If value is year, month or day add '_' before to prevent 404s. e.g. _year\n\t \t$value = ($value === 'year' || $value === 'month' || $value === 'day' || $value === 'author') ? '_'. $value : $value;\n\t \treturn $value;\n \t}", "private function formatKey(string $key): string\n\t{\n\t\treturn str_replace('_', '-', strtolower($key));\n\t}", "public function normaliseKey(string $key): string;", "function unprefix( $key, $strip_underscores = true ) {\n\n\treturn utils\\unprefix_meta_key( $key, '_wpmoly_', $strip_underscores );\n}", "public static function clear_key($k)\n\t{\n\t\tif(!$k)\n\t\t\treturn '';\n \t$k = htmlspecialchars(urldecode($k));\n \t$k = str_replace('..','',$k);\n \t$k = preg_replace('/\\_\\_(.+?)\\_\\_/','',$k);\n \t$k = preg_replace('/^([\\w\\.\\-\\_]+)$/','$1',$k);\n \treturn $k;\n\t}", "function str_underscore($str)\n{\n return strtolower(preg_replace('/(?<=\\\\w)([A-Z]+)/', '_\\\\1', $str));\n}", "private function _key($key) {\n if (empty($key)) {\n return false;\n }\n $key = preg_replace('/[\\s]+/', '_', strtolower(trim(str_replace(array(DIRECTORY_SEPARATOR, '/', '.'), '_', strval($key)))));\n return $key;\n }", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function cap_sanitize_key_list ($key_list)\n{\n $keys = explode (' ', $key_list);\n $result = array ();\n foreach ($keys as $key) {\n $result[] = cap_sanitize_key ($key);\n }\n return implode (' ', $result);\n}", "function remove_underscore($string)\n{\n return str_replace('_', ' ', $string);\n}", "protected function normalizeKey($key)\r\n {\r\n if ($this->normalization & static::NORMALIZE_TRIM) {\r\n $key = trim($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_DELIMITERS) {\r\n $key = static::normalizeKeyDelimiters($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CASE) {\r\n $key = strtolower($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CANONICAL) {\r\n $key = static::canonicalizeKey($key);\r\n }\r\n\r\n return $key;\r\n }", "private function _clean_input_keys($str) {\n\t\tif (!preg_match('/^[a-z0-9:_\\-\\/-\\\\\\\\*]+$/i', $str)) {\n\t\t\tlog_error('Disallowed Key Characters:' . $str);\n\t\t\texit ('Disallowed Key Characters:' . $str);\n\t\t}\n\n\t\treturn $str;\n\t}", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "public static function camelCase2underscore(string $key): string\n {\n $str = lcfirst($key);\n return strtr($str, [\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]);\n }", "static function spaceOrUnderscore( $pattern ) {\n\t\treturn str_replace( ' ', '[ _]', $pattern );\n\t}", "function underscore(){\n\t\t$out = $this->_copy();\n\t\t$out->_String4 = mb_strtolower(preg_replace(\"/([a-z0-9\\p{Ll}])([A-Z\\p{Lu}])/u\",\"\\\\1_\\\\2\",$this->_String4));\n\t\treturn $out;\n\t}", "function underscore($str) {\n return preg_replace('/[\\s]+/', '_', trim(extension_loaded('mbstring') ? mb_strtolower($str) : strtolower($str)));\n}", "protected function clean_input_keys($str) {\n\t\t\n\t\tif ( ! preg_match('#^[&a-zA-Z0-9\\.:_/\\-\\s]+$#uD', $str)) {\n\t\t\techo $str.'<br />';\n\t\t\texit('Disallowed key characters in global data.');\n\t\t}\n\n\t\treturn $str;\n\t}", "function validName($name) {\n \n return preg_replace('/\\s+/', '_',$name);\n\n}", "protected function parseKey(): string\n {\n foreach ($this->getParams() as $key => $value) {\n $this->key = \\str_replace($key, $value, $this->key);\n }\n\n return $this->key;\n }", "public static function toUnderscoreSeparated($input)\r\n {\r\n \t// Convert spaces and dashes to underscores.\r\n \t$input = preg_replace('#[ \\-_]+#', '_', $input);\r\n \r\n \treturn $input;\r\n }", "public function testSpaceIsRepresentedByUnderscore()\n {\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('a_b', $encoder->encodeString('a b'), 'Spaces can be represented by more readable underscores as per RFC 2047.');\n }", "function replace_invalid_keys($key,$opt){\n\n if(is_string($key)){\n $key = preg_replace(INVALIDCHARSRGX, $opt->substitute_string, $key);\n $key = preg_replace(STARTCHARRGX, $opt->substitute_string, $key);\n }\n return $key;\n }", "public static function canonicalizeKey($key)\r\n {\r\n $words = explode('-', strtolower($key));\r\n\r\n foreach ($words as &$word) {\r\n $word = ucfirst($word);\r\n }\r\n\r\n return implode('-', $words);\r\n }", "public function cleanAlias( $value ){\n $value = $this->removeAccents($value); \n $value = strtolower($value);\n // remove anything not alphanumeric OR \"_\"\n $value = preg_replace(\"/([^a-z0-9_\\-]+)/i\", '_', $value);\n // remove duplicate \"_\"\n $value = preg_replace(\"/(__+)/\", '_', $value);\n // remove posible start/end \"_\"\n return trim($value, '_');\n }", "function underscore($s, $sep = '_') {\n\n $s = preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $s);\n $s = preg_replace('/([0-9])([a-z])/', '$1_$2', $s);\n $s = preg_replace('/([a-zA-Z])([0-9])/', '$1_$2', $s);\n $s = preg_replace('/[\\s_-]+/', $sep, $s);\n\n return strtolower($s);\n\n }", "public static function sanitizeId($id)\n {\n return preg_replace('#[^a-zA-Z0-9_]#', '_', $id);\n }", "static function try_modify_key($key)\n\t{\n\t\t//compatibility for the old iconfont that was based on numeric values\n\t\tif(is_numeric($key)) \n\t\t{\n\t\t\t$key = self::get_char_from_fallback($key);\n\t\t}\n\t\n\t\t//chars that are based on multiple chars like \\ueXXX\\ueXXX; need to be modified before passed\n\t\tif(!empty($key) && strpos($key, 'u',1) !== false)\n\t\t{\n\t\t\t$key = explode('u', $key);\n\t\t\t$key = implode('\\u',$key);\n\t\t\t$key = substr($key, 1);\n\t\t}\n\t\n\t\treturn $key;\n\t}", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "function remove_underscores($word, $sub = ' ')\n {\n return str_replace('_', $sub, $word);\n }", "function sanitize_name( $name ) {\r\n\t\t$name = sanitize_title( $name ); // taken from WP's wp-includes/functions-formatting.php\r\n\t\t$name = str_replace( '-', '_', $name );\r\n\r\n\t\treturn $name;\r\n\t}", "public function cleanKeyFromUnicodeCharacters(string $key): string\n {\n return preg_replace('/&([a-z])[a-z]+;/i', '$1', htmlentities($key));\n }", "function put_underscore($str, $lower = true)\n {\n if (!$lower) {\n return str_replace(' ', '_', $str);\n }\n return strtolower(str_replace(' ', '_', $str));\n }", "function eL($key)\n{\n return Filters::noXSS(L($key));\n}", "protected function _normalizeString($string)\n {\n return preg_replace('/\\s+/', '_', $string);\n\n// $string = preg_replace('/([^a-z^0-9^_])+/','_',strtolower($string));\n// $string = preg_replace('/_{2,}/','_',$string);\n// return trim($string,'_');\n }", "public function underscore($word)\n\t{\n\t\treturn strtolower(preg_replace('/[^A-Z^a-z^0-9]+/','_',\n\t\t\t\tpreg_replace('/([a-zd])([A-Z])/','1_2',\n\t\t\t\t\tpreg_replace('/([A-Z]+)([A-Z][a-z])/','1_2',$word))));\n\t}", "public static function underscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "public static function underscore($word) {\n return strtolower(preg_replace('#([a-z])([A-Z])#', '\\\\1_\\\\2', $word));\n }", "public static function underscore2camelCase(string $key): string\n {\n return strtr($key, array_flip([\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]));\n }", "function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}", "function sanitize_username($s) {\n\treturn preg_replace(\"/[^a-zA-Z0-9-_]/\", '', trim($s));\n}", "public function sanitizer($var){\n\t\t$forbidden = array(\"²\",\"&\",\"\\\"\",\"'\",\"(\",\"è\",\"é\",\"ê\",\"ë\",\"ç\",\"à\",\")\",\"=\",\"~\",\"#\",\"{\",\"[\",\"|\",\"`\",\"\\\\\",\"^\",\"@\",\"]\",\"}\",\"+\",\"°\",\"%\",\"¤\",\"*\",\"!\",\":\",\",\",\";\",\"?\",\"/\",\"$\",\"£\",\"€\",\"<\",\">\",\" \");\n\t\t$allowed = array(\"-\",\"-\",\"-\",\"-\",\"-\",\"e\",\"e\",\"e\",\"e\",\"c\",\"a\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"_\");\n\n\t\t$sanitized = str_replace($forbidden,\"_\",$var);\n\n\t\tif(strlen($sanitized) >= 33) $sanitized = substr($sanitized,0,31);\n\n\t\treturn \t$sanitized;\n\t}", "protected function processKey($key)\n {\n if (!empty($this->keySuffix)) {\n return $key . '|' . $this->keySuffix;\n } else {\n return $key;\n }\n }", "protected function _sanitize_id($id)\n {\n // Change slashes and spaces to underscores\n return str_replace(['/', '\\\\', ' '], '_', $id);\n }", "private function sanitizeSecretName($secret_name) {\n\n $pattern = '/^[\\w\\d\\s\\-_]{4,}$/';\n if ($this->isInvalidStr($secret_name) || !preg_match($pattern, $secret_name)) {\n\n throw new \\Exception(\"Valid secret name string is required: \" . $pattern);\n }\n\n //append the suffix, trade spaces for underscores and lower\n return strtolower(str_replace(' ', '_', $secret_name));\n }", "protected function replaceSpecialChars($value)\r\n\t{\r\n//\t\techo \"$value: \" . preg_replace('/[-]/', '_', $value) . \"\\n\";\r\n\t\treturn preg_replace('/[-]/', '_', $value); //Convert non-word characters, hyphens and dots to underscores\r\n\t}", "public function format()\n {\n $formattedString = join('_', $this->toLower());\n if (strpos($formattedString, '_') === 0) {\n $formattedString = substr($formattedString, 1);\n }\n\n return $formattedString;\n }", "public static function quote_name($key)\n {\n if (is_object($key))\n return '('.strval($key).')';\n\n if (preg_match('/^[a-zA-Z]+[a-zA-Z0-9_]*$/', $key))\n return sprintf('`%s`', trim($key));\n\n return trim($key);\n }", "function cut_underscore($str, $uc = true)\n {\n if (!$uc) {\n return str_replace('_', '', $str);\n }\n return ucwords(str_replace(' ', '_', $str));\n }", "public function getKeyAttribute($key)\n {\n return strtolower(trim(\n preg_replace(\n '~[^a-zA-Z0-9]+~',\n '',\n preg_replace('~( |_|\\-)+~', ' ', $key)\n )\n ));\n }", "public function replaceUnderscore($method = false)\n {\n if (!$method) {\n return false;\n }\n $arr = explode('_', $method);\n $new = '';\n if (count($arr)) {\n foreach ($arr as $key => $value) {\n $new .= ucfirst($value);\n }\n }\n\n return $new;\n }", "public static function key2Label(string $key): string\n {\n $str = static::camelCase2underscore($key);\n $prepared = ucfirst(strtolower(\n strtr($str, ['_' => ' ', '.' => ' ','()' => ''])\n ));\n return preg_replace('/\\s+/', ' ', $prepared);\n }", "function wcs_sanitize_subscription_status_key( $status_key ) {\n\tif ( ! is_string( $status_key ) || empty( $status_key ) ) {\n\t\treturn '';\n\t}\n\t$status_key = ( 'wc-' === substr( $status_key, 0, 3 ) ) ? $status_key : sprintf( 'wc-%s', $status_key );\n\treturn $status_key;\n}", "function get_name_sanitized():string{\n $sanitize_name = $this->name ;\n foreach (self::SANITIZED_WORDS as $old => $new) {\n $sanitize_name = str_replace($old, $new, $sanitize_name);\n }\n return $sanitize_name;\n }", "function displayOneCfDef($key) {\n\t\treturn ucwords(str_replace('_',' ',$key));\n\t}", "public function escapeKeywords($key)\n {\n $key = str_replace('+', '\\+', $key);\n $key = str_replace('$', '\\$', $key);\n $key = str_replace('/', '\\/', $key);\n $key = str_replace('.', '\\.', $key);\n return $key;\n }", "function clean_id($id)\n{\n\t$id = str_replace('-', '_', $id);\n\treturn $id;\n}", "function camelCaseToUnderscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "public function underscore($camelCasedWord);", "function RewriteLangKey ($string){\n\treturn trim(strip_tags($string));\n}", "function correctIdentifier($identifier) {\n $search = array(' ', ':', '.', '/');\n $replace = array('_', '_', '_', '-');\n return str_replace($search, $replace, $identifier);\n}", "private function getFunctionName($key) {\n return preg_replace_callback('/(?:^|_)(.?)/', function($m) { strtoupper($m[1]); },$key);\n }", "protected function keyReplacementPattern(string $keyName): string\n {\n $escaped = preg_quote('='.$this->getCurrentKey($keyName), '/');\n\n return \"/^$keyName{$escaped}/m\";\n }", "function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}", "private function sanitize($key): ?string\n {\n if (empty($key) || !is_string($key) || (null === ($clean = preg_replace(static::SANITIZE_PATTERN, static::SANITIZE_REPLACEMENT, $key)))) {\n throw new InvalidArgumentException(\"Key '$key' is not a legal value!\");\n }\n\n return $clean;\n }", "public function getNormalizedName() {\n\n $name = str_replace(' ', '_', $this->getName());\n $name = strtolower($name);\n\n return preg_replace('/[^a-z0-9_]/i', '', $name);\n }", "public static function underscore($wordToCheck)\n {\n $tmp = $wordToCheck;\n $tmp = str_replace('::', '/', $tmp);\n $tmp = self::pregtr($tmp,\n array(\n '/([A-Z]+)([A-Z][a-z])/' => '\\\\1_\\\\2',\n '/([a-z\\d])([A-Z])/' => '\\\\1_\\\\2'\n )\n );\n\n return strtolower($tmp);\n }", "protected function sanitizeContentTypeGroupIdentifier(ContentTypeGroup $contentTypeGroup): string\n {\n return str_replace(' ', '_', $contentTypeGroup->identifier);\n }", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "function slug($value){\n//the pre_quote function is just used to quote regular expressions so that it doesn't get mixed up and result in an error\n //remove all characters not in the list(that what this means when we include \"empty string\")\n $value = preg_replace('![^'.preg_quote('_').'\\pL\\pN\\s]+!u','',mb_strtolower($value));\n\n //replace underscore with a dash\n $value = preg_replace('!['.preg_quote('_').'\\s]+!u','-',$value);\n\n //remove whitespace with the trim function\n //'-' was added as an argument so that the trim function does not remove it too\n\n return trim($value, '-');\n\n}", "public function formatKey(string $key): string;", "public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}", "public static function camelToUnderdash(string $s):string {\n $s = preg_replace('#(.)(?=[A-Z])#', '$1_', $s);\n $s = strtolower($s);\n $s = rawurlencode($s);\n return $s;\n }", "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "static public function underscore($str)\n\t{\n\t\t$str = lcfirst($str);\n\t\treturn strtolower(preg_replace('/([A-Z]+)/', '_$1', $str));\n\t}", "public static function underscore($word, $sep = '_', $strtolower = true)\n {\n $sep = empty($sep) ? '_' : $sep;\n $return = preg_replace('/[^A-Z^a-z^0-9]+/', $sep,\n preg_replace('/([a-z\\d])([A-Z])/','\\1_\\2',\n preg_replace('/([A-Z]+)([A-Z][a-z])/','\\1_\\2',$word)));\n return $strtolower ? strtolower($return) : $return;\n }", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "private function normalizeKey( $key ) {\n if( !is_string( $key ) && !is_int( $key ) )\n throw new \\InvalidArgumentException( 'Argument 1 passed to ' . __METHOD__ . ' must be an integer or a string, ' . gettype( $key ) . ' given' );\n else if( strlen( $key ) > 256 )\n throw new \\InvalidArgumentException( 'Maximum key length is 256 characters' );\n else if( strpos( $key, '=' ) !== FALSE )\n throw new \\InvalidArgumentException( 'Key may not contain the equals character' );\n\n return $key;\n }", "protected function format_key($key)\n {\n }", "private function ValidateFileName($key){\n return $this->prefix . preg_replace('/[^a-zA-Z0-9_.-]/', '_', basename($key)).'.cache';\n }", "function normalize($string, $underscored = true){\r\r\n\r\r\n\t$string = trim($string);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('á', 'à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),\r\r\n\t\tarray('a', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('é', 'è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),\r\r\n\t\tarray('e', 'e', 'e', 'e', 'E', 'E', 'E', 'E'),\r\r\n\t\t$string\r\r\n\t);\r\r\n \r\r\n\t$string = str_replace(\r\r\n\t\tarray('í', 'ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),\r\r\n\t\tarray('i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ó', 'ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),\r\r\n\t\tarray('o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ú', 'ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),\r\r\n\t\tarray('u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ñ', 'Ñ', 'ç', 'Ç'),\r\r\n\t\tarray('n', 'N', 'c', 'C',),\r\r\n\t\t$string\r\r\n\t);\r\r\n \tif($underscored){\r\r\n \t\treturn str_replace(' ', '_', $string);\r\r\n \t}\r\r\n\treturn $string;\r\r\n}", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "private function removeSpecialCharacters(string $table): string\n {\n return (string) preg_replace('/[^a-zA-Z0-9_]/', '_', $table);\n }", "function espacio_guion($dato) {\n $dato = str_replace(' ', '_', $dato);\n return $dato;\n}", "protected static final function unmung($thing) {\n\t\treturn lcfirst(preg_replace_callback('/_([a-z])/', function ($m) { return strtoupper($m[1]); }, $thing));\n\t}", "public function sanatize($name)\n {\n $specialChars = array (\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"!\",\"~\",\"�\",\"\\\"\",\"�\",\"'\",\"=\",\"?\",\"/\",\"[\",\"]\",\"(\",\")\",\"|\",\"<\",\">\",\";\",\":\",\"\\\\\",\",\");\n return str_replace($specialChars, \"_\", $name);\n }" ]
[ "0.78319865", "0.763481", "0.7522966", "0.75154793", "0.7513388", "0.74508363", "0.7443278", "0.73540926", "0.7339959", "0.72198635", "0.7205389", "0.71277475", "0.708133", "0.7064286", "0.69064254", "0.6821983", "0.677941", "0.6736304", "0.67110133", "0.66038823", "0.6601618", "0.6594524", "0.65874624", "0.6586911", "0.6561655", "0.6515913", "0.64981186", "0.64634067", "0.6456407", "0.6401265", "0.63983953", "0.63895154", "0.63691413", "0.6336269", "0.63274163", "0.6319917", "0.62727153", "0.622036", "0.6208763", "0.6201626", "0.61900604", "0.6184773", "0.614122", "0.61290365", "0.610145", "0.60862786", "0.60841817", "0.6066499", "0.6048311", "0.60464776", "0.6038624", "0.6037474", "0.5998273", "0.59735274", "0.5953013", "0.59529716", "0.59492534", "0.59421504", "0.5917082", "0.59139836", "0.58925414", "0.58913326", "0.5876968", "0.58681697", "0.5863872", "0.5861688", "0.5853222", "0.5845015", "0.58409727", "0.58342606", "0.5824398", "0.58239836", "0.5822156", "0.58121467", "0.5811887", "0.5810263", "0.58018667", "0.58005047", "0.57916105", "0.5790291", "0.57890546", "0.5786907", "0.57790923", "0.5751889", "0.57320124", "0.5728311", "0.57205886", "0.57131714", "0.5704906", "0.57028043", "0.57008374", "0.5696297", "0.5695535", "0.5692123", "0.56914264", "0.56906897", "0.56892264", "0.5672031", "0.5655229", "0.56510574" ]
0.830038
0
Prepend output (HTML code or PHP code with tags) before the output (but after the namespace statement if present).
Добавьте вывод (HTML-код или PHP-код с тегами) перед выводом (но после утверждения пространства имен, если оно присутствует).
public function prependOutput($code) { $this->setOutput( $this->hasNamespaceStatement($namespaceStatement, $output) ? $this->concatCode( $this->closePhpCode($namespaceStatement), $code, $this->openPhpCode($output) ) : $this->concatCode($code, $this->output) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependCode($code)\n {\n return $this->prependOutput($this->closePhpCode($this->openPhpCode($code)));\n }", "protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }", "public function prependNamespace($namespace, $hints);", "public function PrependOutput(string $prepend = null) : self|string \n {\n if($prepend == null) return $this->prepend;\n else {\n $this->prepend = $prepend;\n return $this;\n }\n }", "public function prependNamespace(string $namespace, $hints);", "private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}", "function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }", "function yy_r14()\n {\n if ($this->text_is_php) {\n $this->compiler->prefix_code[] = $this->yystack[$this->yyidx + 0]->minor;\n $this->compiler->nocacheCode('', true);\n } else {\n // inheritance child templates shall not output text\n if (! $this->compiler->isInheritanceChild || $this->compiler->block_nesting_level > 0) {\n if ($this->strip) {\n $this->compiler->template_code->php('echo ')->string(preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor))->raw(\";\\n\");\n } else {\n $this->compiler->template_code->php('echo ')->string($this->yystack[$this->yyidx + 0]->minor)->raw(\";\\n\");\n }\n }\n }\n }", "protected function transpilePrepend($expression): string\n {\n return \"<?php \\$__env->startPrepend{$expression}; ?>\";\n }", "public function renderAjaxBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\t$replaceScripts='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN])) {\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('body').prepend\").\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\t\t\n\t\tif($replaceScripts!=='') {\n\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t}\n\t\tif($html!=='') {\n\t\t\t$output=$html.$output;\n\t\t}\n\t}", "protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}", "function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }", "public function stdWrap_prepend($content = '', $conf = [])\n {\n return $this->cObjGetSingle($conf['prepend'], $conf['prepend.'], '/stdWrap/.prepend') . $content;\n }", "public function renderBodyBegin(&$output)\n\t{\n\t\t$html = '';\n\t\tif (isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_BEGIN])) . \"\\n\";\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<body\\b[^>]*>)/is', '$1<###begin###>', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###begin###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}", "public function testPrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->prepend(\"Hello\")->prepend(\"World\");\n\n\t\t\t$this->assertEquals(\"WorldHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function testPrependHtml() {\r\n\t\t$this->testObject->prependHtml ( '<div>test</div>' );\r\n\t\t$this->assertTrue ( '<div>test</div>' == $this->testObject->getPrependHtml (), 'incorrect prepended html found' );\r\n\t}", "public function renderBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<body\\b[^>]*>)/is','$2<###begin###>',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###begin###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}", "public function startContent() {\n ob_start();\n }", "function HTML_StartHead(){\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html>\\n\";\n\t\techo \"<head>\\n\";\n}", "private function renderHead() {\n\t\t\n\t\t\t$this->outputLine('<head>');\n\t\t\t\n\t\t\tif ($this->_title != '') {\n\t\t\t\t$this->outputLine('\t<title>' . $this->_title . '</title>');\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('\t<base href=\"' . $this->_base . '\" />');\n\t\t\t\n\t\t\t$this->outputLine('\t<meta http-equiv=\"content-type\" content=\"' . $this->_contentType . '\" />');\n\t\t\t\n\t\t\t//Meta\n\t\t\tforeach ($this->_meta as $meta) {\n\t\t\t\t$this->outputLine('\t<meta name=\"' . $meta->name . '\" content=\"' . $meta->content . '\" />');\n\t\t\t}\n\t\t\t\n\t\t\t//CSS\n\t\t\tforeach ($this->_css as $css) {\n\t\t\t\t$this->outputLine(\"\t\" . $css);\n\t\t\t}\n\t\t\t\n\t\t\t//JS\n\t\t\tforeach ($this->_js as $js) {\n\t\t\t\t$this->outputLine(\"\t\" . $js);\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('</head>');\n\t\t\n\t\t}", "public function removeNamespaceDeclarations() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_NAMESPACE_DECLARATION, '', $this->processedClassCode);\n\t}", "private function renderHead() {\n\t\t$head = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n\t\tif (!empty($this->stylesheets))\n\t\t\t$head .= implode(PHP_EOL, $this->stylesheets);\n\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$head .= $this->openTag('rss', array(\n\t\t\t\t\t\t\"version\" => \"2.0\",\n\t\t\t\t\t\t\"xmlns:content\" => \"http://purl.org/rss/1.0/modules/content/\",\n\t\t\t\t\t\t\"xmlns:atom\" => \"http://www.w3.org/2005/Atom\",\n\t\t\t\t\t\t\"xmlns:wfw\" => \"http://wellformedweb.org/CommentAPI/\")) . PHP_EOL;\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$head .= $this->openTag('rdf:RDF', array(\n\t\t\t\t\t\t\"xmlns:rdf\" => \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n\t\t\t\t\t\t\"xmlns\" => \"http://purl.org/rss/1.0/\",\n\t\t\t\t\t\t\"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\t)) . PHP_EOL;\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$head .= $this->openTag('feed', array(\"xmlns\" => \"http://www.w3.org/2005/Atom\")) . PHP_EOL;\n\t\t}\n\t\treturn $head;\n\t}", "public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "public abstract function add($prefix, $output);", "public function startIndent() {\r\n\t\treturn '<div class=indent>';\r\n\t}", "function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '\".$_tmp'.$this->prefix_number.'.\"'; $this->compiler->has_variable_string = true; }", "public function renderAjaxHead(&$output) {\n\t\t/*\n\t\t$count=preg_match('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is',$output);\n\t\tif ($count){\n\t\t\t$this->renderHead($output);\n\t\t} else {\n\t\t*/\n\t\t\t$replaceScripts='';\n\t\t\t$html='';\n\t\t\tforeach($this->metaTags as $meta)\n\t\t\t\t$replaceScripts.=checkInsertReplaceMeta($meta).\"\\n\";\n\t\t\tforeach($this->linkTags as $link)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertLink($link).\"\\n\";\n\t\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertCssFile($url,$media).\"\\n\";\n\t\t\t\t\n\t\t\tforeach($this->css as $css)\n\t\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\t\tif($this->enableJavaScript) {\n\t\t\t\tif(isset($this->scriptFiles[self::POS_HEAD])) {\n\t\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('head').append\").\"\\n\";\n\t\t\t\t}\n\n\t\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t\t}\n\t\t\tif($replaceScripts!=='') {\n\t\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t\t}\n\t\t\tif($html!=='') {\n\t\t\t\t$output=$html.$output;\n\t\t\t}\n\t\t//}\n\t}", "function prepend($content) {\n\t\t$this->write($content . $this->read());\n\t}", "public function prepend($middleware): void;", "public function renderHead(&$output)\n\t{\n\t\t$html = '';\n\t\tforeach ($this->metaTags as $meta)\n\t\t\t$html.=self::metaTag($meta['content'], null, null, $meta) . \"\\n\";\n\t\tforeach ($this->cssFiles as $url => $media)\n\t\t\t$html.=self::cssFile($url, $media) . \"\\n\";\n\n\t\tforeach($this->css as $css)\n\t\t\t$html.=self::css($css[0],$css[1]).\"\\n\";\n\t\t\t\t\n\t\tif(isset($this->gapiScripts[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->gapiScripts[self::POS_HEAD] as $gapiScript)\n\t\t\t\t$html.=self::scriptFile($gapiScript) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scriptFiles[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\n\t\tif (isset($this->scripts[self::POS_HEAD]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_HEAD])) . \"\\n\";\n\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is', '<###head###>$1', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###head###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}", "protected function printHead($prefix='')\n {\n echo $prefix.'<HEAD>';\n if($this->getBrowserName() === 'IE')\n {\n $this->printIeCompatability($prefix.$prefix);\n }\n echo $prefix.$prefix.'<TITLE>'.$this->title.'</TITLE>';\n echo $prefix.$prefix.'<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">';\n foreach($this->head_tags as $tag)\n {\n echo $prefix.$prefix.$tag.\"\\n\";\n }\n echo $prefix.'</HEAD>';\n }", "public function add_head_marker() {\n\t\tglobal $wpUnited;\n\n\t\tif ($wpUnited->should_do_action('template-p-in-w') && (!PHPBB_CSS_FIRST)) {\n\t\t\techo '<!--[**HEAD_MARKER**]-->';\n\t\t}\n\t}", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"\\r\\n\";\n echo \"<sitemapindex xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public static function fixNamespaceDeclarations($source)\n {\n if (!function_exists('token_get_all') || !self::$useTokenizer) {\n if (preg_match('/(^|\\s)namespace(.*?)\\s*;/', $source)) {\n $source = preg_replace('/(^|\\s)namespace(.*?)\\s*;/', \"$1namespace$2\\n{\", $source).\"}\\n\";\n }\n\n return $source;\n }\n\n $rawChunk = '';\n $output = '';\n $inNamespace = false;\n $tokens = token_get_all($source);\n\n for ($i = 0; isset($tokens[$i]); ++$i) {\n $token = $tokens[$i];\n if (!isset($token[1]) || 'b\"' === $token) {\n $rawChunk .= $token;\n } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {\n // strip comments\n continue;\n } elseif (T_NAMESPACE === $token[0]) {\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n $rawChunk .= $token[1];\n\n // namespace name and whitespaces\n while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {\n $rawChunk .= $tokens[$i][1];\n }\n if ('{' === $tokens[$i]) {\n $inNamespace = false;\n --$i;\n } else {\n $rawChunk = rtrim($rawChunk).\"\\n{\";\n $inNamespace = true;\n }\n } elseif (T_START_HEREDOC === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n do {\n $token = $tokens[++$i];\n $output .= isset($token[1]) && 'b\"' !== $token ? $token[1] : $token;\n } while ($token[0] !== T_END_HEREDOC);\n $output .= \"\\n\";\n $rawChunk = '';\n } elseif (T_CONSTANT_ENCAPSED_STRING === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n $rawChunk = '';\n } else {\n $rawChunk .= $token[1];\n }\n }\n\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n\n $output .= self::compressCode($rawChunk);\n\n if (\\PHP_VERSION_ID >= 70000) {\n // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098\n unset($tokens, $rawChunk);\n gc_mem_caches();\n }\n\n return $output;\n }", "function addNamespace($namespace);", "function yy_r104()\n {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->php(\"ob_start();\")->newline();\n $code->mergeCode($this->yystack[$this->yyidx + 0]->minor);\n $code->php(\"\\$_tmp{$this->prefix_number} = ob_get_clean();\")->newline();\n $this->compiler->prefix_code[] = $code;\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n }", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function prepend($content){\n\t\t$this->_String4 = \"$content\".$this->_String4;\n\t\treturn $this;\n\t}", "public function testCompileBlockChildPrepend()\n {\n $result = $this->smarty->fetch('test_block_child_prepend.tpl');\n $this->assertContains(\"prepend - Default Title\", $result);\n }", "public function renderHead(&$output)\n {\n\t$html='';\n\tforeach($this->metaTags as $meta)\n\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\tforeach($this->linkTags as $link)\n\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\tforeach($this->cssFiles as $url=>$media)\n\t\t$html.=CHtml::cssFile($url,$media).\"\\n\";\n\tforeach($this->css as $css)\n\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\tif($this->enableJavaScript)\n\t{\n if(isset($this->scriptFiles[self::POS_HEAD]))\n {\n\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n $html.=CHtml::scriptFile($scriptFile).\"\\n\";\n }\n\n if(isset($this->scripts[self::POS_HEAD]))\n\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n }\n\n if($html!=='')\n {\n\t\t$count=0;\n\t\t//$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$1',$output,1,$count);\n $output=preg_replace('/(<\\\\/title\\s*>)|(<\\\\/head\\s*>)/is','$1<###head###>$2',$output,1,$count);\n\t\tif($count)\n //$output=str_replace('<###head###>',$html,$output);\n $output=str_replace('<###head###>',\"\\n\".$html,$output); \n\t\telse\n $output=$html.$output;\n }\n }", "function initialize () {\n $this->set_openingtag(\"<PRE[attributes]>\");\n\t $this->set_closingtag(\"</PRE>\");\n }", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "private function getOgHeadLineString()\n\t{\n\t\t$prefix = 'og: http://ogp.me/ns# fb: http://ogp.me/fb# article: http://ogp.me/article#';\n\t\t\n\t\treturn sprintf('<head prefix=\"%s\">', $prefix) . \"\\n\";\n\t}", "private function _print_html_head()\n\t{\n\t\t$output = \"<head>\\n\";\n\t\t$output .= \"<title>{$this->title}</title>\\n\";\n\t\t$output .= $this->_print_html_head_metatags();\n\t\t$output .= $this->_print_html_head_javascript();\n\t\t$output .= $this->_print_html_head_css();\n\t\t$output .= \"</head>\\n<body>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "function showBegin( $appctx )\n\t{\n\t\t$appctx->Plus() ;\n\t\t$appctx->Indent() ;\n\t\techo( \"<span id=\\\"$this->idx\\\" class=\\\"nodelabel\\\" >\\n\") ;\n\t}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}", "function initialize() {\n $this->set_openingtag(\"<CODE[attributes]>\");\n $this->set_closingtag(\"</CODE>\");\n }", "public function begin()\n\t{\n\t\t$this->show('<h3>' . get_class($this) . '</h3>' . LF . '<ul>' . LF);\n\t}", "function yy_r172()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->db_quote_code_buffer = \"ob_start();\\n\";\n }\n $this->db_quote_code_buffer .= $this->yystack[$this->yyidx + - 1]->minor->buffer;\n if ($this->block_nesting_level == count($this->compiler->_tag_stack)) {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->formatPHP($this->db_quote_code_buffer . ' $_tmp' . $this->prefix_number . '=ob_get_clean();')->newline();\n $this->compiler->prefix_code[] = $code;\n $this->db_quote_code_buffer = '';\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n } else {\n $this->_retvalue = false;\n }\n\n }", "function basecss_insert_head($flux){\n\tif (!test_plugin_actif('Zcore')){\n\t\t$flux .= \"<\".\"?php header(\\\"X-Spip-Filtre: basecss_pied_de_biche\\\"); ?\".\">\";\n\t}\n\treturn $flux;\n}", "public function WPHead() {\n\t\t// Just tag the page for fun.\n\t\techo \"\\n\\t\" . '<!-- This site uses Good Old Gallery, get it from http://wp.unwi.se/good-old-gallery -->' . \"\\n\\n\";\n\t}", "public function show_head() {\n \n $output = '<head>';\n \n if( empty( $this->title ) ) {\n $this->title = \"No Title Available\";\n } \n\n $output .= '<title>' . $this->title . '</title>';\n $output .= $this->get_header_elements();\n $output .= \"\\n</head>\";\n\n echo $output;\n }", "function strong_open() {\n $this->doc .= '<strong>';\n }", "protected function showBeginHTML(): self {\n echo <<<HTML\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>{$this->getTitle()}</title>\n <meta name=\"keywords\" content=\"{$this->getKeywords()}\">\n <meta name=\"description\" content=\"{$this->getDescription()}\">\n <meta name=\"author\" content=\"Dmitri Serõn\">\n <link rel=\"stylesheet\" href=\"/assets/css/styles.css\">\n</head>\n<body>\nHTML;\n\n return $this;\n }", "function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;\r\n\t}", "function initialize () {\n $this->set_openingtag(\"<HEADER[attributes]>\");\n\t $this->set_closingtag(\"</HEADER>\");\n }", "function start_html($extra = '')\n{\n /** Starting the HTML document */\n start_tag('html', '', true, $extra) ;\n}", "function displayTagTopHtml(){\n echo\n '<!DOCTYPE html>\n <html lang=\"fr\">';\n}", "public function prepend(ContainerBuilder $container)\n {\n $container->prependExtensionConfig('nogrod_xml_client', []);\n }", "function tideways_prepend_overwritten()\n{\n}", "function print_html_top() {\r\n\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">' .\r\n\t\t\t\"\\n<html>\";\r\n\t}", "function BasicHead()\n{\n print LoadTemplate(\"basic_head\");\n\n $_SESSION[\"head_printed\"] = true;\n}", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function yy_r13()\n {\n $this->is_xml = true;\n $this->compiler->template_code->php(\"echo '<?xml';\\n\");\n }", "public function beforeToHtml()\n {\n if (!\\class_exists('Mage')) {\n class_alias('\\LCB\\Mage\\Framework\\Mage', 'Mage');\n }\n }", "function _wp_get_head(){\n $msg=\"<?xml version='1.0' encoding='ISO-8859-2'?>\n\t\t\t\t\t<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'\n\t\t\t\t\t\t\t\t\t xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n\t\t\t\t\t\t\t\t\t xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n\t\t\t\t\t\t\t\t\t xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'\n \t\t\t\t\t\t\t xmlns:ns4='http://codewebservice.namespace'\n\t\t\t\t\t\tSOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>\n\t\t\t\t\t<SOAP-ENV:Body>\n \t\";\n return $msg;\n }", "public function output_head() {\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) return;\n\n\t\t// no indentation on purpose\n\t\t?>\n<!-- Start WooCommerce KISSmetrics -->\n<script type=\"text/javascript\">\n\tvar _kmq = _kmq || [];\n\tfunction _kms(u) {\n\t\tsetTimeout(function () {\n\t\t\tvar s = document.createElement('script');\n\t\t\tvar f = document.getElementsByTagName('script')[0];\n\t\t\ts.type = 'text/javascript';\n\t\t\ts.async = true;\n\t\t\ts.src = u;\n\t\t\tf.parentNode.insertBefore(s, f);\n\t\t}, 1);\n\t}\n\t_kms('//i.kissmetrics.com/i.js');\n\t_kms('//doug1izaerwt3.cloudfront.net/<?php echo $this->api_key; ?>.1.js');\n\t_kmq.push(['identify', '<?php echo $this->get_identity(); ?>']);\n\t<?php if ( is_front_page() && $this->event_name['viewed_homepage'] ) echo \"_kmq.push(['record', '\" . $this->event_name['viewed_homepage'] . \"' ]);\\n\"; ?>\n</script>\n<!-- end WooCommerce KISSmetrics -->\n\t\t<?php\n\t}", "public function prepend($content)\n {\n return !empty($content) ? $this->renderContent($content) . ' ' : '';\n }", "public static function printHead() {\n header('Content-Type: text/html; charset='.CHARSET);\n // Checking Bootsprap is enabled\n if(BOOTSTRAP_ON === TRUE){\n //Bootstrap include\n echo BS_DOCTYPE5;\n echo '<html lang=\"'.LANG.'\">';\n echo '<head>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">';\n echo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">';\n \n // HTML Title\n echo '<title>'.HTML_TITLE.'</title>';\n // Bootstrapping via CDN\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSS_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSSTHEME_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.MY_CSS.'\">';\n\n }\n elseif(BOOTSTRAP_ON === 5){\n echo BS_DOCTYPE5;\n echo '<html>';\n echo '<html lang=\"'.LANG.'\">';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n } \n else {\n echo BS_DOCTYPE401;\n echo '<html>';\n echo '<head>';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta http-equiv=\"content-type\" content=\"text/html; '\n .'charset='.CHARSET.'\">'.\"\\n\";\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css.php\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n }\n \n echo '<meta name=\"description\" content=\"'.META_DESCRIPTION.'\">';\n echo '<meta name=\"author\" content=\"'.META_AUTHOR.'\">';\n echo '<meta name=\"keywords\" content=\"'.META_KEYWORDS.'\">';\n echo '<meta name=\"date\" content=\"'.META_DATE.'\">';\n echo '</head>';\n }", "public function renderHead(&$output)\n\t{\n\t\t$html='';\n\t\tforeach($this->metaTags as $meta)\n\t\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\t\tforeach($this->linkTags as $link)\n\t\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\t\t\t\n\t\t//nlac:\n\t\t$html.= self::defCssLoader();\n\n\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t$html.=self::cssFile($url,$media).\"\\n\";\n\t\tforeach($this->css as $css)\n\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\tif($this->enableJavaScript)\n\t\t{\n\t\t\tif(isset($this->scriptFiles[self::POS_HEAD]))\n\t\t\t{\n\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t\t}\n\n\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t}\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$2',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###head###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}", "function rainette_insert_head($flux) {\n\t$flux .= rainette_insert_head_css($flux);\n\n\treturn $flux;\n}", "function start()\n {\n ob_start();\n ob_implicit_flush(0);\n }", "function showBegin( $appctx )\n\t\t{\n\t\t$appctx->Plus() ;\n\t\t}", "public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }", "public function prepend($content)\n\t{\n\t\t$this->content = $content.$this->content;\n\t}", "function finalizeTopHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"<!doctype html>\\n\";\n\t\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t\t$returnVal .= \"<head><title>\";\n\t\t$returnVal .= $this->_title;\n\t\t$returnVal .= \"</title>\\n\";\n\t\t$returnVal .= $this->_headSection; \n\t\t$returnVal .= \"</head>\\n\";\n\t\t$returnVal .= \"<body>\\n\";\n\t\t$returnVal .= \"<div id='container'>\\n\";\n\t\t$this->_topHTML = $returnVal;\n\t}", "public function start_output() {\n echo \"<!DOCTYPE html><html><head>\";\n echo \\html_writer::empty_tag('meta', ['charset' => 'UTF-8']);\n echo \\html_writer::tag('title', $this->filename);\n echo \"<style>\nhtml, body {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 13px;\n background: #eee;\n}\nth {\n border: solid 1px #999;\n background: #eee;\n}\ntd {\n border: solid 1px #999;\n background: #fff;\n}\ntr:hover td {\n background: #eef;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0pt;\n width: 80%;\n margin: auto;\n}\n</style>\n</head>\n<body>\";\n }", "public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }", "function start_capture () {\n if ($this->display_template_output) {\n\t // ob_end_clean(); // Clear out the capture buffer. Removed in v4.3.3\n\t ob_start();\n\t}\n }", "protected function getHeadTag() {\r\n\t\t$headTagContent = '';\r\n\t\tif (count($this->profile) > 0) {\r\n\t\t\t$headTagContent .= sprintf(' profile=\"%s\"', implode(',', $this->profile));\r\n\t\t}\r\n\t\tif (count($this->prefix) > 0) {\r\n\t\t\tforeach ($this->prefix as $k => $v) {\r\n\t\t\t\t$data[$k] = sprintf('%s: %s', $k, $v);\r\n\t\t\t}\r\n\t\t\t$headTagContent .= sprintf(' prefix=\"%s\"', implode(' ', $data));\r\n\t\t}\r\n\t\tif (!empty($headTagContent)) {\r\n\t\t\treturn sprintf('<head%s >', $headTagContent);\r\n\t\t}\r\n\t}", "function add_opengraph_doctype($output)\n{\n\t\treturn $output . ' xmlns:og=\"http://opengraphprotocol.org/schema/\" xmlns:fb=\"http://www.facebook.com/2008/fbml\"';\n}", "function tag($tag_name, $op, $pref = '', $nl = false, $extra = '')\n{\n echo $pref . '<' ;\n if ($op == 'close') {\n echo '/' ;\n }\n echo $tag_name ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n if ($nl == true) {\n NL() ;\n }\n}", "public function printContent()\n {\n GeneralUtility::logDeprecatedFunction();\n $this->content .= $this->doc->endPage();\n $this->content = $this->doc->insertStylesAndJS($this->content);\n echo $this->content;\n }", "function dw2_insert_head($flux) {\r\n\t\t$flux.= \"\\n\".'<script type=\"text/javascript\" src=\"'._DIR_PLUGIN_DW2.'dw2_fermepop.js\"></script>'.\"\\n\";\r\n\t\t$flux.= \"\\n\".'<link rel=\"stylesheet\" type=\"text/css\" href=\"'._DIR_PLUGIN_DW2.'dw2_public_styles.css\" />'.\"\\n\";\r\n\t\treturn $flux;\r\n\t}", "function yy_r10()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n if (! ($this->compiler->template instanceof SmartyBC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n } else {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n }\n }", "public function head() {\n\t\treturn '';\n\t}", "public function addScriptToHeader($context)\n\t\t{\n\t\t\tif(!empty(Symphony::Engine()->Author))\n\t\t\t{\n\t\t\t\tif(Symphony::Engine()->Author->isDeveloper())\n\t\t\t\t{\n\t\t\t\t\t$context['output'] = str_replace('</head>', '\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,tv,projection\" href=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.css\" />\n\t\t\t\t\t\t<script type=\"text/javascript\" src=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.js\"></script>\n\t\t\t\t\t\t</head>', $context['output']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function flipboard_namespace() {\n echo 'xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:georss=\"http://www.georss.org/georss\"';\n}", "public function addHead()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/head.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/head.php\");\n }\n }", "public function prepend(HttpMessage $message, $top = null) {}", "public function testPrependLinePrefix() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", false)->prependLine(\"World\", false);\n\n\t\t\t$this->assertEquals(\"\\nWorld\\nHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "function pre_echo( $var ) {\n\techo '<pre>'.\"\\n\";\n\techo $var;\n\techo '</pre>'.\"\\n\";\n}" ]
[ "0.58757246", "0.5805363", "0.58006907", "0.5750906", "0.56097054", "0.554297", "0.54619336", "0.5320644", "0.52834266", "0.52182925", "0.5192875", "0.5177417", "0.51601654", "0.5148874", "0.51479465", "0.5146182", "0.5137702", "0.512527", "0.51183283", "0.5111244", "0.5107774", "0.5084451", "0.5070424", "0.5064522", "0.5045186", "0.5034566", "0.50327384", "0.5018626", "0.50058895", "0.5004993", "0.5003828", "0.49933156", "0.49807906", "0.4971395", "0.49499592", "0.49495617", "0.49318135", "0.49289232", "0.49238926", "0.4919347", "0.4914717", "0.49135244", "0.48985174", "0.48968595", "0.48957476", "0.48779237", "0.48748875", "0.48684815", "0.48564744", "0.48546988", "0.4853001", "0.4853001", "0.48521158", "0.48454908", "0.48430663", "0.48349386", "0.48319367", "0.48110905", "0.48089448", "0.480468", "0.4800682", "0.47996885", "0.4796428", "0.47945386", "0.47833854", "0.47827098", "0.4779697", "0.47768113", "0.47763827", "0.4772368", "0.47691637", "0.47661418", "0.47649905", "0.47645152", "0.47471738", "0.4741963", "0.47403526", "0.47372437", "0.47367507", "0.47325295", "0.47296077", "0.47276178", "0.4726373", "0.4722589", "0.47219798", "0.47133598", "0.4711136", "0.47091487", "0.47086444", "0.47057495", "0.47045243", "0.47015676", "0.4695799", "0.46949595", "0.46888548", "0.4684228", "0.4673295", "0.46724313", "0.46678817", "0.46672565" ]
0.73823994
0
Test Case: Validate that the project has a title.
Тест-кейс: Проверить, что проект имеет заголовок.
public function shouldHaveTitle() { // Arrange $attributes = factory(Project::class)->raw([ 'title' => '', ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProjectTitle();", "public function testGettingTheTitle()\n {\n $this->assertEquals('title', $this->revision->getTitle());\n }", "public function testAssignTitle()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function testTitle()\n {\n $this->visit('/')\n ->see('Site title','title');\n }", "public function set_title($title)\n\t{\n\t\tif (is_null($title)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Title Invalid!\");\n\t\t}\n\t\t$this->title = $title;\n\t}", "public function testTitleErrors() {\n //Check the title is required\n $badData = $this->goodData;\n $badData['title'] = '';\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)));\n }", "public function testNullTitle()\n {\n $this->browse(function (Browser $browser) {\n //Make a book to add \n $book = factory('App\\Book')->make();\n $book -> title = ' '; \n //Navigate to the create page and send the data\n $browser->visit('/api/books/create')\n ->type('title', $book->title)\n ->type('author', $book->author)\n ->press('Add');\n //Check we remain on the same page and an error is displayed.\n $browser->pause(500);\n $browser->assertPathIs('/api/books/create')->assertSee('The title field is required.');\n\n //Check the new book is not displayed\n $browser->visit('/api/books')\n ->assertDontSee($book->author);\n\n });\n\n }", "public function it_should_have_a_title_that_contains_wizard()\n {\n // for example getTitle() should contain word 'dragon'\n $this->getTitle()->shouldMatch('/dragon/i');\n }", "public function testTitle()\n {\n $this->markTestSkipped();\n }", "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }", "public function testTitle()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's title is correct\n $this->assertTrue($feed->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n $this->verifyProperty2(\n $feed,\n \"title\",\n \"text\",\n \"GData Ops Demo's Composite View\"\n );\n\n // Assert that all entry's have an Atom ID object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n }\n\n // Assert one of the entry's Titles\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"title\", \"text\", \"all day event may 24\");\n }", "public function a_project_require_a_name()\n {\n $project = factory(Project::class)->raw(['name' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'name',\n ],\n ]);\n }", "public function testGetTitle(){\n $this->assertSame(\"Ms./Mrs.\", Customer::getTitle(\"female\"));\n $this->assertSame(\"Mr.\", Customer::getTitle(\"male\"));\n $this->assertSame(\"\", Customer::getTitle(\"\"));\n $this->assertSame(\"\", Customer::getTitle(\"daererer\"));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function page_title_should_return_the_base_title_if_the_title_is_empty()\n {\n $this->assertEquals('Laracarte - List of artisans', page_title(''));\n }", "public function validateTitle()\n {\n if (empty($this->_taintedData['title'])) {\n $this->_addErrorMessage(\"Please fill in the title\");\n\n return false;\n }\n\n $title = $this->_cleanData['title'];\n\n if (strlen($title) > 100) {\n $this->_addErrorMessage(\"Your talk title has to be 100 characters or less\");\n\n return false;\n }\n\n return true;\n }", "function testNameAndTitleGeneration() {\n\t\t$file = $this->objFromFixture('File', 'asdf');\n\t\t$this->assertEquals('FileTest.txt', $file->Name);\n\t\t$this->assertNull($file->Title);\n\t\t\n\t\t/* However, if Name is set instead of Filename, then Title is set */\n\t\t$file = $this->objFromFixture('File', 'setfromname');\n\t\t$this->assertEquals(ASSETS_DIR . '/FileTest.png', $file->Filename);\n\t\t$this->assertEquals('FileTest', $file->Title);\n\t}", "public function shouldHaveDescription()\n {\n // Arrange\n $attributes = factory(Project::class)->raw([\n 'description' => ''\n ]);\n\n // Action\n $response = $this->post('/projects', $attributes);\n\n // Assert\n $response->assertSessionHasErrors('description');\n }", "private function check_title($title)\n {\n if(!empty($title))\n return true;\n else\n {\n $this->errors[] = 3; // empty title!\n return false;\n }\n }", "private function validateProjectValues(\n string $title,\n string $url,\n string $folder\n ): bool {\n $valid = true;\n $v = Validator::make([], []);\n\n if (empty($title)) {\n $v->getMessageBag()\n ->add('title', 'Empty title');\n $valid = false;\n }\n if (empty($url)) {\n $v->getMessageBag()\n ->add('url', 'Empty url');\n $valid = false;\n }\n if (empty($folder)) {\n $v->getMessageBag()\n ->add('folder', 'Empty folder');\n $valid = false;\n }\n\n if (!UrlHelper::validate($url)) {\n $v->getMessageBag()\n ->add('url', 'Invalid url');\n $valid = false;\n }\n\n return $valid;\n }", "public function validate_title( $valid, $title, $field, $input_name ) {\r\n\t\tglobal $post_id; //no value on ajax call / has value on submit\r\n\r\n\t\t$post_id_js = $_POST['custom_post_id'];\r\n\r\n\t // Bail early if value is already invalid.\r\n\t if( $valid !== true) {\r\n\t return $valid;\r\n\t }\r\n\r\n\t\t$dir = $this->create_downloads_dir();\r\n\t\t$slug = str_replace(\" \", \"-\", $title);\r\n\r\n\t\t$title_dir = $dir['reports_dir'].'/'.strtolower($slug);\r\n\r\n\t\t$title_exist = $this->check_if_title_exist($slug, $post_id_js);\r\n\r\n\t\tif($title_exist){\r\n\t\t\treturn __(\"Title already exist\");\r\n\t\t}\r\n\r\n\t\tif($post_id){\r\n\t\t\t$old_title = get_the_title($post_id);\r\n\t\t\t$old_title_slug = str_replace(\" \", \"-\", $old_title);\r\n\t\t\t$old_title_dir = $dir['reports_dir'].'/'.strtolower($old_title_slug);\r\n\t\t\t// wp_die($post_id);\r\n\t\t\tif($title != $old_title && $old_title && file_exists($old_title_dir)){\r\n\t\t\t\trename($old_title_dir, $title_dir);\r\n\t\t\t}else{\r\n\t\t\t\tif(!file_exists($title_dir)){ mkdir($title_dir, 0777); }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t return $valid;\r\n\t}", "public function validateTestCaseIdTitleUniqueness()\n {\n $dupes = [];\n foreach ($this->testCaseToTitleMappings as $newTitle => $files) {\n if (count($files) > 1) {\n $dupes[$newTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"TestCaseId and Title pairs must be unique:\\n\\n\";\n foreach ($dupes as $newTitle => $tests) {\n $testCaseTitleArray = explode(\": \", $newTitle);\n $testCaseId = $testCaseTitleArray[0];\n $title = $testCaseTitleArray[1];\n $message .= \"TestCaseId: '{$testCaseId}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testAdminCanNotAddAPageWithBlankTitle()\n {\n $params = [];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n\n $this->assertEquals('The title field is required.', $errors->get('title')[0]);\n }", "public function testIndexTitle()\n {\n\n // Add a page called \"title\".\n $page = $this->_simplePage(true, 'title');\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index title.\n $this->assertEquals('title', $document->title);\n\n }", "public function checkUniqueTitle()\n {\n $this->viewBuilder()->layout(false);\n if($this->request->is('post')) {\n $data = $this->request->data;\n $result = $this->Titles->isTitleExist($data['name']);\n if(!empty($result)){\n echo \"false\";\n } else {\n echo \"true\";\n }\n }\n die;\n }", "public function testEditTitleError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => '',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => 'Edit comment'),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_APPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\t\t$this->assertArrayHasKey('title', $result['error']['validationErrors'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "public function it_should_have_a_string_as_title()\n {\n // for example method getTitle() should return a string, if not it will be failed.\n $this->getTitle()->shouldBeString();\n }", "public function testTitleExpected($url, $expectedTitle)\r\n {\t\r\n $p = new PageGrabber($url);\r\n\t$result = $p->get_title();\r\n\t\t\r\n\t$this->assertEquals($expectedTitle, $result);\r\n }", "public function testTitleText() {\n // Confirm that the view has the normal title before making the view return\n // no result.\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n\n // Change the view to return no result.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Add a value which does not exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Euler',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_empty | Drupal');\n\n // Change the view to return a result instead.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Change to a value which does exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Ringo',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n }", "public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }", "public function getTitle() {\n return $this->requirement->title;\n }", "protected function validate_title_value() {\n\t\tif ( empty( $this->field['fields']['title']['value'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( empty( $this->field['fields']['key']['value'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static function setTitle($projectTitle=\"Default App\")\n {\n global $application_name;\n $application_name = $projectTitle;\n }", "public function it_should_have_a_title_that_starts_with_the_wizard()\n {\n // value is case sensitive\n $this->getTitle()->shouldStartWith('The Wizard');\n }", "public function test_adding_a_title_generates_a_slug()\n {\n //cuando cree un post y le asigne un titulo\n $post=new Post([\n 'title'=>'Como instalar laravel',\n\n ]);\n //en este punto el post deberia tener una propiedad llamada slug que contenga como-instalar-lravel\n $this->assertSame('como-instalar-laravel',$post->slug);\n\n\n\n }", "public function isTitle()\n {\n return $this->getName() === 'title';\n }", "private function updateProjectTitle($project_id, $project_title)\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->update($db->qn('#__pf_projects'))\n\t\t\t->set($db->qn('title') . ' = ' . $db->q($project_title))\n\t\t\t->where($db->qn('id') .' = '. $db->q($project_id))\n\t\t\t->where($db->qn('title') . ' != '. $db->q($project_title));\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t}", "function isValidTaskTitle($taskTitle){\n if(strlen($taskTitle) <= 74){\n return true;\n }\n else{\n echo \"invalid taskTitle\";\n return false;\n }\n }", "public function hasTaskTitle(){\n return $this->_has(3);\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function get_title( )\n {\n return 'Something went wrong.';\n }", "public function validateStoryTitleUniqueness()\n {\n $dupes = [];\n\n foreach ($this->storyToTitleMappings as $storyTitle => $files) {\n if (count($files) > 1) {\n $dupes[$storyTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"Story and Title annotation pairs must be unique:\\n\\n\";\n foreach ($dupes as $storyTitle => $tests) {\n $storyTitleArray = explode(\"/\", $storyTitle);\n $story = $storyTitleArray[0];\n $title = $storyTitleArray[1];\n $message .= \"Story: '{$story}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testQuizRead_Title()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/quizzes')\n ->clickLink('View Quiz')\n ->assertSee('General Knowledge')\n ->screenshot('RoleEdit/QuizRead');\n });\n }", "public function testAdminCanNotAddADuplicatedPageTitle()\n {\n $existPage = Post::factory()->create(['post_type' => Post::PAGE]);\n\n $params = [\n 'title' => $existPage->title,\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n $this->assertEquals('The title has already been taken.', $errors->get('title')[0]);\n }", "public function checkTitle($title)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideas;\r\n $select = $model -> select()->where('title = ?',$title); \r\n $row = $model->fetchRow($select); \r\n if($row)\r\n return true;\r\n else\r\n return false; \r\n }", "public function testGetTitle(array $values) {\n $permission = new GroupPermission($values);\n $this->assertEquals($values['title'], $permission->getTitle());\n }", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "public static function setTitle(string $title) {}", "function greenspace_title($title ) {\n\t\treturn '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'greenspace' ) : $title;\n\t}", "public function hasTitle(){\n return $this->_has(2);\n }", "function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}", "public function hasTitle() {\n return $this->_has(1);\n }", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "public function jobTitle(){\n\t\n\t\t$_error = \"enter the Job Title\";\n\t\treturn $_error;\n\t}", "public function testGetPagesByTitle() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getPagesByTitle('')));\n }", "public function title()\n {\n if ($this->title === null) {\n $title = null;\n\n $translator = $this->translator();\n\n try {\n $config = $this->dashboardConfig();\n } catch (Exception $e) {\n $this->logger->error($e->getMessage());\n $config = [];\n }\n\n if (isset($config['title'])) {\n $title = $translator->translation($config['title']);\n } else {\n $obj = $this->obj();\n $objId = $this->objId();\n $objType = $this->objType();\n $metadata = $obj->metadata();\n\n if (!$title && isset($metadata['admin']['forms'])) {\n $adminMetadata = $metadata['admin'];\n\n $formIdent = filter_input(INPUT_GET, 'form_ident', FILTER_SANITIZE_STRING);\n if (!$formIdent) {\n $formIdent = (isset($adminMetadata['default_form']) ? $adminMetadata['default_form'] : '');\n }\n\n if (isset($adminMetadata['forms'][$formIdent]['label'])) {\n $title = $translator->translation($adminMetadata['forms'][$formIdent]['label']);\n }\n }\n\n if ($objId) {\n if (!$title && isset($metadata['labels']['edit_item'])) {\n $title = $translator->translation($metadata['labels']['edit_item']);\n }\n\n if (!$title && isset($metadata['labels']['edit_model'])) {\n $title = $translator->translation($metadata['labels']['edit_model']);\n }\n } else {\n if (!$title && isset($metadata['labels']['new_item'])) {\n $title = $translator->translation($metadata['labels']['new_item']);\n }\n\n if (!$title && isset($metadata['labels']['new_model'])) {\n $title = $translator->translation($metadata['labels']['new_model']);\n }\n }\n\n if (!$title) {\n $objType = (isset($metadata['labels']['singular_name'])\n ? $translator->translation($metadata['labels']['singular_name'])\n : null);\n\n if ($objId) {\n $title = $translator->translation('Edit: {{ objType }} #{{ id }}');\n } else {\n $title = $translator->translation('Create: {{ objType }}');\n }\n\n if ($objType) {\n $title = strtr($title, [\n '{{ objType }}' => $objType\n ]);\n }\n }\n }\n\n $this->title = $this->renderTitle($title);\n }\n\n return $this->title;\n }", "static public function checkTitle($title)\n {\n $titleErrs = [];\n if (empty($title))\n {\n $titleErrs[] = 'Prosím zadajte nadpis';\n }\n else\n {\n if (strlen($title) > self::MAX_TITLE_LEN)\n {\n $titleErrs[] = 'Nadpis môže mať maximálne 30 znakov';\n }\n }\n return $titleErrs;\n }", "public function has_title() {\n\t\treturn ! empty( $this->title );\n\t}", "public function testTitle()\n {\n\n $this->assertEquals(\"About|Laracarte\",getTile('About'));\n\n }", "public function testProfileTitle()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see(trans('profile.title', ['username'=>'johndoe']));\n }", "public function setTitle($title) {\n\t\t// if passed in title is not between 1 and 255 characters\n\t\tif(strlen($title) < 1 || strlen($title) > 255) {\n\t\t\tthrow new TaskException(\"Task title error\");\n\t\t}\n\t\t$this->_title = $title;\n\t}", "public function editTitle(ProjectTitleRequest $request, Project $project)\n {\n if (!$project->isUserAuthor(Auth::user()))\n abort(403);\n\n $project->title = $request->getTitle();\n $project->save();\n\n return redirect('projects');\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public function setTitle(string $title);", "public function showTestHeadline($title)\n {\n print \"*** \" . $title . \"\\n\";\n }", "function ui_title() {\n if (!isset($this->plugin['ui_title'])) {\n return check_plain($this->plugin['module'] . ':' . $this->plugin['name']);\n }\n return check_plain($this->plugin['ui_title']);\n }", "protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "protected function assertTitle($expected_title) {\n @trigger_error('AssertLegacyTrait::assertTitle() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n // Cast MarkupInterface to string.\n $expected_title = (string) $expected_title;\n return $this->assertSession()->titleEquals($expected_title);\n }", "public function addTitle()\n {\n $project = $this->_xml->project;\n $name = 'Coverage';\n\n // Find the name from the XML, either in the project node, or the\n // package node if it exists\n if (isset($project['name'])) {\n $name = (string) $project['name'];\n } else {\n if (isset($project->package) && isset($project->package['name'])) {\n $name = (string) $project->package['name'];\n }\n }\n\n $this->append(str_repeat(\"-\", 64));\n $this->append($name);\n $this->append(str_repeat(\"-\", 64));\n }", "public static function validateTitle()\n{\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n}", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function hasTitle()\n {\n return $this->title !== null;\n }", "public static function title();", "protected function _preSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null && strlen($titlePhrase) == 0) {\n $this->error(new XenForo_Phrase('please_enter_valid_title'), 'title');\n }\n }", "private function isTitleValid($title) {\n\t\t// Ensure that the languageCode has a valid value\n\t\t$sql = \t<<<EOD\n\t\t\t\tSELECT *\n\t\t\t\tFROM T_ProductLanguage\n\t\t\t\tWHERE F_ProductCode=? \n\t\t\t\tAND F_LanguageCode=?\nEOD;\n\t\t$rs = $this->db->Execute($sql, array($title->productCode, $title->languageCode));\n\t\t\n\t\tswitch ($rs->RecordCount()) {\n\t\t\tcase 0:\n\t\t\t\t// There is no matching pair, raise an error\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t}\n\t\t// Also make sure that Author Plus has a content location\n\t\t// But how to differentiate this from the above error? \n\t\t// Need to return an error code I suppose.\n\t\t// This is left for now. You get a double error message, but that is kind of OK\n\t\t// v3.5 Now dbContentLocation is tied to the field in DMS and is the direct database link\n\t\t//if ($title-> productCode == 1 && ($title->contentLocation == \"\" || $title->contentLocation == null))\n\t\tif ($title-> productCode == 1 && ($title->dbContentLocation == \"\" || $title->dbContentLocation == null))\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "public function testCreateNoTitle()\n {\n // Do Request\n $this->_request('POST', '/api/1.5.0/news-create',['token' => '123'])\n ->_result(['error' => 'no-title']);\n }", "public function tagSetTitle(UnitTester $I)\n {\n $I->wantToTest('Tag - setTitle()');\n\n Tag::resetInput();\n\n $value = 'This is my title';\n\n Tag::setTitle($value);\n\n $I->assertEquals(\n \"<title>{$value}</title>\" . PHP_EOL,\n Tag::renderTitle()\n );\n\n $I->assertEquals(\n \"{$value}\",\n Tag::getTitle()\n );\n }", "public static function title()\n {\n return 'Untitled module';\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function hasTitle(){\n return $this->_has(37);\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function _setIndexDocumentTitle() {\n\n\t\tif ( !isset( $this->imdb_index_body[$this->imdb_language] ) || !isset( $this->imdb_language ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Index_Body_Or_Language_Undefined' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !preg_match_all( '/\\<title\\>[\\x20]*([^\\x20]+[^\\x3c]+[^\\x20]+)[\\x20]*\\<\\/title\\>/', $this->imdb_index_body[$this->imdb_language], $imdb_page_index_document_title_matches[$this->imdb_language] ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Preg_Match_All_False_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !isset( $imdb_page_index_document_title_matches[$this->imdb_language][1] ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Matches_Undefined_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( count( $imdb_page_index_document_title_matches[$this->imdb_language][1] ) !== 1 ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Count_Diff_1_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\t$imdb_page_index_document_title_matches[$this->imdb_language][1][0] = trim( preg_replace( '/^([^\\x20]+[^\\x28\\x29]+[^\\x20\\]+[^\\x20]+) \\((?:TV Mini\\-Series\\x20|TV Movie\\x20|TV Episode\\x20|TV Short\\x20|Video\\x20)?(?:201[0-5]|200[0-9]|19[0-9][0-9])\\) \\- IMDb$/', '$1', $imdb_page_index_document_title_matches[$this->imdb_language][1][0], -1, $prcount[$this->imdb_language] ) );\n\t\t$imdb_page_index_document_title_matches[$this->imdb_language][1][0] = $prcount[$this->imdb_language] === 1 ? $imdb_page_index_document_title_matches[$this->imdb_language][1][0] : trim( preg_replace( '/^([^\\x20]+.+[^\\x20]+[^\\x20]+) \\((?:Video\\x20)?(?:201[0-5]|200[0-9]|19[0-9][0-9])\\) \\- IMDb$/', '$1', $imdb_page_index_document_title_matches[$this->imdb_language][1][0], -1, $prcount[$this->imdb_language] ) );\n\n\t\tif ( $prcount[$this->imdb_language] === 0 ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Preg_Replace_Count_Equal_Zero_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->raw->index->document_title[$this->imdb_language] = $imdb_page_index_document_title_matches[$this->imdb_language][1][0];\n\n\t\treturn true;\n\n\t}", "private function checkTitleTooShort($title)\r\n {\r\n return $this->checkTooShort($title, self::$titleMinLength); \r\n }", "public function testName()\n {\n $this->assertEquals('homepage_url', (new UrlField('homepage_url'))->getName());\n }", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}" ]
[ "0.71535224", "0.70882756", "0.6800982", "0.6733853", "0.66882277", "0.66729856", "0.66538966", "0.663283", "0.65382916", "0.6493532", "0.6470231", "0.64035076", "0.640006", "0.63973784", "0.6364185", "0.63316715", "0.62585", "0.62511885", "0.62008727", "0.61617523", "0.6118278", "0.61099786", "0.6106584", "0.6094753", "0.6062817", "0.60593456", "0.604611", "0.60382104", "0.60324883", "0.59864134", "0.59695745", "0.5961985", "0.5933795", "0.59318316", "0.59216076", "0.5912412", "0.5890094", "0.5883112", "0.5854207", "0.584504", "0.58279264", "0.5783653", "0.57729596", "0.5772377", "0.576764", "0.57589364", "0.57460445", "0.5740082", "0.573992", "0.5725623", "0.57141376", "0.5701054", "0.5684073", "0.5682234", "0.5680166", "0.5643873", "0.5641518", "0.5633999", "0.56272405", "0.56214505", "0.562076", "0.5610368", "0.5596483", "0.5578557", "0.5578474", "0.55743146", "0.5569936", "0.55694604", "0.55614805", "0.55601007", "0.5559476", "0.55556726", "0.5554916", "0.55520684", "0.5551702", "0.55405784", "0.5537894", "0.552473", "0.5514607", "0.5512861", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.55029017", "0.5491805", "0.54869616", "0.54868376", "0.5480037", "0.5478312", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593" ]
0.7968348
0
Test Case: Validate that the project has a description.
Тест-кейс: Проверить, что проект имеет описание.
public function shouldHaveDescription() { // Arrange $attributes = factory(Project::class)->raw([ 'description' => '' ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('description'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }", "public function validateDescription()\n {\n if (empty($this->_cleanData['description'])) {\n $this->_addErrorMessage(\"Your description was missing\");\n\n return false;\n }\n\n return true;\n }", "public function testCommandHasADescription()\n {\n self::assertNotEmpty($this->command->getDescription());\n }", "public function __validate_description() {\n if (isset($this->initial_data['description'])) {\n $this->validated_data[\"description\"] = $this->initial_data['description'];\n } else {\n $this->validated_data[\"description\"] = \"\";\n }\n }", "public function set_description($description)\n\t{\n\t\tif (is_null($description)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Description Invalid!\");\n\t\t}\n\t\t$this->description = $description;\n\t}", "public function testGetDescription(): void\n {\n $this->class->setDescription($this->value);\n\n self::assertSame($this->value, $this->class->getDescription());\n }", "public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }", "public function setProjectDescription($value)\n {\n return $this->set('ProjectDescription', $value);\n }", "public function testAssignDescription()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function testGetModDescription()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function test_create__with_description()\n {\n\n $testee = new ElementFactory();\n $expected = 'lorum ipsum';\n\n $spec = [\n 'attributes' => [\n 'type' => 'text',\n 'name' => 'test',\n ],\n 'description' => $expected\n ];\n\n $element = $testee->create($spec);\n\n static::assertSame($expected, $element->description());\n }", "function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}", "public function descriptionAction()\n {\n $module = $this->getModule();\n $config = Pi::config('', $module);\n\n if ($this->request->isPost()) {\n $data = $this->request->getPost();\n\n // Set form\n $form = new DescForm('solution-desc-form', 'html');\n $form->setInputFilter(new DescFilter);\n $form->setData($data);\n\n if ($form->isValid()) {\n $values = $form->getData();\n\n // Save\n $description = Pi::user()->data->set(0, 'solutions_description', $values['description']);\n\n } else {\n $message = _a('Invalid data, please check and re-submit.');\n }\n } else {\n $data['description'] = Pi::user()->data->get(0, 'solutions_description');\n if (empty($data['description'])) {\n $data['description'] = '<div style=\"font-size: 20px;\">Content is empty.</div>';\n }\n $form = new DescForm('solution-desc-form', 'html');\n $form->setData($data);\n $message = '';\n }\n\n $this->view()->assign('form', $form);\n $this->view()->assign('title', _a('Solutions Description'));\n $this->view()->assign('message', $message);\n $this->view()->setTemplate('solution-description');\n\n }", "public function getDescriptionAction() {\n\n $project_id = $this->input->post('project_id');\n\n $response = $this->project_model->getDescription($project_id);\n\n echo $response[0]['description'];\n }", "protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && strlen($this->_Description) > 30 ) {\n\t\t\t$inMessage .= \"Description cannot be more than 30 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_Description) <= 1 ) {\n\t\t\t$inMessage .= \"Description must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function testGetDescriptionDefault(): void\n {\n self::assertNull($this->class->getDescription());\n }", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }", "public function testSetGetDescription()\n {\n $charge = new Charge();\n $charge->setDescription('Centurion Guarded Delivery via Horse');\n $this->assertEquals($charge->getDescription(), 'Centurion Guarded Delivery via Horse');\n unset($charge);\n }", "public function testSetAndGetDescription()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Description\r\n $testObj->setDescription('Test Test Test Test');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that the Description field was updated\r\n $this->assertEquals('Test Test Test Test', $testObj->getDescription());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Description');\r\n }", "function isValidTaskDescription($taskDescription){\n if (strlen($taskDescription) <= 200){\n return true;\n }\n else{\n echo \"invalid taskDescription\";\n return false;\n }\n }", "protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function __construct($description)\n {\n $this->description = $description;\n }", "function checkDescr($descr, $X_langArray) {\n\tglobal $errorField;\n\t\n\t//descr vuoto\n\tif (!isset($descr) || $descr == ''){\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_EMPTY_DS_ERR']);\n\t}\n\telse if (strlen($descr) < 50 || strlen($descr) > 2000) {\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_DS_LENGTH_ERR']);\n\t}\n}", "public function testDescription()\n {\n $description_original = \"This is the original \\\"description\\\".\";\n $description_received =\n MetaTags::setDescription($description_original,0)\n ->getDescription();\n\n // Make sure what we got back is what we put in. (not truncated)\n $this->assertEquals(\n $description_original,\n $description_received,\"The original description was not a match\"\n );\n\n // Do the same test, but with truncation turned on.\n $description_received =\n MetaTags::setDescription($description_original,10)\n ->getDescription();\n\n // Test to make sure truncation is working.\n $this->assertEquals(\n $description_received,\n MetaTags::truncateAtWord($description_original,10)\n );\n\n $tag_text = MetaTags::renderDescription(true)->__toString();\n $this->assertStringStartsWith(\"<meta \",$tag_text);\n $this->assertStringEndsWith(\">\",$tag_text);\n }", "public function editProject($project_id, $project_name, $project_description, $db)\r\n {\r\n $sql = \"UPDATE projects\r\n set project_name = :project_name,\r\n project_description = :project_description\r\n WHERE id = :project_id\";\r\n\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_name', $project_name);\r\n $pst->bindParam(':project_description', $project_description);\r\n $pst->bindParam(':project_id', $project_id);\r\n\r\n $count = $pst->execute();\r\n return $count;\r\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function shouldHaveTitle()\n {\n // Arrange\n $attributes = factory(Project::class)->raw([\n 'title' => '',\n ]);\n\n // Action\n $response = $this->post('/projects', $attributes);\n\n // Assert\n $response->assertSessionHasErrors('title');\n }", "public function setDesciption($description);", "abstract public function getValidateDesc();", "function hasDescription()\n {\n return !empty($this->description);\n }", "public function testProjectNoReadme()\n {\n // create project to test with\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'prj',\n 'members' => array('foo-member'),\n 'creator' => 'foo-member',\n 'owners' => array()\n )\n )->save();\n\n $this->dispatch('/project/readme/prj');\n $this->assertRoute('project-readme');\n $this->assertRouteMatch('markdown', 'markdown\\controller\\indexcontroller', 'project');\n $this->assertResponseStatusCode(200);\n $result = $this->getResult();\n\n $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $result);\n $this->assertSame('', $result->getVariable('readme'));\n }", "public function test_lti_build_request_description() {\n $this->resetAfterTest();\n\n self::setUser($this->getDataGenerator()->create_user());\n $course = $this->getDataGenerator()->create_course();\n $instance = $this->getDataGenerator()->create_module('lti', array(\n 'intro' => \"<p>This</p>\\nhas\\r\\n<p>some</p>\\nnew\\n\\rlines\",\n 'introformat' => FORMAT_HTML,\n 'course' => $course->id,\n ));\n\n $typeconfig = array(\n 'acceptgrades' => 1,\n 'forcessl' => 0,\n 'sendname' => 2,\n 'sendemailaddr' => 2,\n 'customparameters' => '',\n );\n\n $params = lti_build_request($instance, $typeconfig, $course, null);\n\n $ncount = substr_count($params['resource_link_description'], \"\\n\");\n $this->assertGreaterThan(0, $ncount);\n\n $rcount = substr_count($params['resource_link_description'], \"\\r\");\n $this->assertGreaterThan(0, $rcount);\n\n $this->assertEquals($ncount, $rcount, 'The number of \\n characters should be the same as the number of \\r characters');\n\n $rncount = substr_count($params['resource_link_description'], \"\\r\\n\");\n $this->assertGreaterThan(0, $rncount);\n\n $this->assertEquals($ncount, $rncount, 'All newline characters should be a combination of \\r\\n');\n }", "public function setDescription(string $desc) : bool {\n $trimmed = trim($desc);\n\n if (strlen($trimmed) > 0) {\n $this->taskDesc = $trimmed;\n\n return true;\n }\n\n return false;\n }", "public function testValidate()\n {\n $this->todo('stub');\n }", "public function testEditDescription()\n {\n // create review record for change 1\n $this->createChange();\n Review::createFromChange('1')->save();\n\n $postData = new Parameters(\n array('description' => \" I am a\\r\\nMultiline\\nDescription\\rThat's pretty cool\\r\\r\\neh\\r\\n \")\n );\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch\n $this->dispatch('/reviews/2');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n\n // check resulting change description\n $change = Change::fetch(2, $this->p4);\n $this->assertSame(\n \"I am a\\nMultiline\\nDescription\\nThat's pretty cool\\n\\neh\\n\",\n $change->getDescription()\n );\n }", "public function has_description(){\n\t\treturn 0 < strlen($this->_description);\n\t}", "public function hasDescription() {\n return $this->_has(4);\n }", "public function hasDescription() {\n return $this->_has(4);\n }", "public function testGetDescription(array $values) {\n $permission = new GroupPermission($values);\n $this->assertEquals($values['description'], $permission->getDescription());\n }", "public function hasDescription(){\n return $this->_has(1);\n }", "public function hasDescription()\n {\n return !empty($this->description);\n }", "public function description(?string $description): static;", "public function canSetDescription();", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function hasDescription() {\n return $this->_has(7);\n }", "public function description()\r\n {\r\n }", "public function testEditGitDescription()\n {\n // create fusion style change and make it a review\n $gitInfo = \"\\n\\nImported from Git\\n\"\n . \" Author: Bob Bobertson <bbobertson@perforce.com> 1381432565 -0700\\n\"\n . \" Committer: Git Fusion Machinery <nobody@example.com> 1381432572 +0000\\n\"\n . \" sha1: 6a96f259deb6d8567a4d85dce09ae2e707ca7286\\n\"\n . \" push-state: complete\\n\"\n . \" review-status: create\\n\"\n . \" review-id: 1\\n\"\n . \" review-repo: Talkhouse\\n\";\n $shelf = new Change;\n $shelf->setDescription(\"Test git review!\" . $gitInfo)->save();\n $review = GitReview::createFromChange($shelf);\n $review->save()->updateFromChange($shelf)->save();\n\n $postData = new Parameters(\n array('description' => \" I am a\\r\\nMultiline\\nDescription\\rThat's pretty cool\\r\\r\\neh\\r\\n\\n\\n \")\n );\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch\n $this->dispatch('/reviews/1');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n\n // check resulting change description\n $change = Change::fetch(1, $this->p4);\n $this->assertSame(\n \"I am a\\nMultiline\\nDescription\\nThat's pretty cool\\n\\neh\" . $gitInfo,\n $change->getDescription()\n );\n }", "public static function getDescription(): string\n {\n }", "public static function getDescription(): string\n {\n }", "public function setDescription($description) \n\t{\n \n $this->description = empty($description) ? \"\" : $description;\t\n\t}", "public function setDescription(/*string*/ $description);", "public static function description($description)\n {\n // Set page description\n self::$data['description'] = $description;\n }", "protected function assignDescription()\n {\n $this->description = 'This is a test for a Template Variable migration class';\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function getDescription()\n {\n \tthrow new Lib_Exception(\"Comments cannot be asked for their description\");\n }", "public function description();", "public function description();", "public function setDescription($description) {\n\t\t// if passed in description is not null and is either 0 chars or is greater than 16777215 characters (mysql mediumtext size), can be null but not empty\n\t\tif(($description !== null) && (strlen($description) == 0 || strlen($description) > 16777215)) {\n\t\t\tthrow new TaskException(\"Task description error\");\n\t\t}\n\t\t$this->_description = $description;\n\t}", "public function updateProject($title, $description){\n $this->update([\n 'title'=>$title,\n 'description'=>$description\n ]);\n }", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }", "function ui_description() {\n if (isset($this->plugin['ui_description'])) {\n return check_plain($this->plugin['ui_description']);\n }\n }", "function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function testSetGetDescription()\n {\n $description = 'Description';\n $event = (new Event())->setDescription($description);\n $this->assertEquals($description, $event->getDescription());\n }", "abstract function getdescription();", "public function setDescription(string $description): bool\n {\n try {\n $this->description = $this->valTextMandMaxCar(\n $description, 200, __METHOD__\n );\n $return = true;\n } catch (AuditFileException $e) {\n $this->description = $description;\n \\Logger::getLogger(\\get_class($this))\n ->error(\\sprintf(__METHOD__.\" '%s'\", $e->getMessage()));\n $this->getErrorRegistor()->addOnSetValue(\"ProductCode_not_valid\");\n $return = false;\n }\n \\Logger::getLogger(\\get_class($this))\n ->debug(\\sprintf(__METHOD__.\" set to '%s'\", $this->description));\n return $return;\n }", "abstract public function getDescription();", "abstract public function getDescription();", "protected function givenAProjectMock()\n {\n return m::mock('phpDocumentor\\Descriptor\\ProjectDescriptor')->shouldIgnoreMissing();\n }", "public function setDescription( $description )\r\n\t{\r\n\t\t$this->description = $description;\r\n\t}", "public abstract function getDescription();", "public function hasDescription(){\n return $this->_has(5);\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();" ]
[ "0.83257455", "0.6658854", "0.6538204", "0.64926475", "0.6483126", "0.6443382", "0.6401218", "0.6279939", "0.62030315", "0.6143676", "0.6071989", "0.60656685", "0.59975594", "0.5943932", "0.5922573", "0.592254", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5900232", "0.58841515", "0.58813095", "0.587948", "0.5867373", "0.5840735", "0.583622", "0.5819227", "0.5802756", "0.5802682", "0.57700616", "0.57700616", "0.57683766", "0.5751669", "0.5740904", "0.57233894", "0.5722307", "0.5716085", "0.57059336", "0.56798625", "0.5677157", "0.5668321", "0.5668112", "0.5668112", "0.5664304", "0.56627774", "0.5659027", "0.56541055", "0.564111", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.56398606", "0.56398606", "0.56398606", "0.5600837", "0.5585581", "0.55809003", "0.5578728", "0.5578728", "0.5575885", "0.5566942", "0.5566146", "0.55553085", "0.55486125", "0.55472463", "0.5545675", "0.5545675", "0.55452746", "0.5544177", "0.5532582", "0.5530173", "0.5513177", "0.5503676", "0.5485656", "0.5477208", "0.5467438", "0.5467438", "0.5462222", "0.5458704", "0.54568565", "0.54549414", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644" ]
0.8085601
1
Check if there is no user in system before run install
Проверьте, что в системе нет пользователей перед запуском установки
private function checkinstallrequirement() { $userCount = Core_User::getUsers(array(), '', '', '', true); if($userCount > 0) return false; else return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check_user_installed()\n {\n if ($this->uid == 0) {\n return true;\n }\n\n $exists = $this->STOR->get_folder_id_from_path('waste');\n if (empty($exists)) {\n $this->create_user();\n }\n }", "public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}", "function installCheck() {\n // Check if user table exists for check.\n $result = $this->db->exec('SELECT name FROM sqlite_master WHERE type=\"table\" AND name=\"users\"');\n if (empty($result)) {\n $this->installSetupForm();\n } else {\n echo 'The site has already been installed.';\n }\n }", "public function checkInstall()\n {\n if (($this->get('db') == '' || !file_exists($this->get('db'))) || $this->get('passwd') == '')\n {\n Misc::redirect('install.php');\n }\n }", "protected function checkInstallToolPasswordNotSet() {}", "public function hasInstall();", "public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}", "public function checkCLIuser() {}", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "protected function outputInstallToolNotEnabledMessageIfNeeded() {}", "protected function outputInstallToolNotEnabledMessageIfNeeded() {}", "protected static function isInstallToolSession() {}", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "function install_root_user() {\n $fields = array(\n 'username' => $site_config['adminUser'],\n 'password' => $site_config['adminPassword'],\n 'role' => DEFAULT_ADMIN_RID,\n 'email' => $site_config['adminEmail'],\n 'name' => $site_config['adminName'],\n 'language' => Session::get('lang'),\n 'active' => 1\n );\n $new_user = new User();\n if($new_user->create($fields)) {\n return true;\n }\n else {\n System::addMessage('error', rt('The site administrator could not be created. Please verify that your server meets the requirements for the application and that your database user has sufficient permissions ot make changes in the database'));\n }\n}", "function drush_sandwich_make_me_a_sandwich_validate() {\n if (drush_is_windows()) {\n // $name = drush_get_username();\n // TODO: implement check for elevated process using w32api\n // as sudo is not available for Windows\n // http://php.net/manual/en/book.w32api.php\n // http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d\n }\n else {\n $name = posix_getpwuid(posix_geteuid());\n if ($name['name'] !== 'root') {\n return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));\n }\n }\n}", "public function install()\n {\n // Install default\n if (!parent::install()) {\n return false;\n }\n\n if (!$this->registrationHook()) {\n return false;\n }\n\n if (!Configuration::updateValue('EPUL_USERNAME', '')\n || !Configuration::updateValue('EPUL_PASSWORD', '')\n ) {\n return false;\n }\n\n return true;\n }", "protected function install_mail_user() {\n $this->prompt_info(\"Creating user accounts\", false);\n if ($this->create_system_user($this->MAIL_USER, $this->MAIL_USER_GROUP, null, $this->MAIL_USER_UID)) {\n $this->prompt_done();\n return true;\n } else {\n $this->prompt_last_error();\n }\n }", "function AdminUsers_install()\n\t{\n\t}", "function noUser() {\n\t}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "public static function checkInstall() {\n\t\t\t// TODO: Something awesoem\n\t\t\tif(!file_exists(\"engine/values/mysql.values.php\")){\n\t\t\t\tLayoutManager::redirect(\"INSTALL.php\");\n\t\t\t} else if(file_exists(\"INSTALL.php\")){\n\t\t\t\tFileHandler::delete(\"INSTALL.php\");\n\t\t\t\techo \"<center><img src=\\\"images/warning.png\\\" height=14px border=0/> Please delete 'INSTALL.php'. It's unsafe to have this in the root directory.</center>\";\n\t\t\t} \n\t\t}", "protected function beforeInstall(): bool\n {\n return true;\n }", "public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}", "public static function installToolEnableFileExists() {}", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public function isSystemUser(): bool\n {\n return $this->system;\n }", "function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "protected function isInitialInstallationInProgress() {}", "public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function accountswitcher_is_installed()\n{\n\tglobal $db;\n\n\tif ($db->field_exists(\"as_uid\", \"users\") && $db->field_exists(\"as_canswitch\", \"usergroups\") && $db->field_exists(\"as_limit\", \"usergroups\"))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function isInstalled(){\n return true;\n }", "function psswrdhsh_is_installed()\n{\n\tglobal $db, $settings;\n\n\tif (isset($settings['psswrd_cost'])) {\n\t\treturn true;\n\t}\n\n\tif ($db->field_exists('passwordhash', 'users')) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function beforeInstall()\n\t{}", "protected function _initInstallChecker()\r\n\t{\r\n\t\t$config = Tomato_Core_Config::getConfig();\r\n\t\tif (null == $config->install || null == $config->install->date) {\r\n\t\t\theader('Location: install.php');\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "public function check_insta_user() {\n \n }", "function unsinstall()\n\t\t{\n\t\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "function havp_check_system() {\n\tglobal $havp_config;\n\n\t/* Check/create user/group accounts */\n\t$grp = exec('/usr/sbin/pw group show ' . HVDEF_GROUP);\n\tif (strpos($grp, HVDEF_GROUP) !== 0) {\n\t\texec('/usr/sbin/pw group add ' . HVDEF_GROUP);\n\t\tlog_error(\"Antivirus: Group '\" . HVDEF_GROUP . \"' was added.\");\n\t}\n\t$usr = exec('/usr/sbin/pw usershow -n ' . HVDEF_USER);\n\tif (strpos($usr, HVDEF_USER) !== 0) {\n\t\texec('/usr/sbin/pw useradd ' . HVDEF_USER . ' -g ' . HVDEF_GROUP . ' -h - -s \"/sbin/nologin\" -d \"/nonexistent\" -c \"havp daemon\"');\n\t\tlog_error(\"Antivirus: User '\" . HVDEF_USER . \"' was added.\");\n\t}\n\n\t/* Workdir permissions */\n\thavp_set_file_access(HVDEF_WORK_DIR, HVDEF_USER, '');\n\n\t/* HAVP tempdir */\n\tif (!file_exists(HVDEF_HAVPTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_HAVPTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_HAVPTEMP_DIR, HVDEF_USER, '');\n\n\t/* ClamAV dbdir */\n\tif (!file_exists(HVDEF_CLAM_DBDIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_CLAM_DBDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_DBDIR, HVDEF_AVUSER, '');\n\n\t/* RAM tempdir */\n\tif (!file_exists(HVDEF_RAMTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_RAMTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_RAMTEMP_DIR, HVDEF_USER, '');\n\n\t/* Template directory and permissions */\n\tif (!file_exists(HVDEF_TEMPLATES_EX)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_TEMPLATES_EX);\n\t}\n\thavp_set_file_access(HVDEF_TEMPLATES, HVDEF_USER, '');\n\thavp_set_file_access(HVDEF_TEMPLATES_EX, HVDEF_USER, '');\n\n\t/* HAVP log dir */\n\tif (!file_exists(HVDEF_LOG_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_LOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '');\n\t/* Create log files if needed */\n\tif (!file_exists(HVDEF_HAVP_ACCESSLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ACCESSLOG, '');\n\t}\n\tif (!file_exists(HVDEF_HAVP_ERRORLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ERRORLOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '0764');\n\n\t/* PID file */\n\tif (!file_exists(HVDEF_PID_FILE)) {\n\t\tfile_put_contents(HVDEF_PID_FILE, '');\n\t}\n\thavp_set_file_access(HVDEF_PID_FILE, HVDEF_USER, '0664');\n\n\t/* freshclam config permissions */\n\tif (!file_exists(HVDEF_FRESHCLAM_CONF)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_CONF, '');\n\t}\n\thavp_set_file_access(HVDEF_FRESHCLAM_CONF, HVDEF_AVUSER, '0664');\n\n\t/* AV log dir */\n\tif (!file_exists(HVDEF_AVLOG_DIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_AVLOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '');\n\n\t/* Create AV log files if needed */\n\tif (!file_exists(HVDEF_CLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_CLAM_LOG, '');\n\t}\n\tif (!file_exists(HVDEF_FRESHCLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_LOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '0777');\n\n\t/* ClamAV */\n\t/* Directory for pid and socket files */\n\tif (!file_exists(HVDEF_CLAM_RUNDIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_CLAM_RUNDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_RUNDIR, HVDEF_USER, '0774');\n\n\t/* AV update script */\n\tfile_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());\n\thavp_set_file_access(HVDEF_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* AV update notification script */\n\t// file_put_contents(HVDEF_ON_AVUPD_SCRIPT, havp_on_avupd_script());\n\t// havp_set_file_access(HVDEF_ON_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* Startup scripts (HAVP and clamd) */\n\thavp_startup_script();\n\thv_clamd_startup_script();\n\n\t/* mount RAMDisk */\n\tmountRAMdisk(true);\n}", "function is_installed()\n{\n return has_account() && has_meta();\n}", "public function testInstaller() {\n $this->assertUrl('user/1');\n $this->assertResponse(200);\n // Confirm that we are logged-in after installation.\n $this->assertText($this->rootUser->getUsername());\n\n // @todo hmmm this message is wrong!\n // Verify that the confirmation message appears.\n require_once \\Drupal::root() . '/core/includes/install.inc';\n $this->assertRaw(t('Congratulations, you installed @drupal!', [\n '@drupal' => drupal_install_profile_distribution_name(),\n ]));\n }", "private function checkInstall($install)\n {\n if (F::has('password'))\n {\n if (!$install && empty(F::get('password')))\n {\n F::redirect('/install');\n }\n elseif ($install && !empty(F::get('password')))\n {\n F::redirect('/login');\n }\n }\n }", "function install()\n {\n $query = parent::getList( 'user_name = \\'admin@test.com\\'' );\n \n if( $query->num_rows() == 0 )\n {\n $data = array(\n 'user_name' => 'admin@test.com',\n 'password' => sha1('rkauqkf.'),\n 'role' => 'admin',\n 'is_active' => '1',\n 'd_o_c'=>date(\"Y/m/d\"),\n );\n \n parent::add($data);\n }\n }", "public function isSystem()\n {\n return $this->getAttribute('id') == self::SYSTEM_USER_ID;\n }", "function __checkInstall() {\n\t\t$base = strpos($_SERVER['REQUEST_URI'], Dispatcher::getUrl());\n\t\t$base = substr($_SERVER['REQUEST_URI'], 0, $base);\n\t\tif (!file_exists(APP . 'config/INSTALLED') && !in_array(Dispatcher::getUrl($_SERVER['REQUEST_URI']), array('install', 'install/configure'))) {\n\t\t\theader('Location: '.$base.'install');exit;\n\t\t}\n\t}", "public function preInstall()\n {\n }", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "protected function install(){ return true;}", "function check_fresh_install_sc($params) {\n\tif (empty($_SERVER['PEPPER'])) {\n\t\tset_variable('fresh_install', 'yes');\n\t} else {\n\t\tset_variable('fresh_install', 'no');\n\t}\n}", "protected function getExtraInstallment()\n {\n return false;\n }", "public function requireInstallation() {\n return is_object($this->installer);\n }", "public function is_installed() {\n\n }", "public function install(): bool;", "public function install()\n\t{\n\t\treturn true;\n\t}", "public function beforeStartingDeploy()\n {\n $remoteDeployDir = $this->getConfig(Option::deployDir);\n $this->runRemote(sprintf('sudo chown -R '.getenv('CI_TARGET_USER').':'.getenv('CI_TARGET_USER').' '.$remoteDeployDir.' 2&1>/dev/null'));\n }", "function wp_install_defaults($user_id)\n {\n }", "public function install(){\n\n return true;\n\n }", "function system_is_uname_registerd($uname)\n{\n\treturn(0);\n}", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "function wp_installing($is_installing = \\null)\n {\n }", "protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}", "public function hasUninstall();", "protected function isFirstTimeSetup() {\n // If there are any auth providers, this isn't first time setup, even if\n // we don't have accounts.\n if (PhabricatorAuthProvider::getAllEnabledProviders()) {\n return false;\n }\n\n // Otherwise, check if there are any user accounts. If not, we're in first\n // time setup.\n $any_users = id(new PhabricatorPeopleQuery())\n ->setViewer(PhabricatorUser::getOmnipotentUser())\n ->setLimit(1)\n ->execute();\n\n return !$any_users;\n }", "public function isSystemCall() {\n\t\treturn !( $this->user instanceof User );\n\t}", "function check_capabilities() {\n\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t\t// TODO: Error message\n\t\t}\n\n\t}", "public function createUserFromRemote() {\n\t\treturn false;\n\t}", "public function isInstalled(){\n if(self::$isInstalled === true){\n return true; \n }\n \n exec('type diatheke', $output, $returnVal);\n if($returnVal === 0){\n self::$isInstalled = true;\n return true;\n }else{\n return false;\n }\n \n }", "function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM users WHERE id='\". $this->id .\"'\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested user (\". $this->id .\") does not exist - possibly the user has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\n\t\treturn 1;\n\t}", "public static function is_needed() {\n\t\treturn is_admin() || wp_doing_cron();\n\t}", "protected function beforeUninstall(): bool\n {\n return true;\n }", "function getUser() {\r\n\t\treturn false;\r\n\t}", "public static function isInstallToolEnableFilePermanent() {}", "public function install()\n {\n // initialisation successful\n return true;\n }", "public function missing_user_errors()\n {\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(1);\n }", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }", "public function checkInstalled() {\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('requests')));\n $request_table_result = $query->rowCount();\n\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('users')));\n $user_table_result = $query->rowCount();\n\n if ($request_table_result > 0 || $user_table_result > 0) {\n return true;\n } else {\n return false;\n }\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "public function isAlreadyInstalled() {\n\t\t// is not a unique package and can be\n\t\t// installed as many times as you want\n\t\tif ($this->packageInfo['isUnique'] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t// this package may only be installed\n\t\t// once (e. g. library package)\n\t\telse {\n\t\t\treturn (count($this->getDuplicates()) != 0);\n\t\t}\n\t}", "private function is_automatic_install( &$dependency ) {\n\t\t$is_required = $this->is_required( $dependency );\n\t\treturn ! $is_required || ( $is_required && ! self::$automatic_install_required );\n\t}", "private function isInstalled()\n\t{\n\t\tif(file_exists(ITEMDATA) && file_exists(IM_DATABASE_DIR.IM_DATABASE)){return true;}\n\t\telse return false;\n\t}", "function exportUserCount()\n {\n //pretend there are 0 users on the local install that were not found on the bridge.\n return 0;\n }", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "public static function checkInstallToolEnableFile() {}", "protected function checkOperationality()\n {\n if (!function_exists('exec')) {\n throw new SystemRequirementsNotMetException('exec() is not enabled.');\n }\n }", "function isGuestLoginAvailable()\n{\n\treturn false;\n}", "function wp_not_installed()\n {\n }", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }", "function cj_authorship_check()\n{\n if (get_site_option(CJ_AUTHORSHIP_VERSION_OPTION) != \\CJ_Authorship\\CJ_Authorship_Handler::VERSION) {\n cj_authorship_install();\n }\n}", "private function notExist() : void\n {\n if(!$this->user)\n {\n (new Session())->set('user','error','Désolé une erreur est survenue');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "function isPartOfMinimalUsableSystem() ;", "function ensure_portal() {\n\t\treturn $this->portal_login($_SESSION['user_name'], $_SESSION['user_hash']);\n\t}", "public function _userntexists($input) {\n\n\t\t$prepare \t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ?\");\n\t\t$prepare->execute(array(r::post($input)));\n\t\t$result \t= $prepare->fetch();\n\n\t\tif(empty($result)) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function install()\n {\n if (!parent::install()\n || !$this->registerHook('displayBackOfficeHeader')\n || !$this->installModuleTab('onehopsmsservice', array(\n 1 => 'Onehop SMS Services'\n ), 0)\n || !$this->installDB()\n || !$this->registerHook('orderConfirmation')\n || !$this->registerHook('postUpdateOrderStatus')\n || !$this->registerHook('actionUpdateQuantity')\n || !$this->registerHook('actionObjectProductUpdateAfter')) {\n return false;\n }\n return true;\n }", "function install_roles() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/roles.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the creation of the default user roles'));\n }\n return false;\n}", "function crepInstallation() {\r\n\t// Check to see if it has already been installed\r\n\tif(get_option('crep-installed') != '1') {\r\n\t\tcrepInsertDefaultOptions();\r\n\t}\r\n}", "public function effectively_installed()\n {\n return isset($this->config['oxcom_phpbbch_format_only']);\n }", "public static function isInstalled (\n\t)\t\t\t// <bool> TRUE if successfully installed, FALSE if not.\n\t\n\t// $plugin->isInstalled();\n\t{\n\t\t// Make sure the newly installed tables exist\n\t\t$pass1 = DatabaseAdmin::columnsExist(\"users\", array(\"uni_id\", \"email\", \"password\", \"referred_by\"));\n\t\t$pass2 = DatabaseAdmin::columnsExist(\"invitation_codes\", array(\"uni_id\", \"invite_code\"));\n\t\t\n\t\treturn ($pass1 and $pass2);\n\t}" ]
[ "0.7581932", "0.715836", "0.7073247", "0.6882467", "0.6655213", "0.66145295", "0.64996564", "0.6467071", "0.6458869", "0.6385002", "0.63844544", "0.6367339", "0.63509744", "0.6332938", "0.6308024", "0.6225235", "0.62100196", "0.6204143", "0.6195796", "0.61802447", "0.61358196", "0.6118471", "0.6116351", "0.6080407", "0.60665", "0.60573834", "0.6051998", "0.6040345", "0.6011086", "0.60069716", "0.60008633", "0.59964114", "0.5989849", "0.5937066", "0.5888508", "0.58857346", "0.5854934", "0.5851408", "0.58461624", "0.5832985", "0.5803581", "0.5757004", "0.5755894", "0.574198", "0.5739816", "0.57330936", "0.5725618", "0.5724474", "0.56883436", "0.56838506", "0.56816596", "0.5671398", "0.56448126", "0.56268823", "0.56103754", "0.55994225", "0.55966467", "0.5592797", "0.55759674", "0.55755055", "0.5566759", "0.55576855", "0.5548991", "0.55476546", "0.553917", "0.55356205", "0.55355465", "0.5530819", "0.5528008", "0.5511645", "0.550986", "0.54832214", "0.54829174", "0.5468136", "0.5463711", "0.5459666", "0.54499805", "0.5447732", "0.5443696", "0.5441848", "0.5432941", "0.54325604", "0.5431985", "0.5423278", "0.5421081", "0.54097927", "0.54071945", "0.539652", "0.5395811", "0.53899604", "0.53892237", "0.5384811", "0.53792566", "0.53615403", "0.5361384", "0.53459334", "0.5343074", "0.533989", "0.5336514", "0.5330926" ]
0.76897407
0
Returns the default area.
Возвращает область по умолчанию.
public function getDefault(): AreaContract;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArea(){}", "abstract protected function getArea();", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getMinArea();", "public function getCurrentArea(): AreaContract;", "public function getCoreArea()\n {\n return $this->coreArea;\n }", "public function getArea(): ?string\n {\n return $this->Area ?? null;\n }", "public function getMapArea()\n {\n return $this->mapArea;\n }", "public function getMaxArea();", "public function getUserDefaultAreaOfApplication()\n {\n $user = $this->getUser();\n\n return \\is_array($user->newsAreaOfApplication_default) ? $user->newsAreaOfApplication_default : [];\n }", "function amap_ma_get_map_default_location() {\n $defaultlocation = trim(elgg_get_plugin_setting('map_default_location', AMAP_MA_PLUGIN_ID));\n\n return $defaultlocation;\n}", "public function getAreaId()\n {\n return $this->area;\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public function getDefaultRegion() : ?string;", "public function getAreaRegion()\n {\n return $this->area_region;\n }", "function getArea(){\r\n return ($this->width * $this->height);\r\n }", "public function area()\n {\n return $this->height * $this->width;\n }", "public function getArea()\n {\n return 1 / 2 * $this->side1 * $this->getHeight();\n }", "public function getAreaID() {\n return $this->get(self::AREAID);\n }", "public function getConfineArea() {\n return $this->_confine; \n }", "public function getAreaId()\n {\n return $this->areaId;\n }", "public function getAreaName()\n {\n return $this->area_name;\n }", "public function getAreaDeep()\n {\n return $this->area_deep;\n }", "public function getArea(){\n return $this -> side * $this -> side;\n }", "public function getBaseArea() {\n return parent::getRadius() * parent::getRadius() * pi();\n }", "public function getAreaCdArea()\n {\n return $this->area_cd_area;\n }", "public function getViewArea() {}", "function area() { return ($this->max->x() - $this->min->x()) * ($this->max->y() - $this->min->y()); }", "public function getCurrentSiteDefaultLayout()\n {\n $siteInfo = $this->getCurrentSiteInfo();\n\n return $siteInfo['siteLayout'];\n }", "public function getPrintArea() {}", "public function getCentroArea() {\n return $this->_centro; \n }", "function amap_ma_get_map_default_layer() {\n $l_option = trim(elgg_get_plugin_setting('default_layer', AMAP_MA_PLUGIN_ID));\n if (!$l_option)\n $l_option = 'roadmap';\n\n return $l_option;\n}", "public function getSource()\n {\n return 'area';\n }", "public function getNomeMappaArea() {\n return $this->_nomeMappa; \n }", "public function getIdArea() {\n return $this->_id; \n }", "public function getAdministrativeArea(): ?string;", "public function getAreaShortName()\n {\n return $this->area_short_name;\n }", "function GetDefaultLocation()\r\n{\r\n $locations = parse_ini_file('./settings/locations.ini', true);\r\n BuildLocations($locations);\r\n \r\n $def = $locations['locations']['default'];\r\n if( !$def )\r\n $def = $locations['locations']['1'];\r\n $loc = $locations[$def]['default'];\r\n if( !$loc )\r\n $loc = $locations[$def]['1'];\r\n \r\n return $locations[$loc];\r\n}", "public function get_default(){\n\t\treturn $this->default;\n\t}", "public function getArea() {\r\n return $this -> lato * $this -> lato ;\r\n }", "public function getDefaultLayoutRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultLayoutRootPath);\r\n }", "public function getCenterOfArea() {\r\n\t\t/* PROTECTED REGION ID(php.implementation._14_0_b6f02e1_1211871307421_631477_281__16_0_b6f02e1_1249464477484_822826_834) ENABLED START */\r\n\t\treturn new Form_Point($this->_center->x, $this->_center->y);\r\n\t\t/* PROTECTED REGION END */\r\n\t}", "public function areaName()\n {\n return $this->name[array_rand($this->name)];\n }", "function amap_ma_get_map_default_location_lon() {\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lng))\n return $map_default_lng;\n\n return 0;\n}", "public function ElementalAreaIfExists()\n {\n if ($this->owner->hasExtension(ElementalPageExtension::class)) {\n return $this->owner->ElementalArea();\n }\n return ElementalArea::create();\n }", "function get_duo_areas() {\n \t\n }", "public function get_default_blocks() {\n return array(\n BLOCK_POS_LEFT => array(),\n BLOCK_POS_RIGHT => array()\n );\n }", "public function getAreaIdInfo()\n {\n return $this->community_area;\n }", "public function getTagName ()\n\t{\n\t\treturn 'area';\n\t}", "private function getCalculatedAreaModel(): \\model\\RectangleArea\r\n {\r\n return $this->area->getAreaModel();\r\n }", "function amap_ma_get_map_default_location_coords() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (empty($map_default_lat) || empty($map_default_lat))\n return AMAP_MA_CUSTOM_DEFAULT_COORDS; // set coords of Europe in case default location is not set\n else\n return $map_default_lat . ',' . $map_default_lng;\n}", "public function getDefaultZone() : ?string;", "public static function getDefaultLayoutConfiguration() {\r\n\t\treturn array (\r\n\t\t\t'layoutKey' => null,\r\n\t\t\t'layoutCss' => null,\r\n\t\t\t'columns' => 2,\r\n\t\t\t'containerMeasure' => '%',\r\n\t\t\t'containerWidth' => 100,\r\n\t\t\t'columnMeasure' => '%',\r\n\t\t\t'columnWidth' => null,\r\n\t\t\t'columnMargin' => null,\r\n\t\t\t'columnPadding' => null,\r\n\t\t\t'disableImageShrink' => null,\r\n\t\t\t'disableStyles' => null\r\n\t\t);\r\n\t}", "public function getRischioArea() {\n return $this->_rischio; \n }", "public static function getDefault()\n {\n return self::$default;\n }", "function time4vps_ClientAreaDefault($details)\n{\n return [\n 'tabOverviewReplacementTemplate' => 'templates/clientarea/clientarea.tpl',\n 'templateVariables' => [\n 'details' => $details\n ]\n ];\n}", "public function getDefault();", "public static function getDefault()\r\n {\r\n return self::get('default');\r\n }", "public static function AreaAssignDefaultValue($areaDetail)\n {\n $areaDetail['areaName'] = isset($areaDetail['areaName']) ? $areaDetail['areaName'] : \"\";\n $areaDetail['cityId'] = isset($areaDetail['cityId']) ? $areaDetail['cityId'] : '0';\n $areaDetail['pinCode'] = isset($areaDetail['pinCode']) ? $areaDetail['pinCode'] : \"\";\n $areaDetail['userId'] = UserCommon::getLoogedInUserId();\n return $areaDetail;\n }", "function getDefault()\n {\n return $this->_defValue;\n }", "public function getDefaultWidth() {}", "public function getDefault()\n {\n return $this->default;\n }", "public function getDefault()\n\t\t{\n\t\t\treturn $this->default;\n\t\t}", "function initDefaults()\n\t{\n\t\tglobal $ninespot_admin;\n\t\n\t\t$ninespot_admin->addNewLayout( 'nines-layout-default',\n\t\t\tarray(\n\t\t\t\t'spots' => array(\n\t\t\t\t\t'head' => array(\n\t\t\t\t\t\t1 => 8,\n\t\t\t\t\t\t2 => 8,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'nav' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'avant-body' => array(\n\t\t\t\t\t\t1 => 0,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'body' => array(\n\t\t\t\t\t\t1 => 4,\n\t\t\t\t\t\t2 => 8,\n\t\t\t\t\t\t3 => 4,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'apres-body' => array(\n\t\t\t\t\t\t1 => 0,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'foot' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'apres-foot' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'widgets' => array(\n\t\t\t\t\t'head' => array(\n\t\t\t\t\t\t'text' => array( 'title' => 'This is a text widget' , 'text' => 'Edit me in the dashboard' ),\n\t\t\t\t\t),\n\t\t\t\t\t'body-1' => array(\n\t\t\t\t\t\t'pages' => array( 'expandtree' => 1 , 'homelink' => 'Home' ),\n\t\t\t\t\t),\n\t\t\t\t\t'body-2' => array(\n\t\t\t\t\t\t'breadcrumbs' => array( 'homelink' => get_option('name') , 'maxchars' => 35 ),\n\t\t\t\t\t\t'categorydescription' => array( 'title' => '%term_name% Archives' ),\n\t\t\t\t\t\t'pagednav' => array(),\n\t\t\t\t\t\t'postloop' => array( 'title' => 'Primary Post Loop', 'what' => 'normal', 'template' => 'a_default_full.php', ),\n\t\t\t\t\t\t'pagednav' => array(),\n\t\t\t\t\t),\n\t\t\t\t\t'body-3' => array(\n\t\t\t\t\t\t'postloop' => array( 'title' => 'Around the site', 'title_show' => 1, 'what' => 'post', 'age_bool' => 'newer' , 'age_num' => 2 , 'age_unit' => 'year' , 'count' => 3 , 'order' => 'rand', 'template' => 'c_default_tiny.php', ),\n\t\t\t\t\t\t'text' => array( 'title' => 'Above this is a post loop widget' , 'text' => 'Use multiple post loop widgets to feature stories anywhere on the page. This widget shows stories published in the past year, but you can select stories by category, tag, or other criteria.' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "function default_location() {\n\n return array(\n array(\n 'param' => 'post_type',\n 'operator' => '==',\n 'value' => 'post',\n )\n );\n }", "public static function getDefaultLayoutPath(): string\n {\n return Path::packageCurrent(['resources/layouts']);\n }", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function getDefault()\n {\n return $this->config['config']['default'] ?? null;\n }", "public function getDefaultWorkspace() {}", "protected function get_default() {\n\t\treturn array(\n\t\t\t'ownerID' => 0,\n\t\t\t'accountID' => '',\n\t\t\t'adsenseLinked' => false,\n\t\t\t'adsConversionID' => '',\n\t\t\t'anonymizeIP' => true,\n\t\t\t'internalWebPropertyID' => '',\n\t\t\t'profileID' => '',\n\t\t\t'propertyID' => '',\n\t\t\t'trackingDisabled' => array( 'loggedinUsers' ),\n\t\t\t'useSnippet' => true,\n\t\t\t'canUseSnippet' => true,\n\t\t\t'dashboardView' => Analytics::DASHBOARD_VIEW,\n\t\t);\n\t}", "public function getStartCollegamentiArea() {\n return $this->_startCollegamenti; \n }", "public function getAreaParentId()\n {\n return $this->area_parent_id;\n }", "public function getArea()\n{\n return 2* 3.14*$this->radius*($this->radius + $this->height);\n}", "public function getAreaFilter()\n {\n return isset($this->area_filter) ? $this->area_filter : null;\n }", "protected function get_default() {\n\t\treturn array( 'ownerID' => 0 );\n\t}", "public function getDefaultLevelRoot()\n {\n return 0;\n }", "public function getDefaultUse() {\n if (isset($this->getRoot()->use)) {\n return $this->getRoot()->use;\n } else return '*';\n }", "public function get_default_category() {\n return $this->defaultcategory;\n }", "public function get_default_blocks() {\n\n return array(\n\n BLOCK_POS_LEFT => array(),\n\n BLOCK_POS_RIGHT => array('search_forums', 'news_items', 'calendar_upcoming', 'recent_activity')\n\n );\n\n }", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "public function defaultTimezone()\n\t{\n\t\treturn $this->get('dxgeolocations')->getTimezone();\n\t}", "function grandeArea($a,$b,$c){\r\n\t\t$fGArea= new fachada_grandeArea();\r\n\t\t$oGArea=$fGArea->grandeArea($a,$b,$c);\r\n\t\treturn $oGArea;\r\n\t}", "function amap_ma_get_osm_base_layer() {\n $osm_base_layer = trim(elgg_get_plugin_setting('osm_base', AMAP_MA_PLUGIN_ID));\n if (!$osm_base_layer) {\n $osm_base_layer = AMAP_MA_DEFAULT_OSM_LAYER;\n }\n\n return $osm_base_layer;\n}", "public function getLayoutZone()\n {\n return $this->layoutZone;\n }", "public function getNomeArea() {\n return $this->_nome; \n }", "public function getDefault()\n {\n return $this->getOption('default');\n }", "public function get_default_blocks() {\n return array(\n BLOCK_POS_LEFT => array(),\n BLOCK_POS_RIGHT => array('search_forums', 'news_items', 'calendar_upcoming', 'recent_activity')\n );\n }", "public function getDefaultView ()\n\t{\n\t\treturn View::NONE;\n\t}", "function getDefaultRootFolder() {\n\t\treturn\tarray(\n\t\t\t\t\t\t1,\t\t\t\t\t\t\t// folderID\t\t\t\t\t\t[0]\n\t\t\t\t\t\t'root',\t\t\t\t\t// in folder (#id)\t\t\t[1]\n\t\t\t\t\t\t'',\t\t\t\t\t\t// folder name\t\t\t\t\t[2]\n\t\t\t\t\t\t'',\t\t\t\t\t\t// introtext\t\t\t\t\t[3]\n\t\t\t\t\t\t$this->installdate,\t// timestamp (publish off)\t[4]\n\t\t\t\t\t\t1,\t\t\t\t\t\t\t// folder position\t\t\t[5]\n\t\t\t\t\t\t0,\t\t\t\t\t\t\t// imageID for folder icon\t[6]\n\t\t\t\t\t\t6,\t\t\t\t\t\t\t// folder sort mode\t\t\t[7]\n\t\t\t\t\t\t'',\t\t\t\t\t\t// password\t\t\t\t\t\t[8]\n\t\t\t\t\t\t0,\t\t\t\t\t\t\t// number of cols\t\t\t\t[9]\n\t\t\t\t\t\t0,\t\t\t\t\t\t\t// number of rows\t\t\t\t[10]\n\t\t\t\t\t\t0\t\t\t\t\t\t\t// folder type\t\t\t\t\t[11]\n\t\t\t\t\t);\n\t}", "public function defaults()\n {\n $defaults = $this->config;\n if (!isset($defaults['width'])) {\n $defaults['width'] = $defaults['default_width'];\n }\n if (!isset($defaults['height'])) {\n $defaults['height'] = $defaults['default_height'];\n }\n return $defaults;\n }", "public static function ADMIN_AREA_GET_AREA_TABLE(){\n\t $SQL_String = \"DESCRIBE area_main;\";\n\t return $SQL_String;\n\t}", "protected function getLayout($default = null)\n\t{\n\t\tif ($default)\n\t\t\treturn 'reservation';\n\n\t\t$jinput = JFactory::getApplication()->input;\n\n\t\treturn $jinput->get('layout', 'reservation', 'CMD');\n\t}", "public function getDefaultView ()\n {\n\t\treturn View::NONE;\n }", "public function getDefaultLongitude(): string|null;", "public function areaColor()\n {\n return $this->color[array_rand($this->color)];\n }", "public function get_root_location()\n {\n return $this->m_mptt->get_by_node_id(C__OBJ__ROOT_LOCATION);\n }", "public function getLayout()\n {\n return 'layouts/layout-full-width.tpl';\n }", "function medigroup_mikado_get_side_area() {\n\n\t\tif(is_active_widget(false, false, 'mkd_side_area_opener')) {\n\n\t\t\t$parameters = array(\n\t\t\t\t'show_side_area_title' => medigroup_mikado_options()->getOptionValue('side_area_title') !== '' ? true : false,\n\t\t\t\t//Dont show title if empty\n\t\t\t);\n\n\t\t\tmedigroup_mikado_get_module_template_part('templates/sidearea', 'sidearea', '', $parameters);\n\n\t\t}\n\n\t}" ]
[ "0.71531254", "0.703821", "0.70051736", "0.70051736", "0.70051736", "0.6843785", "0.6804903", "0.6653907", "0.6632202", "0.6630729", "0.6630361", "0.6607033", "0.6565798", "0.65325135", "0.64702046", "0.64623237", "0.63978213", "0.6356822", "0.6306662", "0.6298281", "0.6276246", "0.627603", "0.62747276", "0.62616265", "0.62125564", "0.6194754", "0.61932266", "0.61362904", "0.60943025", "0.606851", "0.60308737", "0.60208607", "0.59841204", "0.59762263", "0.5956734", "0.59417343", "0.59238756", "0.5920559", "0.5900763", "0.5869047", "0.5844194", "0.5837185", "0.58330965", "0.5822945", "0.5814629", "0.5806623", "0.5794984", "0.57839894", "0.574348", "0.5729591", "0.571956", "0.57148707", "0.5714007", "0.57125145", "0.5704354", "0.5683167", "0.5681797", "0.5670119", "0.56600636", "0.56374145", "0.56203806", "0.5617741", "0.5616348", "0.5612909", "0.561084", "0.5598609", "0.5597847", "0.5563409", "0.5562593", "0.5558831", "0.5550858", "0.55359155", "0.5531149", "0.5526093", "0.5524402", "0.5508748", "0.5505592", "0.5505358", "0.5505273", "0.5492756", "0.54893357", "0.54842633", "0.547396", "0.54622746", "0.5461411", "0.54579204", "0.54575104", "0.5455256", "0.5450113", "0.5442343", "0.54418653", "0.5441772", "0.54302865", "0.5429421", "0.54245144", "0.542373", "0.5422298", "0.5421313", "0.5417707", "0.54165757" ]
0.778171
0
Checks if the route has area.
Проверяет, имеет ли маршрут область.
public function hasAreaInUri(): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}", "public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function hasRoute(): bool;", "public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }", "public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }", "public function hasRoute(): bool\n {\n return isset($this->route);\n }", "protected function isAdminArea(RouteMatched $event)\n {\n if ($action = $event->route->getAction()) {\n return config('administrator.prefix') === Arr::get($action, 'prefix');\n }\n\n return false;\n }", "public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}", "public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function isValidRoute($route) {\n \n return $route == 'campus' ||\n $route == 'extended' ||\n $route == 'nathanBisk' ||\n $route == 'downtown';\n}", "private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }", "public static function isValidArea($area)\n {\n $areas = self::getAreas();\n return array_search($area, array_column($areas, 'area')) !== FALSE;\n }", "public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }", "public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }", "function userIsAreaAdmin() {\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->areaAdmin(Yawp::authUsername(), $this->area);\n\t}", "public function isBackendArea(): bool;", "public function isFrontendArea(): bool;", "public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\n }", "function is_outlet()\n {\n return $this->testFlag('Outlet');\n }", "public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }", "public static function isAllowed( string $route ): ?bool {\n\n\t\t$a = null;\n\n\t\tforeach( main_nodes as $k => $v ) {\n\n\t\t\tif( $v['route'] === $route ) {\n\n\t\t\t\t$a = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $a;\n\n\t}", "function getArea(){}", "public function testOutsideAnyArea()\n {\n $lat = '37.70772645289051';\n $long = '-124.74426269531249';\n \n // When I query\n $response = $this->call('GET', \"/gatekeeper/here/$lat/$long\");\n $json = json_decode($response->getContent());\n \n // Then I get ok,\n $this->assertResponseStatus(200);\n \n // And I am not marked as being in any zone,\n $this->assertEquals($json->isInAnyZone, false);\n \n // And I have no service\n $this->assertEquals($json->hasService, false);\n $this->assertEquals($json->AvailableServices, new \\stdClass() );\n }", "public function hasRegion() : bool;", "abstract protected function getArea();", "public function hasLocations()\n {\n return !empty($this->locations);\n }", "private function isClosureRoute($route)\n {\n return !isset($route['action']['uses']);\n }", "protected function isActiveByRoutesParts()\r\n {\r\n if (!$this->routes_parts) return false;\r\n\r\n $route_name = request()->route()->getName();\r\n\r\n foreach ($this->routes_parts as $group) {\r\n\r\n if (strpos($route_name, $group) !== false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public function isAssignedAreaSingleAssignmentMethod()\n {\n return ($this->getSingleAssignmentMethodCode() == 'assigned_area') ? true : false;\n }", "public function hasRoute(string $name): bool;", "public function isRouteDefined($routeKey)\n {\n return (isset($this->routes[$routeKey]) || ! empty($this->routes[$routeKey]));\n }", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function testInAreaOutsideZone()\n {\n $lat = '37.689254214025276';\n $long = '-122.33413696289064';\n \n // When I query\n $response = $this->call('GET', \"/gatekeeper/here/$lat/$long\");\n $json = json_decode($response->getContent());\n \n // Then I get ok,\n $this->assertResponseStatus(200);\n \n // And I am not marked as being in any zone,\n $this->assertEquals($json->isInAnyZone, false);\n \n // And I have no service\n $this->assertEquals($json->hasService, false);\n $this->assertEquals($json->AvailableServices, new \\stdClass() );\n }", "public function present(): bool\n {\n return ! is_null($this->route);\n }", "public function hasRegion()\n {\n return $this->region !== null;\n }", "function is_route(string $route): bool\n {\n return Route::currentRouteName() == $route;\n }", "private function hasRouteParameters($route) {\n\n if (preg_match(\"/\\/:/\", $route)) {\n return true;\n }\n\n return false;\n }", "public function isValid()\n {\n return $this->hasAddress() || $this->hasCoordinate();\n }", "public static function isActiveRoute()\n {\n return \\Route::currentRouteName() === static::routeName();\n }", "public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function isAdminRoute();", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "protected function isActiveByRoutes()\r\n {\r\n if (!$this->routes_activate) return false;\r\n\r\n $route_name = request()->route()->getName();\r\n\r\n return in_array($route_name, $this->routes_activate);\r\n }", "public function isActiveRoute();", "public function getCurrentArea(): AreaContract;", "public function hasLayout() {}", "public function isRoomEvent()\n {\n return $this->baseEvent->isRoomEvent();\n }", "public function hasRoute($name) {\n\t\treturn isset ( $this->_routes [$name] );\n\t}", "public function hasAccess($route)\n {\n $userId = Yii::app()->user->id;\n $am = Yii::app()->accessManager;\n\n //No controller ID specified. Use current controller ID.\n if(!strpos($route, '/'))\n {\n return $am->hasAccess($userId, $this->id, $route);\n }\n else\n {\n $r = explode('/', $route);\n return $am->hasAccess($userId, $r[0], $r[1]);\n }\n }", "function testGetArea() {\r\n\t\t// Need a Rectangle:\r\n\t\t$r = new Rectangle(8,9);\r\n\r\n\t\t// The assertion tests the math:\r\n\t\t$this->assertEquals(72, $r->getArea());\r\n\t}", "function taxonomies_is_active_route(string $route = '', array $params = []): bool\n {\n if (is_array($params) && count($params) > 0) {\n $route = route($route, $params, false);\n $path = '/'. request()->decodedPath();\n\n return $route === $path;\n }\n\n if (request()->routeIs($route))\n return true;\n\n if (! $currentRoute = app()->router->currentRouteName())\n return false;\n\n if (! is_array($route))\n $route = [$route];\n\n if (in_array($currentRoute, $route))\n return true;\n\n return false;\n }", "public function matchesRequest()\n {\n return $this->event->get('AccountSid') && !(is_null($this->event->get('Latitude')) || is_null($this->event->get('Longitude')));\n }", "function isAdminRoute() {\n return request()->route()->middleware()[0] === 'admin';\n }", "function biagiotti_mikado_is_header_widget_area_active( $area ) {\n\t\t\n\t\tif ( empty( $area ) || ! in_array( $area, array( 'one', 'two' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_' . $area . '_meta', true );\n\t\t$is_active = false;\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-' . $area ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $is_active;\n\t}", "public function getMapArea()\n {\n return $this->mapArea;\n }", "public function isRoutesEnabled() {\n return $this->frontEndRouteEnabled;\n }", "public function hasRoute(string $name): bool\n {\n return \\array_key_exists($name, $this->routes);\n }", "public function hasRouteAccess($route)\n\t{\n\t\treturn Auth::hasRouteAccess($route, $this);\n\t}", "public function hasRoute($name)\n {\n return array_key_exists($name, $this->routes);\n }", "public static function has_folder_access($route){\n\n\n $user_type = Session::get('user.type');\n\n $user_id = Session::get('user.id');\n\n $personal_folder_route = self::personal_folder_path($user_id);\n\n\n\n //if admin has access to all folders\n if( $user_type == 0 ) {\n\n return true;\n\n }//if admin\n\n //if user has access to his folder and client's folders\n else if($user_type == 1){\n\n if( substr_count($route, $personal_folder_route ) > 0 || substr_count($route, 'clients') > 0 ) {\n\n return true;\n\n }//if the route is his personald folder or contains te clients name\n\n }//if user\n else {\n\n if(substr_count($route, $personal_folder_route ) > 0) {\n\n return true;\n\n }//if is his folderor folders inside his folder\n\n\n }//if client\n \n\n return false;\n\n }", "protected function _hasDestinationAddress()\n {\n $hasDestinationAddress = false;\n if ($this->_request->getHeader() && $this->_request->getHeader()->getDefaultLocations()) {\n $locations = $this->_request->getHeader()->getDefaultLocations();\n\n if (isset($locations[self::TAX_LOCATION_PURPOSE_SHIP_TO])) {\n $shipToLocation = $locations[self::TAX_LOCATION_PURPOSE_SHIP_TO];\n $address = $shipToLocation->getAddress();\n $city = (string)$address->getCity();\n $zip = $address->getZipcode();\n $state = $address->getState();\n $hasDestinationAddress = (($city && $state) || $zip) ? true : false;\n }\n }\n\n return $hasDestinationAddress;\n }", "private function requiresAuthorization($uri) {\n\t\tif (array_key_exists($uri, $this->routes))\t {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasCoordinate()\n {\n return $this->coordinate !== null;\n }", "protected function passesAuthorization(): bool\n {\n return $this->hasNestedMenu();\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function validate( IHTTPRouteRequest $request, IHTTPRoute $route ) : bool\n {\n if ( !in_array( self::COMMAND, $route->getOptions()))\n return true;\n \n return ( $request->getHeader( self::REQUESTED_WITH ) == self::REQUESTED_WITH_XHR );\n }", "public function hasBound()\n {\n return $this->bound !== null;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }", "function _validateRouteAddr($route_addr)\n {\n // Check for colon.\n if (strpos($route_addr, ':') !== false) {\n $parts = explode(':', $route_addr);\n $route = $this->_splitCheck($parts, ':');\n } else {\n $route = $route_addr;\n }\n\n // If $route is same as $route_addr then the colon was in\n // quotes or brackets or, of course, non existent.\n if ($route === $route_addr){\n unset($route);\n $addr_spec = $route_addr;\n if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {\n return false;\n }\n } else {\n // Validate route part.\n if (($route = $this->_validateRoute($route)) === false) {\n return false;\n }\n\n $addr_spec = substr($route_addr, strlen($route . ':'));\n\n // Validate addr-spec part.\n if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {\n return false;\n }\n }\n\n if (isset($route)) {\n $return['adl'] = $route;\n } else {\n $return['adl'] = '';\n }\n\n $return = array_merge($return, $addr_spec);\n return $return;\n }", "public function isAvailableWithoutLogin($start, $end, $area, $room)\n {\n $this->validateBookingDuration($start, $end);\n $schedule = Parser::parseRoom($this->bAuth_user, $this->bAuth_pass, $start, $area, $room);\n $startTimeslot = $this->dateTime2timeslot($start);\n $endTimeslot = $this->dateTime2timeslot($end);\n foreach ($schedule['timeslots'] as $t) {\n if ($startTimeslot >= $t['start'] && $endTimeslot <= $t['end']) {\n return true;\n }\n }\n return false;\n }", "public function getArea(): ?string\n {\n return $this->Area ?? null;\n }", "public function hasAdvisorTree() {\n return sizeof($this->advisorTree) > 0;\n }", "function getAreaInfo($area = null, $key = null)\n\t{\n\t\t// by default, use the current area\n\t\tif (is_null($area)) {\n\t\t\t$area = $this->area;\n\t\t}\n\t\t\n\t\t// is it a recognized area?\n\t\tif (! isset($this->areaInfo[$area])) {\n\t\t\t// no, should we return an empty array\n\t\t\t// or a boolean false?\n\t\t\tif (is_null($key)) {\n\t\t\t\treturn $this->areas->getBlankRow();\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (is_null($key)) {\n\t\t\treturn $this->areaInfo[$this->area];\n\t\t} elseif (isset($this->areaInfo[$this->area][$key])) {\n\t\t\treturn $this->areaInfo[$this->area][$key];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function resourceExists(): bool\n {\n $location = $this->route()->parameter('location');\n\n return $location instanceof Location && $location->exists;\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public function isAbroad()\n {\n return strtolower($this->getXml()->getElementsByTagName('IsAbroad')->item(0)->nodeValue) == \"true\";\n }", "public function getAreaId()\n {\n return $this->area;\n }", "public function authorize()\n {\n return Auth::check() && optional($this->route('spacecraft'))->fleet_id == auth()->user()->fleet_id;\n }", "public function hasAnyAccess($routes=array())\n {\n if(count($routes) == 0) return false;\n\n foreach($routes as $route)\n if($this->hasAccess($route))\n return true;\n\n return false;\n }", "protected function is_current_route() {\n\t\tforeach ( array_keys( $this->query_vars ) as $query_var ) {\n\t\t\tif ( get_query_var( $query_var, self::FALSE_HASH ) === self::FALSE_HASH ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function isValid()\n {\n return $this->lat >= -90 && $this->lat <= 90 &&\n $this->lon >= -180 && $this->lon <= 180;\n }", "public static function isValid() : bool{\n\t\treturn self::$noteBlock !== null && self::$noteBlock->getPos()->getWorld() instanceof World;\n\t}", "public function hasAddress()\n {\n return $this->address !== null;\n }", "public function isFullView(): bool\n {\n return self::VIEW_FULL === $this->viewType;\n }", "function get_allowed_block_template_part_areas()\n {\n }", "public function checkIfUserCanAddToAllLocations() {\n if (empty($this->request->params['pass']) || $this->request->params['pass'][0] === '') {\n return false;\n }\n\n return $this->request->params['pass'][0] === $this->userLocation; \n }", "private function checkURI()\n {\n // init vars\n $result = false;\n $uri = $this->getURI();\n $routesArray = $this->routes;\n\n // get existed rule for user requested uri\n foreach ($routesArray as $rulePattern => $path) {\n if (preg_match(\"~$rulePattern~i\", $uri)) {\n $result = [$rulePattern, $path];\n return $result;\n }\n }\n }", "public static function isAreaAccurateEnough(int $idZone): bool\n {\n return true;\n }", "public function assertApiHasRoutes()\n {\n $hasApiRoutes = !empty($this->getApiRoutes());\n\n $this->assertTrue($hasApiRoutes);\n }", "public function show(Area $area)\n {\n //\n }" ]
[ "0.7603163", "0.69949114", "0.69821006", "0.6713858", "0.65964144", "0.6544885", "0.6253558", "0.61429286", "0.6127362", "0.6124531", "0.6122773", "0.6086456", "0.6034936", "0.6012592", "0.596994", "0.5922196", "0.589419", "0.58625555", "0.585383", "0.58433014", "0.58283865", "0.580866", "0.5782834", "0.576414", "0.5760383", "0.5753309", "0.5743579", "0.57196885", "0.56931484", "0.56810486", "0.56614655", "0.56129867", "0.5569465", "0.55676234", "0.55430377", "0.55335426", "0.5532541", "0.5532541", "0.5532541", "0.5514618", "0.5513536", "0.54875165", "0.5481863", "0.5422582", "0.5411098", "0.5404478", "0.5398491", "0.5398294", "0.5388596", "0.53855735", "0.5365414", "0.53607416", "0.5351909", "0.53360355", "0.53064156", "0.53016126", "0.5295846", "0.5289552", "0.5282148", "0.5276473", "0.5265652", "0.52579087", "0.5254181", "0.5246256", "0.5238887", "0.52316743", "0.52225477", "0.5218354", "0.5201973", "0.51960325", "0.51900697", "0.5188932", "0.5184104", "0.51831025", "0.51831025", "0.51809293", "0.5178582", "0.5178474", "0.5162094", "0.5156252", "0.5155197", "0.51478815", "0.51371217", "0.5134194", "0.5117902", "0.51146734", "0.51024646", "0.50950426", "0.50842166", "0.5083297", "0.50740236", "0.5073377", "0.50708926", "0.5059966", "0.50595295", "0.50594187", "0.50581455", "0.5051529", "0.50501895", "0.5048373" ]
0.7533639
1
Returns collection of frontend areas.
Возвращает коллекцию фронтенд-зон.
public function getFrontendAreas(): AreasCollection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBackendAreas(): AreasCollection;", "public function getAreas(): AreasCollection;", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }", "public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }", "public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }", "public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }", "public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }", "public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }", "function get_duo_areas() {\n \t\n }", "public function index()\n {\n $areas = Area::all();\n return view ('config.areas.index', compact('areas'));\n }", "public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }", "public function index()\n {\n $contentAreas = Content_Area::all();\n\n return view('content_areas.index', compact('contentAreas'));\n }", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}", "public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }", "public function index()\n {\n\n $totalAreas = Area::count();\n\n return view('catalogos.areas.index')->with(compact('totalAreas'));\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "public function get_widget_areas() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( ! empty( $this->widget_areas ) ) {\n\t\t\t\treturn $this->widget_areas;\n\t\t\t}\n\n\t\t\t// Get widget areas saved in theem mod\n\t\t\t$widget_areas = wprt_get_mod( 'widget_areas' );\n\n\t\t\t// If theme mod isn't empty set to class widget area var\n\t\t\tif ( ! empty( $widget_areas ) && is_array( $widget_areas ) ) {\n\t\t\t\t$this->widget_areas = array_unique( array_merge( $this->widget_areas, $widget_areas ) );\n\t\t\t}\n\n\t\t\t// Return widget areas\n\t\t\treturn $this->widget_areas;\n\t\t}", "public function index()\n {\n $areas = DB::table('areas')->get();\n\n return view('admin.areas.index', [ 'areas' => $areas]);\n }", "private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }", "public function getIndex()\n {\n $areas = new stdClass();\n $areas->default = 'site';\n\n $areas->panels = new stdClass();\n $areas->panels->site = new stdClass();\n $areas->panels->site->name = 'Site';\n $areas->panels->site->id = 'site';\n $areas->panels->site->link = 'admin/site';\n\n $areas->panels->user = new stdClass();\n $areas->panels->user->name = 'Users';\n $areas->panels->user->id = 'users';\n $areas->panels->user->link = 'admin/user';\n\n $this->setViewData('areas', $areas);\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public function index()\n {\n return TareaResource::collection(Tarea::with('categorias')->get());\n }", "public function index()\n {\n $title = \"All Area Picket\";\n $areas = $this->repository->getAll();\n return view('areas.index', compact('title', 'areas'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areaIns = $em->getRepository('BrooterAdminBundle:AreaIn')->findAll();\n\n return $this->render('areain/index.html.twig', array(\n 'areaIns' => $areaIns,\n ));\n }", "public function index()\n {\n //$sub_area = Sub_area::all();\n //Listar relaciones con foreach EagerLoading\n $sub_area = Sub_area::with('areas')->get();\n //dd($area = $sub_area->areas());\n\n return view('sub_area.index',['sub_area' => $sub_area]);\n }", "public function index()\n {\n if(!auth()->user()->can('ver areas'))\n return response ()->view ('errors.403');\n $areas = Areas::all();\n return view('RRHH/areas', compact('areas',$areas));\n }", "public function ajaxAreas()\n {\n $lineId = Input::get('lineId');\n $areas = Area::where('line_id', $lineId)->lists('name', 'id');\n return Response::json($areas); \n }", "public function index()\n {\n $programAreas = ProgramArea::all();\n\n return view('programs-area', ['programArea'=>$programAreas]);\n }", "public function index()\n {\n $areaData = DeliveryAreaModel::with('zone')->get();\n return view('admin.deliveryarea.index', compact('areaData'));\n }", "public function isFrontendArea(): bool;", "public function getAreas(?int $parent_area_id = null)\n {\n $data = $this->request('areas', [\n 'parent_area_id' => $parent_area_id\n ]);\n\n $areas = [];\n foreach (ArrayHelper::getValue($data, 'areas', []) as $area) {\n $model = new Area();\n $model->setAttributes($area);\n $areas = $model;\n }\n\n return $areas;\n }", "protected function dashboards()\n {\n return [];\n }", "protected function dashboards()\n {\n return [];\n }", "public function index()\n {\n return OrganizerResource::collection(\n Auth::user()->organizers\n );\n }", "public function index(Request $request)\n {\n $areones = AreaOne::all();\n // cache()->remember('areaones',99999, function () use ($areones) {\n // });\n // return cache()->get('areaones');\n return new AreaOneCollection($areones);\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areas = $em->getRepository('AppBundle:Areas')\n ->findAllOrderedByName();\n\n return $this->render('areas/index.html.twig', array(\n 'areas' => $areas,\n ));\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\n\t\tlist($total, $root_list) = Ola_Service_Area::getList($page, $this->perpage, array('root_id'=>0, 'parent_id'=>0));\n\t\t$root_list = Common::resetKey($root_list, 'id');\n\t\tlist(, $parent_list) = Ola_Service_Area::getsBy(array('root_id'=>array('IN', array_keys($root_list)), 'parent_id'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\n\t foreach ($root_list as $key=>$value) {\n\t /*list(, $areas) = Ola_Service_Area::getsBy(array('parent_id'=>$value['id'], 'root_id'=>$value['root_id']), array('id'=>'DESC'));\n\t if($areas) {\n\t \t$this->parents[$key]['areas'] = $areas;\n\t }*/\n\t }\n\n\t\t$list = $this->_cookdata($root_list, $parent_list);\n\t\t$this->assign('list', $list);\n\t\t$this->assign('areas', $areas);\n\t\t//$url = $this->actions['listUrl']. '/?' . http_build_query($search) . '&';\n\t\t$this->assign('pager', Common::getPages($total, $page, $this->perpage, $this->actions['listUrl']. '/?'));\n\t}", "public function index()\n {\n $listAdministrativeRegions = AdministrativeRegion::paginate(5);\n return view('admin.administrative-regions.index', \\compact('listAdministrativeRegions'));\n }", "public function getAreas($moduleName) {\n $areas = $this->luAdmin->perm->getAreas();\n return $areas;\n }", "public function index()\n {\n return view('backend.region.index')->withRegions($this->region->getForDataTable()->paginate(10));\n }", "protected function _getFrontendCollection()\n {\n $collection = $this->_postCollectionFactory->create();\n $collection->addActiveFilter()\n ->addFieldToFilter('post_id', ['neq' => $this->getPost()->getId()])\n ->addStoreFilter($this->_storeManager->getStore()->getId())\n ->setOrder('publish_time', 'DESC')\n ->setPageSize(1);\n return $collection;\n }", "public function index()\n {\n $enities = PageEntity::with('collections')->get();\n\n return $enities;\n }", "public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function actionIndex()\n {\n\t\t$query = Area::find();\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => SIZE10\n\t\t\t],\n ]);\n\t\t\n\t\t$query->andFilterWhere(['is_main' => 0])\n\t\t\t->andFilterWhere(['status' => 1])\n\t\t\t->orderBy(['date' => SORT_DESC]);\n\t\t\t\n\t\t\t\n\t\t$areas = $dataProvider->getModels();\n\t\t$pagination = $dataProvider->getPagination();\n\t\t\n\t\t$mainArea = Area::find()->where(['is_main' => 1])->one();\n\t\t\n\t\tif ($mainArea) {\n\t\t\n $this->view->title = 'Участки';\n\t\t\t$this->view->params['title_h1'] = 'Участки';\n\t\t\t\n\t\t\t/******************** SEO ************************/\n\t\t\tif($mainArea && $mainArea->seo) {\n\t\t\t\tif (!empty($mainArea->seo->meta_title)) {\n\t\t\t\t\t$this->view->title = $mainArea->seo->meta_title;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->title_h1)) {\n\t\t\t\t\t$this->view->params['title_h1'] = $mainArea->seo->title_h1;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->meta_desc)) {\n\t\t\t\t\t$this->view->params['meta_description'] = $mainArea->seo->meta_desc;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->meta_key)) {\n\t\t\t\t\t$this->view->params['meta_keywords'] = $mainArea->seo->meta_key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/******************** /SEO ***********************/\n }\n\t\t\n\t\treturn $this->render('/areas', [\n\t\t\t'dataProvider' => $dataProvider, \n\t\t\t'areas' => $areas, \n\t\t\t'mainArea' => $mainArea,\n\t\t\t'pagination' => $pagination,\n\t\t]);\n }", "public function index()\n {\n //返回集合\n return new ContinentCollection(Continent::paginate(null));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areas = $em->getRepository('CpdgUsuarioBundle:Areas')->findAll();\n\n return $this->render('areas/index.html.twig', array(\n 'areas' => $areas,\n ));\n }", "protected function _getLocalityCollection()\n {\n if (is_null($this->_localityCollection)) {\n $this->_localityCollection = Mage::getResourceModel(\n 'innobyte_emag_marketplace/locality_collection'\n );\n }\n return $this->_localityCollection;\n }", "public function index()\n {\n $regions = OperatingRegion::paginate(25);\n\n return View::make('admin.operating-regions.index')\n ->with('regions', $regions);\n }", "public function index(): View\n {\n return view('titan::admin.areas.index');\n }", "public function loadEmployeeAreaAssets()\n\t{\n\t\t$document = JFactory::getDocument();\n\t\t// css\n\t\t$document->AddStyleSheet(VAPASSETS_URI . 'css/vap-emparea.css');\n\t\tVikAppointments::load_font_awesome();\n\n\t\t// js\n\t\tVikAppointments::load_css_js();\n\t\tVikAppointments::load_fancybox();\n\t\tVikAppointments::load_complex_select();\n\t\tVikAppointments::load_utils();\n\t\tVikAppointments::load_currency_js();\n\t\t$this->addScript(VAPASSETS_URI . 'js/jquery-ui.sortable.min.js');\n\t\t$this->addScript(VAPASSETS_URI . 'js/vap-emparea.js');\n\n\t\t$document->addScriptDeclaration(\n<<<JS\nvar EmployeeArea = new EmployeeArea('#empareaForm');\n\njQuery(document).ready(function() {\n\tjQuery('.vap-list-pagination .hasTooltip').removeClass('hasTooltip').removeAttr('title').attr('data-original-title', '');\n});\nJS\n\t\t);\n\t}", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function get_region_categories()\n\t{\n\t\t\n\t\treturn null;\n\t\t\t\n\t}", "public function getRegiones()\n\t{\n\t\t$regiones = $this->Model_Region->getRegiones();\n\t\techo json_encode($regiones);\n\t}", "public function index()\n {\n /*$datos['areas'] = Area::paginate(10);\n return view('area.index', $datos);*/\n $areas = Area::paginate(10);\n return view('area.index', compact('areas'));\n }", "public function index()\n {\n $areas = Area::orderBy('idArea', 'asc')\n ->where('clasificacion', 'area')\n ->get();\n\n $subareas = Area::orderBy('idArea', 'asc')\n ->where('clasificacion', 'subarea')\n ->get();\n return view('areas.edit', compact(['areas', 'subareas']));\n \n }", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "public function index()\n\t{\n\t\treturn $this->area_atuacao->paginate($this->limit);\n\t}", "public function index()\n {\n $place = $this->getPlace();\n\n $guests = $this->guestRepository->getByPlaceIdSorted($place->id);\n\n return GuestResource::collection($guests);\n }", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function selectallAreas()\n {\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Area ORDER BY Position ASC \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function getSections(){\n return $this->getSite()->getSections();\n }", "public function index()\n {\n $this->authorize('viewAny', Province::class);\n\n $province = Province::all();\n\n return new ProvinceCollection($province);\n\n }", "private function ts_getAreas()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // #41811, dwildt, 1+\n $currHitsSum = $this->hits_sum[ $this->curr_tableField ];\n\n // Get TS configuration of the current filter / tableField\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get areas from TS\n // SWITCH area key\n switch ( $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] )\n {\n case ('strings') :\n $arr_result = $this->pObj->objCal->area_strings( $conf_array, null, $this->curr_tableField );\n break;\n case ('interval') :\n $arr_result = $this->pObj->objCal->area_interval( $conf_array, null, $this->curr_tableField );\n break;\n// case ('from_to_fields') :\n// break;\n default:\n // DRS - Development Reporting System\n if ( $this->pObj->b_drs_error )\n {\n $prompt = 'undefined value in switch: ' .\n '\\'' . $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] . '\\'.';\n t3lib_div :: devLog( '[ERROR/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'Areas won\\'t handled!';\n t3lib_div :: devLog( '[WARN/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS - Development Reporting System\n return;\n }\n // SWITCH area key\n $areas = $arr_result[ 'data' ][ 'values' ];\n unset( $arr_result );\n // Get areas from TS\n // #41811, dwildt, 1+\n $this->hits_sum[ $this->curr_tableField ] = $currHitsSum;\n\n // DRS\n if ( $this->pObj->b_drs_cal || $this->pObj->b_drs_filter )\n {\n $arr_prompt = null;\n foreach ( ( array ) $areas as $key => $value )\n {\n $arr_prompt[] = '[' . $key . '] = ' . $value;\n }\n $prompt = 'values are: ' . implode( ', ', ( array ) $arr_prompt );\n t3lib_div :: devLog( '[INFO/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN areas\n return $areas;\n }", "public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }", "public function getAreaRegion()\n {\n return $this->area_region;\n }", "public function get_regions()\n\t{\n\t\t$this->load->model('promo_model');\n\t\t$region= $this->promo_model->regions();\n\t\t\n\t\techo json_encode($region);\n\t}", "public function serviceAreas()\n {\n return $this->hasMany('App\\SchoolServiceArea');\n }", "public function index()\n {\n return view('admin.zones.index', [\n 'zones' => Zone::paginate(Constant::COUNT_PER_PAGE)\n ]);\n }", "public function getListAreasDefinition()\n {\n $listAreas = array();\n if($this->areasDefinition){\n $defaultParameters = array(\n 'translation_domain' => 'messages',\n );\n foreach ($this->areasDefinition as $areaDefinition) {\n $areas = $areaDefinition->getAreas();\n foreach ($areas as $area) {\n if(!isset($area['name'])){\n throw new \\LogicException(sprintf('The area definition require the \"name\" property'));\n }\n $name = $area['name'];\n if(isset($listAreas[$name])){\n throw new \\LogicException(sprintf('The area definition name \"%s\" is already defined'));\n }\n $areaDefinitionData = array_merge($defaultParameters, $area);\n $listAreas[$name] = $this->trans($areaDefinitionData['name'],array(),$areaDefinitionData['translation_domain']);\n }\n } \n }\n return $listAreas;\n }", "public function index()\n {\n $regions = Region::roots()->orderBy('name')->getModels();\n $categories = Category::whereIsRoot()->defaultOrder()->getModels();\n\n return view('home', [\n 'regions' => $regions,\n 'categories' => $categories,\n ]);\n }", "function get_allowed_block_template_part_areas()\n {\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public static function retrieveAll(){\n\n $myDataAccess = aContentAreaDataAccess::getInstance();\n\n $myDataAccess->connectToDB();\n\n $myDataAccess->selectDivs();\n\n $numberOfRecords = 0;\n\n while($row = $myDataAccess->fetchDivs())\n {\n $currentDiv = new self(\n $myDataAccess->fetchAlias($row),\n //$myDataAccess->fetchCreated($row),\n //$myDataAccess->fetchCreatedBy($row),\n $myDataAccess->fetchDescription($row),\n $myDataAccess->fetchDivId($row),\n $myDataAccess->fetchDivOrder($row),\n //$myDataAccess->fetchLastModified($row),\n //$myDataAccess->fetchModifiedBy($row),\n $myDataAccess->fetchName($row)\n );\n\n $arrayOfDivs[] = $currentDiv;\n\n }\n\n $myDataAccess->closeDB();\n\n return $arrayOfDivs;\n }", "protected function grid()\n\t{\n\t\t$grid = new Grid(new NativePlaceRegion);\n\t $grid->model()->where('parentid', '=', 0);\n\t\t$grid->paginate(40);\n\t\t\n\t\t$grid->region_id('地区id')->sortable();\n\t\t$grid->parentid('上级地区id')->sortable();\n\t\t$grid->region_name('地区名称');\n\t\t$grid->have_children('是否有更下级地区');\n\t\t\n\t\t// filter($callback)方法用来设置表格的简单搜索框\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\t\t\t$filter->like('region_name', '地区名称');\n\t\t});\n\t\t\n\t\treturn $grid;\n\t}", "function getArea(){}", "public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }", "public function index()\n {\n $regions = Region::paginate(25);\n\n return view('regions.index', compact('regions'));\n }", "public function index()\n {\n return Tier1Resource::collection(Region::all());\n }", "function getRegionsNew() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions WHERE ID LIKE 'WebSite%'\";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function index()\n {\n $countries = Country::with('locations')->get();\n return Resource::collection($countries);\n }", "public function listInnerRegionAction()\n {\n // init toolbar controls here, becase we need to handle the logic\n $this->initToolbarControls();\n $collection = $this->getCollection();\n $this->assignCRUDVars(array(\n 'Items' => $collection,\n 'Pager' => $this->createCollectionPager($collection),\n 'Columns' => $this->getListColumns(),\n ));\n return $this->render( $this->findTemplatePath('list_inner.html'));\n }", "public function getDashboardGroups(): array;", "public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }", "function get_list_to_show($area)\n\t{\n\t\t$this->load->model('_procurement_plan');\n\t\t$this->load->model('_contract');\n\t\t$this->load->model('_bid');\n\t\t$list = array();\n\t\t\n\t\tif($area == 'procurement_plans') {\n\t\t\t$list = $this->_procurement_plan->lists(array('status'=>'published', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'best_evaluated_bidders') {\n\t\t\t$list = $this->_bid->lists('awards');\n\t\t} else if($area == 'active_notices') {\n\t\t\t$list = $this->_tender->lists(array('status'=>'published', 'display_type'=>'public', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'contract_awards') {\n\t\t\t$list = $this->_contract->lists(array('offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE, 'status'=>array('active','complete','endorsed','commenced')));\n\t\t}\n\t\t\n\t\treturn $list;\n\t}", "function &plgSearchKunenaAreas() {\n\tstatic $areas = array();\n\tif (empty($areas)) {\n\t\t$areas['kunena'] = JText::_('COM_KUNENA');\n\t}\n\treturn $areas;\n}", "public function getCoreArea()\n {\n return $this->coreArea;\n }", "public function index()\n {\n $provider=Provider::all();\n return ProviderResource::collection($provider);\n }", "public function getAllViews()\n {\n if (!$this->_area || empty($this->_areViewsCollectedInArea[$this->_area])) {\n $this->collectAllViewsFiles($this->_area);\n }\n return $this->_views;\n }", "public function getSections()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('sections');\n }", "public function index()\n {\n $apartments = $this->apartmentRepository->getList();\n if ( ! $apartments)\n {\n return Response::json([\n 'error' => 'E_NOT_FOUND',\n 'message' => \"No apartment\"\n ], 404);\n }\n return new Collection(array_map(\n function ($apartment) {\n return new ApartmentPresenter($apartment);\n }, $apartments->toArray()));\n }", "public function getAreaFilter()\n {\n return isset($this->area_filter) ? $this->area_filter : null;\n }", "public function index()\n {\n /*\n * filter[attribute]\n * limit=100\n * sort[attribute]=desc\n * include[]=property_name\n */\n\n // Laravel Eloquent\n list($regions, $paginator) = $this->_getCollectionAndPaginator(new RegionsRepository());\n\n // Fractal\n $resource = new FractalResource\\Collection($regions, new GenericTransformer());\n $resource->setPaginator(new FractalPaginatorAdapter($paginator));\n\n return response()\n ->json($this->_getResponseData($resource))\n ->setStatusCode(Response::HTTP_OK);\n }", "public function getLayouts();", "abstract protected function getArea();", "public function getViewArea() {}" ]
[ "0.8302107", "0.768433", "0.7483156", "0.67402995", "0.65598005", "0.6485121", "0.64217377", "0.6399152", "0.63838756", "0.6331877", "0.6327003", "0.6270569", "0.624795", "0.6233313", "0.6231023", "0.6228049", "0.61884534", "0.6188238", "0.60617375", "0.6052353", "0.5984779", "0.5982425", "0.59765816", "0.5970407", "0.5957227", "0.5936749", "0.5886044", "0.58649963", "0.58543134", "0.5848863", "0.583668", "0.58359736", "0.5771874", "0.57685816", "0.57606673", "0.5732345", "0.5732345", "0.57320684", "0.5725539", "0.5718607", "0.5700066", "0.5698814", "0.5691496", "0.5668839", "0.56630474", "0.5659308", "0.56555766", "0.56488544", "0.56223434", "0.5616755", "0.5616644", "0.56105244", "0.56087065", "0.5569113", "0.5559922", "0.5554623", "0.55402535", "0.5524795", "0.5505287", "0.5501106", "0.54941726", "0.54795295", "0.5478373", "0.54569465", "0.54455537", "0.54418683", "0.54132885", "0.5408115", "0.5401073", "0.53976166", "0.5391177", "0.53800595", "0.53702515", "0.5365769", "0.5364637", "0.53622055", "0.53571284", "0.5356301", "0.5349468", "0.5341215", "0.53316635", "0.5316382", "0.53147244", "0.53113914", "0.5311161", "0.53068393", "0.52966195", "0.52922523", "0.5285445", "0.528244", "0.5281632", "0.52809346", "0.5277788", "0.5271009", "0.5269034", "0.52679956", "0.5259886", "0.52586603", "0.52568173", "0.5254201" ]
0.8913702
0
Returns collection of backend areas.
Возвращает коллекцию областей бэкенда.
public function getBackendAreas(): AreasCollection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFrontendAreas(): AreasCollection;", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function getAreas(): AreasCollection;", "public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}", "private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }", "public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }", "public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }", "public function get_widget_areas() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( ! empty( $this->widget_areas ) ) {\n\t\t\t\treturn $this->widget_areas;\n\t\t\t}\n\n\t\t\t// Get widget areas saved in theem mod\n\t\t\t$widget_areas = wprt_get_mod( 'widget_areas' );\n\n\t\t\t// If theme mod isn't empty set to class widget area var\n\t\t\tif ( ! empty( $widget_areas ) && is_array( $widget_areas ) ) {\n\t\t\t\t$this->widget_areas = array_unique( array_merge( $this->widget_areas, $widget_areas ) );\n\t\t\t}\n\n\t\t\t// Return widget areas\n\t\t\treturn $this->widget_areas;\n\t\t}", "public function index()\n {\n $areas = Area::all();\n return view ('config.areas.index', compact('areas'));\n }", "public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }", "public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }", "function get_duo_areas() {\n \t\n }", "public function getAreas($moduleName) {\n $areas = $this->luAdmin->perm->getAreas();\n return $areas;\n }", "public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }", "public function index()\n {\n $contentAreas = Content_Area::all();\n\n return view('content_areas.index', compact('contentAreas'));\n }", "public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }", "public function index()\n {\n $areas = DB::table('areas')->get();\n\n return view('admin.areas.index', [ 'areas' => $areas]);\n }", "public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }", "public function index()\n {\n\n $totalAreas = Area::count();\n\n return view('catalogos.areas.index')->with(compact('totalAreas'));\n }", "public function index()\n {\n $title = \"All Area Picket\";\n $areas = $this->repository->getAll();\n return view('areas.index', compact('title', 'areas'));\n }", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }", "public function isBackendArea(): bool;", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public function selectallAreas()\n {\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Area ORDER BY Position ASC \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function getAreas(?int $parent_area_id = null)\n {\n $data = $this->request('areas', [\n 'parent_area_id' => $parent_area_id\n ]);\n\n $areas = [];\n foreach (ArrayHelper::getValue($data, 'areas', []) as $area) {\n $model = new Area();\n $model->setAttributes($area);\n $areas = $model;\n }\n\n return $areas;\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function getALLStore();", "function &plgSearchKunenaAreas() {\n\tstatic $areas = array();\n\tif (empty($areas)) {\n\t\t$areas['kunena'] = JText::_('COM_KUNENA');\n\t}\n\treturn $areas;\n}", "public function getIndex()\n {\n $areas = new stdClass();\n $areas->default = 'site';\n\n $areas->panels = new stdClass();\n $areas->panels->site = new stdClass();\n $areas->panels->site->name = 'Site';\n $areas->panels->site->id = 'site';\n $areas->panels->site->link = 'admin/site';\n\n $areas->panels->user = new stdClass();\n $areas->panels->user->name = 'Users';\n $areas->panels->user->id = 'users';\n $areas->panels->user->link = 'admin/user';\n\n $this->setViewData('areas', $areas);\n }", "function getArea($area)\n {\n $areas = array();\n if(isset($this->areas[$area])){\n ksort($this->areas[$area]);\n $areas = $this->areas[$area];\n }\n return $areas;\n }", "protected function dashboards()\n {\n return [];\n }", "protected function dashboards()\n {\n return [];\n }", "public function index()\n {\n if(!auth()->user()->can('ver areas'))\n return response ()->view ('errors.403');\n $areas = Areas::all();\n return view('RRHH/areas', compact('areas',$areas));\n }", "public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }", "public function index()\n {\n return TareaResource::collection(Tarea::with('categorias')->get());\n }", "public function getCurrentArea(): AreaContract;", "function _load_combo_data()\n\t{\n\t\t$data['po_zone_infos'] = $this->Po_zone_area_detail->get_po_zones();\n\t\t//This function is for listing of areas\t\n\t\t$data['po_area_infos'] = $this->Po_zone_area_detail->get_po_areas();\n\t\treturn $data;\n\t}", "public function ajaxAreas()\n {\n $lineId = Input::get('lineId');\n $areas = Area::where('line_id', $lineId)->lists('name', 'id');\n return Response::json($areas); \n }", "public function getResourceSets();", "public function getListAreasDefinition()\n {\n $listAreas = array();\n if($this->areasDefinition){\n $defaultParameters = array(\n 'translation_domain' => 'messages',\n );\n foreach ($this->areasDefinition as $areaDefinition) {\n $areas = $areaDefinition->getAreas();\n foreach ($areas as $area) {\n if(!isset($area['name'])){\n throw new \\LogicException(sprintf('The area definition require the \"name\" property'));\n }\n $name = $area['name'];\n if(isset($listAreas[$name])){\n throw new \\LogicException(sprintf('The area definition name \"%s\" is already defined'));\n }\n $areaDefinitionData = array_merge($defaultParameters, $area);\n $listAreas[$name] = $this->trans($areaDefinitionData['name'],array(),$areaDefinitionData['translation_domain']);\n }\n } \n }\n return $listAreas;\n }", "public function getEnabledBackends(){\n\t\t$backendMapper = $this->app['BackendMapper'];\n\t\treturn $backendMapper->getAll();\n\t}", "public static function GET_AREA_BLOCKS(){\n\t $SQL_String = \"SELECT * FROM area_block WHERE am_id=:amid AND _keep=1 ORDER BY ab_id ASC\";\n\t return $SQL_String;\n\t}", "public function getSkinsAll()\n {\n return array(\n \\XLite::CUSTOMER_INTERFACE => self::PATH_CUSTOMER,\n \\XLite::COMMON_INTERFACE => self::PATH_COMMON,\n \\XLite::ADMIN_INTERFACE => self::PATH_ADMIN,\n \\XLite::CONSOLE_INTERFACE => self::PATH_CONSOLE,\n \\XLite::MAIL_INTERFACE => self::PATH_MAIL,\n \\XLite::PDF_INTERFACE => self::PATH_PDF,\n );\n }", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areaIns = $em->getRepository('BrooterAdminBundle:AreaIn')->findAll();\n\n return $this->render('areain/index.html.twig', array(\n 'areaIns' => $areaIns,\n ));\n }", "private function ts_getAreas()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // #41811, dwildt, 1+\n $currHitsSum = $this->hits_sum[ $this->curr_tableField ];\n\n // Get TS configuration of the current filter / tableField\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get areas from TS\n // SWITCH area key\n switch ( $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] )\n {\n case ('strings') :\n $arr_result = $this->pObj->objCal->area_strings( $conf_array, null, $this->curr_tableField );\n break;\n case ('interval') :\n $arr_result = $this->pObj->objCal->area_interval( $conf_array, null, $this->curr_tableField );\n break;\n// case ('from_to_fields') :\n// break;\n default:\n // DRS - Development Reporting System\n if ( $this->pObj->b_drs_error )\n {\n $prompt = 'undefined value in switch: ' .\n '\\'' . $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] . '\\'.';\n t3lib_div :: devLog( '[ERROR/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'Areas won\\'t handled!';\n t3lib_div :: devLog( '[WARN/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS - Development Reporting System\n return;\n }\n // SWITCH area key\n $areas = $arr_result[ 'data' ][ 'values' ];\n unset( $arr_result );\n // Get areas from TS\n // #41811, dwildt, 1+\n $this->hits_sum[ $this->curr_tableField ] = $currHitsSum;\n\n // DRS\n if ( $this->pObj->b_drs_cal || $this->pObj->b_drs_filter )\n {\n $arr_prompt = null;\n foreach ( ( array ) $areas as $key => $value )\n {\n $arr_prompt[] = '[' . $key . '] = ' . $value;\n }\n $prompt = 'values are: ' . implode( ', ', ( array ) $arr_prompt );\n t3lib_div :: devLog( '[INFO/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN areas\n return $areas;\n }", "public function getAdministrativeDatabasesList() {\n return $this->_get(9);\n }", "public function index()\n {\n $areaData = DeliveryAreaModel::with('zone')->get();\n return view('admin.deliveryarea.index', compact('areaData'));\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "function getAllBands() {\n return $this->Band->getAllBands();\n }", "public function getGatewayCollection()\n {\n return $this->oGatewayCollecetion;\n }", "public function index()\n {\n //$sub_area = Sub_area::all();\n //Listar relaciones con foreach EagerLoading\n $sub_area = Sub_area::with('areas')->get();\n //dd($area = $sub_area->areas());\n\n return view('sub_area.index',['sub_area' => $sub_area]);\n }", "public function getAreaRegion()\n {\n return $this->area_region;\n }", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function serviceAreas()\n {\n return $this->hasMany('App\\SchoolServiceArea');\n }", "public function index()\n {\n $provider=Provider::all();\n return ProviderResource::collection($provider);\n }", "static function get_treaties_enabled_regions_in_use() {\n global $wpdb;\n return $wpdb->get_results('SELECT a.* FROM ai_region a INNER JOIN ai_treaty_region b ON a.id = b.id_region GROUP BY a.id ORDER BY a.id');\n }", "public function index()\n {\n $programAreas = ProgramArea::all();\n\n return view('programs-area', ['programArea'=>$programAreas]);\n }", "public function index()\n {\n return view('backend.region.index')->withRegions($this->region->getForDataTable()->paginate(10));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areas = $em->getRepository('AppBundle:Areas')\n ->findAllOrderedByName();\n\n return $this->render('areas/index.html.twig', array(\n 'areas' => $areas,\n ));\n }", "public function all()\n {\n $gateways = [];\n\n foreach ($this->gateways as $name => $gateway) {\n $class = $gateway['gateway'];\n if (class_exists($class)) {\n $gateways[$name] = $gateway;\n }\n }\n\n ksort($gateways);\n\n return $gateways;\n }", "public function index(): View\n {\n return view('titan::admin.areas.index');\n }", "public function listar() {\n\t\t\ttry {\n\t\t\t\t$consulta = 'SELECT * FROM Area ORDER BY codigo_area ASC';\n\t\t\t\t//ejecutando la consulta\n\t\t\t\tif($this->databaseTransaction != null) {\n\t\t\t\t\t$resultado = $this->databaseTransaction->ejecutar($consulta);\n\t\t\t\t\tif($this->databaseTransaction->cantidadResultados() == 0) {\n\t\t\t\t\t\t$this->databaseTransaction->cerrar();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$array = null;\n\t\t\t\t\t\t$i \t = 0;\n\t\t\t\t\t\twhile($registro = $this->databaseTransaction->resultados()) {\n\t\t\t\t\t\t\t$array[$i] = new Area($registro);\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->databaseTransaction->cerrar();\n\t\t\t\t\t\treturn $array;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(ambiente == 'DEV') { echo \"Controller Area - Listar: El objeto DatabaseTransaction se encuentra nulo\"; }\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}catch(Exception $e) {\n\t\t\t\tif(ambiente == 'DEV') { echo $e->getMessage(); }\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\n\t\tlist($total, $root_list) = Ola_Service_Area::getList($page, $this->perpage, array('root_id'=>0, 'parent_id'=>0));\n\t\t$root_list = Common::resetKey($root_list, 'id');\n\t\tlist(, $parent_list) = Ola_Service_Area::getsBy(array('root_id'=>array('IN', array_keys($root_list)), 'parent_id'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\n\t foreach ($root_list as $key=>$value) {\n\t /*list(, $areas) = Ola_Service_Area::getsBy(array('parent_id'=>$value['id'], 'root_id'=>$value['root_id']), array('id'=>'DESC'));\n\t if($areas) {\n\t \t$this->parents[$key]['areas'] = $areas;\n\t }*/\n\t }\n\n\t\t$list = $this->_cookdata($root_list, $parent_list);\n\t\t$this->assign('list', $list);\n\t\t$this->assign('areas', $areas);\n\t\t//$url = $this->actions['listUrl']. '/?' . http_build_query($search) . '&';\n\t\t$this->assign('pager', Common::getPages($total, $page, $this->perpage, $this->actions['listUrl']. '/?'));\n\t}", "public function getServiceAreaAllowableValues()\r\n {\r\n return [\r\n self::SERVICE_AREA_MAINLAND_CHINA,\r\n self::SERVICE_AREA_OUTSIDE_MAINLAND_CHINA,\r\n self::SERVICE_AREA__GLOBAL,\r\n ];\r\n }", "public function getAll()\n {\n return $this->apiRequest('application/locations');\n }", "public static function registerWidgetAreas()\n {\n /**\n * Footer Area\n */\n register_sidebar(array(\n 'id' => 'footer-area',\n 'name' => __('Footerarea', 'Helsingborg'),\n 'description' => __('Arean längst ner på sidan', 'Helsingborg'),\n 'before_widget' => '<div class=\"left large-6 medium-6 print-6 columns\"><div class=\"footer-content\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h2 class=\"footer-title\">',\n 'after_title' => '</h2>'\n ));\n\n /**\n * Slider Area\n */\n register_sidebar(array(\n 'id' => 'slider-area',\n 'name' => __('Topparea', 'Helsingborg'),\n 'description' => __('Visas under huvudmenyn', 'Helsingborg'),\n 'before_widget' => '<div class=\"large-12 medium-12 small-12 print-12 columns widget\">' .\n '<div class=\"box %2$s\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h3>',\n 'after_title' => '</h3>'\n ));\n\n /**\n * Content Area\n */\n register_sidebar(array(\n 'id' => 'content-area',\n 'name' => __('Innehållsarea', 'Helsingborg'),\n 'description' => __('Visas strax under en artikels brödtext', 'Helsingborg'),\n 'before_widget' => '<div class=\"box box-outlined widget %2$s\">',\n 'after_widget' => '</div>'\n ));\n\n /**\n * Content Area Bottom\n */\n register_sidebar(array(\n 'id' => 'content-area-bottom',\n 'name' => __('Innehåll bottenarea', 'Helsingborg'),\n 'description' => __('Visas under vänstermeny och artikel (fullbredd) ', 'Helsingborg'),\n 'before_widget' => '<div class=\"large-12 medium-12 small-12 print-12 columns widget\">' .\n '<div class=\"box box-outlined %2$s\">',\n 'after_widget' => '</div>'\n ));\n\n /**\n * Service Area\n */\n register_sidebar(array(\n 'id' => 'service-area',\n 'name' => __('Servicearea', 'Helsingborg'),\n 'description' => __('De service-länkar som visas i grått fält på startsidan', 'Helsingborg'),\n 'before_widget' => '<div class=\"widget columns large-4 medium-4 small-12 pprint-4\">',\n 'after_widget' => '</div>'\n ));\n\n /**\n * Fun Facts Area\n */\n register_sidebar(array(\n 'id' => 'fun-facts-area',\n 'name' => __('Fakta', 'Helsingborg'),\n 'description' => __('Faktarutor som visas innan footer (visar tre slumpmässiga).', 'Helsingborg'),\n 'before_widget' => '<div class=\"widget columns large-3 medium-3 print-3 left\">',\n 'after_widget' => '</div>'\n ));\n\n /**\n * Left Sidebar\n */\n register_sidebar(array(\n 'id' => 'left-sidebar',\n 'name' => __('Vänster area', 'Helsingborg'),\n 'description' => __('Visas ovanför vänstermenyn.', 'Helsingborg'),\n 'before_widget' => '<div class=\"large-12 medium-12 small-12 print-12 columns widget\">' .\n '<div class=\"box box-filled widget %2$s\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n ));\n\n /**\n * Left Sidebar Bottom\n */\n register_sidebar(array(\n 'id' => 'left-sidebar-bottom',\n 'name' => __('Vänster bottenarea', 'Helsingborg'),\n 'description' => __('Visas under vänstermenyn.', 'Helsingborg'),\n 'before_widget' => '<div class=\"large-12 medium-12 small-12 print-12 columns widget\">' .\n '<div class=\"box box-filled widget %2$s\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n ));\n\n /**\n * Right Sidebar\n */\n register_sidebar(array(\n 'id' => 'right-sidebar',\n 'name' => __('Höger area', 'Helsingborg'),\n 'description' => __('Visas i högerspalten.', 'Helsingborg'),\n 'before_widget' => '<div class=\"large-12 medium-12 small-12 print-12 columns widget\">' .\n '<div class=\"box box-filled widget %2$s\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n ));\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "public function getDashboardGroups(): array;", "public function get_regions()\n\t{\n\t\t$this->load->model('promo_model');\n\t\t$region= $this->promo_model->regions();\n\t\t\n\t\techo json_encode($region);\n\t}", "public static function getAreasById($id) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select * from area where idArea = $id\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "public static function getFilteredArea($area_id)\n {\n\n $areas = DB::table('areas')->where('id', '<>', $area_id)->get();\n\n return $areas;\n }", "function getBackendList()\n {\n $files = Misc::getFileList(APP_INC_PATH . '/customer');\n $list = array();\n for ($i = 0; $i < count($files); $i++) {\n // make sure we only list the customer backends\n if (preg_match('/^class\\.(.*)\\.php$/', $files[$i], $matches)) {\n // display a prettyfied backend name in the admin section\n if ($matches[1] == \"abstract_customer_backend\") {\n continue;\n }\n $name = ucwords(str_replace('_', ' ', $matches[1]));\n $list[$files[$i]] = $name;\n }\n }\n return $list;\n }", "function getAllZones() {\n\n $this->load->library('mongo_db');\n $cursor = $this->mongo_db->get('zones');\n\n echo json_encode(array('data' => $cursor));\n }", "public function actionIndex()\n {\n\t\t$query = Area::find();\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => SIZE10\n\t\t\t],\n ]);\n\t\t\n\t\t$query->andFilterWhere(['is_main' => 0])\n\t\t\t->andFilterWhere(['status' => 1])\n\t\t\t->orderBy(['date' => SORT_DESC]);\n\t\t\t\n\t\t\t\n\t\t$areas = $dataProvider->getModels();\n\t\t$pagination = $dataProvider->getPagination();\n\t\t\n\t\t$mainArea = Area::find()->where(['is_main' => 1])->one();\n\t\t\n\t\tif ($mainArea) {\n\t\t\n $this->view->title = 'Участки';\n\t\t\t$this->view->params['title_h1'] = 'Участки';\n\t\t\t\n\t\t\t/******************** SEO ************************/\n\t\t\tif($mainArea && $mainArea->seo) {\n\t\t\t\tif (!empty($mainArea->seo->meta_title)) {\n\t\t\t\t\t$this->view->title = $mainArea->seo->meta_title;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->title_h1)) {\n\t\t\t\t\t$this->view->params['title_h1'] = $mainArea->seo->title_h1;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->meta_desc)) {\n\t\t\t\t\t$this->view->params['meta_description'] = $mainArea->seo->meta_desc;\n\t\t\t\t}\n\t\t\t\tif (!empty($mainArea->seo->meta_key)) {\n\t\t\t\t\t$this->view->params['meta_keywords'] = $mainArea->seo->meta_key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/******************** /SEO ***********************/\n }\n\t\t\n\t\treturn $this->render('/areas', [\n\t\t\t'dataProvider' => $dataProvider, \n\t\t\t'areas' => $areas, \n\t\t\t'mainArea' => $mainArea,\n\t\t\t'pagination' => $pagination,\n\t\t]);\n }", "public function getRegisterBackends()\n {\n \treturn $this->backends;\n }", "function getArea(){}", "function get_list_to_show($area)\n\t{\n\t\t$this->load->model('_procurement_plan');\n\t\t$this->load->model('_contract');\n\t\t$this->load->model('_bid');\n\t\t$list = array();\n\t\t\n\t\tif($area == 'procurement_plans') {\n\t\t\t$list = $this->_procurement_plan->lists(array('status'=>'published', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'best_evaluated_bidders') {\n\t\t\t$list = $this->_bid->lists('awards');\n\t\t} else if($area == 'active_notices') {\n\t\t\t$list = $this->_tender->lists(array('status'=>'published', 'display_type'=>'public', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'contract_awards') {\n\t\t\t$list = $this->_contract->lists(array('offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE, 'status'=>array('active','complete','endorsed','commenced')));\n\t\t}\n\t\t\n\t\treturn $list;\n\t}", "public function all() {\n return $this->provider->getRoutesByNames(NULL);\n }", "public function getMaps()\n {\n return $this->maps;\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public function getPools()\r\n\t{\r\n\t\treturn $this->pools;\r\n\t}", "public static function allBundles(): Collection;", "public function get_search_fileareas() {\n $fileareas = array(\n 'intro' // Fileareas.\n );\n\n return $fileareas;\n }", "public function get_search_fileareas() {\n $fileareas = array(\n 'profile' // Fileareas.\n );\n\n return $fileareas;\n }", "public function getZones()\n {\n $zones = [];\n $allStores = $this->storeManager->getStores();\n foreach ($allStores as $store) {\n $domain = $this->scopeConfig->getValue(\n 'firebear_cloudflare_control/apioptions/api_domain',\n ScopeInterface::SCOPE_STORE,\n $store\n );\n $zone = [\n 'domain' => $domain,\n 'store' => $store->getCode()\n ];\n $zones[$domain] = $zone;\n }\n\n return $zones;\n }", "public function index()\n {\n //返回集合\n return new ContinentCollection(Continent::paginate(null));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areas = $em->getRepository('CpdgUsuarioBundle:Areas')->findAll();\n\n return $this->render('areas/index.html.twig', array(\n 'areas' => $areas,\n ));\n }", "public function getall()\r\n {\r\n $locations = array();\r\n $count = 0;\r\n \r\n foreach($this->all() as $location)\r\n {\r\n $location = (array)$location;\r\n \r\n $locations[] = array('id' => $location['id'], 'name' => $location['name'],\r\n 'caption' => $location['caption'], 'description' => $location['description'],\r\n 'address' => $location['address'],\r\n 'contact' => $location['contact'],\r\n 'image1' => $location['image1'], 'image2' => $location['image2'],\r\n 'image3' => $location['image3'], 'image4' => $location['image4']);\r\n $count++;\r\n \r\n }\r\n \r\n if ($count > 0)\r\n {\r\n return $locations;\r\n }\r\n else\r\n {\r\n return null;\r\n } \r\n }", "public function get_region_categories()\n\t{\n\t\t\n\t\treturn null;\n\t\t\t\n\t}", "public function workareas()\n {\n return $this->hasMany('App\\Workarea');\n }", "protected function operatingCountries()\n {\n return OperatingCountry::all();\n }", "protected function _getLocalityCollection()\n {\n if (is_null($this->_localityCollection)) {\n $this->_localityCollection = Mage::getResourceModel(\n 'innobyte_emag_marketplace/locality_collection'\n );\n }\n return $this->_localityCollection;\n }" ]
[ "0.7982292", "0.7863667", "0.7485426", "0.67022675", "0.6593737", "0.64866", "0.64379495", "0.63639337", "0.6276418", "0.61409205", "0.6113982", "0.6099114", "0.60839504", "0.6070243", "0.60538787", "0.5982377", "0.5981833", "0.59129614", "0.58314604", "0.58313364", "0.5829481", "0.58068717", "0.5794942", "0.5779072", "0.5741784", "0.5726398", "0.5722805", "0.5707307", "0.5701471", "0.56510574", "0.56100255", "0.55747485", "0.55722237", "0.5565001", "0.5562893", "0.5489497", "0.5478043", "0.5478043", "0.5474036", "0.54708236", "0.5469294", "0.54552376", "0.54442203", "0.54428935", "0.5434656", "0.54302126", "0.5416714", "0.5413683", "0.5410132", "0.54013026", "0.5390601", "0.53844696", "0.5356546", "0.53553945", "0.53536105", "0.5350592", "0.5349409", "0.5325246", "0.5323175", "0.53198373", "0.53093636", "0.53039265", "0.5303851", "0.52730036", "0.52709", "0.52662295", "0.5260509", "0.5258274", "0.5256287", "0.5248507", "0.524822", "0.5246831", "0.52406865", "0.5239289", "0.5236206", "0.52313584", "0.52307904", "0.5221315", "0.5214438", "0.5210873", "0.52023715", "0.52021277", "0.52009976", "0.5186347", "0.5183583", "0.51745105", "0.51699746", "0.516886", "0.5159444", "0.5155984", "0.5155348", "0.51488394", "0.5146598", "0.5145278", "0.5143049", "0.5136731", "0.51347417", "0.512982", "0.5127637", "0.51252174" ]
0.8922755
0
Checks if the current area belongs to the Frontend Areas.
Проверяет, принадлежит ли текущая область к областям Frontend.
public function isFrontendArea(): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBackendArea(): bool;", "public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}", "public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}", "public function is_frontend_editor_page() {\n\t\tif ( is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\t// Layouts frontend editor\n\t\t\tisset( $_GET['toolset_editor'] )\n\t\t\t// Beaver Builder frontend editor\n\t\t\t|| isset( $_GET['fl_builder'] )\n\t\t\t// CRED frontend editor pages, when discoverable\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function isFrontEnd()\n {\n return parse_url(Url::to('@web'))['path'] !== '/admin';\n }", "protected function isFrontend() {}", "protected function isFrontendEditActive() {}", "protected function isFrontendEditActive() {}", "public function isEnvironmentInFrontendMode() {}", "public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }", "public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }", "function is_tabber_tabs_area_active( $index ){\n global $wp_registered_sidebars;\n\n $widgetcolums = wp_get_sidebars_widgets();\n\t\t \n if ($widgetcolums[$index]) return true;\n \n\treturn false;\n}", "public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }", "public function isFrontendProtected() {\n return ($this->protection & FRONTEND_PROTECTION) >= 1;\n }", "function biagiotti_mikado_is_header_widget_area_active( $area ) {\n\t\t\n\t\tif ( empty( $area ) || ! in_array( $area, array( 'one', 'two' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_' . $area . '_meta', true );\n\t\t$is_active = false;\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-' . $area ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $is_active;\n\t}", "public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}", "public function getFrontendAreas(): AreasCollection;", "public function is_on_dashboard() {\n return ($this->page->pagelayout == 'mydashboard');\n }", "public function isFrontendEnabled()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_QUOTATION_VISIBILITY,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "function cinerama_edge_dashboard_page() {\n\t\treturn is_page_template('user-dashboard.php');\n\t}", "public function isFrontendEditingActive() {}", "private function set_currFilterIsArea()\n {\n // 3.9.24, 120604, dwildt+\n if ( empty( $this->pObj->objCal->arr_area ) )\n {\n $this->bool_currFilterIsArea = false;\n return;\n }\n // 3.9.24, 120604, dwildt+\n // SWITCH current tableField is a filter with areas\n // Set class var $bool_currFilterIsArea\n switch ( in_array( $this->curr_tableField, array_keys( $this->pObj->objCal->arr_area ) ) )\n {\n case( true ):\n $this->bool_currFilterIsArea = true;\n break;\n case( false ):\n default:\n $this->bool_currFilterIsArea = false;\n break;\n }\n // Set class var $bool_currFilterIsArea\n // SWITCH current tableField is a filter with areas\n\n return;\n }", "public static function isBackEnd()\n {\n return parse_url(Url::to('@web'))['path'] === '/admin';\n }", "public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function isFrontendMode()\n {\n return TYPO3_MODE == 'FE';\n }", "public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }", "public static function canDisplayEstateAgentsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ESTATE_AGENT);\n\t}", "function userIsAreaAdmin() {\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->areaAdmin(Yawp::authUsername(), $this->area);\n\t}", "public function isAllowed()\n {\n if ($this->appState->getAreaCode() == self::AREA_BACKEND) {\n return false;\n }\n\n $userAgentList = $this->helperData->getUserAgentList();\n $userAgent = $this->geoipHelperHttp->getHttpUserAgent();\n if (!empty($userAgentList) && $userAgent) {\n foreach ($userAgentList as $agent) {\n $agent = str_replace(['*', '/'], ['.*', '\\/'], $agent);\n if (preg_match(\"/{$agent}$/i\", $userAgent)) {\n return false;\n }\n }\n }\n\n $request = $this->request;\n $exceptionUrls = $this->helperData->getExceptionUrls();\n if (!empty($exceptionUrls)) {\n $requestString = $request->getRequestString();\n foreach ($exceptionUrls as $url) {\n $url = str_replace('*', '.*?', $url);\n if (preg_match('!^' . $url . '$!i', $requestString)) {\n return false;\n }\n }\n }\n\n return true;\n }", "private function isFrontEndRequest() {\n\t\treturn ! \\is_admin();\n\t}", "public function hasMapareas(){\n return $this->_has(30);\n }", "protected function isFrontendMode() {\n\t\treturn TYPO3_MODE == 'FE';\n\t}", "public function hasAreaInUri(): bool;", "protected function isInAdministration()\n\t{\n\t\treturn (bool) $GLOBALS['tree']->isGrandChild(SYSTEM_FOLDER_ID,$this->getCurrentObject()->getRefId());\n\t}", "protected function is_sections_front_page() {\n\n\t\tif ( get_option( 'show_on_front' ) !== 'page' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$frontpage_id = get_option( 'page_on_front' );\n\n\t\tif ( empty( $frontpage_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->post_id !== $frontpage_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page_template = get_post_meta( $frontpage_id, '_wp_page_template', true );\n\t\tif ( ! empty( $page_template ) && 'default' !== $page_template ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$disabled_frontpage = get_theme_mod( 'disable_frontpage_sections', false );\n\t\tif ( true === (bool) $disabled_frontpage ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\n\t}", "public function is_primary_sidebar_active(): bool\n\t{\n\t\t$this->get_option = get_option('qreate-options');\n\n\n\t\tif (class_exists('ReduxFramework') && $this->get_option != '') {\n\t\t\tif (is_search()) {\n\t\t\t\t$option = $this->get_option['search_page'];\n\t\t\t} else {\n\t\t\t\t$option = is_single() ? $this->get_option['blog_single_page_setting'] : $this->get_option['blog_setting'];\n\t\t\t}\n\t\t\tif (in_array($option, [4, 5])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn (bool)is_active_sidebar(static::PRIMARY_SIDEBAR_SLUG);\n\t}", "abstract function is_agency();", "private function isHome(): bool\n {\n if (! $this->context->get('is_entry')) {\n return false;\n }\n\n if (! $this->context->get('page')) {\n return false;\n }\n\n return $this->context->get('parent') === null;\n }", "public function isNavbarOffcanvas()\r\n\t{\r\n\t\treturn $this->navbarOffcanvas;\r\n\t}", "private function _isFrontendCall()\n {\n $session_name = $this->session()->getName();\n if (!array_key_exists($session_name, $_COOKIE)) {\n return false;\n }\n\n if ($_COOKIE[$session_name] !== $this->session()->getId()) {\n return false;\n }\n\n return true;\n }", "public function getBackendAreas(): AreasCollection;", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public function canShowTab()\n {\n if ($this->_scopeConfig->getValue('brainacts_storelocator/item/separate_page')) {\n return true;\n }\n return false;\n }", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "private function is_dashboard_page() {\n\t\t\t$current_screen = \\get_current_screen();\n\n\t\t\tif (\n\t\t\t\t'dashboard_page_woocart-dashboard' !== $current_screen->id &&\n\t\t\t\t'dashboard_page_woocart-dashboard-network' !== $current_screen->id\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }", "protected function _isEnabled()\n {\n $area = $this->BRequest->area();\n\n if ($area == 'FCom_Frontend' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_frontend')) {\n return false;\n }\n\n if ($area == 'FCom_Admin' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_admin')) {\n return false;\n }\n\n $disabledViews = $this->Sellvana_CurrencyManager_Model_Manager->getConfig('disabled_in_views', null, []);\n $currentView = $this->_getCurrentView();\n\n return !($area == 'FCom_Frontend' && in_array($currentView, $disabledViews));\n }", "function tc_is_customizing() {\r\n //checks if is customizing : two contexts, admin and front (preview frame)\r\n global $pagenow;\r\n $is_customizing = false;\r\n if ( is_admin() && isset( $pagenow ) && 'customize.php' == $pagenow ) {\r\n $is_customizing = true;\r\n } else if ( ! is_admin() && isset($_REQUEST['wp_customize']) ) {\r\n $is_customizing = true;\r\n }\r\n return $is_customizing;\r\n }", "public function getIsNeedToDisplaySideBar()\n {\n return (bool) Mage::app()->getStore()->getConfig('checkout/sidebar/display');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }", "public static function canDisplayEstateAgentTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ESTATE_AGENT_TYPE);\n\t}", "public function isAdminBackend()\n {\n /* @var $owner Controller */\n $owner = $this->owner;\n $url = $owner->getRequest()->getURL();\n if (strpos($url, 'admin/') === 0) {\n return true;\n }\n if (strpos($url, 'dev/') === 0) {\n return true;\n }\n // Because keep-alive pings done through ajax could trigger requirements loading\n if (strpos($url, 'Security/ping') === 0) {\n return true;\n }\n if (\n $owner instanceof LeftAndMain ||\n $owner instanceof DevelopmentAdmin ||\n $owner instanceof DatabaseAdmin ||\n (class_exists('DevBuildController') && $owner instanceof DevBuildController)\n ) {\n return true;\n }\n\n return false;\n }", "function pageIsFrontend() {\n\t$path = basename(htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES));\n\t$file = basename($path,\".php\");\n\treturn $file == 'index';\n}", "public function isFrontendTierEnabled()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_TIER,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "private function is_editor() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t// A global admin can edit content or change options anywhere.\n\t\t\tif ( is_super_admin() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$user = wp_get_current_user();\n\n\t\t\t// On the WSUWP Platform, a network admin can edit content or change options\n\t\t\t// anywhere on an individual network and may not have a role assigned.\n\t\t\tif ( function_exists( 'wsuwp_is_network_admin' ) ) {\n\t\t\t\tif ( wsuwp_is_network_admin( $user->user_login ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Authors and above have (at least) the ability to publish content or delete\n\t\t\t// published content at some level.\n\t\t\t$allowed_roles = array( 'editor', 'administrator', 'author' );\n\t\t\tif ( array_intersect( $allowed_roles, $user->roles ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\n }", "public function canShowTab()\n {\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n\n if (isset($integrationData['integration_id']) &&\n isset($integrationData['endpoint']) &&\n (str_contains($integrationData['endpoint'], 'extend.com') &&\n str_contains($integrationData['endpoint'], 'integ-mage'))\n ) {\n return true;\n }\n }", "public function isSidebarFirstVisible()\n {\n return \\XLite::isAdminZone()\n ? $this->isAdminSidebarFirstVisible()\n : $this->isCustomerSidebarFirstVisible();\n }", "public function isActive() {\n return (($page = Mage::registry('splash_page')) !== null) && $page->getId() === $this->getId();\n }", "public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n $subscriberTypes = [];\n $subscriberCategory = '';\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n }\n\n if (empty($subscriberTypes)) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if (!$this->hookCollector->hasProvider($providerArea)) {\n continue;\n }\n\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n }\n\n return false;\n }", "protected function isAuthorizedFrontendSession() {}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dadolun_ThemeLayoutBlock::theme_layout_block');\n }", "public function supportsCourseOfferingHierarchyDesign() {\n \treturn $this->manager->supportsCourseOfferingHierarchyDesign();\n\t}", "public function isStockEnabledFrontend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "private function hasRequestedScopeAccess()\n {\n // allow specific store view scope\n $storeCode = $this->_request->getParam('store');\n if ($storeCode) {\n $store = $this->_storeManager->getStore($storeCode);\n if ($store) {\n if ($this->_role->hasStoreAccess($store->getId())) {\n return true;\n }\n }\n } elseif ($websiteCode = $this->_request->getParam('website')) {\n try {\n $website = $this->_storeManager->getWebsite($websiteCode);\n if ($website) {\n if ($this->_role->hasWebsiteAccess($website->getId(), true)) {\n return true;\n }\n }\n // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n // redirect later from non-existing website\n }\n }\n return false;\n }", "public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n } else {\n // @deprecated\n $subscriberEntities =\n $this->em->getRepository(Entity\\HookSubscriberEntity::class)\n ->findBy(['sareaid' => $subscriberArea]);\n $subscriberTypes = [];\n foreach ($subscriberEntities as $hookSubscriberEntity) {\n $subscriberTypes[] = $hookSubscriberEntity->getHooktype();\n $subscriberCategory = $hookSubscriberEntity->getCategory(); // will all be same\n }\n }\n\n if (!$subscriberTypes) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if ($this->hookCollector->hasProvider($providerArea)) {\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n } else {\n // @deprecated\n $hookProvider =\n $this->em->createQueryBuilder()->select('t')\n ->from(Entity\\HookProviderEntity::class, 't')\n ->where('t.pareaid = ?1 AND t.hooktype = ?2 AND t.category = ?3')\n ->setParameters([\n 1 => $providerArea,\n 2 => $subscriberType,\n 3 => $subscriberCategory\n ])\n ->getQuery()\n ->getArrayResult();\n\n if ($hookProvider) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function isRegion(){\n if($this->isBreaking_Region() || $this->isBreaking_Federal() || $this->isHF_Region() || $this->isHF_Federal() || $this->isFederal()){\n return true;\n }\n return $this->brki!=null && $this->brki->keyWord==\"Region\";\n }", "function is_sidebar_active( $index ){\r\n\t global $wp_registered_sidebars;\r\n\t \r\n\t $widgetcolums = wp_get_sidebars_widgets();\r\n\t \r\n\t if ($widgetcolums[$index]) return true;\r\n\t \r\n\t\treturn false;\r\n\t}", "public function is_admin_editor_page() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $pagenow, $wp_version;\n\t\t$allowed_pagenow_array = array( 'post.php', 'post-new.php', 'term.php', 'user-new.php', 'user-edit.php', 'profile.php' );\n\t\t$allowed_page_array = array( 'views-editor', 'ct-editor', 'view-archives-editor', 'dd_layouts_edit' );\n\t\t// @todo maybe add a filter here for future Toolset admin pages...\n\t\tif (\n\t\t\tin_array( $pagenow, $allowed_pagenow_array )\n\t\t\t|| (\n\t\t\t\t$pagenow == 'admin.php'\n\t\t\t\t&& isset( $_GET['page'] )\n\t\t\t\t&& in_array( $_GET['page'], $allowed_page_array )\n\t\t\t)\n\t\t\t|| (\n\t\t\t\t// In WordPress < 4.5, the edit tag admin page is edit-tags.php?action=edit&taxonomy=category&tag_ID=X\n\t\t\t\tversion_compare( $wp_version, '4.5', '<' )\n\t\t\t\t&& $pagenow == 'edit-tags.php'\n\t\t\t\t&& isset( $_GET['action'] )\n\t\t\t\t&& $_GET['action'] == 'edit'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasMain()\n\t{\n\t\treturn $this->OfParent($this->parent_type, $this->parent_id)->where('mainoffice', 1)->count() > 0;\n\t}", "function adventure_is_sidebar_active($index) {\r\n\tglobal $wp_registered_sidebars;\r\n\t$widgetcolums = wp_get_sidebars_widgets();\r\n\tif ($widgetcolums[$index]) {\r\n\t\treturn true; }\r\n\t\treturn false; }", "public function isAdmin() {\n\t\treturn ($this->getModule() != RublonMagentoModule::FRONT);\n\t}", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public static function checkPreconditions() {\n /**\n * @var $ilCtrl ilCtrl\n * @var $ilPluginAdmin ilPluginAdmin\n */\n global $ilCtrl, $ilPluginAdmin;\n $existCtrlMainMenu = $ilPluginAdmin->exists(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n $isActiveCtrlMainMenu = $ilPluginAdmin->isActive(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n //The ilRouterGUI is used in ILIAS <= 4.4\n $existRouterGUI = self::getBaseClass() != false;\n return ($existCtrlMainMenu && $isActiveCtrlMainMenu && $existRouterGUI);\n }", "protected function hasAccessControl() {\n $field_definitions = \\Drupal::service('entity_field.manager')\n ->getFieldDefinitions($this->entityTypeId, $this->bundle);\n\n if (Og::isGroup($this->entityTypeId, $this->bundle)) {\n return isset($field_definitions[OgAccess::OG_ACCESS_FIELD]);\n }\n\n if (Og::isGroupContent($this->entityTypeId, $this->bundle)) {\n return isset($field_definitions[OgAccess::OG_ACCESS_CONTENT_FIELD]);\n }\n\n return FALSE;\n }", "function is_sidebar_active( $index ){\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "function is_sidebar_active( $index ){\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}", "protected function isAdminStore()\n {\n return $this->getValue(ColumnKeys::STORE_VIEW_CODE) === null;\n }", "function is_elementor_editor() {\n\t\treturn is_admin() && ( isset( $_GET['action'] ) && sanitize_text_field( $_GET['action'] ) === 'elementor' );\n\t}", "public static function isGfActive()\n {\n return class_exists('RGForms');\n }", "public function supportsCourseOfferingAdmin() {\n \treturn $this->manager->supportsCourseOfferingAdmin();\n\t}", "public function ElementalAreaIfExists()\n {\n if ($this->owner->hasExtension(ElementalPageExtension::class)) {\n return $this->owner->ElementalArea();\n }\n return ElementalArea::create();\n }", "public static function Elementor_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'elementor/elementor.php', self::$active_plugins ) || array_key_exists( 'elementor/elementor.php', self::$active_plugins );\n }", "public function is_on_frontpage() {\n return ($this->page->pagelayout == 'frontpage');\n }", "public function isBackendContext() {}", "function get_allowed_block_template_part_areas()\n {\n }", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }", "protected function front_acf_active() {\n\t\t\treturn ( class_exists('acf') ) ? true : false;\n\t\t}", "public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }", "function is_sidebar_active( $index ) {\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "public function supportsCourseOfferingHierarchy() {\n \treturn $this->manager->supportsCourseOfferingHierarchy();\n\t}", "public static function isEnabled()\n {\n // Frontend editing needs to be enabled also by admins\n if (isset($GLOBALS['BE_USER']) && $GLOBALS['TSFE']->config['config']['tx_frontend_editing'] == 1) {\n return ($GLOBALS['BE_USER']->uc['tx_frontend_editing_enable'] == 1);\n }\n\n return false;\n }", "public function can_current_user_see_forum_association_fields() {\n\n\t\treturn current_user_can( 'manage_options' );\n\n\t}", "public function hasRegion() : bool;", "private static function lp_check_is_block_editor() {\n\n // Check if Guteberg plugin available.\n if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {\n return true;\n }\n\n $current_screen = get_current_screen();\n\n if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {\n return true;\n }\n\n return false;\n }", "protected static function isFrontendSession() {}", "public function isActive() {\n return $this->site->page()->is($this);\n }" ]
[ "0.7264344", "0.65700805", "0.6398109", "0.63687813", "0.618559", "0.61806226", "0.6110364", "0.6110364", "0.60622245", "0.6055879", "0.60200214", "0.595142", "0.5877826", "0.58299637", "0.5816312", "0.5805617", "0.5796868", "0.57897466", "0.57710737", "0.575129", "0.5743461", "0.56553525", "0.56487817", "0.56476456", "0.56398356", "0.56123763", "0.5603064", "0.5602145", "0.55947655", "0.5593116", "0.55802274", "0.55651027", "0.5550077", "0.5549083", "0.55444556", "0.5539693", "0.55270267", "0.545973", "0.5453928", "0.54491365", "0.54386246", "0.5436355", "0.54346335", "0.54079074", "0.54073596", "0.53797877", "0.53415155", "0.5334511", "0.5333543", "0.5304615", "0.5294326", "0.52911603", "0.5283383", "0.5274232", "0.5271383", "0.5255606", "0.52550125", "0.52364767", "0.5227195", "0.5220183", "0.52192473", "0.52164656", "0.5214679", "0.52074176", "0.5201988", "0.5195427", "0.5191697", "0.5186612", "0.5179677", "0.5179136", "0.51791066", "0.5176386", "0.5176301", "0.51742846", "0.5173625", "0.51691437", "0.5168899", "0.516241", "0.516241", "0.5151526", "0.5149895", "0.5148814", "0.5148535", "0.5144907", "0.5141332", "0.514126", "0.51376784", "0.5129845", "0.51295274", "0.5122651", "0.5119186", "0.5112519", "0.511043", "0.51096004", "0.51053756", "0.5103386", "0.5101219", "0.5097289", "0.5091027", "0.50846213" ]
0.79931414
0
Checks if the current area belongs to the Backend Areas.
Проверяет, принадлежит ли текущая область к областям бэкенда.
public function isBackendArea(): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFrontendArea(): bool;", "public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}", "public function isBackendContext() {}", "function is_tabber_tabs_area_active( $index ){\n global $wp_registered_sidebars;\n\n $widgetcolums = wp_get_sidebars_widgets();\n\t\t \n if ($widgetcolums[$index]) return true;\n \n\treturn false;\n}", "public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}", "public function isBackend();", "public function isAdminBackend()\n {\n /* @var $owner Controller */\n $owner = $this->owner;\n $url = $owner->getRequest()->getURL();\n if (strpos($url, 'admin/') === 0) {\n return true;\n }\n if (strpos($url, 'dev/') === 0) {\n return true;\n }\n // Because keep-alive pings done through ajax could trigger requirements loading\n if (strpos($url, 'Security/ping') === 0) {\n return true;\n }\n if (\n $owner instanceof LeftAndMain ||\n $owner instanceof DevelopmentAdmin ||\n $owner instanceof DatabaseAdmin ||\n (class_exists('DevBuildController') && $owner instanceof DevBuildController)\n ) {\n return true;\n }\n\n return false;\n }", "function biagiotti_mikado_is_header_widget_area_active( $area ) {\n\t\t\n\t\tif ( empty( $area ) || ! in_array( $area, array( 'one', 'two' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_' . $area . '_meta', true );\n\t\t$is_active = false;\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-' . $area ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $is_active;\n\t}", "public static function isBackEnd()\n {\n return parse_url(Url::to('@web'))['path'] === '/admin';\n }", "function userIsAreaAdmin() {\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->areaAdmin(Yawp::authUsername(), $this->area);\n\t}", "public function isEnvironmentInBackendMode() {}", "public function getBackendAreas(): AreasCollection;", "public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }", "public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }", "public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }", "public static function isAdminBackend()\n {\n return session_name() === 'eSIdAdm';\n }", "public function getIsBackend()\n {\n if ($this->_isBackend === null) {\n $this->_isBackend = strpos($this->controllerNamespace, 'backend') === false ? false : true;\n }\n\n return $this->_isBackend;\n }", "public function isBackendProtected() {\n return ($this->protection & BACKEND_PROTECTION) >= 1;\n }", "public function isAllowed()\n {\n if ($this->appState->getAreaCode() == self::AREA_BACKEND) {\n return false;\n }\n\n $userAgentList = $this->helperData->getUserAgentList();\n $userAgent = $this->geoipHelperHttp->getHttpUserAgent();\n if (!empty($userAgentList) && $userAgent) {\n foreach ($userAgentList as $agent) {\n $agent = str_replace(['*', '/'], ['.*', '\\/'], $agent);\n if (preg_match(\"/{$agent}$/i\", $userAgent)) {\n return false;\n }\n }\n }\n\n $request = $this->request;\n $exceptionUrls = $this->helperData->getExceptionUrls();\n if (!empty($exceptionUrls)) {\n $requestString = $request->getRequestString();\n foreach ($exceptionUrls as $url) {\n $url = str_replace('*', '.*?', $url);\n if (preg_match('!^' . $url . '$!i', $requestString)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }", "private function set_currFilterIsArea()\n {\n // 3.9.24, 120604, dwildt+\n if ( empty( $this->pObj->objCal->arr_area ) )\n {\n $this->bool_currFilterIsArea = false;\n return;\n }\n // 3.9.24, 120604, dwildt+\n // SWITCH current tableField is a filter with areas\n // Set class var $bool_currFilterIsArea\n switch ( in_array( $this->curr_tableField, array_keys( $this->pObj->objCal->arr_area ) ) )\n {\n case( true ):\n $this->bool_currFilterIsArea = true;\n break;\n case( false ):\n default:\n $this->bool_currFilterIsArea = false;\n break;\n }\n // Set class var $bool_currFilterIsArea\n // SWITCH current tableField is a filter with areas\n\n return;\n }", "public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}", "function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function isBackendActive():bool\n {\n return false;\n }", "public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n $subscriberTypes = [];\n $subscriberCategory = '';\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n }\n\n if (empty($subscriberTypes)) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if (!$this->hookCollector->hasProvider($providerArea)) {\n continue;\n }\n\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n } else {\n // @deprecated\n $subscriberEntities =\n $this->em->getRepository(Entity\\HookSubscriberEntity::class)\n ->findBy(['sareaid' => $subscriberArea]);\n $subscriberTypes = [];\n foreach ($subscriberEntities as $hookSubscriberEntity) {\n $subscriberTypes[] = $hookSubscriberEntity->getHooktype();\n $subscriberCategory = $hookSubscriberEntity->getCategory(); // will all be same\n }\n }\n\n if (!$subscriberTypes) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if ($this->hookCollector->hasProvider($providerArea)) {\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n } else {\n // @deprecated\n $hookProvider =\n $this->em->createQueryBuilder()->select('t')\n ->from(Entity\\HookProviderEntity::class, 't')\n ->where('t.pareaid = ?1 AND t.hooktype = ?2 AND t.category = ?3')\n ->setParameters([\n 1 => $providerArea,\n 2 => $subscriberType,\n 3 => $subscriberCategory\n ])\n ->getQuery()\n ->getArrayResult();\n\n if ($hookProvider) {\n return true;\n }\n }\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }", "public function hasAreaInUri(): bool;", "protected function inEffect() {\n $url = explode('/', ServerRequestFactory::fromGlobals()->getPath());\n\n // no backend config? abort\n if(!Configure::read('Backend'))\n return false;\n\n // not backend? abort\n if(!($url[1] === 'backend' || ($url[1] === 'unimatrix' && $url[2] === 'backend')))\n return false;\n\n // valid\n return true;\n }", "protected function isAuthorizedBackendSession() {}", "protected function isAuthorizedBackendSession() {}", "public function is_on_dashboard() {\n return ($this->page->pagelayout == 'mydashboard');\n }", "public function is_primary_sidebar_active(): bool\n\t{\n\t\t$this->get_option = get_option('qreate-options');\n\n\n\t\tif (class_exists('ReduxFramework') && $this->get_option != '') {\n\t\t\tif (is_search()) {\n\t\t\t\t$option = $this->get_option['search_page'];\n\t\t\t} else {\n\t\t\t\t$option = is_single() ? $this->get_option['blog_single_page_setting'] : $this->get_option['blog_setting'];\n\t\t\t}\n\t\t\tif (in_array($option, [4, 5])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn (bool)is_active_sidebar(static::PRIMARY_SIDEBAR_SLUG);\n\t}", "protected function isInAdministration()\n\t{\n\t\treturn (bool) $GLOBALS['tree']->isGrandChild(SYSTEM_FOLDER_ID,$this->getCurrentObject()->getRefId());\n\t}", "public function isBackendUserLoggedIn() {}", "function is_sidebar_active( $index ){\r\n\t global $wp_registered_sidebars;\r\n\t \r\n\t $widgetcolums = wp_get_sidebars_widgets();\r\n\t \r\n\t if ($widgetcolums[$index]) return true;\r\n\t \r\n\t\treturn false;\r\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Acx_BrandSlider::brandslider_brands');\n }", "function is_sidebar_active( $index ){\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "function is_sidebar_active( $index ){\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "function lalita_is_footer_bar_active() {\n\t\treturn ( is_active_sidebar( 'footer-bar' ) ) ? true : false;\n\t}", "public static function checkPreconditions() {\n /**\n * @var $ilCtrl ilCtrl\n * @var $ilPluginAdmin ilPluginAdmin\n */\n global $ilCtrl, $ilPluginAdmin;\n $existCtrlMainMenu = $ilPluginAdmin->exists(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n $isActiveCtrlMainMenu = $ilPluginAdmin->isActive(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n //The ilRouterGUI is used in ILIAS <= 4.4\n $existRouterGUI = self::getBaseClass() != false;\n return ($existCtrlMainMenu && $isActiveCtrlMainMenu && $existRouterGUI);\n }", "public function isHostBackend()\n {\n $backendUrl = $this->configInterface->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);\n $backendHost = parse_url(trim($backendUrl), PHP_URL_HOST);\n $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';\n return (strcasecmp($backendHost, $host) === 0);\n }", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }", "public static function StagCatalog_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'stag-catalog/stag-catalog.php', self::$active_plugins ) || array_key_exists( 'stag-catalog/stag-catalog.php', self::$active_plugins );\n }", "function is_sidebar_active( $index ) {\n\t global $wp_registered_sidebars;\n\n\t $widgetcolums = wp_get_sidebars_widgets();\n\n\t if ($widgetcolums[$index]) return true;\n\n\t return false;\n\t}", "public function getIsNeedToDisplaySideBar()\n {\n return (bool) Mage::app()->getStore()->getConfig('checkout/sidebar/display');\n }", "function adventure_is_sidebar_active($index) {\r\n\tglobal $wp_registered_sidebars;\r\n\t$widgetcolums = wp_get_sidebars_widgets();\r\n\tif ($widgetcolums[$index]) {\r\n\t\treturn true; }\r\n\t\treturn false; }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dadolun_ThemeLayoutBlock::theme_layout_block');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "public static function isFrontEnd()\n {\n return parse_url(Url::to('@web'))['path'] !== '/admin';\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('HiPay_FullserviceMagento::hipay_split_payment');\n }", "public function isAheadworksCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('AW_Onestepcheckout');\n }", "public function isStockEnabledBackend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_BACKEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "protected function isAdminStore()\n {\n return $this->getValue(ColumnKeys::STORE_VIEW_CODE) === null;\n }", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "protected function _isEnabled()\n {\n $area = $this->BRequest->area();\n\n if ($area == 'FCom_Frontend' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_frontend')) {\n return false;\n }\n\n if ($area == 'FCom_Admin' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_admin')) {\n return false;\n }\n\n $disabledViews = $this->Sellvana_CurrencyManager_Model_Manager->getConfig('disabled_in_views', null, []);\n $currentView = $this->_getCurrentView();\n\n return !($area == 'FCom_Frontend' && in_array($currentView, $disabledViews));\n }", "protected static function isBackendSession() {}", "public static function Elementor_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'elementor/elementor.php', self::$active_plugins ) || array_key_exists( 'elementor/elementor.php', self::$active_plugins );\n }", "public function is_panel_active()\n {\n }", "public function isCatalogBackendManageStockVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MANAGE_STOCK);\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_kst/ifeedback');\n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function checkIfLoginAllowedInBranch() {}", "public function canShowTab()\n {\n if ($this->_scopeConfig->getValue('brainacts_storelocator/item/separate_page')) {\n return true;\n }\n return false;\n }", "public function isCatalogBackendBackordersVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_BACKORDERS);\n }", "public function is_frontend_editor_page() {\n\t\tif ( is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\t// Layouts frontend editor\n\t\t\tisset( $_GET['toolset_editor'] )\n\t\t\t// Beaver Builder frontend editor\n\t\t\t|| isset( $_GET['fl_builder'] )\n\t\t\t// CRED frontend editor pages, when discoverable\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private static function backendSearchActive()\n {\n //Backend search active\n $backendSearchActive = apply_Filters('AlgoliaIndex/BackendSearchActive', true);\n\n //Query algolia for search result\n if ($backendSearchActive || is_post_type_archive()) {\n return true;\n }\n\n return false;\n }", "public function isRegion(){\n if($this->isBreaking_Region() || $this->isBreaking_Federal() || $this->isHF_Region() || $this->isHF_Federal() || $this->isFederal()){\n return true;\n }\n return $this->brki!=null && $this->brki->keyWord==\"Region\";\n }", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "protected function isFrontendEditActive() {}", "protected function isFrontendEditActive() {}", "public function canShowTab()\n {\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n\n if (isset($integrationData['integration_id']) &&\n isset($integrationData['endpoint']) &&\n (str_contains($integrationData['endpoint'], 'extend.com') &&\n str_contains($integrationData['endpoint'], 'integ-mage'))\n ) {\n return true;\n }\n }", "function cinerama_edge_dashboard_page() {\n\t\treturn is_page_template('user-dashboard.php');\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('drugento_countryorder/country');\n }", "public function authorize()\n {\n $admin = Auth::user();\n\n if( $admin->isBranchAdmin() ){\n return false;\n }\n\n if( $admin->church_id != $this->church_id){\n return false;\n }\n\n return true;\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public static function Wpml_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins ) || array_key_exists( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins );\n }", "public function isAllowed(): bool\n {\n foreach ($this->rights as $rights) {\n [$module, $action] = explode('/', $rights);\n\n // check action rights\n if ($module !== '' && $action !== '' && !BackendAuthentication::isAllowedAction($action, $module)) {\n return false;\n }\n }\n\n return true;\n }", "public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }", "public function isScopeStore()\n {\n return !$this->isScopeGlobal() && !$this->isScopeWebsite();\n }", "public function supportsCourseOfferingAdmin() {\n \treturn $this->manager->supportsCourseOfferingAdmin();\n\t}", "public static function isParentStoreLoggedIn() {\n $storeId = Auth::user()->id;\n $subStoreModel = new \\App\\SubStoreDetails();\n $storeSubStores = $subStoreModel->getStoreSubStores($storeId);\n if (!empty($storeSubStores)) {\n return true;\n }\n return false;\n }", "private function is_dashboard_page() {\n\t\t\t$current_screen = \\get_current_screen();\n\n\t\t\tif (\n\t\t\t\t'dashboard_page_woocart-dashboard' !== $current_screen->id &&\n\t\t\t\t'dashboard_page_woocart-dashboard-network' !== $current_screen->id\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function is_outlet()\n {\n return $this->testFlag('Outlet');\n }", "public function canAccessDashboard()\n {\n return $this->isAdmin();\n }", "static function hasCurrent() {\n\t\treturn is_object(self::$_ctrl);\n\t}", "function get_allowed_block_template_part_areas()\n {\n }", "function comicpress_is_active_sidebar( $index ) {\n\tglobal $wp_registered_sidebars, $_wp_sidebars_widgets;\n\tif ( is_int($index) ) {\n\t\tif (!empty($_wp_sidebars_widgets[sanitize_title(\"sidebar-$index\")]) )\n\t\t\treturn true;\n\t} else {\n\t\t$i = 1;\n\t\tforeach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {\n\t\t\tif ( $index == $registered_sidebar['name'] && !empty($_wp_sidebars_widgets[sanitize_title(\"sidebar-$i\")]) )\n\t\t\t\treturn true;\n\t\t\t$i++;\n\t\t}\n\t}\n\treturn false;\n}", "public function isBusiness()\n {\n return $this -> name == config('constant.categorytype.business_id');\n }", "public function hasAdministrativeDatabases() {\n return $this->_has(9);\n }", "public function isAdmin() {\n\t\treturn ($this->getModule() != RublonMagentoModule::FRONT);\n\t}", "public function isAllowedBranch(){\r\n\t\t// checker\r\n\t\t$check = false;\r\n\t\t// check if the payload with ref exists\r\n\t\tif (isset($this->payload->ref) && strpos($this->payload->ref, GIT_BRANCH)) {\r\n\t\t\t$check = true;\r\n\t\t}\r\n\t\t// return the checker\r\n\t\treturn $check;\r\n\t}", "protected function is_types_active() {\n\t\treturn class_exists( 'Types_Main' );\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_MpAuction::auc_auto_bid_delete');\n }", "abstract function is_agency();", "public function hasCurrentManagers()\n {\n return $this->currentManagers->isNotEmpty();\n }" ]
[ "0.7092595", "0.6393919", "0.63526136", "0.62928677", "0.6259223", "0.6258937", "0.62406784", "0.6200967", "0.6059259", "0.60461396", "0.60113114", "0.5998781", "0.59457684", "0.59419745", "0.592258", "0.5914644", "0.58738714", "0.58577", "0.58510315", "0.58357435", "0.58194125", "0.5815955", "0.5800219", "0.5741587", "0.5732603", "0.5720405", "0.57201123", "0.57123756", "0.5685248", "0.5656048", "0.5646414", "0.5577473", "0.5577473", "0.55724186", "0.55650985", "0.5512156", "0.5505299", "0.54959565", "0.5487227", "0.54866165", "0.54866165", "0.54818267", "0.54764336", "0.54583186", "0.5446926", "0.54447794", "0.54378945", "0.5435757", "0.5414028", "0.5408279", "0.54027754", "0.5402399", "0.5390447", "0.5385654", "0.5383013", "0.53614354", "0.5331775", "0.5318558", "0.5301715", "0.52988243", "0.5294558", "0.5288607", "0.528823", "0.5287889", "0.52765775", "0.52756625", "0.52607226", "0.52566415", "0.5251683", "0.52432525", "0.52422327", "0.5238148", "0.5236427", "0.5233353", "0.5233353", "0.52310765", "0.52310574", "0.5223977", "0.522329", "0.5223084", "0.52031", "0.5189613", "0.5188138", "0.5187965", "0.5183271", "0.51671463", "0.51582575", "0.5157354", "0.51444376", "0.5142478", "0.5142378", "0.5140111", "0.5133082", "0.51217484", "0.51168865", "0.5112627", "0.510971", "0.5107343", "0.5106584", "0.5105592" ]
0.8198973
0
Returns a collection with areas.
Возвращает коллекцию с областями.
public function getAreas(): AreasCollection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFrontendAreas(): AreasCollection;", "public function getBackendAreas(): AreasCollection;", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }", "public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "function get_duo_areas() {\n \t\n }", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}", "public function getCollection() ;", "private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }", "public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }", "public function selectallAreas()\n {\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Area ORDER BY Position ASC \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public static function collection()\n {\n $jsoLoader = new JsonLoader(new ISO3166CountryFactory());\n\n return new Collection($jsoLoader->load(__DIR__.'/../data/iso3166.json'));\n }", "public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public function asCollection();", "public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }", "protected function makeResourcesCollection()\n {\n return collect($this->load())->map(function ($item, $key) {\n $item['slug'] = $key;\n\n $item['name'] = Str::studly($key);\n\n $item['is_global'] = (isset($item['is_global']) && $item['is_global']);\n\n return $item;\n });\n }", "public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }", "public function getBlocks(): Collection;", "public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "public function index(Request $request)\n {\n $areones = AreaOne::all();\n // cache()->remember('areaones',99999, function () use ($areones) {\n // });\n // return cache()->get('areaones');\n return new AreaOneCollection($areones);\n }", "public function index()\n {\n return TareaResource::collection(Tarea::with('categorias')->get());\n }", "public function areas($ids)\n {\n return $this->filter_relation('street.area', $ids);\n }", "function getArea(){}", "private function ts_getAreas()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // #41811, dwildt, 1+\n $currHitsSum = $this->hits_sum[ $this->curr_tableField ];\n\n // Get TS configuration of the current filter / tableField\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get areas from TS\n // SWITCH area key\n switch ( $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] )\n {\n case ('strings') :\n $arr_result = $this->pObj->objCal->area_strings( $conf_array, null, $this->curr_tableField );\n break;\n case ('interval') :\n $arr_result = $this->pObj->objCal->area_interval( $conf_array, null, $this->curr_tableField );\n break;\n// case ('from_to_fields') :\n// break;\n default:\n // DRS - Development Reporting System\n if ( $this->pObj->b_drs_error )\n {\n $prompt = 'undefined value in switch: ' .\n '\\'' . $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] . '\\'.';\n t3lib_div :: devLog( '[ERROR/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'Areas won\\'t handled!';\n t3lib_div :: devLog( '[WARN/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS - Development Reporting System\n return;\n }\n // SWITCH area key\n $areas = $arr_result[ 'data' ][ 'values' ];\n unset( $arr_result );\n // Get areas from TS\n // #41811, dwildt, 1+\n $this->hits_sum[ $this->curr_tableField ] = $currHitsSum;\n\n // DRS\n if ( $this->pObj->b_drs_cal || $this->pObj->b_drs_filter )\n {\n $arr_prompt = null;\n foreach ( ( array ) $areas as $key => $value )\n {\n $arr_prompt[] = '[' . $key . '] = ' . $value;\n }\n $prompt = 'values are: ' . implode( ', ', ( array ) $arr_prompt );\n t3lib_div :: devLog( '[INFO/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN areas\n return $areas;\n }", "public function getAll()\n\t{\n\t\treturn new Collection($this->items);\n\t}", "public function ajaxAreas()\n {\n $lineId = Input::get('lineId');\n $areas = Area::where('line_id', $lineId)->lists('name', 'id');\n return Response::json($areas); \n }", "public function index()\n {\n\n $totalAreas = Area::count();\n\n return view('catalogos.areas.index')->with(compact('totalAreas'));\n }", "public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }", "private function create_collection() {\n\n\t\treturn new MapCollection();\n\t}", "public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }", "public function index()\n {\n //返回集合\n return new ContinentCollection(Continent::paginate(null));\n }", "public function area()\n {\n return $this->belongsTo('App\\Models\\Area', 'area_id', 'id');\n }", "public function collection()\n {\n return collect($this->all());\n }", "public function index()\n {\n $title = \"All Area Picket\";\n $areas = $this->repository->getAll();\n return view('areas.index', compact('title', 'areas'));\n }", "public function index()\n {\n $areas = Area::all();\n return view ('config.areas.index', compact('areas'));\n }", "public function &onGroupAreas()\n\t{\n\t\t$area = array(\n\t\t\t'name' => $this->_name,\n\t\t\t'title' => Lang::txt('PLG_GROUPS_ACTIVITY'),\n\t\t\t'default_access' => $this->params->get('plugin_access', 'members'),\n\t\t\t'display_menu_tab' => $this->params->get('display_tab', 1),\n\t\t\t'icon' => 'f056'\n\t\t);\n\t\treturn $area;\n\t}", "public function index()\n {\n //$sub_area = Sub_area::all();\n //Listar relaciones con foreach EagerLoading\n $sub_area = Sub_area::with('areas')->get();\n //dd($area = $sub_area->areas());\n\n return view('sub_area.index',['sub_area' => $sub_area]);\n }", "public function index()\n {\n $contentAreas = Content_Area::all();\n\n return view('content_areas.index', compact('contentAreas'));\n }", "public function toArray()\n {\n $locations = $this->getFilterableQuery()\n ->where('speed', '<=', measurer()->transformKilometersToMeters($this->parameters['max']))\n ->where('speed', '>=', measurer()->transformKilometersToMeters($this->parameters['min']))\n ->get();\n\n return new LocationCollection($locations);\n }", "public static function retrieveAll(){\n\n $myDataAccess = aContentAreaDataAccess::getInstance();\n\n $myDataAccess->connectToDB();\n\n $myDataAccess->selectDivs();\n\n $numberOfRecords = 0;\n\n while($row = $myDataAccess->fetchDivs())\n {\n $currentDiv = new self(\n $myDataAccess->fetchAlias($row),\n //$myDataAccess->fetchCreated($row),\n //$myDataAccess->fetchCreatedBy($row),\n $myDataAccess->fetchDescription($row),\n $myDataAccess->fetchDivId($row),\n $myDataAccess->fetchDivOrder($row),\n //$myDataAccess->fetchLastModified($row),\n //$myDataAccess->fetchModifiedBy($row),\n $myDataAccess->fetchName($row)\n );\n\n $arrayOfDivs[] = $currentDiv;\n\n }\n\n $myDataAccess->closeDB();\n\n return $arrayOfDivs;\n }", "protected function _prepareCollection()\n {\n /* @var $collection Belvg_Storelocator_Model_Resource_Location_Collection */\n $collection = Mage::getModel('storelocator/location')->getResourceCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function all(): Collection;", "public function all(): Collection;", "public function all(): Collection;", "public function all(): Collection;", "public static function getFilteredArea($area_id)\n {\n\n $areas = DB::table('areas')->where('id', '<>', $area_id)->get();\n\n return $areas;\n }", "public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }", "public function index()\n {\n if(!auth()->user()->can('ver areas'))\n return response ()->view ('errors.403');\n $areas = Areas::all();\n return view('RRHH/areas', compact('areas',$areas));\n }", "public function getAllCollection() \n\n\t{\n\n\t\treturn $this->db->get('tb_collection')->result_array();\n\t}", "public function getCities(): Collection\n {\n return $this->cities;\n }", "public function getAreas(?int $parent_area_id = null)\n {\n $data = $this->request('areas', [\n 'parent_area_id' => $parent_area_id\n ]);\n\n $areas = [];\n foreach (ArrayHelper::getValue($data, 'areas', []) as $area) {\n $model = new Area();\n $model->setAttributes($area);\n $areas = $model;\n }\n\n return $areas;\n }", "public function getall()\r\n {\r\n $locations = array();\r\n $count = 0;\r\n \r\n foreach($this->all() as $location)\r\n {\r\n $location = (array)$location;\r\n \r\n $locations[] = array('id' => $location['id'], 'name' => $location['name'],\r\n 'caption' => $location['caption'], 'description' => $location['description'],\r\n 'address' => $location['address'],\r\n 'contact' => $location['contact'],\r\n 'image1' => $location['image1'], 'image2' => $location['image2'],\r\n 'image3' => $location['image3'], 'image4' => $location['image4']);\r\n $count++;\r\n \r\n }\r\n \r\n if ($count > 0)\r\n {\r\n return $locations;\r\n }\r\n else\r\n {\r\n return null;\r\n } \r\n }", "public function testReturnsRegionsFromCollection()\n {\n $data = [\n ['region_name' => 'test1'],\n ['region_name' => 'test2']\n ];\n $regions = ['test1', 'test2'];\n\n $collectionLocationsMock = $this->getResourceModelMock('oggetto_geodetection/location_collection', [\n 'selectRegions', 'filterByCountryCode', 'getData'\n ]);\n\n $collectionLocationsMock->expects($this->once())\n ->method('selectRegions')\n ->willReturnSelf();\n\n $collectionLocationsMock->expects($this->never())\n ->method('filterByCountryCode');\n\n $collectionLocationsMock->expects($this->once())\n ->method('getData')\n ->willReturn($data);\n\n $this->replaceByMock('resource_model', 'oggetto_geodetection/location_collection', $collectionLocationsMock);\n\n $this->assertEquals($regions, $this->_model->getRegions());\n }", "public function getRanges(): UnitRangesCollection;", "public function index()\n {\n /*$datos['areas'] = Area::paginate(10);\n return view('area.index', $datos);*/\n $areas = Area::paginate(10);\n return view('area.index', compact('areas'));\n }", "public function getCollection(): array\n {\n return $this->collection;\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function getCollection() {\n return $this->gateway->find(\n $this->getFilter(),\n $this->order,\n $this->relations,\n $this->pager,\n !$this->excludeRepo\n );\n }", "public function testReturnsRegionsAndCitiesFromCollection()\n {\n $data = [\n [\n 'region_name' => 'test1',\n 'city_name' => 'testC1'\n ],\n [\n 'region_name' => 'test2',\n 'city_name' => 'testC3'\n ],\n [\n 'region_name' => 'test1',\n 'city_name' => 'testC2'\n ],\n ];\n $regionsAndCities = [\n 'test1' => ['testC1', 'testC2'],\n 'test2' => ['testC3']\n ];\n\n $collectionLocationsMock = $this->getResourceModelMock('oggetto_geodetection/location_collection', [\n 'selectRegionsAndCities', 'filterByCountryCode',\n 'groupByRegionAndCity', 'orderRegionNameAndByIpCount',\n 'getData'\n ]);\n\n $collectionLocationsMock->expects($this->once())\n ->method('selectRegionsAndCities')\n ->willReturnSelf();\n\n $collectionLocationsMock->expects($this->never())\n ->method('filterByCountryCode');\n\n $collectionLocationsMock->expects($this->once())\n ->method('groupByRegionAndCity')\n ->willReturnSelf();\n\n $collectionLocationsMock->expects($this->once())\n ->method('orderRegionNameAndByIpCount')\n ->willReturnSelf();\n\n $collectionLocationsMock->expects($this->once())\n ->method('getData')\n ->willReturn($data);\n\n $this->replaceByMock('resource_model', 'oggetto_geodetection/location_collection', $collectionLocationsMock);\n\n $this->assertEquals($regionsAndCities, $this->_model->getRegionsAndCities());\n }", "public function all()\n {\n return $this->resource::collection(\n $this->repository->all()\n );\n }", "abstract protected function getArea();", "public function all(): Collection\n {\n }", "public function collections()\n {\n return $this->morphToMany(Collection::class, 'collectionable');\n }", "public function index()\n {\n return new GroupCollection(Group::all());\n }", "protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }", "public function regions()\n {\n return $this->hasManyThrough(FirmLocation::class, CandidateLocation::class, 'candidate_id', 'id', 'id' , 'location_id');\n }", "public function area($values)\n {\n return $this->range_filter('area', $values);\n }", "public function getViewArea() {}", "public function getAll() : Collection;", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "function area($a,$b,$c){\r\n\t\t$fArea= new fachada_area();\r\n\t\t$oArea=$fArea->area($a,$b,$c);\r\n\t\treturn $oArea;\r\n\t}", "public function get_collections ()\n {\n $array = [];\n\n if(empty($this->collections))\n {\n return null;\n }\n\n foreach($this->collections as $collection)\n {\n $object = new stdClass();\n $object->custom_collection = $collection;\n\n $array[] = \\SACollection::forge(['data' => $object]);\n }\n\n return $array;\n }", "public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }", "protected function grid()\n\t{\n\t\t$grid = new Grid(new NativePlaceRegion);\n\t $grid->model()->where('parentid', '=', 0);\n\t\t$grid->paginate(40);\n\t\t\n\t\t$grid->region_id('地区id')->sortable();\n\t\t$grid->parentid('上级地区id')->sortable();\n\t\t$grid->region_name('地区名称');\n\t\t$grid->have_children('是否有更下级地区');\n\t\t\n\t\t// filter($callback)方法用来设置表格的简单搜索框\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\t\t\t$filter->like('region_name', '地区名称');\n\t\t});\n\t\t\n\t\treturn $grid;\n\t}", "public function index(): AnonymousResourceCollection\n {\n return ElectionResource::collection(Election::orderBy('election_date', 'desc')->paginate(4));\n }", "public function index()\n {\n return IslandGroupResource::collection(IslandGroup::all());\n }", "public static function getAreasById($id) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select * from area where idArea = $id\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "public function collection()\n {\n return collect($this->toArray());\n }", "public function index()\n {\n $categories = Category::all();\n $categories->each(function ($categories) {\n $categories->entity;\n });\n return new CategoryCollection($categories);\n }", "private function areas_toRows()\n {\n // RETURN filter hasn't areas\n if ( !$this->bool_currFilterIsArea )\n {\n return;\n }\n // RETURN filter hasn't areas\n // Get areas from TS\n $areas = $this->ts_getAreas();\n // Convert areas to rows\n $rows = $this->areas_toRowsConverter( $areas );\n $this->rowsFromAreaWoHits = $rows;\n\n // Count the hits for each area row\n $rows = $this->areas_countHits( $rows );\n // Remove area rows without hits, if it's needed\n $rows = $this->areas_wiHitsOnly( $rows );\n\n // Override class var rows\n $this->rows = $rows;\n\n return;\n }", "public function get_widget_areas() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( ! empty( $this->widget_areas ) ) {\n\t\t\t\treturn $this->widget_areas;\n\t\t\t}\n\n\t\t\t// Get widget areas saved in theem mod\n\t\t\t$widget_areas = wprt_get_mod( 'widget_areas' );\n\n\t\t\t// If theme mod isn't empty set to class widget area var\n\t\t\tif ( ! empty( $widget_areas ) && is_array( $widget_areas ) ) {\n\t\t\t\t$this->widget_areas = array_unique( array_merge( $this->widget_areas, $widget_areas ) );\n\t\t\t}\n\n\t\t\t// Return widget areas\n\t\t\treturn $this->widget_areas;\n\t\t}", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "public function index()\n {\n $areas = DB::table('areas')->get();\n\n return view('admin.areas.index', [ 'areas' => $areas]);\n }", "public function getCollection()\r\n {\r\n return $this->collection;\r\n }", "public function getCollection()\n {\n return $this->collection;\n }", "public function getCollection() {\n return $this->collection;\n }", "public function getCollection()\n {\n\n $State = State::select('tbl_state.*');\n return $State->get();\n }", "public function getAreaRegion()\n {\n return $this->area_region;\n }", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function regions()\n {\n return $this->hasMany('App\\SelectedRegion');\n }" ]
[ "0.79317886", "0.7533631", "0.7391379", "0.67795515", "0.6763452", "0.6625361", "0.65923315", "0.6533913", "0.6423929", "0.6423929", "0.6423929", "0.6423929", "0.6415804", "0.6271613", "0.62576985", "0.62463355", "0.61914504", "0.6172695", "0.61725247", "0.6172076", "0.6145999", "0.6023834", "0.60089433", "0.5999341", "0.5919236", "0.59058374", "0.5884907", "0.588208", "0.5878706", "0.5869764", "0.5867952", "0.58325016", "0.5823404", "0.58104193", "0.58101517", "0.58079803", "0.578336", "0.5749505", "0.5741541", "0.5740281", "0.57388896", "0.57371825", "0.5727215", "0.5707565", "0.5701345", "0.5700934", "0.56833357", "0.5663149", "0.56535727", "0.5622184", "0.56184936", "0.56138617", "0.56138617", "0.56138617", "0.56138617", "0.560243", "0.560161", "0.56000847", "0.55911213", "0.5565784", "0.5564116", "0.55617183", "0.55604243", "0.5559735", "0.5549732", "0.55455476", "0.55454284", "0.5543367", "0.554302", "0.55327845", "0.5529893", "0.55269307", "0.55207986", "0.5516563", "0.55108017", "0.5509482", "0.55083245", "0.5492237", "0.5490931", "0.54901844", "0.54881614", "0.5485043", "0.54849803", "0.5478729", "0.54739916", "0.54730815", "0.5470471", "0.5467988", "0.54580927", "0.54548395", "0.54535127", "0.5451226", "0.5446216", "0.5444171", "0.5443427", "0.5437201", "0.5427466", "0.54226255", "0.54164785", "0.5414906" ]
0.86310095
0
Returns an area object based on ID. Default area returns if not found the desired one.
Возвращает объект области на основе ID. Если не найдена нужная область, возвращается объект по умолчанию.
public function getByIdOrDefault(string $id): AreaContract;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function particulararea($id)\n\t{\n\t\t$getarea=\"SELECT * from area where id = $id\";\n\t\t$ggetareadata = $this->get_results( $getarea );\n\t\treturn $ggetareadata;\n\t}", "public function getArea($area_id) {\n $query = $this->db->query(\"SELECT a.area_id,a.code,a.status,a.name,c.city_id,z.zone_id,coun.country_id FROM \" . DB_PREFIX . \"area a LEFT JOIN \" . DB_PREFIX . \"city c on (c.city_id=a.city_id) LEFT JOIN \" . DB_PREFIX . \"zone z on (z.zone_id=c.zone_id) LEFT JOIN \" . DB_PREFIX . \"country coun on (coun.country_id=z.country_id) WHERE area_id = '\" . (int) $area_id . \"'\");\n\n return $query->row;\n }", "public function getArea($areaId) {\n $methods = array(\"areas\", $areaId);\n return $this->get($methods);\n }", "public function getArea($areaId = -1) {\r\r\n //check $areaId is numeric\r\n if (!is_numeric($areaId) || ($areaId == -1) ){\r\n\t\t\t\techo 'Only numeric parameters.';\r\n\t\t\t\texit;\r\r\n }\r\r\n\r\n $select = $this->select()->where(\"area_code = ?\",$areaId);\r\t\t\r\n $result = $this->_db->fetchRow($select);\t\r\n return ($result == false) ? false : $result = $result;\t\r\r\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public function getAreaId()\n {\n return $this->area;\n }", "public function getAreaID() {\n return $this->get(self::AREAID);\n }", "public function edit($id)\n {\n $areaone = AreaOne::find($id);\n return new ResourcesAreaOne($areaone);\n }", "public function getIdArea() {\n return $this->_id; \n }", "public function getAreaId()\n {\n return $this->areaId;\n }", "public function show($id)\n {\n $area = Area::findOrFail($id);\n return response()->json($area);\n }", "public function getCurrentArea(): AreaContract;", "public static function getAreaId($id)\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM areas WHERE id_area = ?\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($id));\n // Capturar primera fila del resultado\n $row = $comando->fetch(PDO::FETCH_ASSOC);\n return $row;\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "public static function getAreasById($id) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select * from area where idArea = $id\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "public function getcity_area($id)\n {\n $data = $this->addcity->with(['Area'])->find($id);\n //dd($data);\n return $data;\n }", "public function show($id)\n {\n $area = Area::where('status', 'a')->find($id); \n \n return response()->json($area, 200);\n }", "public function getDefault(): AreaContract;", "public function getPlaceByID( $id );", "public function get_area($id=0){\n $areas = Area::where('city_id', $id)->orderBy('name', 'asc')->get();\n $output = '';\n if(count($areas)>0){\n $output .= '<option value=\"\">Select area</option>';\n foreach($areas as $area){\n $output .='<option '. (Session::get('area') == $area->id ? \"selected\" : \"\" ).' value=\"'.$area->id.'\">'.$area->name.'</option>';\n }\n }\n echo $output;\n }", "function getArea(){}", "public function show($id)\n {\n $area = Area::findOrFail($id);\n\n return view('area.show', compact('area'));\n }", "public function area()\n {\n return $this->belongsTo('App\\Models\\Area', 'area_id', 'id');\n }", "public function edit($id)\n { \n $area = Areas::FindOrFail($id);\n return response()->json($area);\n }", "public function show($id)\n {\n $subareas = subarea::findOrFale($id);\n\n if ($subareas) {\n return response($subareas,200);\n }\n return response($id,404);\n }", "public static function getRecAreaByRecAreaId(\\PDO $pdo, $recAreaId): ?recArea {\n\t\ttry {\n\t\t\t$recAreaId = self::validateUuid($recAreaId);\n\t\t} catch(\\InvalidArgumentException | \\RangeException | \\Exception | \\TypeError $exception) {\n\t\t\tthrow(new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t// creating query template\n\t\t$query = \"SELECT recAreaId,recAreaDescription,recAreaDirections, recAreaImageUrl,recAreaLat,recAreaLong,recAreaMapUrl,recAreaName FROM recArea WHERE recAreaId = :recAreaId\";\n\t\t$statement = $pdo->prepare($query);\n\t\t//binding the recAreaId to the placeholders in the template\n\t\t$parameters = [\"recAreaId\" => $recAreaId->getBytes()];\n\t\t$statement->execute($parameters);\n\t\t//retrieve the recArea from mySQL\n\t\ttry {\n\t\t\t$recArea = null;\n\t\t\t$statement->setFetchMode(\\PDO::FETCH_ASSOC);\n\t\t\t$row = $statement->fetch();\n\t\t\tif($row !== false) {\n\t\t\t\t$recArea = new RecArea($row[\"recAreaId\"], $row[\"recAreaDescription\"], $row[\"recAreaDirections\"], $row[\"recAreaImageUrl\"], $row[\"recAreaLat\"], $row[\"recAreaLong\"], $row[\"recAreaMapUrl\"], $row[\"recAreaName\"]);\n\t\t\t}\n\t\t} catch(\\Exception $exception) {\n\t\t\t//if the new row cannot be converted, throw it again\n\t\t\tthrow (new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t}\n\t\treturn ($recArea);\n\t}", "public function obtener($id)\n {\n $this->db->join('Usuarios','Usuarios.u_id=Areas.a_director');\n $this->db->where('a_id',(int)$id);\n return $this->db->get('Areas')->row();\n }", "public static function getFilteredArea($area_id)\n {\n\n $areas = DB::table('areas')->where('id', '<>', $area_id)->get();\n\n return $areas;\n }", "public function ElementalAreaIfExists()\n {\n if ($this->owner->hasExtension(ElementalPageExtension::class)) {\n return $this->owner->ElementalArea();\n }\n return ElementalArea::create();\n }", "public static function getAreaByName($name) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select MAX(idArea) as idArea from area where nameArea like '$name'\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "abstract protected function getArea();", "public static function LocatedAtID($id) {\n return static::where(compact('id'))->firstOrFail();\n }", "public function loadLocation($id): LocationInterface;", "public function getByCode($areaId) {\r\r\n\t\t$select = $this->_db->select()\r\n\t\t\t\t\t\t->from(array('area' => 'area'))\r\n\t\t\t\t\t\t->joinLeft(array('p' => 'area'), 'p.area_code = area.parent_area_code', array('p.area_code as parent_code', 'p.area_name as parent_name'))\t\t\t\t\t\t\r\n\t\t\t\t\t\t->where('area.area_code = ?', $areaId);\r\r\n\t $result = $this->_db->fetchRow($select);\t\r\n return ($result == false) ? false : $result = $result;\t\t\r\r\n\r\r\n\t}", "function DatosArea($idArea) {\n\t\t\t$sql=\"SELECT a.id_claveArea, a.nomArea, e.id_claveEdi \n\t\t\t\t FROM area a \n\t\t\t\t INNER JOIN edificio e \n\t\t\t\t ON a.id_claveArea=e.id_claveEdi \n\t\t\t\t WHERE a.id_claveArea=e.id_claveEdi\";\n\t\t\t$result=$this->db->query($sql)->execute();\n\t\t\treturn $result->current();\n\t\t}", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SystemAdministracionBundle:Area')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Area entity.');\n }\n\n return $this->render('SystemAdministracionBundle:Area:show.html.twig', array(\n 'entity' => $entity));\n }", "public function loadModel($id)\n {\n $model = Area::model()->findByPk($id);\n if ($model === null) {\n Yii::app()->user->setNotification('error','Acceso denegado');\n $this->redirect(array('/'));\n //throw new CHttpException(404, 'The requested page does not exist.');\n }\n $areas_por_proyecto = Area::model()->getAreasDisponiblesPorProyecto();\n if(!empty($areas_por_proyecto)){\n $bandera = false;\n foreach ($areas_por_proyecto as $area){\n if($area->id == $id){\n $bandera = true;\n break;\n }\n }\n if(!$bandera){\n Yii::app()->user->setNotification('error','Acceso denegado');\n $this->redirect(array('/'));\n }\n }else{\n Yii::app()->user->setNotification('error','Acceso denegado');\n $this->redirect(array('/'));\n }\n return $model;\n }", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }", "public function byId($id)\n {\n return $this->cottage //->with('images', 'areas', 'features')\n ->find($id);\n }", "function get( $id=\"\" )\n {\n $db =& eZDB::globalDatabase();\n if ( $id != \"\" )\n {\n $db->array_query( $region_array, \"SELECT * FROM eZAddress_Region WHERE ID='$id'\" );\n\t\t\t\n if ( count( $region_array ) == 1 )\n {\n $this->fill( $region_array[0] );\n }\n }\n }", "public function edit($id)\n {\n $data = Area::findOrFail($id);\n return view('main.expedition.area.edit')->withData($data);\n }", "public function loadById($identifier): ?object;", "function load($ID)\n\t{\n\t\t//check ID is not blank and exists and such\n\t\t$db = DB::GetConn();\n\n\t\t$id_con = $db->quoteInto(\"ID = ?\",$ID);\n\t\t$getQuery = \"SELECT * FROM `Location` WHERE $id_con limit 1;\";\n\t\t$res = $db->query($getQuery);\n\t\t$obj = $res->fetchObject();\n return Location::loadLocationFromObject($obj);\n }", "public function edit_area($id)\n {\n $area = $this->addarea->find($id);\n //print_r($area);exit();\n return view('/edit_areas',['area'=>$area]);\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "function getById($id) {\n\t\treturn $this->getMapper()->getById($id);\n\t}", "public function showAreas($id)\n {\n $carrera = EntidadFederativa::where('id',$id)->first();\n $carrera->load('Area');\n if(!is_null($carrera))\n {\n return response()->json(\n [\n \"msg\"=>\"success\",\n \"carrera\"=>$carrera->toArray()\n ],200);\n }\n else{\n return response()->json('carrera_not_found',404);\n }\n }", "private function _get($id=null) {\n if ($id == null) return null;\n // TODO: Buscar en caché y devolver objeto\n return $this->get($id);\n }", "public static function LocatedAt($id) {\n return static::where(compact('id'))->firstOrFail();\n }", "public function byId($id)\n\t{\n\t\treturn $this->find('id', $id)->first();\n\t}", "public static function choose($area) {\r\n\t\tswitch($area) {\r\n\t\t\tcase \"water\":\r\n\t\t\t\t$id = 7;\r\n\t\t\t\t$name = \"Dooth\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"fire\":\r\n\t\t\t\t$id = 1;\r\n\t\t\t\t$name = \"Possel\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"ice\":\r\n\t\t\t\t$id = 4;\r\n\t\t\t\t$name = \"Skarrier\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"jungle\":\r\n\t\t\t\t$id = 10;\r\n\t\t\t\t$name = \"Apelim\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"rock\":\r\n\t\t\t\t$id = 16;\r\n\t\t\t\t$name = \"Diggimal\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"lava\":\r\n\t\t\t\t$id = 17;\r\n\t\t\t\t$name = \"Samalanda\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"gas\":\r\n\t\t\t\t$id = 20;\r\n\t\t\t\t$name = \"Sepelem\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn array(\"speciesID\" => $id, \"speciesName\" => $name);\r\n\t\t$q = ORM::query(\"SELECT * FROM species WHERE world = ? ORDER BY RAND() LIMIT 1\", array($area));\r\n\t\t$data = $q->fetch(PDO::FETCH_ASSOC);\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "public static function getById($id)\n {\n self::init();\n\n if (array_key_exists($id, self::$_map)) {\n // warning : array to object conversion fails for nested arrays\n // see https://stackoverflow.com/questions/19272011/how-to-convert-an-array-into-an-object-using-stdclass\n $result = (object) self::$_map[$id];\n $result->id = $id;\n\n return $result;\n } else {\n return null;\n }\n }", "function cmsArea($mIdSlug): string\n {\n /** @var Model\\Area $oModel */\n $oModel = Factory::model('Area', Constants::MODULE_SLUG);\n return $oModel->render($mIdSlug);\n }", "public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }", "public static function locatedAt($id)\n {\n return static::where(compact('id'))->firstOrFail();\n }", "public function get($id) {\n $this->instance = $this->instanceHome->find($id);\n return $this->instance;\n }", "public function index($id)\n {\n $areas = Area::where('user_id', $id)->get();\n return view('area', compact('areas'));\n }", "public function loadAreaId( $areaKey )\n {\n\n if( $this->areaId )\n return $this->areaId;\n\n $orm = $this->getOrm();\n\n $this->areaId = $orm->get('WbfsysSecurityArea',\"upper(access_key)=upper('{$areaKey}')\")->getid();\n\n return $this->areaId;\n\n }", "public function getById($id) {\n return $this->getBy(id, \"id\");\n }", "public function area()\n {\n return $this->belongsTo('App\\Area');\n }", "public function area()\n {\n return $this->belongsTo('App\\Area');\n }", "public function getCityArea()\n {\n return $this->hasOne(CityArea::className(), ['id' => 'city_area_id']);\n }", "public function GetById($id){\n\t\tif (array_key_exists($id, $this->BlockList)) return $this->BlockList[$id];\n\t\treturn null;\t\n\t}", "public function getArea(): ?string\n {\n return $this->Area ?? null;\n }", "public static function area($area)\n\t{\n\t //return the first to the last item :)\n\t\t$clean = explode('/',$area);\n\t\tarray_pop($clean);\n $area = array_pop($clean);\n\t\treturn $area;\n\t\t\n\t}", "public function edit($id)\n {\n //\n $area = Area::find($id);\n return view('backend.area.edit', compact('area'));\n }", "public function getById($id) {\n foreach ($this->items as $item) {\n if ($item->id() == $id) {\n return $item;\n }\n }\n \n return null;\n }", "public function find_by_name($name)\n\t{\n\t\t$this->db->where('area_name',$name);\n\t\t$q=$this->db->get($this->table_name);\n\t\t//$q=$this->db->query(\"SELECT GetAreaIdByName('{$name}') as id LIMIT 1\");\n\t\treturn $q->row();\n\t}", "function getRoomByID($id){\r\n $common = new \\Cars\\Data\\Common($this->app);\r\n return $common->getRoomByID($id);\r\n }", "public function dnd_area($blockid) {\n return $this->render(new dnd_area($blockid));\n }", "protected function detail($id)\n\t{\n\t\t$show = new Show(NativePlaceRegion::findOrFail($id));\n\t\t\n\t\t$show->region_id('地区id');\n\t\t$show->parentid('上级地区id');\n\t\t$show->region_name('地区名称');\n\t\t$show->have_children('是否有更下级地区');\n\t\t\n\t\treturn $show;\n\t}", "public function getById( $id );", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public abstract function getById($id);", "public function getOne($id)\n {\n return $this->repository->find($id);\n }", "static public function retrieve(mixed $id): ?AddressInterface;", "public function find($id)\r\n {\r\n if (!is_array($id)) {\r\n return $this->location->where('id', $id)->first();\r\n }\r\n \r\n return $this->location->whereIn('id', $id)->get();\r\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "function getRule($id) {\n\t\t$this->loadRules();\n\n\t\t$rule = array(\n\t\t\t'id' => '',\n\t\t\t'name' => '',\n\t\t\t'active' => true,\n\t\t\t'criteria' => array(\n\t\t\t\t'all'\t=> false,\n\t\t\t),\n\n\t\t\t'actions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'action' => array(),\n\t\t\t\t\t'args' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif(!empty($id)) {\n\t\t\tforeach($this->rules as $rule) {\n\t\t\t\tif($rule['id'] == $id) {\n\t\t\t\t\treturn $rule;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $rule;\n\t}", "public static function find($id) {\n if ($id != null) {\n $rows = DB::query('SELECT * FROM Unit WHERE id = :id LIMIT 1', array('id' => $id));\n \n if (count($rows) > 0) {\n $row = $rows[0];\n\n $unit = self::create_unit($row);\n }\n\n return $unit;\n } else {\n return null;\n }\n }", "private function getArea($areas)\n {\n return $areas[rand(0, count($areas) - 1)];\n }", "public function getAreaIdInfo()\n {\n return $this->community_area;\n }", "abstract public function getById($id);", "abstract public function getById($id);" ]
[ "0.6818367", "0.68054247", "0.675593", "0.66526365", "0.6623228", "0.65929544", "0.6525969", "0.6503645", "0.64695245", "0.64217967", "0.63493794", "0.63383394", "0.63373303", "0.6288028", "0.62364167", "0.61606807", "0.61251014", "0.598079", "0.5980592", "0.59436256", "0.592889", "0.59254795", "0.58976775", "0.5817726", "0.58057594", "0.57961094", "0.5733179", "0.5731252", "0.5720976", "0.57025695", "0.57020235", "0.56839705", "0.5680895", "0.5642918", "0.56273574", "0.56157106", "0.5607861", "0.5578773", "0.55756426", "0.55488783", "0.5533705", "0.55280924", "0.5520352", "0.55198854", "0.55013", "0.55013", "0.55013", "0.5501057", "0.54996777", "0.5480832", "0.54668856", "0.54608524", "0.544859", "0.5443531", "0.54346573", "0.5426959", "0.542648", "0.5422171", "0.54213965", "0.5416223", "0.54093283", "0.5405134", "0.5405134", "0.53956115", "0.53923196", "0.53906524", "0.53762335", "0.5374094", "0.5373647", "0.5371274", "0.5354828", "0.5353415", "0.5350623", "0.53330404", "0.53258765", "0.5314994", "0.5307709", "0.530614", "0.5302552", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5301482", "0.5299902", "0.5297111", "0.52967775", "0.52945954", "0.52909374", "0.52909374" ]
0.79509115
0
Apply discount/coupon on subscription
Применить скидку/промокод к подписке
function applyDiscountOnSubscription($subscriptionId = null) { $db = new db(); $db->makeConnection(); if($subscriptionId != null) { \Stripe\Stripe::setApiKey(STRPIE_CLIENT_SECRET); $date = date('Y-m-d 00:00:00'); $discountTotal = 0; // Select plan having trial periods on // $query = "SELECT price FROM billing_products BP INNER JOIN user_subscription_items USI ON BP.plan_id = USI.plan_id WHERE BP.trial_period != 0 AND USI.subscription_id = '{$subscriptionId}' AND USI.coupon_trial_from <= '{$date}' AND USI.coupon_trial_to >= '{$date}'"; $query = "SELECT price FROM billing_products BP INNER JOIN user_subscription_items USI ON BP.plan_id = USI.plan_id WHERE BP.trial_period != 0 AND USI.subscription_id = '{$subscriptionId}' AND USI.coupon_trial_from <= '{$date}' AND USI.coupon_trial_to > '{$date}' AND USI.status = '1'"; $res = $db->query($query); if($db->numRows($res)) { while ($rs = mysqli_fetch_array($res)) { $discountTotal += $rs['price']; } // if($discountTotal) { // Fetch if coupon exist, otherwise create $couponId = 'OFF-'.$discountTotal; try { // Retrieve coupon $coupon = \Stripe\Coupon::retrieve($couponId); } catch (\Stripe\Error\Base $e) { // Create coupon $coupon = \Stripe\Coupon::create([ 'id' => $couponId, 'amount_off' => ($discountTotal*100), 'currency' => 'SEK', 'duration' => 'once', // 'duration' => 'repeating', // 'duration_in_months' => 3, ]); } // Apply coupon on subscription if($coupon) { try { // Update subscription \Stripe\Subscription::update( $subscriptionId, ['coupon' => $coupon->id] ); } catch (\Stripe\Error\Base $e) {} } } else { try { $sub = \Stripe\Subscription::retrieve($subscriptionId); if( isset($sub->discount) && ($sub->discount != null) ) { $sub->deleteDiscount(); } } catch (\Stripe\Error\Base $e) {} } } else { try { $sub = \Stripe\Subscription::retrieve($subscriptionId); if( isset($sub->discount) && ($sub->discount != null) ) { $sub->deleteDiscount(); } } catch (\Stripe\Error\Base $e) {} } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function applyCoupon()\n {\n // check if the current coupon we are trying to apply is associated to a booking.\n // if it is, we will have to calculate the discount based on the the used coupon.\n if ($this->booking->isUsingCoupon($this->coupon)) {\n $this->coupon = $this->getUsedCoupon();\n }\n\n // if this coupon is not the one that's associated to the booking, we will\n // need to ensure the coupon meets the application criteria.\n if ($this->coupon instanceof Coupon && !$this->canApplyCoupon()) return;\n\n $couponInformation = ['beforeDiscount' => $this->discountedPeriodsTotal];\n $this->discountedPeriodsTotal = $this->coupon->apply($this->discountedPeriodsTotal);\n $couponInformation['afterDiscount'] = $this->discountedPeriodsTotal;\n $couponInformation['coupon'] = $this->coupon;\n $this->appliedCoupon = $couponInformation;\n }", "function _apply_discount($coupon)\n\t{\n\t\t$this->database->SaveCheatCode($coupon);\n\t\t$discount_percentage = 0;\n\t\t$coupon_info = $this->database->GetDiscountCoupon($coupon);\n\n\t\t//Run some conditional-check for code\n\t\tif($this->_can_apply_code($coupon_info))\n\t\t{\n\t\t\t$discount_percentage = $this->_getDiscount($coupon);\n\t\t\t$this->cart->apply_discount($coupon, $discount_percentage);\n\t\t}\n\n\t\t$this->_notify_discount_applied($discount_percentage, $coupon_info);\n\n\t}", "public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }", "function learndash_apply_coupon(): void {\n\tif (\n\t\tempty( $_POST['nonce'] ) ||\n\t\t! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'learndash-coupon-nonce' ) ||\n\t\tempty( $_POST['post_id'] ) ||\n\t\t! is_user_logged_in() ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid request.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( empty( $_POST['coupon_code'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Please enter the coupon code.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$product = Product::find( (int) $_POST['post_id'] );\n\n\tif ( ! $product ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Product not found.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if the coupon code is valid.\n\n\t$coupon_code = sanitize_text_field( wp_unslash( $_POST['coupon_code'] ) );\n\n\t$coupon_validation_result = learndash_check_coupon_is_valid( $coupon_code, $product->get_id() );\n\n\tif ( ! $coupon_validation_result['is_valid'] ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => $coupon_validation_result['error'],\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if we are processing the \"subscribe\" pricing.\n\n\tif ( $product->is_price_type_subscribe() ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Subscriptions are not supported for now.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Process an action.\n\n\ttry {\n\t\t$product_pricing = $product->get_pricing();\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$coupon = learndash_get_coupon_by_code( $coupon_code );\n\t$discounted_price = learndash_calculate_coupon_discounted_price( $coupon->ID, $product_pricing->price );\n\t$discount = ( $product_pricing->price - $discounted_price ) * -1;\n\n\t$price = $discounted_price;\n\tif ( ! learndash_is_zero_decimal_currency( learndash_get_currency_code() ) ) {\n\t\t$price = intval( $price * 100 );\n\t}\n\n\tlearndash_attach_coupon( $product->get_id(), $coupon->ID, $product_pricing->price, $discounted_price );\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'coupon_code' => $coupon_code,\n\t\t\t'discount' => esc_html(\n\t\t\t\tlearndash_get_price_formatted( $discount )\n\t\t\t),\n\t\t\t'total' => array(\n\t\t\t\t'value' => $discounted_price,\n\t\t\t\t'stripe_value' => $price,\n\t\t\t\t'formatted' => esc_html(\n\t\t\t\t\tlearndash_get_price_formatted( $discounted_price )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'message' => __( 'Coupon applied.', 'learndash' ),\n\t\t)\n\t);\n}", "public static function subscriptionDiscountAdded($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountAdded', $callback);\n }", "public function apply_coupon_subscription(Request $request) {\n\n $validator = Validator::make($request->all(), [\n 'coupon_code' => 'required|exists:coupons,coupon_code', \n 'subscription_id'=>'required|exists:subscriptions,id' \n ], array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n \n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages'=>$error_messages , 'error_code' => 101);\n\n return response()->json($response_array);\n }\n \n\n $model = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($model) {\n\n if ($model->status) {\n\n $user = User::find($request->id);\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $model)->getData();\n\n if(strtotime($model->expiry_date) >= strtotime(date('Y-m-d'))) {\n\n if ($check_coupon->success) {\n\n if(strtotime($model->expiry_date) >= strtotime(date('Y-m-d'))) {\n\n $subscription = Subscription::find($request->subscription_id);\n\n if($subscription) {\n\n if($subscription->status) {\n\n $amount_convertion = $model->amount;\n\n if ($model->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($model->amount, $subscription->amount), 2);\n\n }\n\n if ($subscription->amount > $amount_convertion && $amount_convertion > 0) {\n\n $amount = $subscription->amount - $amount_convertion;\n \n $response_array = ['success'=> true, \n 'data'=>[\n 'remaining_amount'=>(string) $amount,\n 'coupon_amount'=> (string) $amount_convertion,\n 'coupon_code'=>$model->coupon_code,\n 'original_coupon_amount'=>(string) ($model->amount_type == PERCENTAGE ? $model->amount.'%' : Setting::get('currency').$model->amount)\n ]];\n\n } else {\n\n // $response_array = ['success'=> false, 'error_messages'=>Helper::get_error_message(156), 'error_code'=>156];\n $amount = 0;\n $response_array = ['success'=> true, \n 'data'=>[\n 'remaining_amount'=>(string) $amount,\n 'coupon_amount'=> (string) $amount_convertion,\n 'coupon_code'=>$model->coupon_code,\n 'original_coupon_amount'=>(string) ($model->amount_type == PERCENTAGE ? $model->amount.'%' : Setting::get('currency').$model->amount)\n ]];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(170), 'error_code'=>170];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(169), 'error_code'=>169];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(173), 'error_code'=>173];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>$check_coupon->error_messages];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(173), 'error_code'=>173];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(168), 'error_code'=>168];\n }\n\n\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(167), 'error_code'=>167];\n\n }\n\n return response()->json($response_array);\n\n }", "protected function _applyCoupon($coupon, $price)\n {\n\n $db = & JFactory::getDBO();\n $user = & JFactory::getUser();\n $sid = JRequest::getInt('sid');\n\n // Update used time for this coupon\n $sql = 'UPDATE #__jms_coupons' .\n ' SET used_time = used_time + 1' .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $db->query();\n\n // Get coupon information\n $sql = 'SELECT *' .\n ' FROM #__jms_coupons' .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $row = $db->loadObject();\n\n // Make coupon history for this current user\n $sql = 'INSERT INTO #__jms_coupon_subscrs' .\n ' VALUES (\"\", ' . $user->get('id') . ', ' . $row->id . ', ' . $sid . ', NOW(), ' . $price . ', ' . $row->discount . ', ' . $row->discount_type . ', ' . $row->recurring . ', ' . $row->num_recurring . ')'\n ;\n $db->setQuery($sql);\n $db->query();\n\n // Discount based on amount\n if ($row->discount_type == 2)\n {\n $new = round(($row->discount - $price), 2);\n if ($new < 0) $new = 0;\n $sql = 'UPDATE #__jms_coupons' .\n ' SET discount = ' . $new .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $db->query();\n\n $out = $price - $row->discount;\n if ($out < 0) $out = 0;\n $out = round($out, 2);\n } else\n {\n $out = $price - ($price * ($row->discount / 100));\n $out = round($out, 2);\n }\n return $out;\n }", "public function AssignDiscount()\n\t{\t\n\t}", "function wp_aff_handle_woocommerce_subscription_payment($order) {\n if (!is_object($order)) {\n $order = new WC_Order($order);\n }\n\n $order_id = $order->id;\n $total = $order->order_total;\n $shipping = $order->get_total_shipping();//get_shipping();\n $sale_amount = $total - $shipping;\n $txn_id = $order_id . \"_\" . date(\"Y-m-d\"); //Add the subscription charge date to make this unique\n $item_id = \"\";\n $buyer_email = $order->billing_email;\n $buyer_name = $order->billing_first_name . \" \" . $order->billing_last_name;\n \n $referrer = get_post_meta($order_id, '_wp_aff_ap_id', true);\n if(empty($referrer)){\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - couldn't get referrer ID from cookie. Checking IP address...\", true);\n $ip_address = get_post_meta($order_id, '_customer_ip_address', true);\n if (empty($ip_address)) {\n wp_affiliate_log_debug(\"WooCommerce Subscription Affiliate integration - customer IP address is missing in WooCommerce order.\", false);\n return;\n }\n $referrer = wp_aff_get_referrer_id_from_ip_address($ip_address);\n }\n \n $order_status = $order->status;\n\n //apply filter for coupon check\n $referrer = apply_filters('aff_woo_before_awarding_commission_filter', $referrer, $order);\n\n $debug_data = \"WooCommerce subscripiton payment - Commission tracking debug data: \" . $referrer . \"|\" . $sale_amount . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $ip_address . \"|\" . $buyer_name;\n wp_affiliate_log_debug($debug_data, true);\n\n if (!empty($referrer)) {\n wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, '', '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - This is not an affiliate referred sale!\", true);\n }\n}", "function pp_edd_auto_apply_discount() {\n\n\tif ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() ) {\n\n\t\tif ( ! edd_cart_has_discounts() && edd_is_discount_valid( 'BFCM2016', '', false ) ) {\n\t\t\tedd_set_cart_discount( 'BFCM2016' );\n\t\t}\n\n\t}\n\n}", "private function calculateSubscription()\n {\n $subscription = new Subscription();\n $result = $subscription->getById($this->subscription['name'])[0];\n if ($result === FALSE) {\n $this->subscription['final_price'] = \"0.00\";\n } else {\n $result['date'] = $this->subscription['date'];\n $result['days'] = $subscription->calculateAmountOfDays($this->subscription['date']);\n $result['total'] += $result['price_per_day'] * $result['days'];\n $this->subtotal += $result['total'];\n }\n\n $this->subscription = $result;\n\n }", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "public function pay_now(Request $request) {\n\n try {\n \n DB::beginTransaction();\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'subscription_id'=>'required|exists:subscriptions,id',\n 'payment_id'=>'required',\n 'coupon_code'=>'nullable|exists:coupons,coupon_code',\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors, 101);\n\n } else {\n\n $user = User::find($request->id);\n\n $subscription = Subscription::find($request->subscription_id);\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n $model = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)\n ->orderBy('id', 'desc')->first();\n\n $user_payment = new UserSubscription();\n\n if ($model) {\n\n if (strtotime($model->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($model->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n $user_payment->payment_id = $request->payment_id;\n $user_payment->user_id = $request->id;\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = PAYPAL;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n \n if($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $response_array = ['success'=>true, \n 'message'=>tr('payment_success'), \n 'data'=>[\n 'id'=>$request->id,\n 'token'=>$user_payment->user ? $user_payment->user->token : '',\n ]];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n }\n\n }\n\n DB::commit();\n\n return response()->json($response_array, 200);\n\n } catch(Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }", "public function manage_smart_coupon_credit_used( $coupon = '', $discount = 0, $cart_contains_subscription = false, $calculation_type = '' ) {\n\t\t\tif ( is_object( $coupon ) && $coupon instanceof WC_Coupon ) {\n\n\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t} else {\n\t\t\t\t\t$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';\n\t\t\t\t}\n\n\t\t\t\tif ( $cart_contains_subscription ) {\n\t\t\t\t\tif ( WCS_SC_Compatibility::is_wcs_gte( '2.0.10' ) ) {\n\t\t\t\t\t\tif ( $this->is_wc_greater_than( '3.1.2' ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals = WC()->cart->get_coupon_discount_totals();\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_totals ) || ! is_array( $coupon_discount_totals ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_totals = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_totals[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] = $discount;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] += $discount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tWC()->cart->set_coupon_discount_totals( $coupon_discount_totals );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_amounts = ( is_object( WC()->cart ) && isset( WC()->cart->coupon_discount_amounts ) ) ? WC()->cart->coupon_discount_amounts : array();\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_amounts ) || ! is_array( $coupon_discount_amounts ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_amounts[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] = $discount;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] += $discount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tWC()->cart->coupon_discount_amounts = $coupon_discount_amounts;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\t\t\tWC_Subscriptions_Coupon::increase_coupon_discount_amount( WC()->cart, $coupon_code, $discount );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWC_Subscriptions_Cart::increase_coupon_discount_amount( $coupon_code, $discount );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( $this->is_wc_greater_than( '3.1.2' ) ) {\n\t\t\t\t\t\t$coupon_discount_totals = WC()->cart->get_coupon_discount_totals();\n\t\t\t\t\t\tif ( empty( $coupon_discount_totals ) || ! is_array( $coupon_discount_totals ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $coupon_discount_totals[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] = $discount;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] += $discount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWC()->cart->set_coupon_discount_totals( $coupon_discount_totals );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$coupon_discount_amounts = ( is_object( WC()->cart ) && isset( WC()->cart->coupon_discount_amounts ) ) ? WC()->cart->coupon_discount_amounts : array();\n\t\t\t\t\t\tif ( empty( $coupon_discount_amounts ) || ! is_array( $coupon_discount_amounts ) ) {\n\t\t\t\t\t\t\t$coupon_discount_amounts = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $coupon_discount_amounts[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] = $discount;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] += $discount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWC()->cart->coupon_discount_amounts = $coupon_discount_amounts;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( WC()->session->reload_checkout ) ) { // reload_checkout is triggered when customer is registered from checkout.\n\t\t\t\t\tunset( WC()->cart->smart_coupon_credit_used ); // reset store credit used data for re-calculation.\n\t\t\t\t}\n\n\t\t\t\t$smart_coupon_credit_used = ( is_object( WC()->cart ) && isset( WC()->cart->smart_coupon_credit_used ) ) ? WC()->cart->smart_coupon_credit_used : array();\n\n\t\t\t\tif ( empty( $smart_coupon_credit_used ) || ! is_array( $smart_coupon_credit_used ) ) {\n\t\t\t\t\t$smart_coupon_credit_used = array();\n\t\t\t\t}\n\t\t\t\tif ( empty( $smart_coupon_credit_used[ $coupon_code ] ) || ( $cart_contains_subscription && ( 'combined_total' === $calculation_type || 'sign_up_fee_total' === $calculation_type ) ) ) {\n\t\t\t\t\t$smart_coupon_credit_used[ $coupon_code ] = $discount;\n\t\t\t\t} else {\n\t\t\t\t\t$smart_coupon_credit_used[ $coupon_code ] += $discount;\n\t\t\t\t}\n\t\t\t\tWC()->cart->smart_coupon_credit_used = $smart_coupon_credit_used;\n\n\t\t\t}\n\t\t}", "public static function subscriptionDiscountUpdated($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountUpdated', $callback);\n }", "public function apply_coupon_from_session() {\n\n\t\t\t$cart = ( is_object( WC() ) && isset( WC()->cart ) ) ? WC()->cart : null;\n\n\t\t\tif ( empty( $cart ) || WC()->cart->is_empty() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\t$unique_id = ( ! empty( $_COOKIE['sc_applied_coupon_profile_id'] ) ) ? wc_clean( wp_unslash( $_COOKIE['sc_applied_coupon_profile_id'] ) ) : ''; // phpcs:ignore\n\t\t\t\t$applied_coupon_from_url = ( ! empty( $unique_id ) ) ? get_option( 'sc_applied_coupon_profile_' . $unique_id, array() ) : array();\n\t\t\t} else {\n\t\t\t\t$applied_coupon_from_url = get_user_meta( $user_id, 'sc_applied_coupon_from_url', true );\n\t\t\t}\n\n\t\t\tif ( empty( $applied_coupon_from_url ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $applied_coupon_from_url as $index => $coupon_code ) {\n\t\t\t\tWC()->cart->add_discount( trim( $coupon_code ) );\n\t\t\t\tunset( $applied_coupon_from_url[ $index ] );\n\t\t\t}\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\tupdate_option( 'sc_applied_coupon_profile_' . $unique_id, $applied_coupon_from_url, 'no' );\n\t\t\t} else {\n\t\t\t\tupdate_user_meta( $user_id, 'sc_applied_coupon_from_url', $applied_coupon_from_url );\n\t\t\t}\n\n\t\t}", "public function applyGlobalDiscount($discount_rate)\n {\n }", "function apply_cart_discounts_after_tax() {\t\n\t\t\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tdo_action( 'cmdeals_cart_discount_after_tax_' . $coupon->type, $coupon );\n\t\t\t\t\n\t\t\t\tif ( !$coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = (round( $this->cart_contents_total + $this->tax_total , 2) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t}", "public static function subscriptionDiscountChanged($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountChanged', $callback);\n }", "public function getDiscountRefunded();", "public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }", "public function couponPostAction()\n {\n /** @var Divante_OpenLoyalty_Model_Quote $quote */\n $quote = $this->_getQuote();\n\n $this->resetLoyaltyInUse();\n\n /** @var Mage_Core_Helper_Data $helperCore */\n $helperCore = Mage::helper('core');\n \n /**\n * No reason continue with empty shopping cart\n */\n if (!$quote->getItemsCount()\n || !$this->_validateFormKey()) {\n $this->_goBack();\n\n return;\n }\n\n /** @var string $couponCode */\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n \n if ($this->getRequest()->getParam(self::REMOVE_PARAM) == 1) {\n $couponCode = '';\n }\n \n $oldCouponCode = $quote->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $this->_goBack();\n \n return;\n }\n\n try {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\n ->unsetLoyaltyDiscount()\n ->collectTotals()\n ->save();\n\n if (strlen($couponCode)) {\n if ($couponCode == $quote->getCouponCode()) {\n $this\n ->_getSession()\n ->addSuccess(\n $this->__(\n 'Coupon code \"%s\" was applied.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n } else {\n $this\n ->_getSession()\n ->addError(\n $this->__(\n 'Coupon code \"%s\" is not valid.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n }\n } else {\n $this\n ->_getSession()\n ->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this\n ->_getSession()\n ->addError($e->getMessage());\n } catch (Exception $e) {\n $this\n ->_getSession()\n ->addError($this->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n $this->_goBack();\n }", "protected abstract function applyCoupon($coupon_code);", "function apply_15_percent_coupon() {\n\t\tglobal $woocommerce;\n\n\t\t$coupon_code = '15percent'; // your coupon code here\n\t\tif ( $_POST['coupon_code'] != '' ) {\n\t\t\t$woocommerce->cart->remove_coupon( $coupon_code );\n\n\t\t\treturn;\n\t\t}\n\t\tif ( $woocommerce->cart->has_discount( $coupon_code ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( count( $woocommerce->cart->get_applied_coupons() ) == 0 ) {\n\t\t\t$woocommerce->cart->add_discount( $coupon_code );\n\t\t}\n\t}", "public function stripe_payment(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make($request->all(), \n array(\n 'subscription_id' => 'required|exists:subscriptions,id',\n 'coupon_code'=>'exists:coupons,coupon_code',\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n throw new Exception($error_messages, 101);\n\n } else {\n\n $subscription = Subscription::find($request->subscription_id);\n\n $user = User::find($request->id);\n\n if ($subscription) {\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n if ($user) {\n\n $check_card_exists = User::where('users.id' , $request->id)\n ->leftJoin('cards' , 'users.id','=','cards.user_id')\n ->where('cards.id' , $user->card_id)\n ->where('cards.is_default' , DEFAULT_TRUE);\n\n if($check_card_exists->count() != 0) {\n\n $user_card = $check_card_exists->first();\n\n if ($total <= 0) {\n\n \n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n if (strtotime($previous_payment->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($previous_payment->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = \"free plan\";\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = 1;\n\n $user_payment->amount = $total;\n\n $user_payment->payment_mode = CARD;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n \n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n \n \n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $stripe_secret_key = Setting::get('stripe_secret_key');\n\n $customer_id = $user_card->customer_id;\n\n if($stripe_secret_key) {\n\n \\Stripe\\Stripe::setApiKey($stripe_secret_key);\n\n } else {\n\n throw new Exception(Helper::error_message(902), 902);\n\n }\n\n try{\n\n $user_charge = \\Stripe\\Charge::create(array(\n \"amount\" => $total * 100,\n \"currency\" => \"usd\",\n \"customer\" => $customer_id,\n ));\n\n $payment_id = $user_charge->id;\n $amount = $user_charge->amount/100;\n $paid_status = $user_charge->paid;\n\n if($paid_status) {\n\n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n $expiry_date = $previous_payment->expiry_date;\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime($expiry_date. \"+\".$subscription->plan.\" months\"));\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = $payment_id;\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = CARD;\n\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = SUBSCRIBED_USER;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n\n \n\n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $response_array = array('success' => false, 'error_messages' => Helper::error_message(903) , 'error_code' => 903);\n\n throw new Exception(Helper::error_message(903), 903);\n\n }\n\n \n } catch(\\Stripe\\Error\\RateLimit $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch(\\Stripe\\Error\\Card $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n // Invalid parameters were supplied to Stripe's API\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Authentication $e) {\n\n // Authentication with Stripe's API failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\ApiConnection $e) {\n\n // Network communication with Stripe failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Base $e) {\n // Display a very generic error to the user, and maybe send\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (Exception $e) {\n // Something else happened, completely unrelated to Stripe\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\StripeInvalidRequestError $e) {\n\n Log::info(print_r($e,true));\n\n throw new Exception($e->getMessage(), 903);\n \n \n }\n\n\n }\n\n } else {\n \n throw new Exception(Helper::error_message(901), 901);\n \n }\n\n } else {\n\n throw new Exception(tr('no_user_detail_found'));\n \n }\n\n } else {\n\n throw new Exception(Helper::error_message(901), 901);\n\n } \n\n \n }\n\n DB::commit();\n\n return response()->json($response_array , 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $error = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$error, 'error_code'=>$code];\n\n return response()->json($response_array);\n }\n \n }", "public function coupon()\n\t{\n\t\t$session = JFactory::getSession();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call coupon method of model to apply coupon\n\t\t$valid = $model->coupon();\n\t\t$cart = $session->get('cart');\n\t\t$this->modifyCalculation($cart);\n\t\t$this->_carthelper->cartFinalCalculation(false);\n\n\t\t// Store cart entry in db\n\t\t$this->_carthelper->carttodb();\n\n\t\t// If coupon code is valid than apply to cart else raise error\n\t\tif ($valid)\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_REDSHOP_COUPON_CODE_IS_NOT_VALID');\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link, $msg);\n\t\t}\n\t}", "public function applyCoupon($coupon)\n {\n $this->assertCustomerExists();\n\n $customer = $this->asStripeCustomer();\n\n $customer->coupon = $coupon;\n\n $customer->save();\n }", "protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }", "protected function applyDiscounts()\n {\n $discounts = $this->booking->bookingDiscounts;\n $this->discountedPeriodsTotal = $this->periodsTotal;\n $discountedTotal = $this->periodsTotal;\n\n if (!$discounts) return;\n\n // Apply discounts based on the order of discount sequence.\n foreach ($this->discountSequence as $sequence) {\n // Filter discounts so that we don't have to loop through all of them.\n $filteredDiscounts = $discounts->where('type', $sequence);\n\n $methodName = \"apply\" . Str::studly($sequence) . \"Discount\";\n\n // Apply and store discount information.\n foreach ($filteredDiscounts as $filteredDiscount) {\n $discountInformation = ['beforeDiscount' => $discountedTotal];\n $discountedTotal = $this->$methodName($discountedTotal, $filteredDiscount);\n $discountInformation['afterDiscount'] = $discountedTotal;\n\n if (!$this->discountApplied($discountInformation['beforeDiscount'], $discountInformation['afterDiscount'])) {\n continue;\n }\n\n $discountInformation['discount'] = $filteredDiscount;\n $this->appliedDiscounts[] = $discountInformation;\n }\n }\n\n $this->discountedPeriodsTotal = $discountedTotal;\n }", "public function subscriptions_payment_apple_pay(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make($request->all(), \n array(\n 'subscription_id' => 'required|exists:subscriptions,id',\n 'coupon_code'=>'exists:coupons,coupon_code',\n 'payment_mode' => 'required|in:'.APPLE_PAY,\n 'token_id' => 'required'\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n throw new Exception($error_messages, 101);\n\n }\n\n $subscription = Subscription::find($request->subscription_id);\n\n if(!$subscription) {\n\n throw new Exception(Helper::error_message(901), 901);\n \n }\n\n $user = User::find($request->id);\n\n if(!$user) {\n\n throw new Exception(tr('no_user_detail_found'));\n \n }\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n if ($total <= 0) {\n\n \n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n if (strtotime($previous_payment->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($previous_payment->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = \"free plan\";\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = 1;\n\n $user_payment->amount = $total;\n\n $user_payment->payment_mode = APPLE_PAY;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n \n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n \n \n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $stripe_secret_key = Setting::get('stripe_secret_key');\n\n if($stripe_secret_key) {\n\n \\Stripe\\Stripe::setApiKey($stripe_secret_key);\n\n } else {\n\n throw new Exception(Helper::error_message(902), 902);\n\n }\n\n try{\n\n $user_charge = \\Stripe\\Charge::create(array(\n \"amount\" => $total * 100,\n \"currency\" => \"usd\",\n \"source\" => $request->token_id,\n ));\n\n $payment_id = $user_charge->id;\n $amount = $user_charge->amount/100;\n $paid_status = $user_charge->paid;\n\n if($paid_status) {\n\n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n $expiry_date = $previous_payment->expiry_date;\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime($expiry_date. \"+\".$subscription->plan.\" months\"));\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = $payment_id;\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = APPLE_PAY;\n\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = SUBSCRIBED_USER;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n\n \n\n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $response_array = array('success' => false, 'error_messages' => Helper::error_message(903) , 'error_code' => 903);\n\n throw new Exception(Helper::error_message(903), 903);\n\n }\n\n \n } catch(\\Stripe\\Error\\RateLimit $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch(\\Stripe\\Error\\Card $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n // Invalid parameters were supplied to Stripe's API\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Authentication $e) {\n\n // Authentication with Stripe's API failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\ApiConnection $e) {\n\n // Network communication with Stripe failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Base $e) {\n // Display a very generic error to the user, and maybe send\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (Exception $e) {\n // Something else happened, completely unrelated to Stripe\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\StripeInvalidRequestError $e) {\n\n Log::info(print_r($e,true));\n\n throw new Exception($e->getMessage(), 903);\n \n \n }\n\n\n }\n \n DB::commit();\n\n return response()->json($response_array , 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $error = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$error, 'error_code'=>$code];\n\n return response()->json($response_array);\n }\n \n }", "public function applyDiscount()\n {\n if (request('discountType') == 1) {\n cart()->applyDiscount($percentage = request('red'));\n return $this->getCartDetails();\n }\n cart()->applyFlatDiscount($amount = request('discountInput'));\n\n return redirect()->route('cart');\n }", "public function smart_coupons_discount_total_filters() {\n\t\t\tif ( WCS_SC_Compatibility::is_cart_contains_subscription() && WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t} else {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t\tglobal $current_screen;\n\t\t\t\tif ( ! empty( $current_screen ) && 'edit-shop_order' !== $current_screen ) {\n\t\t\t\t\tadd_filter( 'woocommerce_order_get_total', array( $this, 'smart_coupons_order_discounted_total' ), 10, 2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function applyCouponAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n $isRemove = (bool)$this->getRequest()->getParam('remove', false);\n $coupon = $this->getRequest()->getParam('coupon');\n if ($isRemove) {\n $coupon = null;\n }\n\n $result = $this->getOnepage()->saveCouponCode($coupon);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function getDiscount(Request $request){\n\n \n $coupon=Coupon::where('code',$request->coupon)->first();\n if(count($coupon)==0){\n return back()->withErrors('No such coupon code found');\n }\n\n if($coupon->no_of_uses<=0){\n return back()->withErrors('Coupon code is not available now!');\n }\n\n $discount=round(($coupon->percent_off)*0.01*((float)str_replace(',', '', Cart::subtotal())+(float)str_replace(',', '', Cart::tax())),2);\n session(['coupon_id'=>$coupon->id]);\n session(['percent_off'=>$coupon->percent_off]);\n session(['discount'=>$discount]);\n $cart_total=((float)str_replace(',','',Cart::total()))-session()->get('discount');\n session(['cart_total'=>round($cart_total,2)]);\n\n Session::flash('success','Discount applied!');\n return back();\n }", "public function sc_handle_store_credit_application() {\n\t\t\t$apply_before_tax = get_option( 'woocommerce_smart_coupon_apply_before_tax', 'no' );\n\n\t\t\tif ( $this->is_wc_gte_30() && 'yes' === $apply_before_tax ) {\n\t\t\t\tinclude_once 'class-wc-sc-apply-before-tax.php';\n\t\t\t} else {\n\t\t\t\tadd_action( 'wp_loaded', array( $this, 'smart_coupons_discount_total_filters' ), 20 );\n\t\t\t\tadd_action( 'woocommerce_order_after_calculate_totals', array( $this, 'order_calculate_discount_amount' ), 10, 2 );\n\t\t\t}\n\t\t}", "public function do_process_subscription_payment( $subscription ) {\n\t\t\t$subscription_id = $subscription;\n\t\t\tif ( is_object( $subscription ) ) {\n\t\t\t\t$subscription_id = $subscription->ID;\n\t\t\t}\n\n\t\t\t$subscription_ord = wcs_get_subscription( $subscription_id );\n\t\t\t$subscription_orders = $subscription_ord->get_related_orders();\n\n\t\t\t$order_id = current( $subscription_orders );\n\t\t\t$order = new WC_Order( $order_id );\n\n\t\t\t$user_id = $subscription_ord->get_user_id();\n\t\t\tif ( ! $user_id ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$billing_email = version_compare( WC_VERSION, '3.0', '<' ) ? $subscription_ord->billing_email : $subscription_ord->get_billing_email();\n\n\t\t\t$renewal = false;\n\t\t\t// Its first subscription\n\t\t\t$event_sale_name = apply_filters( 'do_woo_drip_action_order', __( 'Subscription', 'do_woo_drip' ) );\n\t\t\t// Its renewal\n\t\t\tif ( count( $subscription_orders ) > 1 ) {\n\t\t\t\t$renewal = true;\n\t\t\t\t$event_sale_name = apply_filters( 'do_woo_drip_action_order_renew', __( 'Renew', 'do_woo_drip' ) );\n\t\t\t}\n\n\t\t\t// Subscriber Parameters\n\t\t\t$subscriber_params = array(\n\t\t\t\t'account_id' => $this->_drip_account_id,\n\t\t\t\t'email' => $billing_email,\n\t\t\t\t'time_zone' => wc_timezone_string(),\n\t\t\t\t'custom_fields' => $this->drip_custom_fields( $order, $user_id, $renewal ),\n\t\t\t\t'tags' => apply_filters( 'do_woo_drip_tag_customer', array(\n\t\t\t\t\t__( 'WooSubscriber', 'do_woo_drip' ),\n\t\t\t\t) )\n\t\t\t);\n\n\t\t\t$this->_drip_api->drip_create_or_update_subscriber( $this->_drip_account_id, array( 'subscribers' => array( $subscriber_params ) ) );\n\n\t\t\t// Product name\n\t\t\t$products = implode( ', ', array_map( function ( $product ) {\n\t\t\t\treturn version_compare( WC_VERSION, '3.0', '<' ) ? $product['name'] : $product->get_name();\n\t\t\t}, $order->get_items() ) );\n\n\t\t\t// Product ID\n\t\t\t$product_ids = implode( ', ', array_filter( array_map( function ( $product ) {\n\t\t\t\tif ( is_a( $product, 'WC_Order_Item_Product' ) ) {\n\t\t\t\t\treturn $product->get_product_id();\n\t\t\t\t}\n\t\t\t}, $order->get_items() ) ) );\n\n\t\t\t// Billing cycle & Variation ID\n\t\t\t$billing_cycle = $variation_id = $product_type = array();\n\t\t\tforeach ( $order->get_items() as $key => $val ) {\n\t\t\t\t$bill_type = wc_get_order_item_meta( $key, 'pa_billingcycle', true );\n\t\t\t\tif ( $bill_type ) {\n\t\t\t\t\tarray_push( $billing_cycle, $bill_type );\n\t\t\t\t}\n\n\t\t\t\t$variation = wc_get_order_item_meta( $key, '_variation_id', true );\n\t\t\t\tif ( $variation > 0 ) {\n\t\t\t\t\tarray_push( $variation_id, $variation );\n\t\t\t\t}\n\n\t\t\t\t$prodtype = wc_get_order_item_meta( $key, 'pa_producttype', true );\n\t\t\t\tif ( $prodtype ) {\n\t\t\t\t\tarray_push( $product_type, $prodtype );\n\t\t\t\t} elseif ( $variation > 0 ) {\n\t\t\t\t\t$variation_name = get_post_meta( $variation, 'attribute_pa_producttype', true );\n\t\t\t\t\tif ( $variation_name ) {\n\t\t\t\t\t\tarray_push( $product_type, $variation_name );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$billing_cycle = implode( ', ', array_filter( $billing_cycle ) );\n\t\t\t$variation_id = implode( ', ', array_filter( $variation_id ) );\n\t\t\t$product_type = implode( ', ', array_filter( $product_type ) );\n\n\t\t\tif ( empty( $billing_cycle ) ) {\n\t\t\t\t$billing_cycle = $subscription_ord->get_billing_period();\n\t\t\t}\n\n\t\t\t// $is_subscriber Variable\n\t\t\t$is_sub_action = $this->_drip_api->drip_fetch_subscriber( $this->_drip_account_id, $billing_email );\n\n\t\t\tif ( $is_sub_action ) {\n\t\t\t\t$is_subscriber = $is_sub_action['id'];\n\t\t\t} else {\n\t\t\t\t$is_subscriber = false;\n\t\t\t}\n\n\t\t\t$event_params = array(\n\t\t\t\t'account_id' => $this->_drip_account_id,\n\t\t\t\t'email' => $billing_email,\n\t\t\t\t'action' => $event_sale_name,\n\t\t\t\t'properties' => $this->drip_event_properties( $order->get_total(), $products, $order_id, $product_ids, $product_type, $billing_cycle, $variation_id ),\n\t\t\t);\n\n\n\t\t\t// Check if subscriber exists and if so, send data to Drip\n\t\t\tif ( $is_subscriber ) {\n\n\t\t\t\t$this->_drip_api->drip_record_event( $this->_drip_account_id, array( 'events' => array( $event_params ) ) );\n\n\t\t\t}\n\t\t}", "public function add_couponAction() {\r\n\t\t$couponCode = (string)$this->getRequest()->getPost('coupon_code', '');\r\n\t\t\t\t\r\n\t\t$quote = $this->getOnepage()->getQuote();\r\n\t\tif ($this->getRequest()->getParam('remove') == '1') {\r\n\t\t\t$couponCode = '';\r\n\t\t}\r\n\t\t\r\n\t\t$oldCouponCode = $quote->getCouponCode();\r\n\t\tif (!strlen($couponCode) && !strlen($oldCouponCode)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$error = false;\r\n\t\t\t$quote->getShippingAddress()->setCollectShippingRates(true);\r\n\t\t\t$quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\r\n ->collectTotals()\r\n ->save();\r\n\t\t\tif ($couponCode) {\r\n\t\t\t\tif ($couponCode == $quote->getCouponCode()) {\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" was applied.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$message = $this->__('Coupon code was canceled.');\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Mage_Core_Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $e->getMessage();\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $this->__('Cannot apply the coupon code.');\r\n\t\t}\r\n\t\t//reload HTML for review order section\r\n\t\t$reviewHtml = $this->_getReviewTotalHtml();\t\t\r\n\t\t$result = array(\r\n\t\t\t'error' => $error,\r\n\t\t\t'message' => $message,\r\n\t\t\t'review_html' => $reviewHtml\r\n\t\t);\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "function add_discount( $coupon_code ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$the_coupon = new cmdeals_coupon($coupon_code);\n\t\t\t\n\t\t\tif ($the_coupon->id) :\n\t\t\t\t\n\t\t\t\t// Check if applied\n\t\t\t\tif ($cmdeals->cart->has_discount($coupon_code)) :\n\t\t\t\t\t$cmdeals->add_error( __('Discount code already applied!', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\t\n\t\t\t\t\n\t\t\t\t// Check it can be used with cart\n\t\t\t\tif (!$the_coupon->is_valid()) :\n\t\t\t\t\t$cmdeals->add_error( __('Invalid coupon.', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// If its individual use then remove other coupons\n\t\t\t\tif ($the_coupon->individual_use=='yes') :\n\t\t\t\t\t$this->applied_coupons = array();\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\tforeach ($this->applied_coupons as $code) :\n\t\t\t\t\t$coupon = new cmdeals_coupon($code);\n\t\t\t\t\tif ($coupon->individual_use=='yes') :\n\t\t\t\t\t\t$this->applied_coupons = array();\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\t\t\n\t\t\t\t$this->applied_coupons[] = $coupon_code;\n\t\t\t\t$this->set_session();\n\t\t\t\t$cmdeals->add_message( __('Discount code applied successfully.', 'cmdeals') );\n\t\t\t\treturn true;\n\t\t\t\n\t\t\telse :\n\t\t\t\t$cmdeals->add_error( __('Coupon does not exist!', 'cmdeals') );\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function course_discounted_amount($price, $coupon)\n{\n $return_val = $price;\n if (!empty($coupon)) {\n $coupon_details = CourseCoupon::where('code', $coupon)->first();\n if (!empty($coupon_details)) {\n if ($coupon_details->discount_type === 'percentage') {\n $discount_bal = ($price / 100) * (int)$coupon_details->discount;\n $return_val = $price - $discount_bal;\n } elseif ($coupon_details->discount_type === 'amount') {\n $return_val = $price - (int)$coupon_details->discount;\n }\n }\n }\n\n return $return_val;\n}", "public function paynow(Request $request, $slug)\r\r\n {\r\r\n // dd($request);\r\r\n if ($request->gateway == 'razorpay') {\r\r\n $type = $request->type;\r\r\n if ($request->after_discount == 0) {\r\r\n $item = $this->getPackageDetails($type, $slug);\r\r\n $other_details = array();\r\r\n $other_details['is_coupon_applied'] = $request->is_coupon_applied;\r\r\n $other_details['actual_cost'] = $request->actual_cost;\r\r\n $other_details['discount_availed'] = $request->discount_availed;\r\r\n $other_details['after_discount'] = $request->after_discount;\r\r\n $other_details['coupon_id'] = $request->coupon_id;\r\r\n $other_details['paid_by_parent'] = $request->parent_user;\r\r\n $other_details['child_id'] = $request->selected_child_id;\r\r\n $token = $this->preserveBeforeSave($item, $type, $request->gateway, $other_details, 1);\r\r\n if ($this->validateAndApproveZeroDiscount($token, $request)) {\r\r\n //Valid\r\r\n flash('success', 'your_subscription_was_successfull', 'overlay');\r\r\n $user = Auth::user();\r\r\n return redirect(URL_PAYMENTS_LIST . $user->slug);\r\r\n } else {\r\r\n //Cheat\r\r\n flash('Ooops...!', 'invalid_payment_or_coupon_code', 'overlay');\r\r\n $user = Auth::user();\r\r\n return redirect(URL_PAYMENTS_LIST . $user->slug);\r\r\n }\r\r\n return back();\r\r\n }\r\r\n $data['layout'] = getLayout();\r\r\n $active_class = 'lms';\r\r\n if ($type == 'combo' || $type == 'exams' || $type == 'exam') {\r\r\n $active_class = 'exams';\r\r\n }\r\r\n $record = $this->getModelName($type, $slug);\r\r\n // dd($record);\r\r\n $data['active_class'] = $active_class;\r\r\n $data['type'] = $type;\r\r\n $data['slug'] = $slug;\r\r\n $data['request'] = $request;\r\r\n $data['title'] = $record->title;\r\r\n $data['user'] = Auth::user();\r\r\n // return view('payments.razorpayform',$data);\r\r\n $view_name = getTheme() . '::payments.razorpayform';\r\r\n return view($view_name, $data);\r\r\n }\r\r\n $type = $request->type;\r\r\n /**\r\r\n * Get the Item Details based on Type supplied type\r\r\n * If item is valid, prepare the data to save after successfull payment\r\r\n * Preserve the data\r\r\n * Redirect to payment\r\r\n * @var [type]\r\r\n */\r\r\n $item = $this->getPackageDetails($type, $slug);\r\r\n if (!$item) {\r\r\n dd('failed');\r\r\n }\r\r\n $other_details = array();\r\r\n $other_details['is_coupon_applied'] = $request->is_coupon_applied;\r\r\n $other_details['actual_cost'] = $request->actual_cost;\r\r\n $other_details['discount_availed'] = $request->discount_availed;\r\r\n $other_details['after_discount'] = $request->after_discount;\r\r\n $other_details['coupon_id'] = $request->coupon_id;\r\r\n $other_details['paid_by_parent'] = $request->parent_user;\r\r\n $other_details['child_id'] = $request->selected_child_id;\r\r\n /**\r\r\n * If the total amount is 0 after coupon code is applied,\r\r\n * once validate is user is really getting the discount after the coupon is applied\r\r\n * then give subscription for the package\r\r\n * @var [type]\r\r\n */\r\r\n if ($request->after_discount == 0) {\r\r\n $token = $this->preserveBeforeSave($item, $type, $request->gateway, $other_details, 1);\r\r\n if ($this->validateAndApproveZeroDiscount($token, $request)) {\r\r\n //Valid\r\r\n flash('success', 'your_subscription_was_successfull', 'overlay');\r\r\n $user = Auth::user();\r\r\n return redirect(URL_PAYMENTS_LIST . $user->slug);\r\r\n } else {\r\r\n //Cheat\r\r\n flash('Ooops...!', 'invalid_payment_or_coupon_code', 'overlay');\r\r\n $user = Auth::user();\r\r\n return redirect(URL_PAYMENTS_LIST . $user->slug);\r\r\n }\r\r\n return back();\r\r\n }\r\r\n $payment_gateway = $request->gateway;\r\r\n if ($payment_gateway == 'payu') {\r\r\n if (!getSetting('payu', 'module')) {\r\r\n flash('Ooops...!', 'this_payment_gateway_is_not_available', 'error');\r\r\n return back();\r\r\n }\r\r\n $token = $this->preserveBeforeSave($item, $type, $payment_gateway, $other_details);\r\r\n $config = config();\r\r\n $payumoney = $config['indipay']['payumoney'];\r\r\n $payumoney['successUrl'] = URL_PAYU_PAYMENT_SUCCESS . '?token=' . $token;\r\r\n $payumoney['failureUrl'] = URL_PAYU_PAYMENT_CANCEL . '?token=' . $token;\r\r\n $user = Auth::user();\r\r\n $parameters = [\r\r\n 'tid' => $token,\r\r\n 'order_id' => '',\r\r\n 'firstname' => $user->name,\r\r\n 'email' => $user->email,\r\r\n 'phone' => ($user->phone) ? $user->phone : '45612345678',\r\r\n 'productinfo' => $request->item_name,\r\r\n 'amount' => $request->after_discount,\r\r\n 'surl' => URL_PAYU_PAYMENT_SUCCESS . '?token=' . $token,\r\r\n 'furl' => URL_PAYU_PAYMENT_CANCEL . '?token=' . $token,\r\r\n ];\r\r\n return Indipay::purchase($parameters);\r\r\n // URL_PAYU_PAYMENT_SUCCESS\r\r\n // URL_PAYU_PAYMENT_CANCEL\r\r\n } else if ($payment_gateway == 'paypal') {\r\r\n if (!getSetting('paypal', 'module')) {\r\r\n flash('Ooops...!', 'this_payment_gateway_is_not_available', 'error');\r\r\n return back();\r\r\n }\r\r\n $token = $this->preserveBeforeSave($item, $type, $payment_gateway, $other_details);\r\r\n $paypal = new Paypal();\r\r\n $paypal->config['return'] = URL_PAYPAL_PAYMENT_SUCCESS . '?token=' . $token;\r\r\n $paypal->config['cancel_return'] = URL_PAYPAL_PAYMENT_CANCEL . '?token=' . $token;\r\r\n $paypal->invoice = $token;\r\r\n $paypal->add($item->title, $request->after_discount); //ADD item\r\r\n $paypal->pay(); //Proccess the payment\r\r\n } else if ($payment_gateway == 'offline') {\r\r\n if (!getSetting('offline_payment', 'module')) {\r\r\n flash('Ooops...!', 'this_payment_gateway_is_not_available', 'error');\r\r\n return back();\r\r\n }\r\r\n $payment_data = [];\r\r\n foreach (Input::all() as $key => $value) {\r\r\n if ($key == '_token') {\r\r\n continue;\r\r\n }\r\r\n $payment_data[$key] = $value;\r\r\n }\r\r\n $data['active_class'] = 'feedback';\r\r\n $data['payment_data'] = json_encode($payment_data);\r\r\n $data['layout'] = getLayout();\r\r\n $data['title'] = getPhrase('offline_payment');\r\r\n // return view('payments.offline-payment', $data);\r\r\n $view_name = getTheme() . '::payments.offline-payment';\r\r\n return view($view_name, $data);\r\r\n }\r\r\n dd('please wait...');\r\r\n }", "function learndash_enroll_with_zero_price(): void {\n\tif (\n\t\tempty( $_POST['nonce'] ) ||\n\t\t! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'learndash-coupon-nonce' ) ||\n\t\tempty( (int) $_POST['post_id'] ) ||\n\t\t! is_user_logged_in()\n\t) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid request.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if we are processing a course/group.\n\n\t$product = Product::find( (int) $_POST['post_id'] );\n\n\tif ( ! $product ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Product not found.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if the price by coupon is 0.\n\n\ttry {\n\t\t$product_pricing = $product->get_pricing();\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$user = wp_get_current_user();\n\t$price = learndash_get_price_by_coupon( $product_pricing->price, $product->get_id(), $user->ID );\n\n\tif ( $price > 0 ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'You have to pay for access.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Attach a coupon.\n\n\t$coupon_data = learndash_get_attached_coupon_data( $product->get_id(), $user->ID );\n\n\tif ( empty( $coupon_data ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tlearndash_attach_coupon( $product->get_id(), $coupon_data->coupon_id, $product_pricing->price, 0 );\n\n\t// Create a transaction.\n\n\t$transaction_id = learndash_transaction_create(\n\t\tarray(\n\t\t\tTransaction::$meta_key_is_free => true,\n\t\t),\n\t\t$product->get_post(),\n\t\t$user\n\t);\n\n\t$transaction = Transaction::find( $transaction_id );\n\n\tif ( ! $transaction ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Enroll.\n\n\t$product->enroll( $user );\n\n\t// Redirect.\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'redirect_url' => Learndash_Unknown_Gateway::get_url_success(\n\t\t\t\tarray( $product )\n\t\t\t),\n\t\t)\n\t);\n}", "function new_customers_discount( $cart ) {\n // Only for logged in users\n // if ( ! is_user_logged_in() ) return; // We exit\n\n // Only for new customers without orders\n // if ( wc_get_customer_order_count( get_current_user_id() ) != 0 ) return; // We exit\n\n // Set HERE your categories (can be term IDs, slugs or names) in a coma separated array\n // $product = array('', '', '', '', '', '');\n\n $fee_amount = 0;\n\n $discount = 0;\n // Loop through cart items\n\n\n foreach( $cart->get_cart() as $cart_item ){\n \tswitch ($cart_item['product_id']) {\n \t\tcase 2582:\n \t\t$fee_amount = 10;\n \t\t$discount += $cart_item['line_subtotal']*$fee_amount/100;\n \t\tbreak;\n \t\tcase 2591:\n \t\t$fee_amount = 10;\n \t\t$discount += $cart_item['line_subtotal']*$fee_amount/100;\n \t\tbreak;\n \t}\n }\n\n $chosen_gateway = WC()->session->chosen_payment_method;\n \n if ( $chosen_gateway == 'cod' ) {\n \tif ( $fee_amount > 0 ){\n \t\t// $discount = $cart->cart_contents_total * ($fee_amount / 100);\n \t\t$cart->add_fee( __( 'Discount On EasyPaisa Mobile Account', 'woocommerce'), -$discount );\n \t}\n }\n}", "function discountvoucherpurchase_civicrm_postProcess($formName, &$form ) {\n if($formName == 'CRM_Contribute_Form_Contribution_Confirm' && isset($form->_id) && $form->_id == 24){\n $params = array(\n 'code' => $form->_params['contactID'] . '-' . $form->_params['contributionID'],\n 'description' => 'gift from ' . $form->_params['email-5'],\n 'amount' => 100,\n 'amount_type' => 1,\n 'count_max' => 1,\n 'memberships'=> array(7,22),\n 'version' => 3,\n 'multi_valued' => array('memberships' => 1),\n );\n $code = civicrm_api('DiscountCode', 'create', $params);\n }\n}", "public function getDiscountAmount();", "public function getTotalDiscountAmount();", "function learndash_remove_coupon(): void {\n\tif (\n\t\tempty( $_POST['nonce'] ) ||\n\t\t! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'learndash-coupon-nonce' ) ||\n\t\tempty( $_POST['post_id'] ) ||\n\t\t! is_user_logged_in() ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid request.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if we are processing a course/group.\n\n\t$product = Product::find( (int) $_POST['post_id'] );\n\n\tif ( ! $product ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid product.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Detach the coupon.\n\n\tlearndash_detach_coupon( $product->get_id(), get_current_user_id() );\n\n\t// Calculate the price.\n\n\ttry {\n\t\t$product_pricing = $product->get_pricing();\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'total' => array(\n\t\t\t\t'value' => number_format( $product_pricing->price, 2, '.', '' ),\n\t\t\t\t'stripe_value' => learndash_is_zero_decimal_currency( $product_pricing->currency )\n\t\t\t\t\t? $product_pricing->price\n\t\t\t\t\t: intval( $product_pricing->price * 100 ),\n\t\t\t\t'formatted' => esc_html(\n\t\t\t\t\tlearndash_get_price_formatted( $product_pricing->price )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'message' => __( 'Coupon removed.', 'learndash' ),\n\t\t)\n\t);\n}", "function es_cart_change_coupon_label( $html , $coupon){\n\n$html='Discount:';\n\nreturn $html;\n\n}", "public function deleteDiscount();", "public function postApplyCoupon(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $coupon = Coupon::where('coupon_code', $request['coupon_code'])->first();\n $current_date = date('Y-m-d');\n // Kiểm tra coupon có tồn tại không || coupon có vô hiệu hóa không? || coupon có hết hạn không?\n if(!$coupon || $coupon->status == 0 || $coupon->expiry_date < $current_date){\n return redirect()->back()->with('flash_message_error', 'Mã giảm giá \"'.$request['coupon_code'].'\" không hợp lệ (chương trình khuyến mãi tương ứng không tồn tại)');\n }else{\n // Get Tổng tiền trong giỏ hàng\n $session_id = Session::get('session_id');\n $userCart = Cart::where('session_id', $session_id)->get();\n $total_amount = 0;\n foreach($userCart as $cart){\n $total_amount += $cart->attributes->price*$cart->quantity;\n }\n\n // Kiểm tra amount_type\n if($coupon->amount_type == 'fixed'){\n $couponAmount = $coupon->amount;\n }else{\n $couponAmount = $total_amount * ($coupon->amount/100);\n }\n\n // Add Coupon Code & Amount in Session\n Session::put('CouponAmount', $couponAmount);\n Session::put('CouponCode', $request['coupon_code']);\n\n return redirect()->back()->with('flash_message_success', 'Áp dụng mã giảm giá thành công!');\n }\n }", "function applyCouponDiscounts($coupons, $shippingType = null, $cartItems){\n\t\t\t$allTotals = array();\n\t\t\t$allTotals['shippingPrice'] = $this->totals['shippingPrice'];\n\t\t\t$allTotals['giftWrapTotal'] = $this->totals['giftWrapTotal'];\n\t\t\t$allTotals['noTaxNoShipping'] = $this->totals['noTaxNoShipping'];\n\t\t\t$this->totals['discount'] = $this->Coupon->applyCoupons($coupons, $shippingType, $cartItems, $allTotals);\n\t\t\t\n\t\t\t//recalculate grandtotal:\n\t\t\t$grandTotal = 0;\n\t\t\tif(array_sum($allTotals) - $this->totals['discount'] > 0){\n\t\t\t\t$grandTotal = array_sum($allTotals) - $this->totals['discount'];\n\t\t\t}else{\n\t\t\t\t//if discounts are greater than grand total, then change discount to difference:\n\t\t\t\t$this->totals['discount'] = $this->totals['discount'] + (array_sum($allTotals) - $this->totals['discount']);\n\t\t\t}\n\t\t\t$this->totals['total'] = $grandTotal;\n\t\t}", "public function applycoupon($userid,$quoteId,$coupon) { \n \n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and entity_id=$quoteId and store_id=1 and is_active=1\";\n\t\t$result_result = $connection->fetchAll($quote_sql);\n\t\t//print_r($result_result);\n\t\tif(!empty($result_result)) \n\t\t{\n\t\t //$couponCode = $orderData['coupon_code'];\n\t\t $couponCode = $coupon;\n\t\t\t$quoteId=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId);\n\t\t\t\tif($couponCode!='')\n\t\t\t\t{\n\t\t\t\t\t \n\t\t\t\t\t $quote_sql1 = \"Select * FROM salesrule_coupon where code='$couponCode' and expiration_date >NOW()\";\n\t\t $result_result1 = $connection->fetchAll($quote_sql1);\n\t\t\t\t\t if(!empty($result_result1))\n\t\t\t\t\t {\n\t\t\t\t\t\t $quote->setCouponCode($couponCode)->collectTotals();\n\t\t\t\t\t\t $quote->save(); \n\t\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"Success\"));\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Error\"));\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Error\"));\n\t\t\t\t}\n\n \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Error\"));\n\t\t}\n\t \n\t \n\t\treturn $result; \n\t\t \n\t }", "public static function subscriptionDiscountRemoved($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountRemoved', $callback);\n }", "public function cash(Request $request, $subscription_uid) {\n $subscription = \\Acelle\\Model\\Subscription::findByUid($subscription_uid);\n $payment_method = \\Acelle\\Model\\PaymentMethod::getByType(\\Acelle\\Model\\PaymentMethod::TYPE_CASH);\n\n // Check billing information\n if( $this->checkBillingInformation($request, $subscription) !== true ) {\n return redirect()->away($this->checkBillingInformation($request, $subscription));\n }\n\n $payment = new Payment();\n $payment->subscription_id = $subscription->id;\n $payment->payment_method_id = $payment_method->id;\n $payment->status = \\Acelle\\Model\\Payment::STATUS_CASH_MANUAL_CONFIRMATION;\n $payment->action = \\Acelle\\Model\\Payment::ACTION_PAID;;\n $payment->payment_method_name = trans('messages.' . $payment_method->type);\n $payment->order_id = $subscription->getOrderID();\n\n // billing information\n $billing_information = $request->session()->get('billing_information');\n if (isset($billing_information)) {\n $payment->tax_number = $billing_information['tax_number'];\n $payment->billing_address = $billing_information['billing_address'];\n $request->session()->forget('billing_information');\n }\n\n $payment->save();\n\n $request->session()->flash('alert-success', trans('messages.subscription.cash.created'));\n return redirect()->action('AccountController@subscription');\n }", "public function getTonicDiscount()\n {\n }", "public function getDiscountInvoiced();", "function learndash_coupons_init() {\n\t\tadd_action( 'wp_ajax_learndash_apply_coupon', 'learndash_apply_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_remove_coupon', 'learndash_remove_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_enroll_with_zero_price', 'learndash_enroll_with_zero_price' );\n\t\tadd_action( 'learndash_transaction_created', 'learndash_process_coupon_after_transaction' );\n\t\tadd_filter( 'learndash_get_price_by_coupon', 'learndash_get_price_by_coupon', 10, 3 );\n\t}", "public function updateAffectedPlans(Discount $discount)\n {\n }", "function learndash_process_coupon_after_transaction( int $transaction_id ): void {\n\t$transaction = Transaction::find( $transaction_id );\n\n\tif ( ! $transaction ) {\n\t\treturn;\n\t}\n\n\t$product = $transaction->get_product();\n\t$user = $transaction->get_user();\n\n\tif ( ! $product || 0 === $user->ID ) {\n\t\treturn;\n\t}\n\n\tif ( ! learndash_post_has_attached_coupon( $product->get_id(), $user->ID ) ) {\n\t\treturn;\n\t}\n\n\t$coupon_data = learndash_get_attached_coupon_data( $product->get_id(), $user->ID );\n\n\tif ( ! $coupon_data ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tupdate_post_meta(\n\t\t\t$transaction_id,\n\t\t\tLEARNDASH_TRANSACTION_COUPON_META_KEY,\n\t\t\tLearndash_Transaction_Coupon_DTO::create( $coupon_data->to_array() )->to_array()\n\t\t);\n\n\t\tupdate_post_meta(\n\t\t\t$transaction_id,\n\t\t\tTransaction::$meta_key_pricing_info,\n\t\t\tLearndash_Pricing_DTO::create( $coupon_data->to_array() )->to_array()\n\t\t);\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\treturn;\n\t}\n\n\t// Maybe we'll need to filter transactions by a coupon code.\n\tupdate_post_meta(\n\t\t$transaction_id,\n\t\tLEARNDASH_TRANSACTION_COUPON_META_KEY . '_code',\n\t\t$coupon_data->code\n\t);\n\n\tlearndash_increment_coupon_redemptions( $coupon_data->coupon_id, $product->get_id(), $user->ID );\n}", "public function onCartProductAdded($observer)\n {\n /** @var RapidCampaign_Promotions_Helper_Config $configHelper */\n $configHelper = Mage::helper('rapidcampaign_promotions/config');\n\n // Module disabled\n if (!$configHelper->extensionEnabled()) {\n return;\n }\n\n /** @var Mage_Core_Model_Cookie $cookieModel */\n $cookieModel = Mage::getSingleton('core/cookie');\n\n $coupon = $cookieModel->get('coupon_code');\n\n if (!$coupon) {\n return;\n }\n\n /** @var Mage_Checkout_Model_Cart $cartModel */\n $cartModel = Mage::getSingleton('checkout/cart');\n\n /** @var Mage_Checkout_Model_Session $session */\n $session = Mage::getSingleton('checkout/session');\n\n try {\n // Apply coupon to cart\n $cartModel->getQuote()\n ->setCouponCode($coupon)\n ->collectTotals()\n ->save();\n\n if ($coupon != $cartModel->getQuote()->getCouponCode()) {\n $session->addError(\n Mage::helper('core')->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->escapeHtml($coupon))\n );\n }\n } catch (Mage_Core_Exception $e) {\n $session->addError($e->getMessage());\n } catch (Exception $e) {\n $session->addError(Mage::helper('core')->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n // Remove cookie\n $cookieModel->delete('coupon_code');\n\n if (!$configHelper->isFullAnalytics() && $coupon == $cartModel->getQuote()->getCouponCode()) {\n // Set session cookie for rapidcampaign assisted order\n $cookieModel->set('rc_coupon_applied', true, 0, '/');\n }\n }", "public static function coupon($coupon,$product){\n\t\t$coupon = DB::raw ($coupon );\n\t\t$now = date ( \"Y-m-d H:i:s\" );\n\t\t$now =DB::raw($now);\n\n\n\t\t$data = DB::table(\"tm_coupon\")\n\t\t\t\t\t->whereRaw(\"code='$coupon' AND apply > 0 AND status=1 AND active=1 AND date_end > '$now' AND date_start < '$now' \")\n\t\t\t\t\t->get();\n\t\t\n\t\tif(!empty($data[0]->apply)){\n\t\t\t$apply=$data[0]->apply - 1;\n\t\t\tDB::table(\"tm_coupon\")->where(\"code\",\"=\",\"'$coupon'\")->update([\"apply\"=>$apply]);\n\n\t\t\tif(!empty($data[0])){\n\t\t\t\treturn array('type'=>2,'price'=>$data[0]->dis_price,'coupon'=>$data[0]);\n\n\t\t\t}else{\n\t\t\t\treturn array('type'=>3,'price'=>round($data[0]->dis_percent*$product['discount']/100) ,'coupon'=>$data[0]);\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t}", "public function couponPostAction($observer){\r\n\t\tif (!Mage::helper('promotionalgift')->enablePromotionalgift()) return $this;\r\n\t\t\r\n\t\t$action = $observer->getEvent()->getControllerAction();\r\n\t\t$code = trim($action->getRequest()->getParam('coupon_code'));\r\n\t\tif (!$code) \r\n\t\t\treturn $this;\t\t\r\n\t\t$session = Mage::getSingleton('checkout/session');\t\t\r\n\t\t$cart = Mage::getSingleton('checkout/cart');\r\n\t\t$ruleId = '';\t\r\n\t\t$salesRules = Mage::getModel('promotionalgift/shoppingcartrule')->getAvailableCouponRule();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\tforeach($salesRules as $salesRule){\r\n\t\t\tif($salesRule->getCouponCode() == $code){\t\r\n\t\t\t\tif(Mage::helper('promotionalgift')->validateRuleQuote($salesRule)){\t\t\t\r\n\t\t\t\t\t$ruleId = $salesRule->getId();\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\tif ($action->getRequest()->getParam('remove') == 1){\r\n\t\t\tif($session->getData('promptionalgift_coupon_code')){\r\n\t\t\t\t$session->addSuccess(Mage::helper('promotionalgift')->__('Coupon code \"%s\" was canceled.',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$session->getData('promptionalgift_coupon_code')));\t\t\t\r\n\t\t\t\t$session->setData('promptionalgift_coupon_code', null);\t\r\n\t\t\t\t$session->setData('shoppingcart_couponcode_rule_id', null);\t\r\n\t\t\t\t$session->setData('promotionalgift_shoppingcart_rule_id', null);\t\r\n\t\t\t\t$session->setData('promotionalgift_shoppingcart_rule_used', null);\r\n\t\t\t\tif($ruleId){\r\n\t\t\t\t\t$shoppingQuote = Mage::getModel('sales/quote_item');\r\n\t\t\t\t\t$giftItems = Mage::getModel('promotionalgift/shoppingquote')->getCollection()\r\n\t\t\t\t\t\t\t\t\t\t\t\t->addFieldToFilter('shoppingcartrule_id', $ruleId);\r\n\t\t\t\t\tforeach($giftItems as $item){\r\n\t\t\t\t\t\ttry{\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$item->delete();\r\n\t\t\t\t\t\t\t$cart->removeItem($item->getItemId())->save();\r\n\t\t\t\t\t\t}catch(Exception $e){\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t} else {\t\t\t\t\t\t\t\t \r\n\t\t\tif($ruleId){\r\n\t\t\t\tif(!$session->getData('promptionalgift_coupon_code')){\t\t\t\r\n\t\t\t\t\t$session->setData('promptionalgift_coupon_code',$code);\t\t\t\t\t\t\r\n\t\t\t\t\t$session->setData('promotionalgift_shoppingcart_rule_id',$ruleId);\t\t\t\t\t\t\r\n\t\t\t\t\t$quote = Mage::getSingleton('checkout/cart')->getQuote();\t\t\t\r\n\t\t\t\t\t$quote->setCouponCode('');\r\n\t\t\t\t\t$quote->collectTotals()->save();\r\n\t\t\t\t\t$available = false;\r\n\t\t\t\t\tforeach ($quote->getAddressesCollection() as $address){\r\n\t\t\t\t\t\tif (!$address->isDeleted() && $session->getData('promptionalgift_coupon_code') == $code){\r\n\t\t\t\t\t\t\t$available = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\r\n\t\t}\t\r\n\t}", "public function hold_applied_coupon( $coupons_args = array() ) {\n\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$saved_status = array();\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\t$saved_status = $this->save_applied_coupon_in_cookie( $coupons_args );\n\t\t\t} else {\n\t\t\t\t$saved_status = $this->save_applied_coupon_in_account( $coupons_args, $user_id );\n\t\t\t}\n\n\t\t\tif ( ! empty( $saved_status ) ) {\n\t\t\t\tforeach ( $coupons_args as $coupon_args ) {\n\t\t\t\t\t$coupon_code = $coupon_args['coupon-code'];\n\t\t\t\t\t$save_status = isset( $saved_status[ $coupon_code ] ) ? $saved_status[ $coupon_code ] : '';\n\t\t\t\t\tif ( 'saved' === $save_status ) {\n\t\t\t\t\t\t/* translators: %s: $coupon_code coupon code */\n\t\t\t\t\t\t$notice = sprintf( __( 'Coupon code \"%s\" applied successfully. Please add some products to the cart to see the discount.', 'woocommerce-smart-coupons' ), $coupon_code );\n\t\t\t\t\t\t$this->set_coupon_notices( $notice, 'success' );\n\t\t\t\t\t} elseif ( 'already_saved' === $save_status ) {\n\t\t\t\t\t\t/* translators: %s: $coupon_code coupon code */\n\t\t\t\t\t\t$notice = sprintf( __( 'Coupon code \"%s\" already applied! Please add some products to the cart to see the discount.', 'woocommerce-smart-coupons' ), $coupon_code );\n\t\t\t\t\t\t$this->set_coupon_notices( $notice, 'error' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function store(Request $request)\n {\n\n $coupon = Coupons::where('code',$request->coupon_code)->first();\n if(!$coupon){\n return redirect()->route('check.index')->with('error','Inviled coupon code, Please try again');\n }\n $sub = Cart::total();\n session()->put('coupon',[\n 'name' => $coupon->code,\n 'discount' => $coupon->discount(Cart::subtotal(2,'.','')),\n ]);\n return redirect()->route('check.index')->with('success','coupon has been alpplied');\n \n }", "function coupon_code($coupon_code,$conn)\n {\n unset($_SESSION['coupon_code']);\n $sql=\"select * from coupons where code = '$coupon_code'\"; // check coupon code valid\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n \n $current_date=date('Y/m/d'); //take date from system\n $row=$res->fetch_assoc();\n \n \n //condition for check coupon dates are valid\n if(strtotime($row['start'])<=strtotime($current_date) && strtotime($row['end'])>=strtotime($current_date) )\n { \n \n $sql=\"select count(*) as per_coupon from coupon_uses where coupon_id = (select id from coupons where code = '$coupon_code') and coupon_status=1\";\n $res=$conn->query($sql);\n if($res->num_rows <= $row['percoupon']) //condition for check coupon per validation\n {\n $discount_product=array(); //create discount product array\n $x=0;\n \n //take product value from product session\n if(isset($_SESSION['products']) && !empty($_SESSION['products']))\n {\n \n foreach($_SESSION['products'] as $product)\n {\n $p_id=$product['product_code'];\n \n // check coupon apply category\n $sql=\"select coupon_id from coupon_categories where coupon_id=(select id from coupons where code = '$coupon_code') and m_id =(select m_id from products where id=$p_id)\";\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n if(!in_array($p_id,$discount_product))\n {\n $discount_product[$x]=$p_id;\n $x++;\n }\n }\n else\n {\n //check coupon apply products\n $sql=\"select coupon_id from coupon_products where coupon_id=(select id from coupons where code = '$coupon_code') and p_id = $p_id\";\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n if(!in_array($p_id,$discount_product))\n {\n $discount_product[$x]=$p_id;\n $x++;\n }\n }\n else\n {\n $response['msg']=\"5\"; \n }\n }\n }\n }\n else\n {\n $response['msg']=\"4\"; \n }\n \n }\n else\n {\n $response['msg']=\"3\";\n }\n }\n else\n {\n $response['msg']=\"2\";\n }\n }\n else\n {\n \n $response['msg']=\"Invalid Coupon Code.\";\n \n }\n \n \n if(isset($discount_product))\n {\n $coupan_discount=$row['coupon_discount'];\n $coupon_type=$row['coupon_type'];\n \n $discount=0;\n foreach($discount_product as $ds_product)\n {\n //take product price from product session\n $product_price=$_SESSION['products'][$ds_product]['product_price']*$_SESSION['products'][$ds_product]['quantity'];\n $discount=$discount+$product_price;\n }\n \n //apply coupon _type\n if($coupon_type=='Percentage')\n {\n $total_discount=$discount*$coupan_discount/100;\n }\n else\n {\n $total_discount=$coupan_discount;\n }\n \n //check price is grator then extra\n \n if($total_discount>$row['max_discount'])\n {\n $response['discount']=$row['max_discount'];\n }\n else\n {\n $response['discount']=floor($total_discount);\n }\n if($response['discount']==0)\n {\n $response['msg']=\"This Coupon Code is not for this item\";\n }\n else\n {\n //create coupon code session\n $_SESSION['coupon_code']=$coupon_code;\n $response['msg']='ok';\n }\n }\n else\n {\n $response['msg']=\"Invalid Coupon Code.\";\n }\n \n return $response;\n }", "public function getCoupon()\n\t {\n\t $discount = $this->carObj->addSeasonDiscount();\n\t $discount = $this->carObj->addStockDiscount();\n\t \n\t return $coupon = \"Get {$discount}% off the price of your new car.\";\n\t }", "function charge_credit_card() {\n\nif ( is_user_logged_in() ) {\n\t\n\t require 'vendor/autoload.php';\n\n define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n \n ///////////////////////------- FUNCTION CANCEL SUBSCRIPTION --------////////////////////////////\n \n function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }\n \n///////////////////------------- SUBSCRIPTION USERS -----------------/////////////////////\n function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }\n ///////////////////------------- ONCE PAID USERS -----------------/////////////////////\n function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }\n \n ///////////////////////////////--------- FUNCTION END -----------/////////////////////////////////// \nif(!empty($_POST['amount'])) {\n $payment_type = $_POST['payment_type'];\n $card = $_POST['card'];\n $mn = $_POST['mn'];\n $yr = $_POST['yr'];\n $exp = $mn.''.$yr;\n $code = $_POST['code'];\n $fullname = $_POST['fullname'];\n $interval = 30; // 30 days interval\n // monthly subscription $75 (run on authorize live mode only)\n if(isset($payment_type) && $payment_type == \"monthly\") {\n\t $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t \t $amount = $monthpaid;\n \t\t$peramaters = array($amount,$card,$exp,$code,$fullname,$interval);\n \t$ret = createSubscription($peramaters);\n\t\t\n\t\t//print_r($ret); exit(0);\n \t } \n else { \n // cancel monthly subscription first\n global $wpdb;\n \t$current_user = wp_get_current_user();\n\t$user_id = $current_user->ID;\n \t$table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t\tif($subscribe > 0)\n\t\tcancelSubscription($subscribe);\n // pay once $1500 (run on both authorize live and test mode)\n $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n \t\t$amount = $oncepaid;\n\t \t$peramaters = array($amount,$card,$exp,$code,$fullname);\n \t\tchargeCreditCard($peramaters);\n \t\t}\n\n}\n/////////////////////////////////////////////////////////////////////////\n\nif(isset($_GET['subid']) && $_GET['subid'] > 0) { \n \n\t$subid = $_GET['subid'];\n\tcancelSubscription($subid); \n}\n\n\n\n\n/* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\t*/\n\t\n$current_user = wp_get_current_user();\n$username = $current_user->user_login;\n$user_email = $current_user->user_email;\n$user_firstname = $current_user->user_firstname;\n$user_lastname = $current_user->user_lastname;\n$user_id = $current_user->ID;\n$thefullname = $user_firstname?$user_firstname.' '.$user_lastname:'';\t\n ?>\n <style>\n\t #sjkfrm input[type=text] {\n\t\t border:solid 1px #666666;\n\t\tborder-radius: 15px;\n\t\tborder: 2px solid #666666;\n\t\tpadding: 5px; \n\t\theight: 50px; \n\t\t }\n\t.form-control{\n\t\tborder: 2px solid #999 !important;\n\t\tborder-radius: 8px;\n\t\theight:40px !important;\n\t\twidth: 70%;\n\t\t}\n\t.thimg{\n\t\twidth: 70%;\n\t\t}\t\n\t@media only screen and (max-width: 700px) {\n\t\t.form-control{\n\t\t\twidth: 100%;\n\t\t}\n\t\t.thimg{\n\t\twidth: 100%;\n\t\t}\n\t\t}\t\n\t.selbx{\n\t\tborder: 2px solid #999 !important;\n\t\theight:40px !important;\n\t\t}\t \n\t.sbmt{\n\t\tbackground-color:#6dcd62;\n\t\tcolor:#FFF;\n\t\tpadding:12px 35px;\n\t\tborder-radius: 8px;\n\t\tborder: none 0px;\n\t\tmargin-bottom: 20px;\n\t\t}\n\t.sbmt:hover{\n\t\tbackground-color:#090;\n\t\t}\t\n </style>\n <?php \n /* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $oncePaid = $wpdb->get_var( \"SELECT amount FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe == '-' order by id desc\" );\n echo $oncePaid; exit(0);\n if($oncePaid == 1000) {\n\t ?>\n <h2 style=\"color:#7066ce\">You have already paid $1500 for perfect cNanny</h2><br />\n <p>You have already paid $1500 for perfect cNanny. so you need not to be subscribed again</p>\n <?php\n\t $disp = 'style=\"display:none\"';\n\t } else {\n\t$disp = 'style=\"display:block\"';\t \n\t}*/\n ?> \n<form action=\"\" id=\"jkfrm\" method=\"post\" enctype=\"multipart/form-data\" name=\"payment\" autocomplete=\"off\" onsubmit=\"check_exp()\" <?php //echo $disp; ?>>\n\t<style type=\"text/css\">\n #checkout_card_number {\n background-image: url('<?php echo WP_PLUGIN_URL; ?>/authorizejk/cards.png');\n background-position: 3px 3px;\n background-size: 40px 252px; /* 89 x 560 */\n background-repeat: no-repeat;\n padding-left: 48px !important;\n }\n\tlabel span {\n\t\tfont-size:12px;\n\t\tfont-weight:600 !important;\n\t\tcolor:#666 !important;\n\t\t}\n\t/*input.pw {\n -webkit-text-security: disc;\n\t}*/\n\t\n\t\n\t\n\n\n#username,\n#pw {\n display: inline-block;\n width: 150px;\n background: #FFF;\n \tborder: 2px solid #999 !important;\n border-radius: 8px;\n height: 40px !important;\n\tline-height: 40px;\n padding: 0px 5px;\n letter-spacing: 2px;\n\toverflow:hidden;\n}\n#pw {\n -webkit-text-security: disc;\n\t\n}\n\n\n </style>\n <?php\n\t global $wpdb;\n $table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t?>\n <!--<h2 style=\"color:#6dcd62; font-weight:bold;\">$75/month</h2><br />-->\n <?php if(!empty($subscribe)) { \n\tif(empty($ret)) {\n\t\twp_redirect(site_url().'/already-subscribe'); exit(0);\n\t}\n\t?>\n\n <small>Don't worry, you can <a href=\"?subid=<?php echo $subscribe; ?>\" onclick=\"return confirm('Are you sure that you want to cancel monthly subscription from Cnanny?')\">cancel</a> at any time</small><br />\n \n <?php $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <input type=\"radio\" name=\"payment_type\" value=\"yearly\" checked=\"checked\" style=\"clear:both\" /> <label style=\"margin-top:20px;\"> Pay Once $<?php echo $oncepaid; ?> for hiring perfect cNanny</label>\n <?php } else { ?>\n <?php $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75; ?>\n <br />\n <input type=\"radio\" name=\"payment_type\" value=\"monthly\" checked=\"checked\" /> <label> Monthly Subscribe $<?php echo $monthpaid; ?></label>\n <?php } ?>\n <br /><br />\n <img src=\"<?php echo WP_PLUGIN_URL; ?>/authorizejk/cclogos.gif\" class=\"thimg\" /><br /><br />\n <label style=\"\">Full Name <span>(as it appears on your card)</span></label> <input type=\"text\" name=\"fullname\" maxlength=\"80\" required=\"required\" class=\"input-text form-control validate-alpha required\" placeholder=\"\" autocomplete=\"off\" value=\"<?php echo $thefullname; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $monthpaid; ?>\" /><br />\n <label>Card Number <span>(no dashes or spaces)</span></label><input id=\"checkout_card_number\" name=\"card\" required=\"required\" class=\"input-text form-control validate-creditcard required\" type=\"text\" maxlength=\"16\" data-stripe=\"number\" placeholder=\"\" autocomplete=\"off\"><br />\n <script type=\"text/javascript\">\n\t$ = jQuery.noConflict();\n var $cardinput = $('#checkout_card_number');\n $('#checkout_card_number').validateCreditCard(function(result)\n {\t\t\n //console.log(result);\n if (result.card_type != null)\n {\t\t\t\t\n switch (result.card_type.name)\n {\n case \"visa\":\n $cardinput.css('background-position', '3px -34px');\n $cardinput.addClass('card_visa');\n break;\n \n case \"visa_electron\":\n $cardinput.css('background-position', '3px -72px');\n $cardinput.addClass('card_visa_electron');\n break;\n \n case \"mastercard\":\n $cardinput.css('background-position', '3px -110px');\n $cardinput.addClass('card_mastercard');\n break;\n \n case \"maestro\":\n $cardinput.css('background-position', '3px -148px');\n $cardinput.addClass('card_maestro');\n break;\n \n case \"discover\":\n $cardinput.css('background-position', '3px -186px');\n $cardinput.addClass('card_discover');\n break;\n \n case \"amex\":\n $cardinput.css('background-position', '3px -223px');\n $cardinput.addClass('card_amex');\n break;\n \n default:\n $cardinput.css('background-position', '3px 3px');\n break;\t\t\t\t\t\n }\n } else {\n $cardinput.css('background-position', '3px 3px');\n }\n \n // Check for valid card numbere - only show validation checks for invalid Luhn when length is correct so as not to confuse user as they type.\n if (result.length_valid || $cardinput.val().length > 16)\n {\n if (result.luhn_valid) {\n $cardinput.parent().removeClass('has-error').addClass('has-success');\n } else {\n $cardinput.parent().removeClass('has-success').addClass('has-error');\n }\n } else {\n $cardinput.parent().removeClass('has-success').removeClass('has-error');\n }\n });\n\t//------------------------------------------------------\n\tfunction check_exp() {\n\tvar yr = document.getElementById(\"yrt\").value;\t\n\tvar currentTime = new Date();\n\tvar curr_month = currentTime.getMonth() + 1;\n\tvar theyear = <?php echo date('y'); ?>;\n\tif(yr == theyear) {\n\t\tvar mnt = document.getElementById(\"mnt\").value;\n\t\tif(mnt < curr_month) {\n\t\t\talert('Please select a valid Expiry Date');\n\t\t\t}\n\t}\n\t\n}\n\nfunction set_type() { //\n\tvar pw = $('#pw').text();\n\tdocument.getElementById(\"code\").value = pw;\n\t//alert(pw);\n\t}\n \n </script>\n \n <label>Expiry Date</label><br />\n <select name=\"mn\" class=\"selbx required\" id=\"mnt\" required>\n <option value=\"\">Select Month</option>\n <option value=\"01\">January</option>\n <option value=\"02\">February</option>\n <option value=\"03\">March</option>\n <option value=\"04\">April</option>\n <option value=\"05\">May</option>\n <option value=\"06\">June</option>\n <option value=\"07\">July</option>\n <option value=\"08\">August</option>\n <option value=\"09\">September</option>\n <option value=\"10\">October</option>\n <option value=\"11\">November</option>\n <option value=\"12\">December</option>\n </select>\n <select name=\"yr\" class=\"selbx required\" id=\"yrt\" required onchange=\"check_exp()\">\n <option value=\"\">Select Year</option>\n \n\n <?php \n $y = date('y');\n for($i=1;$i<=12;$i++) {\n ?>\n <option value=\"<?php echo $y; ?>\"><?php echo '20'.$y; ?></option>\n <?php $y++; } ?>\n </select>\n <br />\n <input type=\"text\" name=\"card_number\" value=\"0000 0000 0000 0000\" style=\"display:none\" /><br />\n \n <?php\n if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0) { // Firefox\n ?>\n\t <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"password\" id=\"codeff\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /><br />\n\t<?php\n} else { // other browsers\n ?>\n <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"hidden\" id=\"code\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /> <br /><div contenteditable id=\"pw\"></div><br /><br />\n <?php\n}\n ?> \n\n\n \n\n \n \n <?php if(!empty($subscribe)) { \n\t\n\t $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <strong id=\"st\">You will be charged $<?php echo $oncepaid; ?> for hiring perfect cNanny</strong><br /><br />\n <?php } else { \n\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t?>\n <strong id=\"st\">You will be charged $<?php echo $monthpaid; ?> every month</strong><br /><br />\n <?php } ?>\n \n <!-- prevent auto save in browser-->\n <div style=\"display:none\">\n <input type=\"text\" name=\"cardinfo\" id=\"txtUserName\" value=\"0000 0000 0000 0000\"/>\n\t<input type=\"text\" name=\"txtPass\" id=\"txtPass\" value=\"9999999999\"/>\n </div>\n \n \n <input type=\"submit\" class=\"sbmt\" value=\"Pay Now\" onclick=\"set_type();\" /><br />\n <strong>Don't want to pay right now?</strong> <a href=\"<?php echo site_url(); ?>/parent-search\">Continue browsing</a><br />\n <strong>Questions?</strong> <a href=\"<?php echo site_url(); ?>/contact-us\">Contact us</a>\n <script>document.addEventListener('contextmenu', event => event.preventDefault());\n payment.setAttribute( \"autocomplete\", \"off\" ); payment.code.setAttribute( \"autocomplete\", \"off\" );\n\thideFrm(); //hide form and show success massage\n </script>\n</form><br />\n<script>\nhideFrm(); //hide form and show success massage\n</script>\n <?php\n\t} else {\n\t\twp_redirect('login');\n\t\t}\n}", "public function removeCoupon()\n {\n $this->coupon = null;\n foreach ($this->order_configurations as $config) {\n $config->calculateFinalPrice();\n }\n $this->save();\n }", "public function applyCoupon(CouponContract $coupon)\n {\n $this->coupons[$coupon->code] = $coupon;\n\n $this->update();\n }", "public function applyDiscount(string $subscriptionId, string $couponId): ApiResponse\n {\n return $this->update($subscriptionId, [\n 'coupon' => $couponId,\n ]);\n }", "public function getBaseDiscountRefunded();", "function _apply_auto_disc()\n\t{\n\t\t$num_items = $this->cart->total_items();\n\t\t$auto_disc_info = null;\n\n\t\tforeach ($this->auto_disc_array as $cart_items => $disc_info)\n\t\t{\n\t\t\tif($num_items >= $cart_items)\n\t\t\t{\n\t\t\t\t$auto_disc_info = $disc_info;\n\t\t\t}\n\t\t}\n\n\t\t$applied_disc = $this->cart->discount_info();\n\n\t\t//auto discount should be more than the applied disc (if any)\n\t\tif($applied_disc['percentage'] < $auto_disc_info['percentage'])\n\t\t{\n\t\t\t$this->_apply_discount( $auto_disc_info['coupon'] );\n\t\t}\t\t\n\t}", "public function subscribeDuringCheckout($order)\n {\n // If subscription option chosen, then subscribe\n if (isset($_REQUEST['emailchef_subscribe2']) && $_REQUEST['emailchef_subscribe2']) {\n try {\n Mage::getModel('newsletter/subscriber')->subscribe($order->getCustomerEmail());\n } catch (Exception $e) {\n }\n }\n }", "public function record_subscription_payment() { }", "public function woocommerce_modern_coupon_cart() {\n\n\t\t\tif ( wc_coupons_enabled() ) {\n\t\t\t\t?>\n\t\t\t<div id=\"ast-checkout-coupon\">\n\t\t\t\t<p id=\"ast-coupon-trigger\"><?php esc_attr_e( 'Have a coupon?', 'astra-addon' ); ?></p>\n\t\t\t\t<div class=\"coupon\">\n\t\t\t\t<label class=\"ast-coupon-label\" for=\"ast-coupon-code\" ><?php esc_attr_e( 'coupon:', 'astra-addon' ); ?></label>\n\t\t\t\t\t<input type=\"text\" name=\"ast-coupon-code\" id=\"ast-coupon-code\" value=\"\" placeholder=\"<?php esc_attr_e( 'Coupon code', 'astra-addon' ); ?>\" />\n\t\t\t\t\t<a class=\"button\" id=\"ast-apply-coupon\" name=\"ast-apply-coupon\" value=\"<?php esc_attr_e( 'Apply', 'astra-addon' ); ?>\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Apply', 'astra-addon' ); ?>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}", "public function adddiscountAction() {\n $request = $this->getRequest();\n\n if ( $request->isPost() ){\n $post = $request->getPost();\n\n $discountCodeId = $post['discountId'];\n\n if(!is_null($discountCodeId)) {\n\n //create discount object\n try {\n $rabatt = new Yourdelivery_Model_Rabatt_Code(null, $discountCodeId);\n\n $count = 0;\n foreach ($this->company->getEmployees() as $employeer) {\n $t = $employeer;\n\n //create customer object\n try {\n //$customer = new Yourdelivery_Model_Customer(1123);\n\n //add discount to the customer\n if (!$employeer->setDiscount($rabatt)) {\n $this->error(__b(\"Discount code could not associated to customer \") . $customer->getPrename() . ' ' . $customer->getName() . '(#' . $customer->getId());\n }\n\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n $this->error(__b(\"Customer %s %s (#%s) is non-existant\", $customer->getPrename(), $customer->getName(), $customer->getId()));\n }\n \n $count++;\n }\n\n if ($count == 0) {\n $this->success(__b(\"Company doesn't have employees. Discount code could not be associated to anyone\"));\n }\n else {\n $this->success(__b(\"Discount code %s was successfully associated to %s employees\", $rabatt->getName(), $count));\n $this->logger->adminInfo(sprintf(\"Discount code %s (#%d) was assigned to %d employeers of company #%d\",\n $rabatt->getName(), $rabatt->getId(), $count, $this->company->getId()));\n }\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n $this->error(__b(\"This discount code is non-existant\"));\n }\n\n }\n }\n\n return $this->_redirect('/administration_company_edit/assoc/companyid/' . $this->company->getId());\n }", "public function smart_coupons_discounted_totals( $total = 0, $cart = null, $cart_contains_subscription = false, $calculation_type = '' ) {\n\n\t\t\tif ( empty( $total ) ) {\n\t\t\t\treturn $total;\n\t\t\t}\n\n\t\t\t$applied_coupons = ( is_object( WC()->cart ) && is_callable( array( WC()->cart, 'get_applied_coupons' ) ) ) ? WC()->cart->get_applied_coupons() : array();\n\n\t\t\t$smart_coupon_credit_used = ( is_object( WC()->cart ) && isset( WC()->cart->smart_coupon_credit_used ) ) ? WC()->cart->smart_coupon_credit_used : array();\n\n\t\t\tif ( ! empty( $applied_coupons ) ) {\n\t\t\t\tforeach ( $applied_coupons as $code ) {\n\t\t\t\t\t$request_wc_ajax = ( ! empty( $_REQUEST['wc-ajax'] ) ) ? wc_clean( wp_unslash( $_REQUEST['wc-ajax'] ) ) : ''; // phpcs:ignore\n\t\t\t\t\t$ignore_ajax_action = array( 'update_order_review', 'checkout' );\n\t\t\t\t\tif ( ! empty( $request_wc_ajax ) && in_array( $request_wc_ajax, $ignore_ajax_action, true ) && array_key_exists( $code, $smart_coupon_credit_used ) && true !== $cart_contains_subscription && ! isset( WC()->session->reload_checkout ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$coupon = new WC_Coupon( $code );\n\t\t\t\t\t$discount = $this->sc_cart_get_discount_amount( $total, $coupon );\n\n\t\t\t\t\tif ( ! empty( $discount ) ) {\n\t\t\t\t\t\t$discount = min( $total, $discount );\n\t\t\t\t\t\t$total = $total - $discount;\n\t\t\t\t\t\t$this->manage_smart_coupon_credit_used( $coupon, $discount, $cart_contains_subscription, $calculation_type );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $total;\n\t\t}", "function regenerateCouponArticle() {\r\n\r\n\t\t$coupons = $this->getSessionCoupons();\r\n\r\n\t\t$behind = $this->getSessionCoupons_discountOnly();\r\n\t\tif(is_array($behind)){\r\n\t\t $coupons2 = array();\r\n\t\t while(list($k,$v) = each($behind)){\r\n\t\t\t unset($coupons[$k]);\r\n\t\t \t if($v['record']['type']<>'percent'){\r\n\t\t\t $coupons[$k] = $v;\r\n\t\t\t }else{\r\n\t\t\t\t$coupons2[$k] = $v;\r\n\t\t\t }\r\n\t\t }\r\n\t\t while(list($k,$v) = each($coupons2)){\r\n\t\t $coupons[$k] = $v;\r\n\t\t }\r\n\t\t}\r\n\t\t// we have 2 article types: 1) having a related article (e.g. trial article) and only moneydiscount\r\n\t\t$couponArticleUids_type1 = $this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']);\t// was 4\r\n\t $couponArticleUids_type2 = $this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType']);\t// was 5\r\n\t\t$couponArticleUids = array_merge($couponArticleUids_type1,$couponArticleUids_type2);\r\n\t\t\t// erstmal alle coupon artikel l�schen:\r\n\t\tforeach($couponArticleUids as $couponArticleUid) {\r\n\t\t\tif($this->basket->basket_items[$couponArticleUid]) {\r\n\r\n\t\t\t\t$this->basket->delete_article($couponArticleUid);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!count($coupons)) return false;\r\n\r\n\t\treset($coupons);\r\n\r\n\t\t$b = &$this->basket->basket_items;\r\n\t\t\t// dann alle neu generieren\r\n\t\tforeach($coupons as $coupon) {\r\n\r\n\t\t\tif($coupon['record']['type']=='percent'){\r\n\t\t\t\t$coupon = $this->getCouponData($coupon['uid'],true);\r\n\t\t\t}\r\n\r\n\t\t\t\t// add coupon article to the basket or add quantity to existing article\r\n\t\t\tif($b[$coupon['articleId']]->quantity) {\r\n\r\n\t\t\t\t$previous_price_net = $b[$coupon['articleId']]->get_price_net();\r\n\t\t\t\t$previous_price_gross = $b[$coupon['articleId']]->get_price_gross();\r\n\t\t\t\t$b[$coupon['articleId']]->tx_commercecoupons_addedbycouponid[] = $coupon['uid'];\r\n\t\t\t\t$b[$coupon['articleId']]->related_coupon = $coupon['uid'];\r\n\t\t\t\t$b[$coupon['articleId']]->setPriceNet($previous_price_net+$coupon['price_net']);\r\n\t\t\t\t$b[$coupon['articleId']]->setPriceGross($previous_price_gross+$coupon['price_gross']);\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$this->basket->add_article($coupon['articleId']);\r\n\t\t\t\t$b[$coupon['articleId']]->tx_commercecoupons_addedbycouponid = array($coupon['uid']);\r\n\t\t\t\t$b[$coupon['articleId']]->related_coupon = array($coupon['uid']);\r\n\t\t\t\t$this->basket->changePrices($coupon['articleId'],$coupon['price_gross'],$coupon['price_net']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$this->basket->store_data();\r\n\t}", "public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"&#039;\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }", "function apply_deals_discounts_after_tax( $values, $price ) {\n\t\t\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tdo_action( 'cmdeals_deals_discount_after_tax_' . $coupon->type, $coupon );\n\t\t\t\t\n\t\t\t\tif ($coupon->type!='fixed_deals' && $coupon->type!='percent_deals') continue;\n\t\t\t\t\n\t\t\t\tif ( !$coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\n\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\telse :\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\n\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t// Apply filter\n\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = false );\n\t\t\t\t\t\n\t\t\t\t\t// Apply the discount\n\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + ( $price / 100 ) * $coupon->amount;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t}", "function shopcart($coupon_code = ''){ \n\n if($coupon_code == ''){ \n\n $MAC = exec('getmac');\n $MAC = strtok($MAC,' ');\n\n $ip= $_SERVER['REMOTE_ADDR'];\n $data = Cart::where('mac_address',$MAC)->where('customer_ip',$ip)->get();\n $discount = 0;\n $grandtotal= 0;\n\n $totals = 0;\n foreach ($data as $value) {\n $totals += Product::findOrfail($value->product_id)->product_price * $value->product_quantity;\n }\n $grandtotal= $totals;\n session(['grand_total'=> $grandtotal]);\n\n session(['totals'=> $totals]);\n\n\n return view('frontend.product.shop_carts', compact('totals','discount','grandtotal'));\n }\n else{\n \n if(Coupon::where('coupon_code',$coupon_code)->exists()){ \n \n if(Carbon::now()->format('Y-m-d')<= Coupon::where('coupon_code',$coupon_code)->first()->coupon_validity ){\n\n \n $MAC = exec('getmac');\n $MAC = strtok($MAC,' ');\n\n $ip= $_SERVER['REMOTE_ADDR'];\n $data = Cart::where('mac_address',$MAC)->where('customer_ip',$ip)->get();\n\n $disamount = Coupon::where('coupon_code',$coupon_code)->first()->coupon_discount;\n $totals = 0;\n $grandtotal= 0;\n\n\n foreach ($data as $value) {\n $totals += Product::findOrfail($value->product_id)->product_price * $value->product_quantity;\n }\n\n $discount = $totals*$disamount/100; \n\n\n $grandtotal= $totals - $discount;\n session(['grand_total'=> $grandtotal]);\n session(['discount'=> $discount]);\n session(['totals'=> $totals]);\n return view('frontend.product.shop_carts', compact('totals','discount','grandtotal'));\n\n }\n\n else{\n return back()->with('errorMsg','Coupon Expired!');\n }\n\n\n }\n else{\n return back()->with('errorMsg','Invalid Coupon Code');\n }\n }\n\n\n\n }", "function cart_frontend( ) {\n\tglobal $woocommerce;\n\t$args = array(\n\t\t'posts_per_page' => -1,\n\t\t'post_type' => 'shop_coupon',\n\t\t'post_status' => 'publish'\n\t);\n\t$coupons = get_posts( $args );\n\tforeach ( $coupons as $coupon ) {\n\t\tif ( get_post_meta( $coupon->ID, 'freeproductid', true ) != '' ) {\n\t\t\t$coupontitle = $coupon->post_title;\n\t\t\t$product_id = get_post_meta( $coupon->ID, 'freeproductid', true );\n\t\t\tif( in_arrayi( $coupontitle, $woocommerce->cart->applied_coupons ) ){\n\t\t\t\t//check if product already in cart\n\t\t\t\tif ( sizeof( $woocommerce->cart->get_cart( ) ) > 0 ) {\n\t\t\t\t\tforeach ( $woocommerce->cart->get_cart( ) as $cart_item_key => $values ) {\n\t\t\t\t\t\t$_product = $values['data'];\n\t\t\t\t\t\tif ( $_product->id == $product_id )\n\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t}\n\t\t\t\t\t// if product not found, add it\n\t\t\t\t\tif ( ! $found )\n\t\t\t\t\t\t$woocommerce->cart->add_to_cart( $product_id );\n\t\t\t\t} else {\n\t\t\t\t\t// if no products in cart, add it\n\t\t\t\t\t$woocommerce->cart->add_to_cart( $product_id );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue;\n\t\t}\n\t}\n}", "function edd_downloads_ajax_apply_discount(){\n\n\t$existing_discount \t= edd_get_cart_discounts();\n\t$discount_code \t\t= $_POST['code'];\n\tif(!empty($existing_discount) && in_array($discount_code, $existing_discount)){\n\t\t$return['msg'] = __('This code has already been applied','edd_downloads');\n\t\tedd_unset_error( 'edd-discount-error' );\n\t\t\n\t\t// Allow for custom discount code handling\n\t\t$return = apply_filters( 'edd_ajax_discount_response', $return );\n\n\t\techo json_encode($return);\t\t\t\t\t\n\t}else{\n\t\tedd_ajax_apply_discount();\n\t}\n\tedd_die();\t\n}", "function buy_annual_subscription_action() {\n // Annual subscription + membership product ID: 11327\n $product_id = 11326;\n $added_product = WC()->cart->add_to_cart($product_id);\n\n if ($added_product !== '') {\n echo \"Subscription added to cart!\";\n } else {\n echo \"Subscription not add to cart!\";\n }\n\n wp_die();\n }", "public function index()\n {\n ///start global count..........................\n global $count;//amount of people that can be registered by the company\n $user = auth()->user()->id;\n// $stripe = DB::table('subscription_items')->where('subscription_id', $user)->first();\n// if($stripe == \"null\"){\n// return back()->with('success',\"Subscription was not successful, Please Subscribe again.\");\n// }\n\n\n ///find payment record\n /// $flight = Flight::where('active', 1)->first();\n $payment = Money::where('user_id', $user)->first();\n\n $count = $payment->quantity;\n // dd($stripe->stripe_plan);\n //6 months///////////////////////////////\n //5 - 50\n// if($stripe->stripe_plan == 'price_1IBbycHUeyKZTcreaYYdqOnR'){\n// //count\n// $count = 50;\n//\n//\n// //51 - 100\n// }else if($stripe->stripe_plan == 'price_1IBbzgHUeyKZTcre8i2EXKrG'){\n// //count = 100 for 6 months\n// $count = 100;\n//\n//\n// //101 to 1000\n// }else if($stripe->stripe_plan == 'price_1IBc3ZHUeyKZTcrezbCk70Fi'){\n// //count = 1000 for 6 months\n// $count = 1000;\n//\n//\n// //1001 and above\n// }else if($stripe->stripe_plan == 'price_1IBc9iHUeyKZTcre83b2JINE') {\n// //count = 1001 and above for 6 months\n// $count = 10000000;\n//\n//\n//\n//\n//\n// //12 months\n// //5 - 50\n// }else if($stripe->stripe_plan == 'price_1IBc9iHUeyKZTcre83b2JINE'){\n// //count = 50 for 12 months\n// $count = 50;\n//\n//\n// //51 - 100\n// }else if($stripe->stripe_plan == 'price_1IBcAcHUeyKZTcreVnR3TJ5Q'){\n// //count = 100 for 12 months\n// $count = 100;\n//\n//\n// //101 to 1000\n// }else if($stripe->stripe_plan == 'price_1IBcCprice_1IBcCEHUeyKZTcreG2eSKVAQEHUeyKZTcreG2eSKVAQ'){\n// //count = 1000 for 12 months\n// $count = 1000;\n//\n// //1001 and above\n// }else if($stripe->stripe_plan == 'price_1IBcDKHUeyKZTcreefieAcV6'){\n// //count = 1001 and above for 12 months\n// $count = 10000000;\n//\n// //free trial\n// }else{\n// //count = 0\n// $count = 5;\n// }\n ///end global count..........................\n return view('corporate.index', ['count' => $count]);\n }", "public function update(Request $request, $id)\n {\n // if(count(Coupon::where('id', '!=' , $id)->where('code', $request->coupon_code)->get()) > 0){\n // flash(translate('Coupon already exist for this coupon code'))->error();\n // return back();\n // }\n\n // $coupon = Coupon::findOrFail($id);\n // if ($request->coupon_type == \"product_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $cupon_details = array();\n // foreach($request->product_ids as $product_id) {\n // $data['product_id'] = $product_id;\n // array_push($cupon_details, $data);\n // }\n // $coupon->details = json_encode($cupon_details);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n // elseif ($request->coupon_type == \"cart_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $data = array();\n // $data['min_buy'] = $request->min_buy;\n // $data['max_discount'] = $request->max_discount;\n // $coupon->details = json_encode($data);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "function learndash_attach_coupon( int $post_id, int $coupon_id, float $price, float $discounted_price ): void {\n\tif ( ! is_user_logged_in() ) {\n\t\treturn;\n\t}\n\n\t$coupon_settings = learndash_get_setting( $coupon_id );\n\n\ttry {\n\t\t$coupon_dto = Learndash_Coupon_DTO::create(\n\t\t\tarray(\n\t\t\t\t'currency' => learndash_get_currency_code(),\n\t\t\t\t'price' => $price,\n\t\t\t\t'discount' => $price - $discounted_price,\n\t\t\t\t'discounted_price' => $discounted_price,\n\t\t\t\t'coupon_id' => $coupon_id,\n\t\t\t\tLEARNDASH_COUPON_META_KEY_CODE => $coupon_settings[ LEARNDASH_COUPON_META_KEY_CODE ],\n\t\t\t\tLEARNDASH_COUPON_META_KEY_TYPE => $coupon_settings[ LEARNDASH_COUPON_META_KEY_TYPE ],\n\t\t\t\tLEARNDASH_COUPON_META_KEY_AMOUNT => $coupon_settings[ LEARNDASH_COUPON_META_KEY_AMOUNT ],\n\t\t\t)\n\t\t);\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\treturn;\n\t}\n\n\tset_transient(\n\t\tlearndash_map_coupon_transient_key( $post_id, get_current_user_id() ),\n\t\t$coupon_dto->to_array(),\n\t\tDAY_IN_SECONDS\n\t);\n}", "public function getDiscountTaxCompensationRefunded();", "function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/** \n\t\t\t\t\t\t\t * This is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}", "public function apply_coupon(){\n $customer_id = $_REQUEST['customer_id'];\n $coupon_code = $_REQUEST['coupon_code'];\n $cart_total = $_REQUEST['order_total_amount'];\n $today = date('d-m-Y');\n\n $coupon_info = $this->User_Model->get_info_arr('coupon_code', $coupon_code, 'coupon');\n if($coupon_info){\n $coupon_used_count = $this->User_Model->get_count('coupon_used_id','coupon_id',$coupon_info[0]['coupon_id'],'customer_id',$customer_id,'coupon_used_status','1','coupon_used');\n if($coupon_info[0]['coupon_status'] == 0 ){\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Invalid Coupon Code';\n } elseif ( strtotime($coupon_info[0]['coupon_exp_date']) < strtotime($today)) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'This Coupon Code is Expired';\n } elseif ($cart_total > $coupon_info[0]['coupon_max_spend'] || $cart_total < $coupon_info[0]['coupon_min_spend']) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Cart Amount is Out of Range';\n } elseif ($coupon_used_count >= $coupon_info[0]['limit_per_user']) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'This Coupon Usage is Expired';\n } else{\n $response[\"status\"] = TRUE;\n $response['msg'] = 'Coupon Applied Successfully';\n $response['coupon_id'] = $coupon_info[0]['coupon_id'];\n $response['coupon_code'] = $coupon_info[0]['coupon_code'];\n $response['coupon_amt'] = $coupon_info[0]['coupon_amt'];\n }\n } else{\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Invalid Coupon Code';\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "function create_new_listing_actions_renew_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = db_query('SELECT order_id FROM commerce_order WHERE status = :status AND type = :type AND uid = :uid ORDER BY order_id DESC LIMIT 1', array(':status' => 'canceled', ':type' => 'recurring', ':uid' => $uid));\r\n\r\n $result = $query->fetchField();\r\n\r\n if (!$result) {\r\n drupal_set_message(t('Unable to find billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load($result);\r\n $order->status = 'recurring_open';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription will be renewed automatically.'));\r\n}", "function _reconfirm_cheat_code()\n\t{\n\t\t//If discount is applied, do a conditional-check again\n\t\tif($this->cart->is_discount_applied())\n\t\t{\n\t\t\t$coupon = $this->cart->discount_info();\n\t\t\tif($this->_can_apply_code($coupon) == false)\n\t\t\t{\n\t\t\t\t$this->cart->remove_discount();\n\t\t\t}\n\t\t}\n\t}", "public function actionCoupon(){\n // Redirect away if he has billing setup previously.\n // Not allowed if customer already has used billing\n if(count(Yii::$app->user->identity->billings)>0){\n $this->redirect('index');\n }\n\n // Attempt to post coupon\n if($couponCode = Yii::$app->request->post('coupon')){\n $agentEmail = Yii::$app->user->identity->agent_email;\n $coupon = \\common\\models\\Coupon::find()->where(['coupon_name' => $couponCode])->one();\n if(!$coupon){\n Yii::error(\"[Invalid Coupon Attempted ($couponCode)] Agent: $agentEmail\", __METHOD__);\n Yii::$app->getSession()->setFlash('error', \"[Invalid Coupon Code] This coupon code is not valid.\");\n }else{\n $errors = false;\n\n // Check if its at user limit\n if($coupon->isAtUserLimit() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Invalid Coupon] This coupon is no longer valid.\");\n Yii::error(\"[Attempted to redeem coupon thats already reached limit ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n // Check if coupon expiry date passed\n if($coupon->isExpired() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Coupon Expired] This coupon has expired on \".Yii::$app->formatter->asDate($coupon->coupon_expires_at, \"long\").\".\");\n Yii::error(\"[Attempted to redeem expired coupon ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n //If customer already has used a coupon previously\n if(\\common\\models\\CouponUsed::findOne(['agent_id' => Yii::$app->user->identity->agent_id]) && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Unable to use coupon] You have already used a coupon\");\n Yii::error(\"[Unable to use coupon ($couponCode)] You've already used a coupon. Agent: $agentEmail\", __METHOD__);\n }\n\n if(!$errors){\n // Redeem coupon for that agent\n $trialDaysToExtend = $coupon->coupon_reward_days;\n\n // Extend Trial for Agent\n $agent = Yii::$app->user->identity;\n $agent->agent_trial_days = $agent->agent_trial_days + $trialDaysToExtend;\n $agent->save(false);\n\n // Enable Agent and his Managed Accounts\n $agent->enableAgentAndManagedAccounts();\n\n // Mark Coupon Usage\n $couponUsage = new \\common\\models\\CouponUsed;\n $couponUsage->agent_id = $agent->agent_id;\n $couponUsage->coupon_id = $coupon->coupon_id;\n $couponUsage->save();\n\n Yii::$app->getSession()->setFlash('success', \"[Coupon Redeemed] Your trial has been extended by $trialDaysToExtend days\");\n Yii::info(\"[Coupon used ($couponCode) by $agentEmail] Trial has been extended by $trialDaysToExtend days.\", __METHOD__);\n }\n\n }\n }\n\n return $this->render('coupon');\n }", "public function process_published_scheduled_coupon( $coupon_id = 0 ) {\n\n\t\t\t$post_type = get_post_type( $coupon_id );\n\t\t\tif ( 'shop_coupon' !== $post_type ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$coupon = new WC_Coupon( $coupon_id );\n\t\t\tif ( is_a( $coupon, 'WC_Coupon' ) ) {\n\t\t\t\t$order_id = get_post_meta( $coupon_id, 'generated_from_order_id', true );\n\t\t\t\t$order = wc_get_order( $order_id );\n\t\t\t\tif ( is_a( $order, 'WC_Order' ) ) {\n\t\t\t\t\t$coupon_receiver_details = get_post_meta( $coupon_id, 'wc_sc_coupon_receiver_details', true );\n\t\t\t\t\tif ( ! empty( $coupon_receiver_details ) && is_array( $coupon_receiver_details ) ) {\n\t\t\t\t\t\t$parent_id = $coupon_receiver_details['coupon_details']['parent'];\n\t\t\t\t\t\t$receiver_email = $coupon_receiver_details['gift_certificate_receiver_email'];\n\t\t\t\t\t\t$gift_certificate_sender_name = $coupon_receiver_details['gift_certificate_sender_name'];\n\t\t\t\t\t\t$gift_certificate_sender_email = $coupon_receiver_details['gift_certificate_sender_email'];\n\t\t\t\t\t\t$sending_timestamp = get_post_time( 'U', true, $coupon_id ); // Get coupon publish timestamp.\n\t\t\t\t\t\t$action_args = array(\n\t\t\t\t\t\t\t'auto_generate' => 'yes',\n\t\t\t\t\t\t\t'coupon_id' => $coupon_id,\n\t\t\t\t\t\t\t'parent_id' => $parent_id, // Parent coupon id.\n\t\t\t\t\t\t\t'order_id' => $order_id,\n\t\t\t\t\t\t\t'receiver_email' => $receiver_email,\n\t\t\t\t\t\t\t'message_index_key' => '',\n\t\t\t\t\t\t\t'ref_key' => uniqid(), // A unique timestamp key to relate action schedulers with their coupons.\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$is_scheduled = $this->schedule_coupon_email( $action_args, $sending_timestamp );\n\t\t\t\t\t\tif ( ! $is_scheduled ) {\n\t\t\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* translators: 1. Receiver email 2. Coupon code 3. Order id */\n\t\t\t\t\t\t\t$this->log( 'error', sprintf( __( 'Failed to schedule email to \"%1$s\" for coupon \"%2$s\" received from order #%3$s.', 'woocommerce-smart-coupons' ), $receiver_email, $coupon_code, $order_id ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function syncCoupon(): void\n {\n $stripeCoupon = $this->asStripeCoupon();\n\n $this->valid = $stripeCoupon->valid;\n\n $this->times_redeemed = $stripeCoupon->times_redeemed;\n\n $this->save();\n }", "private function updateProductDiscount(\n ProductInterface $product,\n Request $request\n ): void {\n $discountPercent = $request->request->get('discount_percent') !== '' ? (float) $request->request->get('discount_percent') : null;\n $discountLimitType = $request->request->get('discount_limit_type') !== '' ? $request->request->get('discount_limit_type') : null;\n $discountFromDate = $request->request->get('discount_from_date') !== '' ? $request->request->get('discount_from_date') : null;\n $discountToDate = $request->request->get('discount_to_date') !== '' ? $request->request->get('discount_to_date') : null;\n\n $variants = $product->getVariants();\n foreach ($variants as $variant) {\n // Variant to change\n $variantPricing = $variant->getChannelPricings()->first();\n\n // Change percent\n if ($discountPercent !== null) {\n $variantPricing->setDiscount($discountPercent / 100);\n }\n\n // Continue if no change type\n if ($discountLimitType === self::LIMIT_NO_CHANGE) {\n continue;\n }\n // Discount type\n $variantPricing->setDiscountLimitType($discountLimitType === self::LIMIT_NONE ? null : $discountLimitType);\n\n // Date type discount\n if ($discountLimitType === self::LIMIT_DATETIME) {\n if ($discountFromDate && $discountToDate) {\n $dateFrom = \\DateTime::createFromFormat('Y-m-d', $discountFromDate);\n $dateTo = \\DateTime::createFromFormat('Y-m-d', $discountToDate);\n\n $variantPricing->setDiscountFrom($dateFrom);\n $variantPricing->setDiscountTo($dateTo);\n }\n\n if ($discountFromDate && !$discountToDate) {\n $dateFrom = \\DateTime::createFromFormat('Y-m-d', $discountFromDate);\n\n $variantPricing->setDiscountFrom($dateFrom);\n $variantPricing->setDiscountTo(null);\n }\n\n if (!$discountFromDate && $discountToDate) {\n $dateTo = \\DateTime::createFromFormat('Y-m-d', $discountToDate);\n\n $variantPricing->setDiscountFrom(null);\n $variantPricing->setDiscountTo($dateTo);\n }\n }\n }\n }", "public function couponCallback() {\n\n\t\ttry {\n\t\t\t/* * ********* Check input parameters ******************************* */\n\t\t\tif (!isset($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'])) {\n\t\t\t\tthrow new Exception(SyC::t('sdk','At least one of the parameters is missing. Received: {data}', array('{data}' => print_r($_POST, true))));\n\t\t\t}\n\n\t\t\t//make sure the coupon is valid\n\t\t\t$this->assertCouponIsValid($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type']);\n\n\t\t\t//save the coupon\n\t\t\t$this->saveCoupon($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'], (isset($_POST['product_unique_ids']) && is_array($_POST['product_unique_ids']) ? $_POST['product_unique_ids'] : array()));\n\n\t\t\t//check if the coupon is intended to be applied to the current cart\n\t\t\tif (empty($_POST['save_only'])) {\n\t\t\t\t$this->applyCoupon($_POST['coupon_code']);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\n\t\t\theader(\"HTTP/1.0 403\");\n\t\t\techo $e->getMessage();\n\t\t\t\n\t\t\tif($this->isDebugMode()){\n\t\t\t\techo $e->getTraceAsString();\n\t\t\t}\n\t\t}\n\t}", "public function validatecoupon($coupon,$email,$phone,$amount){\n\t\t// if($coupon==\"BIVAFIRST\"){\n\t\t// \t//This Block For Check Coupon For Perticular Person\n\t\t// \t// fetch from Order table by $email\n\t\t// \t// if row found\n\t\t// \t// Display message \"Sorry! This coupon is for first time users only.\"\n\t\t// \t// else\n\t\t// \t// $discountpercent= 10\n\t\t// \t// or\n\t\t// \t// $discountpercent=($amount*(20/100));\n\t\t// \t// return round($discountpercent)\n\t\t// }\n\n\t\t$this->db->where('CouponCode', $coupon);\n\t\t$query=$this->db->get('tbl_coupon');\n\t\tif($query->num_rows()==1)\n\t\t{\n\t\t\tif($query->row(0)->CouponStatus==1)\n\t\t\t{\n\t\t\t\t//This Block For Check Coupon For Perticular Person\n\t\t\t\tif($query->row(0)->CouponPersonEmail!=null && $query->row(0)->CouponPersonPhone!=null){\n\t\t\t\t\tif($query->row(0)->CouponPersonEmail==$email && $query->row(0)->CouponPersonPhone==$phone)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($query->row(0)->CouponType==\"cash\"){\n\t\t\t\t\t\t\treturn $query->row(0)->CouponDiscount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($query->row(0)->CouponType==\"trad\"){\n\t\t\t\t\t\t\t$discountpercent=(($amount*$query->row(0)->CouponDiscount)/100);\n\t\t\t\t\t\t\treturn round($discountpercent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\treturn 804;//Email And Phone Dose Not Match\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t \t//This Else Block For Coupon For All\n\t\t\t\telse{\n\n\t\t\t\t\tif($query->row(0)->CouponType==\"cash\"){\n\t\t\t\t\t\treturn $query->row(0)->CouponDiscount;\n\t\t\t\t\t}\n\t\t\t\t\telse if($query->row(0)->CouponType==\"trad\"){\n\t\t\t\t\t\t//$CouponDiscountValue=$query->row(0)->CouponDiscount;\n\t\t\t\t\t\t$discountpercent=(($amount*$query->row(0)->CouponDiscount)/100);\n\t\t\t\t\t\treturn round($discountpercent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 904;//Coupon Code Has Expired\n\t\t\t}\n\t\t}\n\n\t\telse{\n\t\t\treturn 704;//This is a invallid coupon\n\t\t}\n\t}", "public function getTotalDiscount(): float;", "abstract public function add_subscription( Payment_Subscription $subscription );" ]
[ "0.67926526", "0.6785508", "0.67720866", "0.6667279", "0.6549684", "0.65437543", "0.65316623", "0.6530725", "0.65135664", "0.6509255", "0.6507628", "0.6461083", "0.64513326", "0.64356816", "0.63701975", "0.635742", "0.6281496", "0.6249001", "0.6246762", "0.6207004", "0.6201372", "0.6199059", "0.6170138", "0.6136765", "0.6114615", "0.6107935", "0.6096809", "0.6096442", "0.60867333", "0.6043579", "0.604047", "0.6032575", "0.60124165", "0.5983393", "0.5977409", "0.59623575", "0.5959237", "0.589711", "0.58715487", "0.5869166", "0.58571285", "0.58460337", "0.58128077", "0.58044904", "0.57818604", "0.57790583", "0.5751911", "0.57310426", "0.5728726", "0.5728444", "0.5725802", "0.57228273", "0.5709314", "0.5701521", "0.5700061", "0.56920576", "0.5678767", "0.5675978", "0.5674823", "0.5662802", "0.5648352", "0.5646417", "0.5640414", "0.56352544", "0.5634709", "0.56209576", "0.56163603", "0.56155163", "0.56149995", "0.5611357", "0.5609213", "0.5601397", "0.5597899", "0.55939955", "0.5593051", "0.55847317", "0.5583359", "0.5567472", "0.5564577", "0.5563102", "0.55283856", "0.5525669", "0.5521235", "0.55206066", "0.55172205", "0.5506933", "0.54990697", "0.5487188", "0.54826653", "0.5469866", "0.5455593", "0.54526865", "0.54503185", "0.5449456", "0.54411405", "0.5436698", "0.5430413", "0.54227173", "0.542244", "0.5417501" ]
0.83097464
0
/ creation d'un lot catalogue
/ создание лота каталога
function createCatalog($ar){ $rs = selectQueryGetAll('select count(distinct categ) as nb from '.$this->wtscatalog); $p= new XParam($ar, array('prdconf'=>NULL, 'categ'=>'Lot '.($rs[0]['nb']+1), 'wtspool'=>NULL, 'wtsticket'=>NULL, 'wtsperson'=>NULL)); $added = 0; $prdconf = $p->get('prdconf'); $categ = $p->get('categ'); $tapool = $p->get('tapool'); $wtspool = $p->get('wtspool'); $tatickets = $p->get('ticket'); $tapersons = $p->get('person'); $wtstickets = $p->get('wtsticket'); $wtspersons = $p->get('wtsperson'); $lar = array('_options'=>array('local'=>true), 'tplentry'=>TZR_RETURN_DATA, 'tapool'=>$tapool, 'wtspool'=>$wtspool, 'categ'=>$categ, 'prdconf'=>$prdconf, ); // on génère les produits pour les combinaison selectionnées de valeurs tatickets/tapools foreach($tatickets as $it=>$taticketoid){ $lar['wtsticket'] = NULL; $lar['taticket'] = $taticketoid; if (isset($wtstickets[$it])) $lar['wtsticket']= $wtstickets[$it]; foreach($tapersons as $ip=>$tapersonoid){ $lar['wtsperson'] = NULL; $lar['taperson'] = $tapersonoid; if (isset($wtspersons[$ip])) $lar['wtsperson'] = $wtspersons[$ip]; // creation de la ligne $added+=1; $this->dswtscatalog->procInput($lar); } } $mess = $added.' produits ajoutés'; XShell::setNextData('message', $mess); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preCreateCatalog($ar){\n // lot\n $rs = selectQueryGetAll('select count(distinct categ) as nb from '.$this->wtscatalog);\n $newval = 'Groupe '.($rs[0]['nb']+1);\n $fdl = new XShortTextDef();\n $fdl->field = 'categ';\n $fdl->table = $this->wtscatalog;\n $fdl->fieldcount = '32';\n $fdl->compulsory = 1;\n $fvl = $fdl->edit($newval);\n XShell::toScreen2('br', 'ocateg', $fvl);\n // configuration\n $fdl = new XLinkDef();\n $fdl->field = 'prdconf';\n $fdl->table = $this->wtscatalog;\n $fdl->target = $this->wtsprdconf;\n $fdl->fieldcount = '1';\n $fdl->compulsory = 0;\n $fvl = $fdl->edit();\n XShell::toScreen2('br', 'oprdconf', $fvl);\n // liste des secteurs wts\n $fdl = new XLinkDef();\n $fdl->field = 'wtspool';\n $fdl->table = $this->wtscatalog;\n $fdl->target = $this->wtspool;\n $fdl->fieldcount = '1';\n $fdl->compulsory = 0;\n $fdl->checkbox = 0;\n $fvl = $fdl->edit();\n XShell::toScreen2('br', 'owtspool', $fvl);\n // liste des personnes wts\n $this->dswtsperson->browse(array('selectedfields'=>'all', 'tplentry'=>'br_wtsperson', 'pagesize'=>999));\n // liste des forfaits wts\n $this->dswtsticket->browse(array('selectedfields'=>'all', 'tplentry'=>'br_wtsticket', 'pagesize'=>999));\n // liste des pools ta\n $bpools = $this->dstapool->browse(array('selectedfields'=>'all', 'tplentry'=>'br_pool', 'pagesize'=>999));\n // liste des tickets ta par pool ta\n $tickets = array();\n foreach($bpools['lines_oid'] as $poid){\n $tickets[] = $this->dstaticket->browse(array('selectedfields'=>'all', 'tplentry'=>TZR_RETURN_DATA, 'pagesize'=>999,\n 'select'=>$this->dstaticket->select_query(array('cond'=>array('tapool'=>array('=', $poid))))\n )\n );\n }\n XShell::toScreen2('br', 'ticket', $tickets);\n // liste des types de personnes ta\n $this->dstaperson->browse(array('selectedfields'=>'all', 'tplentry'=>'br_person', 'pagesize'=>999));\n // date de recherche\n $fd = new XDateDef();\n $fd->field = 'validfrom';\n $r = $fd->edit(date('Y-m-d'));\n XShell::toScreen2('br', 'ovalidfrom', $r);\n }", "public function catalogo(){\n \n $inicio['recomendado'] = $this->carga_recomendado();\n $inicio['categorias'] = $this->carga_menu_categorias();\n $this->Plantilla(\"catalogo\", $inicio);\n \n }", "public function catalogos() \n\t{\n\t}", "function create_catalogs($catalog)\r\n {\r\n $this->valid_catalog = new stdClass;\r\n $this->invalid_catalog = new stdClass;\r\n $this->validated_catalog = new stdClass;\r\n foreach ($catalog as $k => $v) {\r\n if ($v == \"invalid number\") {\r\n $this->invalid_catalog->name[] = $k;\r\n $this->invalid_catalog->number = $this->invalid_number;\r\n } elseif($k == ''){\r\n $this->invalid_catalog->invalid_name[] = $k;\r\n $this->invalid_catalog->number_of_invalid_name[] = $v;\r\n }\r\n else {\r\n $this->valid_catalog->name[] = $k;\r\n $this->valid_catalog->number[] = $v;\r\n $this->validated_catalog->validated_name[]= $k;\r\n $this->validated_catalog->validated_number[]= $this->transformTelNum($v, $this->outputformat);;\r\n }\r\n }\r\n $this->invalid_catalog->invalidline = $this->invalid_line;\r\n }", "public function manageCatalog()\r\n {\r\n foreach ($this->data as $line) {\r\n if (count($line) > 2 || ($line[0] == '' && $line[1] == '')) {\r\n $this->invalid_line[] = implode(\";\", $line);\r\n } else {\r\n foreach ($line as $k => $v) {\r\n if ($this->getType($v) == \"name\") {\r\n $name[] = $v;\r\n } elseif ($this->getType($v) == \"number\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } elseif ($this->getType($v) == \"empty\") {\r\n if ($this->getType($this->temp) == \"name\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } else{\r\n $name[] = $v;\r\n }\r\n }\r\n $this->temp = $v;\r\n }\r\n }\r\n }\r\n $this->raw_catalog = array_combine($name, $number); // array me ola ta onomata kai ta noumera opws erxetai apo to arxeio\r\n $this->tempcatalog = array_combine($name, $validatednumber); // array me ola ta onomata kai \"invalid number\" opou einai lathos to noumero \r\n $this->create_catalogs($this->tempcatalog);\r\n /*foreach (array_keys($this->tempcatalog, \"invalid number\") as $k => $v) {\r\n $invalidname[] = $v;\r\n $invalidnumber[] = $this->raw_catalog[$v];\r\n $this->invalidcatalog = array_combine($invalidname, $invalidnumber); //aray me onomata kai \"invalid number\" mono\r\n unset($this->tempcatalog[$v]); // kopsimo twn \"invalid number\"\r\n }\r\n foreach ($this->tempcatalog as $k => $v) {\r\n if ($k == '') {\r\n unset($this->tempcatalog[$k]);\r\n $this->invalidcatalog += array($k => $v);\r\n \r\n }\r\n }\r\n $this->invalidcatalog += array('invalid line' => $this->invalid_line);*/\r\n //foreach ($this->tempcatalog as $k => $v) {\r\n /*foreach ($this->valid_catalog->number as $k => $v) {\r\n $finalnumber[] = $this->transformTelNum($v, $this->outputformat);\r\n $final_name[] = $k;\r\n if ($this->order == \"names\") {\r\n $this->finalcatalog = array_combine($final_name, $finalnumber); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n } else {\r\n $this->finalcatalog = array_combine($finalnumber, $final_name); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n }\r\n }*/\r\n $this->Catalogs = new ArrayObject();\r\n $this->Catalogs[\"rawcatalog\"] = $this->raw_catalog;\r\n $this->Catalogs[\"validcatalog\"] = $this->valid_catalog;\r\n $this->Catalogs[\"invalidcatalog\"] = $this->invalid_catalog;\r\n $this->Catalogs[\"validatedcatalog\"] = $this->validated_catalog;\r\n return $this->Catalogs;\r\n //return array($this->finalcatalog, $this->invalid_catalog);\r\n }", "public function createCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(9, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $data['profession'] = $this->utils->professions();\n $data['typepiece'] = $this->utils->typepiece();\n $data['pays'] = $this->utils->listePays();\n $data['nationalites'] = $this->utils->nationalites();\n $data['regions'] = $this->utils->allRegionByPays();\n $paramsview = array('view' => 'compte/new-carte');\n $this->view($paramsview, $data);\n }", "static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}", "private function construct_xml_contain(){\r\n global $CFG;\r\n $xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.'<!DOCTYPE root [<!ENTITY nbsp \"&#160;\">]>'.'<catalogue/>');\r\n\r\n foreach($this->offers as $offer){\r\n $resource_link = '';\r\n if (OfferCourse::isCentralizedRessourcesAvailable()) {\r\n if(isset($offer->thumbnailid) && $offer->thumbnailid != null){\r\n $DBC = get_centralized_db_connection();\r\n $cr_resource = $DBC->get_record('cr_resources', array('resourceid'=>$offer->thumbnailid));\r\n $resource_link = \"\";\r\n if($cr_resource){\r\n $url_resource = '/'.$CFG->centralizedresources_media_types['indexthumb'].'/'.$cr_resource->cleanname;\r\n $resource_link = get_resource_centralized_secure_url($url_resource, $cr_resource->hashname.$cr_resource->createdate, $CFG->secure_link_timestamp_image);\r\n }\r\n }\r\n }\r\n $formation = $xml->addChild('formation');\r\n if (isset($resource_link)){\r\n $formation->addChild('image', htmlspecialchars($resource_link));\r\n }\r\n $formation->addChild('nom_parcours', htmlspecialchars($offer->fullname));\r\n if (isset($offer->domain_name)){\r\n $formation->addChild('domaine', htmlspecialchars($offer->domain_name));\r\n }\r\n if (isset($offer->publics)){\r\n $formation->addChild('public', htmlspecialchars($offer->publics));\r\n }\r\n if (isset($offer->col_name)){\r\n $formation->addChild('collection', htmlspecialchars($offer->col_name));\r\n }\r\n if (isset($offer->authors)){\r\n $formation->addChild('formateur', htmlspecialchars($offer->authors));\r\n }\r\n if (isset($offer->summary)){\r\n $description = strip_tags($offer->summary,'');\r\n $formation->addChild('description', htmlspecialchars($description));\r\n }\r\n if (isset($offer->objectif)){\r\n $objectif = strip_tags($offer->objectif,'');\r\n $formation->addChild('objectifs', htmlspecialchars($objectif));\r\n }\r\n if (isset($offer->tps_en_presence)){\r\n $temps_presence = OfferCourse::string_format_time($offer->tps_en_presence);\r\n if($temps_presence == null){\r\n $temps_presence = get_string('no_lead_time_attendance', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_presence', htmlspecialchars($temps_presence));\r\n }\r\n if (isset($offer->tps_a_distance)){\r\n $temps_distance = OfferCourse::string_format_time($offer->tps_a_distance);\r\n if($temps_distance == null){\r\n $temps_distance = get_string('no_lead_time_remote', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_distance', htmlspecialchars($temps_distance));\r\n }\r\n if (isset($offer->validateby)){\r\n $formation->addChild('validation', htmlspecialchars($offer->validateby));\r\n }\r\n if (isset($offer->aca_name)){\r\n $formation->addChild('origine', OfferCourse::string_format_origine_offers($offer->aca_name));\r\n }\r\n if (isset($offer->timepublished)){\r\n $updatedate = (isset($offer->timepublished)?date('YmdHis',$offer->timepublished):date('YmdHis',$offer->updatedate));\r\n $formation->addChild('date_publication', $updatedate);\r\n }\r\n $formation->addChild('url', $offer->courseurl);\r\n }\r\n\r\n $this->xml_structure = $xml->asXML();\r\n }", "public function create()\n {\n $data = [];\n $data['breadcrumb_header'] = AppServiceProvider::get_breadcrumb_header();\n\n $data['categories'] = Category::pluck('title', 'id')->all();\n $data['tags'] = Tag::all();\n\n\n //Получаем список атрибутов\n $data['attrs'] = [];\n $results = AttributeCategory::where(['type'=> 0])->get();\n foreach ($results as $result) {\n $items = Attribute::where('category_id', $result->id)->get();\n $data['attrs'][] = [\n 'id' => $result->id,\n 'title' => $result->title,\n 'items' => $items,\n ];\n }\n $data['attrs_dop'] = [];\n // 1 - это дополнительные атрибуты\n $results = AttributeCategory::where(['type'=> 1])->get();\n foreach ($results as $result) {\n $items = Attribute::where('category_id', $result->id)->get();\n\n $data['attrs_dop'][] = [\n 'id' => $result->id,\n 'title' => $result->title,\n 'items' => $items,\n ];\n }\n\n $data['brands'] = CarBrand::all();\n\n return view('admin.lots.create', $data);\n }", "public function run()\n {\n $catalog = new \\App\\Catalog(['name' => 'Thời trang nam']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang nữ']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang đôi']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang cho bé']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang tổng hợp']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đầm nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo khoác nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo thun nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Chân váy', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần Short Nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đồ lót & Đồ ngủ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đầm bầu', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đồ bơi nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thắt lưng', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo khoác nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo thun nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo Cardigan nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo sơ mi', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n $catalog = new \\App\\Catalog(['name' => 'Áo len', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Cà vạt & nơ bướm', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n }", "public function getCatalog() {}", "protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}", "function create(){\n // cls_hermes_plugin::cls_hermes_plugin($options); \nglobal $xoopsModuleConfig, $xoopsDB;\n\n //------------------------------------------- \n $decomodele = $this->name;\n $sql = \"('{$decomodele}', 'content','multiline',0,01,'12',''),\n ('{$decomodele}', 'type','list',0,02,'|css|html|text','');\";\n\n \n //--------------------------------------------------\n cls_decoration:: createModele($decomodele, $sql);\n //-------------------------------------------------- \n\n\n}", "function panier2bdd() {\n\t// if (!empty($_SESSION['dims']['userid']) && !empty($_SESSION['catalogue']['panier'])) {\n\tif (!empty($_SESSION['dims']['userid'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/include/class_panier.php';\n\t\t$panier = new cata_panier();\n\t\t$panier->open($_SESSION['dims']['userid']);\n\t\t$panier->articles = array();\n\n\t\t$panier->fields['libelle'] = '';\n\t\t$panier->fields['id_user'] = $_SESSION['dims']['userid'];\n\t\t$panier->fields['id_module'] = $_SESSION['dims']['moduleid'];\n\n\t\tif (isset($_SESSION['catalogue']['panier'])) {\n\t\t\tforeach ($_SESSION['catalogue']['panier']['articles'] as $ref => $values) {\n\t\t\t\t$panier->articles[] = array(\n\t\t\t\t\t'ref' \t\t\t=> $ref,\n\t\t\t\t\t'qte' \t\t\t=> $values['qte'],\n\t\t\t\t\t'forced_price' \t=> (isset($values['forced_price']) ? $values['forced_price'] : 'NULL')\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$panier->save();\n\t}\n}", "function createProduct($nome, $categoria, $descricao, $quantidade, $preco, $foto) {\n return [\n 'id' => hash('sha256', uniqid(\"\")), // gera um idenficador unico para o registro\n 'nome' => $nome,\n 'categoria' => $categoria, \n 'descricao' => $descricao,\n 'quantidade' => $quantidade,\n 'preco' => $preco, \n 'foto' => $foto\n ];\n}", "function getNewClotures($id_ag, $date) {\n global $dbHandler, $global_id_agence;\n $db = $dbHandler->openConnection();\n $sql = \"SELECT id_cpte, id_prod, devise, id_ag, num_complet_cpte, id_titulaire, solde_clot, raison_clot, date_ouvert FROM ad_cpt WHERE date_clot = '$date' AND id_ag = $global_id_agence\";\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n }\n $newClot = array ();\n while ($tmprow = $result->fetchrow()){\n $newClot[$tmprow[0]][\"id_cpte\"] = $tmprow[0];\n $newClot[$tmprow[0]][\"id_prod\"] = $tmprow[1];\n $newClot[$tmprow[0]][\"devise\"] = $tmprow[2];\n $newClot[$tmprow[0]][\"id_ag\"] = $tmprow[3];\n $newClot[$tmprow[0]][\"num_complet_cpte\"] = $tmprow[4];\n $newClot[$tmprow[0]][\"id_titulaire\"] = $tmprow[5];\n $newClot[$tmprow[0]][\"solde_clot\"] = $tmprow[6];\n $newClot[$tmprow[0]][\"raison_clot\"] = $tmprow[7];\n $newClot[$tmprow[0]][\"date_ouvert\"] = $tmprow[8];\n }\n $dbHandler->closeConnection(true);\n return $newClot;\n}", "function ciniki_artcatalog_trackingAdd(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'artcatalog_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Artcatalog Item'), \n 'name'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Name'), \n 'external_number'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Number'), \n 'start_date'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'type'=>'date', 'name'=>'Start'), \n 'end_date'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'type'=>'date', 'name'=>'End'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Notes'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n if( $args['artcatalog_id'] == '0' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.artcatalog.39', 'msg'=>'No artcatalog item specified'));\n }\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.trackingAdd'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n if( isset($args['name']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['name'] . '-' . ($args['start_date']==''?'0000-00-00':$args['start_date']));\n }\n\n //\n // Update tracking\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n return ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.artcatalog.place', $args);\n}", "public function CrearNuevaCompra($datos){\n $ArrayIdProducto=$datos->ArrayIdProducto;\n $ArrayCantidadCompraProducto=$datos->ArrayCantidadCompraProducto;\n $ArrayPrecioProductoUnidad=$datos->ArrayPrecioProductoUnidad;\n \n \n //extraemos el precio de venta del repositorio\n $PrecioCompraTotal=$this->CompraRepository->PrecioTotalCompra($ArrayCantidadCompraProducto,$ArrayPrecioProductoUnidad);\n //Registramos la compra con los datos generales y extraemos el id de la compra que servira para llenar el detalle de la compra\n $compra_id= $this->CompraRepository->RegistrarCompraDatosGenerales($datos,$PrecioCompraTotal);\n\n \n //while que permite registrar los detalles de la venta \n $contador=0;\n while($contador<count($ArrayIdProducto)){\n //llamamos a metode para llenar los detalles de la compra pasando el id d ela compra \n $this->CompraRepository->RegistrarCompraDetalles($compra_id,$ArrayIdProducto[$contador],$ArrayCantidadCompraProducto[$contador],$ArrayPrecioProductoUnidad[$contador]);\n //Funcion que permite actualizar el stock de los productos \n $this->CompraRepository->ActualizarStockDisminuir($ArrayIdProducto[$contador],$ArrayCantidadCompraProducto[$contador]);\n $contador++;\n }\n\n \n \n \n \n }", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "public function producto(){\n\t \t$this->load->template('catalogo_producto');\n\t }", "public function run()\n {\n // CATEGORIA POSTRES\n\n $catalogo = new Catalogue();\n $catalogo->titulo = \"Enrollado de Chirimoya\";\n $catalogo->categoria = \"postres\";\n $catalogo->descripcion = \"Bizcochuelo de vainilla, relleno con tres capas, manjar, chantilly y pulpa de chirimoya, cubierto con fudge. Pídelo en su versión de 6 a 8 porciones.\";\n $catalogo->imagen = \"enrolladochirimoya.jpg\";\n $catalogo->save();\n\n $catalogo1 = new Catalogue();\n $catalogo1->titulo = \"Cheescake de zarzamoras\";\n $catalogo1->categoria = \"postres\";\n $catalogo1->descripcion = \"Una base de galleta rellena de una crema de queso y trozos de zarzamoras con el dulce clásico del cheescake, cubierto con mermelada y frutos.\";\n $catalogo1->imagen = \"cheescake.jpg\";\n $catalogo1->save();\n\n $catalogo2 = new Catalogue();\n $catalogo2->titulo = \"Crema Volteada\";\n $catalogo2->categoria = \"postres\";\n $catalogo2->descripcion = \"La más cremosa versión horneada con caramelo y un delicioso aroma a vainilla. Pídela desde 22cms\";\n $catalogo2->imagen = \"cremavolteada.jpg\";\n $catalogo2->save();\n\n $catalogo3 = new Catalogue();\n $catalogo3->titulo = \"Explosión de fresas\";\n $catalogo3->categoria = \"postres\";\n $catalogo3->descripcion = \"Bizcochuelo de vainilla embebido en un almíbar de fresas con licor, rellena con una capa de mermelada de fresas hecha en casa, una segunda capa de chantilly con fresas en trozos; cubierta en chantilly y decorada con fresas maceradas en jalea.\";\n $catalogo3->imagen = \"explosionfresa.jpg\";\n $catalogo3->save();\n\n $catalogo4 = new Catalogue();\n $catalogo4->titulo = \"Tarta de durazno\";\n $catalogo4->categoria = \"postres\";\n $catalogo4->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con duraznos en jalea.\";\n $catalogo4->imagen = \"tartadurazno.jpg\";\n $catalogo4->save();\n\n $catalogo5 = new Catalogue();\n $catalogo5->titulo = \"Tartaleta de Fresas\";\n $catalogo5->categoria = \"postres\";\n $catalogo5->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con fresas en jalea y decorada con copos de chantilly.\";\n $catalogo5->imagen = \"tartaletafresa.jpg\";\n $catalogo5->save();\n\n $catalogo6 = new Catalogue();\n $catalogo6->titulo = \"Torta húmeda de chocolate\";\n $catalogo6->categoria = \"postres\";\n $catalogo6->descripcion = \"Queque húmedo de chocolate embebido en un almíbar de chocolate, rellena con dos capas de fudge, cubierta con fudge. Pídela desde su versión mini (10 porciones).\";\n $catalogo6->imagen = \"tortahumeda.jpg\";\n $catalogo6->save();\n\n $catalogo7 = new Catalogue();\n $catalogo7->titulo = \"Tres Leches\";\n $catalogo7->categoria = \"postres\";\n $catalogo7->descripcion = \"Un suave bizcochuelo de vainilla o chocolate, embebido en nuestra deliciosa preparación de tres leches, rellena y cubierta de chantilly y envuelta en una deliciosa corona de chocolate bitter. Pídela desde su versión mini (10 porciones)\";\n $catalogo7->imagen = \"tresleches.jpg\";\n $catalogo7->save();\n\n\n //BODAS\n\n\n $catalogo8 = new Catalogue();\n $catalogo8->titulo = \"Naked\";\n $catalogo8->categoria = \"bodas\";\n $catalogo8->descripcion = \"Una torta en tendencia, pese a su sencillez luce super elegante, decorada con flores naturales o de tela.\";\n $catalogo8->imagen = \"naked.jpg\";\n $catalogo8->save();\n\n $catalogo9 = new Catalogue();\n $catalogo9->titulo = \"Azul\";\n $catalogo9->categoria = \"bodas\";\n $catalogo9->descripcion = \"Si deseas tematizar una torta y salir del blanco convencional he aquí la idea principal, una hermosa torta de bodas con azul metalizado.\";\n $catalogo9->imagen = \"azul.jpg\";\n $catalogo9->save();\n\n \n $catalogo10 = new Catalogue();\n $catalogo10->titulo = \"B&A\";\n $catalogo10->categoria = \"bodas\";\n $catalogo10->descripcion = \"Una torta ejecutada para la celebración de Bodas de Oro, aplicaciones de fondant.\";\n $catalogo10->imagen = \"bya.jpg\";\n $catalogo10->save();\n\n $catalogo11 = new Catalogue();\n $catalogo11->titulo = \"Love Gaby\";\n $catalogo11->categoria = \"bodas\";\n $catalogo11->descripcion = \"Una delicada versión que incluye acolchado, perlas y rosas, predominando el color perla\";\n $catalogo11->imagen = \"lovegaby.jpg\";\n $catalogo11->save();\n\n \n $catalogo12 = new Catalogue();\n $catalogo12->titulo = \"Love Volados\";\n $catalogo12->categoria = \"bodas\";\n $catalogo12->descripcion = \"Hermosa versión de bodas con flores y unos volados que envuelven todo el pastel para un efecto diferente. Aplicaciones en fondant\";\n $catalogo12->imagen = \"lovevolado.jpg\";\n $catalogo12->save();\n\n $catalogo13 = new Catalogue();\n $catalogo13->titulo = \"Siluetas\";\n $catalogo13->categoria = \"bodas\";\n $catalogo13->descripcion = \"Una idea para personalizar tu boda, usando siluetas de los novios en fotos reales, hará de ese recuerdo algo muy especial.\";\n $catalogo13->imagen = \"silueta.jpg\";\n $catalogo13->save();\n\n \n $catalogo14 = new Catalogue();\n $catalogo14->titulo = \"Mesa de Postres\";\n $catalogo14->categoria = \"bodas\";\n $catalogo14->descripcion = \"Una idea para complementar tu recepción una mesa completa de mini postres para el deleite de tus invitados.\";\n $catalogo14->imagen = \"mesapostre.jpg\";\n $catalogo14->save();\n\n //INFANTILES\n\n $catalogo15 = new Catalogue();\n $catalogo15->titulo = \"Mario Bross\";\n $catalogo15->categoria = \"infantiles\";\n $catalogo15->descripcion = \"El fontanero engreído de niños y adultos. Torta de 20 porciones\";\n $catalogo15->imagen = \"mariobross.jpg\";\n $catalogo15->save();\n\n \n $catalogo16 = new Catalogue();\n $catalogo16->titulo = \"Mickey\";\n $catalogo16->categoria = \"infantiles\";\n $catalogo16->descripcion = \"Aunque pasen los años este ratón seguirá robando el corazón de nuestros pequeños. Torta de 30 porciones (2 pisos) la cabecita de Mickey en chocolate forrado.\";\n $catalogo16->imagen = \"mickey.jpg\";\n $catalogo16->save();\n\n $catalogo17 = new Catalogue();\n $catalogo17->titulo = \"Spiderman\";\n $catalogo17->categoria = \"infantiles\";\n $catalogo17->descripcion = \"El super héroe favorito de muchos. Torta de 30 porciones\";\n $catalogo17->imagen = \"spiderman.jpg\";\n $catalogo17->save();\n\n \n $catalogo18 = new Catalogue();\n $catalogo18->titulo = \"Unicornio\";\n $catalogo18->categoria = \"infantiles\";\n $catalogo18->descripcion = \"Llevando a un mundo de sueños, color y fantasía. Torta de 20 porciones\";\n $catalogo18->imagen = \"unicornio.jpg\";\n $catalogo18->save();\n\n $catalogo19 = new Catalogue();\n $catalogo19->titulo = \"Hot Wheels\";\n $catalogo19->categoria = \"infantiles\";\n $catalogo19->descripcion = \"Para los amantes de la velocidad y por supuesto para los coleccionistas. Torta de 3 pisos (80 porciones)\";\n $catalogo19->imagen = \"hotwheels.jpg\";\n $catalogo19->save();\n\n \n $catalogo20 = new Catalogue();\n $catalogo20->titulo = \"Jasmine\";\n $catalogo20->categoria = \"infantiles\";\n $catalogo20->descripcion = \"Una princesa con el temperamento de su mascota. Torta de 2 pisos (50 porciones)\";\n $catalogo20->imagen = \"jasmine.jpg\";\n $catalogo20->save();\n\n $catalogo21 = new Catalogue();\n $catalogo21->titulo = \"Angry Birds\";\n $catalogo21->categoria = \"infantiles\";\n $catalogo21->descripcion = \"El clásico juego que conquistó a grandes y pequeños. Torta de 20 porciones\";\n $catalogo21->imagen = \"angrybirds.jpg\";\n $catalogo21->save();\n\n \n $catalogo22 = new Catalogue();\n $catalogo22->titulo = \"Blanca Nieves\";\n $catalogo22->categoria = \"infantiles\";\n $catalogo22->descripcion = \"No podría faltar nuestra primera princesa Disney. Temática blanca nieves, torta de 4 pisos (110 porciones) y dulces tematizados.\";\n $catalogo22->imagen = \"blancanieve.jpg\";\n $catalogo22->save();\n\n\n // Bocaditos\n\n\n $catalogo23 = new Catalogue();\n $catalogo23->titulo = \"Alfajores de Maicena\";\n $catalogo23->categoria = \"bocaditos\";\n $catalogo23->descripcion = \"Dos galletitas de maicena con una fina y delicada consistencia que se deshace en la boca rellenas con manjar de leche.\";\n $catalogo23->imagen = \"alfajore.jpg\";\n $catalogo23->save();\n\n \n $catalogo24 = new Catalogue();\n $catalogo24->titulo = \"Empanaditas de carne\";\n $catalogo24->categoria = \"bocaditos\";\n $catalogo24->descripcion = \"Una Deliciosa masa saladita rellena de un guiso con carne, pasas, ají amarillo, llevadas al horno. No podrás parar de comerlas.\";\n $catalogo24->imagen = \"empanada.jpg\";\n $catalogo24->save();\n\n $catalogo25 = new Catalogue();\n $catalogo25->titulo = \"Enrolladitos de hot dog\";\n $catalogo25->categoria = \"bocaditos\";\n $catalogo25->descripcion = \"Masa de hojaldre rellena de hot dog de ternera, llevada al horno, simplemente Yumi¡¡¡.\";\n $catalogo25->imagen = \"enrollado.jpg\";\n $catalogo25->save();\n\n \n $catalogo26 = new Catalogue();\n $catalogo26->titulo = \"Fresas Crocantes\";\n $catalogo26->categoria = \"bocaditos\";\n $catalogo26->descripcion = \"Dulces fresas cubiertas en chocolate bitter, la combinación de ambos ingredientes al paladar no tiene descripción.\";\n $catalogo26->imagen = \"fresacrocante.jpg\";\n $catalogo26->save();\n\n $catalogo27 = new Catalogue();\n $catalogo27->titulo = \"Mini pye de manzana\";\n $catalogo27->categoria = \"bocaditos\";\n $catalogo27->descripcion = \"Un clásico postre en un bocado, la deliciosa galletita se mezcla con el sabor de aquella manzana horneada con canela, azúcar y clavo.\";\n $catalogo27->imagen = \"minipye.jpg\";\n $catalogo27->save();\n\n \n $catalogo28 = new Catalogue();\n $catalogo28->titulo = \"Trufas de chocolate\";\n $catalogo28->categoria = \"bocaditos\";\n $catalogo28->descripcion = \"Pequeñas bolitas elaboradas con galletas, castañas y un toquecito de licor, cubiertas con una capita de chocolate bitter.\";\n $catalogo28->imagen = \"trufas.jpg\";\n $catalogo28->save();\n\n $catalogo29 = new Catalogue();\n $catalogo29->titulo = \"Rolatines de jamón y queso\";\n $catalogo29->categoria = \"bocaditos\";\n $catalogo29->descripcion = \"Pequeños piononos de pan pulman relleno de jamón y queso en rolatines.\";\n $catalogo29->imagen = \"rolatines.jpg\";\n $catalogo29->save();\n\n \n $catalogo30 = new Catalogue();\n $catalogo30->titulo = \"Petit pan con pollo\";\n $catalogo30->categoria = \"bocaditos\";\n $catalogo30->descripcion = \"Clásico sandwish y el favorito de muchos, un suave pancito de yema relleno de pollo deshilachado con apio y mayonesa de la casa.\";\n $catalogo30->imagen = \"petit.jpg\";\n $catalogo30->save();\n\n\n \n\n }", "private function createViewProducto()\n {\n $this->addView('ListProductoSample', 'ProductoSample', 'products', 'fas fa-cubes');\n $this->addSearchFields('ListProductoSample', ['referencia', 'descripcion', 'observaciones']);\n $this->addOrderBy('ListProductoSample', ['referencia'], 'reference');\n $this->addOrderBy('ListProductoSample', ['descripcion'], 'description');\n $this->addOrderBy('ListProductoSample', ['precio'], 'price');\n $this->addOrderBy('ListProductoSample', ['stockfis'], 'stock');\n $this->addOrderBy('ListProductoSample', ['actualizado'], 'update-time');\n\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListProductoSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n\n $families = $this->codeModel::all('familias', 'codfamilia', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codfamilia', 'family', 'codfamilia', $families);\n\n $taxes = $this->codeModel::all('impuestos', 'codimpuesto', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codimpuesto', 'tax', 'codimpuesto', $taxes);\n\n $this->addFilterCheckbox('ListProductoSample', 'nostock', 'no-stock', 'nostock');\n $this->addFilterCheckbox('ListProductoSample', 'bloqueado', 'locked', 'bloqueado');\n $this->addFilterCheckbox('ListProductoSample', 'secompra', 'for-purchase', 'secompra');\n $this->addFilterCheckbox('ListProductoSample', 'sevende', 'for-sale', 'sevende');\n $this->addFilterCheckbox('ListProductoSample', 'publico', 'public', 'publico');\n }", "private function new_articulo()\n {\n $this->template = FALSE;\n \n $art0 = new articulo();\n $art0->referencia = $_POST['referencia'];\n if( $art0->exists() )\n {\n $this->results[] = $art0->get($_POST['referencia']);\n }\n else\n {\n $art0->descripcion = $_POST['descripcion'];\n $art0->codfamilia = $_POST['codfamilia'];\n $art0->set_impuesto($_POST['codimpuesto']);\n \n if( $art0->save() )\n {\n $this->results[] = $art0;\n }\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "private function crear_get()\n {\n $item = $this->ObtenNewModel();\n\t\t$lModel = new CicloModel(); \n \n //Pasamos a la vista toda la información que se desea representar\n\t\t$data['TituloPagina'] = \"Añadir un grupo\";\n\t\t$data[\"Model\"] = $item;\n\t\t$data[\"ComboCiclos\"] = $lModel->ObtenerTodos();\n\n //Finalmente presentamos nuestra plantilla\n\t\theader (\"content-type: application/json; charset=utf-8\");\n $this->view->show($this->_Nombre.\"/crear.php\", $data);\n\t}", "public function catalogoInsert($genero, $servicio, $categoria, $descripcion, $detalle, $foto, $precio)\n {\n $sql = \"INSERT INTO catalogo (cod_genero,cod_servicio,cod_categoria,descripcion,detalle,foto,precio)\n VALUES ('$genero','$servicio','$categoria','$descripcion','$detalle','$foto','$precio')\";\n\n if (mysqli_query($this->open(), $sql)) {\n echo \"<script> alert('Registrado Correctamente') </script>\";\n } else {\n echo \"<script> alert('Error de Registro')\";\n }\n\n $this->catalogoSelect();\n }", "function GetTabPrestation($projet)\n {\n //Ajout d'une catégorie de prestationj\n $btnNew = new Button(BUTTON);\n $btnNew->Value = $this->Core->GetCode(\"Devis.NewCategory\");\n $btnNew->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\");\";\n\n $html .= $btnNew->Show();\n\n //Recuperation des articles\n $category = new DevisPrestationCategory($this->Core);\n $category->AddArgument(new Argument(\"Apps\\Devis\\Entity\\DevisPrestationCategory\", \"ProjetId\", EQUAL, $projet->IdEntite ));\n $categorys = $category->GetByArg();\n\n if(count($categorys) > 0)\n {\n //Ligne D'entete\n $html .= \"<div class='category'>\";\n $html .= \"<div class='blueTree'><b>\".$this->Core->GetCode(\"Devis.Libelle\").\"</b></div>\";\n\n $html .= \"</div>\"; \n\n foreach($categorys as $category)\n {\n $html .= \"<div class='category'>\";\n $html .= \"<div >\".$category->Libelle->Value.\"</div>\";\n\n //Lien pour afficher le détail\n $icEdit = new EditIcone();\n $icEdit->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\", \".$category->IdEntite.\");\";\n $html .= \"<div >\".$icEdit->Show().\"</div>\";\n\n //Ajout de prestation\n $icAdd = new AddIcone($this->Core);\n $icAdd->Title = $this->Core->GetCode(\"Devis.AddPrestation\");\n $icAdd->OnClick = \"DevisAction.ShowAddPrestation(\".$category->IdEntite.\");\";\n\n $html .= \"<div >\".$icAdd->Show();\n $html .= $this->GetPrestation($category); \n\n $html .= \"</div>\";\n\n //Suppression\n $icDelete = new DeleteIcone();\n $icDelete->OnClick = \"DevisAction.DeleteCategory(this, '\".$category->IdEntite.\"')\";\n $html .= \"<div >\".$icDelete->Show().\"</div>\";\n\n $html .= \"</div>\";\n }\n }\n\n return new Libelle($html);\n }", "public function traitementCategorie() {\n\n $this->data .= '<div class=\"boutique-droite\">';\n if(isset($_GET['categorie']))\n {\n $donnees = Database::query(\"SELECT id_produit,reference,titre,photo,prix FROM produit WHERE categorie=?\", array($_GET['categorie']));\n foreach($donnees as $key2 =>$produit)\n {\n $this->data .= '<div class=\"boutique-produit\">';\n $this->data .= \"<h3>$produit[titre]</h3>\";\n $this->data .= \"<a href=\\\"fiche_produit.php?id_produit=$produit[id_produit]\\\"><img src=\\\"$produit[photo]\\\" width=\\\"130\\\" height=\\\"100\\\" /></a>\";\n $this->data .= \"<p>$produit[prix] €</p>\";\n $this->data .= '<a href=\"fiche_produit.php?id_produit=' . $produit['id_produit'] . '\">Voir la fiche</a>';\n $this->data .= '</div>';\n }\n }\n $this->data .= '</div></div>';\n }", "function defCatalog($name,$type = \"DIR\",$container = null){\n if(!isset($container)){\n $container = [\n defCatalog(\"manageA\",\"FUN\",[])\n ];\n }\n assert(is_array($container));\n assert(is_string($name));\n assert($type == \"DIR\" || $type == \"FUN\");\n return [\n \"name\"=>$name,\n \"type\"=>$type,\n \"container\"=>$container,\n ];\n}", "public function __construct(){\n\t\t\t$this->productoDetalleModelo = new productoDetalleModelo;\n\t\t\t$this->productoFavoritoControlador = new productoFavoritoControlador();\n\t\t\t$this->productoEstrellaControlador = new productoEstrellaControlador();\n\t\t\t$this->productoCarritoControlador = new productoCarritoControlador();\n\t\t}", "static public function ctrCrearVenta(){\n\n\t\t\n\t\tif(isset($_POST[\"nuevaVenta\"])){\n\n\t\t\t/*=============================================\n\t\t\tACTUALIZAR LAS COMPRAS DEL CLIENTE Y REDUCIR EL STOCK Y AUMENTAR LAS VENTAS DE LOS PRODUCTOS\n\t\t\t=============================================*/\n\n\t\t\t$listaProductos = json_decode($_POST[\"listaProductos\"], true);\n\t\t\t\n\n\t\t\t// $totalProductosComprados = array();\n\n\t\t\tforeach ($listaProductos as $key => $value) {\n\n\t\t\t\t// TRAER EL STOCK\n\t\t\t\t$tablaProductos = \"productos\";\n\n\t\t\t $item = \"id\";\n\t\t\t $valor = $value[\"id\"];\n\t\t\t $orden = \"id\";\n\n\t\t\t\t$stock = ModeloProductos::mdlMostrarProductos($tablaProductos, $item, $valor, $orden);\n\t\t\t\t\n\t\t\t\t// VER QUE TIPO DE STOCK TIENE\n\t\t\t\t$item = \"id\";\n\t\t\t $valor = $stock[\"id_categoria\"];\n\n\t\t\t $categorias = ControladorCategorias::ctrMostrarCategorias($item, $valor);\n\t\t\t echo '<pre>'; print_r($categorias); echo '</pre>';\n\n\t\t\t\t// SUMAR UNA VENTA\n\t\t\t $item1a = \"ventas\";\n\t\t\t\t$valor1a = $value[\"cantidad\"] + $stock[\"ventas\"];\n\n\t\t\t\t$nuevasVentas = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1a, $valor1a, $valor);\n\t\t\t\t\n\t\t\t\tif($categorias[\"movimiento\"]==\"SI\"){\n\t\t\t\t\t// SUMAR STOCK\n\t\t\t\t $item1b = \"stock\";\n\t\t\t\t\t$valor1b = $stock[\"stock\"]-$value[\"cantidad\"];\n\n\t\t\t\t\t$nuevoStock = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1b, $valor1b, $value[\"id\"]);\n\t\t\t\t\t\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\n\t\t\t$tablaClientes = \"clientes\";\n\n\t\t\t$item = \"id\";\n\t\t\t$valor = $_POST[\"seleccionarCliente\"];\n\n\t\t\t$traerCliente = ModeloClientes::mdlMostrarClientes($tablaClientes, $item, $valor);\n\t\t\t\n\n\t\t\t$item1a = \"compras\";\n\t\t\t$valor1a = $traerCliente[\"compras\"]+1;\n\n\t\t\t$comprasCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1a, $valor1a, $valor);\n\n\t\t\t$item1b = \"ultima_compra\";\n\n\t\t\t\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$valor1b = $fecha.' '.$hora;\n\n\t\t\t$fechaCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1b, $valor1b, $valor);\n\n\t\t\t/*=============================================\n\t\t\tFORMATEO LOS DATOS\n\t\t\t=============================================*/\t\n\n\t\t\t$fecha = explode(\"-\",$_POST[\"fecha\"]); //15-05-2018\n\t\t\t$fecha = $fecha[2].\"-\".$fecha[1].\"-\".$fecha[0];\n\n\t\t\tif ($_POST[\"listaMetodoPago\"]==\"CTA.CORRIENTE\"){\n\t\t\t\t\n\t\t\t\t$adeuda=$_POST[\"totalVenta\"];\n\n\t\t\t\t$fechapago=\"0000-00-00\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$adeuda=0;\n\n\t\t\t\t$fechapago = $fecha;\n\t\t\t}\n\n\t\t\t\n\n\t\t\t/*=============================================\n\t\t\tGUARDAR LA COMPRA\n\t\t\t=============================================*/\t\n\n\t\t\t$tabla = \"ventas\";\n\n\n\n\t\t\t$datos = array(\"id_vendedor\"=>$_POST[\"idVendedor\"],\n\t\t\t\t\t\t \"fecha\"=>$fecha,\n\t\t\t\t\t\t \"id_cliente\"=>$_POST[\"seleccionarCliente\"],\n\t\t\t\t\t\t \"codigo\"=>$_POST[\"nuevaVenta\"],\n\t\t\t\t\t\t \"nrofc\"=>$_POST[\"nrocomprobante\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($_POST[\"busqueda\"]),\n\t\t\t\t\t\t \"productos\"=>$_POST[\"listaProductos\"],\n\t\t\t\t\t\t \"impuesto\"=>$_POST[\"nuevoPrecioImpuesto\"],\n\t\t\t\t\t\t \"neto\"=>$_POST[\"nuevoPrecioNeto\"],\n\t\t\t\t\t\t \"total\"=>$_POST[\"totalVenta\"],\n\t\t\t\t\t\t \"adeuda\"=>$adeuda,\n\t\t\t\t\t\t \"obs\"=>strtoupper($_POST[\"obs\"]),\n\t\t\t\t\t\t \"metodo_pago\"=>$_POST[\"listaMetodoPago\"],\n\t\t\t\t\t\t \"fechapago\"=>$fechapago);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t/*=============================================\n\t\t\t\tCOMPARA EL NUMERO DE COMPROBANTE\n\t\t\t\t=============================================*/\n\t\t\t\t $nrofc = intval($_POST[\"nrocomprobante\"]);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"REGISTRO\";\n\n\t\t\t\t $nroComprobante = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nrofc==$nroComprobante[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nrofc=$nrofc+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nrofc);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\t\t\t\t \n\t\t\t\t $nroComprobante = substr($_POST[\"nuevaVenta\"],8);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"FC\";\n\n\t\t\t\t $registro = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nroComprobante==$registro[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nroComprobante=$nroComprobante+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nroComprobante);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\n\n\n\t\t\t\techo'<script>\n\n\t\t\t\tlocalStorage.removeItem(\"rango\");\n\n\t\t\t\t\n\n\t\t\t\t\t\t\t\twindow.location = \"ventas\";\n\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t }\n\n\t}", "function wtsadd2caddie($ar){\n $dps = array();\n $dos = array();\n $persByType = array();\n $switchTo = array();\n $p = new XParam($ar, array());\n $oldcaddie = $this->getCaddie();\n $linesid = $p->get('lineid');\n $formparms = array('personpackid', 'validfrom', 'offreoid', 'productoid',\n 'card', 'CHIPID', 'ACCNO', 'CRC', 'assurance',\n 'NEWCARDLabel', 'joursbonus', 'justphotoidentnom',\n 'justphotoidentprenom', 'justphotoident', 'justphotoidentdob',\n 'justetatciv', 'justdomicile', 'justgrp', 'justgrpname','customercard');\n $lineparms = array('validfrom', 'offreoid', 'productoid');\n foreach($formparms as $parm){\n $$parm = $p->get($parm);\n }\n $season = $this->getSeason();\n $lines = array();\n $cptf = 1;\n foreach($linesid as $lineid){\n $id1 = date('dhis').$cptf.uniqid('_');\n $cptf ++;\n $line = array('type'=>'forfait');\n foreach($lineparms as $parm){\n $v = $$parm;\n if (isset($v[$lineid]))\n $line[$parm]=$v[$lineid];\n else\n $line[$parm]=NULL;\n }\n // passage d'options par prog seulement\n if (isset($ar['linesOptions'][$lineid])){\n $line['options'] = $ar['linesOptions'][$lineid];\n }\n // lecture du produit et des produits associés\n if (!isset($dps[$line['productoid']])){\n\t$dps[$line['productoid']] = $this->productInfos($line['productoid'], $line['validfrom']);\n\t// cause est utilisé directement ...\n\t$dpc = $dps[$line['productoid']]['dpc'];\n }\n // lecture des offre (la meme ... ) pour avoir le flash\n if (!isset($dos[$line['offreoid']])){\n $dos[$line['offreoid']] = $this->modcatalog->displayOffre(array('_options'=>array('local'=>true),\n\t\t\t\t\t\t\t\t\t'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t\t\t\t\t\t'offre'=>$line['offreoid'],\n\t\t\t\t\t\t\t\t\t'caddie'=>false)); // le stock importe pas ici\n }\n\n // remplacement du produit si existe (fidelite - voir wtssaisieforfaits)\n if ($this->modcustomer->loyaltyActive()){\n\n // carte du forfait (!! mêmes tests que dessous)\n $rpcard2 = substr($card[$lineid], 0, 8);\n if ($rpcard2 == 'NEWCARD_'){\n $rpwtp['cardoid'] = substr($card[$lineid], 8);\n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n } elseif($card[$lineid] == 'WTPCARD'){\n //$rpnewwtp = strtoupper($CHIPID[$lineid].'-'.$CRC[$lineid].'-'.$ACCNO[$lineid]);\n $rpnewwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n $rpwtp['cardlabel'] = $rpnewwtp;\n $rpwtp['cardoid'] = NULL;\n } elseif(!empty($card[$lineid])){ \n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n $rpwtp['cardoid'] = NULL;\n $rpcardid = $card[$lineid];\n if (isset($oldcaddie['bycards']) && $oldcaddie['bycards'][$rpcardid]['newcard'] !== false){\n $rplineid = $oldcaddie['bycards'][$rpcardid]['newcard'];\n $rpwtp['cardoid'] = $oldcaddie['lines'][$rplineid]['productoid'];\n }\n }\n\n list($loyaltymess, $loyaltyprice, $loyaltyProductOid) = $this->modcustomer->checkLoyaltyReplacementProduct(array('season'=>$season, 'doffre'=>$dos[$line['offreoid']]['doffre'], 'dp'=>$dps[$line['productoid']], 'dpc'=>$dps[$line['productoid']]['dpc'], 'validfrom'=>$line['validfrom'], 'availablesNewCards'=>$dps[$line['productoid']]['availablesNewCards'],'wtp'=>$rpwtp));\n if ($loyaltyProductOid != NULL){\n XLogs::notice(get_class($this), '::wtsadd2caddie replace product '.$line['productoid'].' -> '.$loyaltyProductOid.' '.$loyaltyprice);\n $ldps = $this->productInfos($loyaltyProductOid , $line['validfrom']);\n // on remplace ... \n \n $line['productoid'] = $loyaltyProductOid;\n $dps[$line['productoid']] = $ldps;\n } else {\n XLogs::notice(get_class($this), '::wtsadd2caddie no replacement product '.$line['productoid']);\n }\n }\n // top des des produtis non dates - date si rechargement\n $line['validfrom_hidden'] = 0;\n if ($dps[$line['productoid']]['dpc']['ocalendar']->link['otype']->raw == 'NO-DATE'){\n list($drech, $dnew, $dliv) = $this->getFirstDayNoDate(date('Y-m-d h:i:s'));\n $line['validfrom_hidden'] = 1;\n if ($card[$lineid] == 'WTPCARD'){\n $line['validfrom'] = $drech;\n $line['calendar-NO-DATE'] = 0;\n } else {\n $line['calendar-NO-DATE'] = 1;\n }\n }\n // ajout d'un top flash et de l'id de la vente\n if ($dos[$line['offreoid']]['doffre']['oflash']->raw == 1){\n $line['isflash'] = true;\n foreach($dos[$line['offreoid']]['doffre']['_flash']['ventes'] as $i=>$vente){\n if (in_array($line['validfrom'], $vente['dates'])){\n $line['flashoid'] = $vente['oid'];\n break;\n }\n }\n } else {\n $line['isflash'] = false;\n }\n // ajout de l'id packpersonne et du type de personne (pour la suppression)\n if (isset($personpackid[$lineid])){\n $line['ispersonpack'] = true;\n $line['personpackid'] = $personpackid[$lineid];\n // replacement type de personne suivant composition pack\n $personType = $dps[$line['productoid']]['owtsperson']->raw;\n $persByType[$personType]++;\n if ($dos[$line['offreoid']]['persons'][$personType]->switchTo && $dos[$line['offreoid']]['persons'][$personType]->switchLimit && $persByType[$personType] == $dos[$line['offreoid']]['persons'][$personType]->switchLimit) {\n $personType = $dos[$line['offreoid']]['persons'][$personType]->switchTo;\n if (!isset($switchTo[$personType])) {\n $switchTo[$personType] = selectQuery(\"select WTSCATALOG.koid from WTSCATALOG join WTSCATALOG c2 using (wtsticket) where WTSCATALOG.wtsperson='$personType' and c2.koid='{$line['productoid']}'\")->fetch(PDO::FETCH_COLUMN);\n // lecture du produit et des produits associés\n if (!isset($dps[$switchTo[$personType]])){\n $dps[$switchTo[$personType]] = $this->productInfos($switchTo[$personType], $line['validfrom']);\n // cause est utilisé directement ...\n $dpc = $dps[$switchTo[$personType]]['dpc'];\n }\n }\n $line['productoid'] = $switchTo[$personType];\n }\n $line['wtsperson'] = $personType;\n } else {\n $line['ispersonpack'] = false;\n $line['personpackid'] = NULL;\n $line['wtsperson'] = NULL;\n }\n // ajout des champs issus du produit etc ...\n $line['validtill'] = $this->getValidtill($line['validfrom'], $dps[$line['productoid']], $dps[$line['productoid']]['dpc']);\n $line['price'] = $dps[$line['productoid']]['price']['tariff'];\n $line['label'] = $dps[$line['productoid']]['label'];\n\n // ajout carte du forfait\n $line['cardid'] = $card[$lineid];\n $line['lineid'] = $lineid;\n\n // traitement des justifs (cartes ce/ coupons ..)\n if (isset($dpc['ojustgrps']) && $dpc['ojustgrps']->raw == 1){\n $line['justifgrps'] = $justgrpname[$lineid].' '.$justgrp[$lineid];\n }\n // traitement des pièces justficaves\n if ($dpc['ojustphotoident']->raw == 1 \n && $dps[$line['productoid']]['owtsticket']->link['oduree']->raw >= $dpc['ojustphotonbjour']->raw){\n $needphotoident = true;\n } else {\n $needphotoident = false;\n }\n if (($justphotoidentnom[$lineid] && $justphotoidentprenom[$lineid])\n\t || $justphotoidentdob[$lineid]\n\t || $dpc['ojustetatciv']->raw == 1\n\t || $dpc['ojustdomicile']->raw == 1\n\t || $needphotoident){\n\t$nom = $justphotoidentnom[$lineid];\n\t$prenom = $justphotoidentprenom[$lineid];\n\t$dob = $justphotoidentdob[$lineid];\n\tif ($this->dsjustifs == NULL)\n\t $this->dsjustifs = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableJUSTIFS);\n\t$jar = array('lineid'=>$lineid, 'nom'=>$nom, 'prenom'=>$prenom, 'dob'=>$dob, 'photoident'=>0, 'etatciv'=>0, 'domicile'=>0, 'customercard'=>0);\n\t// utilisation d'une carte client\n\tif (isset($customercard[$lineid])){\n\t $jar['customercard'] = $customercard[$line_id];\n\t if ($needphotoident){\n\t if (!isset($dscustomercards)){\n\t $dscustomercards = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableCUSTOMERCARDS);\n\t }\n\t $dcard = $dscustomercards->rdisplay($customercard[$lineid]);\n\t $tmpfile = TZR_TMP_DIR.uniqid('customercard');\n\t copy($dcard['ophoto']->filename, $tmpfile);\n\t $_FILES['justphotoident']['tmp_name'][$lineid] = $tmpfile;\n\t $_FILES['justphotoident']['type'][$lineid] = $dcard['ophoto']->mime;\n\t $_FILES['justphotoident']['name'][$lineid] = $dcard['ophoto']->originalname;\n\t $_FILES['justphotoident']['type'][$lineid] = filesize($tmpfile);\n\t }\n\t}\n\tif ($dpc['ojustetatciv']->raw == 1)\n\t $jar['etatciv'] = 1;\n\tif ($dpc['ojustdomicile']->raw == 1)\n\t $jar['domicile'] = 1;\n\tif ($dpc['ojustphotoident']->raw == 1){\n\t $jar['photoident'] = 1;\n\t}\n\t$justifoid = $this->saveJustif($jar);\n\t$line['justifoid'] = $justifoid;\n }\n // ajout des lignes cartes : NEWCARD = commander; WTPCARD = saisie du WTP; autres : id de cartes deja dans le panier\n // !!! NEWCARD_WTSCATLOG:xxx = ajouter nouvelle carte, NEWCARDuniqid = nouvelle carte du panier - sera rattachée\n // !!! on a la meme chose (ou presque pour le remplacement de produit)\n $card2 = substr($line['cardid'], 0, 8);\n if ($card2 == 'NEWCARD_'){\n $cardid = uniqid('NEWCARD');\n $line['cardid'] = $cardid;\n $cardoid = substr($card[$lineid], 8);\n // trouver le bon prix et intitulé des cartes en commande\n $cardok = 0;\n foreach($dps[$line['productoid']]['availablesNewCards'] as $acarddesc){\n if($cardoid == $acarddesc['oid']){\n $cardok=1;\n break;\n }\n }\n if ($cardok !== 1){ // on doit trouver !!! sauf si on enlève\n XLogs::notice(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n //die('An error occured'.$cardoid);\n // on cherche le prix directement (DSR : rp + produit public ...)\n $ct = $this->modcatalog->getProductTariff(NULL, $line['validfrom'], $cardoid);\n if ($ct['tariff'] == 'NOT FOUND'){\n XLogs::critical(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n die('An error occured'.$cardoid);\n } else {\n $acarddesc['price'] = $ct['tariff'];\n }\n }\n $lines[$id1.'_0000'] = array('linesid'=>$lineid, 'type'=>'carte',\n\t\t\t\t 'label'=>$NEWCARDLabel[$lineid], 'cardid'=>$cardid,\n\t\t\t\t 'productoid'=>$cardoid,\n\t\t\t\t 'price'=>$acarddesc['price']);\n //les cartes ne sont pas dans le pack car elle peuvent avoir d'autres forfaits dessus\n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n\t/*saisie WTP */\n } elseif($line['cardid'] == 'WTPCARD'){\n $newwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n // regarder si cette carte n'est pas déjà dans le panier si oui recup de sont cardid\n $cardid = array_search($newwtp, $oldcaddie['cards']);\n if ($cardid === false)\n $cardid = uniqid('WTPCARD');\n $line['cardlabel'] = $newwtp;\n $line['cardid'] = $cardid;\n\t/* autres cas : cartes du panier (WTPCARDuniq ou cartes en commandes NEWCARuniqid)*/\n } elseif(!empty($line['cardid'])){ \n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n $line['cardid'] = $card[$lineid];\n }\n // ajout des lignes assurances\n if (isset($assurance[$lineid])){\n $lines[$id1.'_0020'] = array('lineid'=>$lineid, 'type'=>'assurance',\n\t\t\t\t 'label'=>$dps[$line['productoid']]['assur']['label'],\n\t\t\t\t 'productoid'=>$dps[$line['productoid']]['assur']['oid'],\n\t\t\t\t 'price'=>$dps[$line['productoid']]['assur']['price'], \n\t\t\t\t 'options'=>array());\n if (isset($dps[$line['productoid']]['assur']['options'])){\n $lines[$id1.'_0020']['options'] = $dps[$line['productoid']]['assur']['options'];\n }\n $lines[$id1.'_0020']['ispersonpack'] = $line['ispersonpack'];\n $lines[$id1.'_0020']['personpackid'] = $line['personpackid'];\n }\n // ajout des lignes bonus et calcul du bonus\n if (isset($joursbonus[$lineid]) && $joursbonus[$lineid]>0){\n // calcul du forfait bonus\n list($rline, $bline) = $this->modloyalty->getForfaitBonus($line, $joursbonus[$lineid], $dps[$line['productoid']]);\n if ($bline != NULL && $rline != NULL){\n $bline['jours'] = $joursbonus[$lineid];\n // ev garder ... $line[$id1.'_0009'] = $line\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $line = $rline;\n $lines[$id1.'_0015'] = $bline;\n }\n if ($bline != NULL && $rline == NULL){\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $lines[$id1.'_0010'] = $bline;\n $line = NULL;\n }\n }\n if ($line != NULL){\n $lines[$id1.'_0010'] = $line;\n }\n }\n // ajout des lignes au caddie\n $this->addLines2Caddie($lines);\n }", "public function CargarCatalogo() {\r\n foreach ($this->obtenerProfesionales(['id'], '', 'object') as $idProf) {\r\n $oProfesional = new Profesional(); //Instanciar un profesional\r\n $oProfesional->cargar_profesional($idProf); //Cargar modelo profesional con datos\r\n $this->col_profesional[] = $oProfesional; //Poner al profesional en el arreglo \r\n }\r\n return $this->col_profesional; //Retornar el listado de profesionales \r\n }", "function ciniki_artcatalog_categoryList($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'maps');\n $rc = ciniki_artcatalog_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_web_settings', \n 'tnid', $args['tnid'], 'ciniki.web', 'settings', 'page-gallery-artcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n\n if( isset($settings['page-gallery-artcatalog-split']) \n && $settings['page-gallery-artcatalog-split'] == 'yes' \n ) {\n $strsql = \"SELECT DISTINCT type, type AS name, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY type, category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'types', 'fname'=>'type', 'name'=>'type',\n 'fields'=>array('number'=>'type', 'name'),\n 'maps'=>array('name'=>$maps['item']['type'])),\n// 'maps'=>array('name'=>array('1'=>'Paintings', '2'=>'Photographs', '3'=>'Jewelry', '4'=>'Sculptures', '5'=>'Fibre Arts', '6'=>'Crafts', '8'=>'Pottery'))),\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['types']) ) {\n return array('stat'=>'ok', 'types'=>array());\n }\n return array('stat'=>'ok', 'types'=>$rc['types']);\n } else {\n $strsql = \"SELECT DISTINCT '0' AS type, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok', 'categories'=>array());\n }\n return array('stat'=>'ok', 'categories'=>$rc['categories']);\n }\n}", "protected function _construct()\n {\n \t$this->_isEnabled = Mage::getStoreConfig('ceesenco_maattabel/configuration/enabled');\n \t$this->_accountid = Mage::getStoreConfig('ceesenco_maattabel/configuration/accountid');\n \t$this->_width = Mage::getStoreConfig('ceesenco_maattabel/configuration/width');\n \t$this->_height = Mage::getStoreConfig('ceesenco_maattabel/configuration/height');\n \t$this->_label = Mage::getStoreConfig('ceesenco_maattabel/configuration/label');\n \t$this->_lang = Mage::getStoreConfig('ceesenco_maattabel/configuration/lang');\n\n \t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getSingleton('catalog/layer')->getCurrentCategory()->getData('maattabel_categorie'));\n \tif ($this->_categorie == \"\") {\n\t\t $current_product = Mage::registry('current_product');\n\t\t if(is_object($current_product))\n\t\t {\n\t\t $categories = $current_product->load($current_product->getId())->getCategoryIds();\n\t\t if (is_array($categories) and count($categories))\n\t\t {\n \t\t\t\t\t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getModel('catalog/category')->load($categories[count($categories)-1])->getData('maattabel_categorie'));\n\t\t }\n\t\t }\n \t}\n \t$temp = explode(\" - \", $this->_categorie);\n \t$this->_categorie = $temp[0];\n }", "static function clone_in_catalog(string $newdocuid, string $olddocuid, string $catuid) {\n $contents = Yaml::parse(ydread($catuid));\n //print_r($contents);\n $title = $contents['contents'][$olddocuid]['title'];\n $contents['contents'][$newdocuid] = ['title'=> \"$title cloné $newdocuid\" ];\n ydwrite($catuid, Yaml::dump($contents, 999));\n }", "public function create()\n {\n //\n $res = Category::select(DB::raw('*,concat(path,id) as paths'))->orderBy('paths')->get();\n foreach ($res as $key => $value) {\n $level = substr_count($value->path,',')-1;\n\n $value->catename = str_repeat('--|',$level).$value->catename;\n }\n return view('admin.goods.create',[\n 'title'=>'商品添加页面',\n 'res'=>$res\n ]);\n }", "function makeRubOrdre() { // Ordre dans la table relation rubriques/produits\r\n\t\tglobal $langues,$R0;\r\n\t\tfor ($i=0; $i<count($this->data); $i++) {\r\n\t\t\tif ($this->data[$i]['name'] == 'ordre') $ordreExist = 1; // Verif if ORDRE exist\r\n\t\t\tif ($this->data[$i]['relation'] == 1) $relationName = $this->data[$i]['name']; // Verif if got a CAT\r\n\t\t}\r\n\t\tif ($ordreExist) {\r\n\t\t\r\n\t\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\t\t\t\r\n\t\t\tif ($_GET['ordre'] == intval($_GET['ordre']) && intval($_GET['selectId']) > 0) { // Reorder One & all\r\n\t\t\t\t$newOrdre = intval($_GET['ordre']);\r\n\t\t\t\t$selectId = intval($_GET['selectId']);\r\n\t\t\t\t$this->id = $selectId;\r\n\t\t\t\t// Update selected ordre\r\n\t\t\t\t$this->champs['0'] = array(0=>'ordre',1=>$newOrdre);\r\n\t\t\t\t$C = new SQL($tableRel);\r\n\t\t\t\t$C->updateSql($this->champs, $relRubId.\"='\".$this->rub_id.\"' AND \".$relProdId.\"='\".$selectId.\"' \"); // where id='$id'\r\n\t\t\t\t// Get order for all\r\n\t\t\t\t$F = new SQL($tableRel);\r\n\t\t\t\t$F->LireSql(array($relProdId),$relRubId.\"='\".$this->rub_id.\"' ORDER BY ordre ASC \");\r\n\t\t\t\t$inc = 10;\r\n\t\t\t\tfor ($p=0; $p<count($F->V); $p++) { // Clean re-order all (prod_id)\r\n\t\t\t\t\t$C = new SQL($tableRel);\r\n\t\t\t\t\t$this->champs['0'] = array(0=>'ordre',1=>$inc);\r\n\t\t\t\t\t$C->updateSql($this->champs,$relRubId.\"='\".$this->rub_id.\"' AND \".$relProdId.\"='\".$F->V[$p][$relProdId].\"'\");\r\n\t\t\t\t\t$inc += 10;\r\n\t\t\t\t}\r\n\t\t\t\t$this->info = 'ordre';\r\n\t\t\t}\r\n\t\t\telse { // Reorder All\r\n\t\t\t\tlist($newOrdre,$order) = explode('-',clean($_GET['ordre']));\r\n\t\t\t\t// Get order for all\r\n\t\t\t\t$F = new SQL($tableRel);\r\n\t\t\t\t//$F->debug = 1 ;\r\n\t\t\t\t$F->customSql(\" SELECT $tableProd.$prodId FROM $tableProd LEFT JOIN $tableRel ON $tableProd.$prodId=$tableRel.$relProdId WHERE $tableRel.$relRubId='{$this->rub_id}' ORDER BY $tableProd.$newOrdre $order \");\r\n\t\t\t\t// Clean re-order all\r\n\t\t\t\t$inc = 10;\r\n\t\t\t\tfor ($p=0; $p<count($F->V); $p++) { // Clean re-order all\r\n\t\t\t\t\t$C = new SQL($tableRel);\r\n\t\t\t\t\t$this->champs['0'] = array(0=>'ordre',1=>$inc);\r\n\t\t\t\t\t$C->debug = 1 ;\r\n\t\t\t\t\t$C->updateSql($this->champs,$relRubId.\"='\".$this->rub_id.\"' AND \".$relProdId.\"='\".$F->V[$p][$prodId].\"'\");\r\n\t\t\t\t\t$inc += 10;\r\n\t\t\t\t}\r\n\t\t\t\t$this->info = 'ordre';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function __construct(Creditos $credito){ \n //selectDatabase();\n $this->sale = $credito;\n }", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function create()\n {\n $productor=\\App\\producto::All();\n $ventas=\\App\\ventasp::All();\n $cont=0;\n foreach ($productor as $key ) {\n # code...c\n\n $productor[$cont]->cPromedio=0;\n $productor[$cont]->gUni=0;\n foreach ($ventas as $key2) {\n # code...\n if($key->id==$key2->idProd)\n {\n $productor[$cont]->cPromedio=$productor[$cont]->cPromedio+$key2->preciov;\n $productor[$cont]->gUni=$productor[$cont]->gUni+$key2->cantidadv;\n }\n }\n $cont++;\n //for($cont=$p; $cont<count($comp2); $cont++)\n \n //$comp=\\App\\ventasp::where('idProd',$key->id)->get();\n\n }\n \n\n //$lotes=ventasp::where('idProd',1)->get();\n \n// $x=0; \n // foreach ($lotes as $key ) {\n // $x=$x+$key->preciov; \n //}\n //$lotes = lotes::proLot();\n return view('Productos.index',compact('productor'));\n }", "function ajouterProduit($code, $nom, $prix) {\n\t // echo \"<p>ajouter $code $nom $prix </p> \";\n\t \n\t /* on verifie si le panier n'est pas vide */ \n\t if ( $this->nbProduits == 0) {\n\t // echo \"<p>premier produit </p> \";\n\t \n\t /* le panier etait vide - on y ajoute un nouvel produit */\n\t $prod = new Produit($code, $nom, $prix);\n\t \n\t /* le produit dans la ligne de panier */ \n\t $lp = new LignePanier($prod);\n\t \n\t /* on garde chaque ligne dans un tableau associatif, avec le code produit en clé */\n\t\t\t $this->lignes[$code] = $lp;\n\t\t\t \n\t \n\t // echo \"<p>\" . $lp->prod->code . \" \" . $lp->qte . \"</p>\" ;\n\t \n\t $this->nbProduits = 1;\n\t }\n\t else {\n\t /* il y a deja des produits dans le panier */\n\t /* on verifie alors si $code n'y est pas deja */\n\t \n\t if ( isset ($this->lignes[$code]) ) {\n\t /* le produit y figure deja, on augmente la quantite */\n\t $lp = $this->lignes[$code] ; //on recupere la ligne du panier\n\t $qte = $lp->qte; \n\t $lp->qte = $qte + 1;\n\t \n\t // echo \"<p> nouvelle qte ($qte) : \" . $lp->qte .\"</p>\" ;\n\t \n\t }\n\t else { \n\t /* le produit n'etait pas encore dans le panier, on n'y ajoute */\n\t $prod = new Produit($code, $nom, $prix);\n\t $lp = new LignePanier($prod);\n\t \n\t $this->lignes[$code] = $lp;\n\t $this->nbProduits = $this->nbProduits + 1;\n\t \n\t\t\t\t // echo \"<p>\" . $this->lignes[$code]->prod->code . \" \" . $this->lignes[$code]->qte . \"</p>\" ;\n\t\t\t\t \n\n\t } \n\t \n\t }\t \n\t \n\t }", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "public function todaInfoProductos(){\n\n for($i = 0; $i < count($this -> listProducto); $i++){\n $this -> listProducto[$i][0] -> getInfoBasic();\n }\n }", "function cextras_objets_valides(){\r\n\t$objets = array();\r\n\tforeach (array('article','auteur','breve','groupes_mot','mot','rubrique','site') as $objet) {\r\n\t\t$objets[$objet] = array(\r\n\t\t\t'table' => table_objet_sql($objet), \r\n\t\t\t'nom' => _T('cextras:table_'.$objet),\r\n\t\t);\r\n\t}\r\n\treturn $objets;\r\n}", "function crear_carpeta($ruta,$nombre_carpeta)\r\n\t{\r\n\t}", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "function createObject()\n {\n $stmt = $this->mysqli->prepare(\"INSERT INTO object(`name`, `description`, `price`, `typeCoin`, `weight`, `volume`, `limitationStrength`,\n `limitationDex`, `limitationCons`, `limitationInt`, `limitationWis`,`typeObject`, `primal`)\n VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\");\n $stmt->bind_param(\n \"ssisiiiiiiisi\",\n $this->name,\n $this->description,\n $this->price,\n $this->typeCoin,\n $this->weight,\n $this->volume,\n $this->limitationStrength,\n $this->limitationDex,\n $this->limitationCons,\n $this->limitationInt,\n $this->limitationWis,\n $this->typeObject,\n $this->primal\n );\n $stmt->execute();\n $this->id = $this->mysqli->insert_id;\n $stmt->close();\n }", "function AddSingleBook()\n {\n $id_libro = $_POST[\"id_libro\"];\n $cart = new Carrello;\n $cart->InsertNewCart($id_libro);\n $book = new Libri;\n $libro = $book->GetBook($id_libro);\n return $libro[\"titolo\"].\"$$$\".$libro[\"autore\"].\"$$$\".$libro[\"prezzo\"].\"$$$\".$libro[\"path_copertina\"];\n }", "public function onGenerate()\n {\n try\n {\n $this->onSearch();\n // open a transaction with database 'bedevops'\n TTransaction::open(self::$database);\n $param = [];\n // creates a repository for Resultado\n $repository = new TRepository(self::$activeRecord);\n // creates a criteria\n $criteria = new TCriteria;\n\n if ($filters = TSession::getValue(__CLASS__.'_filters'))\n {\n foreach ($filters as $filter) \n {\n $criteria->add($filter); \n }\n }\n\n // load the objects according to criteria\n $objects = $repository->load($criteria, FALSE);\n\n if ($objects)\n {\n $dataTotals = [];\n $data = [];\n $groups = [];\n foreach ($objects as $obj)\n {\n $group1 = $obj->categoria->categoria;\n $group2 = $obj->relatorio->titulo;\n\n $groups[$group2] = true;\n $numericField = $obj->valor;\n\n $dataTotals[$group1][$group2]['count'] = isset($dataTotals[$group1][$group2]['count']) ? $dataTotals[$group1][$group2]['count'] + 1 : 1;\n $dataTotals[$group1][$group2]['sum'] = isset($dataTotals[$group1][$group2]['sum']) ? $dataTotals[$group1][$group2]['sum'] + $numericField : $numericField;\n\n }\n\n $groups = ['x'=>true]+$groups;\n $data = [array_keys($groups)];\n $line = array_fill(0, count($groups), NULL);\n\n foreach ($dataTotals as $group1 => $group1Totals) \n {\n\n $lineData = $line;\n\n $lineData[0] = $group1;\n foreach ($group1Totals as $group2 => $totals) \n {\n $posi = array_search($group2, array_keys($groups));\n\n $lineData[$posi] = $totals['sum'];\n\n }\n $data[] = $lineData;\n }\n\n $chart = new THtmlRenderer('app/resources/c3_bar_chart.html');\n $chart->enableSection('main', [\n 'data'=> json_encode($data),\n 'height' => 500,\n 'precision' => 0,\n 'decimalSeparator' => ',',\n 'thousandSeparator' => '.',\n 'prefix' => '',\n 'sufix' => '%',\n 'width' => 100,\n 'widthType' => '%',\n 'title' => 'Resultado',\n 'showLegend' => 'true',\n 'showPercentage' => 'true',\n 'barDirection' => 'false'\n ]);\n\n parent::add($chart);\n }\n else\n {\n new TMessage('error', _t('No records found'));\n }\n\n // close the transaction\n TTransaction::close();\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function __construct($id,$nom,$description,$prix,$categorie,$user){\n $this->Idservivce=$id;\n $this->NomService=$nom;\n $this->DescriptionService=$description;\n $this->prix=$prix;\n $this->Categorie=$categorie;\n $this->User=$user;\n \n }", "function ajouter_vue(){\n $fichier = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'cli' . DIRECTORY_SEPARATOR . 'compteur';\n $fichier_journalier = $fichier . '_' . date('Y-m-d');\n incrementer_compteur($fichier);\n incrementer_compteur($fichier_journalier);\n }", "function genera_cotizador($filtros){ \n\n \t$cotiza = new cotizador_detalle;\n \t$cotiza->id_cotizacion = $filtros->id_cotizacion;\n\n \t$productos = $cotiza->detalle_cotizacion($cotiza);\n \t$cotizacion = cotizador::where('id',$filtros->id_cotizacion)->first();\n \t$num_cotizacion = $filtros->id_cotizacion;\n\n \t$estatus = $cotizacion->estatus == '' ? 0 : $cotizacion->estatus;\n\n \t$options = view('cotizador.table',compact('productos','cotizacion','num_cotizacion','estatus'))->render();\n\n \treturn $options;\n }", "function add_tour($type,$item,$name,$desc,$price,$currency,$route,$program,$duration,$place,$date){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t\t$fold = 'belarus';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t\t$fold = 'belarus_pref';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t\t$fold = 'foreigners';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t\t$fold = 'foreigners_pref';\n\t}\n\tcreate_path('../../img/tours/'.$fold.'/'.$item.'/');\n\tdo {\n\t\t$folder = randomName(7);\n\t} while(file_exists('../../img/tours/'.$fold.'/'.$item.'/'.$folder));\n\t$object = json_decode(file_get_contents($patch));\n\n\t$object_item = new stdClass();\n\t$object_item->name = $name;\n\t$object_item->desc = $desc;\n\t$object_item->price = $price;\n\t$object_item->currency = $currency;\n\t$object_item->route = $route;\n\t$object_item->program = $program;\n\t$object_item->duration = $duration;\n\t$object_item->place = $place;\n\tif($date !== false){\n\t\t$object_item->date = $date;\n\t}\n\tcreate_path('../../img/tours/'.$fold.'/'.$item.'/'.$folder);\n\t$object_item->img = 'img/tours/'.$fold.'/'.$item.'/'.$folder;\n\t// mkdir('../../img/tours/'.$fold.'/'.$item.'/'.$folder, 0777);\n\tarray_push($object[0]->$item,$object_item);\n\t$fp = fopen($patch,'w');\n\tfwrite($fp,json_encode($object));\n\tfclose($fp);\n\treturn true;\n}", "public static function AbilitaSbloccate($PG){\n\n\t\t$sbloccate\t\t=$PG->Sbloccate()->get();\n\n\t\t// trova abilità disponibili per l'acquisto\n\t\t$possessed = $PG['Abilita'];\n\t\t// trova le abilità eventualmente escluse da quelle acquistabili da una abilità già posseduta\n\t\t$escluse=array();\n\t\tforeach ($possessed as $pos){\n\t\t\t$escab=$pos->Esclusi;\n\t\t\t$esc=INtools::select_column($escab,'ID');\n\t\t\tforeach ($esc as $escid){\n\t\t\t\tarray_push($escluse,$escid);\n\t\t\t}\n\t\t}\n\t\t$possessed = $possessed->lists('ID');\n\n\t\t$categorie = $PG['Categorie']->lists('Categoria');\n\n\t\t$categorie_poss=$categorie;\n\t\tarray_push($categorie_poss,'Speciali');\n\t\tarray_push($categorie_poss,'Innate');\n\t\tarray_push($categorie_poss,'Spiriti');\n\t\t\n\t\tif (empty($sbloccate)) $sbloccate=array();\n\t\tif (empty($possessed)) $possessed=array();\n\t\tif (empty($categorie)) $categorie=array();\n\t\t$all_ab = Abilita::all();\n\t\t#cartellino potere supplementare, aggiungilo se è già stato preso 1 volta, ma meno di 8 volte.\n\t\tif (in_array(57,$possessed)) {\n\t\t\t$cc=array_count_values($possessed);\n\t\t\t$cart_pot_supl=$cc[57];\n\t\t\t} else {\n\t\t\t\t$cart_pot_supl=0;\n\t\t\t}\n\t\t\t\n\t\tforeach ($all_ab as $ab){\n\n\t\t\t $reqab=$ab->Requisiti;\n\t\t\t $req=INtools::select_column($reqab,'ID');\n\n\t\t\t \n\t\t\t // se l'abilità è nelle categorie giuste, non è già stata\n\t\t\t //acquistata, oppure è stata sbloccata, allora aggiungi alla lista\n\t\t\t if (array_intersect($req,$possessed)==$req &\n\t\t\t\t in_array($ab['Categoria'],$categorie) &\n\t\t\t\t (!in_array($ab['ID'],$possessed) | in_array('Mistiche',$categorie) &$ab['ID']==57 & $cart_pot_supl<8) &\n\t\t\t\t !in_array($ab['ID'],$escluse) ) {\n\t\t\t\t$sbloccate[]=$ab;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t// controllo se ho le abilità conoscenza profonda //\n\t\t// e confini della conoscenza. In base alla loro descrizione,\n\t\t// aggiungo o meno abilità alla lista\t\t\t\n\t\t$hasConoscProf=in_array(36,$possessed);\n\t\t$hasConoscConf=in_array(37,$possessed);\n\t\t\n\t\t$num_generiche=0;\n\t\t$fuori_categoria=0;\n\t\tforeach ($PG['Abilita'] as $ab){\n\t\t\tif ($ab['Generica']==1 & !in_array($ab['Categoria'],$categorie_poss)){\n\t\t\t\t\t$num_generiche++;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($PG['Abilita'] as $ab){\n\t\t\tif (!in_array($ab['Categoria'],$categorie_poss)){\n\t\t\t\t$fuori_categoria++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// conoscenza profonda\n\t\t$generiche=Abilita::where('Generica','=','1')->get();\n\t\tif ((!$hasConoscProf & $num_generiche<1)|($hasConoscProf & $num_generiche<2)) {\n\t\t\tforeach ($generiche as $ab){\n\t\t\t\tif (!in_array($ab['ID'],$possessed)){\n\t\t\t\t\t$sbloccate[]=$ab;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//confini della conoscenza\n\t\tif (($hasConoscConf & $fuori_categoria<=1)|($hasConoscConf & $hasConoscProf & $fuori_categoria<=2)) {\n\t\t\tforeach ($all_ab as $ab){\n\t\t\t\tif (!in_array($ab['ID'],$possessed) & !in_array($ab['Categoria'],array('Speciali','Innate','Spiriti'))){\n\t\t\t\t\t$sbloccate[]=$ab;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//converto in un array adatto a un SELECT input\n\t\t$selSbloccate=array();\n\t\tforeach($sbloccate as $sbloccata){\n\t\t\t$selSbloccate[$sbloccata->ID]=$sbloccata->Ability.' ('.$sbloccata->PX.'px)';\n\t\t\t}\n\t\treturn INtools::array_unshift_assoc($selSbloccate,'0','');\n\t}", "function ajouteProdToRub() { \r\n\t\tglobal $R0;\r\n\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\r\n\t\t$C = new SQL($tableRel);\r\n\t\t$champs = array(array($relRubId,$relProdId,'ordre'),array($this->rub_id,intval($_POST[$prodId]),'999')); // Array champsName // Array champsVal\r\n\t\t$C->insertSql($champs,1);\r\n\t\t$this->info = 'ajout';\r\n\t}", "public function accueil() {\r\n $tickets = $this->ticket->getTickets();\r\n $vue = new Vue(\"Accueil\");\r\n $vue->generer(array('tickets' => $tickets));\r\n }", "public function ZipCodeCatalog()\n {\n parent::Catalog();\n }", "public function newAction()\n {\n $request = $this->get('request');\n $campeonatoId = $request->request->get('campeonato');\n /* Precondicion: debe haber al menos 2 equipos inscriptos en el Campeonato */\n $em = $this->getDoctrine()->getEntityManager();\n $campeonato = $em->getRepository('Area4CampeonatoBundle:Campeonato')->findOneById($campeonatoId);\n if ( count($campeonato->getEquipo()) > 2 ){\n $partido = new Partido();\n \n $campeonato = $em->getRepository('Area4CampeonatoBundle:Campeonato')->findOneById($campeonatoId);\n\n $partidoType = new PartidoType();\n $partidoType->setCampeonato($campeonato);\n\n $form = $this->createForm($partidoType, $partido);\n\n return array(\n 'entity' => $partido,\n 'form' => $form->createView(),\n );\n }\n\n //echo \"\";\n //throw new \\Exception(\"Debe de haber al menos 2 equipos en el Campeonato\", 1);\n \n //throw $this->createNotFoundException('Debe de haber al menos 2 equipos en el Campeonato');\n return new Response(\"<h2>Debe de haber al menos 2 equipos en el Campeonato</h2>\",404);\n }", "public function createRayonAndAddAllProduits()\n\t{\n\t\t$user = User::where(['email' => 'ent1@dev.com'])->first();\n\t\t$ent = Entreprise::where(['user_id' => $user->id])->first();\n\t\tAuth::login($user);\n\n\t\t$etagere_produits[1] = json_decode('[{\"position\": {\"top\": \"8%\", \"left\": \"4%\"}, \"id_produit\": 1, \"id_position\": 0}, {\"position\": {\"top\": \"8%\", \"left\": \"30%\"}, \"id_produit\": 2, \"id_position\": 1}, {\"position\": {\"top\": \"8%\", \"left\": \"56%\"}, \"id_produit\": 3, \"id_position\": 2}, {\"position\": {\"top\": \"8%\", \"left\": \"82%\"}, \"id_produit\": 4, \"id_position\": 3}, {\"position\": {\"top\": \"41%\", \"left\": \"4%\"}, \"id_produit\": 5, \"id_position\": 4}, {\"position\": {\"top\": \"41%\", \"left\": \"30%\"}, \"id_produit\": 6, \"id_position\": 5}, {\"position\": {\"top\": \"41%\", \"left\": \"56%\"}, \"id_produit\": 7, \"id_position\": 6}, {\"position\": {\"top\": \"41%\", \"left\": \"82%\"}, \"id_produit\": 8, \"id_position\": 7}, {\"position\": {\"top\": \"73%\", \"left\": \"4%\"}, \"id_produit\": 9, \"id_position\": 8}, {\"position\": {\"top\": \"73%\", \"left\": \"30%\"}, \"id_produit\": 10, \"id_position\": 9}, {\"position\": {\"top\": \"73%\", \"left\": \"56%\"}, \"id_produit\": 11, \"id_position\": 10}, {\"position\": {\"top\": \"73%\", \"left\": \"82%\"}, \"id_produit\": 12, \"id_position\": 11}]');\n\t\t$etagere_produits[2] = json_decode('[{\"position\": {\"top\": \"8%\", \"left\": \"4%\"}, \"id_produit\": 13, \"id_position\": 0}, {\"position\": {\"top\": \"8%\", \"left\": \"30%\"}, \"id_produit\": 14, \"id_position\": 1}, {\"position\": {\"top\": \"8%\", \"left\": \"56%\"}, \"id_produit\": 15, \"id_position\": 2}, {\"position\": {\"top\": \"8%\", \"left\": \"82%\"}, \"id_position\": 3}, {\"position\": {\"top\": \"41%\", \"left\": \"4%\"}, \"id_position\": 4}, {\"position\": {\"top\": \"41%\", \"left\": \"30%\"}, \"id_position\": 5}, {\"position\": {\"top\": \"41%\", \"left\": \"56%\"}, \"id_position\": 6}, {\"position\": {\"top\": \"41%\", \"left\": \"82%\"}, \"id_position\": 7}, {\"position\": {\"top\": \"73%\", \"left\": \"4%\"}, \"id_position\": 8}, {\"position\": {\"top\": \"73%\", \"left\": \"30%\"}, \"id_position\": 9}, {\"position\": {\"top\": \"73%\", \"left\": \"56%\"}, \"id_position\": 10}, {\"position\": {\"top\": \"73%\", \"left\": \"82%\"}, \"id_position\": 11}]');\n\t\t$rayon_id = Rayon::create([\n\t\t\t'nom' => 'ut_Rayon',\n\t\t\t'entreprise_id' => $ent->id\n\t\t])['id'];\n\t\t$sous_rayon_id = SousRayon::create([\n\t\t\t'nom' => 'ut_SousRayon',\n\t\t\t'entreprise_id' => $ent->id,\n\t\t\t'rayon_id' => $rayon_id\n\t\t])['id'];\n\t\tfor ($i = 1; $i <= 2; ++$i)\n\t\t{\n\t\t\tEtagere::create([\n\t\t\t\t'nom' => 'ut_Etagere',\n\t\t\t\t'entreprise_id' => $ent->id,\n\t\t\t\t'rayon_id' => $rayon_id,\n\t\t\t\t'sous_rayon_id' => $sous_rayon_id,\n\t\t\t\t'list_produits' => $etagere_produits[$i]\n\t\t\t])['id'];\n\t\t}\n\t\t$ent->shop_order = json_decode('{\"A0\": {\"A00\": {\"A000\": {\"etagere_id\": 1, \"etagere_nom\": \"ut_Etagere\"}, \"A001\": {\"etagere_id\": 2, \"etagere_nom\": \"ut_Etagere\"}, \"sous_rayon_id\": 1, \"sous_rayon_nom\": \"ut_SousRayon\"}, \"rayon_id\": 1, \"rayon_nom\": \"ut_Rayon\"}}');\n\t\t$ent->save();\n\t}", "public function create(): Renderable\n {\n return view('inventory.create', ['categories' => Category::pluck('naam', 'id')]);\n }", "function agregar($nombre_libro, $paginas_libro, $codigo_libro, $version_libro, $id_editorial, $id_estado_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tlibro(nombre_libro, paginas_libro, codigo_libro, version_libro, id_editorial, id_estado_libro)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_libro',\n\t\t\t\t\t\t\t\t'$paginas_libro',\n\t\t\t\t\t\t\t\t'$codigo_libro',\n\t\t\t\t\t\t\t\t'$version_libro',\n\t\t\t\t\t\t\t\t$id_editorial,\n\t\t\t\t\t\t\t\t$id_estado_libro\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('libroClass.php');\n\t\t$libro = new Libro($id, $nombre_libro, $paginas_libro, $codigo_libro, $version_libro, $id_editorial, $id_estado_libro);\n\t\t//Regreso los productos\n\t\treturn $libro;\n\t}", "public function createdbhaircutman($nom,$prix){\n\n global $connect_bdd;\n\n $sql = \"INSERT INTO `haircut_man`(`name`, `price`) VALUES ('\".$nom.\"' , '\".$prix.\"' )\";\n $connect_bdd->query($sql);\n\n }", "public function onProductAdd( $param )\n {\n try\n {\n TTransaction::open('futapp');\n $data = $this->form->getData();\n \n if( (! $data->nome_atleta) || (! $data->cpf))\n throw new Exception('O nome e o CPF são obrigatorios');\n \n \n \n $sale_items = TSession::getValue('sale_items');\n \n if ($data->id_atleta) \n {\n $key = $data->id_atleta;\n }\n else\n {\n $key = uniqid();\n }\n\n $sale_items[ $key ] = ['id_atleta' => $key,\n 'nome_atleta' => $data->nome_atleta,\n 'cpf' => $data->cpf,\n 'ja_jogou' => $data->ja_jogou];\n \n TSession::setValue('sale_items', $sale_items);\n \n // clear product form fields after add\n $data->id_atleta = '';\n $data->nome_atleta = '';\n $data->cpf = '';\n $data->ja_jogou = '';\n TTransaction::close();\n $this->form->setData($data);\n\n TTransaction::open('futapp');\n $objCategoria = new CategoriaCampeonato($data->ref_categoria);\n\n $obj = new stdClass;\n\n $obj->ref_campeonato = $objCategoria->ref_campeonato;\n $obj->ref_categoria = $objCategoria->id;\n $this->fireEvents( $obj );\n TTransaction::close();\n \n $this->onReload( $param ); // reload the sale items\n }\n catch (Exception $e)\n {\n $data = $this->form->getData();\n\n $this->form->setData( $data);\n TTransaction::open('futapp');\n $objCategoria = new CategoriaCampeonato($data->ref_categoria);\n\n $obj = new stdClass;\n\n $obj->ref_campeonato = $objCategoria->ref_campeonato;\n $obj->ref_categoria = $objCategoria->id;\n $this->fireEvents( $obj );\n TTransaction::close();\n new TMessage('error', $e->getMessage());\n }\n }", "private function seedCatalog(){\n /*DB::table('clientes')->delete();\n foreach( $this->arrayClientes as $cliente ) {\n $c = new Cliente;\n $c->nombre = $cliente['nombre'];\n $c->imagen = $cliente['imagen'];\n $c->fecha_nacimiento = $cliente['fecha_nacimiento'];\n $c->correo = $cliente['correo'];\n $c->save();\n }*/\n\n }", "public function create()\n {\n //\n\n\n $categories = category::all() ;\n $produit = new Produit ;\n // pour éviter l'erreur $produit undifined qu'on crée la ligne 51 $produit = new Produit ;\n return view(\"front-office.produits.create\",[\n \"categories\"=>$categories,\n \"produit\"=>$produit\n ]) ;\n }", "public function new_productos($com_id){\n $enlaces=$this->menu_modelo->get_Modulos_programacion(2);\n $data['enlaces'] = $enlaces;\n $data['componente'] = $this->model_componente->get_componente($com_id);\n\n\n if(count($data['componente'])!=0){\n $fase=$this->model_faseetapa->get_fase($data['componente'][0]['pfec_id']);\n $data['nro_fase'] = $this->model_faseetapa->nro_fase($fase[0]['proy_id']); /// nro de fases y etapas registrados\n $data['proyecto'] = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); \n $data['id_f'] = $this->model_faseetapa->get_id_fase($fase[0]['proy_id']); //// recupera datos de la tabla fase activa\n $data['indi'] = $this->model_proyecto->indicador(); /// indicador\n $data['metas'] = $this->model_producto->tp_metas(); /// tp metas\n $data['oestrategicos'] = $this->model_mestrategico->list_objetivos_estrategicos(); /// Objetivos Estrategicos\n $data['mod']=1;\n if(count($this->model_producto->ult_operacion($com_id))!=0){\n $data['cod_ope']=$this->model_producto->ult_operacion($com_id);\n }\n else{\n $data['cod_ope']=0;\n }\n \n/* if($data['proyecto'][0]['tp_id']==1){\n $data['componente'] = $this->model_componente->get_componente_pi($com_id); \n }\n else{\n $data['componente'] = $this->model_componente->get_componente($com_id);\n }*/\n \n $this->load->view('admin/programacion/producto/form_prod', $data); \n }\n else{\n redirect('admin/dashboard');\n }\n }", "function __construct() {\n\t\tparent::__construct();\n $this->vista->setTitle('Cursos');\n\t\t$this->TSubgrupo = new TSubgrupo();\n\t\t$this->TPrograma = new TPrograma();\n\t }", "static function &creer_cacti_graphs(&$liste_option, $sort_en_erreur = false, $entete = __CLASS__) {\n\t\t$objet = new cacti_graphs ( $sort_en_erreur, $entete );\n\t\t$objet->_initialise ( array (\n\t\t\t\t\"options\" => $liste_option \n\t\t) );\n\t\t\n\t\treturn $objet;\n\t}", "function categportal($cod,$desc,$tipo){\r\n\t\t$fCateg = new fachada_categportal();\r\n\t\t$oCateg = $fCateg->categportal($cod,$desc,$tipo);\r\n\t\treturn $oCateg;\r\n\t}", "public function lectureContenu ()\n {\n\n //$metadata = simplexml_load_file(\"xmoddledata/metadata.xml\");\n\n // on Vérifie si le cours existe\n\n /* @TODO Partie à décommenter lorsque le module de navigation sera intégré au reste de l'application */\n\n // $nbrCours = $metadata->attributes()->nbrCours;\n // $isFound = false;\n // $i = 0;\n // for ($i = 0; $i < $nbrCours; $i++) {\n // if ($metadata->cours[$i]->attributes()->title == $title && $metadata->cours[$i]->attributes()->id == $id) {\n // $isFound = true;\n // break;\n // }\n // }\n\n // if ($isFound) {\n //$cours = simplexml_load_file(\"xmoddledata/\" . $metadata->cours[$i]->attributes()->id . \"_\" . $metadata->cours[$i]->attributes()->title . \"/description.xml\"); \n\n $description = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/description.xml');\n $notions = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/descriptionNotions.xml');\n\n // Création d'un tableau associatif de notions avec l'id comme clé\n\n $notionsArray = $this->getNotions($notions);\n\n // Construction de la navigation\n $text_parties = \"\";\n $nav_parties = [];\n for ($i = 0; $i < $description->attributes()->nbrParties; $i++) {\n $text_parties = \"<div style='\";\n $text_parties .= $this->getStyle($description->partie[$i]->attributes());\n $text_parties .= \"'\";\n $text_parties .= \" id='\".$i.\"'>\";\n $nav_chapitres = [];\n $text_parties .= $description->partie[$i]->attributes()->title;\n $text_parties .= \"</div>\";\n $text_parties .= \"<br/><br/>\";\n $text_chapitres = \"\";\n for ($j = 0; $j < $description->partie[$i]->attributes()->nbrChapitres; $j++) {\n $text_chapitres .= \"<div style='\";\n $text_chapitres .= $this->getStyle($description->partie[$i]->chapitre[$j]->attributes());\n $text_chapitres .= \"'\";\n $text_chapitres .= \" id='\".$i.\"_\".$j.\"'>\";\n $nav_paragraphes = [];\n $text_chapitres .= $description->partie[$i]->chapitre[$j]->attributes()->title;\n $text_chapitres .= \"</div>\";\n $text_chapitres .= \"<br/><br/>\";\n $text_paragraphes = \"\";\n for ($k = 0; $k < $description->partie[$i]->chapitre[$j]->attributes()->nbrParagraphes; $k++) {\n // On renseigne le titre du paragraphe\n $text_paragraphes .= \"<div style='\";\n $text_paragraphes .= $this->getStyle($description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes());\n $text_paragraphes .= \"'\";\n // Ajout d'un ancre de navigation\n $text_paragraphes .= \" id='\".$i.\"_\".$j.\"_\".$k.\"'>\";\n $text_paragraphes .= $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n $text_paragraphes .= \"</div>\";\n $text_paragraphes .= \"<br/>\";\n // Navigation avec paragraphes\n $nav_paragraphes[\"\".$i.\"_\".$j.\"_\".$k] = $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n // On remplit les notions contenus dans le paragraphe\n for ($l = 0; $l < $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->nbrNotions; $l++) {\n $text_paragraphes .= $notionsArray[\"\".$description->partie[$i]->chapitre[$j]->paragraphe[$k]->notion[$l]->attributes()->id];\n }\n }\n $text_chapitres .= $text_paragraphes;\n $nav_chapitres[\"\".$i.\"_\".$j] = $nav_paragraphes;\n }\n $text_parties .= $text_chapitres;\n $nav_parties[\"\".$i] = $nav_chapitres;\n }\n// dd($nav_parties);\n// dd($navigation);\n// dd($description);\n\n // Construction de la page web\n $titre = $description->attributes()->title;\n// dd($description);\n// forearch( $navigation->partie[] as $partie) {\n// dd($pantie);\n// }\n// dd($titre);\n\n\n // $notions = simplexml_load_file(\"../../../fichiersdestructuration/descriptionNotions.xml\");\n\n\n // $nbrNotions = $cours->attributes()->nbrNotions;\n // $notionsConvertis = array();\n // for ($i = 0; $i < $nbrNotions; $i++) {\n // $attributs = $cours->notion[$i]->attributes();\n // $style = \"\";\n // if ($attributs['font-weight'] != null) {\n // $style .= 'font-weight:' . $attributs['font-weight'] . \";\";\n // }\n // if ($attributs['font-size'] != null) {\n // $style .= 'font-size:' . $attributs['font-size'] . \";\";\n // }\n\n // if ($attributs['font-family'] != null) {\n // $style .= 'font-family:' . $attributs['font-family'] . \";\";\n // }\n\n // if ($attributs['color'] != null) {\n // $style .= 'color:' . $attributs['color'] . \";\";\n // }\n\n // if ($attributs['text-decoration'] != null) {\n // $style .= 'text-decoration:' . $attributs['text-decoration'] . \";\";\n // }\n\n // $text = \"\";\n // foreach ($cours->notion[$i]->children() as $child) {\n // $text .= $child->asXML();\n // }\n // $notionHtml = \"<div style='\";\n // $notionHtml .= $style;\n // $notionHtml .= \"'>\";\n // $notionHtml .= $text;\n // $notionHtml .= \"</div>\";\n\n\n // //dd(strval($text));\n // array_push($notionsConvertis, $notionHtml);\n\n // }\n // }else{\n // return view(\"/\");\n // }\n //$notions = $notionsConvertis;\n // return response()->json($notions,200);\n\n // return \"lecture cours\";\n return 0;\n }", "public function create()\n {\n $segments = Segment::on(Auth::user()->database_name)->orderBY('description','asc')->pluck('description','id')->toArray();\n \n $subsegments = Subsegment::on(Auth::user()->database_name)->orderBY('description','asc')->get();\n \n $unitofmeasures = UnitOfMeasure::on(Auth::user()->database_name)->orderBY('description','asc')->get();\n \n return view('admin.combos.create',compact('segments','subsegments','unitofmeasures'));\n }", "function catalogoProdotti(){\n$datsys = date(\"Y/m/d\");\n$scadenza = strtotime('-4 day', strtotime($datsys));\n$scadenza = date('Y-m-d', $scadenza);\n$catalogo = query(\"SELECT * FROM prodotti WHERE quantita_pdt <> 0\");\nconferma($catalogo);\n\nwhile($row = fetch_array($catalogo)){\n $data = strtotime('+3 day', strtotime($row['datainsert']));\n $data = date('Ymd', $data);\n $datsys = date(\"Ymd\");\n if ($datsys < $data) {\n $prezzo = 0;\n $prezzopieno = $row['prezzo'];\n $prezzo80 = $prezzopieno*80/100;\n $prezzo20 = $prezzopieno*20/100;\n $dataOggi = date(\"Y/m/d\");\n $data = $row['datainsert'];\n $differenza = floor((strtotime($data) - strtotime($dataOggi)) / 86400);\n if ($differenza==0) {\n $prezzo = $prezzopieno;\n }\n if ($differenza== -1) {\n $prezzo = $prezzo80;\n }\n if ($differenza== -2) {\n $prezzo = $prezzo20;\n }\n\n\n $shopCatalogo = <<<CATALOGO\n <div class=\"col-lg-3 col-md-6 mb-4\">\n <div class=\"card altezza\">\n <img class=\"card-img-top\" src=\"immagini/{$row['immagine']}\" alt=\"\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">{$row['nome_prodotto']}</h4>\n <h5>€{$prezzo}</h5>\n <p class=\"card-text\">{$row['descr_prodotto']}</p>\n </div>\n <div class=\"card-footer text-center\">\n <a href=\"prodotto.php?id={$row['id_prodotto']}\" class=\"btn btn-info btn-small\">Dettagli</a>\n </div>\n</div>\n</div>\n\nCATALOGO;\necho $shopCatalogo;\n}\n}\n}", "public function create()\n {\n return view('administracion.cupon_descuento.create',[\n \"action\" => \"create\",\n \"monedas\" => Pais::whereIn('moneda',['ARS','CLP'])->pluck('moneda','moneda'),\n \"modos_aplicacion_descuento\" => NModoAplicacionDescuento::all()->pluck('descripcion','id'),\n ]);\n }", "function alistar()\n\t{\n\t\t$data['equipo'] = $this->equipos_model->equipos();\n\t\t$data['insumo'] = $this->equipos_model->insumos1();\n\t\t//$data['test'] = $this->insumos_model->decrementa_stock('12'); \n\t\t\n\t\t\n\t\t//cargo vista para realizar recepciones\n $data['content_view']='entregas_view';\n \t//template diferente para vistas que no incluyen grocery \n \t$this->load->view('template2',$data);\n\t\t\n\t\t}", "private function affichageItemCreateur() : string{\n $i = $this->tab[0][0];\n $l = $this->tab[1][0];\n $m = $this->tab[2][0];\n $testType = explode(\"/\",$i['img']);\n if (count($testType) > 1){\n $image = $i['img'];\n }else{\n $image = \"../../img/\" . $i['img'];\n }\n // item réservé (par défaut)\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-secondary\\\">RÉSERVÉ</span></h5>\";\n $modification = \"<a class=\\\"btn btn-warning btn-lg disabled\\\" href=\\\"#\\\" role=\\\"button\\\" aria-disabled=\\\"true\\\"><span class=\\\"fa fa-pencil\\\" ></span> Modifier l'item</a>\";\n $url_creerCagnotte = $this->container->router->pathFor(\"creerCagnotte\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $supprimer = \"<button type=\\\"button\\\" class=\\\"btn btn-lg btn-danger disabled\\\" data-toggle=\\\"modal\\\" data-target=\\\"#confirmationSupp_{$i['nom']}\\\"><span class=\\\"fa fa-trash fa-lg\\\"></span> Supprimer</button>\";\n $cagnotte = \"<a class=\\\"btn btn-success btn-lg disabled\\\" href=\\\"$url_creerCagnotte\\\" role=\\\"button\\\" aria-disabled=\\\"true\\\"><i class=\\\"fa fa-usd\\\" aria-hidden=\\\"true\\\"></i> Créer une cagnotte</a>\";\n // on verifie si l'item n'est pas reservé\n if ($i['reserve'] == \"false\"){\n $url_modification = $this->container->router->pathFor(\"modifierItem\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $url_creerCagnotte = $this->container->router->pathFor(\"creerCagnotte\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $modification = \"<a class=\\\"btn btn-warning btn-lg\\\" href=\\\"$url_modification\\\" role=\\\"button\\\"><span class=\\\"fa fa-pencil\\\" ></span> Modifier l'item</a>\";\n if ($i['cagnotteActive'] == \"false\") {\n $cagnotte = \"<a class=\\\"btn btn-success btn-lg\\\" href=\\\"$url_creerCagnotte\\\" role=\\\"button\\\" aria-disabled=\\\"true\\\"><i class=\\\"fa fa-usd\\\" aria-hidden=\\\"true\\\"></i> Créer une cagnotte</a>\";\n }\n else {\n $cagnotte = \"<a class=\\\"btn btn-success btn-lg disabled\\\" href=\\\"$url_creerCagnotte\\\" role=\\\"button\\\" aria-disabled=\\\"true\\\"><i class=\\\"fa fa-usd\\\" aria-hidden=\\\"true\\\"></i> Créer une cagnotte</a>\";\n }\n\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-secondary\\\">PAS ENCORE RÉSERVÉ</span></h5>\";\n $supprimer = \"<button type=\\\"button\\\" class=\\\"btn btn-lg btn-danger\\\" data-toggle=\\\"modal\\\" data-target=\\\"#confirmationSupp_{$i['nom']}\\\"><span class=\\\"fa fa-trash fa-lg\\\"></span> Supprimer</button>\";\n }\n $url_supprimerImage = $this->container->router->pathFor(\"supprimerImage\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $supprimerImage = \"<a class=\\\"btn btn-danger btn-lg\\\" href=\\\"$url_supprimerImage\\\" role=\\\"button\\\"><span class=\\\"fa fa-trash fa-lg\\\" ></span> Supprimer Image</a>\";\n // on verifie si l'item possède un url pour l'acheter sur un site externe\n if ($i['url'] != \"\") {\n $url =$i['url'];\n } else {\n $url = \"Aucun URL disponible\";\n }\n $message = \"\";\n $date = date('Y-m-d',strtotime($l['expiration']));\n if ($date < $this->today) {\n if (isset($m['auteur']) ) {\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-secondary\\\">RÉSERVÉ par {$m['auteur']}</span></h5>\";\n $message .= <<<FIN\n <div class=\"card card_form\">\n <div class=\"card-header\">\n Message de réservation de {$m['auteur']} :\n </div>\n <div class=\"card-body\">\n <blockquote class=\"blockquote mb-0\">\n <footer class=\"blockquote-footer\">{$m['message']}</footer>\n </blockquote>\n </div>\n </div>\n FIN;\n }\n }\n $tarif = \"<span class=\\\"badge badge-info\\\">{$i['tarif']}€</span>\";\n $url_supprimer = $this->container->router->pathFor(\"supprimerItem\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $html = <<<FIN\n <div class=\"box_item\">\n \n <div class=\"card flex-row\">\n <div class=\"card-header bg-transparent border-0\">\n <img src=\"$image\" onError=\"this.onerror=null;this.src='../../img/default.png';\" >\n </div>\n <div class=\"card-body info_item px-5\">\n <h4 class=\"card-title\">$isReserved</h4>\n <p class=\"card-text\">{$i['descr']}</p>\n <h2 class=\"card-text\">$tarif</h2>\n <br>\n <label for=\"url\" >Ou trouver mon article ?</label>\n <div class=\"input-group mb-3\">\n <div class=\"input-group-prepend\"> \n <span class=\"input-group-text\">URL</span>\n </div>\n <input readonly type=\"text\" class=\"form-control\" aria-label=\"url\" value=\"{$url}\" id=\"myInput\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyClipboard()\">Copier</button>\n </div>\n </div>\n $modification\n $cagnotte\n $supprimerImage\n $supprimer\n \n <!-- Modal pour demander si on veut supprimer -->\n <div class=\"modal fade\" id=\"confirmationSupp_{$i['nom']}\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"confirmation\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"confirmation\">Etes-vous sûr de vouloir supprimer cet item ?</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body text-center\">\n {$i['nom']}\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Annuler</button>\n <a type=\"button\" href=\"$url_supprimer\" class=\"btn btn-danger\">Supprimer</a>\n </div>\n </div>\n </div>\n </div> \n </div>\n </div>\n </div>\n $message \n <br>\n FIN;\n\n return $html;\n }", "function __construct($id, $label, $price, $nbSame, $listProvConcern){\n \n parent::__construct($id, $label, $price);\n $this->nbSame = $nbSame;\n // $this->provInfo = $this->getProvInfo();\n // $this->totalPrice = $this->getTotalPrice();\n \n \n }", "public function actionCreateItem()\r\n {\r\n $catalogItem = new CatalogItem(['scenario' => 'create']);\r\n\r\n if($catalogItem->load(Yii::$app->request->post()) && $catalogItem->save())\r\n {\r\n $this->redirect(['/admin/catalog/index', 'id' => $catalogItem->id]);\r\n }\r\n\r\n $catalog = new Catalog();\r\n\r\n return $this->render(\r\n 'create',\r\n [\r\n 'catalog' => $catalog,\r\n 'catalogItem' => $catalogItem,\r\n ]\r\n );\r\n }", "function buscar_recomendado_hotel($precio, $nombre, $id, $cat){\n\t\t$precio_inicial=$precio-50;\n\t\t$precio_final=$precio+50;\n\t\t$marcas=explode(\" \",$nombre);\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND id_pro!='$id' AND disponible_pro='1' AND categoria_pro!='10' AND nombre_image='portada' GROUP BY id_pro ORDER BY RAND()\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function __construct($htCatNum,$htDescrip,$nQty,$nPrice,$nShItem,$nShPkg) {\n\t$this->htCatNum = $htCatNum;\n\t$this->htDescrip = $htDescrip;\n\t$this->nQty = $nQty;\n\t$this->nPrice = $nPrice;\n\t$this->nShItem = $nShItem;\n\t$this->nShPkg = $nShPkg;\n }", "public function __construct($id=0,$nom='',$description='',$type=0) {\n\t\t//Generated by ObjectGenerator::generateConstruct()\n\t\t$this->_id = $id;\n\t\t$this->_nom = $nom;\n\t\t$this->_description = $description;\n\t\t$this->_type = $type;\n\n\t/*\n\t * Entre ces deux balises vous pourrez mettre votre code specifique a la classe.\n\t * Il sera preserve lors de la reconstruction automatique.\n\t */\n\t/*[TAG-__construct1]*/\t/*[/TAG-__construct1]*/\n\n\n\t}", "function catalog_db2xml($lang_id=\"default\")\n{\n\t# Start catalog\n\t$string_data = <<<EOF\n<?xml version=\"1.0\"?>\n<catalog lang=\"$lang_id\" descr=''>\n\t<entity id=\"section\" descr=\"Lab Section\">\nEOF;\n\t$handle = fopen(\"../../langdata/\".$lang_id.\"_catalog.xml\", \"w\");\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM test_category\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['test_category_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add test types\n\t$string_data = <<<EOF\n\n\t<entity id=\"test\" descr=\"Test Type\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM test_type WHERE disabled=0\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['test_type_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add measures\n\t$string_data = <<<EOF\n\n\t<entity id=\"measure\" descr=\"Measures\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM measure\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['measure_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add specimen types\n\t$string_data = <<<EOF\n\n\t<entity id=\"specimen\" descr=\"Specimen Types\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM specimen_type WHERE disabled=0\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['specimen_type_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# End catalog\n\t$string_data = <<<EOF\n\n</catalog>\nEOF;\n\tfwrite($handle, $string_data);\n\tfclose($handle);\n}", "private function inicializa_propiedades(): array\n {\n $identificador = \"cat_sat_tipo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Tipo\");\n $pr = $this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_division_producto_id\";\n $propiedades = array(\"label\" => \"SAT - División\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n\n $identificador = \"cat_sat_grupo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Grupo\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_clase_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Clase\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Producto\", \"con_registros\" => false, \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_unidad_id\";\n $propiedades = array(\"label\" => \"SAT - Unidad\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_obj_imp_id\";\n $propiedades = array(\"label\" => \"Objeto del Impuesto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"com_tipo_producto_id\";\n $propiedades = array(\"label\" => \"Tipo Producto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_conf_imps_id\";\n $propiedades = array(\"label\" => \"Conf Impuestos\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"codigo\";\n $propiedades = array(\"place_holder\" => \"Código\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"descripcion\";\n $propiedades = array(\"place_holder\" => \"Producto\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"precio\";\n $propiedades = array(\"place_holder\" => \"Precio\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n return $this->keys_selects;\n }", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\n }", "function __construct($nombre,$id_categoria,$id){\n $this->nombre= $nombre;\n $this->id_categoria=$id_categoria;\n $this->id=$id;\n }", "function formulaires_editer_composition_objet_charger($type,$id){\n\t$valeurs = array();\n\t$table_objet_sql = table_objet_sql($type);\n\t$id_table_objet = id_table_objet($type);\n\t$valeurs[$id_table_objet] = intval($id);\n\n\t$row = sql_fetsel('composition,composition_lock',$table_objet_sql,\"$id_table_objet=\".intval($id));\n\tif (!autoriser('styliser',$type,$id,NULL,array('row'=>$row))){\n\t\t$valeurs['editable'] = false;\n\t}\n\telse {\n\n\t\tif ($type=='rubrique'){\n\t\t\t$config_accueil = true;\n\t\t\tif (isset($GLOBALS['meta']['compositions'])){\n\t\t\t\t$config = unserialize($GLOBALS['meta']['compositions']);\n\t\t\t\t$config_accueil = $config['utiliser_article_accueil'] != 'non';\n\t\t\t}\n\t\t\tif ($config_accueil){\n\t\t\t\t$valeurs['id_article_accueil'] = sql_getfetsel('id_article_accueil',$table_objet_sql,\"$id_table_objet=\".intval($id));\n\t\t\t\t$valeurs['id_article_accueil'] = $valeurs['id_article_accueil'] ? $valeurs['id_article_accueil'] : '0';\n\t\t\t}\n\t\t}\n\t\t$valeurs['composition'] = $row['composition'];\n\t\t$valeurs['composition_lock'] = $row['composition_lock'];\n\n\t\t$valeurs['compositions'] = compositions_lister_disponibles($type);\n\t\t$valeurs['compositions'] = reset($valeurs['compositions']); // on ne regarde qu'un seul type\n\t\tif (is_array($valeurs['compositions']) AND !isset($valeurs['compositions'][''])){\n\t\t\t$valeurs['compositions'] = array_merge(\n\t\t\t\tarray(''=>array('nom'=>_T('compositions:label_pas_de_composition'),'description'=>'','icon'=>'','configuration'=>'')),\n\t\t\t\t$valeurs['compositions']\n\t\t\t);\n\t\t}\n\t\t$valeurs['_hidden'] = \"<input type='hidden' name='$id_table_objet' value='$id' />\";\n\n\t\tif (!is_array($valeurs['compositions']) AND !isset($valeurs['id_article_accueil']))\n\t\t\t$valeurs['editable'] = false;\n\t}\n\n\treturn $valeurs;\n}", "public function tampilan_pertanyaan_new()\n\t{\n\t\t$contenku = '';\n\t\t$cek = array(\"Gejala\", \"Riwayat\");\n\t\tforeach ($cek as $cek_status) {\n\t\t\tif($cek_status == \"Gejala\"){\n\t\t\t\t$contenku .= '<h2>'.$cek_status.'</h2>';\n\t\t\t\t\n\t\t\t\t$pertanyaan = $this->get_pertanyaan();\n\t\t\t\tforeach ($pertanyaan as $pertanyaan ) {\t\t\n\t\t\t\t\tif($pertanyaan['STATUS'] == 'A'){\n\t\t\t\t\t\tif($pertanyaan['SUBGROUP'] == 'GEJALA'){\n\t\t\t\t\t\t\t$contenku .= '<div class=\"card card-warning card-outline\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-header '.$pertanyaan['IDSOAL'].' validate-card\" style=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label>'.$pertanyaan['SOAL'].'</label>';\n\t\t\t\t\t\t\t$pertanyaan_detail = $this->get_pertanyaan_detail($pertanyaan['IDSOAL']);\n\t\t\t\t\t\t\tforeach ($pertanyaan_detail as $pertanyaan_detail) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t$contenku .=\t\t\t'<div class=\"col-sm-10\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-check\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-check-input validate\" type=\"radio\" name=\"'.$pertanyaan_detail['IDSOAL'].'-radio\" id=\"'.$pertanyaan_detail['IDSOALDTL'].'\" value=\"'.$pertanyaan_detail['DESCR'].'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class=\"form-check-label\" for=\"gridRadios1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'.$pertanyaan_detail['DESCR'].'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$contenku .= \t\t\t'</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$contenku .= '<h2>'.$cek_status.'</h2>';\n\t\t\t\t$pertanyaan = $this->get_pertanyaan();\n\t\t\t\tforeach ($pertanyaan as $pertanyaan ) {\t\t\n\t\t\t\t\tif($pertanyaan['STATUS'] == 'A'){\n\t\t\t\t\t\tif($pertanyaan['SUBGROUP'] == 'RIWAYAT'){\n\t\t\t\t\t\t\t$contenku .= '<div class=\"card card-danger card-outline\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-header '.$pertanyaan['IDSOAL'].' validate-card\" style=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label>'.$pertanyaan['SOAL'].'</label>';\n\t\t\t\t\t\t\t$pertanyaan_detail = $this->get_pertanyaan_detail($pertanyaan['IDSOAL']);\n\t\t\t\t\t\t\tforeach ($pertanyaan_detail as $pertanyaan_detail) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t$contenku .=\t\t\t'<div class=\"col-sm-10\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-check\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-check-input validate\" type=\"radio\" name=\"'.$pertanyaan_detail['IDSOAL'].'-radio\" id=\"'.$pertanyaan_detail['IDSOALDTL'].'\" value=\"'.$pertanyaan_detail['DESCR'].'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class=\"form-check-label\" for=\"gridRadios1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'.$pertanyaan_detail['DESCR'].'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$contenku .= \t\t\t'</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $contenku;\n\t}", "public function create()\n {\n $loaigiay = loaigiay::join('theloai' , 'theloai.id_theloai', '=' ,'loaigiay.id_theloai' )->select('loaigiay.*' , 'theloai.name as theloainame')->get();\n return view('admin.add_product' , ['loaigiays' => $loaigiay]);\n }", "public function create()\n {\n $categories = Category::select(['id', 'volume', 'name'])->get();\n $newCategory = [];\n foreach ($categories as $category) {\n $newCategory[$category->id] = $category;\n }\n\n $products = Goods::withTrashed()->orderBy('category_id')->get();\n\n $data = [];\n\n foreach ($products as $product) {\n $data[$product->category_id]['volume'] = $newCategory[$product->category_id]['volume'];\n $data[$product->category_id]['items'][] = $product;\n }\n\n // 2级品类分组 id\n /*$categoryOne = [20, 21, 22, 23, 24, 25];\n $categoryTwo = [26, 27, 28, 29];\n $categoryThree = [30, 31, 32, 33];\n $categoryMilk = [7, 8, 9, 16, 17]; // 排斥柑橘类*/\n//print_r($data);exit;\n return view('clerk.orders.create', compact(['products', 'data']));\n }", "public function create()\n\t{\n\t\t$tc = TipoComunicacion::all();//tc = tipo comunicaciones\n\t\t$this->layout->titulo = 'Crear Comunicaciones';\n $this->layout->nest(\n 'content',\n 'comunicaciones.create',\n array(\n \t'tipoComunicaciones' => $tc \n )\n );\n\t}", "public function create()\n {\n $compkge=Common_pack::all();\n $com_cat=Common_cat::all();\n return view ('commonpack::commonpackage.create',compact('compkge','com_cat'));\n }", "public function create()\n {\n $rs = Category::select(DB::raw('*,CONCAT(path,tid) as paths'))->\n orderBy('paths')->\n get();\n\n foreach ($rs as $k => $v) {\n $ps = substr_count($v->path, ',')-1;\n\n $v->tname = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$ps).'|--'.$v->tname;\n }\n\n return view('admin.goods.add',[\n 'title'=>'商品的添加页面',\n 'rs'=>$rs\n ]);\n }", "function __construct() {\n\n /**\n * Definicion de tipos de campos\n */\n $this->assignType(\"id\", \"ID\", BaseView::HIDDEN);\n $this->assignType(\"name\", JText::_(\"COM_CTC_NAME\"), BaseView::STRING);\n $this->assignType(\"description\", JText::_(\"COM_CTC_DESCRIPTION\"), BaseView::BIG_STRING);\n $this->assignType(\"package\", \"Paquete\", BaseView::STRING);\n $this->assignType(\"version\", \"Versión\", BaseView::STRING);\n $this->assignType(\"username\", JText::_(\"COM_CTC_USER\"), BaseView::STRING);\n $this->assignType(\"password\", JText::_(\"COM_CTC_PASSWORD\"), BaseView::PASSWORD);\n $this->assignType(\"process\", \"Proceso\", BaseView::PICKLIST, array(\n \"ATTENDANCE\" => \"Asignación de Turno (ATTENDANCE)\",\n \"PAYROLL\" => \"Clasificación de Horas (PAYROLL)\",\n \"AFTERPAYROLL\" => \"Post Clasificación (AFTERPAYROLL)\",\n \"HOURPERIOD\" => \"Clasificación del Período (HOURPERIOD)\",\n ));\n\n $this->assignType(\"enterprises\", \"Empresas\", BaseView::ENTITIES, array(\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_CLASS => \"Enterprise\",\n BaseView::ENT_FILTER => null));\n /**\n * Definicion de vistas y sus acciones\n */\n $this->addViewEx(\"form\", array());\n $this->addAction(\"form\", \"rule_form_submit\", JText::_(\"COM_CTC_SAVE\"), \"save.png\");\n $this->addAction(\"form\", \"rule_form_cancel\", JText::_(\"COM_CTC_CANCEL\"), \"remove.png\");\n\n //TODO agregar rule_status_id\n $this->addView(\"table\", array(\"name\",\n \"package\", \"version\", \"username\", \"process\"));\n $this->addAction(\"table\", \"rule_table_edit\", JText::_(\"COM_CTC_EDIT\"), \"edit.png\");\n //$this->addAction(\"table\", \"rule_table_remove\", JText::_(\"COM_CTC_DELETE\"), \"delete.png\");\n\n $this->addView(\"dialog\", array());\n $this->addAction(\"dialog\", \"rule_dialog_ok\", JText::_(\"COM_CTC_OK\"), \"accept.png\");\n $this->addAction(\"dialog\", \"rule_dialog_cancel\", JText::_(\"COM_CTC_CANCEL\"), \"remove.png\");\n\n $this->addView(\"aud\", array(\n \"name\",\n \"package\", \"version\", \"process\"));\n }", "public function crear($nombre)\n {\n foreach ($this->tablas as $tabla => $molde_dt) {\n $this->asistente->generar_datos_tabla($this->tablas[$tabla], $tabla, $this->definiciones[$tabla]);\n }\n\n //Creo las lineas correspondientes en el datos relacion del molde.\n $datos = array('nombre' => $nombre . ' - DR ');\n $this->datos->tabla('base')->set($datos);\n $predeterminados = array(\n 'ap' => 2,\n 'sinc_lock_optimista' => 1,\n 'sinc_orden_automatico' => 1\n );\n $this->datos->tabla('prop_basicas')->set($predeterminados);\n }", "public function verCategoria(){\n\t\t\t$array[] = array(\"id\"=>\"A00-B99\",\"name\"=>\"Ciertas enfermedades infecciosas y parasitarias\");\n\t\t\t$array[] = array(\"id\"=>\"C00-D48\",\"name\"=>\"Neoplasias\");\n\t\t\t$array[] = array(\"id\"=>\"D50-D89\",\"name\"=>\"Enfermedades de la sangre y de los órganos hematopoyéticos y otros trastornos que afectan el mecanismo de la inmunidad\");\n\t\t\t$array[] = array(\"id\"=>\"E00-E90\",\"name\"=>\"Enfermedades endocrinas, nutricionales y metabólicas\");\n\t\t\t$array[] = array(\"id\"=>\"F00-F99\",\"name\"=>\"Trastornos mentales y del comportamiento\");\n\t\t\t$array[] = array(\"id\"=>\"G00-G99\",\"name\"=>\"Enfermedades del sistema nervioso\");\n\t\t\t$array[] = array(\"id\"=>\"H00-H59\",\"name\"=>\"Enfermedades del ojo y sus anexos\");\n\t\t\t$array[] = array(\"id\"=>\"H60-H95\",\"name\"=>\"Enfermedades del oído y de la apófisis mastoides\");\n\t\t\t$array[] = array(\"id\"=>\"I00-I99\",\"name\"=>\"Enfermedades del sistema circulatorio\");\n\t\t\treturn $array;\n\t\t\t/*\n\t\t\t$array=array(\n\t\t\t\t'CATEGORIA_ID'=>$categoria_id\n\t\t\t\t);\n\n\t\t\t$consult= oci_parse($conn,\"BEGIN Ips$_sndCitas.Ver_subcie10 END \");\n\t\t\t// $consult= oci_parse($conn,\"SELECT * FROM SUBCATEGORIA_CIE10\");\n\t\t\toci_execute($consult);\n\t\t\t*/\n\t\t}", "function createCourse ($id, $name, $description) {\n\t\t\t\n\t\t}", "public function definition()\n {\n $users = DB::table('users')->select('id')->get();\n $catalog = DB::table('catalog')->select('id')->get();\n\n return [\n 'status' => rand(0, 1), // rand(1, $maxCategoryId)\n 'name' => $this->faker->sentence(rand(3, 5)),\n 'image' => 'https://imgholder.ru/600x300/8493a8/adb9ca&text=IMAGE+HOLDER&font=kelson',\n 'catalog_id' => ($catalog[Rand(0,count($catalog)-1)])->id,\n 'author_id' => ($users[Rand(0,count($users)-1)])->id,\n 'description' => $this->faker->text(rand(100, 200))\n ];\n }", "public function create()\n {\n $pagos = Pago::all()->pluck('name', 'id');\n $items = Item::select(DB::Raw('concat(upc_ean_isbn,\" - \",item_name) as name'), 'id')\n ->wildcard()\n ->lists('name', 'id');\n\n // dd($items);\n return view('prices.create')\n ->with('pagos', $pagos)\n ->with('items', $items);\n // ->with('category',$category);\n }", "public function crear()\n {\n $json = file_get_contents('php://input');\n //convierto en un array asociativo de php\n $obj = json_decode($json);\n\n $listaArticulos = [];\n foreach ($obj as $key => $value) {\n $indice = $key;\n $valor = $value;\n $articulo = new Articulo();\n $articulo->id = $valor->id;\n $articulo->nombre = $valor->nombre;\n $listaArticulos[] = $articulo;\n //array_push($listaArticulos, $articulo);\n //$items[] = $item;\n }\n $modeloCargado = $this->model;\n //$articulo->id = $obj->id;\n //$articulo->nombre = $obj->nombre;\n //$articulos = $this->model->get();\n //$this->view->articulos = json_encode($articulos);\n //$listaObjetos = json_encode($listaArticulos);\n\n $respuesta = [\n \"datos\" => $listaArticulos,\n \"totalResultados\" => count($listaArticulos),\n ];\n $this->view->respuesta = json_encode($respuesta);\n\n $this->view->render('api260/articulos/crear');\n //var_dump($this);\n //var_dump($this->view);\n }", "public function ajoutProduitEncore()\n {\n Produit::create(\n [\n 'uuid' => Str::uuid(),\n 'designation' => 'Mangue',\n 'description' => 'Mangue bien grosse et sucrée! Yaa Proprè !',\n 'prix' => 1500,\n 'like' => 63,\n 'pays_source' => 'Togo',\n 'poids' => 89.5,\n ]\n );\n }" ]
[ "0.74085134", "0.689524", "0.6711217", "0.62744534", "0.6160358", "0.5952195", "0.58899945", "0.5806396", "0.5796995", "0.57410246", "0.5710859", "0.5672943", "0.5601688", "0.5583919", "0.55301535", "0.55263233", "0.54898703", "0.5486411", "0.5461777", "0.54476166", "0.5421867", "0.54165155", "0.5406588", "0.5391986", "0.53726757", "0.53716254", "0.5369639", "0.5357329", "0.5341829", "0.53410083", "0.5334232", "0.53330576", "0.52928257", "0.528707", "0.52865964", "0.52730024", "0.52718544", "0.5270486", "0.5270274", "0.5269261", "0.52563983", "0.52452326", "0.5232734", "0.52306926", "0.5225054", "0.52239454", "0.52212095", "0.52151626", "0.52095526", "0.5203567", "0.5203383", "0.5199645", "0.51990324", "0.51940536", "0.5186278", "0.518499", "0.5179166", "0.5175428", "0.5175348", "0.51734596", "0.51724815", "0.5172346", "0.51721656", "0.51663136", "0.5164873", "0.5164311", "0.516162", "0.5160281", "0.515975", "0.51590407", "0.5158855", "0.5155554", "0.51552254", "0.51507986", "0.5150293", "0.5149486", "0.5147887", "0.51460934", "0.5134262", "0.5131712", "0.5126376", "0.51263034", "0.5125404", "0.5122531", "0.5121547", "0.5116377", "0.5113336", "0.51131946", "0.51131433", "0.51074153", "0.51042783", "0.50998276", "0.509956", "0.5098447", "0.5096227", "0.5095774", "0.50914633", "0.50905746", "0.50905275", "0.50886714" ]
0.75418735
0
/ browse d'une table de base
/ просматривать базовую таблицу
function browseTable($ar){ $p = new XParam($ar, array('tplentry'=>'br')); $boid = $p->get('boid'); $tplentry = $p->get('tplentry'); $options = $p->get('options'); $x = XDataSource::objectFactory8($boid); $lar = array('options'=>$options, '_options'=>array('local'=>true), 'pagesize'=>9999, 'first'=>0, 'selectedfields'=>'all', 'tplentry'=>$tplentry); $x->browse($lar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "abstract public function getTable();", "abstract public function getTable();", "public function getTableBase();", "abstract protected function getTable();", "public function baseTable();", "public function index()\n {\n return parent::getTable($this->columns, $this->url, 'table', 'Data Penjualan');\n }", "public abstract function getDbTable();", "public static function getTable();", "static function loadDb($table) {\n $tab = new self($table);\n $cols = stdDB::selectArray(\"SHOW COLUMNS FROM `$table`\");\n foreach($cols as $col)\n $tab->cols[$col['Field']] = new schemaColumn($col['Field'],$col['Type'],\n $col['Null'], $col['Default'], $col['Extra']);\n $rows = stdDB::selectArray(\"SHOW INDEX FROM `$table`\");\n $idxrow = array(); $idxs = array();\n foreach($rows as $row){\n $idxrow[$row[\"Key_name\"]][] = $row[\"Column_name\"];\n $idxs[$row[\"Key_name\"]] = $row;\n }\n foreach($idxs as $k=>$row) {\n $tab->idx[$k] = new schemaIndex($k, $idxrow[$k],\n $row['Non_unique'], $row['Sub_part']);\n }\n return $tab;\n }", "public function getTable() {}", "public function getTable() {}", "public function getTable() {}", "public function fullDataBase()\n {\n print \"<table cellpadding='10' border=solid bordercolor=black>\";\n print\"<tr>\n <td>ROW</td> <td>EXCHANGE</td>\n <td>NAME</td> <td>IPO</td>\n <td>SYMBOL</td> <td>PRICE</td>\n <td>CAP</td> <td>UPDATED</td>\n <td>SECTOR</td> <td>INDUSTRY</td>\n </tr>\";\n $sql = \"SELECT * FROM companies ORDER BY ipodate DESC, cap DESC\";\n\n foreach ($this->conn->query($sql) as $row) {\n print \"<tr> <td nowrap>\";\n print $row['id'] . \"</td><td nowrap>\";\n print $row['stockexchange'] . \"</td><td nowrap>\";\n print $row['name'] . \"</td><td nowrap>\";\n print $row['ipodate'] . \"</td><td nowrap>\";\n print $row['symbol'] . \"</td><td nowrap>\";\n print $row['price'] . \"</td><td nowrap>\";\n print $row['cap'] . \"</td><td nowrap>\";\n print $row['created_at'] . \"</td><td nowrap>\";\n print $row['sector'] . \"</td><td nowrap>\";\n print $row['industry'] . \"</td></tr>\";\n }\n print \"</table>\";\n }", "public function getTableRaw();", "public function getTable()\r\n {\r\n }", "public function admin_get_tables() {}", "public function admin_get_tables() {}", "public function table($table);", "public function table($table);", "public function getTable()\n {\n\n }", "function tablaRuta($Nombre){\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::tablaRegistro($Nombre, $query);\r\n\t\r\n }", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "public function getTable(): Table;", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public function getTabla(){\n return $this->table;\n }", "public static function getTable() {}", "public function table_get_all($table);", "public function table()\n\t{\n\t\t$sql = '\n\t\t\tselect \n\t\t\t\tid, \n\t\t\t\tname, \n\t\t\t\tenable \n\t\t\tfrom \n\t\t\t\tfile \n\t\t\twhere \n\t\t\t\tuser = ?';\n\n\t\t$results = DB::select($sql, [Auth::id()]);\n\n\t\treturn Datatable::collection(new Collection($results))\n\t\t\t->showColumns('name')\n\t\t\t->addColumn('enable', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/edit&ID=\".$model->id.\"&EN=\".$model->enable).'\">'.$model->enable.'</a>';\n\t\t\t})\n\t\t\t->addColumn('remove', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/delete&ID=\".$model->id).'\"><i class=\"fa fa-times\"></i></a>';\n\t\t\t})\n ->searchColumns('name')\n ->orderColumns('enable', 'name')\n ->make();\n\t}", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "public function getTable() { return( $this->_table ); }", "public function getTableData()\n\t{\n\t}", "function getItemTableName() ;", "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "public static function table($table)\n {\n }", "protected function _readTable() {}", "protected function _readTable() {}", "public static function tableName()\n { return 'magistrado'; }", "function mostrar_tabla()\n {\n return $this->mostrar_tabla_slickgrid();\n /*\n $sPrefs = '';\n $id_usuario= core\\ConfigGlobal::mi_id_usuario();\n $tipo = 'tabla_presentacion';\n $oPref = new usuarios\\Preferencia(array('id_usuario'=>$id_usuario,'tipo'=>$tipo));\n $sPrefs=$oPref->getPreferencia();\n if ($sPrefs == 'html') {\n return $this->mostrar_tabla_html();\n } else {\n return $this->mostrar_tabla_slickgrid();\n }\n */\n }", "public function getTableInformation() {}", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "public function hack($tabel){\n\t\t$this->db->select('*');\n\t\t$this->db->from($tabel);\n\t\t$this->show($this->db->get()); // SELECT * FROM $tabel;\t\n\t}", "public function getCurrentTable() {}", "abstract public function tableName();", "abstract public function tableName();", "function allinea_db() {\r\n\t\t\r\n\t\t$in=$this->session_vars;\r\n\t\t$conn=$this->conn;\r\n\t\t$service=$this->service;\r\n\t\t$tb_exist = false;\r\n\t\t$str_synonym=\"select * from USER_SYNONYMS where synonym_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $str_synonym );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$sql->get_row();\r\n\t\tif($sql->row['TABLE_NAME']!='') $this->form ['TABLE']=$sql->row['TABLE_NAME'];\r\n\t\t$query = \"select column_name from user_col_comments where table_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $query );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$all_field_exist = true;\r\n\t\tforeach ( $this->fields as $key => $val ) {\r\n\t\t\tif (isset ( $val ['TYPE'] ) && $val ['TYPE'] != '')\r\n\t\t\t$field_type = \"field_{$val['TYPE']}\";\r\n\t\t\telse\r\n\t\t\t$field_type = \"field\";\r\n\t\t\t\r\n\t\t\tif ($this->config_service['field_lib'] != '' && file_exists ( $this->config_service['field_lib'] . $field_type . \".inc\" )) {\r\n\t\t\t\tinclude_once $this->config_service['field_lib'] . $field_type . \".inc\";\r\n\t\t\t} else\r\n\t\t\tinclude_once \"{$field_type}.inc\";\r\n\t\t\t$this->no_field_value_by_tb=true;\r\n\t\t\t$field_obj = new $field_type ( $this, $key, $this->conn, $this->tb_vals, $this->session_vars, $this->service, $this->errors);\r\n\t\t\t$this->no_field_value_by_tb=false;\r\n\t\t\t$allinea_stmt [$key] = $field_obj->allinea_db ();\r\n\t\t\tif ($field_obj->attributes ['PK'] == 'yes') {\r\n\t\t\t\t$sql_pk_fields .= \"{$field_obj->attributes['VAR']},\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sql_pk_fields = rtrim ( $sql_pk_fields, \",\" );\r\n\t\tif ($sql->numrows > 0) {\r\n\t\t\t$tb_exist = true;\r\n\t\t\t$i = 0;\r\n\t\t\twhile ( $sql->get_row () ) {\r\n\t\t\t\t$res [$i] = $sql->row ['COLUMN_NAME'];\r\n\t\t\t\t$i ++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($tb_exist) {\r\n\t\t\t$sql_pk = null;\r\n\t\t\t$c = 0;\r\n\t\t\t$all_field_exist = true;\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tif ($val != '') {\r\n\t\t\t\t\t$field_exist = false;\r\n\t\t\t\t\tforeach ( $val as $vk => $vval ) {\r\n\t\t\t\t\t\t$nome_campo = explode ( \" \", $vval );\r\n\t\t\t\t\t\t$field_exist [$key] [$vk] = false;\r\n\t\t\t\t\t\tforeach ( $res as $key_res => $val_res ) {\r\n\t\t\t\t\t\t\tif ($val_res == $nome_campo [0] || $nome_campo [0] == '') {\r\n\t\t\t\t\t\t\t\t$field_exist [$key] [$vk] = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforeach ( $field_exist as $key1 => $val1 ) {\r\n\t\t\t\t\t\tforeach ( $val1 as $vk => $boolval )\r\n\t\t\t\t\t\tif (! $boolval) {\r\n\t\t\t\t\t\t\t$all_field_exist = false;\r\n\t\t\t\t\t\t\t$index = (count ( $this->fields ) * $vk) + $key;\r\n//\t\t\t\t\t\t\t$eq_sql_str [$index] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$s_sql_str [$index] = \"alter table S_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$sql_str [$index] = \"alter table \" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$sql_pk_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint PK_\" . $this->form ['TABLE'] . \" cascade\";\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$sql_fk_coord_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint FK_\" . $this->form ['TABLE'] . \"_COORD cascade\";\r\n\t\t\tglobal $config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t} else {\r\n\t\t\t$this->body .= \"Table <b>\" . $this->form ['TABLE'] . \"</b> doesn't exist<br/>\";\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tforeach ( $val as $key_f => $val_f )\r\n\t\t\t\tif ($val_f != '')\r\n\t\t\t\t$sql_create_fields .= \"{$val_f},\";\r\n\t\t\t}\r\n\t\t\t$sql_create_fields = rtrim ( $sql_create_fields, \",\" );\r\n\t\t\t$sql_str_ini = \"create table \" . $this->form ['TABLE'] . '(';\r\n\t\t\t$sql_str_end = \")\";\r\n\t\t\t$sql_str [0] = $sql_str_ini . $sql_create_fields . $sql_str_end;\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$config_service=$this->config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n//\t\t\t$eq_sql_str [0] = \"create table EQ_\" . $this->form ['TABLE'] . \" (ID NUMBER, COMMENTO varchar2(400),\" . $sql_create_fields . $sql_str_end;\r\n//\t\t\t$eq_sql_str [1] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add constraint EQ_PK_\" . $this->form ['TABLE'] . \" primary key (ID)\";\r\n\r\n\t\t\t$s_sql_str [0] = \"create table S_\" . $this->form ['TABLE'] . \"(USERID VARCHAR2(20),MODDT DATE,MODPROG NUMBER not null,FL_QUERY CHAR(1) not null,ID_QUERY NUMBER,\" . $sql_create_fields . $sql_str_end;\r\n\t\t\t$s_sql_str [1] = \"alter table S_\" . $this->form ['TABLE'] . \" add constraint S_PK_\" . $this->form ['TABLE'] . \" primary key (MODPROG)\";\r\n\r\n\t\t}\r\n\t\tif (isset ( $in ['CREATE'] ) || isset ( $in ['CREATE_' . $this->form ['TABLE']] )) {\r\n\t\t\tforeach ( $sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $eq_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $s_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tif ($sql_pk_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_pk_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_pk); // bind non necessario\r\n\t\t\tif ($sql_fk_coord_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_fk_coord_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_fk_coord); // bind non necessario\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\treturn ($tb_exist && $all_field_exist);\r\n\t}", "public function ListTable()\n {\n echo $this->ListTableText();\n }", "function nav_sqltabele() {\n\n\tglobal $db;\n\n\techo \"Lista svih tabela: \";\n\t\n $komanda = 'SHOW tables';\n\t$result = mysql_query($komanda, $db);\n\t$br_redova = mysql_num_rows($result);\n\t\n\tfor ($i = 0; $i < $br_redova; $i++) {\n\n\t\t\techo \"<a href='?tab=\" . mysql_tablename($result, $i) . \"'>\" . mysql_tablename($result, $i) . \"</a>\";\n\t\t\techo \" | \";\t\t\t\n\n\t}\n\n\t\n\n}", "public function showTable() {\n\t\t$tableName = $this->request->getVariable('id');\n\t\t$this->smarty->assign('dbTableObject',new $tableName());\n\t\t$this->pageDisplay('tools');\n\t}", "abstract function tableName();", "public function tableWizard() {}", "public function getTableNames();", "public function listForTable (){\r\n //generamo la query final que precisamos\r\n $queryResult= \"SELECT id,dni,nombre,apellido,mail FROM usuario.usuario ORDER BY id;\";\r\n\r\n //Ejecutamos la query\r\n $this->stmt=pg_query($this->link,$queryResult) or die(\"Error en la consulta,function listForTable :\".preg_last_error());\r\n\r\n return $this->stmt;\r\n }", "abstract protected function fetchTableDefDb(string $table);", "protected function tableModel()\n {\n }", "function showTable(&$database)\n{\n $columns = $database->query(\"SHOW TABLES\")->fetchAll();\n\n foreach ($columns as $col) {\n echo '<a href=\"./table.php?name=' . $col[0] . '\" >';\n echo \"$col[0] </a> <br/>\";\n }\n\n\n}", "public function getTableDescription();", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "public function getTableName() ;", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "function browse($ar){\n $r = array('tables'=>array(\narray('label'=>$this->dstapool->getLabel(), 'name'=>$this->dstapool->getTable(), 'boid'=>$this->dstapool->getBoid()),\narray('label'=>$this->dstaticket->getLabel(), 'name'=>$this->dstaticket->getTable(), 'boid'=>$this->dstaticket->getBoid()),\n array('label'=>$this->dstaperson->getLabel(), 'name'=>$this->dstaperson->getTable(), 'boid'=>$this->dstaperson->getBoid())),\n \n 'ta'=>array('WTPSI_WSDL'=>$GLOBALS['TA_WTPSI_WSDL'])\n );\n XShell::toScreen1('br', $r);\n }", "public function view($table)\n {\n return $this->db->get($table);\n }", "abstract public function openTableHead();", "function listPage_tableField(){\n $this->data_view['tableField'] = array(\n array('name'=>'id','title'=>'Mã'),\n array('name'=>'image','title'=>'Hình','type'=>'image','linkDetail'=>true),\n array('name'=>'title','title'=>'Tên','linkDetail'=>true),\n array('name'=>'c_title','title'=>'Loại'),\n array('name'=>'price','title'=>'Giá','type'=>'number'),\n array('name'=>'price_promotion','title'=>'Giá giảm','type'=>'number','hidden'=>true),\n array('name'=>'views','title'=>'Lượt xem','type'=>'number'),\n array('name'=>'is_active','title'=>'Trạng thái','type'=>'status'),\n array('name'=>'is_stock','title'=>'Còn hàng','type'=>'status','hidden'=>true),\n array('name'=>'is_special','title'=>'Nổi bật','type'=>'status','hidden'=>true)\n );\n }", "public function getTable() { return $this->table->getTable(); }", "public function show_table_sturcture()\n\t{\n\t\t$str_input_html = \"\";\n\t\t$table = \"default_module_test\";\n\t\t$table = $this->db->escape_str($table);\n\t\t//$sql = \"DESCRIBE `$table`\";\n\t\t//$desc = $this->db->where('Field','sorts')->query($sql)->row();\n\t\t$desc = Easy_Database_Manage::get_table_desc($table);\n\t\techo \"<pre>\";\n\t\techo print_r($desc);\n\t\techo \"</pre>\";\n\t\n\t}", "public function selectTable($table)\n {\n $select_query = \"SELECT * FROM {$table}\"; \n\n if ($this->conexao == null) {\n $this->abrir();\n }\n\n $prepare = $this->conexao->prepare($select_query);\n\n $prepare->execute();\n\n $linha = $prepare->fetchAll(\\PDO::FETCH_OBJ);\n\n return $linha;\n }", "public static function tableName()\n {\n return '{{carandexterior}}';\n }", "public static function getTablename() { return \"Productos_01\"; }", "public function vistaXTablaModel($table){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $table\"); //preparacion de la consulta SQL \n\t\t$stmt->execute(); //ejecucion de la consulta\n\t\treturn $stmt->fetchAll(); //se retorna en un array asociativo el resultado de la consulta\n\t\t$stmt->close();\n\n\t}", "public function getTableOfContents();", "abstract public static function getTableName();", "abstract public static function getTableName();", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "public function from($table);", "function getAllTablesBar(){\n\n return $this->db->table('mesas')\n ->select('numero_Mesa, forma, personas, alto, ancho')\n ->where('id_puntos = 1')\n ->get()\n ->getResult();\n }", "function select_db($base_datos) {\r\n\t\t//\"implementado en la clase <i>\" . get_class($this) . \"</i></h1>\";\r\n\t\treturn FALSE;\r\n\t}", "private function tbl_guiones() {\r\n\t\t\t$this->guiones = $this->esquema->createTable('GUIONES');\r\n\t\t\t$this->guiones->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la plantilla del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('PLANTILLA', 'text', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => false,\r\n\t\t\t\t'comment' => 'plantilla del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function getTableName() {}", "public function getTableName() {}", "public function dataTable();" ]
[ "0.69066596", "0.69066596", "0.69066596", "0.69066596", "0.69066596", "0.69066596", "0.69066596", "0.68663263", "0.6788869", "0.6788869", "0.6784087", "0.67251194", "0.6706494", "0.6637506", "0.6529571", "0.652892", "0.64077574", "0.63447714", "0.6343819", "0.63433725", "0.63203216", "0.6298187", "0.62713903", "0.6199823", "0.61987853", "0.6179875", "0.6179875", "0.6155111", "0.6151348", "0.6147333", "0.6143268", "0.612487", "0.61221147", "0.61221147", "0.61221147", "0.61221147", "0.61221147", "0.61221147", "0.61203533", "0.6119289", "0.6073366", "0.6072775", "0.6063312", "0.6050147", "0.6043008", "0.60275704", "0.6019902", "0.6004251", "0.5999774", "0.5999259", "0.59680045", "0.5959682", "0.59560907", "0.5955686", "0.5955686", "0.5950042", "0.594925", "0.5930637", "0.5926842", "0.5926842", "0.5918996", "0.5918968", "0.59163797", "0.5914156", "0.5912936", "0.59042335", "0.5903696", "0.5900536", "0.5894575", "0.5892381", "0.5891115", "0.5881829", "0.58747965", "0.58747965", "0.58747965", "0.5874236", "0.5861671", "0.58548975", "0.5844907", "0.5843595", "0.5839079", "0.58325565", "0.5831813", "0.5830981", "0.5826942", "0.58238673", "0.58229417", "0.5817434", "0.58131474", "0.58015263", "0.58015263", "0.5784175", "0.5784067", "0.5781367", "0.5778073", "0.5776457", "0.5771346", "0.5766194", "0.5766194", "0.5756706" ]
0.7221671
0
/ charger les types de personnes
/ загрузка типов людей
private function loadPersonTypes($clearbefore=0){ if ($clearbefore){ updateQuery('truncate '.$this->tapersontype); } $wtpsi = $this->getAWTPSI(); $rs = $wtpsi->doGetPersonTypes(array()); foreach($rs as $i=>$o){ if ($o->NERRORNO != 0){ XLogs::critical(get_class($this)." erreur lecture des types de personnes : ${$o->SZERRORMESSAGE}"); continue; } $newoid = sprintf($this->tapersontype.':%06d', $o->NPERSONTYPENO); // recherche du type de personne via person type no $rs1 = selectQuery($this->dstaperson->select_query(array('cond'=>array('ptno'=>array('=', $o->NPERSONTYPENO))))); if ($rs1 && $rs1->RowCount() > 0){ // on a deja } else { // ajout $this->dstaperson->procInput(array('_options'=>array('local'=>true), 'ptno'=>addslashes($o->NPERSONTYPENO), 'oid'=>$newoid, 'newoid'=>$newoid, 'talabel'=>addslashes($o->SZPERSONTYPE) ) ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function erp_get_people_types() {\n return apply_filters( 'erp_people_types', [] );\n}", "protected function getTypes() {}", "public function get_types()\n {\n }", "public function get_desired_types();", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public function iN_CreatorTypes() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_creators WHERE creator_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function get_personnel_types()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('personnel_type_name', 'ASC');\n\t\t$query = $this->db->get('personnel_type');\n\t\t\n\t\treturn $query;\n\t}", "public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"courses.name\",\n \"course_start_date\" => \"users_to_courses.from_timestamp\",\n \"course_user_type\" => \"users_to_courses.user_type\",\n \"course_completed\" => \"users_to_courses.completed\",\n \"course_comments\" => \"users_to_courses.comments\",\n \"course_score\" => \"users_to_courses.score\",\n \"course_active\" => \"users_to_courses.active\",\n \"course_end_date\" => \"users_to_courses.to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }", "public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"course_name\",\n \"course_start_date\" => \"from_timestamp\",\n \"course_user_type\" => \"user_type\",\n \"course_completed\" => \"completed\",\n \"course_comments\" => \"comments\",\n \"course_score\" => \"score\",\n \"course_active\" => \"active\",\n \"course_end_date\" => \"to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }", "public function list_of($type)\n {\n }", "public static function getTypes();", "function get_field_types()\n {\n }", "public static function getUserTypeDescription()\n {\n $className = get_called_class();\n return array(\n 'PROPERTY_TYPE' => 'S',\n 'USER_TYPE' => self::USER_TYPE,\n 'DESCRIPTION' => 'Покупаемость',\n 'GetPublicEditHTML' => array($className, 'getPublicEditHTML'),\n 'GetPublicViewHTML' => array($className, 'getPublicViewHTML'),\n 'GetPropertyFieldHtml' => array($className, 'getPropertyFieldHtml'),\n 'GetAdminListViewHTML' => array($className, 'getAdminListViewHTML'),\n 'CheckFields' => array($className, 'checkFields'),\n 'GetLength' => array($className, 'getLength'),\n 'ConvertToDB' => array($className, 'convertToDB'),\n 'ConvertFromDB' => array($className, 'convertFromDB'),\n 'AddFilterFields' => array($className, 'addFilterFields'),\n );\n }", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public function getTypeUsers(){\n $query = \"SELECT * FROM rol\";\n return $this->consulta($query);\n }", "public function getUserTypes()\n {\n $main_actions = [\n 'type' => \\adminer\\lang('Create type'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n // From db.inc.php\n $userTypes = \\adminer\\support(\"type\") ? \\adminer\\types() : [];\n $details = [];\n foreach($userTypes as $userType)\n {\n $details[] = [\n 'name' => \\adminer\\h($userType),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "private function loadTypes() {\n \n if(!empty($this->types)) return;\n \n $this->types = $this->doctrine\n ->getManager()\n ->getRepository('FenchyNoticeBundle:Type')\n ->getFilterTypes();\n }", "public static function getCandidates($type);", "function getType() ;", "function getType() ;", "function getType() ;", "function getUserTypes() {\n return array(self::HOME => self::HOME,\n self::CLINIC => self::CLINIC);\n }", "private function get_posted_person_types( $product ) {\n $post_data = wp_unslash( $_POST ); // phpcs:ignore\n $person_types = array();\n\n if ( isset( $post_data['person_id'] ) && isset( $post_data['_wc_booking_has_persons'] ) ) {\n $person_ids = $post_data['person_id'];\n $person_menu_order = $post_data['person_menu_order'];\n $person_name = $post_data['person_name'];\n $person_cost = $post_data['person_cost'];\n $person_block_cost = $post_data['person_block_cost'];\n $person_description = $post_data['person_description'];\n $person_min = $post_data['person_min'];\n $person_max = $post_data['person_max'];\n $max_loop = max( array_keys( $post_data['person_id'] ) );\n\n for ( $i = 0; $i <= $max_loop; $i ++ ) {\n if ( ! isset( $person_ids[ $i ] ) ) {\n continue;\n\t\t\t\t}\n $person_id = absint( $person_ids[ $i ] );\n $person_type = new \\WC_Product_Booking_Person_Type( $person_id );\n $person_type->set_props(\n array(\n 'name' => wc_clean( stripslashes( $person_name[ $i ] ) ),\n 'description' => wc_clean( stripslashes( $person_description[ $i ] ) ),\n 'sort_order' => absint( $person_menu_order[ $i ] ),\n 'cost' => wc_clean( $person_cost[ $i ] ),\n 'block_cost' => wc_clean( $person_block_cost[ $i ] ),\n 'min' => wc_clean( $person_min[ $i ] ),\n 'max' => wc_clean( $person_max[ $i ] ),\n 'parent_id' => $product->get_id(),\n )\n );\n $person_types[] = $person_type;\n }\n }\n return $person_types;\n }", "public function getTypes(): array;", "public function getTypes(): array;", "function get_all_usertype()\n\t\t{\n\t\t\t$query=\"SELECT * from tbl_user_type\";\n\t\t\t$result = execute_query($query);\n\t\t\treturn new readonlyresultset($result);\n\t\t}", "public function people() {\n\t\tregister_post_type(\n\t\t\t'people',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'People' ),\n\t\t\t\t\t'singular_name' => __( 'Person' ),\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'custom-fields' ),\n\t\t\t\t'taxonomies' => array( 'category' ),\n\t\t\t\t'menu_icon' => 'dashicons-media-text',\n\t\t\t)\n\t\t);\n\t}", "function getAllByType($tipo) {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente where tipo = :tipo\");\n $stmt->bindParam(':tipo', $tipo);\n\t $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[18]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }", "function getTypeslist ()\r\n\t{\r\n\t\t$query = 'SELECT id, name'\r\n\t\t\t\t. ' FROM #__flexicontent_types'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY name ASC'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$types = $this->_db->loadObjectList();\r\n\t\treturn $types;\r\n\t}", "public function loadUserTypes(){\n\t\t\t$stmt = $this->db->executequery('select id_type_user, type_user, date_modification_type_user, description_type_user from type_user order by type_user asc');\n\t\t\tif (!$userTypes = $stmt->fetchall()) return array(); \n\t\t\tfor ($i = 0; $i < count($userTypes); $i++) {\n\t\t\t\t$userTypes[$i] = new UserType($userTypes[$i]['id_type_user'], $userTypes[$i]['type_user'], $userTypes[$i]['description_type_user'], $userTypes[$i]['date_modification_type_user']);\n\t\t\t}\n\t\t\treturn $userTypes;\n\t\t}", "public function getUserType();", "public function getUserType();", "public function getUserTypes()\n {\n return $this->find()->all();\n }", "public function setup_types()\n {\n }", "public function has_person_types() {\n return !empty( $this->person_types );\n }", "function get_user_types() {\n\t$policy = new Config;\n\treturn $policy->getUserTypes();\n}", "function workbench_post_get_node_user_types() {\n $revision_author = new RevisionAuthorType('revision author');\n $author = new AuthorType('author');\n\n $users = array();\n $users[$revision_author->user_string] = $revision_author;\n $users[$author->user_string] = $author;\n\n return $users;\n}", "function tipoCampo($result, $indice){\n\t // echo \"<br><br>\".mysql_field_type($result, $indice);\n\t\treturn mysql_field_type($result, $indice);\t\n\t}", "public function listRegisterFields(){\n\t\t$this->registerFieldString('name_hld', 'Tipo');\n\t}", "public function get_persontype_info($post_id, $persontype = 1, $type = '_billing') {\n\n\t\t$WooCommerceNFeFormat = new WooCommerceNFeFormat;\n\n\t\tif ( $persontype == 3 && $type == '_shipping' ) {\n\t\t\t$persontype = $this->detect_persontype($post_id, '_billing');\n\t\t\t$type = '_billing';\n\t\t}\n\n\t\tif ( $persontype == 1 ) {\n\n\t\t\t// Full name and CPF\n\t\t\t$person_info['nome_completo'] = get_post_meta($post_id, $type.'_first_name', true).' '.get_post_meta($post_id, $type.'_last_name', true);\n\t\t\t$person_info['cpf'] = $WooCommerceNFeFormat->cpf(get_post_meta($post_id, $type.'_cpf', true));\n\n\t\t} elseif ( $persontype == 2 ) {\n\n\t\t\t// Razao Social, CNPJ and IE\n\t\t\t$person_info['razao_social'] = get_post_meta($post_id, $type.'_company', true);\n\t\t\t$person_info['cnpj'] = $WooCommerceNFeFormat->cnpj(get_post_meta($post_id, $type.'_cnpj', true));\n\t\t\t$person_info['ie'] = str_replace(array('-','.',','), '', get_post_meta($post_id, $type.'_ie', true));\n\n\t\t}\n\n\t\treturn $person_info;\n\n\t}", "public function getPageTypes() {}", "public function listAllType(){\n try {\n return $this->identityTypeGateway->getAllTypes();\n } catch (Exception $ex) {\n throw $ex;\n }catch (PDOException $e){\n throw $e;\n }\n }", "function workbench_post_get_user_types() {\n $default_users = workbench_post_get_settings_default_user_types();\n $all_users = workbench_post_get_all_user_types();\n $users = array_filter($all_users, function($user) use ($default_users) {\n return $default_users[$user->user_string];\n });\n return $users;\n}", "function cextras_types_formulaires(){\r\n\t$types = array();\r\n\r\n\tforeach(_chemin() as $dir) {\r\n\t\tif (@is_dir($s = $dir.'extra-saisies/')) {\r\n\t\t\tforeach(preg_files($s, '.*.html$') as $saisie) {\r\n\t\t\t\t$type = basename($saisie,'.html');\r\n\t\t\t\t$types[$type] = array(\r\n\t\t\t\t\t'nom' => _T('cextras:type', array('type' => $type))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $types;\r\n}", "public function getAvailableSeedTypes(){\n\t\t$sql = \n\t\t\t\"SELECT DISTINCT type.type_name \n\t\t\tFROM type\n\t\t\tWHERE type.type_name != '000'\n\t\t\tORDER BY type.type_name\";\n\t\t$stmt = $this->databaseConnection->dbConnection->prepare($sql);\n\t\t$stmt->execute();\n\t\t$arrayThing = [];\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\tarray_push($arrayThing, $row['type_name']);\n\t\t}\n\t\t$myJSON = json_encode($arrayThing);\n\t\techo $myJSON;\n\t}", "abstract protected function getType();", "private function myListAccessible($titre,$type,$sujet)\n {\n return $this->getDoctrine()\n ->getRepository(Groupe::class)\n ->findAllMineAccessible($this->getUser()->getId(),$titre,$type,$sujet);\n }", "function _getTypes()\n {\n $types = array(\n 0 => \"null\",\n 1 => \"bool\",\n 2 => \"int\",\n 3 => \"float\",\n 4 => \"varchar\",\n 5 => \"text\",\n 6 => \"blob\"\n );\n $tLeast = $this->table->count() < 2 ? 4 : 0;\n if ($this->GET('override')) {\n $types[1] = \"int\";\n $types[4] = \"text\";\n $types[6] = \"text\";\n }\n foreach ($this->table->fields as $field) {\n $t[$field] = strcasecmp($field, \"id\") ? $tLeast : 2;\n }\n while ($row = $this->table->each()) {\n foreach ($row as $field => $value) {\n if (preg_match('/[\\x00-\\x06\\x08\\x0B-\\x0C\\x0E-\\x13\\x16-\\x1F]/', $value))\n $t[$field] = 6;\n elseif (strlen($value) > 255 || strpos($value, \"\\n\"))\n $t[$field] = max($t[$field], 5);\n elseif (! empty($value) && ! is_numeric($value))\n $t[$field] = max($t[$field], 4);\n elseif (! preg_match('/^[+-]?\\d{0,10}$/s', $value))\n $t[$field] = max($t[$field], 3);\n elseif (! preg_match('/^[01]?$/s', $value))\n $t[$field] = max($t[$field], 2);\n elseif (strlen($value))\n $t[$field] = max($t[$field], 1);\n }\n }\n foreach ($this->table->fields as $field) {\n $this->types[$field] = $types[$t[$field]];\n }\n $this->table->reset();\n }", "protected function getAvailableTypes() {\n return [\n 'miljoenennota' => 'miljoenennota',\n 'miljoenennota (bijlage)' => 'miljoenennota',\n 'voorjaarsnota' => 'voorjaarsnota',\n 'najaarsnota' => 'najaarsnota',\n 'belastingplan (vvw)' => 'belastingplan_voorstel_van_wet',\n 'belastingplan (mvt)' => 'belastingplan_memorie_van_toelichting',\n 'belastingplan (sb)' => 'belastingplan_staatsblad',\n 'financieel jaarverslag' => 'financieel_jaarverslag',\n 'financieel jaarverslag (bijlage)' => 'financieel_jaarverslag',\n 'sw' => 'voorstel_van_wet',\n 'sw (mvt)' => 'memorie_van_toelichting',\n 'owb' => 'memorie_van_toelichting',\n 'owb (wet)' => 'voorstel_van_wet',\n 'jv' => 'jaarverslag',\n '1supp' => 'memorie_van_toelichting',\n '1supp (wet)' => 'voorstel_van_wet',\n '2supp' => 'memorie_van_toelichting',\n '2supp (wet)' => 'voorstel_van_wet',\n 'isb (mvt)' => 'isb_memorie_van_toelichting',\n 'isb (wet)' => 'isb_voorstel_van_wet',\n ];\n }", "function getDatatypes() {\n return ['Protein', 'Phenotype', 'Gene Expression', 'Nucleotide Sequence','Clinical Trials','Imaging Data','Morphology','Proteomics Data','Physiological Signals','Epigenetic Data','Data from Papers',\n 'Omics Data','Survey Data','Cell Signaling','Unspecified',];\n}", "function getAvailableTypes() {\n return array('public' => 'public microtext',\n 'private' => 'private microtext',\n 'book' => 'microbuilder book microtext' );\n }", "static function getProduitByType($type) {\n $sql = \"SELECT * \n FROM PRODUIT\n WHERE typeAvion=:nom_var\";\n $req_prep = Model::$pdo->prepare($sql);\n $req_prep->bindParam(\":nom_var\", $type);\n $req_prep->execute();\n $req_prep->setFetchMode(PDO::FETCH_CLASS, 'ModelProduit');\n return $req_prep->fetchAll();\n }", "public function get_all_teachers_bytype()\n {\n $teachers = Staff::where('is_active', 1)->orWhere('type', 'Adviser')->orWhere('type', 'Teacher')->orderBy('id', 'asc')->get();\n \n $teac = array();\n $teac[] = array('0' => 'select a teacher');\n \n foreach ($teachers as $teacher) {\n $teac[] = array(\n $teacher->id => $teacher->lastname.', '.$teacher->firstname.' '.$teacher->middlename.'( '.$teacher->identification_no.' )',\n );\n }\n \n $teachers = array();\n foreach($teac as $tea) {\n foreach($tea as $key => $val) {\n $teachers[$key] = $val;\n }\n }\n \n return $teachers; \n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "private function get_type() {\n\n\t}", "private function listAccessible($titre,$type,$sujet)\n {\n return $this->getDoctrine()\n ->getRepository(Groupe::class)\n ->findAllAccessible($this->getUser()->getId(),$titre,$type,$sujet);\n }", "public function getAllProtypes(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM protypes\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function workbench_post_get_role_user_types() {\n $roles = user_roles(TRUE);\n $users = array();\n foreach ($roles as $rid => $label) {\n $role_user = new RoleUserType($rid);\n $users[$role_user->user_string] = $role_user;\n }\n return $users;\n}", "public function getTipo();", "public function get_types() {\n\n $q = $this->db->query('SELECT DISTINCT `rgl_type` , `vtr_type` \n FROM `t_reglements` \n LEFT JOIN `v_types_reglements` ON `vtr_id` = `rgl_type` ');\n if ($q->num_rows() > 0) {\n $resultat = $q->result();\n return $resultat;\n }\n else {\n return array();\n }\n }", "function lib4ridora_get_all_publication_types() {\n $field = variable_get('lib4ridora_solr_field_publication_type', 'mods_genre_ms');\n $facet_fields = array($field);\n $facets = lib4ridora_facet_query($facet_fields);\n\n // If there's results, construct an array where the keys are the genres\n // as in Solr, and the values are formatted to be labels.\n if (isset($facets[$field]) && $facets[$field]) {\n return drupal_map_assoc(array_keys($facets[$field]), 'lib4ridora_org_unit_ucwordss');\n }\n\n // Default to returning an empty array.\n return array();\n}", "function getAllCommissionTypes() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_COMMISSION_TYPE . \" WHERE status='1' ORDER BY name\");\n\n return $data;\n }", "public function getTypes(){\r\n \r\n $options[\"\"] = \"--Select--\";\r\n //Query all users(Lecturers) not assigned to other departments\r\n $types = $this->em->getRepository(\"\\Application\\Entity\\Assessmenttype\")->findBy(array(\"systemGenerated\"=>0));\r\n \r\n foreach($types as $type ){\r\n $options[$type->getPkAtid()] = $type->getTypeName();\r\n }\r\n \r\n return $options;\r\n }", "public function get_type();", "#[Pure]\n\tpublic function getTypes()\n {\n }", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "public function getAll($type)\n {\n $type = strtolower($type);\n return (isset($this->$type)) ? $this->$type : null;\n }", "public static function getAllowedTypes();", "function showAllTypes($type,$log,$user,$registrado){\n $tipo=$type;\n $this->smarty->assign('title', $this->title); \n $this->smarty->assign('tipito', $tipo);\n $this->smarty->assign('user', $user);\n $this->smarty->assign('registrado', $registrado);\n $this->smarty->assign('log', $log);\n $this->smarty->display('templates/listaTipos.tpl');\n\n }", "public static function getUserTypeDescription()\n\t{\n\t\treturn array(\n\t\t\t\"USER_TYPE_ID\" => \"url_preview\",\n\t\t\t\"CLASS_NAME\" => __CLASS__,\n\t\t\t\"DESCRIPTION\" => Loc::getMessage('MAIN_URL_PREVIEW_USER_TYPE_NAME'),\n\t\t\t\"BASE_TYPE\" => \"int\"\n\t\t);\n\t}", "public function get_person_types_html() {\n $html = '';\n if ( !empty( $this->person_types ) ) {\n foreach ( $this->person_types as $person_type ) {\n $id = isset( $person_type[ 'id' ] ) ? $person_type[ 'id' ] : false;\n $title = isset( $person_type[ 'title' ] ) ? $person_type[ 'title' ] : false;\n $number = isset( $person_type[ 'number' ] ) ? $person_type[ 'number' ] : false;\n\n if ( $id === false || $title === false || !$number )\n continue;\n\n $person_type_title = get_the_title( $id );\n $title = !!$person_type_title ? $person_type_title : $title;\n $html .= \"<strong>{$title}:</strong> {$number}\";\n $html .= \"<br />\";\n }\n }\n\n return $html;\n }", "public function CountPersonTypes() {\n if ((is_null($this->intId)))\n return 0; \n\n // Get the Database Object for this Class\n $objDatabase = Person::GetDatabase();\n \n $strQuery = sprintf(\"SELECT count(*) as total_count FROM person_persontype_assn WHERE person_id = %s\", $this->intId);\n \n // Perform the Query\n $objDbResult = $objDatabase->Query($strQuery); \n $row = $objDbResult->FetchArray();\n return $row['total_count'];\n }", "public function getDataWithTypeField() {}", "public function getExttypes(){\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('distinct(type)');\n\t\t\t$query->from('#__extensions');\n\t\t\t$query->where('protected=0');\n\t\t\t$db->setQuery($query);\n\t\t\t$arrDatos = $db->loadRowList();\n\t\t\tif(!$arrDatos){\n\t\t\t\t$arrDatos= array();\n\t\t\t}\n\t\t\treturn $arrDatos;\n\t\t}", "public function getAllTypes(){\n return $this->find()->asArray()->orderBy('typeDesc ASC')->all();\n }", "public function listeTheseParType($dateEntree = null, $dateFin = null)\n {\n $this->loadModel('Theses');\n $result = $this->Theses->find('all');\n\n if ($dateEntree && $dateFin) {\n $result = $result->where(function (QueryExpression $exp, Query $q) use ($dateEntree, $dateFin) {\n return $exp->between('date_fin', $dateEntree, $dateFin);\n });\n }\n $result = $result->toArray();\n\n foreach ($result as $key => $row) {\n $type[$key] = $row['type'];\n }\n array_multisort($type, SORT_ASC, SORT_STRING, $result);\n\n return $result;\n }", "public function getValidTypes()\n\t{\n\t\treturn array(\n\t\t\tself::TYPE_SINGLE=>Yii::t('payment', 'Ett LAN'),\n\t\t\tself::TYPE_SEASON=>Yii::t('payment', 'Säsong'),\n\t\t);\n\t}", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "public function testType()\n {\n $user = new User(null, null, null, \"student\");\n $this->assertEquals(\"student\", $user->getType());\n\n $user->setType(\"wrong\");\n $this->assertEquals(\"student\", $user->getType());\n\n $user->setType(\"admin\");\n $this->assertEquals(\"admin\", $user->getType());\n\n $user->setType(\"lecturer\");\n $this->assertEquals(\"lecturer\", $user->getType());\n\n $user->setType(\"student\");\n $this->assertEquals(\"student\", $user->getType());\n }", "public static function getTypesList()\n {\n $sql = 'SELECT id AS value, display_name AS text '\n . 'FROM location_type '\n . 'WHERE active = 1';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "function obtenirTypesChambres ($connexion) {\r\n\r\n $req = \"SELECT * FROM TypeChambre\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt;\r\n\r\n }", "function getTypes() {\n\t\treturn $this->types;\n\t}", "public function Types(){\r\n\t\t$types = self::get_types();\r\n\t\t$types_available = self::get_types_available();\r\n\t\tif (!$types){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$completeTypes = ArrayList::create();\r\n\t\tforeach ($types as $type){\r\n\t\t\tif (isset($types_available[$type])){\r\n\t\t\t\t$completeTypes->push($types_available[$type]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $completeTypes;\t\r\n\t}" ]
[ "0.71190315", "0.6791145", "0.6602424", "0.65821797", "0.6441488", "0.6441488", "0.6441488", "0.63681716", "0.63536155", "0.63536155", "0.63536155", "0.63536155", "0.622103", "0.6186636", "0.61758435", "0.61592954", "0.60903585", "0.6069656", "0.60397035", "0.6015194", "0.601241", "0.6000981", "0.5989597", "0.59816927", "0.59080696", "0.5897819", "0.58971316", "0.589562", "0.58707386", "0.58706474", "0.58576053", "0.58576053", "0.5847451", "0.5839933", "0.58397615", "0.58255213", "0.5804592", "0.57865894", "0.57865894", "0.57566917", "0.5755437", "0.5746207", "0.57445514", "0.5741419", "0.5720076", "0.5718787", "0.5701599", "0.56995213", "0.5691093", "0.5671999", "0.56632966", "0.5654191", "0.56474704", "0.5646576", "0.5645088", "0.5640218", "0.5636129", "0.56346893", "0.5628719", "0.5625573", "0.56104183", "0.5592429", "0.5592429", "0.5592429", "0.5592429", "0.5592429", "0.5591676", "0.5588851", "0.55869025", "0.55781966", "0.55638677", "0.556152", "0.55548966", "0.5545305", "0.5543869", "0.5535685", "0.55328053", "0.5527273", "0.5527273", "0.5527273", "0.5527273", "0.5527273", "0.5527273", "0.5526743", "0.55259216", "0.55216104", "0.5517824", "0.5517337", "0.5506265", "0.5505902", "0.5496889", "0.54964185", "0.54949754", "0.5490617", "0.54875773", "0.5484836", "0.5481959", "0.5480309", "0.5478595", "0.5468166" ]
0.7029266
1
/ instace des WTPSI
/ экземпляр WTPSI
function getAWTPSI(){ if ($this->wtps == NULL){ if ($this->wtpsiusecpny == 1){ $this->wtps = TAWTPSI::objectFactory(array('wsdl'=>$this->wtpsiwsdl, 'cpnylogin'=>1, 'username'=>$this->wtpsiusername, 'userpassword'=>$this->wtpsixmlpasswd, 'wtplogin'=>$this->wtpsiwtplogin, 'wtpusername'=>$this->wtpsicontactuser, 'wtppassword'=>$this->wtpsicontactpasswd )); } else { $this->wtps = TAWTPSI::objectFactory(array('user'=>$this->wtpsiwtplogin, 'pwd'=>$this->wtpsicontactpasswd, 'wsdl'=>$this->wtpsiwsdl)); } } return $this->wtps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAWTPSIAddsOn(){\n if ($this->wtpsaddson == NULL){\n $this->wtpsaddson = TAWTPSIAddsOn::objectFactory(array('user'=>$this->wtpsiwtplogin,\n 'pwd'=>$this->wtpsicontactpasswd,\n 'wsdl'=>$this->wtpsiaddonswsdl));\n }\n return $this->wtpsaddson;\n }", "public function __construct() {\n\t\n parent::__construct();\n\t\t\n self::_initTags(); //extend ipp server tags\t\t\t\n\t\t\n\t\t$this->server_version = '1.0'; //IPP server version\n\t\t$this->ipp_version = '1.0'; //1.1 or 1.0\n\t\t$this->ipp_version_auto = true; //auto change ipp version depending on ipp client\n\t\t\n\t\tswitch ($this->ipp_version) {\n\t\t case '1.1' : $this->ipp_version_x8 = chr(0x01) . chr(0x01); \n\t\t break;\n\t\t case '1.0' :\n\t\t default :\n\t\t $this->ipp_version_x8 = chr(0x01) . chr(0x00);//'1.0';//NOT 1.1 ..WILL NOT WORK IN WINDOWS\n\t\t}\n\t\t\n\t\t$this->clientoutput = new stdClass();\t\t\n }", "function __construct() {\n\t\t$wsdlURL = \"https://hc.mercurydev.net/tws/transactionservice.asmx?WSDL\";\n\t\t$this->wsClient = new SoapClient($wsdlURL);\n\t}", "function qmwConnect() {\n\ttry {\n\t\t$soap = new PerceptionSoap($GLOBALS['CFG']->perception_server_domain, array(\n\t\t\t\t\"qmwise_webshare_name\"\t\t=>\t$GLOBALS['CFG']->perception_webshare,\n\t\t\t\t\"perception_server_port\"\t=>\t$GLOBALS['CFG']->perception_hostport,\n\t\t\t\t\"security_client_id\"\t\t=>\t$GLOBALS['CFG']->perception_use_security ? $GLOBALS['CFG']->perception_client_id : null,\n\t\t\t\t\"security_checksum\"\t\t\t=>\t$GLOBALS['CFG']->perception_use_security ? $GLOBALS['CFG']->perception_checksum : null,\n\t\t\t\t\"trust_use\"\t\t\t\t\t=>\t$GLOBALS['CFG']->perception_use_trust,\n\t\t\t\t\"trust_key\"\t\t\t\t\t=>\t$GLOBALS['CFG']->perception_use_trust ? $GLOBALS['CFG']->perception_trustedkey : null,\n\t\t\t\t\"trust_encoding\"\t\t\t=>\t$GLOBALS['CFG']->perception_encoding,\n\t\t\t\t\"debug\"\t\t\t\t\t\t=>\t$GLOBALS['CFG']->debug\t\t\t\t\n\t\t\t));\n\t\treturn $soap;\n\t} catch(Exception $e) {\n\t\tthrow $e;\n\t}\n}", "public function __construct()\n\t\t{\n\t\t\t// Setup the required variables for the Protx Vps Direct checkout module\n\n\t\t\t$this->_languagePrefix = \"ProtxVspDirect\";\n\t\t\t$this->_id = \"checkout_vspdirect\";\n\t\t\t$this->_image = \"protx_logo.gif\";\n\n\t\t\tparent::__construct();\n\n\t\t\t$this->requiresSSL = true;\n\t\t\t$this->_currenciesSupported = array(\"GBP\");\n\t\t\t$this->_cardsSupported = array ('VISA','AMEX','MC', 'DINERS', 'DISCOVER', 'SOLO','MAESTRO','SWITCH','LASER');\n\t\t\t$this->_liveTransactionURL = 'https://ukvps.protx.com';\n\t\t\t$this->_testTransactionURL = 'https://ukvpstest.protx.com';\n\t\t\t$this->_liveTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_testTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_curlSupported = true;\n\t\t\t$this->_fsocksSupported = true;\n\t\t}", "public function _construct()\n {\n $this->_init('wsu_taxtra/taxtrareports');\n }", "public function __construct() {\n $this->xot = XotData::make();\n $this->register_type = (string) $this->xot->register_type;\n }", "function ClienteWSInmuebles(){\n $this->auth = new ClienteWSAuthAgencia();\n }", "public function __construct()\n\t{\n\t\t$this->api = new ApiDirect('fio');\n\n\t}", "public function __construct() {\n $this->server = new nusoap_server();\n // Define the method as a PHP function\n }", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "public function initOptions() {\n parent::initOptions();\n $this->_options->setOpt(\"WTPSI Company ID\",'wtpsicpnyid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI XML ID\",'wtpsixmlid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI UserName\",'wtpsiusername','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Password\",'wtpsixmlpasswd','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WTP Login\",'wtpsiwtplogin','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI User Contact\",'wtpsicontactuser','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Contact Password \",'wtpsicontactpasswd','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI POSNO \",'wtpsiposno','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"Utiliser le login company\",'wtpsiusecpny','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WSDL \",'wtpsiwsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Add-Ons WSDL \",'wtpsiaddonswsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP : allproj\",'wtpvalidationallproj','boolean',array('compulsory'=>true), false ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP 64 bits\", 'wtp64bits', 'boolean',array('compulsory'=>true), false ,'EPassLibre');\n }", "function wc_pip() {\n\n\treturn \\WC_PIP::instance();\n}", "public function Create() {\n\t\tparent::Create();\t\n\t\t//These lines are parsed on Symcon Startup or Instance creation\n\t\t//You cannot use variables here. Just static values.\n\t\t$this->RegisterPropertyString(\"login\", \"\");\t\t\n\t\t$this->RegisterPropertyString(\"password\", \"\");\n\t\t$this->RegisterPropertyString(\"user\", \"\");\n\t\t$this->RegisterPropertyString(\"serverversion\", \"exV15\");\n\t\t$this->RegisterPropertyString(\"host\", \"\");\n\t\t$this->RegisterPropertyString(\"search\", \"URLAUB!!!, Urlaub!!!, Urlaub !!!, URLAUB !!!, Urlaub, URLAUB, Vacation - Confirmed\");\n\t\t$this->RegisterPropertyString(\"timeframe\", \"today\");\n\t\t$this->RegisterPropertyString(\"starttime\",\"00:00:00\");\n\t\t$this->RegisterPropertyString(\"endtime\",\"23:59:00\");\n\t}", "public function init()\n {\n\t\t$this->_temporizador = new Trf1_Admin_Timer ();\n\t\t$this->_temporizador->Inicio ();\n\t\t\n $this->view->titleBrowser = 'e-Sosti';\n }", "function __construct($trumpia_xml)\n\t{\n\t\techo \"xml string is valid<br>\";\n\t\t$this->time_stamp = date(\"m-d-Y H:i:s\");\n\t\t$this->push_id = $trumpia_xml->PUSH_ID[0];\n\t\t$this->inbound_id = $trumpia_xml->INBOUND_ID[0];\n\t\t$this->subscription_uid = $trumpia_xml->SUBSCRIPTION_UID[0];\n\t\t$this->phone_number = $trumpia_xml->PHONENUMBER[0];\n\t\t$this->keyword = $trumpia_xml->KEYWORD[0];\n\t\t$this->data_capture = $trumpia_xml->DATA_CAPTURE[0];\n\t\t$this->contents = $trumpia_xml->CONTENTS[0];\n\t\t$this->attachment = $trumpia_xml->ATTACHMENT[0];\n\t\t$this->dataset_id = $trumpia_xml->DATASET_ID[0];\n\t\t$this->dataset_name = $trumpia_xml->DATASET_NAME[0];\t\n\t}", "public function __construct($ifspParam){\n $this->ifsp = $ifspParam;\n }", "public function init()\n {\n $this->wxService = new WxService();\n parent::init();\n }", "function wtsCheckWTP($ar){\n $p = new XParam($ar, array('mode'=>'a', 'b'=>0, 'f'=>1));\n $mode = $p->get('mode');\n $bonus = $p->get('b');\n $fidelite = $p->get('f');\n $chipid = $p->get('chipid');\n $accno = $p->get('accno');\n $crc = $p->get('crc');\n // cas ski data à faire (? non fait !)\n $wtp = strtoupper($chipid.'-'.$crc.'-'.$accno);\n $r = array('ok'=>0, 'bonus'=>array('points'=>0, 'jours'=>0));\n\n $kwtp = $this->modresort->knownEPLWTP(array($chipid, $crc, $accno));\n if ($kwtp['ok'] == 1 && $this->modresort->expiredWTP($wtp)){\n $r['ok'] = 0;\n $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n // wtp valide : points bonus eventuels - ceux du panier si il y en a\n if ($kwtp['ok'] == 1){\n $r['ok'] = 1;\n if ($bonus == 1 && $kwtp['eplwtpoid'] != NULL){\n $rs = $this->modloyalty->getCardPoints($kwtp['eplwtpoid']);\n $r['bonus']['points'] = $rs['points'];\n $caddie = $this->getCaddie();\n if (isset($caddie['bonusbycards'][$wtp])){\n $jours = $caddie['bonusbycards'][$wtp];\n if ($jours > 0){\n $jpoints = $this->modloyalty->getPointsFromJours($jours);\n $r['bonus']['points'] = $r['bonus']['points'] - $jpoints;\n }\n }\n $r['bonus']['jours'] = $this->modloyalty->getJoursBonus($r['bonus']['points']);\n }\n if ($this->modresort->expiredWTP($wtp)){\n\t$r['ok'] = 0;\n\t$r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n } else {\n // check de la carte 'temoin' pour assurer que c'est pas service indisponible\n if (defined('EPL_TA_CHECKWTPCARD')){\n\tif (!$this->modresort->checkWTP(explode('-', EPL_TA_CHECKWTPCARD))){\n\t $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_serviceindisponible');\n\t if (empty($r['errormess']))\n\t $r['errormess'] = '[Service indisponible, veuillez réessayer dans quelques instants]';\n\t $r['ok'] = 0;\n\t}\n }\n }\n if ($mode == 'a')\n die(json_encode($r));\n return $r;\n }", "public function Create() {\n parent::Create();\n\n\t\t\t$this->RegisterPropertyString(\"Password\", \"\");\n\n\t\t\t$this->RegisterPropertyString(\n\t\t\t\t'RadioStations', '[{\"position\":1,\"station\":\"NDR2 Niedersachsen\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/800c150e9a6b16078a4a3b3b5aee0672\"},\n\t\t\t\t{\"position\":2,\"station\":\"MDR Jump\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/0888328132708be0905731457bba8ae0\"},\n\t\t\t\t{\"position\":3,\"station\":\"Inselradio Mallorca\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/14f799071150331b9a7994ca8c61f8c7\"}]'\n );\n\n $this->RegisterPropertyBoolean(\"HideVolume\",false);\n $this->RegisterPropertyBoolean(\"HideTitle\",false);\n $this->RegisterPropertyBoolean(\"HideTimeElapsed\",false);\n\n\t\t\t$this->RegisterTimer(\"KeepAliveTimer\", 1000, 'MPDP_KeepAlive($_IPS[\\'TARGET\\']);');\n\t\t}", "public function __construct($_regType = NULL,$_regDt = NULL,$_dtType = NULL,$_postAddr = NULL,$_regStatusCode = NULL,$_registrationNum = NULL,$_message = NULL)\n {\n MicrobiltWsdlClass::__construct(array('RegType'=>$_regType,'RegDt'=>$_regDt,'DtType'=>$_dtType,'PostAddr'=>$_postAddr,'RegStatusCode'=>$_regStatusCode,'RegistrationNum'=>$_registrationNum,'Message'=>$_message),false);\n }", "function __construct() {\n\t\tWP_Http::_getTransport();\n\t\tWP_Http::_postTransport();\n\t}", "public function __construct()\n\t{\n\t\t$this->registry\t\t= ipsRegistry::instance();\n\t\t$this->DB\t\t\t= $this->registry->DB();\n\t\t$this->settings\t\t=& $this->registry->fetchSettings();\n\t\t$this->lang\t\t\t= $this->registry->getClass('class_localization');\n\t}", "static function generarServicioL($par){\n\n\t\tif($par==\"T\"){\n\t\trequire_once('../SERVIDOR/lib/nusoap.php');\n\t\t}else{\n\t\trequire_once('SERVIDOR/lib/nusoap.php');\n\t\t}\n\n\t\t$host = 'http://localhost/Final2k16/SERVIDOR/ws.php?wsdl';\t\n \n $client = new nusoap_client($host);\n $err = $client->getError();\n if ($err) {\n die();\n return '<h2>ERROR EN LA CONSTRUCCION DEL WS:</h2><pre>' . $err . '</pre>';\n }\n return $client;\n\n\t}", "public function Create()\n {\n parent::Create();\n \n //These lines are parsed on Symcon Startup or Instance creation\n //You cannot use variables here. Just static values.\n $this->RegisterPropertyString(\"IPAddress\", \"\");\n $this->RegisterPropertyInteger(\"DefaultVolume\", 15);\n $this->RegisterPropertyBoolean(\"GroupCoordinator\", false);\n $this->RegisterPropertyBoolean(\"GroupForcing\", false);\n $this->RegisterPropertyBoolean(\"MuteControl\", false);\n $this->RegisterPropertyBoolean(\"LoudnessControl\", false);\n $this->RegisterPropertyBoolean(\"BassControl\", false);\n $this->RegisterPropertyBoolean(\"TrebleControl\", false);\n $this->RegisterPropertyString(\"FavoriteStation\", \"\");\n $this->RegisterPropertyString(\"WebFrontStations\", \"<all>\");\n $this->RegisterPropertyString(\"RINCON\", \"\");\n \n }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n // for TYPO3 3.8.0+: enable storage of last built SQL query in $this->debug_lastBuiltQuery for all query building functions of class t3lib_DB\n $this->store_lastBuiltQuery = true;\n \n // get basic extension configuration incl. GSA DB access data from localconf.php (extension configuration in Extension Manager)\n $extConfArr = tx_pttools_div::returnExtConfArray('pt_gsasocket');\n \n $this->logEnabled = $extConfArr['logEnabled'];\n $this->logDirPath = $extConfArr['logDirPath'];\n $this->logAdminEmail = $extConfArr['logAdminEmail'];\n $this->logHostName = $extConfArr['logHostName'];\n if (isset($extConfArr['useGsaTablesInTypo3Database'])) {\n $this->useGsaTablesInTypo3Database = (boolean)$extConfArr['useGsaTablesInTypo3Database'];\n }\n \n // get database connection data\n if ($extConfArr['useGsaTablesInTypo3Database'] == false) {\n // use external GSA database\n $this->host = $extConfArr['dbGSAhost'];\n $this->database = $extConfArr['dbGSAname'];\n $this->user = $extConfArr['dbGSAuser']; \n $this->pass = $extConfArr['dbGSApwd'];\n // allow individual database intialization\n $TYPO3setDBinit = $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']; \n $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] = $extConfArr['dbGSAsetDBinit']; // this will be used now for GSA DB initialization in t3lib_db::sql_pconnect() below\n } else {\n // use TYPO3 database (constants used below are defined in t3lib/config_default.php)\n $this->host = TYPO3_db_host;\n $this->database = TYPO3_db;\n $this->user = TYPO3_db_username; \n $this->pass = TYPO3_db_password;\n }\n \n // connect to database server and select database\n tx_pttools_assert::isNotEmptyString($this->host, array('message'=>'No database host found for GSA DB.'));\n tx_pttools_assert::isNotEmptyString($this->database, array('message'=>'No database name found for GSA DB.'));\n tx_pttools_assert::isNotEmptyString($this->user, array('message'=>'No database user found for GSA DB.')); // note: password my be empty, this is not an error\n $php_errormsg = '';\n $this->connection = @$this->sql_pconnect($this->host, $this->user, $this->pass);\n if ($this->connection == false) {\n throw new tx_pttools_exception('Could not connect to database server', 0, $php_errormsg);\n }\n $this->selectDbResult = $this->sql_select_db($this->database);\n if ($this->selectDbResult == false) {\n throw new tx_pttools_exception('Could not select database', 1, $this->sql_error());\n }\n \n // trace results\n trace('Connected successfully to GSA-DB: '.($extConfArr['useGsaTablesInTypo3Database'] == true ? '***** Using TYPO3 DB for GSA tables! *****' : 'Using additional GSA database.'));\n trace($this->connection, 0, '$this->connection');\n trace($this->selectDbResult, 0, '$this->selectDbResult');\n \n // re-set original TYPO3 database intialization if overwritten for an external GSA database\n if ($extConfArr['useGsaTablesInTypo3Database'] == false) {\n $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] = $TYPO3setDBinit; // perform all other connects with original TYPO3 setting\n }\n \n }", "function AGILETELECOM()\n {\n Provider::Provider(); //call base class constructor\n $this->_name = 'AGILETELECOM';\n $this->_file = basename( __FILE__ );\n\n $this->_params['smstype']\t\t= 'file.sms'; //default params\n $this->_params['smsgateway'] \t= 'H'; \t\t//default params\n\t\t$this->_params['smsuser'] \t\t= 'user'; \t//default params\n\t\t$this->_params['smspassword']\t= 'password'; //default params\n }", "function __construct($username, $password, $wsdl) {\r\n\t\t\t$this->_username=$username;\r\n\t\t\t$this->_password=$password;\r\n\t\t\t$this->_wsdl = $wsdl;\r\n\t\t\t\r\n\t\t\t// Setting up SOAP ready headers with authentication\r\n\t\t\t$WSSEAuth = new SoapVar(array('ns1:Username' => $this->_username,'ns1:Password' => $this->_password),\r\n\t\t\t\t\t\t\t\t\tSOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL, $this->_strWSSENS);\r\n\t\t\t$WSSEToken = new clsWSSEToken($WSSEAuth);\r\n\t\t\t$SoapVarWSSEToken = new SoapVar($WSSEToken,SOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL,$this->_strWSSENS);\r\n\t\t\t$SoapVarHeaderVal=new SoapVar($SoapVarWSSEToken,SOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL,$this->_strWSSENS);\r\n\t\t\t$SoapHeader = new SoapHeader($this->_strWSSENS,'Security',$SoapVarHeaderVal,true);\r\n\t\t\t\r\n\t\t\t$context = stream_context_create(array(\r\n\t\t 'ssl' => array(\r\n\t\t 'verify_peer' => false,\r\n\t\t 'verify_peer_name' => false,\r\n\t\t 'allow_self_signed' => true\r\n\t \t\t \t)\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t// Creating the SOAP client \r\n\t\t\t$this->_SoapClient = new SoapClient($this->_wsdl, array(\r\n\t\t\t\t\"trace\" => 1, \r\n\t\t\t\t\"stream_context\" => $context\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t$this->_SoapClient->__setSoapHeaders(array($SoapHeader));\r\n\t\t}", "public function init() {\n\t\t$this->_temporizador = new Trf1_Admin_Timer ();\n\t\t$this->_temporizador->Inicio ();\n\t\t\n $this->view->titleBrowser = 'e-Sosti - Sistema de Atendimento a Solicitações de TI';\n $this->view->module = $this->getRequest()->getModuleName();\n $this->view->controller = $this->getRequest()->getControllerName();\n $this->view->action = $this->getRequest()->getActionName();\n }", "public function __construct() {\n\t\tself::$IP = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : \"127.0.0.1\"; \t\t\n\t\tself::$SETTINGS = array(\n\t\t\tnew SecuritySetting(1, \"SITE_LOAD\", 20, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(2, \"ACTION_HANDLER\", 15, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(3, \"LOGIN_ATTEMPT\", 7, \"10 MINUTE\"),\n\t\t\tnew SecuritySetting(4, \"EMAIL\", 5, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(5, \"CHANGE_PASSWORD\", 5, \"20 MINUTE\"),\n\t\t\tnew SecuritySetting(6, \"REGISTRATIONS\", 15, \"30 MINUTE\"),\n\t\t\tnew SecuritySetting(7, \"FORUM_POST\", 5, \"30 SECOND\"),\n\t\t\tnew SecuritySetting(8, \"MESSAGE_CENTRE\", 10, \"1 MINUTE\")\n\t\t);\n\t}", "function __construct() {\n $this->name=\"AliIPRelays\";\n $this->title=\"Ali IP Реле\";\n $this->lastsate=array();\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "private function initSoap()\n {\n $options = array(\n 'soap_version' => SOAP_1_1,\n 'stream_context' => $this->container->getParameter('aspone.context'),\n 'authentification' => SOAP_AUTHENTICATION_BASIC,\n 'trace' => 1\n );\n $soap = new SoapClient($this->container->getParameter('aspone.wsdl.monitoring'), $options);\n\n $soap->setContext($this->container->getParameter('aspone.context'));\n $soap->setContextLogin($this->container->getParameter('aspone.contextLogin'));\n $soap->setContextPassword($this->container->getParameter('aspone.contextPassword'));\n $soap->setPassword($this->container->getParameter('aspone.password'));\n $soap->setUsername($this->container->getParameter('aspone.username'));\n $soap->setService($this->container->getParameter('aspone.serviceVersion.0'));\n $soap->setServiceVersion('1.0');\n $soap->setSoapHeaders();\n $soap->__setLocation($this->container->getParameter('aspone.location.monitoring'));\n\n $this->soap = $soap;\n }", "public function TessBaseAPICreate();", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "public function __construct($wrequest)\n {\n //\n $this->wrequest = $wrequest;\n }", "public function __construct(WePortal $portal);", "function getTSsetup($pObj=null,$piKey=null){\n\t\tif($pObj==null){\n\t\t\treturn;\n\t\t}\n\t\tif($GLOBALS['TSFE']->tmpl==null){\n\t\t\t$GLOBALS['TSFE'] = t3lib_div::makeInstance('contentrendering'); ;\n\t\t\t$GLOBALS['TSFE']->id = $pObj['id'];\n\t\t\t$GLOBALS['TSFE']->MP = $pObj['MP'];\n\t\t\t$GLOBALS['TSFE']->sys_language_uid = $pObj['L'];\n\t\t\t$GLOBALS['TSFE']->tmpl = t3lib_div::makeInstance('t3lib_TStemplate');\n\t\t\t$GLOBALS['TSFE']->tmpl->init();\n\t\t\t$GLOBALS['TSFE']->sys_page = t3lib_div::makeInstance('t3lib_pageSelect');\n\t\t\t$rootLine = $this->getRootLine($pObj['id'], $pObj['MP'],false,$pObj['L']);\n\t\t\t$GLOBALS['TSFE']->tmpl->start($rootLine);\n\t\t}\n\t\tif($piKey ==null){\n\t\t\treturn $GLOBALS['TSFE']->tmpl->setup;\n\t\t}else{\n\t\t\treturn $GLOBALS['TSFE']->tmpl->setup['plugin.'][$piKey.'.'];\n\t\t}\n\t}", "function __construct() {\n // require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/NuSOAP/lib/nusoap'.EXT);\n require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/nusoap/nusoap'.EXT);\n }", "public function __construct($_personInfo = NULL,$_regDt = NULL,$_politicalParty = NULL,$_voterStatus = NULL,$_lastVoteDt = NULL)\n {\n MicrobiltWsdlClass::__construct(array('PersonInfo'=>$_personInfo,'RegDt'=>$_regDt,'PoliticalParty'=>$_politicalParty,'VoterStatus'=>$_voterStatus,'LastVoteDt'=>$_lastVoteDt),false);\n }", "public function __init(){}", "public function __construct($wfcID)\n {\n $this->wfcID = $wfcID;\n }", "function __construct()\n {\n $this->reqAdminToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyAdminsCanTagTalks', 'false')->getKey('value'));\n $this->reqCreatorToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyTagCreatorsCanEditTalkTags', 'true')->getKey('value'));\n return parent::__construct();\n }", "function createPWSSOAPClient()\n{\n //Set the parameters for the Non-WSDL mode SOAP communication with your Development/Production credentials\n $client = new SoapClient( \"./wsdl/serviceavailabilityservice.wsdl\", \n array\t(\n 'trace'\t\t\t=>\ttrue,\n 'location'\t=>\t\"https://webservices.purolator.com/PWS/V1/ServiceAvailability/ServiceAvailabilityService.asmx\",\n 'uri'\t\t\t\t=>\t\"http://purolator.com/pws/datatypes/v1\",\n 'login'\t\t\t=>\tPRODUCTION_KEY,\n 'password'\t=>\tPRODUCTION_PASS\n )\n );\n //Define the SOAP Envelope Headers\n $headers[] = new SoapHeader ( 'http://purolator.com/pws/datatypes/v1', \n 'RequestContext', \n array (\n 'Version' => '1.3',\n 'Language' => 'en',\n 'GroupID' => 'xxx',\n 'RequestReference' => 'Rating Example',\n 'UserToken' => USER_TOKEN\n )\n ); \n //Apply the SOAP Header to your client \n $client->__setSoapHeaders($headers);\n\n return $client;\n}", "public function __construct()\n {\n if (!empty($_SESSION['id_uzytkownika']) && !empty($_SESSION['id_roli'])) {\n $this->_idUzytkownik = (int) $_SESSION['id_uzytkownika'];\n $this->_idRoli = (int) $_SESSION['id_roli'];\n\t\t\t$this->_Imie= $_SESSION['imie'];\n\t\t\t$this->_Nazwisko= $_SESSION['nazwisko'];\n }\n\n $this->_conn = new Conn();\n }", "private function __construct()\t{}", "function createPWSSOAPClient()\n{\n //Set the parameters for the Non-WSDL mode SOAP communication with your Development/Production credentials\n $client = new SoapClient( \"./wsdl/PickUpService.wsdl\", \n array\t(\n\t\t\t\t\t'trace'\t\t\t=>\ttrue,\n\t\t\t\t\t'location'\t=>\t\"https://devwebservices.purolator.com/EWS/V1/PickUp/PickUpService.asmx\",\n\t\t\t\t\t'uri'\t\t\t\t=>\t\"http://purolator.com/pws/datatypes/v1\",\n\t\t\t\t\t'login'\t\t\t=>\tPRODUCTION_KEY,\n\t\t\t\t\t'password'\t=>\tPRODUCTION_PASS\n )\n );\n //Define the SOAP Envelope Headers\n $headers[] = new SoapHeader ( 'http://purolator.com/pws/datatypes/v1', \n 'RequestContext', \n array (\n 'Version' => '1.2',\n 'Language' => 'en',\n 'GroupID' => 'xxx',\n 'RequestReference' => 'Rating Example',\n 'UserToken' => USER_TOKEN\n )\n ); \n //Apply the SOAP Header to your client \n $client->__setSoapHeaders($headers);\n return $client;\n}", "function SNTH_Woo() {\n return SNTH_Woo::instance();\n }", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "function __construct($SUI, $private_key, $wsdl_url) {\n $this->_SUI = $SUI;\n $this->_private_key = $private_key;\n $this->_wsdl_url = $wsdl_url;\n /*\n * Note: the trace option enables the use of the SOAP functions\n * - __getLastRequest()\n * - __getLastResponse()\n */\n parent::__construct($wsdl_url, array(\n 'soap_version' => SOAP_1_2,\n 'trace' => 1,\n 'exceptions' => 1)\n );\n }", "function __construct() {\n $this->plugin_dir = plugin_dir_path(__FILE__);\n $this->icon_dir = $this->plugin_dir . 'images/icons/';\n\n $this->plugin_url = plugins_url('',__FILE__);\n $this->icon_url = $this->plugin_url . 'images/icons/';\n $this->admin_page = admin_url() . 'admin.php?page=' . $this->plugin_dir;\n\n $this->base_name = plugin_basename(__FILE__);\n\n $this->prefix = ADPRESS_PREFIX;\n\n $this->_configure();\n $this->_includes();\n \n // Extra help : attach the packages\n //\n $this->wpcsl->extrahelp = new ADPRESS_Extra_Help(\n array(\n 'parent' => $this->wpcsl\n )\n ); \n }", "public function serch()\n {\n }", "private function __construct($i,$s,$t) {\n\t\t$this->id=$i;\n\t\t$this->state=!!$s;\n\t\t$this->text=(string)$t;\n\t}", "public function __construct()\n {\n $this->connection = Shopware()->Models()->getConnection();\n $this->db = Shopware()->Db();\n $this->writer = new TranslationComponent();\n $this->shops = $this->getShops();\n }", "function __construct()\n {\n // Some default values of the class\n $this->gatewayUrl = 'https://test.ipgonline.com/connect/gateway/processing';\n $this->ipnLogFile = PAID_SUBS_DIR.'/ipn/logs/firstdata.ipn_results.log';\n \n global $paidSub;\n \n if($paidSub->configs['test_mode']=='enabled')\n $this->enableTestMode();\n }", "function __construct() {\n\t\t\n\t\tparent::__construct(array('Waccess'), 8);\n\t\t\n\t}", "public function __construct() {\n $this->activated = false;\n if (defined('USCES_VERSION')) {\n $this->activated = true;\n }\n\n $mopath = __DIR__ . '/languages/wgeneric-' . get_locale() . '.mo';\n if (file_exists($mopath)) {\n load_textdomain('wgeneric', $mopath);\n } else {\n load_textdomain('wgeneric', __DIR__ . '/languages/wgeneric-en.mo');\n }\n }", "public function __construct(WampServerInterface $app) {\n $this->wampProtocol = new ServerProtocol(new TopicManager($app));\n }", "public function __construct()\n {\n \tglobal $psp;\n\n \t$this->the_plugin = $psp;\n\t\t\t$this->module_folder = $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'modules/smushit/';\n\n\t\t\t$this->settings = $this->the_plugin->get_theoption( 'psp_smushit' );\n\t\t\t\n\t\t\t$this->init();\n }", "function createPWSSOAPClient()\n{\n //Set the parameters for the Non-WSDL mode SOAP communication with your Development/Production credentials\n $client = new SoapClient( \"./wsdl/PickUpService.wsdl\", \n array\t(\n 'trace'\t\t\t=>\ttrue,\t\t\t\t \n\t\t\t\t 'location'\t=>\t\"https://devwebservices.purolator.com/EWS/V1/PickUp/PickUpService.asmx\",\t\t\t\t \n 'uri'\t\t\t\t=>\t\"http://purolator.com/pws/datatypes/v1\",\n 'login'\t\t\t=>\tPRODUCTION_KEY,\n 'password'\t=>\tPRODUCTION_PASS\n )\n );\n //Define the SOAP Envelope Headers\n $headers[] = new SoapHeader ( 'http://purolator.com/pws/datatypes/v1', \n 'RequestContext', \n array (\n 'Version' => '1.2',\n 'Language' => 'en',\n 'GroupID' => 'xxx',\n 'RequestReference' => 'Rating Example'\n )\n ); \n //Apply the SOAP Header to your client \n $client->__setSoapHeaders($headers);\n\n return $client;\n}", "public function __construct($tea_list,$template_id,$data,$url)\n {\n $this->wx_info=[\n \"template_id\" => $template_id,\n \"data\" => $data,\n \"tea_list\" => $tea_list,\n \"url\" => $url,\n ];\n }", "function __construct(){\n\t\t\n\t\t$this->rp=''; for($n=0;$n<(count(explode(\"/\",eregi_replace(\"//*\",\"/\",substr($_SERVER['PHP_SELF'],1))))-1);$n++) $this->rp .= \"../\";\n\t\trequire_once($this->rp.'includes/fnct_clean_entry.php');\n\t\t\n\t\t$this->URLS['programs']=\"ProgramService.svc?wsdl\"; // WSDL for our programs module\n\t\t\n\t\t$this->TEMP['pListCont']\t\t=\"prods_list.tpl\"; \t\t// file path to our products list template\n\t\t$this->TEMP['pList']\t\t\t\t=\"prod_list.tpl\"; \t\t// file path to our product list template\n\t\t$this->TEMP['pLarge']\t\t\t\t=\"prod_lrg.tpl\"; \t\t\t// file path to our product view template\n\t\t$this->TEMP['cList']\t\t\t\t=\"cart.tpl\"; \t\t\t\t\t// file path to our cart template\n\t\t$this->TEMP['cItem']\t\t\t\t=\"cart_item.tpl\"; \t\t\t// file path to our product view template\n\t}", "static function generarServicioF(){\n\n\t\trequire_once('SERVIDOR/lib/nusoap.php');\n \n $host = 'http://maxineiner.tuars.com/webservice/ws_segundo_parcial.php?wsdl';\n\n $client = new nusoap_client($host);\n $err = $client->getError();\n if ($err) {\n die();\n return '<h2>ERROR EN LA CONSTRUCCION DEL WS:</h2><pre>' . $err . '</pre>';\n }\n return $client;\n\n\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function __construct($_indValue,$_indName = NULL)\n {\n MicrobiltWsdlClass::__construct(array('IndValue'=>$_indValue,'IndName'=>$_indName),false);\n }", "protected function __init__() { }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function newPortal(){\n\t\t$this->wlan_if = null;\n\t\t$this->ssid = null;\n\t\t$this->remote_file = null;\n\t\t\n\t\t$hp = HostAPDConfig::getInstance();\n\t\t\n\t\t$this->wlan_if = \"wlan\".$hp->getWlanNumber();\n\t}", "public function __construct()\r\n {\r\n global $IP;\r\n $this->url = \"http://\" . $IP . \"/user/info/update/\";\r\n $this->http = new HttpClass();\r\n $this->InfoGet = new TestUserInfoGet();\r\n }", "public function __construct() {\r\n\t\t$this->namespace = '/wcc/v1';\r\n\t\t$this->resource_name = 'shipping';\r\n\t}", "public function __construct() {\n $this->miConexion = Conexion::singleton();\n $this->retorno = new stdClass();\n }" ]
[ "0.61785626", "0.55700535", "0.55467254", "0.55089617", "0.5493206", "0.54186076", "0.53854", "0.53367203", "0.532515", "0.53076303", "0.5287357", "0.52626115", "0.52144355", "0.51818913", "0.5180667", "0.5177764", "0.51580375", "0.5153518", "0.51520914", "0.51497084", "0.5120447", "0.512015", "0.5111752", "0.5101447", "0.5099174", "0.5094452", "0.508737", "0.50848955", "0.5078817", "0.5067151", "0.50499505", "0.50287056", "0.50286615", "0.5020893", "0.5020637", "0.5017932", "0.5017785", "0.50132173", "0.5005481", "0.5003488", "0.499296", "0.49864748", "0.49590972", "0.49583697", "0.4951098", "0.49448192", "0.49414632", "0.49393842", "0.493829", "0.49353728", "0.493401", "0.4927601", "0.4923683", "0.49236184", "0.49182558", "0.49160767", "0.49154234", "0.49149334", "0.49124902", "0.4896456", "0.48949632", "0.4893964", "0.48925263", "0.48925263", "0.48925263", "0.48925263", "0.48925263", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.4892321", "0.48908788", "0.48802987", "0.4878864", "0.4878864", "0.4878864", "0.4878864", "0.48785427", "0.48785427", "0.48785427", "0.48785427", "0.48785427", "0.48785427", "0.48783752", "0.48783752", "0.4872382", "0.48705247", "0.48697385", "0.48670995" ]
0.7157683
0
/ instace des WTPSI AddOns
/ экземпляр дополнений WTPSI
function getAWTPSIAddsOn(){ if ($this->wtpsaddson == NULL){ $this->wtpsaddson = TAWTPSIAddsOn::objectFactory(array('user'=>$this->wtpsiwtplogin, 'pwd'=>$this->wtpsicontactpasswd, 'wsdl'=>$this->wtpsiaddonswsdl)); } return $this->wtpsaddson; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n $this->plugin_dir = plugin_dir_path(__FILE__);\n $this->icon_dir = $this->plugin_dir . 'images/icons/';\n\n $this->plugin_url = plugins_url('',__FILE__);\n $this->icon_url = $this->plugin_url . 'images/icons/';\n $this->admin_page = admin_url() . 'admin.php?page=' . $this->plugin_dir;\n\n $this->base_name = plugin_basename(__FILE__);\n\n $this->prefix = ADPRESS_PREFIX;\n\n $this->_configure();\n $this->_includes();\n \n // Extra help : attach the packages\n //\n $this->wpcsl->extrahelp = new ADPRESS_Extra_Help(\n array(\n 'parent' => $this->wpcsl\n )\n ); \n }", "function wdtAddOnsEnqueue()\n{\n WDTTools::wdtUIKitEnqueue();\n\n wp_enqueue_style('wdt-add-ons-css', WDT_CSS_PATH . 'admin/addons.css', array(), WDT_CURRENT_VERSION);\n\n wp_enqueue_script('wdt-common');\n wp_enqueue_script('wdt-doc-js');\n wp_enqueue_script('wdt-addons-tms-store-checkout', WDT_JS_PATH . 'wpdatatables/wdt.store.checkout.js', array('jquery'), 1.12, true);\n\n wp_localize_script('wdt-addons-tms-store-checkout', 'tmsStore', ['url' => WDT_STORE_URL]);\n}", "public function winespace_welcome_addons() {\n\t\trequire_once( get_template_directory() . '/inc/admin/welcome-screen/sections/add-ons.php' );\n\t}", "public static function init() {\n\t\tadd_filter('gb_addons', array(get_class(),'gb_merchant_meta_addon'), 10, 1);\n\t}", "public function init() {\n\n\t\t\t// WPML String Translation plugin exist check\n\t\t\tif ( defined( 'WPML_ST_VERSION' ) ) {\n\t\t\t\tadd_filter( 'wpml_elementor_widgets_to_translate', array( $this, 'add_translatable_nodes' ) );\n\t\t\t\tadd_filter( 'jet-woo-builder/current-template/template-id', array( $this, 'jet_woo_builder_modify_template_id' ) );\n\t\t\t}\n\n\t\t\t// Polylang Translation plugin exist check\n\t\t\tif ( class_exists( 'Polylang' ) ) {\n\t\t\t\trequire jet_woo_builder()->plugin_path( 'includes/lib/compatibility/packages/polylang.php' );\n\t\t\t}\n\n\t\t}", "static protected function setup_extensions()\n\t{\n\t\treturn array('anavaro/eventmedals');\n\t}", "public function init() {\n\t\t$this->define_constants();\n\t\t$this->load_dependencies();\n\t\tdo_action( 'wprmprc_init' );\n\t\tadd_filter( 'wprm_addon_active', array( $this, 'addon_active' ), 10, 2 );\n\t}", "function customs()\n\t{\n\t\t$custom = $this->ipsclass->load_class( ROOT_PATH.'mod_install/'.$this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'].'.php', $this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'] );\n\t\t$custom->xml_array =& $this->xml_array;\n\t\t\n\t\tif ( $this->ipsclass->input['un'] )\n\t\t{\n\t\t\t$custom->uninstall();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom->install();\n\t\t}\n\t}", "public function __construct() {\n\n\t\t// Define constants\n\t\tadd_action( 'plugins_loaded', array( &$this, 'wpl_toolskit_define_constants' ), 1 );\n\n\t\t// Load language file\n\t\tadd_action( 'plugins_loaded', array( &$this, 'wpl_toolskit_load_textdomain' ), 2 );\n\n\t\tadd_action( 'after_setup_theme', array( &$this, 'wpl_toolskit_includes'), 3 );\n\n\t\tadd_action( 'after_setup_theme', array( &$this, 'wpl_toolskit_instances'), 4 );\n\t\t\n\t\t// Add Setings Link\n\t\tadd_filter( 'plugin_action_links_'.plugin_basename(__FILE__), array( &$this, 'wpl_toolskit_links' ), 1 );\n\n\t}", "function tb_addTagBeepToWpAdmin() { \r\n //add in /settings manu\r\n add_options_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitor\", \"tb_load_tagBeepAdmin\"); \r\n //add in the /plugins menu\r\n add_plugins_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitorPlugin\", \"tb_load_tagBeepAdmin\"); \r\n}", "function owa_install() {\r\n\r\n\tdefine('OWA_INSTALLING', true);\r\n\t\r\n\t$params = array();\r\n\t//$params['do_not_fetch_config_from_db'] = true;\r\n\r\n\t$owa = owa_getInstance($params);\r\n\t$owa->setSetting('base', 'cache_objects', false);\t\r\n\t$public_url = get_bloginfo('wpurl').'/wp-content/plugins/owa/';\r\n\t\r\n\t$install_params = array('site_id' => md5(get_settings('siteurl')), \r\n\t\t\t\t\t\t\t'name' => get_bloginfo('name'),\r\n\t\t\t\t\t\t\t'domain' => get_settings('siteurl'), \r\n\t\t\t\t\t\t\t'description' => get_bloginfo('description'),\r\n\t\t\t\t\t\t\t'action' => 'base.installEmbedded',\r\n\t\t\t\t\t\t\t'db_type' => 'mysql',\r\n\t\t\t\t\t\t\t'db_name' => DB_NAME,\r\n\t\t\t\t\t\t\t'db_host' => DB_HOST,\r\n\t\t\t\t\t\t\t'db_user' => DB_USER,\r\n\t\t\t\t\t\t\t'db_password' => DB_PASSWORD,\r\n\t\t\t\t\t\t\t'public_url' => $public_url\r\n\t\t\t\t\t\t\t);\r\n\t\r\n\t$owa->handleRequest($install_params);\r\n}", "function __construct() {\r\n\t\t/**\tAppel des scripts et styles pour le module digirisk dans la partie administration / Include styles and scripts for backend\t*/\r\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_assets' ) );\r\n\t\t/**\tAppel des scripts communs pour le module digirisk / Include common styles and scripts\t*/\r\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'common_js' ) );\r\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'common_js' ) );\r\n\r\n\t\t/*\tCréation du menu dans l'administration pour le module digirisk / Create the administration menu for digirisk plugin */\r\n\t\tadd_action('admin_menu', array( &$this, 'admin_menu' ) );\r\n\r\n\t\t/**\tAppel des scripts de mise à jour automatique de la base de données / Call automatic database structure update\t*/\r\n\t\tif ( digirisk_options::getDbOption('base_evarisk') > 1 ) {\r\n\t\t\tadd_action('admin_init', array( 'digirisk_install', 'update_digirisk' ) );\r\n\t\t}\r\n\t}", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "public function initOptions() {\n parent::initOptions();\n $this->_options->setOpt(\"WTPSI Company ID\",'wtpsicpnyid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI XML ID\",'wtpsixmlid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI UserName\",'wtpsiusername','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Password\",'wtpsixmlpasswd','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WTP Login\",'wtpsiwtplogin','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI User Contact\",'wtpsicontactuser','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Contact Password \",'wtpsicontactpasswd','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI POSNO \",'wtpsiposno','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"Utiliser le login company\",'wtpsiusecpny','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WSDL \",'wtpsiwsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Add-Ons WSDL \",'wtpsiaddonswsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP : allproj\",'wtpvalidationallproj','boolean',array('compulsory'=>true), false ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP 64 bits\", 'wtp64bits', 'boolean',array('compulsory'=>true), false ,'EPassLibre');\n }", "private function __construct() {\n\t\t$plugin = Tribe__Events__Main::instance();\n\n\t\tadd_action( 'admin_menu', array( $this, 'register_menu_item' ) );\n\t\tadd_action( 'current_screen', array( $this, 'action_request' ) );\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\n\t\t// check if the license is valid each time the page is accessed\n\t\tadd_action( 'tribe_aggregator_page_request', array( $this, 'check_for_license_updates' ) );\n\n\t\t// filter the plupload default settings to remove mime type restrictions\n\t\tadd_filter( 'plupload_default_settings', array( $this, 'filter_plupload_default_settings' ) );\n\n\t\t// Setup Tabs Instance\n\t\t$this->tabs = Tribe__Events__Aggregator__Tabs::instance();\n\n\t\ttribe_notice( 'tribe-aggregator-legacy-import-plugins-active', array( $this, 'notice_legacy_plugins' ), 'type=warning' );\n\t}", "public function action_init()\n\t{\n\t\t$this->add_template( 'addon_preview', dirname(__FILE__) . '/templates/addon_preview.php' );\n\t\t$this->add_template( 'addon', dirname(__FILE__) . '/templates/addon.php' );\n\t\t\n\t\t$this->add_rule('\"retrieve_addonlist\"', 'retrieve_addonlist');\n\t\t$this->add_rule('\"install_addons\"', 'install_addons');\n\n\t}", "public function addExtAddon($addon);", "function setup() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 21 );\n\t\tadd_action( 'admin_init', array( $this, 'maybe_add_pagination' ) );\n\n\t\tadd_action( 'appthemes_addons_mp_popular', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t\tadd_action( 'appthemes_addons_mp_new', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t\tadd_action( 'appthemes_addons_mp_updated', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t}", "function get_entry_points()\n\t{\n\t\treturn array('misc'=>'XML_DATA_MANAGEMENT');\n\t}", "function wlms_plugin_install()\n{\n wlms_create_table();\n wlms_settings_data();\n}", "function mediawikiinstall($o){\n\t\n\t\t//$o->extract(\"confirmaccount\", \"extensions/\");\n\t\t$o->sr(\"LocalSettings.php\", \"#Add\\s*more\\s*configuration\\s*options\\s*below.#\", \"End of automatically generated settings. \\n\\n \\$wgGroupPermissions['*']['edit'] = false; \\n\\n \\$wgGroupPermissions['*']['createpage'] = false; \\n\\n \\$wgEmailConfirmToEdit = true;\");\n\t}", "function register_vc_add_on(){\r\n\r\n vc_map( array(\r\n \"name\" => $this->name,\r\n \"base\" => $this->id,\r\n \"icon\" => $this->icon,\r\n \"description\" => $this->description,\r\n \"weight\" => 1,\r\n\r\n \"wrapper_height\"=> 'full',\r\n\r\n \"category\" => __( 'BetterMag Addons', 'better-studio' ),\r\n \"params\" => array(\r\n\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Title', 'better-studio' ),\r\n \"param_name\" => 'title',\r\n \"value\" => $this->defaults['title'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"heading\" => __( 'Show Title?', 'better-studio'),\r\n \"param_name\" => 'show_title',\r\n \"value\" => $this->defaults['show_title'],\r\n ),\r\n array(\r\n 'heading' => __( 'Instructions', 'better-studio' ),\r\n 'param_name' => 'help',\r\n 'type' => 'bf_info',\r\n 'value' => __('<ol>\r\n <li>Copy the link to you facebook page</li>\r\n <li>Paste it in the \"Link to you Facebook page\" input box below</li>\r\n </ol>\r\n ', 'better-studio' ),\r\n 'state' => 'open',\r\n 'info-type' => 'help',\r\n 'section_class' => 'widefat',\r\n ),\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Link to you Facebook page', 'better-studio' ),\r\n \"param_name\" => 'url',\r\n \"value\" => $this->defaults['url'],\r\n ),\r\n array(\r\n \"type\" => 'bf_select',\r\n \"heading\" => __( 'Style', 'better-studio' ),\r\n \"param_name\" => 'style',\r\n 'section_class' => 'style-floated-left',\r\n \"admin_label\" => true,\r\n \"options\" => array(\r\n 'light' => __( 'Light Schema', 'better-studio' ),\r\n 'dark' => __( 'Style Schema', 'better-studio' ),\r\n ),\r\n \"value\" => $this->defaults['style'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Posts?', 'better-studio' ),\r\n \"param_name\" => 'show_posts',\r\n \"value\" => $this->defaults['show_posts'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show faces?', 'better-studio' ),\r\n \"param_name\" => 'show_faces',\r\n \"value\" => $this->defaults['show_faces'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Header?', 'better-studio' ),\r\n \"param_name\" => 'show_header',\r\n \"value\" => $this->defaults['show_header'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Border?', 'better-studio' ),\r\n \"param_name\" => 'show_border',\r\n \"value\" => $this->defaults['show_border'],\r\n ),\r\n\r\n\r\n )\r\n ) );\r\n\r\n }", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "public static function _register()\n {\n self::assignElements([\n 'ListingDurations' => ['type' => 'ListingDurationDefinitionsType', 'xmlns' => self::XMLNS],\n 'ShippingTermsRequired' => ['type' => 'ShippingTermRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferEnabled' => ['type' => 'BestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DutchBINEnabled' => ['type' => 'DutchBINEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UserConsentRequired' => ['type' => 'UserConsentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'HomePageFeaturedEnabled' => ['type' => 'HomePageFeaturedEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackEnabled' => ['type' => 'ProPackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BasicUpgradePackEnabled' => ['type' => 'BasicUpgradePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ValuePackEnabled' => ['type' => 'ValuePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackPlusEnabled' => ['type' => 'ProPackPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdFormatEnabled' => ['type' => 'AdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferCounterEnabled' => ['type' => 'BestOfferCounterEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoDeclineEnabled' => ['type' => 'BestOfferAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSpecialitySubscription' => ['type' => 'LocalMarketSpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketRegularSubscription' => ['type' => 'LocalMarketRegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPremiumSubscription' => ['type' => 'LocalMarketPremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketNonSubscription' => ['type' => 'LocalMarketNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressEnabled' => ['type' => 'ExpressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressPicturesRequired' => ['type' => 'ExpressPicturesRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressConditionRequired' => ['type' => 'ExpressConditionRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'MinimumReservePrice' => ['type' => 'MinimumReservePriceDefinitionType', 'xmlns' => self::XMLNS],\n 'TransactionConfirmationRequestEnabled' => ['type' => 'TCREnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerContactDetailsEnabled' => ['type' => 'SellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreInventoryEnabled' => ['type' => 'StoreInventoryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeTransactionalEnabled' => ['type' => 'SkypeMeTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeNonTransactionalEnabled' => ['type' => 'SkypeMeNonTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesRegular' => ['type' => 'LocalListingDistancesRegularDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesSpecialty' => ['type' => 'LocalListingDistancesSpecialtyDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesNonSubscription' => ['type' => 'LocalListingDistancesNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPaymentMethodEnabled' => ['type' => 'ClassifiedAdPaymentMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdShippingMethodEnabled' => ['type' => 'ClassifiedAdShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdBestOfferEnabled' => ['type' => 'ClassifiedAdBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCounterOfferEnabled' => ['type' => 'ClassifiedAdCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoDeclineEnabled' => ['type' => 'ClassifiedAdAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByPhoneEnabled' => ['type' => 'ClassifiedAdContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByEmailEnabled' => ['type' => 'ClassifiedAdContactByEmailEnabledDefintionType', 'xmlns' => self::XMLNS],\n 'SafePaymentRequired' => ['type' => 'SafePaymentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPayPerLeadEnabled' => ['type' => 'ClassifiedAdPayPerLeadEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemSpecificsEnabled' => ['type' => 'ItemSpecificsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PaisaPayFullEscrowEnabled' => ['type' => 'PaisaPayFullEscrowEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNIdentifierEnabled' => ['type' => 'ISBNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCIdentifierEnabled' => ['type' => 'UPCIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANIdentifierEnabled' => ['type' => 'EANIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BrandMPNIdentifierEnabled' => ['type' => 'BrandMPNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoAcceptEnabled' => ['type' => 'BestOfferAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoAcceptEnabled' => ['type' => 'ClassifiedAdAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeNorthAmericaEnabled' => ['type' => 'CrossBorderTradeNorthAmericaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeGBEnabled' => ['type' => 'CrossBorderTradeGBEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeAustraliaEnabled' => ['type' => 'CrossBorderTradeAustraliaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalBuyerProtectionEnabled' => ['type' => 'PayPalBuyerProtectionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BuyerGuaranteeEnabled' => ['type' => 'BuyerGuaranteeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CombinedFixedPriceTreatmentEnabled' => ['type' => 'CombinedFixedPriceTreatmentEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'GalleryFeaturedDurations' => ['type' => 'ListingEnhancementDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'INEscrowWorkflowTimeline' => ['type' => 'INEscrowWorkflowTimelineDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequired' => ['type' => 'PayPalRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAdFormatEnabled' => ['type' => 'EBayMotorsProAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByPhoneEnabled' => ['type' => 'EBayMotorsProContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPhoneCount' => ['type' => 'EBayMotorsProPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByAddressEnabled' => ['type' => 'EBayMotorsProContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProStreetCount' => ['type' => 'EBayMotorsProStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCompanyNameEnabled' => ['type' => 'EBayMotorsProCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByEmailEnabled' => ['type' => 'EBayMotorsProContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProBestOfferEnabled' => ['type' => 'EBayMotorsProBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoAcceptEnabled' => ['type' => 'EBayMotorsProAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoDeclineEnabled' => ['type' => 'EBayMotorsProAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPaymentMethodCheckOutEnabled' => ['type' => 'EBayMotorsProPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProShippingMethodEnabled' => ['type' => 'EBayMotorsProShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCounterOfferEnabled' => ['type' => 'EBayMotorsProCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProSellerContactDetailsEnabled' => ['type' => 'EBayMotorsProSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAdFormatEnabled' => ['type' => 'LocalMarketAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByPhoneEnabled' => ['type' => 'LocalMarketContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPhoneCount' => ['type' => 'LocalMarketPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByAddressEnabled' => ['type' => 'LocalMarketContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketStreetCount' => ['type' => 'LocalMarketStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCompanyNameEnabled' => ['type' => 'LocalMarketCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByEmailEnabled' => ['type' => 'LocalMarketContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketBestOfferEnabled' => ['type' => 'LocalMarketBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoAcceptEnabled' => ['type' => 'LocalMarketAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoDeclineEnabled' => ['type' => 'LocalMarketAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPaymentMethodCheckOutEnabled' => ['type' => 'LocalMarketPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketShippingMethodEnabled' => ['type' => 'LocalMarketShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCounterOfferEnabled' => ['type' => 'LocalMarketCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSellerContactDetailsEnabled' => ['type' => 'LocalMarketSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPhoneCount' => ['type' => 'ClassifiedAdPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByAddressEnabled' => ['type' => 'ClassifiedAdContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdStreetCount' => ['type' => 'ClassifiedAdStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCompanyNameEnabled' => ['type' => 'ClassifiedAdCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SpecialitySubscription' => ['type' => 'SpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'RegularSubscription' => ['type' => 'RegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'PremiumSubscription' => ['type' => 'PremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'NonSubscription' => ['type' => 'NonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyEnabled' => ['type' => 'ReturnPolicyEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'HandlingTimeEnabled' => ['type' => 'HandlingTimeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequiredForStoreOwner' => ['type' => 'PayPalRequiredForStoreOwnerDefinitionType', 'xmlns' => self::XMLNS],\n 'ReviseQuantityAllowed' => ['type' => 'ReviseQuantityAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'RevisePriceAllowed' => ['type' => 'RevisePriceAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurationsEnabled' => ['type' => 'StoreOwnerExtendedListingDurationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurations' => ['type' => 'StoreOwnerExtendedListingDurationsDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentMethod' => ['type' => 'PaymentMethodDefinitionType', 'xmlns' => self::XMLNS],\n 'Group1MaxFlatShippingCost' => ['type' => 'Group1MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group2MaxFlatShippingCost' => ['type' => 'Group2MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group3MaxFlatShippingCost' => ['type' => 'Group3MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCostCBTExempt' => ['type' => 'MaxFlatShippingCostCBTExemptDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCost' => ['type' => 'MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'VariationsEnabled' => ['type' => 'VariationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AttributeConversionEnabled' => ['type' => 'AttributeConversionEnabledFeatureDefinitionType', 'xmlns' => self::XMLNS],\n 'FreeGalleryPlusEnabled' => ['type' => 'FreeGalleryPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'FreePicturePackEnabled' => ['type' => 'FreePicturePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemCompatibilityEnabled' => ['type' => 'ItemCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxItemCompatibility' => ['type' => 'MaxItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'MinItemCompatibility' => ['type' => 'MinItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionEnabled' => ['type' => 'ConditionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionValues' => ['type' => 'ConditionValuesDefinitionType', 'xmlns' => self::XMLNS],\n 'ValueCategory' => ['type' => 'ValueCategoryDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductCreationEnabled' => ['type' => 'ProductCreationEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANEnabled' => ['type' => 'EANEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNEnabled' => ['type' => 'ISBNEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCEnabled' => ['type' => 'UPCEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CompatibleVehicleType' => ['type' => 'CompatibleVehicleTypeDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxGranularFitmentCount' => ['type' => 'MaxGranularFitmentCountDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentOptionsGroup' => ['type' => 'PaymentOptionsGroupEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ShippingProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'VINSupported' => ['type' => 'VINSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'VRMSupported' => ['type' => 'VRMSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerProvidedTitleSupported' => ['type' => 'SellerProvidedTitleSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'DepositSupported' => ['type' => 'DepositSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'GlobalShippingEnabled' => ['type' => 'GlobalShippingEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdditionalCompatibilityEnabled' => ['type' => 'AdditionalCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PickupDropOffEnabled' => ['type' => 'PickupDropOffEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DigitalGoodDeliveryEnabled' => ['type' => 'DigitalGoodDeliveryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EpidSupported' => ['type' => 'EpidSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'KTypeSupported' => ['type' => 'KTypeSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductRequiredEnabled' => ['type' => 'ProductRequiredEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsAcceptedValues' => ['type' => 'DomesticReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsAcceptedValues' => ['type' => 'InternationalReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsDurationValues' => ['type' => 'DomesticReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsDurationValues' => ['type' => 'InternationalReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsShipmentPayeeValues' => ['type' => 'DomesticReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsShipmentPayeeValues' => ['type' => 'InternationalReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticRefundMethodValues' => ['type' => 'DomesticRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'InternationalRefundMethodValues' => ['type' => 'InternationalRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyDescriptionEnabled' => ['type' => 'ReturnPolicyDescriptionEnabledDefinitionType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "function install() {\n\t\tsafe_query('DELETE FROM '.safe_pfx('txp_prefs').' WHERE name LIKE \"wlk_phsb_%\"');\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_notifications_instant',val = '1',type = '1',event = 'wlk_phsb',html = 'yesnoradio',position = '10',user_name = ''\");\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_endpoints',val = '\".implode(\"\\n\", $this->vars['endpoints']).\"',type = '1',event = 'wlk_phsb',html = 'wlk_phsb_textarea',position = '60',user_name = ''\");\n\t}", "function addWPActions ()\n\t{\n\t\t//Frontend\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontendEnqueues' ), 1 );\n\t\tadd_shortcode( 'imperial-document-upload', array( $this, 'drawDocumentUploadShortcode' ) );\n\t\t\n\n\t}", "public static function init() {\n\t\tadd_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );\n\t\tadd_action( 'wp_ajax_wprm_wpurp_nutrition', array( __CLASS__, 'ajax_wpurp_nutrition' ) );\n\t}", "function insta_f_install(){\n}", "private function add_hooks(){\n\t\n\t\tadd_action( 'plugin_action_links_' . UCLACOMPONENTSWP_PLUGIN_BASE, array( $this, 'add_plugin_action_link' ), 20 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts_and_styles' ), 20 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_public_scripts_and_styles' ), 20 );\n\t\n\t}", "function initialize() {\n \t$this->addon = $this->slplus->addon( 'power' );\n $this->settings = new SLP_Settings( array(\n 'name' => SLPLUS_NAME . ' - ' . __( 'Pages' , 'slp-power' ),\n 'form_action' => admin_url() . 'admin.php?page=slp-pages'\n ) );\n SLP_Power_Text_Pages_Tab::get_instance();\n }", "function wpt_install(){\n //Nothing to say for this version\n}", "function __construct() {\n\t\tadd_action( 'oxygen_enqueue_scripts', \tarray( $this, 'enqueue_script' ) );\n\t\tadd_action( 'admin_menu', \t\t\t\tarray( $this, 'add_typekit_page' ) );\n\t\tadd_action( 'ct_builder_ng_init', \t\tarray( $this, 'init_typekit' ) );\n\t}", "function getAWTPSI(){\n if ($this->wtps == NULL){\n if ($this->wtpsiusecpny == 1){\n $this->wtps = TAWTPSI::objectFactory(array('wsdl'=>$this->wtpsiwsdl,\n 'cpnylogin'=>1,\n 'username'=>$this->wtpsiusername,\n 'userpassword'=>$this->wtpsixmlpasswd,\n 'wtplogin'=>$this->wtpsiwtplogin,\n 'wtpusername'=>$this->wtpsicontactuser,\n 'wtppassword'=>$this->wtpsicontactpasswd\n ));\n } else {\n $this->wtps = TAWTPSI::objectFactory(array('user'=>$this->wtpsiwtplogin,\n 'pwd'=>$this->wtpsicontactpasswd,\n 'wsdl'=>$this->wtpsiwsdl));\n }\n }\n return $this->wtps;\n }", "function __construct() {\n add_action( 'init', array( __CLASS__, 'load_plugin_textdomain' ), -1 );\n\n if ( version_compare( phpversion(), '5.6', '<' ) ) {\n add_action( 'admin_notices', array( $this, 'php_version_notice' ) );\n return;\n }\n\n if ( version_compare( WC_VERSION, '2.7', '<' ) ) {\n add_action( 'admin_notices', array( $this, 'wc_version_notice' ) );\n return;\n }\n\n $this->includes();\n\n add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 999 );\n add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_script' ), 999 );\n add_action( 'init', array( $this, 'extended_functions' ) );\n }", "function utcw_init() {\n\twp_enqueue_script('utcw-js');\n\twp_enqueue_style('utcw-css');\n\t\n\tadd_shortcode('utcw', 'do_utcw_shortcode');\n}", "public function __construct()\n\t{\n\t\tadd_shortcode('Opening_hours', array($this, 'Opening_hours_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_table', array($this, 'Opening_hours_table_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_alert', array($this, 'Opening_hours_alert_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_clock', array($this, 'Opening_hours_clock_fct') ); // link new function to shortcode name\n\t}", "public function __construct() {\n\n $this->admin_notices = array();\n add_action('admin_notices', array($this, 'notices_callback'));\n if (!$this->check_dependencies()) {\n return false;\n }\n\n // Initialize Addon\n add_action('init', array($this, 'init'), 90);\n\n add_action('wp_enqueue_scripts', array($this, 'front_style_scripts'), 92);\n \n add_filter('script_loader_tag', array($this, 'add_id_to_script'), 10, 3);\n\n $this->load_files();\n }", "private function define_public_hooks() {\n\n\t\t$plugin_public = new APS_Public( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_public, 'load_helpers' );\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );\n\t\t$this->loader->add_filter( 'woocommerce_locate_template', $plugin_public, 'woocommerce_override_template', 1, 3 );\n\t}", "private function share_extensions() {\n// $fsext->name = 'btn_campos';\n// $fsext->from = __CLASS__;\n// $fsext->to = 'ventas_cliente';\n// $fsext->params = '&back=ventas_cliente';\n// $fsext->type = 'tab';\n// $fsext->text = '<span class=\"glyphicon glyphicon-list-alt\" aria-hidden=\"true\"></span>'\n// . '<span class=\"hidden-xs\">&nbsp; Campos</span>';\n// $fsext->save();\n }", "function ciniki_web_sliderAdd(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'name'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Name'), \n 'size'=>array('required'=>'no', 'default'=>'medium', 'blank'=>'no', 'name'=>'Size'), \n 'effect'=>array('required'=>'no', 'default'=>'slide', 'blank'=>'yes', 'name'=>'Effect'), \n 'speed'=>array('required'=>'no', 'default'=>'medium', 'blank'=>'yes', 'name'=>'Speed'), \n 'resize'=>array('required'=>'no', 'default'=>'cropped', 'blank'=>'yes', 'name'=>'Resize'), \n 'image_offset'=>array('required'=>'no', 'default'=>'middle-center', 'blank'=>'yes', 'name'=>'Position'), \n 'images'=>array('required'=>'no', 'default'=>'', 'blank'=>'yes', 'type'=>'idlist', 'name'=>'Images'),\n 'modules'=>array('required'=>'no', 'default'=>'', 'blank'=>'yes', 'name'=>'Modules'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'checkAccess');\n $rc = ciniki_web_checkAccess($ciniki, $args['tnid'], 'ciniki.web.sliderAdd'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.web');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Add the slider to the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.web.slider', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $slider_id = $rc['id'];\n\n $rsp = array('stat'=>'ok', 'id'=>$slider_id);\n\n //\n // Add the images\n //\n if( isset($args['images']) && is_array($args['images']) ) {\n $rsp['images'] = array();\n $sequence = 1;\n foreach($args['images'] as $image_id) {\n $i_args = array(\n 'slider_id'=>$slider_id,\n 'image_id'=>$image_id,\n 'sequence'=>$sequence++,\n 'caption'=>'',\n 'object'=>'',\n 'object_id'=>'',\n 'url'=>'',\n 'image_offset'=>$args['image_offset'],\n 'overlay'=>'',\n 'overlay_position'=>'',\n 'start_date'=>'',\n 'end_date'=>'',\n );\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.web.slider_image', $i_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['images'][] = array('image'=>array('id'=>$rc['id'], 'image_id'=>$image_id));\n }\n }\n\n //\n // Commit the changes to the database\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.web');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'web');\n\n return $rsp;\n}", "public function addons_page_init() {\n\t\tregister_setting(\n\t\t\t'git_updater_addons',\n\t\t\t'git_updater_addons_settings',\n\t\t\t[ $this, 'sanitize' ]\n\t\t);\n\n\t\tadd_settings_section(\n\t\t\t'addons',\n\t\t\tesc_html__( 'API Add-Ons', 'git-updater' ),\n\t\t\t[ $this, 'insert_cards' ],\n\t\t\t'git_updater_addons_settings'\n\t\t);\n\t}", "public function __construct() {\n\n\t\tadd_action( 'it_exchange_register_addons', array( $this, 'register_addon' ) );\n\t\tadd_action( 'template_redirect', array( $this, 'update_user_history' ) );\n\t\tadd_action( 'it_exchange_generate_transaction_object', array( $this, 'update_transaction_object') );\n\t\tadd_action( 'it_exchange_add_transaction_success', array( $this, 'save_user_history' ), 9 );\n\n\t\t// Uncomment the following action to enable devmode\n\t\t// add_action( 'get_header', array( $this, 'devmode' ) );\n\n\t}", "public function init()\n {\n $this->wxService = new WxService();\n parent::init();\n }", "function getAllAddOnTools(){\n\t $url = urlize();\n\t $url = substr($url,0,strpos($url,'index.php'));\n\t $url .= 'jukebox/jukeboxes/junctionbox/?id=';\n\t return ' - <a href=\"'.htmlentities($url).'\" target=\"_BLANK\"> [Click to open]</a>';\n\t}", "abstract public function getTypoScriptSetup() ;", "function amt_wsc_team_install(){\n}", "function ww_taxonomies_addon($addons){\n $addons['Taxonomies'] = new WW_Taxonomies();\n return $addons;\n}", "public function defaultAddons(){\n\t $this->addRule('oid.pen', function($in){\n\t \t $tok = '1.3.6.1.4.1';\n\t\t $tl = strlen($tok);\n\t\t $l = strlen($in);\n\t \t $r = valFormats::is($in,'oid'); \n\t \t return (false !== $r && $tok === substr($in,0,$tl) && $l > $tl) ? true : false;\n\t });\n\t \n\t $this->addRule('oid.weid', function($in){\n\t \t $tok = '1.3.6.1.4.1.37553.8';\n\t \t $r = valFormats::is($in,'oid'); \n\t \t return (false !== $r && $tok === substr($in,0,strlen($tok))) ? true : false;\n\t });\t\n\t \n\t $this->addRule('impolite', function($in){\n\t \t return (preg_match(\"/porn|fucker|sex|asshole/i\", $in)) ? true : false;\n\t });\t\n\t \n\t \n\t /**\n\t * german aliasis\n\t */\n\t $this->addRule('ungerade', function($in){\n\t \t return valFormats::create()->is($in, 'odd');\n\t });\t \t \n\n\t $this->addRule('gerade', function($in){\n\t \t return valFormats::create()->is($in, 'even');\n\t });\n\t \n\n\t $this->addRule('primzahl', function($in){\n\t \t return valFormats::create()->is($in, 'prime');\n\t });\t\n\t \n\t return $this;\t\t \t\t \t\n }", "public function extensions();", "function gsCustomPageExtensions() {\r\n /* Load Langauge Files */\r\n $langDir = dirname(plugin_basename(__FILE__)) . '/lang';\r\n load_plugin_textdomain('custom-page-extensions', false, $langDir, $langDir);\r\n\r\n /* Set the plugin name to use the selected language. */\r\n $this->pluginName = __('Custom Page Extensions', 'custom-page-extensions');\r\n\r\n global $wp_rewrite;\r\n\r\n /* Plugin paths */\r\n $this->pluginPath = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));\r\n $this->pluginURL = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));\r\n\r\n // Get the extension.\r\n $this->load_settings();\r\n\r\n /* Add Options Pages and Links */\r\n add_action('admin_menu', array(&$this, 'admin_menu'));\r\n add_action('admin_init', array(&$this, 'admin_init'));\r\n add_action('update_option_' . $this->optionsName, array(&$this, 'update_option'), 10);\r\n add_action('wp_loaded', array(&$this, 'flush_rules'));\r\n\r\n add_filter('plugin_action_links', array(&$this, \"plugin_action_links\"), 10, 2);\r\n add_filter('user_trailingslashit', array(&$this, 'no_page_slash'), 66, 2);\r\n }", "function wrmp_install()\n{\n\tglobal $lang;\n\n\tif(!$lang->wrmp)\n\t{\n\t\t$lang->load('wrmp');\n\t}\n\n\tif(!class_exists('WildcardPluginInstaller'))\n\t{\n\t\trequire_once MYBB_ROOT . 'inc/plugins/wrmp/classes/installer.php';\n\t}\n\t$installer = new WildcardPluginInstaller(MYBB_ROOT . 'inc/plugins/wrmp/install_data.php');\n\t$installer->install();\n}", "public function __construct()\n {\n include_once plugin_dir_path( __FILE__ ).'/newsletter.php';\n new Gd_Newsletter();\n\n register_activation_hook(__FILE__, array('Gd_Newsletter', 'install_newsletter'));\n\n register_uninstall_hook(__FILE__, array('Gd_Newsletter', 'uninstall_newsletter'));\n\n add_action('admin_menu', array($this, 'add_admin_menu'));\n\n if(!is_admin()){\n add_action('wp_enqueue_scripts', array($this, 'info_lettreCSS'),15);\n add_action('wp_enqueue_scripts', array($this, 'info_lettreJS'),15);\n }\n }", "function pum_eip_init() {\n\tif ( ! class_exists( 'PUM_Extension_Activator' ) ) {\n\t\trequire_once 'includes/pum-sdk/class-pum-extension-activator.php';\n\t}\n\n\t$activator = new PUM_Extension_Activator( 'PUM_EIP' );\n\t$activator->run();\n}", "function cal_install()\n{\n register_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings');\n register_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post');\n}", "private function init_hooks() {\n\n register_activation_hook( __FILE__, array( 'IWJ_Install', 'install' ) );\n register_deactivation_hook( __FILE__, array('IWJ_Install', 'deactive') );\n\n add_action('plugins_loaded', array('IWJ_Install', 'update'));\n add_action('wp_loaded', array('IWJ_Install', 'update2'));\n\n add_action( 'wpmu_new_blog', array( 'IWJ_Install', 'new_blog' ), 10, 6 );\n add_action( 'delete_blog', array( 'IWJ_Install', 'delete_blog' ), 10, 2 );\n\n add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );\n add_action( 'init', array( $this, 'init' ), 0 );\n\n add_action('wp_logout', array($this, 'end_session'));\n add_action('wp_login', array($this, 'end_session'));\n\n //add_action('activated_plugin',array($this, 'active_plugin_error'));\n }", "public function __construct() {\n\t\tadd_action( 'wprm_premium_init', array( $this, 'init' ) );\n\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new Soisy_Pagamento_Rateale_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n $this->loader->add_filter( 'woocommerce_payment_gateways', $plugin_admin, 'payment_methods' );\n\t\t\n $this->loader->add_filter( 'soisy_settings', $plugin_admin, 'soisy_vars' );\n\t\t\n\t\t$this->loader->add_filter('plugin_action_links', $plugin_admin,'add_soisy_action_links', 10, 2);\n\t\t\n\t\t/*\n\t\t * Payments Gateways extend WC_Payment_Gateway\n\t\t * To have them work properly they must be hooked to 'plugins_loaded'\n\t\t */\n add_action( 'plugins_loaded', 'init_Soisy_Pagamento_Rateale_Gateway_Settings');\n\t}", "function __construct() {\n add_action( 'init', array( $this, 'dt_icon_list' ) );\n \n // Use this when creating a shortcode addon\n add_shortcode( 'dt_icon_list', array( $this, 'dt_icon_list_rander' ) );\n\n // Register CSS and JS\n add_action( 'wp_enqueue_scripts', array( $this, 'dt_icon_list_loadCssAndJs' ) );\n }", "static function init(){\n\t\t\n\t\tinclude WPAFFILIATES_DIR . '/classes/woocommerce_handler.php'; //including woocommmerce hanlder\n\t\tLinkRewriterWithWoocommerce::init();\n\t\t\n\t\t\n\t\tinclude WPAFFILIATES_DIR . '/classes/local_link_handler.php';\n\t\tLinkRewriterLocalLinks::init();\n\t\t \t\t\n\t\t\n\t\tself::populate_affiliates_options(); //populates parameters from affiliates_for_parameters.php\t\n\t\tadd_action('admin_menu', array(get_class(), 'admin_menu_for_wp_link_rewriter')); //add amdin menu\n\t\t\t\n\t\tadd_action('add_meta_boxes', array(get_class(), 'metabox_at_post_edit_page'));\t//add a metabox in post editing page\n\t\tadd_action('save_post', array(get_class(), 'save_metabox_data'), 10, 1); //save metabox info\n\t\t\n\t\t\n\t}", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "function __construct(){\n\t\tadd_action('init', array($this, 'stockIntegrateWithVC'));\n\t}", "public static function init()\n\t{\n\t\t$classname = get_called_class();\n\n\t\t// register our shortcode and its handler\n\t\tadd_shortcode( self::SHORTCODE_TAG, array( $classname, 'shortcodeHandler' ) );\n\n\t\t// Shortcode UI, if supported\n\t\tadd_action(\n\t\t\t'register_shortcode_ui',\n\t\t\tarray( $classname, 'shortcodeUI' ),\n\t\t\t5,\n\t\t\t0\n\t\t);\n\n\t\tif ( ! is_admin() ) {\n\t\t\t// unhook the WordPress Core oEmbed handler\n\t\t\twp_oembed_remove_provider( static::OEMBED_CORE_REGEX );\n\t\t\t// pass a Tweet detail URL through the Tweet shortcode handler\n\t\t\twp_embed_register_handler(\n\t\t\t\tself::SHORTCODE_TAG,\n\t\t\t\tstatic::URL_REGEX,\n\t\t\t\tarray( $classname, 'linkHandler' ),\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t}", "public function __construct() {\n\t\tif ( defined( 'APS_VERSION' ) ) {\n\t\t\t$this->version = APS_VERSION;\n\t\t} else {\n\t\t\t$this->version = '1.0.0';\n\t\t}\n\t\t$this->plugin_name = APS_NAME;\n\n\t\t$this->load_dependencies();\n\t\t$this->set_locale();\n\t\t$this->define_admin_hooks();\n\t\t$this->load_aps_gateway();\n\t\t$this->load_ajax_routes();\n\t\t$this->load_wc_hooks();\n\t\t$this->define_public_hooks();\n\t}", "abstract protected function getTypoScriptSetup();", "function add_support_script_frontend(){\n}", "function ihc_initiate_plugin(){\n\t/*\n\t * @param none\n\t * @return none\n\t */\n\n\t/// IF PHP >5.3 don't activate plugin\n\tif (defined('PHP_VERSION') && version_compare(PHP_VERSION, 5.3, '<')){\n\t\tdeactivate_plugins(plugin_basename( __FILE__ ));\n\t\tdie('Ultimate Membership Pro requires PHP version greater than 5.3, Your current PHP is v.' . PHP_VERSION . ' . Update Your PHP and try again!');\n\t}\n\n\trequire_once IHC_PATH . 'classes/Ihc_Db.class.php';\n\tIhc_Db::add_new_role();\n\tIhc_Db::save_settings_into_db();\n\tIhc_Db::create_tables();\n\tIhc_Db::create_notifications();\n\tIhc_Db::create_default_pages();\n\tIhc_Db::create_default_redirects();\n\tIhc_Db::create_extra_redirects();\n\tIhc_Db::create_default_lockers();\n\tIhc_Db::create_demo_levels();\n\n\t$WPMLActions = new \\Indeed\\Ihc\\WPMLActions();\n\t$WPMLActions->registerNotifications();\n\t$WPMLActions->registerTaxes();\n}", "function __construct() \n {\n $this->plugin_path = plugin_dir_path( __FILE__ ); // has trailing /\n $this->plugin_url = plugin_dir_url( __FILE__ );\n // Set up activation hooks\n register_activation_hook( __FILE__, array(&$this, 'activate') );\n register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );\n // Set up l10n\n // load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );\n\n add_action( 'wp_enqueue_scripts', array( $this, 'queScripts'));\n \n add_action('admin_init', array( $this, 'adminInit'));\n add_action('admin_menu', array( $this, 'addMenu'));\n \n // Add your own hooks/filters\n add_action( 'init', array( $this, 'init') );\n add_filter( 'eStore_below_cart_checkout_filter', array( $this, 'addBeanstreamButton'));\n }", "public function __construct()\n {\n add_action('admin_menu', array($this, 'add_plugin_page'));\n add_action('admin_init', array($this, 'page_init'));\n add_filter('cron_schedules', array($this, 'filter_cron_schedules'));\n register_activation_hook(__FILE__, array($this, 'plugin_activate'));\n register_deactivation_hook(__FILE__, array($this, 'plugin_deactivate'));\n }", "public function init() {\r\n\r\n // Check WooLentor Free version\r\n if( !is_plugin_active('woolentor-addons/woolentor_addons_elementor.php') ){\r\n add_action( 'admin_notices', [ $this, 'admin_notice_missing_main_plugin' ] );\r\n return;\r\n }\r\n\r\n // Include File\r\n $this->include_files();\r\n\r\n // After Active Plugin then redirect to setting page\r\n $this->plugin_redirect_option_page();\r\n\r\n }", "function __construct(){\n\t\t$this->add_hooks();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t\n\t\t$this->extension = new AtomicOperationsExtension();\n\t\t$this->applyExtension($this->extension);\n\t}", "function init() {\n\n if( !current_user_can( self::$capability ) ) {\n return;\n }\n\n //** Add Inquiry page to Property Settings page array */\n add_filter( 'wpp_settings_nav', array( &$this, 'settings_nav' ) );\n\n //** Add Settings Page */\n add_action( 'wpp_settings_content_admin_tools', array( &$this, 'settings_page' ) );\n\n //** Contextual Help */\n add_action( 'property_page_property_settings_help', array( &$this, 'wpp_contextual_help' ) );\n\n }", "function __construct()\n {\n $this->reqAdminToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyAdminsCanTagTalks', 'false')->getKey('value'));\n $this->reqCreatorToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyTagCreatorsCanEditTalkTags', 'true')->getKey('value'));\n return parent::__construct();\n }", "function __construct() \n\t{\n\t\tparent::__construct();\n\n\t\t$this->attributes['id']\t\t= $this->createID('KOPERASI');\n\n\t\tif(isset($this->ext_appends))\n\t\t{\n\t\t\t$this->appends \t\t\t= array_merge($this->appends, $this->ext_appends);\n\t\t}\n\n\t}", "static public function init()\n {\n // Set up language\n load_plugin_textdomain( 'wordpress-file-monitor-plus', false, dirname( plugin_basename( SC_WPFMP_PLUGIN_FILE ) ) . '/languages/' );\n\n // Deal with activation and deactivation\n register_activation_hook( SC_WPFMP_PLUGIN_FILE, array( __CLASS__, 'activate' ) );\n register_deactivation_hook( SC_WPFMP_PLUGIN_FILE, array( __CLASS__, 'deactive' ) );\n\n // Create and/or setup actions\n add_action( 'init', array( __CLASS__, 'external_cron_run_check' ) ); // Add a check for external cron trigger\n add_action( 'admin_notices', array( __CLASS__, 'admin_alert' ) ); // Admin alert show in dashboard\n add_action( self::$cron_name, array( __CLASS__, 'scan' ) ); // Create a hook for scanning\n add_action( 'sc_wpfmp_enable_wp_cron', array( __CLASS__, 'enable_cron' ) ); // Create a hook for enabling WPFMP cron\n add_action( 'sc_wpfmp_disable_wp_cron', array( __CLASS__, 'disable_cron' ) ); // Create a hook for disabling WPFMP cron\n add_action( 'sc_wpfmp_send_notify_email', array( __CLASS__, 'send_notify_email' ) ); // Create a hook for sending alert email\n\n // Create Plugin Filters\n add_filter('sc_wpfmp_format_file_modified_time', array(__CLASS__, 'format_file_modified_time'), 10, 2); // Create filter for formatting the file modified time\n }", "function SetupOtherOptions() {\n\t\tglobal $Language, $Security;\n\t\t$options = &$this->OtherOptions;\n\t\t$option = $options[\"addedit\"];\n\n\t\t// Add\n\t\t$item = &$option->Add(\"add\");\n\t\t$addcaption = ew_HtmlTitle($Language->Phrase(\"AddLink\"));\n\t\t$item->Body = \"<a class=\\\"ewAddEdit ewAdd\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . ew_HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->Phrase(\"AddLink\") . \"</a>\";\n\t\t$item->Visible = ($this->AddUrl <> \"\" && $Security->CanAdd());\n\t\t$option = $options[\"detail\"];\n\t\t$DetailTableLink = \"\";\n\t\t$item = &$option->Add(\"detailadd_avaluo\");\n\t\t$url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . \"=avaluo\");\n\t\t$caption = $Language->Phrase(\"Add\") . \"&nbsp;\" . $this->TableCaption() . \"/\" . $GLOBALS[\"avaluo\"]->TableCaption();\n\t\t$item->Body = \"<a class=\\\"ewDetailAddGroup ewDetailAdd\\\" title=\\\"\" . ew_HtmlTitle($caption) . \"\\\" data-caption=\\\"\" . ew_HtmlTitle($caption) . \"\\\" href=\\\"\" . ew_HtmlEncode($url) . \"\\\">\" . $caption . \"</a>\";\n\t\t$item->Visible = ($GLOBALS[\"avaluo\"]->DetailAdd && $Security->AllowAdd(CurrentProjectID() . 'avaluo') && $Security->CanAdd());\n\t\tif ($item->Visible) {\n\t\t\tif ($DetailTableLink <> \"\") $DetailTableLink .= \",\";\n\t\t\t$DetailTableLink .= \"avaluo\";\n\t\t}\n\n\t\t// Add multiple details\n\t\tif ($this->ShowMultipleDetails) {\n\t\t\t$item = &$option->Add(\"detailsadd\");\n\t\t\t$url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . \"=\" . $DetailTableLink);\n\t\t\t$caption = $Language->Phrase(\"AddMasterDetailLink\");\n\t\t\t$item->Body = \"<a class=\\\"ewDetailAddGroup ewDetailAdd\\\" title=\\\"\" . ew_HtmlTitle($caption) . \"\\\" data-caption=\\\"\" . ew_HtmlTitle($caption) . \"\\\" href=\\\"\" . ew_HtmlEncode($url) . \"\\\">\" . $caption . \"</a>\";\n\t\t\t$item->Visible = ($DetailTableLink <> \"\" && $Security->CanAdd());\n\n\t\t\t// Hide single master/detail items\n\t\t\t$ar = explode(\",\", $DetailTableLink);\n\t\t\t$cnt = count($ar);\n\t\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t\tif ($item = &$option->GetItem(\"detailadd_\" . $ar[$i]))\n\t\t\t\t\t$item->Visible = FALSE;\n\t\t\t}\n\t\t}\n\t\t$option = $options[\"action\"];\n\n\t\t// Set up options default\n\t\tforeach ($options as &$option) {\n\t\t\t$option->UseImageAndText = TRUE;\n\t\t\t$option->UseDropDownButton = TRUE;\n\t\t\t$option->UseButtonGroup = TRUE;\n\t\t\t$option->ButtonClass = \"btn-sm\"; // Class for button group\n\t\t\t$item = &$option->Add($option->GroupOptionName);\n\t\t\t$item->Body = \"\";\n\t\t\t$item->Visible = FALSE;\n\t\t}\n\t\t$options[\"addedit\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonAddEdit\");\n\t\t$options[\"detail\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonDetails\");\n\t\t$options[\"action\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonActions\");\n\n\t\t// Filter button\n\t\t$item = &$this->FilterOptions->Add(\"savecurrentfilter\");\n\t\t$item->Body = \"<a class=\\\"ewSaveFilter\\\" data-form=\\\"fsolicitudlistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"SaveCurrentFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$item = &$this->FilterOptions->Add(\"deletefilter\");\n\t\t$item->Body = \"<a class=\\\"ewDeleteFilter\\\" data-form=\\\"fsolicitudlistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"DeleteFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$this->FilterOptions->UseDropDownButton = TRUE;\n\t\t$this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton;\n\t\t$this->FilterOptions->DropDownButtonPhrase = $Language->Phrase(\"Filters\");\n\n\t\t// Add group option item\n\t\t$item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\t}", "protected function init(){\r\n\t\t\r\n\t\tparent::init();\r\n\t\t\r\n\t\t$this->typeName = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR_TEMPLATE;\r\n\t\t\t\t\r\n\t\t$this->isBasicType = false;\r\n\t\t$this->layoutTypeForCategory = $this->typeName;\r\n\t\t$this->displayType = self::DISPLAYTYPE_MANAGER;\r\n\t\t\r\n\t\t$this->allowDuplicateTitle = false;\r\n\t\t$this->defaultBlankTemplate = false;\r\n\t\t\r\n\t\t$this->allowWebCatalog = false;\r\n\t\t$this->allowManagerWebCatalog = false;\r\n\t\t$this->showDescriptionField = false;\r\n\t\t\r\n\t\t$this->allowNoCategory = false;\r\n\t\t$this->defaultCatTitle = __(\"Main\", \"unlimited_elements\");\r\n\t\t\r\n\t\t$this->postType = GlobalsUnlimitedElements::POSTTYPE_UNLIMITED_ELEMENS_LIBRARY;\r\n\t\t$this->isBloxPage = false;\r\n\t\t\r\n\t\t//$this->catalogKey = \"addons\";\r\n\t\t//$this->arrCatalogExcludeCats = array(\"basic\");\r\n\t\t\r\n\t\t$this->textPlural = __(\"Templates\", \"unlimited_elements\");\r\n\t\t$this->textSingle = __(\"Template\", \"unlimited_elements\");\r\n\t\t$this->textShowType = __(\"Elementor Template\", \"unlimited_elements\");\r\n\t\t\r\n\t\t$this->browser_textBuy = esc_html__(\"Activate Plugin\", \"unlimited_elements\");\r\n\t\t$this->browser_textHoverPro = __(\"This template is available<br>when the plugin is activated.\", \"unlimited_elements\");\r\n\t\t\r\n\t\t$urlLicense = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR);\t\t\r\n\t\t$this->browser_urlBuyPro = $urlLicense;\r\n\t\t\r\n\t\t$responseAssets = UniteProviderFunctionsUC::setAssetsPath(\"ac_assets\", true);\r\n\t\t\r\n\t\t$this->pathAssets = $responseAssets[\"path_assets\"];\r\n\t\t$this->urlAssets = $responseAssets[\"url_assets\"];\r\n\t\t\r\n\t\t$this->addonView_urlBack = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_TEMPLATES_ELEMENTOR);\r\n\t\t\r\n\t\t\r\n\t}", "public static function _register()\n {\n self::assignElements([\n 'SKU' => ['type' => 'SKUType', 'xmlns' => self::XMLNS],\n 'StartPrice' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'Quantity' => ['type' => 'int'],\n 'VariationSpecifics' => ['type' => 'NameValueListArrayType', 'xmlns' => self::XMLNS],\n 'UnitsAvailable' => ['type' => 'int'],\n 'UnitCost' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'SellingStatus' => ['type' => 'SellingStatusType', 'xmlns' => self::XMLNS],\n 'VariationTitle' => [],\n 'VariationViewItemURL' => [],\n 'Delete' => ['type' => 'bool'],\n 'SellingManagerProductInventoryStatus' => ['type' => 'SellingManagerProductInventoryStatusType', 'xmlns' => self::XMLNS],\n 'WatchCount' => ['type' => 'int'],\n 'PrivateNotes' => [],\n 'DiscountPriceInfo' => ['type' => 'DiscountPriceInfoType', 'xmlns' => self::XMLNS],\n 'VariationProductListingDetails' => ['type' => 'VariationProductListingDetailsType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "public function activate_extension()\n\t{\n\n\t $data = array(\n\t 'class' => __CLASS__,\n\t 'method' => 'template_types',\n\t 'hook' => 'template_types',\n\t 'settings' => serialize($this->settings),\n\t 'priority' => 10,\n\t 'version' => $this->version,\n\t 'enabled' => 'y'\n\t );\t\n\t ee()->db->insert('extensions', $data);\n\t \n\t}", "public function __construct() {\n\n\t\t$this->plxAdmin = new plxAdmin(PLX_CONF);\n\n\t\t$this->checkVersions();\n\t\t$this->getUpdateList();\n\t}", "public function __construct() {\r\n\t\t\tadd_action( 'admin_notices', array($this, 'prosperity') );\r\n\t\t\tadd_action( 'admin_head', array($this, 'prosperity_css') );\t\t\t\r\n\t\t\tadd_shortcode( 'Prosperity', array($this, 'Prosperity_Handler') );\r\n\t\t\tadd_action( 'admin_menu', array($this, 'add_Prosperity_menu') );\r\n\t\t\tadd_action('widgets_init', array($this, 'RegisterProsperityWidget') );\r\n\t\t\tadd_filter('plugin_row_meta', array($this, 'create_prosperity_plugin_links'), 10, 2);\t\t\t\r\n\t\t}", "function wpms_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'wpms_classifieds_build_permissions' );\n//\tif (isset($_GET['page']) && $_GET['page'] == 'settings_page_wp-multilingual-slider') {\n// \t add_action('admin_init', 'wpms_register');\n//\t}\n\tadd_action('admin_init', 'wpms_init');\n\tadd_action('admin_init', 'wpms_register_mysettings');\n\tadd_action('admin_menu', 'wpms_home_create_menu');\n//\tload_plugin_textdomain( 'wp-multilingual-slider', 'wp-content/plugins/wp-multilingual-slider/languages/');\n}", "function __construct() {\n self::add_extension();\n self::require_php_api();\n self::define_globals();\n self::require_subclasses();\n }", "function upgrade_addWebservicesFeature()\r\n{\r\n global $_TABLES;\r\n\r\n $ft_id = DB_getItem($_TABLES['features'], 'ft_id',\r\n \"ft_name = 'webservices.atompub'\");\r\n $grp_id = DB_getItem($_TABLES['groups'], 'grp_id',\r\n \"grp_name = 'Webservices Users'\");\r\n $rootgrp = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Root'\");\r\n\r\n if (($grp_id > 0) && ($ft_id > 0)) {\r\n // add 'webservices.atompub' feature to 'Webservices Users' group\r\n DB_query(\"INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $grp_id)\");\r\n\r\n // make 'Root' members a member of 'Webservices Users'\r\n if ($rootgrp > 0) {\r\n DB_query(\"INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES ($grp_id, NULL, $rootgrp)\");\r\n }\r\n }\r\n}", "public function __construct() {\n\n parent::__construct();\n\n add_action( 'wpp_settings_help_tab', array( $this, 'help_tab' ), 10, 4 );\n\n add_action( 'wp_ajax_wpp_export_properties', array( $this, 'wpp_export_properties' ) );\n add_action( 'wp_ajax_nopriv_wpp_export_properties', array( $this, 'wpp_export_properties' ) );\n\n /** May be export properties to CSV file */\n add_action( \"template_redirect\", array( $this, 'maybe_export_properties_to_scv' ) );\n\n }", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('WarehouseManagement');\n\n\t\t$m->addHook('Page(pw_template=whse-find-item)::printableUrl', function($event) {\n\t\t\t$event->return = self::printableUrl($event->arguments(0));\n\t\t});\n\t}", "protected function registerExtDirectComponents() {}", "public function __construct() {\n\n\t\tif ( ! doing_action( 'plugins_loaded' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->version = mktime( 0, 0, 0, 1, 7, 2016 );\n\n\t\t$this->load_method_class();\n\n\t\tadd_filter( 'woocommerce_shipping_methods', array( $this, 'register_method' ) );\n\n\t\tadd_action( 'init', array( $this, 'setup_i18n' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'load_admin_scripts' ) );\n\t\tadd_action( 'wp_ajax_get_new_layer', array( $this, 'add_layer' ) );\n\t\tadd_action( 'wp_ajax_get_new_configuration_layer', array( $this, 'add_configuration' ) );\n\n\t}", "public function __construct(){\n $this->__classname = get_class($this); \n $this->_methods['default'] = $this->__classname.\"Init\";\n $this->registerMethodAlias(\"createUrl\", array(\"Vimerito\", \"createUrl\"));\n $this->registerMethodAlias(\"loadJsLibrary\", array(\"VLayout\", \"registerUserJavaScriptLibraries\"));\n }", "private function define_public_hooks() {\n\t\t\n\t\t$plugin_public = new Soisy_Pagamento_Rateale_Public( $this->get_plugin_name(), $this->get_version() );\n\t\t\n\t\t\n\t\t$this->loader->add_action( 'woocommerce_before_cart_table', $plugin_public, 'updated_cart' );\n\t\t$this->loader->add_action( 'woocommerce_before_checkout_form', $plugin_public, 'updated_cart' );\n\t\t//$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'wp_footer', $plugin_public, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'wp', $plugin_public, 'soisy_available' , 10);\n\t\t$this->loader->add_action( 'init', $plugin_public, 'shortcodes' , 10);\n\t\t$this->loader->add_filter( 'soisy_settings', $plugin_public, 'get_options',99);\n\t\t$this->loader->add_action( 'wp', $plugin_public, 'init_soisy_widget' );\n\t\t$this->loader->add_action( 'woocommerce_before_single_product', $plugin_public, 'product_hooks' );\n\t\t//$this->loader->add_action( 'woocommerce_before_main_content', $plugin_public, 'product_hooks' );\n\t\t$this->loader->add_action( 'woocommerce_proceed_to_checkout', $plugin_public, 'checkout_hooks', 1 );\n\t\t$this->loader->add_action( 'woocommerce_review_order_before_order_total', $plugin_public, 'order_review_hooks', 1 );\n\t\t$this->loader->add_action( 'soisy_render_widget', $plugin_public, 'render_widget', 1 );\n\t\t//ajax actions\n\t\t$this->loader->add_action( 'soisy_ajax_order_status', $plugin_public, 'parseRemoteRequest');\n\t\t\n\t}", "function proc($wizardItems)\t{\r\n\t\tglobal $LANG;\r\n\r\n\t\t$LL = $this->includeLocalLang();\r\n\r\n\t\t$wizardItems['plugins_f4luceneworkshop_ui'] = array(\r\n\t\t\t'icon'=>t3lib_extMgm::extRelPath('f4_lucene_workshop').'ui/ce_wiz.gif',\r\n\t\t\t'title'=>$LANG->getLLL('ui_title',$LL),\r\n\t\t\t'description'=>$LANG->getLLL('ui_plus_wiz_description',$LL),\r\n\t\t\t'params'=>'&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=f4_lucene_workshop_ui'\r\n\t\t);\r\n\r\n\t\treturn $wizardItems;\r\n\t}", "public function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'init' ), 100 );\n\t\tadd_action( 'wc_rs_sync', array( $this, 'start' ) );\n\t\tadd_action( 'wp_ajax_wc_rs_import', array( $this, 'import' ) );\n\t\tadd_action( 'wp_ajax_nopriv_wc_rs_import', array( $this, 'import' ) );\n\t}", "function woocommerce_admin_register_extension_scripts() {\n\trequire_once dirname( __FILE__ ) . '/extensions/add-report/add-report.php';\n}", "public function __construct()\n {\n $CSO = new Api_Resources_CSO();\n $CSO->authenticate('timojong', 'FG4d%!k3hU');\n $this->addResource('CSO', $CSO);\n\n $OpenOnderwijs = new Api_Resources_OpenOnderwijs();\n $this->addResource('OpenOnderwijs', $OpenOnderwijs);\n }", "public function setUp(): void\n {\n TaoPhpUnitTestRunner::initTest();\n \\common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem');\n }", "function on_add_extra()\r\n\t{\r\n\t}", "function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}", "public function activate_extension(){}", "function __construct() {\n\n // Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.\n register_activation_hook( __FILE__, array( $this, 'activate' ) );\n \n // MOVE uninstall feature to uninstall.php\n //register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) );\n\n // Register hook executes just before WordPress determines which template page to load\n //add_action( 'template_redirect', array( $this, 'increase_counter_when_home_visited' ) );\n \n // Add extra submenu to the admin panel\n add_action( 'admin_menu', array( $this, 'create_menu_admin_panel' ) );\n \n // Handle POST request, admin_action_($action)\n //add_action( 'admin_action_tk_slideshow_action', array( $this, 'tk_slideshow_admin_action' ) );\n\n add_action( 'admin_post_tk_slideshow_new_action', array( $this, 'tk_slideshow_admin_new_action' ) );\n add_action( 'admin_post_tk_slideshow_edit_action', array( $this, 'tk_slideshow_admin_edit_action' ) );\n \n }", "function wtsadd2caddie($ar){\n $dps = array();\n $dos = array();\n $persByType = array();\n $switchTo = array();\n $p = new XParam($ar, array());\n $oldcaddie = $this->getCaddie();\n $linesid = $p->get('lineid');\n $formparms = array('personpackid', 'validfrom', 'offreoid', 'productoid',\n 'card', 'CHIPID', 'ACCNO', 'CRC', 'assurance',\n 'NEWCARDLabel', 'joursbonus', 'justphotoidentnom',\n 'justphotoidentprenom', 'justphotoident', 'justphotoidentdob',\n 'justetatciv', 'justdomicile', 'justgrp', 'justgrpname','customercard');\n $lineparms = array('validfrom', 'offreoid', 'productoid');\n foreach($formparms as $parm){\n $$parm = $p->get($parm);\n }\n $season = $this->getSeason();\n $lines = array();\n $cptf = 1;\n foreach($linesid as $lineid){\n $id1 = date('dhis').$cptf.uniqid('_');\n $cptf ++;\n $line = array('type'=>'forfait');\n foreach($lineparms as $parm){\n $v = $$parm;\n if (isset($v[$lineid]))\n $line[$parm]=$v[$lineid];\n else\n $line[$parm]=NULL;\n }\n // passage d'options par prog seulement\n if (isset($ar['linesOptions'][$lineid])){\n $line['options'] = $ar['linesOptions'][$lineid];\n }\n // lecture du produit et des produits associés\n if (!isset($dps[$line['productoid']])){\n\t$dps[$line['productoid']] = $this->productInfos($line['productoid'], $line['validfrom']);\n\t// cause est utilisé directement ...\n\t$dpc = $dps[$line['productoid']]['dpc'];\n }\n // lecture des offre (la meme ... ) pour avoir le flash\n if (!isset($dos[$line['offreoid']])){\n $dos[$line['offreoid']] = $this->modcatalog->displayOffre(array('_options'=>array('local'=>true),\n\t\t\t\t\t\t\t\t\t'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t\t\t\t\t\t'offre'=>$line['offreoid'],\n\t\t\t\t\t\t\t\t\t'caddie'=>false)); // le stock importe pas ici\n }\n\n // remplacement du produit si existe (fidelite - voir wtssaisieforfaits)\n if ($this->modcustomer->loyaltyActive()){\n\n // carte du forfait (!! mêmes tests que dessous)\n $rpcard2 = substr($card[$lineid], 0, 8);\n if ($rpcard2 == 'NEWCARD_'){\n $rpwtp['cardoid'] = substr($card[$lineid], 8);\n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n } elseif($card[$lineid] == 'WTPCARD'){\n //$rpnewwtp = strtoupper($CHIPID[$lineid].'-'.$CRC[$lineid].'-'.$ACCNO[$lineid]);\n $rpnewwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n $rpwtp['cardlabel'] = $rpnewwtp;\n $rpwtp['cardoid'] = NULL;\n } elseif(!empty($card[$lineid])){ \n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n $rpwtp['cardoid'] = NULL;\n $rpcardid = $card[$lineid];\n if (isset($oldcaddie['bycards']) && $oldcaddie['bycards'][$rpcardid]['newcard'] !== false){\n $rplineid = $oldcaddie['bycards'][$rpcardid]['newcard'];\n $rpwtp['cardoid'] = $oldcaddie['lines'][$rplineid]['productoid'];\n }\n }\n\n list($loyaltymess, $loyaltyprice, $loyaltyProductOid) = $this->modcustomer->checkLoyaltyReplacementProduct(array('season'=>$season, 'doffre'=>$dos[$line['offreoid']]['doffre'], 'dp'=>$dps[$line['productoid']], 'dpc'=>$dps[$line['productoid']]['dpc'], 'validfrom'=>$line['validfrom'], 'availablesNewCards'=>$dps[$line['productoid']]['availablesNewCards'],'wtp'=>$rpwtp));\n if ($loyaltyProductOid != NULL){\n XLogs::notice(get_class($this), '::wtsadd2caddie replace product '.$line['productoid'].' -> '.$loyaltyProductOid.' '.$loyaltyprice);\n $ldps = $this->productInfos($loyaltyProductOid , $line['validfrom']);\n // on remplace ... \n \n $line['productoid'] = $loyaltyProductOid;\n $dps[$line['productoid']] = $ldps;\n } else {\n XLogs::notice(get_class($this), '::wtsadd2caddie no replacement product '.$line['productoid']);\n }\n }\n // top des des produtis non dates - date si rechargement\n $line['validfrom_hidden'] = 0;\n if ($dps[$line['productoid']]['dpc']['ocalendar']->link['otype']->raw == 'NO-DATE'){\n list($drech, $dnew, $dliv) = $this->getFirstDayNoDate(date('Y-m-d h:i:s'));\n $line['validfrom_hidden'] = 1;\n if ($card[$lineid] == 'WTPCARD'){\n $line['validfrom'] = $drech;\n $line['calendar-NO-DATE'] = 0;\n } else {\n $line['calendar-NO-DATE'] = 1;\n }\n }\n // ajout d'un top flash et de l'id de la vente\n if ($dos[$line['offreoid']]['doffre']['oflash']->raw == 1){\n $line['isflash'] = true;\n foreach($dos[$line['offreoid']]['doffre']['_flash']['ventes'] as $i=>$vente){\n if (in_array($line['validfrom'], $vente['dates'])){\n $line['flashoid'] = $vente['oid'];\n break;\n }\n }\n } else {\n $line['isflash'] = false;\n }\n // ajout de l'id packpersonne et du type de personne (pour la suppression)\n if (isset($personpackid[$lineid])){\n $line['ispersonpack'] = true;\n $line['personpackid'] = $personpackid[$lineid];\n // replacement type de personne suivant composition pack\n $personType = $dps[$line['productoid']]['owtsperson']->raw;\n $persByType[$personType]++;\n if ($dos[$line['offreoid']]['persons'][$personType]->switchTo && $dos[$line['offreoid']]['persons'][$personType]->switchLimit && $persByType[$personType] == $dos[$line['offreoid']]['persons'][$personType]->switchLimit) {\n $personType = $dos[$line['offreoid']]['persons'][$personType]->switchTo;\n if (!isset($switchTo[$personType])) {\n $switchTo[$personType] = selectQuery(\"select WTSCATALOG.koid from WTSCATALOG join WTSCATALOG c2 using (wtsticket) where WTSCATALOG.wtsperson='$personType' and c2.koid='{$line['productoid']}'\")->fetch(PDO::FETCH_COLUMN);\n // lecture du produit et des produits associés\n if (!isset($dps[$switchTo[$personType]])){\n $dps[$switchTo[$personType]] = $this->productInfos($switchTo[$personType], $line['validfrom']);\n // cause est utilisé directement ...\n $dpc = $dps[$switchTo[$personType]]['dpc'];\n }\n }\n $line['productoid'] = $switchTo[$personType];\n }\n $line['wtsperson'] = $personType;\n } else {\n $line['ispersonpack'] = false;\n $line['personpackid'] = NULL;\n $line['wtsperson'] = NULL;\n }\n // ajout des champs issus du produit etc ...\n $line['validtill'] = $this->getValidtill($line['validfrom'], $dps[$line['productoid']], $dps[$line['productoid']]['dpc']);\n $line['price'] = $dps[$line['productoid']]['price']['tariff'];\n $line['label'] = $dps[$line['productoid']]['label'];\n\n // ajout carte du forfait\n $line['cardid'] = $card[$lineid];\n $line['lineid'] = $lineid;\n\n // traitement des justifs (cartes ce/ coupons ..)\n if (isset($dpc['ojustgrps']) && $dpc['ojustgrps']->raw == 1){\n $line['justifgrps'] = $justgrpname[$lineid].' '.$justgrp[$lineid];\n }\n // traitement des pièces justficaves\n if ($dpc['ojustphotoident']->raw == 1 \n && $dps[$line['productoid']]['owtsticket']->link['oduree']->raw >= $dpc['ojustphotonbjour']->raw){\n $needphotoident = true;\n } else {\n $needphotoident = false;\n }\n if (($justphotoidentnom[$lineid] && $justphotoidentprenom[$lineid])\n\t || $justphotoidentdob[$lineid]\n\t || $dpc['ojustetatciv']->raw == 1\n\t || $dpc['ojustdomicile']->raw == 1\n\t || $needphotoident){\n\t$nom = $justphotoidentnom[$lineid];\n\t$prenom = $justphotoidentprenom[$lineid];\n\t$dob = $justphotoidentdob[$lineid];\n\tif ($this->dsjustifs == NULL)\n\t $this->dsjustifs = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableJUSTIFS);\n\t$jar = array('lineid'=>$lineid, 'nom'=>$nom, 'prenom'=>$prenom, 'dob'=>$dob, 'photoident'=>0, 'etatciv'=>0, 'domicile'=>0, 'customercard'=>0);\n\t// utilisation d'une carte client\n\tif (isset($customercard[$lineid])){\n\t $jar['customercard'] = $customercard[$line_id];\n\t if ($needphotoident){\n\t if (!isset($dscustomercards)){\n\t $dscustomercards = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableCUSTOMERCARDS);\n\t }\n\t $dcard = $dscustomercards->rdisplay($customercard[$lineid]);\n\t $tmpfile = TZR_TMP_DIR.uniqid('customercard');\n\t copy($dcard['ophoto']->filename, $tmpfile);\n\t $_FILES['justphotoident']['tmp_name'][$lineid] = $tmpfile;\n\t $_FILES['justphotoident']['type'][$lineid] = $dcard['ophoto']->mime;\n\t $_FILES['justphotoident']['name'][$lineid] = $dcard['ophoto']->originalname;\n\t $_FILES['justphotoident']['type'][$lineid] = filesize($tmpfile);\n\t }\n\t}\n\tif ($dpc['ojustetatciv']->raw == 1)\n\t $jar['etatciv'] = 1;\n\tif ($dpc['ojustdomicile']->raw == 1)\n\t $jar['domicile'] = 1;\n\tif ($dpc['ojustphotoident']->raw == 1){\n\t $jar['photoident'] = 1;\n\t}\n\t$justifoid = $this->saveJustif($jar);\n\t$line['justifoid'] = $justifoid;\n }\n // ajout des lignes cartes : NEWCARD = commander; WTPCARD = saisie du WTP; autres : id de cartes deja dans le panier\n // !!! NEWCARD_WTSCATLOG:xxx = ajouter nouvelle carte, NEWCARDuniqid = nouvelle carte du panier - sera rattachée\n // !!! on a la meme chose (ou presque pour le remplacement de produit)\n $card2 = substr($line['cardid'], 0, 8);\n if ($card2 == 'NEWCARD_'){\n $cardid = uniqid('NEWCARD');\n $line['cardid'] = $cardid;\n $cardoid = substr($card[$lineid], 8);\n // trouver le bon prix et intitulé des cartes en commande\n $cardok = 0;\n foreach($dps[$line['productoid']]['availablesNewCards'] as $acarddesc){\n if($cardoid == $acarddesc['oid']){\n $cardok=1;\n break;\n }\n }\n if ($cardok !== 1){ // on doit trouver !!! sauf si on enlève\n XLogs::notice(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n //die('An error occured'.$cardoid);\n // on cherche le prix directement (DSR : rp + produit public ...)\n $ct = $this->modcatalog->getProductTariff(NULL, $line['validfrom'], $cardoid);\n if ($ct['tariff'] == 'NOT FOUND'){\n XLogs::critical(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n die('An error occured'.$cardoid);\n } else {\n $acarddesc['price'] = $ct['tariff'];\n }\n }\n $lines[$id1.'_0000'] = array('linesid'=>$lineid, 'type'=>'carte',\n\t\t\t\t 'label'=>$NEWCARDLabel[$lineid], 'cardid'=>$cardid,\n\t\t\t\t 'productoid'=>$cardoid,\n\t\t\t\t 'price'=>$acarddesc['price']);\n //les cartes ne sont pas dans le pack car elle peuvent avoir d'autres forfaits dessus\n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n\t/*saisie WTP */\n } elseif($line['cardid'] == 'WTPCARD'){\n $newwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n // regarder si cette carte n'est pas déjà dans le panier si oui recup de sont cardid\n $cardid = array_search($newwtp, $oldcaddie['cards']);\n if ($cardid === false)\n $cardid = uniqid('WTPCARD');\n $line['cardlabel'] = $newwtp;\n $line['cardid'] = $cardid;\n\t/* autres cas : cartes du panier (WTPCARDuniq ou cartes en commandes NEWCARuniqid)*/\n } elseif(!empty($line['cardid'])){ \n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n $line['cardid'] = $card[$lineid];\n }\n // ajout des lignes assurances\n if (isset($assurance[$lineid])){\n $lines[$id1.'_0020'] = array('lineid'=>$lineid, 'type'=>'assurance',\n\t\t\t\t 'label'=>$dps[$line['productoid']]['assur']['label'],\n\t\t\t\t 'productoid'=>$dps[$line['productoid']]['assur']['oid'],\n\t\t\t\t 'price'=>$dps[$line['productoid']]['assur']['price'], \n\t\t\t\t 'options'=>array());\n if (isset($dps[$line['productoid']]['assur']['options'])){\n $lines[$id1.'_0020']['options'] = $dps[$line['productoid']]['assur']['options'];\n }\n $lines[$id1.'_0020']['ispersonpack'] = $line['ispersonpack'];\n $lines[$id1.'_0020']['personpackid'] = $line['personpackid'];\n }\n // ajout des lignes bonus et calcul du bonus\n if (isset($joursbonus[$lineid]) && $joursbonus[$lineid]>0){\n // calcul du forfait bonus\n list($rline, $bline) = $this->modloyalty->getForfaitBonus($line, $joursbonus[$lineid], $dps[$line['productoid']]);\n if ($bline != NULL && $rline != NULL){\n $bline['jours'] = $joursbonus[$lineid];\n // ev garder ... $line[$id1.'_0009'] = $line\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $line = $rline;\n $lines[$id1.'_0015'] = $bline;\n }\n if ($bline != NULL && $rline == NULL){\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $lines[$id1.'_0010'] = $bline;\n $line = NULL;\n }\n }\n if ($line != NULL){\n $lines[$id1.'_0010'] = $line;\n }\n }\n // ajout des lignes au caddie\n $this->addLines2Caddie($lines);\n }" ]
[ "0.6000555", "0.57204646", "0.57073635", "0.56994313", "0.56773365", "0.5673357", "0.5672344", "0.5651897", "0.5647044", "0.5629927", "0.56260824", "0.5613327", "0.559047", "0.5581401", "0.55772233", "0.5565469", "0.55610055", "0.5556372", "0.55525196", "0.5547311", "0.5544613", "0.5538304", "0.55323035", "0.5518237", "0.55113554", "0.5504575", "0.5496238", "0.54865754", "0.54832166", "0.54828894", "0.54773444", "0.54754186", "0.54624015", "0.54618424", "0.5455508", "0.54504716", "0.5435207", "0.5425213", "0.5417367", "0.54022586", "0.5399566", "0.5399558", "0.53857785", "0.5373595", "0.5362045", "0.5355362", "0.53522086", "0.5350495", "0.5342048", "0.53260934", "0.5325832", "0.5325486", "0.5324839", "0.53179675", "0.5313878", "0.53067595", "0.53017837", "0.5297429", "0.52959853", "0.5292446", "0.5292312", "0.5286481", "0.52796835", "0.52756506", "0.52718407", "0.5265958", "0.52630854", "0.5257938", "0.52497137", "0.52485263", "0.5244907", "0.52417284", "0.52402395", "0.5238302", "0.5237668", "0.52343285", "0.52336437", "0.5232315", "0.52305275", "0.5228693", "0.5228468", "0.5227671", "0.5226656", "0.5226252", "0.522365", "0.52214235", "0.5220469", "0.52197343", "0.52186465", "0.52182394", "0.5211775", "0.5211338", "0.5209177", "0.5198456", "0.51980007", "0.51949584", "0.51943934", "0.5192734", "0.5192719", "0.5186442" ]
0.72144175
0
Show the Job Builder mini SPA
Показать мини-SPA Построителя задач
public function show() { return view( 'manager/job-builder-root' )->with([ 'title' => Lang::get('manager/job_builder.title'), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Job $job)\n {\n //\n }", "public function getShow($jobtitle)\n\t{\n\t\t// redirect to the frontend\n\t}", "public function index()\n\t{\n\t\treturn view('sanatorium/job::index');\n\t}", "public function showInstallerApp() {\n\t\t$doc = JFactory::getDocument();\n\t\t$this->loadJQuery($doc);\n\t\t$this->loadBootstrap($doc);\n\t\t$doc->addStylesheet ( JUri::root ( true ) . '/administrator/components/com_jmap/css/cpanel.css' );\n\t\t$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/installer.js' );\n\t\n\t\t// Set layout\n\t\t$this->setLayout('default');\n\t\n\t\t// Format data\n\t\tparent::display ('installer');\n\t}", "public function getJobseekerDashboard()\n {\n return view('jobseeker::jobseeker.dashboard');\n }", "public function index()\n {\n $jobs = Job::all();\n return view(\"admin.jobs\", compact(\"jobs\"));\n }", "public function index()\n {\n $jobs = \\App\\Job::all();\n\n return view('home', compact('jobs'));\n }", "public function index()\n {\n $lists = $this->jobRepository->getListJob(20);\n foreach ($lists as $key => $item) {\n $lists[$key]->cate = $this->categoryRepository->find($item->category_id);\n $lists[$key]->author = $this->getAuthor($item->user_id);\n }\n\n return view('admin::jobs.job_list', compact('lists'));\n }", "public function index()\n {\n $jobs = Job::where('status', 0)\n ->where('company_id', '!=', Auth::user()->id)\n ->orderBy('id', 'DESC')->get();\n $colorAvt = ['#e1663f', '#558ed5', '#92d050'];\n $tabActive = 'job';\n\n $technicals = config('resources.technical_skill');\n $postions = config('resources.position');\n $levels = config('resources.level');\n return view('job.index', compact('jobs', 'colorAvt', 'tabActive', 'levels', 'postions', 'technicals'));\n }", "public function show(PaintJob $paintJob)\n {\n //\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function viewJob()\n {\n $result = Job::paginate(50);\n return view('data.list_job', ['job' => $result]);\n }", "public function index()\n {\n $data['jobs'] = $this->admin_m->getRecords();\n\n $data['content'] = 'admin/adminJobs';\n $this->load->view('components/template', $data);\n }", "public function show_box()\n\t\t{\n\t\t\techo '<div id=\"mfn-wrapper\">';\n\t\t\t\techo '<input type=\"hidden\" name=\"mfn-builder-nonce\" value=\"'. wp_create_nonce('mfn-builder-nonce') .'\" />';\n\t\t\t\tmfn_builder_show();\n\t\t\techo '</div>';\n\t\t}", "public function show();", "public function show();", "public function show();", "public function show();", "public function index()\n {\n return view('app.user.job.index');\n }", "public function index()\n {\n $Jobs = JobResource::collection(Jobs::where('active', '=', 1)->orderBy('id', 'desc')->paginate(50));\n return view('home')->with(compact(\"Jobs\"));\n }", "public function applicationDetailAction() {\n $job_id = $this->_getParam('job_id');\n $this->view->applicationDetail = Engine_Api::_()->getItem('sitereview_job', $job_id);\n }", "public function index()\n {\n $id = Auth::user()->id;\n $items = Job::with(['user'])->where('user_id', '=', $id)->get();\n return view('pages.admin.job.index',compact('items'));\n }", "public function index()\n {\n //\n $jobs = Job::all();\n return view('admin.job.index',[\n 'jobs'=>$jobs\n ]);\n }", "public function show(Job $job)\n {\n \n return view('pages.admin.job.show',compact('job'));\n }", "public function show() {\n \n }", "function showStart() {\n $starturl = $this->action . '?mode=eligible';\n $extra = array('starturl' => $starturl);\n $output = $this->outputBoilerplate('start.html', $extra);\n return $output;\n }", "public function actionIndex(){ \n echo 'REST API';\n //echo \\admin\\components\\GoogleURLShortner::widget([\"url\" => \"http://www.google.com\"]);\n }", "function register_gather_ua_jobs_tools_page() {\n\tadd_management_page( __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), 'edit_posts', 'gather-ua-jobs', 'print_gather_ua_jobs_tools_page' );\n\n}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show() {\n\t}", "public function index()\n {\n return view('home', ['jobs' => $this->jobs()]);\n }", "public function index() {\n $jobs = Job::latest()->get();\n $filter = 'all';\n //DD($jobs);\n return view('jobs.index', compact('jobs', 'filter'));\n }", "public function gettingStartedAction()\n {\n return $this->render('BraincraftedBootstrapDemoBundle:Bootstrap:gettingStarted.html.twig');\n }", "public function start()\n\t{\n\t\t$page = 'getting started';\n\t\treturn view('dashboard.start', compact('page'));\n\t}", "public\n function show(Job $job)\n {\n return view('admin.jobs.show', compact('job'));\n }", "public function show($id)\n {\n return view('jobseeker::show');\n }", "public function index()\n {\n $id = Auth::id();\n $jobs = JobList::where('user_id', $id)->with('user')->get();\n return view('admin.job.index', ['jobs' => $jobs]);\n }", "public function index()\n {\n $jobs = $this->jobRepo->getJobs();\n\n return view('jobs.index')->with(['items' => $jobs]);\n }", "public function index()\n {\n $jobs = Job::orderBy('created_at', 'desc')->get();\n return view('admin.jobs.index', compact('jobs'));\n }", "public function show(JobSeeker $jobSeeker)\n {\n //\n }", "public function index()\n {\n // Show the page\n return view('admin.producer.index');\n }", "public function index()\n {\n //\n $breadcrumbs = [\n ['name'=>\"Home\"],\n ['name'=>\"Jobs And applicants\"],\n ['name'=>\"View Job\"]\n ];\n $jobs = JobTranslation::all();\n return view('cpanel.job.index',compact('jobs','breadcrumbs'));\n // return response([ 'success' => true,compact('jobTranslation','breadcrumbs')]);\n }", "public function show(Worker $worker)\n {\n //\n }", "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "public function show(Job $job)\n {\n return view('jobs.show', compact('job'));\n }", "public function show()\n {\n return view('scaffold::show');\n }", "public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }", "public function index(Job $job)\n {\n\n return view('submitresume', ['job'=>$job]);\n \n \n }", "function print_gather_ua_jobs_tools_page() {\n\n\t// Include the file\n\trequire plugin_dir_path( __FILE__ ) . 'includes/display-gather-ua-jobs-tools-page.php';\n\n}", "public function showJobForProfile(Job $job) {\n //\n $ProfileJobs = Job::where('user_id', '=', Auth::user()->id)->latest()->get();\n return view('profile.your-jobs', compact('ProfileJobs'));\n }", "public function index()\n {\n return view('admin.job',['rows' => Job::paginate(1000)]);\n }", "public function show()\n {\n $contact = new Contact([\n 'name' => 'Benedikt Poller',\n 'email' => 'benedikt.poller+contact@gmail.com'\n ]);\n $contact->save();\n\n\n SendEmailJob::dispatch((object) [\n 'subject' => 'foo'\n ])\n ->delay(now()->addSeconds(10));\n\n return view('welcome');\n }", "public function show()\n {\n //\n }", "public function show($id)\n {\n return 'View job details';\n }", "public function view($job_id){\n\n\t\t$data['applicants'] = $this->applicant_model->get_applicants($job_id); \n\n\t\t$data['title'] = 'Jobs Applicants';\n\t\t$data['layout'] = 'themes/employers/applicants/job_applicants_page';\n\t\t$this->load->view('themes/layout',$data);\n\t}", "public function index()\n {\n $jobs = Job::with('user')->orderBy('created_at', 'desc')->paginate(10);\n return view('welcome', compact('jobs'));\n }", "public function show()\n\t{\n\t\t\n\t}", "function elodin_do_jobs_sidebar_genesis() {\n\tdynamic_sidebar( 'jobs' );\n}", "public function jobs()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n $managerType = $this->container->getParameter('dtc_queue.manager.job');\n $rendererFactory = $this->container->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->container->get('dtc_queue.grid_source.jobs_waiting.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n $params['worker_methods'] = $this->container->get('dtc_queue.manager.job')->getWorkersAndMethods();\n $params['prompt_message'] = 'This will archive all non-running jobs';\n\n return $this->render('@DtcQueue/Queue/jobs.html.twig', $params);\n }", "function showGettingStartedForm($selectedProductIndex = NO_PRODUCT) {\n\t?>\n\t<iframe src=\"getting-started.php?getStartedProduct=<?=$selectedProductIndex?>\" frameborder=\"0\" name=\"gettingStarted\" style=\"height:290px;width:255px;overflow:hidden;\" scrolling=\"no\">\n\t</iframe>\n\t<?php\n}", "public function index()\n {\n $query = Job::query();\n\n if(!Auth::check() || !Auth::user()->isAdmin()) {\n $query->where('approved', '=', 1);\n }\n\n $jobs = $query->paginate(10);\n\n return view('jobs.index', ['jobs' => $jobs]);\n }", "public function viewJob($id)\n {\n $data['job'] = $this->admin_m->jobDetails($id);\n $data['content'] = 'admin/detailsView';\n $this->load->view('components/template', $data);\n }", "public function show() {\n \n \n }", "public function show_admin_page() {\n\t\t$this->view->render();\n\t}", "public function index()\n {\n\n $q = Job::query()->latest();\n if (Auth::user() -> role_id == 3)\n {\n $jobs = $q->where('user_id', Auth::id())->get();\n\n }else\n {\n $jobs = $q ->get();\n }\n return view('jobs.index', compact('jobs'));\n }", "public function show()\n\t{\n\n\t}", "public function index()\n {\n\n $this->global['pageTitle'] = 'Talend Job Seeker : Input Components';\n\n $data[\"jobs\"] = $this->model->listJobs();\n $data[\"role\"] = $this->isManager();\n \n $this->loadViews(\"JobsTable\", $this->global, $data, NULL);\n }", "public function index()\n {\n $jobs_data['jobs_data'] = $this->job_model->get_all_jobs();\n $this->load->view('job/default_view', array_merge($this->global_data, $jobs_data));\n }", "public function show()\n {\n \n }", "public function show()\n {\n \n }", "public function show($id)\n {\n $job = JobSeeker::find($id);\n return view('jobseeker.show',compact('job'));\n }", "public function run()\n {\n $this->browser->open($_ENV['app_frontend_url'] . $this->product->getUrlKey() . '.html');\n }", "public function show()\n {\n // return view('master::show');\n }", "public function show()\n {\n \n }", "public function show()\n {\n \n }", "public function getIndex()\n {\n // Title\n $title = Lang::get('admin/jobtitles/title.jobtitle_management');\n\n\t // Grab all the jobtitle\n\t $jobtitle = $this->jobtitle;\n\n // Show the page\n return View::make('admin/jobtitles/index', compact('jobtitle', 'title'));\n }", "public function show($id)\n {\n $job = $this->jobRepo->getJob($id);\n\n return view('jobs.view')->with(['item' => $job]);\n }", "public function print_preview_page() {\n\n\t\t?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<?php\n\n\t\t\techo conference_schedule()->get_conference_schedule();\n\n\t\t\t?>\n </div>\n\t\t<?php\n\n\t}", "public function index()\n {\n #$rekod_joblist = DB::table('joblist')->get();\n $rekod_joblist = Joblist::all();\n\n return view('template_joblist/senarai_joblist', compact('rekod_joblist'));\n }", "public function show($id)\n {\n $job = Job::findOrFail($id);\n return view(\"admin.career.job\", compact(\"job\"));\n }", "public function index()\n {\n $jobs = DB::table('jobs')->paginate(5);\n return view('show', ['jobs' => $jobs]);\n }", "public function showBackupPage() {\n echo '<div class=\"wrap\">';\n echo '<h2>' . self::NAME . ' v ' . self::VERSION . '</h2>';\n\n if ($this->getNonce()) {\n if (isset($_GET['kickoff'])) {\n $this->renderRefresh(\n $this->initArchiving()\n );\n } elseif (isset($_GET['holding'])) {\n $this->renderRefresh(\n false,\n $this->resumeArchiving()\n );\n }\n } else {\n echo '<hr>';\n echo '<p>When you click the button below, Wordpress will create a zip archive of your content directory (in <code>' . $this->content_dir . '</code>) and a SQL export of your database.</p>';\n echo '<p>You can then import said archive into an <a target=\"_blank\" href=\"https://github.com/evolution/wordpress\">Evolution Wordpress</a> site.</p>';\n echo '<form action=\"\" method=\"get\">';\n wp_nonce_field(__CLASS__, __CLASS__.'_nonce', true);\n echo '<input type=\"hidden\" name=\"page\" value=\"' . __CLASS__ . '_opt_menu\">';\n echo '<input type=\"submit\" name=\"kickoff\" value=\"Create Archive\" class=\"button button-primary\">';\n echo '</form>';\n }\n\n echo '</div>';\n }", "public function show(Menu_builder $menu_builder)\n {\n //\n }", "public function index()\n\t{\n\t\t//\n\t\t$jobs = jobsDb::All();\n\t\t$name = 'hello';\n\n\t\treturn view('pages.test', compact('jobs'));\n\t}", "public function open()\n {\n $allRows = Job::open()->latest()->get();\n $rows = Job::open()->latest()->paginate(10);\n\n return view('admin.jobs.index', [\n 'rows' => $rows,\n 'title' => 'Open',\n 'values' => $this->totalValue($allRows)\n ]\n );\n }", "public function run() {\n $data = array('project' => $this->getProject(),\n 'sprint' => $this->getSprint());\n $this->render('widget_user_menu', array('data' => $data));\n }", "public function Show(){\n\t\techo(\"\n\t\t<div class='$this->claseCSS'>\n\t\t<div class='WidgetTitle'><a id='TitleBlock' href='$this->masURL'><div id='TitleText'>$this->Titulo</div></a></div>\n\t\t\t$this->Contenido\n\t\t\t<div class='footer'><a href='$this->masURL'>Ver m&aacute;s...</a></div>\n\t\t</div>\n\t\t\");\n\t}", "public function index()\n {\n $categories = JobCategory::all();\n $jobs = Jobs::with('company')->with('joblocation')->orderBy('id', 'desc')->get();\n return view('jobs2')->with('jobs', $jobs)->with('categories', $categories);\n }", "public function index()\n {\n if (empty(Session::get('authenticated')))\n return redirect('/login');\n\n if (AccessRight::granted() === false) {\n $data['page_title'] = 'Oops! Unauthorized.';\n return response(view('errors.403')->with(compact('data')), 403);\n }\n \n $access = AccessRight::access(); \n $data['page_title'] = 'Jobs';\n $data['ctree_mod'] = 'Setting';\n $data['ctree'] = 'setting/jobs';\n $data[\"access\"] = (object)$access;\n return view('monitoring.jobs')->with(compact('data'));\n }", "public function display() {\n\t\techo '<iframe src=\"http://norulesweb.com/contact/\" width=\"800\" height=\"400\"></iframe>';\n\t}", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public function create()\n {\n $breadcrumbs = [\n ['name'=>\"Home\"],\n ['name'=>\"Jobs And applicants\"],\n ['name'=>\"Add Job\"],\n ];\n \n return view('cpanel.job.create',compact('breadcrumbs'));\n }", "public function index()\n {\n $jobs = Job::latest()->paginate(5);\n return view('Jobs.index', compact('jobs'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }" ]
[ "0.6665023", "0.6536361", "0.63888204", "0.6380171", "0.62925464", "0.61752284", "0.6144173", "0.610938", "0.60875916", "0.60807264", "0.6065288", "0.6047928", "0.6037091", "0.6018285", "0.6015556", "0.6015556", "0.6015556", "0.6015556", "0.6010017", "0.60046476", "0.6001178", "0.59930414", "0.59461296", "0.59387434", "0.5938212", "0.5937609", "0.59320587", "0.5924406", "0.5922281", "0.5922281", "0.5922281", "0.5919466", "0.5916898", "0.59094566", "0.5904555", "0.59003156", "0.589143", "0.5865165", "0.5864841", "0.58635", "0.5861221", "0.58500236", "0.5833262", "0.58223295", "0.58027214", "0.5786133", "0.5785903", "0.57758963", "0.5769758", "0.57657486", "0.57644814", "0.5759771", "0.57563215", "0.5751697", "0.57364553", "0.5731856", "0.57124156", "0.57056797", "0.56986743", "0.5698295", "0.56964546", "0.5695809", "0.5690878", "0.5690632", "0.568785", "0.5687229", "0.56868964", "0.5683686", "0.5680656", "0.56728405", "0.56724924", "0.56724924", "0.566907", "0.5664566", "0.56557906", "0.56541437", "0.56541437", "0.5644723", "0.5640287", "0.5637922", "0.56369525", "0.5626243", "0.5623951", "0.56227154", "0.56209576", "0.5619887", "0.5612918", "0.5606933", "0.5598868", "0.5597326", "0.559463", "0.55841404", "0.5572729", "0.55688435", "0.5563352", "0.5561837", "0.5561837", "0.5561837", "0.5561837", "0.5561837" ]
0.7357492
0
$n | $n+1 sets rightmost zero bit to 1 ($n | $n+1) + 1 sets all bits after second zero to 0 and second zero to 1 combining these terms with XOR (^) gives leading zeros until second rightmost zero of original term and then only 1s adding 1 again turns all 1s to zeros and adds only one 1 in front of them moving to the right one position returns the exact position of the second rightmost 0 Example: $n = 37 = 100101 $n | $n + 1 = 100111 ($n | $n + 1) + 1 = 101000 XOR of the above = 001111 +1 to that = 010000 >> 1 = 001000
$n | $n+1 устанавливает правый нулевой бит в 1 ($n | $n+1) + 1 устанавливает все биты после второго нуля в 0 и второй ноль в 1. Комбинируя эти термы с помощью XOR (^), получаем ведущие нули до второго правого нуля исходного терма, а затем только 1. Добавление 1 снова превращает все 1 в нули и добавляет только один 1 перед ними. Сдвиг вправо на одну позицию возвращает точное положение второго правого нуля. Пример: $n = 37 = 100101 $n | $n + 1 = 100111 ($n | $n + 1) + 1 = 101000. XOR вышеуказанных значений = 001111. +1 к этому = 010000 >> 1 = 001000.
function secondRightmostZeroBit($n) { return ((($n | $n+1) ^ (($n | $n + 1) + 1)) + 1) >> 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function getMaskOnes(int $n): int {\n // so (1 << 63) - 1 gets converted to float and loses precision (leading to incorrect result)\n // 2. (1 << 64) - 1 works fine, because (1 << 64) === 0 (it overflows) and -1 is exactly what we want\n // (`php -r 'var_dump(decbin(-1));'` => string(64) \"111...11\")\n $bit = 1 << $n;\n return $bit === PHP_INT_MIN ? ~$bit : $bit - 1;\n }", "function num1BitsSecondSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $number >>= 1) {\n $c += $number & 1;\n }\n\n return $c;\n}", "function num1BitsFirstSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n $countOf1 = 0;\n\n do {\n\n if ($number & 1) {\n ++$countOf1;\n }\n\n } while ($number = $number >> 1);\n\n return $countOf1;\n}", "function flippingBits($n)\n{\n return $n ^ 0xFFFFFFFF;\n}", "function num1BitsThirdSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $c++) {\n $number &= $number - 1;\n }\n\n return $c;\n}", "function decbinx($d,$n)\r\n\t{\r\n\t\t$bin = decbin($d);\r\n\t\t$sbin = strlen($bin);\r\n\t\tfor($j = 0; $j < $n - $sbin; $j++)\r\n \t\t\t$bin = \"0$bin\";\r\n\t\treturn $bin;\r\n\t}", "function ROR($binner, $shift)\n{\n $length = strlen($binner);\n for ($i = 0; $i < $shift; $i++) {\n $x = substr($binner, -1);\n $temp = $x . substr($binner, 0, $length - 1);\n $binner = $temp;\n }\n}", "function computeParityEraseLowestSetBit($number)\n{\n if (!is_int($number)) {\n throw new \\InvalidArgumentException('$number must be an integer');\n }\n\n $bitwiseHelper = new BitwiseHelper();\n $number = $bitwiseHelper->eraseSignBit($number);\n $result = 0;\n\n while ($number) {\n $result ^= 1;\n $number &= ($number - 1);\n }\n\n return $result;\n}", "function next_pow($number)\n{\n if($number < 2) return 1;\n for($i = 0 ; $number > 1 ; $i++)\n {\n $number = $number >> 1;\n }\n return 1<<($i+1);\n}", "static function powerOfTwo($n)\n { \n if ($n >= 0 && $n < 31) {\n $pow = 2**$n;\n $all = 0; $count = 1;\n while($all != $pow)\n {\n $all = 2** $count;\n echo $all.\"\\n\";\n $count++;\n }\n } else {\n echo \"enter value between 0 to 31\".\"\\n\";\n Utility::powerOfTwo();\n }\n \n }", "function _binxor($l, $r)\n {\n $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)\n ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);\n\n return (float)(($x < 0) ? $x + 4294967296 : $x);\n }", "function variant_xor($left, $right) {}", "function mirrorBits($a) {\n return bindec(strrev(decbin($a)));\n}", "function toBinary($n1)\n {\n $n = $n1;\n $binaryNum = array();\n\n $i = 0;\n while ($n > 0) {\n\n $binaryNum[$i] = $n % 2;\n $n = (int) ($n / 2);\n $i++;\n }\n echo \"Binary representation of \" . $n1 . \" is : \";\n\n for ($j = $i - 1; $j >= 0; $j--) {\n echo $binaryNum[$j];\n }\n }", "function solution($N) {\n $binStr = decbin($N);\n $binStr = preg_replace(['/^0+/', '/0+$/'], '',$binStr);\n $zeros = explode('1', $binStr);\n $zeros = array_map(function ($zero) {\n return strlen($zero);\n }, $zeros);\n return max($zeros);\n}", "public function getIncrementBy2($n){\n\t\t$hasil= array();\n\t\t$data=1;\n\t\tfor ($i=0; $i < $n ; $i++) {\n\t\t\t$hasil[$i]=$data;\n\t\t\t$data=$data+2;\n\t\t}\n\t\treturn $hasil;\n\t}", "private static function scan1($bites) {\n if ($bites == 0) {\n return self::HASH_LENGTH - self::HASH_K;\n }\n\n $offset = floor(log($bites, 2));\n $offset = self::HASH_LENGTH - self::HASH_K - $offset;\n\n return $offset;\n }", "function ROL($binner, $shift)\n{\n $length = strlen($binner);\n for ($i = 0; $i < $shift; $i++) {\n $x = substr($binner, 0, 1);\n $temp = substr($binner, 1, $length - 1) . $x;\n $binner = $temp;\n }\n\n return $binner;\n}", "public function getOddAndReverse($n){\n\t\t$result = array();\n\t\t$data = 0;\n\t\tfor($i = 0; $i < $n; $i++){\n\t\t\t//collect to result array\n\t\t\t$result[$i] = $data;\n\t\t\t\n\t\t\tif($i <= ($n-1)/2-1){\n\t\t\t\t$data = $data + 2;\n\t\t\t} else {\n\t\t\t\t$data = $data - 2;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public static function getNextTwoPower($number) {\n $result = $number - 1;//Subtract 1 to handle the case that we are already a power of 2\n $result |= $result >> 1;//shift all bits to 1\n $result |= $result >> 2;//shift all bits to 1\n $result |= $result >> 4;//shift all bits to 1\n $result |= $result >> 8;//shift all bits to 1\n $result |= $result >> 16;//Support up to 32bit integer or 0x8000_0000\n return $result + 1;\n }", "function nprimo($n)\n {\n $primo=true;\n \n $i=2;\n while (($i< $n) & ($primo)){\n \n if($n%$i==0) {\n $primo=false;\n }\n $i++;\n }\n return $primo;\n }", "function _rshift($integer, $n) {\r\n if (0xffffffff < $integer || -0xffffffff > $integer) {\r\n $integer = fmod($integer, 0xffffffff + 1);\r\n }\r\n\r\n // convert to unsigned integer\r\n if (0x7fffffff < $integer) {\r\n $integer -= 0xffffffff + 1.0;\r\n } elseif (-0x80000000 > $integer) {\r\n $integer += 0xffffffff + 1.0;\r\n }\r\n\r\n // do right shift\r\n if (0 > $integer) {\r\n $integer &= 0x7fffffff; // remove sign bit before shift\r\n $integer >>= $n; // right shift\r\n $integer |= 1 << (31 - $n); // set shifted sign bit\r\n } else {\r\n $integer >>= $n; // use normal right shift\r\n }\r\n\r\n return $integer;\r\n }", "public function oddMask()\n {\n $low = (-($this->low & 1)) & 0xFFFFFFFF;\n $high = $low;\n return UInt64::newValue($high, $low);\n }", "function collatzLength($n) {\n $chainLength = 0;\n while ($n != 1) {\n $chainLength++;\n if ($n % 2 == 0) {\n $n = $n / 2;\n } else {\n $n = 3 * $n + 1;\n }\n }\n return $chainLength + 1;\n}", "function Fannkuch($n){\n $check = 0;\n $perm = array();\n $perm1 = array();\n $count = array();\n $maxPerm = array();\n $maxFlipsCount = 0;\n $m = $n - 1;\n\n for ($i=0; $i<$n; $i++) $perm1[$i] = $i;\n $r = $n;\n\n while (TRUE) {\n // write-out the first 30 permutations \n if ($check < 30){\n for($i=0; $i<$n; $i++) echo $perm1[$i]+1; \n echo \"\\n\";\n $check++;\n }\n\n while ($r != 1){ $count[$r-1] = $r; $r--; } \n if (! ($perm1[0]==0 || $perm1[$m] == $m)){ \n for($i=0; $i<$n; $i++) $perm[$i] = $perm1[$i]; \n $flipsCount = 0;\n\n while ( !(($k=$perm[0]) == 0) ) {\n $k2 = ($k+1) >> 1;\n for($i=0; $i<$k2; $i++) {\n $temp = $perm[$i]; $perm[$i] = $perm[$k-$i]; $perm[$k-$i] = $temp;\n }\n $flipsCount++;\n }\n\n if ($flipsCount > $maxFlipsCount) {\n $maxFlipsCount = $flipsCount;\n for($i=0; $i<$n; $i++) $maxPerm[$i] = $perm1[$i];\n }\n } \n\n while (TRUE) { \n if ($r == $n) return $maxFlipsCount;\n $perm0 = $perm1[0];\n $i = 0;\n while ($i < $r) {\n $j = $i + 1;\n $perm1[$i] = $perm1[$j];\n $i = $j;\n }\n $perm1[$r] = $perm0;\n\n $count[$r] = $count[$r] - 1;\n if ($count[$r] > 0) break;\n $r++;\n }\n }\n}", "function addOneToNumberOptimized($arr) {\n // handle empty array\n if (empty($arr)) {\n return [1];\n }\n // remove forward padded zeros\n $arr = removeForwardZero($arr);\n // init carry variable to track forward carrys\n $carry = 0;\n // loop through array from back to front\n for ($i=sizeof($arr)-1; $i >= 0; $i--) { \n if ($i == sizeof($arr)-1) {\n $arr[$i]++;\n } else {\n $arr[$i] += $carry;\n $carry = 0;\n }\n if ($arr[$i] >= 10) {\n $arr[$i] %= 10; \n $carry = 1;\n } else {\n break;\n }\n }\n // if carry is 1 at the end, append a new 1 to forward of array\n if ($carry === 1) {\n array_unshift($arr, 1);\n }\n return $arr;\n}", "private static function ShiftLeft( int|string|\\GMP $x, int $n ) : \\GMP\n\t{\n\t\treturn gmp_mul( $x, gmp_pow( 2, $n ) );\n\t}", "private static function ShiftRight( int|string|\\GMP $x, int $n ) : \\GMP\n\t{\n\t\treturn gmp_div_q( $x, gmp_pow( 2, $n ) );\n\t}", "function fb($n)\n {\n if ($n == 0) \n {\n \treturn 0;\n }\n elseif ($n < 3 and $n!==0) \n {\n return 1; \n }\n else \n {\n return (fb($n-1) + fb($n-2));\n }\n }", "protected function BinaryXOR( $strBin1, $strBin2 )\n\t{\n\t\t$strBinaryFinal = '';\n\t\tfor( $intPos = 1 ; $intPos <= \\strlen( $strBin1 ) ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\tswitch( substr( $strBin1, intval( $intPos ) - 1, 1 ) )\n\t\t\t{\n\t\t\t\tcase substr( $strBin2, intval( $intPos ) - 1, 1 ) :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"1\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $strBinaryFinal;\n\t}", "function nCrModp($n, $r, $p)\n{\n \n// Optimization for the cases when r is large\nif ($r > $n - $r)\n $r = $n - $r;\n \n// The array C is going\n// to store last row of\n// pascal triangle at\n// the end. And last entry\n// of last row is nCr\n$C = array();\n \nfor( $i = 0; $i < $r + 1; $i++)\n $C[$i] = 0;\n \n// Top row of Pascal\n// Triangle\n$C[0] = 1;\n \n// One by constructs remaining\n// rows of Pascal Triangle from\n// top to bottom\nfor ($i = 1; $i <= $n; $i++)\n{\n \n // Fill entries of current\n // row using previous row values\n for ($j = Min($i, $r); $j > 0; $j--)\n \n // nCj = (n-1)Cj + (n-1)C(j-1);\n $C[$j] = ($C[$j] +\n $C[$j - 1]) % $p;\n}\n \nreturn $C[$r];\n}", "public static function getPreviousTwoPower($number) {\n return Utils::getNextTwoPower($number) >> 1;\n }", "function simple_rec($n)\n{\n if($n == 1)\n {\n return \"1\";\n }\n ////from max to min\n // return $n .= fac($n - 1);\n ////from min to max\n return simple_rec($n - 1) . $n;\n}", "function recursive($n){\r\n\r\n if($n==0){\r\n return 1;\r\n }\r\n else{\r\n return $n * recursive($n-1);\r\n }\r\n\r\n}", "function sumate2(array $n,int $r) {\r\n if ($r < 0) {\r\n return 0;\r\n } else {\r\n print($n[$r]);\r\n print \"<br> \";\r\n return ($n[$r]) + sumate2($n, $r-1);\r\n }\r\n}", "static private function champGaloisSum($a, $b){\n return $a ^ $b;\n }", "function oddArray(array $array): int\n {\n $odd = 0;\n\n foreach($array as $number)\n {\n if($number & 1)\n {\n $odd++;\n }\n }\n\n return $odd;\n }", "function egyptianMultiplication($a, $n) {\n\t//we could use bits here\n\t//ONE DAY :P\n\t$startValue = $a;\n\tif ($n == 1) {\n\t\treturn $a;\n\t}\n\n\t$odd = $n % 2;\n\n\tif ($odd) {\n\t\t$n = $n - 1;\n\t}\n\t// $log2 = floor(log($n, 2));\n\n\t// for ($i = 0; $i < $log2; $i++) {\n\t// \t$n = $n / 2;\n\t// \t$a += $a;\n\t// }\n\t$i = 0;\n\twhile ($n != 1) {\n\t\t$n = $n / 2;\n\t\t$a += $a;\n\t\t$i++;\n\t}\n\n\tif ($odd) {\n\t\t$a += $startValue;\n\t}\n\treturn $a;\n}", "function xxor($x,$y) {\n return $x ^ $y;\n}", "public function getIncrement($n){\n\t\t$hasil= array();\n\t\t$data=1;\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\t$hasil[$i] =$data;\n\t\t\t$data=$data+1;\n\t\t}\n\t\treturn $hasil;\n\t}", "function checkRecursive($x, $n, $curr_num = 1,$curr_sum = 0)\n{\n // Initialize number of ways to express\n // x as n-th powers of different natural\n // numbers\n $results = 0;\n \n // Calling power of 'i' raised to 'n'\n $p = power($curr_num, $n);\n $p + $curr_sum;\n while ($p + $curr_sum < $x)\n {\n // Recursively check all greater values of i\n $results += checkRecursive($x, $n, $curr_num+1,$p+$curr_sum);\n $curr_num++;\n $p = power($curr_num, $n);\n }\n \n // If sum of powers is equal to x\n // then increase the value of result.\n echo $p + $curr_sum;\n echo \"\\n\";\n if ($p + $curr_sum == $x)\n $results++;\n \n // Return the final result\n return $results;\n}", "public function zeroFill($a, $b){\n return ($a >= 0) ? ($a >> $b) : ($a >> $b) & (PHP_INT_MAX >> ($b - 1));\n }", "function fixed_xor($str1, $str2, $bit=4) {\n\n\t$str1 = strtolower($str1);\n\t$str2 = strtolower($str2);\n\n\t$xor_hex = '';\n\tfor($i=0; $i<strlen($str1); $i++) {\n\t\t$char_str1_hex_to_bin = sprintf('%0'.$bit.'d', base_convert($str1[$i], 16, 2));\n\t\t$char_str2_hex_to_bin = sprintf('%0'.$bit.'d', base_convert($str2[$i], 16, 2));\n\n\t\t$xor_bin_partial = '';\n\t\tfor($j=0; $j<$bit; $j++) {\n\t\t\t$xor_bin_partial .= ($char_str1_hex_to_bin[$j] xor $char_str2_hex_to_bin[$j]) ? '1' : '0';\n\n\t\t\tif ((($j+1)%4) == 0) {\n\t\t\t\t$xor_hex .= base_convert($xor_bin_partial, 2, 16);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $xor_hex;\n}", "static function flipCoin($n)\n { \n //h and t to count head and tails.\n $h=0;\n $t=0;\n \n for($i = 0;$i<$n;$i++)\n {\n if (random_int(0,1)==1) \n {\n $t++;\n } \n else \n {\n $h++;\n }\n }\n echo ($h/($h+$t))*100;\n echo \"% head\".\"\\n\";\n echo ($t/($h+$t))*100;\n echo \"% tail\".\"\\n\";\n }", "function build_bitwise_swap($profilefieldid, $loc1, $loc2)\n{\n\n\tglobal $vbulletin;\n\n\t$loc1value = pow(2, $loc1 - 1);\n\t$loc2value = pow(2, $loc2 - 1);\n\n\t// Zero loc1 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc1value\n\t\tWHERE temp & $loc1value\n\t\");\n\t// Copy loc2 to loc1\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc1value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Zero loc2 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc2value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Copy loc1 from perm field to loc2 temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc2value\n\t\tWHERE field$profilefieldid & $loc1value\n\t\");\n\n}", "function yy_r149(){$this->_retvalue = ' XOR '; }", "protected function _rshift($integer, $n)\n\t{\n if (0xffffffff < $integer || -0xffffffff > $integer)\n\t\t{\n $integer = fmod($integer, 0xffffffff + 1);\n }\n\n // convert to unsigned integer\n if (0x7fffffff < $integer)\n\t\t{\n $integer -= 0xffffffff + 1.0;\n } elseif (-0x80000000 > $integer)\n\t\t{\n $integer += 0xffffffff + 1.0;\n }\n\n // do right shift\n if (0 > $integer)\n\t\t{\n $integer &= 0x7fffffff; // remove sign bit before shift\n $integer >>= $n; // right shift\n $integer |= 1 << (31 - $n); // set shifted sign bit\n }\n\t\telse\n\t\t{\n $integer >>= $n; // use normal right shift\n }\n\n return $integer;\n }", "public static function be2le(int $n, int $len): int\n {\n $rv = 0;\n \n for ($pos = 0; $pos < $len; $pos++) {\n $rv <<= 8;\n $rv |= $n & 0xff;\n $n >>= 8;\n }\n \n return $rv;\n }", "private function luhnOddDigit($n){\n\t\treturn ($n >= 5) ? 2 * $n - 9 : 2 * $n;\n\t}", "function unsigned_shift_r($a, $b) {\n $z = 0x80000000;\n if ($z & $a) {\n $a = ($a >> 1);\n $a &= (~$z);\n $a |= 0x40000000;\n $a = ($a >> ($b - 1));\n } else {\n $a = ($a >> $b);\n }\n return $a;\n }", "function jc1($n)\n{\n\t$sum=1;\n\tfor($i=1;$i<=$n;$i++)\n\t{\n\t\t$sum=$sum*$i;\n\t}\n\techo $sum;\n}", "public function rshift()\n {\n $out = clone $this;\n for ($j = $this->count() - 1; $j > 0; --$j) {\n $out[$j] = (($out[$j - 1] & 1) << 7) | ($out[$j] >> 1);\n }\n $out[0] >>= 1;\n return $out;\n }", "function summation($n) {\r\n $sum = 0;\r\n\r\n for ($i = $n; $i >= 1; $i--) {\r\n $sum += $i;\r\n }\r\n\r\n return $sum;\r\n}", "public function cursorForward($n = 1)\n {\n return $this->cuf($n);\n }", "public static function le2be(int $n): int\n {\n $rv = 0;\n\n while ($n) {\n $rv <<= 8;\n $rv |= $n & 0xff;\n $n >>= 8;\n }\n\n return $rv;\n }", "function reverse_integer($n)\n {\n $reverse = 0;\n while ($n > 0)\n {\n $reverse = $reverse * 10;\n $reverse = $reverse + $n % 10;\n $n = (int)($n/10);\n }\n return $reverse;\n }", "function triangular($n){\r\n return $n*($n + 1)/2;\r\n }", "function reverse($head) {\n // [2, 18, 24, 3, 5, 7, 9, 6, 12]\n // create a new head_r for return;\n \n $p_temp_s; // temp array start;\n $p_temp_m; // temp array mid;\n $p_temp_e; // temp array end;\n \n $head_r = new Node(9);\n $head_r->next = $head;\n $p_current = $head_r;\n \n $p_next = $head_r;\n while(isset($p_next->data)){\n if($p_next->data%2==1 && $p_next->next->data %2 ==0){\n // start of an even\n $p_temp_e = new Node($p_next->next->data); //echo \"51:\".$p_next->next->data.\";\";\n $p_temp_m = $p_temp_e;\n $p_next = $p_next->next; // move next\n }else if($p_next->data%2==0 && (!isset($p_next->next) || $p_next->next->data %2 ==1)){\n $p_current->next = $p_temp_m;\n $p_temp_e->next=$p_next->next;// connect 2 to 9\n $p_current=$p_temp_e;\n $p_next = $p_next->next; // move next\n $p_current = $p_current->next;\n\n }else if($p_next->data%2==0 && $p_next->next->data%2==0){ \n // save the even number to outside link\n $p_temp = new Node($p_next->next->data);//echo \"64:\".$p_next->next->data.\"--\";\n $p_temp->next = $p_temp_m;\n $p_temp_m = $p_temp;\n $p_next = $p_next->next;\n }else if($p_next->data%2==1 && $p_next->next->data%2==1){\n // odd number\n $p_current=$p_current->next;\n $p_next = $p_next->next; // move next\n }else{\n echo \"should not be here;\";\n }\n }\n return $head_r->next;\n}", "static function binary($number)\n {\n $binary=0;\n $i=1;\n //convert into binary\n while($number>0)\n {\n $binary=$binary+(((int)($number%2))*$i);\n $i=$i*10;\n $number=((int)($number)/2);\n\n }\n //prints $number in binary form\n echo \"The binary form is:\\n\";\n echo $binary.\"\\n\";\n echo \"After swapping nibbles we get integer:\\n\";\n self::decimal($binary);\n }", "function solution($N, $A)\n{\n // Initial array which length is N for saving final result\n $result_arr = array_fill(0, $N, 0);\n \n // Solution:\n // what we did is using $current_big_val to save current biggest value in result array\n // we empty result array when $A[$i] === $N1 which is max counter\n // when empty result array we will add $current_big_val to $addition_val\n // so we only need to record those steps which after final max counter\n // and add $addition_val to each element\n\n // e.g $N = 5, $A = [3, 4, 4, 6, 1, 4, 4]\n // So $N1 = 6 and the original steps should look like below\n // (0, 0, 1, 0, 0) $A[0] !== $N1\n // (0, 0, 1, 1, 0) $A[1] !== $N1\n // (0, 0, 1, 2, 0) $A[2] !== $N1\n // (2, 2, 2, 2, 2) $A[3] === $N1, max counter\n // (3, 2, 2, 2, 2) $A[4] !== $N1\n // (3, 2, 2, 3, 2) $A[5] !== $N1\n // (3, 2, 2, 4, 2) $A[6] !== $N1\n\n // Our steps will be like this\n // (0, 0, 1, 0, 0) $A[0] !== $N1, $current_big_val = 1, $addition_val = 0\n // (0, 0, 1, 1, 0) $A[1] !== $N1, $current_big_val = 1, $addition_val = 0\n // (0, 0, 1, 2, 0) $A[2] !== $N1, $current_big_val = 2, $addition_val = 0\n // (0, 0, 0, 0, 0) $A[3] === $N1, max counter so empty array, $current_big_val = 0, $addition_val = 2\n // (1, 0, 0, 0, 0) $A[4] !== $N1\n // (1, 0, 0, 1, 0) $A[5] !== $N1\n // (1, 0, 0, 2, 0) $A[6] !== $N1\n // add $addition_val which is 2 to each element\n // (3, 2, 2, 4, 2)\n \n $len = count($A);\n $N1 = $N + 1;\n $current_big_val = 0;\n $addition_val = 0;\n \n for ($i = 0; $i < $len; $i++) {\n if ($A[$i] === $N1) {\n $result_arr = array();\n $addition_val += $current_big_val;\n $current_big_val = 0;\n } else {\n if (!isset($result_arr[$A[$i] - 1])) {\n $result_arr[$A[$i] - 1] = 0;\n }\n \n $result_arr[$A[$i] - 1] ++;\n \n if ($current_big_val < $result_arr[$A[$i] - 1]) {\n $current_big_val = $result_arr[$A[$i] - 1];\n }\n }\n }\n \n for ($i=0; $i<$N; $i++) {\n $result_arr[$i] = !isset($result_arr[$i]) ? $addition_val : $result_arr[$i] + $addition_val;\n }\n \n return $result_arr;\n}", "private function getRightShift()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n if ($this->currentPage >= $all_pages - 1) {\n $shift = 3;\n } else {\n $shift = 1;\n }\n return $shift;\n }", "function bcpowmod($left_operand, $right_operand, $modulus, $scale = false)\n{\n}", "public function modif_boolbin() \r\n\t{\r\n\t\t$this->boolbin = abs($this->boolbin-1);\t\r\n\t}", "function repeatingKeyXOR($data, $key)\n{\n $dataLen = strlen($data);\n $keyLen = strlen($key);\n\n for ($i = 0; $i < $dataLen; $i++) {\n $data[$i] = $data[$i] ^ $key[$i % $keyLen];\n }\n\n return $data;\n}", "private function leftShift32($number, $steps) {\n\t\t// convert to binary (string)\n\t\t$binary = decbin($number);\n\t\t// left-pad with 0's if necessary\n\t\t$binary = str_pad($binary, 32, \"0\", STR_PAD_LEFT);\n\t\t// left shift manually\n\t\t$binary = $binary.str_repeat(\"0\", $steps);\n\t\t// get the last 32 bits\n\t\t$binary = substr($binary, strlen($binary) - 32);\n\t\t// if it's a positive number return it\n\t\t// otherwise return the 2's complement\n\t\treturn ($binary{0} == \"0\" ? bindec($binary) :\n\t\t-(pow(2, 31) - bindec(substr($binary, 1))));\n\t}", "public function getFibo($n){\n\t\t$result = array();\n\t\t$result[0]=1;\n\t\t$result[1]=1;\n\n\t\tfor ($i=2; $i <$n ; $i++) { \n\t\t\t$result[$i]= $result[$i-1] + $result[$i-2];\n\t\t}\n\n\t\treturn $result;\n\t}", "static public function shiftRightUnsigned ($left, $right) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:482: lines 482-488\n\t\tif ($right === 0) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:483: characters 4-15\n\t\t\treturn $left;\n\t\t} else if ($left >= 0) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:485: characters 4-78\n\t\t\treturn ($left >> $right) & ~((1 << (8 * PHP_INT_SIZE - 1)) >> ($right - 1));\n\t\t} else {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:487: characters 4-56\n\t\t\treturn ($left >> $right) & (2147483647 >> ($right - 1));\n\t\t}\n\t}", "function evenFibonacciNumbers($n){\n $sum = 0;\n $seq[] = maxFibonacciValue($n);\n foreach($seq[0] as $value){\n if($value % 2 == 0){ $sum += $value; }\n }\n return $sum;\n }", "public function testXor()\n {\n $this->assertEquals(0x7998bfda, ChaCha20Block::xor(0x01020304, 0x789abcde));\n }", "function solution($A) {\n $return = 0;\n \n $N = count($A);\n $left = [];\n $right = [];\n \n for ($i=0; $i<$N; $i++) {\n $left[] = $A[$i] + $i;\n $right[] = -($A[$i] - $i);\n }\n \n sort($left);\n sort($right);\n \n for($i=0; $i<$N-1; $i++) {\n $val = $left[$i];\n $pos = binary_search($val, $right);\n $return += $N - $pos - 1;\n }\n \n return $return;\n}", "function add($x, $y) {\n while($x) {\n int t = ($x & y) <<1;\n y ^= $x;\n $x = t;\n }\n return y;\n}", "function get_rand_num($n) {\n $temp = rand(0, ($n - 1));\n while ( $temp%2 == 1 ) {\n $temp = rand(0, ($n - 1));\n }\n return $temp;\n }", "private function getControlNumber()\n {\n $total = 0;\n for ($i = 0; $i < 10; $i++) {\n $multiplier = $i + 1;\n $total += substr($this->code, $i, 1) * ($multiplier > 9 ? 1 : $multiplier);\n }\n\n $modulo = $total % 11;\n\n // Second round\n if ($modulo >= 10) {\n $total = 0;\n\n for ($i = 0; $i < 10; $i++) {\n $multiplier = $i + 3;\n $total += substr($this->code, $i, 1) * ($multiplier > 9 ? $multiplier - 9 : $multiplier);\n }\n\n $modulo = $total % 11;\n if ($modulo >= 10) {\n $modulo = 0;\n }\n }\n\n return $modulo;\n }", "static protected function BinaryOR( $strBin1, $strBin2 )\n\t{\n\t\t$strBinaryFinal = '';\n\t\tfor( $intPos = 1 ; $intPos <= \\strlen( $strBin1 ) ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\tif ( substr( $strBin1, intval( $intPos ) - 1, 1 ) == \"1\" || substr( $strBin2, intval( $intPos ) - 1, 1 ) == \"1\" )\n\t\t\t{\n\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"0\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $strBinaryFinal;\n\t}", "static function NumerosALetras( $n ){\r\n\t\treturn self :: n2l($n);\r\n\t}", "function variant_pow($left, $right) {}", "function countOnes($n){\r\n $count = 0;\r\n for($i=0;$i<strlen($n); $i++){\r\n if($n[$i]=='1') $count++;\r\n elseif($n[$i]=='0') {\r\n $count-1;\r\n }else return;\r\n }return \"Number of 1s:\".$count;\r\n }", "function calc_checksum($cmd,$data){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd;\n foreach($data as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "public function bitwiseLeftShift(int $shift);", "function fibonacci($n)\n{\n if ($n == 1 or $n == 0) {\n return $n;\n }\n return fibonacci($n - 1) + fibonacci($n - 2);\n}", "function calc_checksum2($cmd1,$cmd2,$bytes){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd1;\n $xor_value = $xor_value ^ $cmd2;\n foreach($bytes as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "function mod($n, $m) {\n return (($n % $m) + $m) % $m;\n}", "function ADD64AC(&$v, $a, $b0, $b1) {\n\t\t$o0 = $v[$a] + $b0;\n\t\tif ($b0 < 0) {\n\t\t\t$o0 += 4294967296;\n\t\t}\n\t\t$o1 = $v[$a + 1] + $b1;\n\t\tif ($o0 >= 4294967296) {\n\t\t\t$o1++;\n\t\t}\n\t\t$v[$a] = $o0 & 0xffffffff;\n\t\t$v[$a + 1] = $o1 & 0xffffffff;\n\t}", "function findIt(array $seq): int\n{\n foreach ($seq as $number) {\n $arrNumeros = array_keys($seq, $number);\n if (count($arrNumeros) % 2 === 1) {\n return $number;\n }\n }\n}", "function simpleXor($InString, $Key) {\n\n // Initialise key array\n\n $KeyList = array();\n\n // Initialise out variable\n\n $output = \"\";\n\n \n\n // Convert $Key into array of ASCII values\n\n for($i = 0; $i < strlen($Key); $i++){\n\n $KeyList[$i] = ord(substr($Key, $i, 1));\n\n }\n\n\n\n // Step through string a character at a time\n\n for($i = 0; $i < strlen($InString); $i++) {\n\n // Get ASCII code from string, get ASCII code from key (loop through with MOD), XOR the two, get the character from the result\n\n // % is MOD (modulus), ^ is XOR\n\n $output.= chr(ord(substr($InString, $i, 1)) ^ ($KeyList[$i % strlen($Key)]));\n\n }\n\n\n\n // Return the result\n\n return $output;\n\n}", "public function climbStairs($n)\n {\n $way_count[0] = 1;\n $way_count[1] = 1;\n\n for ($i=2; $i<=$n; $i++) {\n $way_count[$i] = $way_count[$i-1] + $way_count[$i-2];\n }\n\n return $way_count[$n];\n }", "public function testXorRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'false'\n ), 'xor');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'xor');\n $this->assertFalse($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'true'\n ), 'xor');\n $this->assertFalse($rule->validate());\n }", "function permutator_generate($tops){\r\n\t$max=1;\r\n\t$cas=array();\r\n\tforeach ($tops as $top) {$max=$max*$top;array_push($cas,0);}\r\n\t\r\n\t$res=array();\r\n\t\r\n\tarray_push($res,$cas);\r\n\t\r\n\tfor ($i=0;$i<$max-1;$i++){\r\n\t\t$cas[0]++;\r\n\t\tpermutator_overflow($cas,$tops);\r\n\t\tarray_push($res,$cas);\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $res;\r\n\t\r\n}", "public static function distinctTriplets($n)\n {\n $arr = array();\n echo \"enter the elements \\n\";\n\n //enter the elements to array\n for ($i = 0; $i < $n; $i++) {\n $arr[$i] = Utility::readInt();\n }\n $totalDistinct = 0;\n\n for ($i = 0; $i < sizeof($arr); $i++) {\n for ($j = $i + 1; $j < sizeof($arr); $j++) {\n for ($k = $j + 1; $k < sizeof($arr); $k++) {\n\n //sum of three values of arry is equal to 0\n if (($arr[$i] + $arr[$j] + $arr[$k]) == 0) {\n echo $arr[$i] . \" \", $arr[$j] . \" \" . $arr[$k] . \" \";\n $totalDistinct++;\n }\n }\n }\n }\n echo \"\\n total distinct triplets are \" . $totalDistinct . \"\\n\";\n }", "private function getLeftShift()\n {\n if ($this->currentPage < 3) {\n $shift = 3;\n } else {\n $shift = 1;\n }\n return $shift;\n }", "function solution($A)\n{\n $pairs = $zeros = 0;\n\n foreach ($A as $k => $v) {\n $zeros += ($v === 0);\n\n if ($v===1) {\n $pairs += $zeros;\n }\n\n if ($pairs>1000000000) {\n $pairs = -1;\n break;\n }\n }\n\n return $pairs;\n}", "function array_method($a){\n\t$tmpArray = array_fill(0,count($a),0);\n\n\tforeach($a as $v) {\n\t\t$tmpArray[$v-1] ++;\n\t\tif($tmpArray[$v-1] >1) {\n\t\t\treturn $v;\n\t\t}\n\t}\n}", "public static function fibonacci(IInt32\\Type $n) : IInt32\\Type {\n\t\t\treturn (IInt32\\Module::le($n, IInt32\\Type::one())->unbox())\n\t\t\t\t? $n\n\t\t\t\t: IInt32\\Module::add(IInt32\\Module::fibonacci(IInt32\\Module::decrement($n)), IInt32\\Module::fibonacci(IInt32\\Module::subtract($n, IInt32\\Type::box(2))));\n\t\t}", "function fibona4i($n)\n{\n static $callCount;\n static $cache;\n $callCount++;\n //echo $callCount.PHP_EOL; //счётчик количества итераций\n if ($n == 1 || $n == 2) {\n return 1;\n } else {\n if (!isset($cache[$n-1])) {\n $cache[$n-1] = fibona4i($n - 1);\n }\n $n1 = $cache[$n - 1];\n $n2 = fibona4i($n - 2);\n return $n1 + $n2;\n }\n}", "function odd_even($n) {\n $odd_even = fmod($n, 2);\n if($odd_even == 1) {\n return '_';\n } else {\n return 'true';\n }\n }", "function factorielle($n) : float\n{\n\treturn ($n === 0) ? 1 : $n*factorielle($n-1);\n}", "function swapNibbles($number)\n {\n $swap_nibbles = (($number & 0x0F) << 4 | ($number & 0xF0) >> 4);\n $power = $swap_nibbles;\n echo \"\\n\" . \"Number generated after swapping nibbles is: \" . $swap_nibbles;\n AlgorithmsUtility::checkpower($power);\n }", "public static function factorial(IInt32\\Type $n) : IInt32\\Type {\n\t\t\treturn (IInt32\\Module::eq($n, IInt32\\Type::zero())->unbox())\n\t\t\t\t? IInt32\\Type::one()\n\t\t\t\t: IInt32\\Module::multiply($n, IInt32\\Module::factorial(IInt32\\Module::decrement($n)));\n\t\t}", "function fac($n)\n{\n if($n == 0)\n {\n return 1;\n }\n else\n {\n return $n * fac($n - 1); \n }\n}", "function solution(array $A) {\n $result = $started = 0;\n foreach ($A as $d) {\n if ($d === 0) {\n $started++;\n } else if ($d === 1 and $started > 0) {\n $result += $started;\n }\n }\n if ($result > (int) 1E9) {\n return -1;\n }\n return $result;\n}" ]
[ "0.62852633", "0.6116158", "0.6056246", "0.6055227", "0.60162616", "0.57413346", "0.55304277", "0.5477094", "0.5446826", "0.5413623", "0.53752816", "0.53333426", "0.53181046", "0.52793753", "0.5232766", "0.51740205", "0.5160071", "0.5099801", "0.5079656", "0.50759155", "0.5041144", "0.503121", "0.5020721", "0.50112003", "0.4995265", "0.49617624", "0.49477643", "0.49469203", "0.49142325", "0.49093655", "0.4908738", "0.49005157", "0.48514572", "0.48120773", "0.47957888", "0.47915062", "0.47819042", "0.47567165", "0.4740805", "0.47371396", "0.47339", "0.47330907", "0.47049534", "0.4699748", "0.4698842", "0.46891734", "0.4674594", "0.46561837", "0.46368125", "0.46362743", "0.4626194", "0.46157077", "0.46101573", "0.46024722", "0.459469", "0.45862097", "0.45762974", "0.45707253", "0.45602968", "0.45515484", "0.4551204", "0.4545742", "0.45318946", "0.45202056", "0.45056525", "0.44798598", "0.44693938", "0.44628045", "0.4458602", "0.44443986", "0.4429785", "0.4425485", "0.4419993", "0.44092205", "0.43883425", "0.43867055", "0.4383722", "0.43835407", "0.43803236", "0.43797535", "0.43719217", "0.43527168", "0.43509147", "0.43475986", "0.4347232", "0.43411404", "0.43385243", "0.43352032", "0.43335816", "0.4324942", "0.43248016", "0.43205747", "0.43167016", "0.43160146", "0.43100694", "0.43061367", "0.4300702", "0.4298079", "0.4287672", "0.42776552" ]
0.7070557
0
appends values to template variables by reference
дополняет значения в переменных шаблона по ссылке
function AppendByRef($tpl_var, &$value, $merge=false) { $this->_smarty->append_by_ref($tpl_var, $value, $merge); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addVariables($tvs = array());", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "function AssignByRef($tpl_var, &$value)\n {\n $this->_smarty->assign_by_ref($tpl_var, $value);\n }", "public function append($var, $value) {\n\t\tif (isset($this->tpl_vars[$var])) {\n\t\t\tif (!is_array($this->tpl_vars[$var])) {\n\t\t\t\tsettype($this->tpl_vars[$var], 'array');\n\t\t\t}\n\t\t\t$this->tpl_vars[$var][] = $value;\n\t\t} else {\n\t\t\t$this->tpl_vars[$var] = array($value);\n\t\t}\n\t}", "function Append($tpl_var, $value=null, $merge=false)\n {\n $this->_smarty->append( $tpl_var, $value, $merge );\n }", "public static function assignByRef($key,&$value) {\r\n\t\tself::$_smarty->assignByRef($key,$value);\r\n\t}", "public function addVariable($tv);", "public function replaceTemplateVars($new_vars = array()){\n\t\t$this->template_data = $new_vars;\n\t}", "function cps_changeset_publish_batch_variables(&$context) {\n $item = $context['results']['entity'];\n foreach ($item->variables as $name => $value) {\n db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();\n }\n cache_clear_all('variables', 'cache_bootstrap');\n $context['message'] = t('Publishing variables');\n}", "function array_capture ($array){\n\t $this->template = array_merge($this->template, $array);\n\t}", "function set_var($name, $value){ // set the template variable\n\tif (func_num_args()> 2){\n\t\tif (!$this->in_vars($name)) $this->vars[$name] = array();\n\t\t$this->vars[$name][func_get_arg(2)] = $value;\n\t} else $this->vars[$name] = $value;\n}", "public function addVariable($name, $value);", "protected function _injectTplVariable()\r\n {\r\n $oConfig = oxRegistry::getConfig();\r\n $sTplVariableName = $oConfig->getConfigParam('sTplVariable');\r\n if ($sTplVariableName) {\r\n $oConfig->getActiveView()->addTplParam($sTplVariableName, $this->getToxid());\r\n }\r\n }", "public function assignTemplateVariable($varName, $varValue);", "public function insertVars($vars) {\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "function attendance_template_variables($record) {\n $templatevars = array(\n '/%coursename%/' => $record->coursename,\n '/%courseid%/' => $record->courseid,\n '/%userfirstname%/' => $record->firstname,\n '/%userlastname%/' => $record->lastname,\n '/%userid%/' => $record->userid,\n '/%warningpercent%/' => $record->warningpercent,\n '/%attendancename%/' => $record->aname,\n '/%cmid%/' => $record->cmid,\n '/%numtakensessions%/' => $record->numtakensessions,\n '/%points%/' => $record->points,\n '/%maxpoints%/' => $record->maxpoints,\n '/%percent%/' => round($record->percent * 100),\n );\n $extrauserfields = \\core_user\\fields::get_name_fields();\n foreach ($extrauserfields as $extra) {\n $templatevars['/%'.$extra.'%/'] = $record->$extra;\n }\n $patterns = array_keys($templatevars); // The placeholders which are to be replaced.\n $replacements = array_values($templatevars); // The values which are to be templated in for the placeholders.\n // Array to describe which fields in reengagement object should have a template replacement.\n $replacementfields = array('emailsubject', 'emailcontent');\n\n // Replace %variable% with relevant value everywhere it occurs in reengagement->field.\n foreach ($replacementfields as $field) {\n $record->$field = preg_replace($patterns, $replacements, $record->$field);\n }\n return $record;\n}", "public static function addVars($arr){\n self::$vars = array_merge(self::$vars, $arr);\n }", "public function appendTemporaryValue($key, $value) {\n $this->entity->_exoComponent[$this->viewMode][$key][] = $value;\n return $this;\n }", "function prepare_vars_for_template_usage()\n {\n }", "public function addVar($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}", "public function append($values);", "function getTemplateVariableContainer() ;", "private function assignValues() {\n $this->setIndicators('value');\n\n $leftIndicator = $this->sugarTemplateIndicators['valueLeft'] . $this->sugarTemplateIndicators['valueSeparator'];\n $rightIndicator = $this->sugarTemplateIndicators['valueSeparator'] . $this->sugarTemplateIndicators['valueRight'];\n\n foreach ($this->assignedValues as $tag => $value) {\n $this->rootContent = str_replace($leftIndicator . $tag . $rightIndicator, $value, $this->rootContent);\n }\n }", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function pagelines_less_var( $name, $value ){\n\t\n\tglobal $less_vars;\n\t\n\t$less_vars[$name] = $value;\n\t\n}", "function assignToView($variable_name, $variable_value = null) {\r\n $template_engine = Angie::getTemplateEngine();\r\n if(is_array($variable_name)) {\r\n foreach($variable_name as $k => $v) {\r\n $template_engine->assignToView($k, $v);\r\n } // foreach\r\n } else {\r\n $template_engine->assignToView($variable_name, $variable_value);\r\n } // if\r\n }", "protected function setTemplateVariables() {}", "function smarty_function_sugar_replace_vars($params, &$smarty)\n{\n\tif(empty($params['subject'])) {\n\t $smarty->trigger_error(\"sugarvar: missing 'subject' parameter\");\n\t return;\n\t} \n\t$fields = empty($params['fields']) ? $smarty->get_template_vars('fields') : $params['fields'];\n $subject = replace_sugar_vars($params['subject'], $fields, !empty($params['use_curly']));\n\tif (!empty($params['assign']))\n\t{\n\t\t$smarty->assign($params['assign'], $subject);\n\t\treturn '';\n\t}\n\t\n\treturn $subject;\n}", "protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }", "public function setVarsByReference(array &$value)\n {\n $this->_contents =& $value;\n return $this;\n }", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "function set($name, $value) {\n $args = func_get_args();\n $cnt = count($args);\n // we check for odd number of args => missing values...\n if ($cnt % 2 == 0 && $cnt >= 2 ) {\n for ($i=0; $i < $cnt; $i += 2) {\n $name = $args[$i];\n $value = $args[$i + 1];\n $this->vars[$name] = ($value instanceof Template) ? $value->fetch() : $value;\n }\n } \n }", "public static function bind_global($key, & $value) {\r\n View::$_global_data[$key] = &$value;\r\n View::$_global_bound_variables[$key] = TRUE;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty::$global_tpl_vars[$key] = new Smarty_variable($value);\r\n Smarty::$global_tpl_vars[$key]->value = &$value;\r\n }\r\n}", "function addVar($varName,$value)\n {\n $this->VARS[${'varName'}][0] = $varName;\n $this->VARS[${'varName'}][1] = $value;\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "function addVars($node, $vars) {\n\tforeach ($vars as $name=>$val) {\n\t\t$var = $node->data->addChild('var', $val);\n\t\t$var->addAttribute('name', $name);\n\t}\n}", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}", "private function append($value)\n {\n \t$this->values[] = $value;\n }", "public function render()\n {\n $name = $this->arguments['name'];\n $value = $this->arguments['value'];\n\n if (null === $value) {\n $value = $this->renderChildren();\n }\n if (false === strpos($name, '.')) {\n if (true === $this->templateVariableContainer->exists($name)) {\n $this->templateVariableContainer->remove($name);\n }\n $this->templateVariableContainer->add($name, $value);\n } elseif (1 === substr_count($name, '.')) {\n $parts = explode('.', $name);\n $objectName = array_shift($parts);\n $path = implode('.', $parts);\n if (false === $this->templateVariableContainer->exists($objectName)) {\n return;\n }\n $object = $this->templateVariableContainer->get($objectName);\n try {\n ObjectAccess::setProperty($object, $path, $value);\n // Note: re-insert the variable to ensure unreferenced values like arrays also get updated\n $this->templateVariableContainer->remove($objectName);\n $this->templateVariableContainer->add($objectName, $object);\n } catch (\\Exception $error) {\n return;\n }\n }\n }", "public function setDataIntoTemplate($reference,$data) {\n\t$this->assign($reference,$data);\n }", "function replacevars($arrSubstitutes)\n {\n foreach($arrSubstitutes as $var=>$value)\n {\n $this->template = str_replace('<!--['.strtoupper($var).']-->',$value,$this->template);\n }\n \n }", "function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "public function getTemplateVariables()\n\t{\n\t\treturn array_merge($this->template_variables, [\n\t\t\t'options' => $this->getOptions(),\n\t\t\t'column' => $this->getColumn(),\n\t\t\t'key' => $this->getKey(),\n\t\t\t'status' => $this\n\t\t]);\n\t}", "function _handle_array_var_append($key, $val, &$vars)\n{\n $val2 = mixed();\n\n foreach ($val as $key2 => $val2) {\n if (!is_string($key2)) {\n $key2 = strval($key2);\n }\n\n if (is_array($val2)) {\n _handle_array_var_append($key . '[' . $key2 . ']', $val2, $vars);\n } else {\n if (get_magic_quotes_gpc()) {\n $val2 = stripslashes($val2);\n }\n\n $vars[$key . '[' . $key2 . ']'] = $val2;\n }\n }\n}", "function makeValuesReferenced($arr){\n $refs = array();\n foreach($arr as $key => $value)\n $refs[$key] = &$arr[$key];\n return $refs;\n}", "public function getTemplateVariables(): array;", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "public function getTemplateVariableContainer() {}", "function setVariables($value) {\n \tif(is_array($value)) {\n \t return parent::setVariables(implode(\"\\n\", $value));\n \t} else {\n \t return parent::setVariables($value);\n \t} // if\n }", "function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }", "function template_tags ($s_template, $a_values) {\n\tforeach ($a_values as $key=>&$value) $s_template = template_tag ($s_template, $key, $value);\n\treturn $s_template;\n}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function setVarsByReference(array &$vars)\n {\n $this->_vars =& $vars;\n return $this;\n }", "function GlobalReplace($template){\n\tglobal $globalVars;\n\n\tforeach ($globalVars as $key => $value) {\r\n\t\t$template = str_replace('{'.$key.'}', $value, $template);\r\n\t}\n\n\treturn $template;\r}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "function addVariable($name,$value,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= '$'.$name.' = '.$this->prepareVariableString($value).';'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= '$'.$name.' = $'.$value.\";\".chr(10);\n\t\t } \n\t\t}", "public function register_replace_vars( $context ) {\n\t\t$replace_vars = [\n\t\t\t'main_schema_id' => $context->main_schema_id,\n\t\t\t'author_id' => $this->id_helper->get_user_schema_id( $context->indexable->author_id, $context ),\n\t\t\t'person_id' => $context->site_url . Schema_IDs::PERSON_HASH,\n\t\t\t'primary_image_id' => $context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH,\n\t\t\t'webpage_id' => $context->canonical . Schema_IDs::WEBPAGE_HASH,\n\t\t\t'website_id' => $context->site_url . Schema_IDs::WEBSITE_HASH,\n\t\t\t'organization_id' => $context->site_url . Schema_IDs::ORGANIZATION_HASH,\n\t\t];\n\n\t\tif ( $context->post ) {\n\t\t\t// Post does not always exist, e.g. on term pages.\n\t\t\t$replace_vars['post_date'] = $context->post->post_date;\n\t\t}\n\n\t\tforeach ( $replace_vars as $var => $value ) {\n\t\t\t$this->register_replacement( $var, $value );\n\t\t}\n\t}", "public function appendValue($value) {\n $this->current->value($value);\n }", "function getVariableContainer() ;", "function generateTemplateVariableHTML($rec,$cntr) {\n global $_TABLES,$_CONF;\n\n $p = new Template($_CONF['path_layout'] . 'nexflow/admin');\n $p->set_file ('variables','template_variables.thtml');\n $p->set_file ('variable_rec','template_variable_record.thtml');\n\n $p->set_var('template_id',$rec);\n $p->set_var('cntr',$cntr);\n\n $sql = \"SELECT * FROM {$_TABLES['nftemplatevariables']} WHERE nf_templateID='{$rec}' ORDER BY id\";\n $query = DB_Query($sql);\n $numrows = DB_numrows($query);\n if ($numrows > 0) {\n $j=1;\n $p->set_var('show_vars','');\n $p->set_var('vdivid','');\n\n while ( $A = DB_fetchArray($query) ) {\n $edit_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"edit\\\",{$rec},{$cntr},{$j});'\\\">Edit</a>&nbsp;]\";\n $del_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"delete\\\",{$rec},{$cntr},{$j});'\\\">Delete</a>&nbsp;]\";\n $p->set_var('variable_name',$A['variableName']);\n $p->set_var('variable_value',$A['variableValue']);\n $p->set_var('var_id',$j);\n $p->set_var('edit_link',$edit_link);\n $p->set_var('delete_link',$del_link);\n if ($j == 1) {\n $p->parse('template_variable_records','variable_rec');\n } else {\n $p->parse('template_variable_records','variable_rec',true);\n }\n $j++;\n }\n } else {\n $p->set_var('show_vars','none');\n $p->set_var('vdivid',\"vars{$cntr}\");\n $p->set_var('template_variable_records','');\n }\n $p->parse ('output', 'variables');\n $html = $p->finish ($p->get_var('output'));\n $html = htmlentities($html);\n\n return $html;\n}", "public function AddVar($key, $var)\n {\n $this->aTemplateData[$key] = $var;\n }", "private function replaceVariables( $value_with_placeholders, array $variable_set )\n {\n $variable_set = array_combine( array_map( function( $key )\n {\n return '[' . $key . ']';\n }, array_keys( $variable_set ) ), array_values( $variable_set ) );\n\n return strtr( $value_with_placeholders, $variable_set );\n }", "public function set($var, $value){\n\t\t\t$this->template_vars[$var] = $value;\n\t\t}", "function copy_value($v) {\r\n return $v;\r\n}", "static function expandRefs($value) {\n if (is_array($value)) {\n if (self::isRef($value)) {\n return self::getRef($value);\n } else {\n foreach ($value as $k => $v) {\n $value[$k] = self::expandRefs($v);\n }\n }\n }\n return $value;\n }", "function assign_vars($vararray)\n\t{\n\t\t$this->_tpldata['.'][0] = array_merge(empty($this->_tpldata['.'][0]) ? array() : $this->_tpldata['.'][0], $vararray);\n\t\treturn true;\n\t}", "protected function addBootstrapVariables()\n {\n $objFile = new \\File($this->getBootstrapSrc('variables.less'));\n\n $strVariables = '';\n\n if ($objFile->size > 0)\n {\n $strVariables = $objFile->getContent();\n }\n\n if (!is_array($this->variablesOrderSRC))\n {\n return;\n }\n\n $objTarget = new \\File($this->getBootstrapCustomSrc($this->variablesSrc));\n\n // overwrite bootstrap variables with custom variables\n $objFilesModels = \\FilesModel::findMultipleByUuids($this->variablesOrderSRC);\n\n if ($objFilesModels !== null)\n {\n while ($objFilesModels->next())\n {\n $objFile = new \\File($objFilesModels->path);\n $strContent = $objFile->getContent();\n\n if ($this->isFileUpdated($objFile, $objTarget))\n {\n $this->rewrite = true;\n $this->rewriteBootstrap = true;\n if ($strContent)\n {\n $strVariables .= \"\\n\" . $strContent;\n }\n }\n else\n {\n $strVariables .= \"\\n\" . $strContent;\n }\n }\n }\n\n if ($this->rewriteBootstrap)\n {\n $objTarget->write($strVariables);\n $objTarget->close();\n }\n\n $this->objLess->parse($strVariables);\n }", "public function addReferenceIds( $value){\n return $this->_add(2, $value);\n }", "public function addVariables(\\obiba\\mica\\DatasetVariableDto $value) {\n return $this->_add(2, $value);\n }", "protected function buildValues($hook, $variables) {\n // We want ContentEntity only for now.\n if ($entity = $this->getEntity($hook, $variables)) {\n $variables['#_value'][\"_{$entity->bundle()}\"] = \\Drupal::service('serializer')\n ->normalize($entity, 'value');\n }\n\n return $variables;\n }", "public function addVars(array $vars = array())\n\t{\n\t\tforeach($vars as $var => $value)\n\t\t{\n\t\t\t$this->vars[$var] = $value;\n\t\t}\n\t}", "private function addToBindings($value)\n {\n if (is_array($value)){\n $this->bindings = array_merge($this->bindings , array_values($value));\n }\n else{\n $this->bindings[] = $value;\n }\n }", "function assign_global($key, $value = null)\n\t{\n\t\t\tforeach ($this->data as $k => $v)\t // iterate through data\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (get_class($v) == 'Template') // if data is template object\n\t\t\t\t{\n\t\t\t\t\t$v->assign($key, $value);\t // assign to it\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->assign($key, $value);\t\t // assign to this template also\n\t}", "public function addVariables(\\obiba\\mica\\DatasetVariableDto $value) {\n return $this->_add(4, $value);\n }", "public function replaceVariable()\n {\n $args = func_get_args();\n $cloneDom = '';\n $domParent = '';\n\n if (is_string($args[0])) {\n // Sometimes Word splits tags. Find and replace all of them with\n // new string surrounded by template symbol value\n $documentSymbol =\n explode(self::$_templateSymbol, self::$_document);\n foreach ($documentSymbol as $documentSymbolValue) {\n if (strip_tags($documentSymbolValue) == $args[0]) {\n self::$_document = str_replace(\n $documentSymbolValue, $args[0], self::$_document\n );\n }\n }\n }\n\n // Replace VAR within DOCX.\n if ($args[2] == 'docx' && is_string($args[0]) && is_string($args[1])) {\n if (!$this->_isDOCX) {\n $this->addContentTypes('<Default Extension=\"zip\" ContentType=\"application/vnd.openxmlformats'\n . '-officedocument.wordprocessingml.document.main+xml\"> </Default>');\n $this->_isDOCX = true;\n }\n $this->addRelationship('<Relationship Id=\"rDOCXId' . $this->_idDOCX .\n '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/' .\n 'aFChunk\" Target=\"docx' . $this->_idDOCX .\n '.zip\" TargetMode=\"Internal\"></Relationship>');\n // add source and dest filepath\n self::$embedFiles[] = array(\n 'src_file' => $args[1],\n 'dest_file' => 'docx' . $this->_idDOCX . '.zip'\n );\n $args[1] = '<' . CreateElement::NAMESPACEWORD . ':altChunk r:id=\"rDOCXId' . $this->_idDOCX . '\" ' .\n 'xmlns:r=\"http://schemas.openxmlformats.org/' . 'officeDocument/2006/relationships\" ' .\n 'xmlns:w=\"http://schemas.openxmlformats.org/' . 'wordprocessingml/2006/main\" />';\n $this->_idDOCX++;\n }\n\n // Replace VAR within MHT.\n if ($args[2] == 'mht' && is_string($args[0]) && is_string($args[1])) {\n if (!$this->_isMHT) {\n $this->addContentTypes('<Default Extension=\"mht\" ContentType=\"message/rfc822\"> </Default>');\n $this->_isMHT = true;\n }\n $this->addRelationship('<Relationship Id=\"rMHTId' . $this->_idMHT .\n '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/' .\n 'relationships/aFChunk\" Target=\"mht' . $this->_idMHT .\n '.mht\" TargetMode=\"Internal\"></Relationship>');\n // add source string and dest filepath\n self::$embedFiles[] = array(\n 'src_file' => $args[1],\n 'dest_file' => 'mht' . $this->_idMHT . '.mht'\n );\n $args[1] = '<' . CreateElement::NAMESPACEWORD . ':altChunk r:id=\"rMHTId' . $this->_idMHT . '\" ' .\n 'xmlns:r=\"http://schemas.openxmlformats.org/' . 'officeDocument/2006/relationships\" ' .\n 'xmlns:w=\"http://schemas.openxmlformats.org/' . 'wordprocessingml/2006/main\" />';\n $this->_idMHT++;\n }\n\n // Replace VAR within HTML.\n if ($args[2] == 'html' && is_string($args[0]) && is_string($args[1])) {\n if (!$this->_isHTML) {\n $this->addContentTypes('<Default Extension=\"htm\" ContentType=\"application/xhtml+xml\"> </Default>');\n $this->_isHTML = true;\n }\n $this->addRelationship('<Relationship Id=\"rHTMLId' . $this->_idHTML .\n '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/' .\n 'relationships/aFChunk\" Target=\"html' . $this->_idHTML .\n '.htm\" TargetMode=\"Internal\"></Relationship>');\n // add source string and dest filepath\n self::$embedFiles[] = array(\n 'src_string' => '<html>' . $args[1] . '</html>',\n 'dest_file' => 'html' . $this->_idHTML . '.htm'\n );\n $args[1] = '<' . CreateElement::NAMESPACEWORD . ':altChunk r:id=\"rHTMLId' . $this->_idHTML . '\" ' .\n 'xmlns:r=\"http://schemas.openxmlformats.org/' . 'officeDocument/2006/relationships\" ' .\n 'xmlns:w=\"http://schemas.openxmlformats.org/' . 'wordprocessingml/2006/main\" />';\n $this->_idHTML++;\n }\n\n // Replace VAR within an image.\n if ($args[2] == 'image' && is_string($args[0]) && is_string($args[1])) {\n // transform image to MHT file to embed it\n $imageToMHT = new MhtFileMaker();\n list($imgWidth, $imgHeight, $imgType, $imgAttr) = getimagesize($args[1]);\n $imageToMHT->AddContents('file:///C:/2673C891/Doc1.htm', 'text/html; charset=\"us-ascii\"', chunk_split('<html xmlns:v=3D\"urn:schemas-microsoft-com:vml\" xmlns:o=3D\"urn:schemas-microsoft-com:office:office\" xmlns:w=3D\"urn:schemas-microsoft-com:office:word\" xmlns:m=3D\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns=3D\"http://www.w3.org/TR/REC-html40\"><head></head><body lang=3DEN-US style=3D\\'tab-interval:36.0pt\\'><div class=3DSection1><p class=3DMsoNormal><span style=3D\\'mso-no-proof:yes\\'><!--[if gte vml 1]><v=:shapetype id=3D\"_x0000_t75\" coordsize=3D\"21600,21600\" o:spt=3D\"75\" o:preferrelative==3D\"t\" path=3D\"m@4@5l@4@11@9@11@9@5xe\" filled=3D\"f\" stroked=3D\"f\"> <v:stroke joinstyle=3D\"miter\"/> <v:formulas><v:f eqn=3D\"if lineDrawn pixelLineWidth 0\"/><v:f eqn=3D\"sum @0 1 0\"/><v:f eqn=3D\"sum 0 0 @1\"/><v:f eqn=3D\"prod @2 1 2\"/><v:f eqn=3D\"prod @3 21600 pixelWidth\"/><v:f eqn=3D\"prod @3 21600 pixelHeight\"/><v:f eqn=3D\"sum @0 0 1\"/><v:f eqn=3D\"prod @6 1 2\"/><v:f eqn=3D\"prod @7 21600 pixelWidth\"/><v:f eqn=3D\"sum @8 21600 0\"/><v:f eqn=3D\"prod @7 21600 pixelHeight\"/><v:f eqn=3D\"sum @10 21600 0\"/></v:formulas><v:path o:extrusionok=3D\"f\" gradientshapeok=3D\"t\" o:connecttype=3D\"rect\"/><o:lock v:ext=3D\"edit\" aspectratio=3D\"t\"/></v:shapetype><v:shape id=3D\"Picture_x0020_1\" o:spid=3D\"_x0000_i1025\" type=3D\"#_x0000_t75\" style=3D\\'width:' . $imgWidth . 'pt;height:' . $imgHeight . 'pt;visibility:visible;mso-wrap-style:square\\'><v:imagedata src=3D\"Doc1_files/image001.' . $imageToMHT->GetExtension($args[1]) . '\" o:title=3D\"\"/></v:shape><![endif]--></span></p></div></body></html>', 5000), 'quoted-printable');\n $imageToMHT->AddFile($args[1]);\n if (!$this->_isMHT) {\n $this->addContentTypes('<Default Extension=\"mht\" ContentType=\"message/rfc822\"> </Default>');\n $this->_isMHT = true;\n }\n $this->addRelationship('<Relationship Id=\"rMHTId' . $this->_idMHT .\n '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/' .\n 'relationships/aFChunk\" Target=\"mht' . $this->_idMHT .\n '.mht\" TargetMode=\"Internal\"></Relationship>');\n // add source string and dest filepath\n self::$embedFiles[] = array(\n 'src_string' => $imageToMHT->GetFile(),\n 'dest_file' => 'mht' . $this->_idMHT . '.mht'\n );\n $args[1] = '<' . CreateElement::NAMESPACEWORD . ':altChunk r:id=\"rMHTId' . $this->_idMHT . '\" ' .\n 'xmlns:r=\"http://schemas.openxmlformats.org/' . 'officeDocument/2006/relationships\" ' .\n 'xmlns:w=\"http://schemas.openxmlformats.org/' . 'wordprocessingml/2006/main\" />';\n $this->_idMHT++;\n }\n\n // Replace VAR within RTF.\n if ($args[2] == 'rtf' && is_string($args[0]) && is_string($args[1])) {\n if (!$this->_isRTF) {\n $this->addContentTypes('<Default Extension=\"rtf\" ContentType=\"application/rtf\"> </Default>');\n $this->_isRTF = true;\n }\n $this->addRelationship('<Relationship Id=\"rRTFId' . $this->_idRTF .\n '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/' .\n 'aFChunk\" Target=\"rtf' . $this->_idRTF . '.rtf\" TargetMode=\"Internal\">' .\n '</Relationship>');\n // add source and dest filepath\n self::$embedFiles[] = array(\n 'src_file' => $args[1],\n 'dest_file' => 'rtf' . $this->_idRTF . '.rtf'\n );\n $args[1] = '<' . CreateElement::NAMESPACEWORD .\n ':altChunk r:id=\"rRTFId' . $this->_idRTF . '\" ' .\n 'xmlns:r=\"http://schemas.openxmlformats.org/' .\n 'officeDocument/2006/relationships\" ' .\n 'xmlns:w=\"http://schemas.openxmlformats.org/' .\n 'wordprocessingml/2006/main\" />';\n $this->_idRTF++;\n }\n\n // Only lists and tables are supported.\n if (($args[1] == 'list' || $args[1] == 'table') && is_array($args[0])) {\n $domDocument = new DomDocument();\n $domDocument->loadXML(self::$_document);\n\n $xmlWP = $domDocument->getElementsByTagNameNS(\n 'http://schemas.openxmlformats.org/wordprocessingml/2006/main',\n 'p'\n );\n $xpath = new DOMXPath($domDocument);\n $query = 'w:r/w:t';\n $length = $xmlWP->length;\n $itemsWP = array();\n for ($i = 0; $i < $length; $i++) {\n $itemsWP[$i] = $xmlWP->item($i);\n }\n for ($i = 0; $i < $length; $i++) {\n $variables = $xpath->query($query, $itemsWP[$i]);\n foreach ($variables as $entry) {\n if (isset($args[2]['header'])) {\n foreach ($args[0] as $valuesArray) {\n foreach ($valuesArray as $keys => $values) {\n if (empty($entry->nodeValue)) {\n continue;\n }\n if (\n strpos(\n $entry->nodeValue,\n self::$_templateSymbol . $keys .\n self::$_templateSymbol\n ) !== false\n ) {\n if ($args[1] == 'list') {\n $domP = $entry->parentNode->parentNode;\n $domParent = $entry->parentNode->\n parentNode->parentNode;\n $cloneDom = $entry->\n parentNode->parentNode->cloneNode(true);\n try {\n $domP->parentNode->insertBefore(\n $cloneDom, $domP\n );\n }\n catch (Exception $e) {\n CreateDocx::$log->fatal(\n $e->getMessage()\n );\n exit();\n }\n } elseif ($args[1] == 'table') {\n $domTR = $entry->parentNode->\n parentNode->parentNode->\n parentNode;\n if (\n $entry->parentNode->\n parentNode->parentNode->\n parentNode->nodeName == 'w:tr'\n ) {\n $domParent = $entry->parentNode->\n parentNode->parentNode->\n parentNode->parentNode;\n $cloneDom = $entry->parentNode->\n parentNode->parentNode->\n parentNode->cloneNode(true);\n try {\n $domTR->parentNode->insertBefore(\n $cloneDom, $domTR\n );\n }\n catch (Exception $e) {\n CreateDocx::$log->fatal(\n $e->getMessage()\n );\n exit();\n }\n }\n }\n }\n /* Only the first key is needed to iterate over\n * DOM and clone the required nodes.\n */\n break;\n }\n }\n } else {\n if ($args[1] == 'list') {\n $domP = $entry->parentNode->parentNode;\n $domParent = $entry->parentNode->\n parentNode->parentNode;\n $cloneDom = $entry->\n parentNode->parentNode->cloneNode(true);\n try {\n $domP->parentNode->insertBefore(\n $cloneDom, $domP\n );\n }\n catch (Exception $e) {\n CreateDocx::$log->fatal(\n $e->getMessage()\n );\n exit();\n }\n } elseif ($args[1] == 'table') {\n $domTR = $entry->parentNode->\n parentNode->parentNode->\n parentNode;\n if (\n $entry->parentNode->\n parentNode->parentNode->\n parentNode->nodeName == 'w:tr'\n ) {\n $domParent = $entry->parentNode->\n parentNode->parentNode->\n parentNode->parentNode;\n $cloneDom = $entry->parentNode->\n parentNode->parentNode->\n parentNode->cloneNode(true);\n try {\n $domTR->parentNode->insertBefore(\n $cloneDom, $domTR\n );\n }\n catch (Exception $e) {\n CreateDocx::$log->fatal(\n $e->getMessage()\n );\n exit();\n }\n }\n }\n /* Only the first key is needed to iterate over\n * DOM and clone the required nodes.\n */\n break;\n }\n }\n }\n /* A last element is created due to number of values plus the first\n * used as placeholder. Just remove it.\n */\n if (is_object($domParent)) {\n $domParent->removeChild($cloneDom);\n }\n self::$_document = $domDocument->saveXML();\n }\n\n // Iterate text array.\n if (is_string($args[0]) && is_array($args[1])) {\n $domDocument = new DomDocument();\n $domDocument->loadXML(self::$_document);\n\n $xmlWP = $domDocument->getElementsByTagNameNS(\n 'http://schemas.openxmlformats.org/wordprocessingml/2006/main',\n 'p'\n );\n $xpath = new DOMXPath($domDocument);\n $query = 'w:r/w:t';\n $length = $xmlWP->length;\n $itemsWP = array();\n for ($i = 0; $i < $length; $i++) {\n $itemsWP[$i] = $xmlWP->item($i);\n }\n for ($i = 0; $i < $length; $i++) {\n $variables = $xpath->query($query, $itemsWP[$i]);\n foreach ($variables as $entry) {\n foreach ($args[1] as $values) {\n if (\n self::$_templateSymbol . $args[0] .\n self::$_templateSymbol ==\n $entry->nodeValue\n && $entry->nodeValue != '$'\n ) {\n $domP = $entry->parentNode->parentNode;\n $domParent = $entry->parentNode->\n parentNode->parentNode;\n $cloneDom = $entry->\n parentNode->parentNode->cloneNode(true);\n try {\n $domP->parentNode->insertBefore(\n $cloneDom, $domP\n );\n }\n catch (Exception $e) {\n CreateDocx::$log->fatal(\n $e->getMessage()\n );\n exit();\n }\n }\n }\n }\n }\n /* A last element is created due to number of values plus the first\n * used as placeholder. Just remove it.\n */\n if (is_object($domParent)) {\n $domParent->removeChild($cloneDom);\n }\n self::$_document = $domDocument->saveXML();\n }\n\n if (is_string($args[0])) {\n // Text string or array of texts\n if (is_string($args[1])) {\n // if text string escape chars\n if (empty($args[2])) {\n $args[1] = htmlspecialchars($args[1]);\n }\n // Single text string\n self::$_document = str_replace(\n self::$_templateSymbol . $args[0]\n . self::$_templateSymbol,\n $args[1],\n self::$_document\n );\n $i = 0;\n foreach (self::$_footer as $footer) {\n self::$_footer[$i] = str_replace(self::$_templateSymbol . $args[0] . self::$_templateSymbol,\n $args[1], $footer);\n $i++;\n }\n $i = 0;\n foreach (self::$_header as $header) {\n self::$_header[$i] = str_replace(self::$_templateSymbol . $args[0] . self::$_templateSymbol,\n $args[1], $header);\n $i++;\n }\n } elseif (is_array($args[1])) {\n // Text array\n foreach ($args[1] as $values) {\n // if text string escape chars\n if (empty($args[2])) {\n $values = htmlspecialchars($values);\n }\n self::$_document = preg_replace(\n '/\\\\' . self::$_templateSymbol . $args[0]\n . '\\\\' . self::$_templateSymbol . '/',\n $values,\n self::$_document,\n 1\n );\n $i = 0;\n foreach (self::$_footer as $footer) {\n self::$_footer[$i] = preg_replace('/\\\\' . self::$_templateSymbol . $args[0] . '\\\\' .\n self::$_templateSymbol . '/', $values, $footer, 1);\n $i++;\n }\n $i = 0;\n foreach (self::$_header as $header) {\n self::$_header[$i] = preg_replace('/\\\\' . self::$_templateSymbol . $args[0] . '\\\\' .\n self::$_templateSymbol . '/', $values, $header, 1);\n $i++;\n }\n }\n }\n } elseif (is_array($args[0])) {\n // List or table\n foreach ($args[0] as $values) {\n foreach ($values as $keys => $textValue) {\n // escape chars\n $textValue = htmlspecialchars($textValue);\n $documentSymbol =\n explode(self::$_templateSymbol, self::$_document);\n foreach ($documentSymbol as $documentSymbolValue) {\n if (strip_tags($documentSymbolValue) == $keys) {\n self::$_document = str_replace(\n $documentSymbolValue, $keys, self::$_document\n );\n }\n }\n self::$_document = preg_replace(\n '/\\\\' . self::$_templateSymbol . $keys . '\\\\' .\n self::$_templateSymbol . '/',\n $textValue,\n self::$_document,\n 1\n );\n $i = 0;\n foreach (self::$_footer as $footer) {\n self::$_footer[$i] = preg_replace('/\\\\' . self::$_templateSymbol . $keys . '\\\\' .\n self::$_templateSymbol . '/', $textValue, $footer, 1);\n $i++;\n }\n $i = 0;\n foreach (self::$_header as $header) {\n self::$_header[$i] = preg_replace('/\\\\' . self::$_templateSymbol . $keys . '\\\\' .\n self::$_templateSymbol . '/', $textValue, $header, 1);\n $i++;\n }\n }\n }\n }\n }", "function tie_var($var_name, &$var_value)\r\n\t{\r\n\t\tif (is_array($var_value)) \r\n\t\t{\r\n\t\t\t$list = array_keys($var_value);\r\n\t\t\tforeach($list as $key)\r\n\t\t\t{\r\n\t\t\t\t$this->tie_var($var_name . '.' . $key, $var_value[$key]); // recursion for array branches\r\n\t\t\t}\r\n\t\t}\r\n\t\telse // normal variable\r\n\t\t{\r\n\t\t\t$this->vars[$var_name] =& $var_value;\r\n\t\t}\r\n\t}", "public function & arrayUnShift () {\n $getFunctionArguments = func_get_args ();\n foreach ($getFunctionArguments as $k => $v) {\n array_unshift ($this->varContainer, $v);\n }\n # Return to chain ...\n return $this->returnToChain ();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function setTemplateVariable(string $key, $value) : self {\n $data = $this->getVariable('template_data', []);\n $data[$key] = $value;\n\n return $this->setVariable('template_data', $data);\n }", "public function addTwigVar(string $varName, $varValue)\n {\n $this->vars[$varName] = $varValue;\n }", "function passVar($key, $value) {\n // array ?\n if (is_array($value) ) {\n for ($i = 0; $i < sizeof($value); $i++) {\n passVar($key . '[' . $i . ']', $value[$i]);\n }\n\n return;\n }\n\n // other values: do stripslashes if needed\n ?><input type=\"hidden\" name=\"<?php echo hsc($key)?>\" value=\"<?php echo hsc(undoMagic($value) )?>\" /><?php\n}", "function __ ($var, $rpl = null)\n{\n global $main;\n if (array_key_exists ($var, $main->template->vars_l))\n {\n if (is_array ($rpl))\n $cnt = vsprintf ($main->template->vars_l[$var], $rpl);\n else\n $cnt = $main->template->vars_l[$var];\n echo $cnt;\n }\n}", "function push_raw_ref ( ) {\n\t\t$this->raw_refs[] = $this->raw_ref;\n\t\t$this->clear_raw_ref();\n\t}", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "public function AddVarArray($aData)\n {\n $this->aTemplateData = array_merge($this->aTemplateData, $aData);\n }", "function generate_block_varref($namespace, $varname, $use_isset = true)\n\t{\n\t\t// Strip the trailing period.\n\t\t$namespace = substr($namespace, 0, strlen($namespace) - 1);\n\n\t\t// Get a reference to the data block for this namespace.\n\t\t$varref = $this->generate_block_data_ref($namespace, true);\n\t\t// Prepend the necessary code to stick this in an echo line.\n\n\t\t// Append the variable reference.\n\t\t$varref .= '[\\'' . $varname . '\\']';\n\n\t\tif($use_isset)\n\t\t{\n\t\t\t$varref = '<' . '?php echo isset(' . $varref . ') ? ' . $varref . ' : \\'\\'; ?' . '>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$varref = '<' . '?php echo ' . $varref . '; ?' . '>';\n\t\t}\n\n\t\treturn $varref;\n\t}", "public function __set($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}", "function add(){\r\n $a=$b = 2;\r\n \r\n return $a+$b;\r\n}", "public function expand_refs($value) {\n if (is_array($value)) {\n if (self::isRef($value)) {\n return $this->get_ref($value);\n } else {\n foreach ($value as $k => $v) {\n $value[$k] = $this->expand_refs($v);\n }\n }\n }\n return $value;\n }", "public function & toFlt () {\n return $this->varContainer;\n }", "function assign_to($tpl, $key, $value = null)\n\t{\n\t\t$this->data[$tpl]->assign($key, $value);\n\t}", "function smarty_function_var($params, &$smarty) {\n\tif($params['var']) {\n\t\treturn $smarty->getTemplateVars($params['var']);\n\t}\n\t\n\treturn \"\";\n}", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function get_append($adr, $var, $val)\n\t{\n\t\t $pattern = \"/(\\?|\\&)\" . $var . \"=.*?(\\&|$)/\";\n\t\t$erased = preg_replace($pattern, '' , $adr);\n\t\t//apologize($erased);\n\t\t$remove_end = preg_replace(\"/(\\.php)\\?.*$/\", '$1' , $adr);\n\t\t// if there are no Get variables in the url\n\t\tif ($erased == $remove_end)\n\t\t\t$erased = $erased . \"?\";\n\t\telse \n\t\t\t$erased = $erased . \"&\";\n\t\treturn $erased . $var . \"=\" . $val; \n\t}", "function setPlaceholders($placeholders, $tpl) {\r\n $keys = array();\r\n $values = array();\r\n\r\n foreach ($placeholders as $key => $value) {\r\n $keys[] = '[+' . $key . '+]';\r\n $values[] = $value;\r\n }\r\n\r\n return str_replace($keys, $values, $tpl);\r\n }", "static function inject($collection, $variable, $function)\n {\n foreach($collection as $item) {\n $variable = $function($variable, $item);\n }\n return $variable;\n }", "private function addToBindings($value): void\n {\n if (is_array($value)) {\n $this->bindings = array_merge($this->bindings, array_values($value));\n } else {\n $this->bindings[] = $value;\n }\n }", "function yy_r91(){ $this->_retvalue = '['.$this->compiler->compileTag('special_smarty_variable','[\\'section\\'][\\''.$this->yystack[$this->yyidx + -1]->minor.'\\'][\\'index\\']').']'; }", "function assign_vars_array($name, $value)\n\t{\n\t\t$this->_vars[$name][] = $value;\n\t}" ]
[ "0.6383608", "0.582568", "0.5783358", "0.57092637", "0.5691141", "0.5566079", "0.5545298", "0.5543698", "0.55160135", "0.546763", "0.5465623", "0.54495597", "0.5397482", "0.5372851", "0.5364306", "0.536316", "0.5343946", "0.53392595", "0.5325619", "0.53142554", "0.53100157", "0.52992654", "0.5298789", "0.5289992", "0.52776605", "0.5275762", "0.526423", "0.5263509", "0.5263365", "0.5221771", "0.52118766", "0.52038956", "0.519617", "0.5152563", "0.511805", "0.51058763", "0.50921726", "0.5085022", "0.5068823", "0.5067664", "0.50563973", "0.50534815", "0.5042244", "0.50186235", "0.50168717", "0.4991878", "0.49720582", "0.49675733", "0.49663043", "0.4957237", "0.4956149", "0.49454236", "0.48990113", "0.48749927", "0.48599714", "0.48478857", "0.4838385", "0.482289", "0.48165756", "0.48127106", "0.47902766", "0.4786662", "0.47863036", "0.47849464", "0.47799125", "0.47746113", "0.4767757", "0.4763296", "0.47483665", "0.47327948", "0.47299898", "0.47275102", "0.47185373", "0.47176203", "0.4703169", "0.46988952", "0.46924606", "0.4687319", "0.468656", "0.46845174", "0.46791774", "0.4678728", "0.4673652", "0.46720088", "0.46617925", "0.46614102", "0.46579033", "0.46561036", "0.46468908", "0.4644865", "0.46431392", "0.46427894", "0.4640507", "0.46394533", "0.4637908", "0.46360746", "0.4635069", "0.46261877", "0.46247563", "0.46238798" ]
0.7091639
0
clear the given assigned template variable.
Очистите заданный переменную шаблона.
function ClearAssign($tpl_var) { $this->_smarty->clear_assign( $tpl_var ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear_assign($tpl_var)\n {\n $this->clearAssign($tpl_var);\n }", "function unset_var($name){ // unset the template variable\n\tif (isset($this->vars[$name])) unset($this->vars[$name]);\n}", "public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }", "public function clearAssign(Smarty_Internal_Data $data, $tpl_var)\n {\n if (is_array($tpl_var)) {\n foreach ($tpl_var as $curr_var) {\n unset($data->tpl_vars[ $curr_var ]);\n }\n } else {\n unset($data->tpl_vars[ $tpl_var ]);\n }\n\n return $data;\n }", "function unset_template()\r\n\t{\r\n\t\t$this->_template = null;\r\n\t\t$this->set_mode(self::OUTPUT_MODE_NORMAL);\r\n\t}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "public function __unset($key)\n {\n\t\t$this->_setSmartyMethod('clear_assign', array($key));\n //$this->_smarty()->clear_assign($key);\n }", "public static function clear($key = null) {\n if (is_null($key)) {\n self::$vars = array();\n }\n else {\n unset(self::$vars[$key]);\n }\n }", "public function __unset($key)\r\n {\r\n $this->_smarty->clearAssign($key);\r\n }", "function destroy()\n\t{\n\t\t$this->_tpldata = array('.' => array(0 => array()));\n\t\t$this->vars = &$this->_tpldata['.'][0];\n\t\t$this->xs_started = 0;\n\t}", "public function delTemplateData() {\r\n\t\t$this->templateData = [];\r\n\t}", "public function removeVariable($tv);", "function tagReset () {\n if (is_object($this->tptPointer)) \n $this->say($this->tptPointer->templateReset());\n }", "function ClearAllAssign()\n {\n $this->_smarty->clear_all_assign();\n }", "public function __unset($key) {\n\t\t$this->vars[$key] = '';\n\t}", "public function testClearAllAssings()\n {\n $varsValues = $this->view->templateVars();\n $this->assertEquals(2, count($varsValues));\n \n // Clear the assings and get again.\n $this->view->clearAllAssign();\n $varsValues = $this->view->templateVars();\n \n $this->assertEquals(0, count($varsValues));\n }", "public function clearTemplateCache()\n {\n $this->loadedTemplates = array();\n }", "public function clear_menu( )\n {\n $this->variables = array();\n }", "public function clear_cache($template=FALSE) {\n\t\tif (!$template) {\n\t\t\t$this->smarty->clear_all_cache();\n\t\t} else {\n\t\t\t$this->smarty->clear_cache($template);\n\t\t}\n\t}", "function clear() {}", "public function clear( );", "public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}", "function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "function clear() {}", "public function __unset($var)\n {\n if (isset($this->_vars[$var])) {\n unset($this->_vars[$var]);\n }\n }", "public function variable_del($name) {\n // TODO\n variable_del($name);\n }", "public static function unset($var)\n {\n // Remove existing keypair\n unset(self::$data['vars'][$var]);\n }", "function clear_cache($template, $cache_id=null, $compile_id=null, $expire=null)\n {\n\t\tif ($cache_id) {\n\t\t\t$cache_id = $this->module . '|' . $cache_id;\n\t\t} else {\n\t\t\t$cache_id = $this->module . '|' . $this->cache_id;\n\t\t}\n // the cache ID must not end on a |\n $cache_id = preg_replace('/\\|$/', '', $cache_id);\n\n return parent::clear_cache($template, $cache_id, $compile_id, $expire);\n }", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "protected function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "protected function clear()\n {\n $this->innerHtml = null;\n $this->outerHtml = null;\n $this->text = null;\n }", "public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }", "public function __unset($name)\n {\n $this->var_holder->remove($name);\n }", "protected function removeFormObjectFromViewHelperVariableContainer() {}", "public function offsetUnset($key)\n {\n unset($this->defaultVariables[$key]);\n }", "public function unset_var($variable)\n\t{\n\t\t$this->last_selector = null;\n\n\t\treturn $this->cmd(9, array(\n\t\t\t!is_array($variable) ? array($variable) : $variable,\n\t\t));\n\t}", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_VALUE] = null;\n }", "public function clear()\n {\n $this->contents = '';\n }", "public function clear()\n\t{\n\t\t$this->xResponse = null;\n\t}", "public function reset()\n {\n $this->values[self::_FROM] = null;\n $this->values[self::_TITLE] = null;\n $this->values[self::_CONTENT] = null;\n }", "function clear ();", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function deleteData($key) {\r\n\t\tif (isset($this->templateData[$key])) {\r\n\t\t\tunset($this->templateData[$key]);\r\n\t\t}\r\n\t}", "function drop_var($handle)\r\n\t{\r\n\t\tif (isset($this->vars[$handle])) unset($this->vars[$handle]);\r\n\t}", "public function clearVariables()\n {\n $this->variables = array();\n\n return $this;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TID] = null;\n $this->values[self::_SPLIT_TIMES] = null;\n $this->values[self::_END_POINT] = null;\n }", "function clear()\n \t{\n \t\tforeach ($this as &$value) \n \t\t $value = null;\n \t}", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_PASS_TIME] = null;\n }", "function drush_variable_realm_del($realm_name, $realm_key, $variable_name) {\n variable_realm_del($realm_name, $realm_key, $variable_name);\n drush_print('Variable deleted.');\n}", "protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }", "public function resetView()\n {\n $this->view = null;\n }", "public function clear()\n {\n $this->_params = null;\n }", "function wp_reset_vars($vars)\n {\n }", "function unsetVar(string $varName, string $scope=\"global\") {\r\n\r\n }", "public function clear () {\n \n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_AMOUNT] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_AMOUNT] = null;\n }", "public function clear(string $key) : void;" ]
[ "0.7566433", "0.7191758", "0.6726413", "0.67050195", "0.6686058", "0.66438085", "0.6436306", "0.6413052", "0.634062", "0.633813", "0.6132039", "0.6110073", "0.5961733", "0.59504163", "0.59501046", "0.5922669", "0.5908307", "0.585374", "0.5843332", "0.5801497", "0.5779502", "0.5758576", "0.5755115", "0.57455313", "0.5738571", "0.5738571", "0.5738571", "0.5738571", "0.5738571", "0.5738571", "0.5727058", "0.5691106", "0.5658174", "0.5614471", "0.561199", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607253", "0.5607236", "0.55950934", "0.55950934", "0.55950934", "0.55950934", "0.5582276", "0.5562527", "0.5541065", "0.55230284", "0.54937345", "0.5488277", "0.54686433", "0.5435804", "0.54268366", "0.5425893", "0.5414724", "0.54086125", "0.5402517", "0.53829324", "0.53820443", "0.5379852", "0.5360693", "0.5359825", "0.5359825", "0.53589964", "0.53589964", "0.53543204", "0.5350889", "0.53431463", "0.53431463", "0.53376466", "0.53372043", "0.5331828", "0.5331216", "0.5327855", "0.5327147", "0.5316141", "0.52994263", "0.52879465", "0.52879465", "0.5272441" ]
0.7491993
1
Registers a prefilter function to apply to a template before compiling
Регистрирует функцию предварительного фильтра, которая применяется к шаблону перед компиляцией
function RegisterPrefilter($function) { $this->_smarty->register_prefilter($function); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}", "function _add_template_loader_filters()\n {\n }", "function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }", "function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}", "public function addFilter(callable $filter);", "function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function register_variablefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['variable'][$_name] = $function;\n}", "function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }", "function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}", "function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_filters()\n {\n }", "private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }", "function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}", "function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}", "function _applyPrefilters ($text) {\r\n foreach ($this->_prefilters as $filter) {\r\n if (is_callable ($filter)) {\r\n $ntext = call_user_func ($filter, $text);\r\n if (is_string ($ntext)) {\r\n $text = $ntext;\r\n }\r\n }\r\n }\r\n return $text;\r\n }", "public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }", "public function register_filters() {\n\n\t\t}", "function acf_enable_filters($filters = array())\n{\n}", "protected function addTemplateFunctionConfigs()\n {\n // TODO: add twig template function configs\n }", "public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );\n\t\treturn $twig;\n\t}", "function acf_enable_filter($name = '')\n{\n}", "public function filter_timber_twig_add_basic_filters( $twig ) {\n $function_names = [\n // PHP Functions\n 'addslashes', // http://php.net/manual/en/function.addslashes.php\n 'nl2br', // http://php.net/manual/en/function.nl2br.php\n\n // WordPress functions\n 'antispambot', // https://developer.wordpress.org/reference/functions/antispambot/\n 'esc_attr', // https://developer.wordpress.org/reference/functions/esc_attr/\n 'esc_html', // https://developer.wordpress.org/reference/functions/esc_html/\n 'esc_url', // https://developer.wordpress.org/reference/functions/esc_url/\n 'esc_js', // https://developer.wordpress.org/reference/functions/esc_js/\n 'esc_textarea', // https://developer.wordpress.org/reference/functions/esc_textarea/\n 'sanitize_email', // https://developer.wordpress.org/reference/functions/sanitize_email/\n ];\n foreach ( $function_names as $func ) {\n if ( function_exists( $func ) ) {\n $twig->addFilter( new \\Twig_SimpleFilter( $func, $func ) );\n }\n }\n return $twig;\n }", "function filter_load() {\r\n\t\tadd_action( current_filter(), array( $this, 'setup_vars' ), 20 );\r\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'get_select' ) );\r\n\t\tadd_filter( \"manage_taxonomies_for_{$this->post_type}_columns\", array( $this, 'add_columns' ) );\r\n\t}", "function add_to_twig($twig) {\n $twig->addExtension(new \\Twig_Extension_StringLoader());\n $twig->addFunction(new \\Twig_SimpleFunction('script', 'CodekippleWPTheme\\Timber\\Site\\script'));\n $twig->addFunction(new \\Twig_SimpleFunction('css', 'CodekippleWPTheme\\Timber\\Site\\css'));\n $twig->addFilter('body_class', new \\Twig_Filter_Function('CodekippleWPTheme\\Timber\\Site\\body_class'));\n\n return $twig;\n }", "function beforeFilter() {\n }", "function doing_filter($hook_name = \\null)\n {\n }", "public function setFilters()\n {\n if (class_exists('Twig_SimpleFilter')) {\n $class = 'Twig_SimpleFilter';\n } else {\n $class = 'Twig\\TwigFilter';\n }\n\n $filter_merge_str = new $class('merge_str', function ($attrs, array $options = array()) {\n $key = $options[0];\n $value = $options[1];\n\n if (array_key_exists($key, $attrs)) {\n $attrs[$key] = implode(' ', [$value, $attrs[$key]]);\n } else {\n $attrs[$key] = $value;\n }\n\n return $attrs;\n }, array('is_variadic' => true));\n\n $this->twig->addFilter($filter_merge_str);\n }", "public function genFilterPreProcess ($filter = array())\n {\n return $filter;\n }", "private static function addFunctions()\n {\n \tself::$twig->addFunction(new \\Twig_SimpleFunction('asset', function ($asset) {\n return sprintf('%s', ltrim($asset, '/'));\n\t\t}));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('getBaseUrl', function () {\n return getBaseUrl();\n }));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('csrf_token', function () {\n return csrf_token();\n }));\n }", "public static function add_filter($tag, $fn, $priority = 10, $accepted_args = 1)\r\n {\r\n $current_priority = has_filter($tag, $fn);\r\n\r\n if ($current_priority === $priority) {\r\n return;\r\n }\r\n\r\n if ($current_priority !== $priority) {\r\n remove_filter($tag, $fn);\r\n }\r\n\r\n add_filter($tag, $fn, $priority, $accepted_args);\r\n }", "function _activateFilterLevel( $objKey )\n {\n// FIXXME all filters that get registered before $tpl->setOption('filterLevel',x) will be lost !!!!\n// because of the following line!!!\n $this->_objectPool[$objKey]->unregisterFilter();\n $filterLevel = $this->_objectPool[$objKey]->getOption('filterLevel');\n if( $filterLevel > 0 )\n {\n require_once('HTML/Template/Xipe/Filter/TagLib.php');\n // pass the options used in the template class, so we set the same delimiters in the filter\n $tagLib = new HTML_Template_Xipe_Filter_TagLib($this->_objectPool[$objKey]->getOptions());\n $this->_objectPool[$objKey]->registerPrefilter(array(&$tagLib,'allPrefilters'),$filterLevel);\n\n require_once('HTML/Template/Xipe/Filter/Basic.php');\n $tplFilter = new HTML_Template_Xipe_Filter_Basic($this->_objectPool[$objKey]->getOptions());\n $this->_objectPool[$objKey]->registerPrefilter(array(&$tplFilter,'allPrefilters'),$filterLevel);\n $this->_objectPool[$objKey]->registerPostfilter(array(&$tplFilter,'allPostfilters'),$filterLevel);\n }\n }", "public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "function _preview_theme_template_filter()\n {\n }", "public function include_template_functions() {\n\n\t}", "public function filterBeforeAll($filter);", "function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }", "private function addTwigFunctions() : void {\n\t\t$msgFunc = new Twig_SimpleFunction( 'msg', function ( $key, $params = [] ) {\n\t\t\t$params = is_array( $params ) ? $params : [];\n\t\t\treturn $this->i18n->msg(\n\t\t\t\t$key, [ 'domain' => 'popular-pages', 'variables' => $params ]\n\t\t\t);\n\t\t} );\n\t\t$this->twig->addFunction( $msgFunc );\n\n\t\t// Fetching assessments info, case-insensitive.\n\t\t$assessmentFunc = new Twig_SimpleFunction(\n\t\t\t'assessments', function (\n\t\t\t\tstring $type, string $value\n\t\t\t) {\n\t\t\t\t$dataset = $this->api->getAssessmentConfig()[$type];\n\t\t\t\tforeach ( $dataset as $key => $values ) {\n\t\t\t\t\tif ( strtolower( $value ) === strtolower( $key ) ) {\n\t\t\t\t\t\treturn $values;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $dataset['Unknown'];\n\t\t\t} );\n\t\t$this->twig->addFunction( $assessmentFunc );\n\n\t\t// Add ucfirst() (Twig's capitalize() will make the other chars lowercase).\n\t\t$ucfirstFunc = new Twig_SimpleFilter( 'ucfirst', function ( string $value ) {\n\t\t\treturn ucfirst( $value );\n\t\t} );\n\t\t$this->twig->addFilter( $ucfirstFunc );\n\t}", "function genesisawesome_custom_filters( $filters ) {\n\n\t$filters['email'] = 'sanitize_email';\n\t$filters['integer'] = 'genesisawesome_intval';\n\n\treturn $filters;\n\n}", "public function createFilter();", "function add_filter($name, $callback, $priority = 10)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->addFilter($name, $callback, $priority);\n }\n}", "public function test_apply_filter_create_function( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "abstract public function filter(callable $func);", "public function preDispatch()\n {\n $this->view->addFilter('TwitterLink');\n }", "protected function init() {\n parent::init('search_template_filter');\n }", "function twig_raw_filter($string)\n{\n return $string;\n}", "public function addFilter(string $name, callable $callback, int $priority = 100, int $params = 1);", "function dacig_register_filters( $output ) {\n\tadd_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tadd_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $output;\n}", "protected function filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {\n\t\treturn \\add_filter( $tag, [ $this, $function_to_add ], $priority, $accepted_args );\n\t}", "function prso_init_custom_post_tax_filter_class() {\n\t\n\t//Init vars\n\t$file_path = plugin_dir_path( __FILE__ ) . \"class.custom-post-tax-filter.php\";\n\t\n\tinclude_once( $file_path );\n}", "public function test_multiple_filter_with_priority() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 9 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"2\" . \"1\", $filtered );\n\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 11 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n }", "function ks_acf_template_filter_query($args, $field, $post_id) {\n if ($field['filter_template']) {\n $args['meta_query'] = array(\n array(\n 'key' => '_wp_page_template',\n 'value' => $field['filter_template'],\n 'compare' => 'IN'\n )\n );\n }\n\t\n return $args;\n}", "public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "function filter($callback = null);", "public function addToTwig($twig)\n {\n /* this is where you can add your own functions to twig */\n $twig->addExtension(new Twig_Extension_StringLoader());\n /**\n * Deprecated: Twig_Filter_Function, use Twig_SimpleFilter\n * http://twig.sensiolabs.org/doc/deprecated.html#filters\n * $twig->addFilter( 'whatever', new Twig_Filter_Function( 'whatever' ) );\n */\n $twig->addFilter('format_for_title', new Twig_SimpleFilter('format_for_title', array($this, 'titleFilter')));\n $twig->addFilter('slugify', new Twig_SimpleFilter('slugify', array($this, 'slugify')));\n $twig->addFilter('mdfive', new Twig_SimpleFilter('mdfive', array($this, 'mdfive')));\n $twig->addFilter('str_to_bool', new Twig_SimpleFilter('str_to_bool', array($this, 'strToBool')));\n $twig->addFilter(\n 'auto_version_path',\n new Twig_SimpleFilter('auto_version_path', array($this, 'autoVersionFilter'))\n );\n return $twig;\n }", "public function addFilter($type, $value);", "function make_all_functions_avaible_for_twig () {\r\n $this->CI->config->set_item( 'reveal_all_functions_to_twig', true );\r\n $get_defined_functions = get_defined_functions();\r\n\r\n foreach ( $get_defined_functions[ 'user' ] as $function ) {\r\n if ( ! isset( $this->_twig->$function ) ) {\r\n $this->_twig->addFunction( $function, new Twig_Function_Function( $function ) );\r\n }\r\n }\r\n\r\n unset( $get_defined_functions );\r\n }", "function dunkdog_template_filter( $template_path ) { \n\tif(is_search()){\n\t\treturn $template_path;\n\t}\n\n\t$type = get_post_type(); \n if ( ( $type == 'dd-player' ) || ( $type == 'dd-team' ) || ( $type == 'dd-player-ranking' ) || ($type == 'dd-team-ranking' ) ){\n if ( is_single() ) {\n \t$prefix = 'single';\n }\n if ( is_archive()){\n \t$prefix = 'archive';\n }\n if ( is_tax()){\n \t$prefix = 'taxonomy';\n\n \t// if(get_query_var('taxonomy')=='dd-conference'){\n \t// \t$type = 'dd-team';\n \t// }else{\n \t\t$type = 'dd-player'; // forcing tax to be player; no other need for team or ranking taxonomy\n \t// }\n }\n\n $template_path = dunkdog_template_function($prefix . '-' . $type, false);\n \n }\n \n if(DD_DEBUG){global $wp_query; krumo('template_path', $template_path, $prefix, $type, $wp_query);}\n\treturn $template_path;\n}", "protected function addFilter($hook, $callback, $priority = 10, $args = 1)\n\t{\n\t\tswitch ( Stringify::lowercase($hook) ) {\n\t\t\tcase 'head':\n\t\t\t\t$hook = 'wp_head';\n\t\t\t\tbreak;\n\t\t\tcase 'body':\n\t\t\t\t$hook = 'wp_body_open';\n\t\t\t\tbreak;\n\t\t\tcase 'footer':\n\t\t\t\t$hook = 'wp_footer';\n\t\t\t\tbreak;\n\t\t\tcase 'content':\n\t\t\t\t$hook = 'the_content';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn add_filter($hook,$callback,$priority,$args);\n\t}", "function _dotgo_filter_prepare() {\n\n}", "public function setupFilterRules()\n { }", "function add_function ( $name ) {\r\n $this->_twig->addFunction( $name, new Twig_Function_Function( $name ) );\r\n }", "public function registerPhpFunctions ($restrict = null) {}", "public function addFilters()\n {\n }", "public static function set()\n {\n add_filter( 'template_include', [ __CLASS__, 'add' ] );\n }", "function twig_safe_filter($string)\n{\n return $string;\n}", "function remove_filter($hook_name, $callback, $priority = 10)\n {\n }", "public function __construct()\n {\n add_filter('template_include', [$this, 'template']);\n add_filter('init', [$this, 'rewriteRules']);\n add_filter('query_vars', [$this, 'query']);\n }", "public function registerFilters()\n {\n foreach ($this->getFilters() as $filter) {\n try {\n $this->smarty->registerFilter($filter->getType(), $filter->getCallback());\n } catch (SmartyException $e) {\n if (null !== $this->logger) {\n $this->logger->warn(sprintf(\"SmartyException caught: %s.\", $e->getMessage()));\n }\n }\n }\n }", "function has_filter($hook_name, $callback = \\false)\n {\n }", "public function beforeFeature($filter, $callback)\n {\n $this->hooks['feature.before'][] = array($filter, $callback);\n }", "public function getFilters()\r\n {\r\n\r\n return array(new \\Twig_SimpleFilter('montantTva', array($this, 'montantTva')));\r\n }", "function before_filter(&$action, &$args) {\n }", "function wp_render_duotone_filter_preset($preset)\n {\n }", "function smarty_function_pagesetter_CreateFilter($args, &$smarty)\r\n{\r\n //$smarty->caching = 0; // Nice for debugging ...\r\n \r\n // pagesetter_userapi_getPubList\r\n if (!isset($args['filter']))\r\n return \"Missing 'filter' argument in Smarty plugin 'pagesetter_CreateFilter'\";\r\n\r\n if (!pnModAPILoad('pagesetter', 'admin'))\r\n return pagesetterErrorPage(__FILE__, __LINE__, 'Failed to load Pagesetter admin API');\r\n\r\n $filter = array(); \r\n\r\n // Get unnumbered filter string\r\n $filterStr = $args['filter'];\r\n\r\n if (isset($filterStr))\r\n $filter[] = pagesetterReplaceFilterVariable($filterStr); \r\n\r\n // Get filter1 ... filterN\r\n $i = 1;\r\n while (true) {\r\n $filterURLName = \"filter$i\";\r\n $filterStr = $args[$filterURLName];\r\n\r\n if (empty($filterStr))\r\n break;\r\n\r\n $filter[] = pagesetterReplaceFilterVariable($filterStr);\r\n $i++;\r\n } \r\n\r\n if (isset($args['assign'])) {\r\n $smarty->assign($args['assign'], $filter);\r\n } else {\r\n return $filter; \r\n } \r\n}", "public function register()\n {\n Filter::register();\n }", "abstract public function prepareFilters();", "function LoadFilter($type, $name)\n {\n $this->_smarty->load_filter($type, $name);\n }", "public function add_filter( $hook, $component, $callback, $priority = 10, $acc_args = 1 ) {\n\t\t$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $acc_args );\n\t}", "protected function addFilter($class)\n {\n return <<<EOF\n\\$this->register('{$class}');\nEOF;\n }", "function did_filter($hook_name)\n {\n }", "private function filter($name, $method = null): Twig_SimpleFilter\n\t{\n\t\treturn $this->extension(Twig_SimpleFilter::class, $name, $method);\n\t}", "public function test_multiple_filter() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; } );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; } );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n\t}", "public static function pre_process() {}", "public function getFilters()\n {\n return array(\n 'safe' => new Twig_Filter_Function('twig_safe_filter', array('is_escaper' => true)),\n );\n }", "protected function register_filters(){\n\t\tadd_filter(\"the_content\", array($this, \"filter_single_content_after\"), 0);\n\t}", "function acf_set_filters($filters = array())\n{\n}", "private function setup_filters() {\n\n\t\tadd_filter( 'pre_option_posts_per_page', array( $this, 'filter_posts_per_page' ) );\n\n\t\tadd_filter( 'plugins_url', array( $this, 'filter_plugins_url' ) );\n\n\t}", "function registerPreFunction($mFunction)\n\t{\n\t\tif (is_array($mFunction)) {\n\t\t\t$this->sPreFunction = $mFunction[0];\n\t\t\t$this->aObjects[$mFunction[0]] = array_slice($mFunction, 1);\n\t\t}\n\t\telse {\n\t\t\t$this->sPreFunction = $mFunction;\n\t\t}\n\t}", "public static function custom($function)\n {\n if (!is_callable($function)) {\n throw new InvalidArgumentException('function', 'callable');\n }\n\n self::$templates[] = $function;\n }", "public function filter( string $tag, callable $fn, int $priority = 10, int $accepted_args = 1 ) {\n\t\t$fn = Closure::bind( Closure::fromCallable( $fn ), $this );\n\n\t\tif ( ! function_exists( 'add_filter' ) ) {\n\t\t\tthrow new Exception( 'WordPress not loaded' );\n\t\t}\n\n\t\treturn add_filter( $tag, $fn, $priority, $accepted_args );\n\t}", "public function twig_filter_fcache()\n\t{\n\t\treturn new \\Twig_SimpleFilter('fcache', function ($string)\n\t\t{\n\t\t\tif(file_exists($string))\n\t\t\t{\n\t\t\t\treturn $string.'?'.filemtime($string);\n\t\t\t}\n\t\t});\n\t}", "private function _applyFilter($filter)\n\t{\n\t\tglobal $context, $scripturl;\n\n\t\tif (isset($filter['variable']))\n\t\t{\n\t\t\t$context['filter'] = &$filter;\n\n\t\t\t// Set the filtering context.\n\t\t\tswitch ($filter['variable'])\n\t\t\t{\n\t\t\t\tcase 'id_member':\n\t\t\t\t\t$id = $filter['value']['sql'];\n\t\t\t\t\tMembersList::load($id, false, 'minimal');\n\t\t\t\t\t$name = MembersList::get($id)->real_name;\n\t\t\t\t\t$context['filter']['value']['html'] = '<a href=\"' . getUrl('profile', ['action' => 'profile', 'u' => $id, 'name' => $name]) . '\">' . $name . '</a>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'url':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars((substr($filter['value']['sql'], 0, 1) === '?' ? $scripturl : '') . $filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array('\\_' => '_')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'message':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\t$context['filter']['value']['html'] = preg_replace('~&amp;lt;span class=&amp;quot;remove&amp;quot;&amp;gt;(.+?)&amp;lt;/span&amp;gt;~', '$1', $context['filter']['value']['html']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'error_type':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$context['filter']['value']['html'] = &$filter['value']['sql'];\n\t\t\t}\n\t\t}\n\t}", "public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}", "public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }" ]
[ "0.7772184", "0.6464766", "0.6291857", "0.62652165", "0.6119213", "0.61075324", "0.610526", "0.59339553", "0.59259903", "0.5877378", "0.58709174", "0.58709174", "0.58709174", "0.58544", "0.57992023", "0.5778107", "0.57774925", "0.57272476", "0.568918", "0.56596994", "0.5609149", "0.5519953", "0.5473757", "0.54426384", "0.5417593", "0.5416106", "0.54026705", "0.53810006", "0.5379099", "0.5340714", "0.53384894", "0.5309869", "0.52629715", "0.52578425", "0.5249857", "0.5242795", "0.5231873", "0.5224514", "0.5211695", "0.5211477", "0.51964384", "0.5195111", "0.51879555", "0.5173274", "0.5168466", "0.5152095", "0.5141349", "0.5118163", "0.5116577", "0.51147133", "0.51018345", "0.5095994", "0.5089459", "0.5081531", "0.5063173", "0.5061814", "0.50595033", "0.50524783", "0.50501907", "0.50356746", "0.50348544", "0.50331265", "0.5015119", "0.5014546", "0.50106376", "0.4988019", "0.49825054", "0.49813244", "0.49798423", "0.4977558", "0.49718732", "0.49682018", "0.49678406", "0.49675938", "0.49675876", "0.496737", "0.49488118", "0.49409196", "0.4940336", "0.4932686", "0.4929846", "0.49282444", "0.4922477", "0.4871178", "0.48682883", "0.48641837", "0.4852783", "0.48509473", "0.4841291", "0.48329026", "0.48251644", "0.4821639", "0.4820969", "0.4816905", "0.48101774", "0.48068702", "0.48030174", "0.47966892", "0.47874275", "0.47681755" ]
0.77226025
1
Unregisters a prefilter function
Отписывает предфильтр функцию
function UnregisterPrefilter($function) { $this->_smarty->unregister_prefilter($function); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }", "function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }", "function remove_filter($hook_name, $callback, $priority = 10)\n {\n }", "public function removeFilters();", "public function remove()\n {\n foreach ($this->filters as $filter) {\n $filterWithoutAcceptedArguments = array_slice($filter, 0, 3);\n call_user_func_array($this->removeCallback, $filterWithoutAcceptedArguments);\n }\n }", "function remove_all_filters($hook_name, $priority = \\false)\n {\n }", "function remove_filter ($filter,$remove) \n{\n unset($filter[$remove]);\n return $filter;\n}", "function RegisterPrefilter($function)\n {\n $this->_smarty->register_prefilter($function);\n }", "public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function removeFilter($key);", "public function remove_filter($hook_name, $callback, $priority)\n {\n }", "public function removeAllFilters();", "function acf_disable_filters()\n{\n}", "function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}", "protected function removeFilter($hook, $callback, $priority = 10)\n\t{\n\t\treturn remove_filter($hook,$callback,$priority);\n\t}", "function clear_filters($filterName = null)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->clearFilters($filterName);\n }\n}", "public function removeFilter(string $name);", "function remove_anonymous_object_filter( $tag, $class, $method ){\n\t$filters = isset($GLOBALS['wp_filter'][ $tag ])? $GLOBALS['wp_filter'][ $tag ] : false;\n\n\tif (empty($filters)){\n\t\treturn;\n\t}\n\n\tforeach ( $filters as $priority => $filter )\n\t{\n\t\tforeach ( $filter as $identifier => $function )\n\t\t{\n\t\t\tif ( is_array( $function)\n\t\t\t\tand is_a( $function['function'][0], $class )\n\t\t\t\tand $method === $function['function'][1]\n\t\t\t)\n\t\t\t{\n\t\t\t\tremove_filter(\n\t\t\t\t\t$tag,\n\t\t\t\t\tarray ( $function['function'][0], $method ),\n\t\t\t\t\t$priority\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}", "function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}", "public function filter($function) {\n $this->_hash= array_filter($this->_hash, $function);\n }", "public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function removeFilter(string $name): void;", "function dacig_deregister_filters( $status ) {\n\tremove_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tremove_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $status;\n}", "function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}", "public function remove(FilterInterface ...$filters);", "public function filterNot(callable $hof);", "abstract public function filter(callable $func);", "protected function remove_filter( $tag, $function_to_remove, $priority = 10 ) {\n\t\treturn \\remove_filter( $tag, [ $this, $function_to_remove ], $priority );\n\t}", "public function unsetProvider();", "public function removeFilter( string $tag, string $function, int $priority = 10, $replacement = false ): self\n {\n\n $this->filters[] = [\n 'tag' => $tag,\n 'function' => $function,\n 'priority' => $priority,\n 'replacment' => $replacement,\n ];\n\n return $this;\n\n }", "public function unregisterOperator($operator) {}", "public function filter(callable $hof);", "public function reset() : void\n {\n\n // load the filters that has to be resetted\n $filters = $this->getFilters();\n\n // reset the filters\n foreach ($filters as $filter) {\n if ($filter instanceof PregMatchFilterInterface) {\n $filter->reset();\n }\n }\n }", "function filter($callback = null);", "public function resetFilters() {\n $this->filters = array();\n }", "function acf_disable_filter($name = '')\n{\n}", "function unregister_plugin_hook($hook, $entity_type, $function) {\n\tglobal $CONFIG;\n\tforeach($CONFIG->hooks[$hook][$entity_type] as $key => $hook_function) {\n\t\tif ($hook_function == $function) {\n\t\t\tunset($CONFIG->hooks[$hook][$entity_type][$key]);\n\t\t}\n\t}\n}", "function doing_filter($hook_name = \\null)\n {\n }", "public function removeFilter($filter)\n {\n if (strpos($filter, 'iPhorm_Filter_') === false) {\n $filter = 'iPhorm_Filter_' . ucfirst($filter);\n }\n\n if (array_key_exists($filter, $this->_filters)) {\n unset($this->_filters[$filter]);\n }\n }", "public static function clearOutput(): void\n {\n rex_extension::register('OUTPUT_FILTER', static function (rex_extension_point $ep) {\n $ep->setSubject(false);\n });\n }", "function did_filter($hook_name)\n {\n }", "public function removeIf(callable $callable);", "function runkit_function_remove($funcname)\n{\n}", "public function remove_filter($filter)\n {\n \t$filters = session('reports_filter_domain');\n \tif(array_key_exists($filter, $filters))\n {\n unset($filters[$filter]);\n session()->put('reports_filter_domain', $filters);\n }\n\n \treturn $filters;\n }", "public function unregister() {\n // Normally, there are definitely wrappers set for the ALL filter. However,\n // in some cases involving many container rebuilds (e.g. BrowserTestBase),\n // $this->wrappers may be empty although wrappers are still registered\n // globally. Thus an isset() check is needed before iterating.\n if (isset($this->wrappers[StreamWrapperInterface::ALL])) {\n foreach (array_keys($this->wrappers[StreamWrapperInterface::ALL]) as $scheme) {\n stream_wrapper_unregister($scheme);\n }\n }\n }", "public function filter(callable $c = null);", "public function test_remove_filter_within_class_instance( $hook ) {\n $this->assertTrue( yourls_has_filter( $hook ) );\n $removed = yourls_remove_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function filter(callable $callback = null);", "public function filter(callable $callback);", "public function removeFilter($name)\n {\n unset($this->filters[$name]);\n }", "function fuzzloc_unload() {\n\n\tunregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\tunregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tunregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\n\tlogger(\"removed fuzzloc\");\n}", "public function unregister(): void;", "public function unregister(): void;", "function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }", "static public function unregister()\n {\n spl_autoload_unregister(array(self::getInstance(), 'autoload'));\n self::$registered = false;\n }", "static public function unregister()\n {\n spl_autoload_unregister(array(self::getInstance(), 'autoload'));\n self::$registered = false;\n }", "function deactivation_func() {\r\n\r\n delete_option( 'wpc_run_activated_functions' );\r\n }", "private function restoreFilters()\n {\n if (count($this->wordpressFilters) > 0) {\n $filters = $this->wordpress->getFilters();\n\n foreach ($this->wordpressFilters as $filterKey => $filter) {\n $filters[$filterKey] = $filter;\n }\n\n $this->wordpress->setFilters($filters);\n $this->wordpressFilters = [];\n }\n }", "public function unregister () {\r\n\t\tspl_autoload_unregister( array( $this, 'loadClass' ) );\r\n\t}", "function http_request_method_unregister($method) {}", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "public function test_remove_filter_within_class( $hook ) {\n $removed = yourls_remove_filter( $hook, 'Change_Variable::change_it' );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function destroy(Filter $filter)\n {\n //\n }", "public function filter();", "public function test_remove_filter_within_class_array( $hook ) {\n $removed = yourls_remove_filter( $hook, array( 'Change_Variable', 'change_it' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function unregister() {\n\n\t\tspl_autoload_unregister( array( $this, 'load' ) );\n\t}", "public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }", "public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }", "public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }", "public function unbind( $actions = true, $filters = true ) {\n\t\t$types = array();\n\n\t\tif ( $actions ) {\n\t\t\t$types['actions'] = 'remove_action';\n\t\t}\n\n\t\tif ( $filters ) {\n\t\t\t$types['filters'] = 'remove_filter';\n\t\t}\n\n\t\tforeach ( $types as $hooks => $method ) {\n\t\t\tforeach ( $this->$hooks as $hook ) {\n\t\t\t\tcall_user_func_array( $method, $hook );\n\t\t\t}\n\t\t}\n\t}", "public function unregister()\n {\n spl_autoload_unregister( array( $this, 'loadClass' ) );\n }", "function unregister()\n {\n spl_autoload_unregister([$this, 'resolve']);\n }", "public function unregister()\n\t{\n\t\tspl_autoload_unregister([$this, 'loadClass']);\n\t}", "public function register_filters() {\n\n\t\t}", "function ft_hook_destroy() {}", "public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClassWithAlias'));\n }", "public function unregister()\n {\n spl_autoload_unregister([$this, 'loadClass']);\n }", "static public function deregister_scripts() {\n wp_dequeue_script( 'filterable-portfolio' );\n wp_deregister_script( 'filterable-portfolio' );\n }", "function after_filter($action, $args) {\n }", "function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }", "public function unregister(): void {\n\t\t\\spl_autoload_unregister( [ $this, self::AUTOLOAD_METHOD ] );\n\t}", "function spl_autoload_unregister(callable $callback): bool {}", "public function remove_all_filters($priority = \\false)\n {\n }", "public function reset()\n\t{\n\t\tupdate_option($this->filterName, array());\n\t}", "public function afterFilter()\n\t{\n\n\t}", "public function resetFilter()\n {\n $this->actor = null;\n $this->addTimestamp = null;\n $this->encryptSignature = null;\n $this->expires = null;\n $this->serviceSecurityKey = null;\n $this->signAllHeaders = null;\n $this->tokenReferenceEncryption = null;\n $this->tokenReferenceSignature = null;\n $this->userSecurityKey = null;\n }", "function unhook_hotlink_scanner() {\n\t\tremove_action( 'save_post', array( &$this, 'localize_hotlinked_files' ) );\n\t}", "function hook_uninstall() {\r\n\t\tupdate_options('foliamaptool', '');\r\n\t}", "public function unregister() {\n spl_autoload_unregister([$this, 'autoLoad']);\n }", "public function remove()\n {\n\n foreach ( $this->actions as $action ) {\n extract( $action );\n\n /**\n * @var string $tag\n * @var string $function\n * @var int $priority\n * @var mixed $replacment\n */\n\n remove_action( $tag, $function, $priority );\n\n if ( $replacment ) {\n add_action( $tag, $replacment, $priority );\n }\n }\n\n foreach ( $this->filters as $filter ) {\n extract( $filter );\n\n /**\n * @var string $tag\n * @var string $function\n * @var int $priority\n * @var mixed $replacment\n */\n\n remove_filter( $tag, $function, $priority );\n\n if ( $replacment ) {\n add_filter( $tag, $replacment, $priority );\n }\n }\n\n }", "public function filter(\\Closure $callback);", "function wp_unregister_GLOBALS()\n {\n }", "function acf_enable_filters($filters = array())\n{\n}", "public function deactivate()\n {\n if (!isset(self::$_activeFilters[$this->target])) {\n //this filter isn't active...something's wrong\n return false;\n }\n\n //if there are any filters that are dependent on this one, remove them first\n foreach (self::$_activeFilters as $f) {\n if ($f->getDependency() === $this->target) {\n $f->deactivate();\n }\n }\n\n //update database\n $session = geoSession::getInstance()->initSession();\n $db = DataAccess::getInstance();\n $sql = \"DELETE FROM \" . geoTables::browsing_filters . \" WHERE `session_id` = ? AND `target` = ?\";\n $db->Execute($sql, array($session, $this->target));\n\n //remove cache var\n unset(self::$_activeFilters[$this->target]);\n\n //update table select to not use this filter\n $this->applyToQuery($db->getTableSelect(DataAccess::SELECT_BROWSE), true);\n }", "public function resetFilters()\n {\n unset($this->options['AmazonOrderId']);\n unset($this->options['FinancialEventGroupId']);\n $this->resetTimeLimits();\n }", "function DRA_Disable_Via_Filters() {\n\n // Filters for WP-API version 1.x\n add_filter( 'json_enabled', '__return_false' );\n add_filter( 'json_jsonp_enabled', '__return_false' );\n\n // Filters for WP-API version 2.x\n add_filter( 'rest_enabled', '__return_false' );\n add_filter( 'rest_jsonp_enabled', '__return_false' );\n\n // Remove REST API info from head and headers\n remove_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );\n remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n remove_action( 'template_redirect', 'rest_output_link_header', 11 );\n\n}", "public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }", "function add_filters()\n {\n }", "function output_filter($value, array $params = null) {\n return trigger_hook('output', 'filter', $params, $value);\n}" ]
[ "0.71847147", "0.6910196", "0.68760026", "0.6465871", "0.62737244", "0.61718947", "0.6135773", "0.6060782", "0.6057684", "0.60540015", "0.60170066", "0.5993051", "0.5976774", "0.59508926", "0.5862169", "0.58367765", "0.5784914", "0.5777473", "0.5769011", "0.5754283", "0.57109743", "0.5681446", "0.56814355", "0.56758916", "0.56695", "0.56681323", "0.5629105", "0.5623453", "0.5583739", "0.55522263", "0.5539588", "0.55296135", "0.5509683", "0.55083364", "0.5500584", "0.54862463", "0.5482109", "0.5441617", "0.5427817", "0.54168093", "0.5385128", "0.53787833", "0.53749615", "0.5335026", "0.5308485", "0.5305818", "0.5300844", "0.52753294", "0.5272763", "0.52542156", "0.52434736", "0.5238098", "0.5238098", "0.52173847", "0.5189419", "0.5189419", "0.5177904", "0.5152587", "0.5152211", "0.5144864", "0.51422286", "0.51422286", "0.5132182", "0.51239085", "0.5115431", "0.5106753", "0.50974756", "0.50935405", "0.50935405", "0.50935405", "0.508988", "0.50887215", "0.50873464", "0.5069797", "0.5057894", "0.505721", "0.50374615", "0.50314224", "0.5031025", "0.50185573", "0.5017159", "0.5013201", "0.50082475", "0.50017536", "0.49994117", "0.49967825", "0.49958017", "0.49931017", "0.49830967", "0.4967505", "0.4964266", "0.4960246", "0.49589768", "0.4956942", "0.49447975", "0.49318972", "0.492558", "0.4919888", "0.49188644", "0.49113956" ]
0.8121243
0
Registers a postfilter function to apply to a compiled template after compilation
Регистрирует функцию постфильтрации для применения к откомпилированному шаблону после компиляции
function RegisterPostfilter($function) { $this->_smarty->register_postfilter($function); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }", "public function _post_filter()\n {\n }", "function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }", "function dacig_register_filters( $output ) {\n\tadd_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tadd_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $output;\n}", "function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}", "function after_filter($action, $args) {\n }", "function _applyPostfilters ($text) {\r\n foreach ($this->_postfilters as $filter) {\r\n if (is_callable ($filter)) {\r\n $ntext = call_user_func ($filter, $text);\r\n if (is_string ($ntext)) {\r\n $text = $ntext;\r\n }\r\n }\r\n }\r\n return $text;\r\n }", "function RegisterPrefilter($function)\n {\n $this->_smarty->register_prefilter($function);\n }", "function _add_template_loader_filters()\n {\n }", "protected function postFilter($filterChain)\n {\n }", "protected function register_filters(){\n\t\tadd_filter(\"the_content\", array($this, \"filter_single_content_after\"), 0);\n\t}", "function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function smarty_postfilter_strip($compiled, &$smarty)\n{\n\treturn preg_replace('/<\\?php\\s+\\?>/', '', $compiled);\n}", "function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}", "function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }", "function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public function afterFilter()\n\t{\n\n\t}", "public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }", "function did_filter($hook_name)\n {\n }", "protected function after_filter()\n {\n $this->render('footer.php');\n }", "function add_filters()\n {\n }", "function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}", "function register_variablefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['variable'][$_name] = $function;\n}", "function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }", "private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }", "function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "public function get_name()\n {\n return 'post-filter';\n }", "function register_block_core_post_template()\n {\n }", "function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}", "protected function executeRenderPostTransformHook() {}", "public function addFilter(callable $filter);", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function remove_filter($hook_name, $callback, $priority = 10)\n {\n }", "public static function post_process() {}", "private static function addFunctions()\n {\n \tself::$twig->addFunction(new \\Twig_SimpleFunction('asset', function ($asset) {\n return sprintf('%s', ltrim($asset, '/'));\n\t\t}));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('getBaseUrl', function () {\n return getBaseUrl();\n }));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('csrf_token', function () {\n return csrf_token();\n }));\n }", "public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}", "public function post_filter($filter, $field = TRUE)\n\t{\n\t\tif ($field === TRUE)\n\t\t{\n\t\t\t// Use wildcard\n\t\t\t$fields = array('*');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add the filter to specific inputs\n\t\t\t$fields = func_get_args();\n\t\t\t$fields = array_slice($fields, 1);\n\t\t}\n\n\t\t// Convert to a proper callback\n\t\t$filter = $this->callback($filter);\n\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\t// Add the filter to specified field\n\t\t\t$this->post_filters[$field][] = $filter;\n\t\t}\n\n\t\treturn $this;\n\t}", "function twig_raw_filter($string)\n{\n return $string;\n}", "private function addTwigFunctions() : void {\n\t\t$msgFunc = new Twig_SimpleFunction( 'msg', function ( $key, $params = [] ) {\n\t\t\t$params = is_array( $params ) ? $params : [];\n\t\t\treturn $this->i18n->msg(\n\t\t\t\t$key, [ 'domain' => 'popular-pages', 'variables' => $params ]\n\t\t\t);\n\t\t} );\n\t\t$this->twig->addFunction( $msgFunc );\n\n\t\t// Fetching assessments info, case-insensitive.\n\t\t$assessmentFunc = new Twig_SimpleFunction(\n\t\t\t'assessments', function (\n\t\t\t\tstring $type, string $value\n\t\t\t) {\n\t\t\t\t$dataset = $this->api->getAssessmentConfig()[$type];\n\t\t\t\tforeach ( $dataset as $key => $values ) {\n\t\t\t\t\tif ( strtolower( $value ) === strtolower( $key ) ) {\n\t\t\t\t\t\treturn $values;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $dataset['Unknown'];\n\t\t\t} );\n\t\t$this->twig->addFunction( $assessmentFunc );\n\n\t\t// Add ucfirst() (Twig's capitalize() will make the other chars lowercase).\n\t\t$ucfirstFunc = new Twig_SimpleFilter( 'ucfirst', function ( string $value ) {\n\t\t\treturn ucfirst( $value );\n\t\t} );\n\t\t$this->twig->addFilter( $ucfirstFunc );\n\t}", "function postRender(&$render)\n {\n }", "function preview_theme_ob_filter_callback($matches)\n {\n }", "function doing_filter($hook_name = \\null)\n {\n }", "function _preview_theme_template_filter()\n {\n }", "public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function register_filters() {\n\n\t\t}", "function output_filter($value, array $params = null) {\n return trigger_hook('output', 'filter', $params, $value);\n}", "public function testPostFilter()\n {\n $index = new Index();\n $query = new Query($index);\n $query->postFilter([\n 'name.first' => 'jose',\n 'age >' => 29,\n 'or' => [\n 'tags in' => ['cake', 'php'],\n 'interests not in' => ['c#', 'java'],\n ],\n ]);\n\n $compiled = $query->compileQuery()->toArray();\n\n $filter = $compiled['post_filter']['bool']['must'];\n\n $expected = ['term' => ['name.first' => 'jose']];\n $this->assertEquals($expected, $filter[0]);\n\n $expected = ['range' => ['age' => ['gt' => 29]]];\n $this->assertEquals($expected, $filter[1]);\n\n $expected = ['terms' => ['tags' => ['cake', 'php']]];\n $this->assertEquals($expected, $filter[2]['bool']['should'][0]);\n\n $expected = [\n 'bool' => [\n 'must_not' => [\n ['terms' => ['interests' => ['c#', 'java']]],\n ],\n ],\n ];\n $this->assertEquals($expected, $filter[2]['bool']['should'][1]);\n\n $query->postFilter(function (QueryBuilder $builder) {\n return $builder->and(\n $builder->term('another.thing', 'value'),\n $builder->exists('stuff')\n );\n });\n\n $compiled = $query->compileQuery()->toArray();\n $filter = $compiled['post_filter']['bool']['must'];\n $filter = $filter[3]['bool']['must'];\n $expected = [\n ['term' => ['another.thing' => 'value']],\n ['exists' => ['field' => 'stuff']],\n ];\n $this->assertEquals($expected, $filter);\n\n $query->postFilter(['name.first' => 'jose'], true);\n $compiled = $query->compileQuery()->toArray();\n $filter = $compiled['post_filter']['bool']['must'];\n $expected = ['term' => ['name.first' => 'jose']];\n $this->assertEquals([$expected], $filter);\n }", "public function addFilters() {\n\t\t// $this->subscriber->addFilter( 'mdm_syndication_post_fields', [$this, 'addCustomFields'] );\n\t}", "function add_to_twig($twig) {\n $twig->addExtension(new \\Twig_Extension_StringLoader());\n $twig->addFunction(new \\Twig_SimpleFunction('script', 'CodekippleWPTheme\\Timber\\Site\\script'));\n $twig->addFunction(new \\Twig_SimpleFunction('css', 'CodekippleWPTheme\\Timber\\Site\\css'));\n $twig->addFilter('body_class', new \\Twig_Filter_Function('CodekippleWPTheme\\Timber\\Site\\body_class'));\n\n return $twig;\n }", "public static function get_dynamic_functions() {\n return apply_filters(\n 'super_common_js_dynamic_functions_filter', \n array(\n // @since 1.0.0\n 'before_validating_form_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_post_url_tags' ),\n ),\n 'after_validating_form_hook' => array(),\n\n 'after_initializing_forms_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_html_tags' ),\n array( 'name' => 'init_replace_post_url_tags' )\n ),\n 'after_field_change_blur_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'calculate_distance' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_post_url_tags' )\n ),\n\n // @since 1.2.8\n 'after_email_send_hook' => array(),\n\n // @since 1.3\n 'after_responsive_form_hook' => array(),\n 'after_form_data_collected_hook' => array(),\n 'after_duplicate_column_fields_hook' => array(),\n \n // @since 1.9\n 'before_submit_button_click_hook' => array(),\n 'after_preview_loaded_hook' => array(),\n\n // @since 2.0.0\n 'after_form_cleared_hook' => array(),\n \n // @since 2.1.0\n 'before_scrolling_to_error_hook' => array(),\n 'before_scrolling_to_message_hook' => array(),\n \n // @since 2.4.0\n 'after_duplicating_column_hook' => array(),\n\n // @since 3.3.0\n 'after_appending_duplicated_column_hook' => array(),\n\n // @since 4.7.0\n 'before_submit_hook' => array(),\n\n // @since 4.9.0\n 'after_init_common_fields' => array(\n array( 'name' => 'init_distance_calculators' ),\n array( 'name' => 'init_color_pickers' ),\n array( 'name' => 'init_carouseljs' ),\n array( 'name' => 'init_tooltips' ),\n array( 'name' => 'init_datepicker' ),\n array( 'name' => 'init_adaptive_placeholder' ),\n array( 'name' => 'init_masked_input' ),\n array( 'name' => 'init_currency_input' ),\n array( 'name' => 'init_colorpicker' ),\n array( 'name' => 'init_slider_field' ),\n array( 'name' => 'init_button_colors' ),\n array( 'name' => 'init_text_editors' ),\n array( 'name' => 'init_fileupload_fields' ),\n array( 'name' => 'init_international_phonenumber_fields' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'set_keyword_tags_width' ),\n array( 'name' => 'rating' ),\n array( 'name' => 'init_signature' ) // This should actually be called by the signature element, but it has been like this since the start.\n ),\n )\n );\n }", "protected function addTemplateFunctionConfigs()\n {\n // TODO: add twig template function configs\n }", "protected function setupPostContentFilter() {\n add_filter('the_title', array($this->getPostContentController(), 'modifyPostTitle'));\n add_filter('the_content', array($this->getPostContentController(), 'view'));\n add_filter('wp_footer', array($this->getPostContentController(), 'modifyFooter'));\n add_action('save_post', array($this->getPostContentController(), 'initTeaserContent'), 10, 2);\n add_action('edit_form_after_editor', array($this->getPostContentController(), 'initTeaserContent'), 10, 2);\n }", "private function setupPostFilter()\n {\n if (! is_admin()) {\n $post_types = $this->setting('search-options/post-types');\n if (! $post_types) {\n $post_types = $this->setting('post-types');\n }\n\n if ($post_types && (count($post_types) > 1)) {\n add_action('pre_get_posts', function ($query) use ($post_types) {\n if (($query->is_home() && $query->is_main_query()) || ($query->is_search()) || ($query->is_tag())) {\n if ($query->is_search()) {\n if ($post_types) {\n $query->set('post_type', $post_types);\n }\n } else {\n if ($post_types) {\n $query->set('post_type', $post_types);\n }\n }\n\n if ($this->preGetPostsCallback) {\n call_user_func($this->preGetPostsCallback, $query);\n }\n }\n });\n }\n }\n\n if ($this->setting('search-options/fulltext-search')) {\n\t add_filter('posts_search', function($search, $query){\n\t\t if ($query->is_main_query() && $query->is_search()) {\n\t\t\t if (empty($query->get('s'))) {\n\t\t\t\t return ' ';\n\t\t\t }\n\n\t\t\t global $wpdb;\n\t\t\t return $wpdb->prepare(\" AND MATCH($wpdb->posts.post_title, $wpdb->posts.post_content) AGAINST(%s)\", '*' . $query->get('s') . '*');\n\t\t } else {\n\t\t\t return $search;\n\t\t }\n\t }, 10000, 2);\n\n\n\t add_filter('posts_orderby', function($orderby, $query){\n\t\t if ($query->is_main_query() && $query->is_search()) {\n\t\t\t global $wpdb;\n\n\t\t\t return \" $wpdb->posts.post_date DESC\";\n\t\t } else {\n\t\t\t return $orderby;\n\t\t }\n\t }, 10000, 2);\n }\n\n // Below alter the way wordpress searches\n $search_tags = $this->setting('search-options/search-tags');\n if ($search_tags) {\n add_filter('posts_join', function ($join, $query) {\n global $wpdb;\n if ($query->is_main_query() && $query->is_search()) {\n $join .= \"\n LEFT JOIN\n (\n {$wpdb->term_relationships}\n INNER JOIN\n {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id\n INNER JOIN\n {$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id\n )\n ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id \";\n }\n\n return $join;\n }, 10, 2);\n\n // change the wordpress search\n add_filter('posts_where', function ($where, $query) {\n global $wpdb;\n if ($query->is_main_query() && $query->is_search()) {\n $user = wp_get_current_user();\n $user_where = '';\n $status = [\"'publish'\"];\n if (! empty($user->ID)) {\n $status[] = \"'private'\";\n\n $user_where .= \" AND {$wpdb->posts}.post_author = \".esc_sql($user->ID);\n }\n $user_where .= \" AND {$wpdb->posts}.post_status IN( \".implode(',', $status).' )';\n\n $where .= \" OR (\n {$wpdb->term_taxonomy}.taxonomy IN( 'category', 'post_tag' )\n AND\n {$wpdb->terms}.name LIKE '%\".esc_sql(get_query_var('s')).\"%'\n {$user_where}\n )\";\n }\n\n return $where;\n }, 10, 2);\n\n // change the wordpress search\n add_filter('posts_groupby', function ($groupby, $query) {\n global $wpdb;\n if ($query->is_main_query() && $query->is_search()) {\n $groupby = \"{$wpdb->posts}.ID\";\n }\n\n return $groupby;\n }, 10, 2);\n }\n }", "function twig_safe_filter($string)\n{\n return $string;\n}", "protected function getPostCompileVisitors()\n {\n $postCompileVisitors = array(\n new ILess_Visitor_JoinSelector()\n );\n\n if ($this->env->hasExtends) {\n $postCompileVisitors[] = new ILess_Visitor_ProcessExtend();\n }\n\n $postCompileVisitors[] = new ILess_Visitor_ToCSS($this->getEnvironment());\n\n // FIXME: allow plugins to hook here\n return $postCompileVisitors;\n }", "public function generatePage_postProcessing() {}", "public function postProcessResetFilterModules()\n {\n }", "function add_json_filter()\n{\n add_filter( 'json_prepare_post', 'apply_json_filter', 10, 3 );\n}", "public function register_hooks() {\n\t\tadd_filter( 'acf/pre_render_fields', array( $this, 'fields_on_translated_options_page' ), 10, 2 );\n\t\tadd_filter( 'acf/update_value', array( $this, 'overwrite_option_value' ), 10, 4 );\n\t\tadd_filter( 'acf/validate_post_id', [ $this, 'append_language_code_for_option_pages' ] );\n\t}", "public function hooks() {\n\t\t\\add_filter( 'the_generator', '__return_false' );\n\t\t\\remove_action('wp_head', 'wp_generator');\n\t}", "public function registerFilters()\n {\n foreach ($this->getFilters() as $filter) {\n try {\n $this->smarty->registerFilter($filter->getType(), $filter->getCallback());\n } catch (SmartyException $e) {\n if (null !== $this->logger) {\n $this->logger->warn(sprintf(\"SmartyException caught: %s.\", $e->getMessage()));\n }\n }\n }\n }", "function setHooks() {\n add_filter('manage_pages_columns', array($this, 'addColumn')); \n add_action('manage_pages_custom_column', array($this,'displayTemplateColumn'), 10, 2);\n\n // Hooks for filtering pages by available templates\n add_action('restrict_manage_posts', array($this, 'displayFilterOptions'));\n add_filter('parse_query', array($this, 'getPagesByTemplate'));\n }", "public function filter_timber_twig_add_basic_filters( $twig ) {\n $function_names = [\n // PHP Functions\n 'addslashes', // http://php.net/manual/en/function.addslashes.php\n 'nl2br', // http://php.net/manual/en/function.nl2br.php\n\n // WordPress functions\n 'antispambot', // https://developer.wordpress.org/reference/functions/antispambot/\n 'esc_attr', // https://developer.wordpress.org/reference/functions/esc_attr/\n 'esc_html', // https://developer.wordpress.org/reference/functions/esc_html/\n 'esc_url', // https://developer.wordpress.org/reference/functions/esc_url/\n 'esc_js', // https://developer.wordpress.org/reference/functions/esc_js/\n 'esc_textarea', // https://developer.wordpress.org/reference/functions/esc_textarea/\n 'sanitize_email', // https://developer.wordpress.org/reference/functions/sanitize_email/\n ];\n foreach ( $function_names as $func ) {\n if ( function_exists( $func ) ) {\n $twig->addFilter( new \\Twig_SimpleFilter( $func, $func ) );\n }\n }\n return $twig;\n }", "public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "function add_function ( $name ) {\r\n $this->_twig->addFunction( $name, new Twig_Function_Function( $name ) );\r\n }", "function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}", "function filter_load() {\r\n\t\tadd_action( current_filter(), array( $this, 'setup_vars' ), 20 );\r\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'get_select' ) );\r\n\t\tadd_filter( \"manage_taxonomies_for_{$this->post_type}_columns\", array( $this, 'add_columns' ) );\r\n\t}", "public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}", "public function apply()\n {\n $all_templates = $this->getTemplates($this->configuration);\n\n // Loop templates per $post_type and register templates per $post_type.\n foreach ($all_templates as $post_type => $templates) {\n add_filter(\"theme_{$post_type}_templates\", function($registeredTemplates) use ($templates)\n {\n return array_merge($registeredTemplates, $templates);\n });\n }\n }", "public function add_hooks() {\n\t\tadd_filter( 'theme_root_uri', array( $this, 'rewrite' ), 99, 1 );\n\t\tadd_filter( 'plugins_url', array( $this, 'rewrite' ), 99, 1 );\n\n\t\t// add rewrite filters for misc scripts and styles\n\t\tadd_filter( 'script_loader_src', array( $this, 'rewrite' ), 99, 1 );\n\t\tadd_filter( 'style_loader_src', array( $this, 'rewrite' ), 99, 1 );\n\t\treturn true;\n\t}", "function dunkdog_template_filter( $template_path ) { \n\tif(is_search()){\n\t\treturn $template_path;\n\t}\n\n\t$type = get_post_type(); \n if ( ( $type == 'dd-player' ) || ( $type == 'dd-team' ) || ( $type == 'dd-player-ranking' ) || ($type == 'dd-team-ranking' ) ){\n if ( is_single() ) {\n \t$prefix = 'single';\n }\n if ( is_archive()){\n \t$prefix = 'archive';\n }\n if ( is_tax()){\n \t$prefix = 'taxonomy';\n\n \t// if(get_query_var('taxonomy')=='dd-conference'){\n \t// \t$type = 'dd-team';\n \t// }else{\n \t\t$type = 'dd-player'; // forcing tax to be player; no other need for team or ranking taxonomy\n \t// }\n }\n\n $template_path = dunkdog_template_function($prefix . '-' . $type, false);\n \n }\n \n if(DD_DEBUG){global $wp_query; krumo('template_path', $template_path, $prefix, $type, $wp_query);}\n\treturn $template_path;\n}", "public function init_hooks() {\n\t\tadd_action( 'vc_after_mapping', array( $this, 'vc_after_mapping' ) );\n\t}", "function acf_add_deprecated_filter($deprecated, $version, $replacement)\n{\n}", "function smarty_postfilter_process_tags ($source, Smarty_Internal_Template $template)\n{\n\t$extra = array (\n\t\t'include' => array(),\n\t\t'addon' => array(),\n\t\t'module' => array(),\n\t);\n\t$addSection = false;\n\tforeach ($template->used_tags as $tag) {\n\t\tif (!in_array($tag[0], array('addon','include','module','listing'))) {\n\t\t\t//not addon or include tag\n\t\t\tcontinue;\n\t\t}\n\t\t\t\n\t\t$vars = array();\n\t\tforeach ($tag[1] as $var) {\n\t\t\tforeach ($var as $name => $val) {\n\t\t\t\t$vars[$name] = trim($val,\"'\\\"\");\n\t\t\t}\n\t\t}\n\t\tif ($tag[0]=='include') {\n\t\t\t//go through includes as well\n\t\t\t$info = array();\n\t\t\t\n\t\t\t$info['file'] = $vars['file'];\n\t\t\t\n\t\t\tif (isset($vars['g_type'])) {\n\t\t\t\t$info['g_type'] = $vars['g_type'];\n\t\t\t}\n\t\t\tif (isset($vars['g_resource'])) {\n\t\t\t\t$info['g_resource'] = $vars['g_resource'];\n\t\t\t}\n\t\t\t//make key such that if same include is used multiple times, it is still\n\t\t\t//only added to the array once\n\t\t\t$extra['include'][implode(':',$info)] = $info;\n\t\t\tunset ($info);\n\t\t} else if ($tag[0]=='module') {\n\t\t\tif (isset($vars['tag']) && $vars['tag']) {\n\t\t\t\t$extra['module'][$vars['tag']] = $vars['tag'];\n\t\t\t}\n\t\t} else if ($tag[0] == 'addon' || $tag[0]=='listing') {\n\t\t\tif (!isset($vars['addon']) || !isset($vars['tag']) || $vars['addon']=='core') {\n\t\t\t\t//failsafe, required info missing, or this is a core tag\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Note: Do NOT check to see if addon is enabled and has the tag\n\t\t\t//able to be used at this point, or template would need to be re-compiled\n\t\t\t//every time addon is enabled/disabled\n\t\t\t\n\t\t\t$info = array();\n\t\t\t\n\t\t\t$info['addon'] = $vars['addon'];\n\t\t\t$info['tag'] = $vars['tag'];\n\t\t\t\n\t\t\t//make key such that if the same addon tag is used multiple times, it is\n\t\t\t//still only added to the array once\n\t\t\t$extra['addon'][implode(':',$info)] = $info;\n\t\t\tunset($info);\n\t\t}\n\t\t$addSection = true;\n\t}\n\t$template->mustCompile();\n\tif ($addSection) {\n\t\t//there is stuff to process\n\t\t\n\t\t$section = '<?php $_smarty_tpl->used_tags = '.var_export($extra,1).'; ?>';\n\t\t\n\t\t$source = str_replace('/*/%%SmartyHeaderCode%%*/?>','/*/%%SmartyHeaderCode%%*/?>'.$section,$source);\n\t}\n\treturn $source;\n}", "function _dotgo_filter_prepare() {\n\n}", "function my_footer_shh() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "public function register_output_filter($callback_impl, $filter_name = '')\n {\n if (empty($filter_name)) {\n $filter_name = substr(abs(crc32(microtime(true))), 0, 8);\n }\n $this->_OUTPUT_FILTERS[$filter_name] = $callback_impl;\n }", "public function postProcess();", "public static function add_filter($tag, $fn, $priority = 10, $accepted_args = 1)\r\n {\r\n $current_priority = has_filter($tag, $fn);\r\n\r\n if ($current_priority === $priority) {\r\n return;\r\n }\r\n\r\n if ($current_priority !== $priority) {\r\n remove_filter($tag, $fn);\r\n }\r\n\r\n add_filter($tag, $fn, $priority, $accepted_args);\r\n }", "public function register_hooks() {\n\t\tadd_filter( 'post_link_category', [ $this, 'post_link_category' ], 10, 3 );\n\t}", "function wp_filter_post_kses($data)\n {\n }", "public static function pre_process() {}", "protected function _post_render() {\n\t\n\t\t// Silence is golden\n\t\n\t}", "public function postRender()\n {\n }", "public function test_apply_filter_create_function( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "function acf_disable_filters()\n{\n}", "public function _templateProcessing($attrs, $children) {\r\n $this->processingFunction = function($controller) use($children) {\r\n foreach($children as $child) {\r\n $child->__invoke($controller);\r\n }\r\n };\r\n }", "protected function filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {\n\t\treturn \\add_filter( $tag, [ $this, $function_to_add ], $priority, $accepted_args );\n\t}", "function add_filter($name, $callback, $priority = 10)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->addFilter($name, $callback, $priority);\n }\n}", "public function _apply_output_filters($text = '')\n {\n foreach ((array) $this->_OUTPUT_FILTERS as $cur_filter) {\n if (is_callable($cur_filter)) {\n $text = call_user_func($cur_filter, $text);\n }\n }\n return $text;\n }", "public function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );\n\t\treturn $twig;\n\t}", "function add_late_scripts()\n\t{\n\t\t// only procceed if we have finished printing footer scripts\n\t\tif (did_action('bwp_minify_after_footer_scripts'))\n\t\t\t$this->todo_late_scripts = 'footer' . $this->late_script_order;\n\t}", "protected function postApply(): void {\n\t\t// re-register events\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Rules::applyRules', 1);\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata');\n\t}", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "public static function getPostProcessor()\n {\n }", "protected function add()\n {\n $this->numArgs = $this->findNumArgs($this->callback);\n if (is_string($this->callback) && class_exists($this->callback)) {\n $this->useCallbackManager('invoke', $this->callback);\n }\n foreach ((array) $this->hook as $hook) {\n \\add_filter($hook, $this->callback, $this->priority, $this->numArgs);\n }\n }", "function tidyt_get_post_type_archive_template_functions() {\n\n $post_type = get_query_var( 'post_type' );\n if ( is_array( $post_type ) )\n $post_type = reset( $post_type );\n\n $obj = get_post_type_object( $post_type );\n if ( ! $obj->has_archive )\n return '';\n\n return tidyt_get_archive_template_functions();\n}" ]
[ "0.6769889", "0.67541254", "0.64160013", "0.61654174", "0.6124806", "0.6036429", "0.5968456", "0.5938088", "0.58840364", "0.5806517", "0.5777778", "0.5724347", "0.567673", "0.5592164", "0.55697477", "0.5513224", "0.5494791", "0.54361206", "0.54172826", "0.5411904", "0.53983426", "0.531215", "0.52933365", "0.5287966", "0.5271787", "0.52686703", "0.5249521", "0.5238338", "0.52203834", "0.5219524", "0.52031857", "0.5180401", "0.5180401", "0.5180401", "0.51766443", "0.51160496", "0.5108997", "0.5102424", "0.5100591", "0.508732", "0.50821424", "0.5081097", "0.5075913", "0.50659055", "0.5060902", "0.5050751", "0.50242805", "0.502292", "0.50142527", "0.5006089", "0.499361", "0.49861053", "0.4982297", "0.49773836", "0.49755195", "0.49619395", "0.4950389", "0.49484697", "0.49477243", "0.4928351", "0.49157068", "0.4912998", "0.49056533", "0.49035266", "0.49032924", "0.48910904", "0.48906568", "0.48717195", "0.48683038", "0.48629144", "0.4852", "0.4851424", "0.48419455", "0.48380205", "0.48306483", "0.4828827", "0.47931454", "0.47909966", "0.4788589", "0.47867623", "0.47855425", "0.47751218", "0.47652993", "0.47602338", "0.47498554", "0.4744074", "0.47424322", "0.4714821", "0.4712385", "0.4709405", "0.4709172", "0.47071058", "0.47067684", "0.47055146", "0.46969503", "0.4696197", "0.4681748", "0.46765146", "0.46753055", "0.4650777" ]
0.7855613
0