/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $template = new Template($request->all());
     $template->user_id = Auth::user()->id;
     $template->save();
     return Redirect::route('templates.index');
 }
Beispiel #2
0
 public static function exceptionHandler(\Exception $exception)
 {
     $template = new Template('error.twig');
     $template->title = 'Error';
     $template->alert('danger', $exception->getMessage());
     $template->e = $exception;
     $template->render(true);
 }
Beispiel #3
0
 public function getSectionInfo()
 {
     $tickets = $this->tickets->getTicketsFromSection($this->request->get('section'));
     $availableCount = count(array_filter($tickets, function ($ticketInfo) {
         return $ticketInfo['status'] == 'available';
     }));
     $view = new Template('modal_section', compact('tickets'));
     return $this->json(['html' => $view->fetch(), 'count' => $availableCount]);
 }
Beispiel #4
0
 /**
  * Display FRONT PAGE
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $programs = \App\Program::orderBy(\DB::raw('RAND()'))->take(4)->get();
     $programs_high_bonus = \App\Program::orderBy(\DB::raw('RAND()'))->take(4)->get();
     $program_logos = \App\Program::get(array('logo_bgcolor', 'slug'));
     return view(\App\Template::view('page.front-page'))->with(['menu_item' => 'home', 'edit_mode' => false, 'programs' => $programs, 'programs_high_bonus' => $programs_high_bonus, 'program_logos' => $program_logos]);
 }
 public function createfortemplate($template)
 {
     $template = Template::findOrFail($template);
     $answertypes = Answertype::lists('name', 'id');
     $questionable_type = 'App\\Template';
     $questionable_id = $template->id;
     return view('questions.create', compact('answertypes', 'questionable_id', 'questionable_type'));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $template = new Template();
     $template->name = 'Blog';
     $template->slug = 'Blog';
     $template->description = 'Create a blog post.';
     $template->save();
     $template = new Template();
     $template->name = 'Project';
     $template->slug = 'Project';
     $template->description = 'Create a project post.';
     $template->save();
     $template = new Template();
     $template->name = 'Book';
     $template->slug = 'Book';
     $template->description = 'Create a Book project.';
     $template->save();
 }
Beispiel #7
0
 public function deleteDelete($id)
 {
     $template = Template::find($id);
     if (is_null($template)) {
         return back()->withErrors('没有这个模板');
     } elseif ($template->delete()) {
         return redirect('template/list')->with('status', '模板删除成功');
     } else {
         return back()->withErrors('模板删除失败');
     }
 }
Beispiel #8
0
 public function index(Request $request, Response $response, array $args)
 {
     $template = new Template('home.twig');
     // Get a list of tags to show.
     $tagsSql = "SELECT tags.id, tags.title, count(*) AS item_count " . " FROM tags JOIN item_tags ON tags.id=item_tags.tag " . " GROUP BY tags.id";
     $params = [];
     if (isset($args['id'])) {
         $tagsSql .= " WHERE id = :id";
         $params['id'] = $args['id'];
     }
     $template->tags = $this->db->query($tagsSql, $params);
     // Get the Items with the currently-selected tags.
     $sql = "SELECT items.id FROM items " . " JOIN groups ON groups.id = items.read_group " . " LIMIT 20";
     $params = [];
     $items = $this->db->query($sql, $params, '\\App\\Item');
     $template->items = $items;
     $template->title = 'Home';
     // Return.
     $response->setContent($template->render());
     return $response;
 }
 public function postContent(Request $request)
 {
     $content = new Content();
     $content->user_id = \Auth::user()->id;
     $content->slug = $request->input('title');
     $content->fill($request->all());
     $content->save();
     $template = Template::find($request->input('template_id'));
     // make directory for content
     $contentDir = base_path() . $this->contentDir;
     if (!\File::exists($contentDir)) {
         \File::makeDirectory($contentDir, 755);
     }
     $contentDir = $contentDir . $content->id;
     \File::makeDirectory($contentDir, 755);
     $templateDir = base_path() . $this->templateDir . $template->slug;
     \File::copyDirectory($templateDir, $contentDir);
     return response()->json($content->id, 200);
 }
 public function populateDropdowns()
 {
     $populatecountry = Country::orderBy('created_at', 'asc')->paginate(100);
     $populatemunicipality = Municipality::orderBy('created_at', 'asc')->paginate(100);
     $populateregion = Region::orderBy('created_at', 'asc')->paginate(100);
     $populateschool_level = School_level::orderBy('created_at', 'asc')->paginate(100);
     $populateschool_type = School_type::orderBy('created_at', 'asc')->paginate(100);
     $populateacademic_year = Academic_year::orderBy('created_at', 'asc')->paginate(100);
     $populatetemplate = Template::orderBy('created_at', 'asc')->paginate(100);
     $site_code = Settings::first()->site_code;
     $site_title = Settings::first()->site_title;
     $owner = Settings::first()->owner;
     $street = Settings::first()->street;
     $barangay = Settings::first()->barangay;
     $zip_code = Settings::first()->zip_code;
     $contact = Settings::first()->contact;
     $fax = Settings::first()->fax;
     $tin = Settings::first()->tin;
     //$posts=Post::orderBy('created_at','desc')->paginate(15);
     //return view('general-settings',['populatecountry' => $populatecountry]);
     return view('general-settings')->with('populatecountry', $populatecountry)->with('populatemunicipality', $populatemunicipality)->with('populateregion', $populateregion)->with('populateschool_level', $populateschool_level)->with('populateschool_type', $populateschool_type)->with('populateacademic_year', $populateacademic_year)->with('populatetemplate', $populatetemplate)->with('site_code', $site_code)->with('site_title', $site_title)->with('owner', $owner)->with('street', $street)->with('barangay', $barangay)->with('zip_code', $zip_code)->with('contact', $contact)->with('fax', $fax)->with('tin', $tin);
 }
Beispiel #11
0
 public function run()
 {
     DB::table('templates')->delete();
     Template::create(['name' => 'Soft Colors Template', 'alias' => 'soft', 'description' => 'A template with soft colors to soothe the soul.', 'active_state' => false, 'css_content' => 'body{ background-color: beige;}', 'created_by' => 1, 'modified_by' => 1]);
     Template::create(['name' => 'Other Colors Template', 'alias' => 'other', 'description' => 'A template with other colors to soothe the soul.', 'active_state' => true, 'css_content' => 'body{ background-color: e0eeee; } #Header h1{color: #ffa500} #Footer h1{color: #450b00} #Main h1{color: #00ced1}', 'created_by' => 1, 'modified_by' => 1]);
 }
Beispiel #12
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $programs = \App\Program::orderBy('name', 'asc')->get();
     return view(\App\Template::view('program.index'), ['menu_item' => 'casino', 'programs' => $programs]);
 }
 public function getCategoryTemplateList($categoryId)
 {
     $templates = Template::where('category_id', '=', $categoryId)->get();
     return $templates;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  Template $template
  * @return Response
  */
 public function destroy($template)
 {
     $template->delete();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function update($id, Request $request)
 {
     // Grab our template
     $tg = TemplateGroup::findOrFail($id);
     $templates = $tg->templates;
     // Make an array of template IDs: existing templates and request templates.
     $currentTemplates = [];
     foreach ($templates as $template) {
         $currentTemplates[] = $template->template_id;
     }
     $newTemplates = array_keys($request->templates);
     $templatesDelete = array_diff($currentTemplates, $newTemplates);
     $templatesAdd = array_diff($newTemplates, $currentTemplates);
     foreach ($templatesDelete as $td) {
         $tpl = Template::where('template_id', '=', $td)->where('template_group_id', '=', $tg->id)->first();
         $tpl->delete();
     }
     foreach ($templatesAdd as $ta) {
         $newTemplate = new Template(['template_id' => $ta, 'size' => 'SaaS' == $request->type ? '0' : $request['templateSize'][$ta], 'price' => '0']);
         $tg->templates()->save($newTemplate);
         unset($newTemplate);
     }
     // Update the template group record
     $tg->name = $request->name;
     $tg->type = $request->type;
     // Check to see if we have a new image to work with
     if ($request->hasFile('display_img')) {
         // Save file somewhere useful
         $path = public_path() . '/img/';
         $filename = $request->file('display_img')->getFilename() . '.' . $request->file('display_img')->guessExtension();
         $request->file('display_img')->move($path, $filename);
         $tg->display_img = $filename;
     }
     $tg->save();
     flash()->success('Successfully updated template group: ' . $tg->name);
     return back();
 }
 public function run()
 {
     DB::table('products')->delete();
     Template::create(['style_name' => 'Авто', 'height' => '348', 'width' => '606', 'offset' => '25', 'code_face' => '{"data_id":"45326446","data_value":"E-mail: xxxxx@xxxx.xx","style":"color: rgb(0, 0, 0); font-size: 20px; left: 356px; top: 272px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 356px; top: 272px;"}|||{"data_id":"29932038","data_value":"моб.: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 371px; top: 242px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 371px; top: 242px;"}|||{"data_id":"15987516","data_value":"Тел.факс: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 326px; top: 211px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 326px; top: 211px;"}|||{"data_id":"22169546","data_value":"Улица, дом","style":"color: rgb(0, 0, 0); font-size: 18px; left: 453px; top: 183px;","styleImg":"color: rgb(0, 0, 0); font-size: 18px; left: 453px; top: 183px;"}|||{"data_id":"45948140","data_value":"Страна, г. Город","style":"color: rgb(0, 0, 0); left: 409px; top: 161px; font-size: 18px;","styleImg":"color: rgb(0, 0, 0); left: 409px; top: 161px; font-size: 18px;"}|||{"data_id":"99653617","data_vis":false,"data_value":"должность","style":"color: rgb(0, 0, 0); left: 471px; top: 127px;","styleImg":"color: rgb(0, 0, 0); left: 471px; top: 127px;"}|||{"data_id":"11236042","data_value":"Имя Отчество","style":"font-size: 20px; color: rgb(255, 255, 255); left: 417px; top: 103px;","styleImg":"font-size: 20px; color: rgb(255, 255, 255); left: 417px; top: 103px;"}|||{"data_id":"5916004","data_value":"Фамилия","style":"font-size: 28px; color: rgb(255, 255, 255); left: 419px; top: 67px; font-weight: bold;","styleImg":"font-size: 28px; color: rgb(255, 255, 255); left: 419px; top: 67px; font-weight: bold;"}|||{"data_id":"40267012","data_value":"услуги","style":"color: rgb(0, 0, 0); left: 504px; top: 20px;","styleImg":"color: rgb(0, 0, 0); left: 504px; top: 20px;"}|||{"data_id":"63309878","data_value":"Название","style":"color: rgb(0, 0, 0); font-size: 20px; left: 462px; top: 0px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 462px; top: 0px;"}|||{"data_id":"370647","data_name":"9b3f0c35fc9b8eifj4rf4uf49rfj4f8c8ea78.jpg","data_type":true,"styleImg":"position: absolute; top: -112px; left: -295px; width: 906.7707641196013px; height: 570px;"}|||11|||"rgb(255, 255, 255)"', 'code_back' => '{"data_id":"45326446","data_value":"E-mail: xxxxx@xxxx.xx","style":"color: rgb(0, 0, 0); font-size: 20px; left: 356px; top: 272px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 356px; top: 272px;"}|||{"data_id":"29932038","data_value":"моб.: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 371px; top: 242px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 371px; top: 242px;"}|||{"data_id":"15987516","data_value":"Тел.факс: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 326px; top: 211px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 326px; top: 211px;"}|||{"data_id":"22169546","data_value":"Улица, дом","style":"color: rgb(0, 0, 0); font-size: 18px; left: 453px; top: 183px;","styleImg":"color: rgb(0, 0, 0); font-size: 18px; left: 453px; top: 183px;"}|||{"data_id":"45948140","data_value":"Страна, г. Город","style":"color: rgb(0, 0, 0); left: 409px; top: 161px; font-size: 18px;","styleImg":"color: rgb(0, 0, 0); left: 409px; top: 161px; font-size: 18px;"}|||{"data_id":"99653617","data_vis":false,"data_value":"должность","style":"color: rgb(0, 0, 0); left: 471px; top: 127px;","styleImg":"color: rgb(0, 0, 0); left: 471px; top: 127px;"}|||{"data_id":"11236042","data_value":"Имя Отчество","style":"font-size: 20px; color: rgb(255, 255, 255); left: 417px; top: 103px;","styleImg":"font-size: 20px; color: rgb(255, 255, 255); left: 417px; top: 103px;"}|||{"data_id":"5916004","data_value":"Фамилия","style":"font-size: 28px; color: rgb(255, 255, 255); left: 419px; top: 67px; font-weight: bold;","styleImg":"font-size: 28px; color: rgb(255, 255, 255); left: 419px; top: 67px; font-weight: bold;"}|||{"data_id":"40267012","data_value":"услуги","style":"color: rgb(0, 0, 0); left: 504px; top: 20px;","styleImg":"color: rgb(0, 0, 0); left: 504px; top: 20px;"}|||{"data_id":"63309878","data_value":"Название","style":"color: rgb(0, 0, 0); font-size: 20px; left: 462px; top: 0px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 462px; top: 0px;"}|||{"data_id":"370647","data_name":"9b3f0c35fc9b8eifj4rf4uf49rfj4f8c8ea78.jpg","data_type":true,"styleImg":"position: absolute; top: -112px; left: -295px; width: 906.7707641196013px; height: 570px;"}|||11|||"rgb(255, 255, 255)"', 'preview' => 'template_1.png', 'active' => 1]);
     Template::create(['style_name' => 'Абстрактные', 'height' => '348', 'width' => '606', 'offset' => '25', 'code_face' => '{"data_id":"28443115","data_name":"1545761cf57cc2.jpeg","data_type":true,"styleImg":"left: 1px; top: 1px; position: absolute; width: 627.407407407407px; height: 350px;"}|||{"data_id":"45326446","data_value":"E-mail: xxxxx@xxxx.xx","style":"color: rgb(247, 242, 247); font-size: 20px; left: 338px; top: 267px;","styleImg":"color: rgb(247, 242, 247); font-size: 20px; left: 338px; top: 267px;"}|||{"data_id":"29932038","data_value":"моб.: (ххх) ххх-хх-хх","style":"color: rgb(240, 231, 240); font-size: 20px; left: 357px; top: 240px;","styleImg":"color: rgb(240, 231, 240); font-size: 20px; left: 357px; top: 240px;"}|||{"data_id":"15987516","data_value":"Тел.факс: (ххх) ххх-хх-хх","style":"color: rgb(250, 250, 250); font-size: 20px; left: 312px; top: 213px;","styleImg":"color: rgb(250, 250, 250); font-size: 20px; left: 312px; top: 213px;"}|||{"data_id":"22169546","data_value":"Улица, дом","style":"color: rgb(245, 240, 245); font-size: 18px; left: 447px; top: 187px;","styleImg":"color: rgb(245, 240, 245); font-size: 18px; left: 447px; top: 187px;"}|||{"data_id":"45948140","data_value":"Страна, г. Город","style":"color: rgb(245, 233, 245); left: 404px; top: 157px; font-size: 18px;","styleImg":"color: rgb(245, 233, 245); left: 404px; top: 157px; font-size: 18px;"}|||{"data_id":"99653617","data_value":"должность","style":"color: rgb(245, 237, 245); left: 462px; top: 104px;","styleImg":"color: rgb(245, 237, 245); left: 462px; top: 104px;"}|||{"data_id":"11236042","data_value":"Имя Отчество","style":"font-size: 20px; color: rgb(255, 255, 255); left: 407px; top: 82px;","styleImg":"font-size: 20px; color: rgb(255, 255, 255); left: 407px; top: 82px;"}|||{"data_id":"5916004","data_value":"Фамилия","style":"font-size: 28px; color: rgb(245, 237, 245); left: 410px; top: 48px; font-weight: bold; font-family: Arial;","styleImg":"font-size: 28px; color: rgb(245, 237, 245); left: 410px; top: 48px; font-weight: bold; font-family: Arial;"}|||{"data_id":"40267012","data_value":"услуги","style":"color: rgb(245, 233, 245); left: 494px; top: 28px;","styleImg":"color: rgb(245, 233, 245); left: 494px; top: 28px;"}|||{"data_id":"63309878","data_value":"Название","style":"color: rgb(245, 242, 245); font-size: 20px; left: 452px; top: 2px;","styleImg":"color: rgb(245, 242, 245); font-size: 20px; left: 452px; top: 2px;"}|||11|||"rgb(255, 255, 255)"', 'code_back' => '', 'preview' => '8dd153adbc08.png', 'active' => 1]);
     Template::create(['style_name' => 'Абстрактные', 'height' => '348', 'width' => '606', 'offset' => '25', 'code_face' => '{"data_id":"39834242","data_name":"15457d70dcd5ef.jpeg","data_type":true,"styleImg":"position: absolute; top: 0px; left: -17px; width: 625.614814814815px; height: 349px;"}|||{"data_id":"45326446","data_value":"E-mail: xxxxx@xxxx.xx","style":"color: rgb(0, 0, 0); font-size: 20px; left: 196px; top: 270px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 196px; top: 270px;"}|||{"data_id":"29932038","data_value":"моб.: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 4px; top: 269px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 4px; top: 269px;"}|||{"data_id":"15987516","data_value":"Тел.факс: (ххх) ххх-хх-хх","style":"color: rgb(0, 0, 0); font-size: 20px; left: 1px; top: 245px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 1px; top: 245px;"}|||{"data_id":"22169546","data_value":"Улица, дом","style":"color: rgb(0, 0, 0); font-size: 18px; left: 164px; top: 218px;","styleImg":"color: rgb(0, 0, 0); font-size: 18px; left: 164px; top: 218px;"}|||{"data_id":"45948140","data_value":"Страна, г. Город","style":"color: rgb(0, 0, 0); left: 0px; top: 219px; font-size: 18px;","styleImg":"color: rgb(0, 0, 0); left: 0px; top: 219px; font-size: 18px;"}|||{"data_id":"99653617","data_value":"должность","style":"color: rgb(0, 0, 0); left: 234px; top: 164px;","styleImg":"color: rgb(0, 0, 0); left: 234px; top: 164px;"}|||{"data_id":"11236042","data_value":"Имя Отчество","style":"font-size: 20px; color: rgb(0, 0, 0); left: 214px; top: 134px;","styleImg":"font-size: 20px; color: rgb(0, 0, 0); left: 214px; top: 134px;"}|||{"data_id":"5916004","data_value":"Фамилия","style":"font-size: 28px; color: rgb(0, 0, 0); left: 212px; top: 99px; font-weight: bold; font-family: Arial;","styleImg":"font-size: 28px; color: rgb(0, 0, 0); left: 212px; top: 99px; font-weight: bold; font-family: Arial;"}|||{"data_id":"40267012","data_value":"услуги","style":"color: rgb(0, 0, 0); left: 238px; top: 24px;","styleImg":"color: rgb(0, 0, 0); left: 238px; top: 24px;"}|||{"data_id":"63309878","data_value":"Название","style":"color: rgb(0, 0, 0); font-size: 20px; left: 218px; top: 2px;","styleImg":"color: rgb(0, 0, 0); font-size: 20px; left: 218px; top: 2px;"}|||11|||"rgb(255, 255, 255)"', 'code_back' => '', 'preview' => '7ed916601172.png', 'active' => 1]);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $article = Article::find($id);
     $pageTitle = 'Update Department: ' . $article->display_name;
     $article->category_name = Category::find($article->category_id)->display_name;
     $article->template = $article->template_id != 0 ? Template::find($article->template_id)->toArray() : null;
     $article->sections = $article->articleSections()->get()->toArray();
     return view('home.articles.edit', compact('pageTitle', 'article'));
 }
Beispiel #18
0
    }
    $variableMapping = ['/\\%CHI_NAME\\%/' => "chinese_name", '/\\%ENG_NAME\\%/' => "english_name", '/\\%TODAY\\%/' => "today", '/\\%LOGIN\\%/' => "loginname", '/\\%PASSWORD\\%/' => "password"];
    $template = \App\Template::firstOrFail()->template;
    $letters = [];
    foreach ($customers as $user) {
        $letter = $template;
        foreach ($variableMapping as $pattern => $variable) {
            if ($pattern == '/\\%TODAY\\%/') {
                $today = \Carbon\Carbon::create()->toDateString();
                $letter = preg_replace($pattern, $today, $letter);
            } else {
                $letter = preg_replace($pattern, $user->{$variable}, $letter);
            }
        }
        $letters[] = $letter;
    }
    return view('print.accountInitLetter', compact('letters'));
});
Route::get('/template/create', function () {
    $template = \App\Template::first();
    return view('print.createTemplate', compact('template'));
});
Route::put('/template/update', function (\Illuminate\Http\Request $request) {
    $template = \App\Template::firstOrFail();
    $template->update($request->all());
    return view('print.createTemplate', compact('template'));
});
Route::post('/template/create', function (\Illuminate\Http\Request $request) {
    \App\Template::create($request->all());
    return view('print.accountInitLetter', compact('text'));
});
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request, Template $template, $id)
 {
     //
     Template::findOrFail($id)->delete();
     return redirect('/templates');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $destroyTemplate = Template::destroy($id);
     flash()->success('Template Deleted.');
     return redirect('template');
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Template::all();
 }
 public function getcompareproduct($id, $cate)
 {
     return array("template" => Template::Compare_Cate($cate, $id), "product" => Product::select(array(DB::raw("check_coupon(pro_product.id,pro_product.cid_cate,1) AS discountcoupon"), DB::raw("check_coupon(pro_product.id,pro_product.cid_cate,2) AS coupons"), DB::raw("get_review(pro_product.id,1) AS rating"), DB::raw("get_review(pro_product.id,2) AS countrating"), DB::raw("get_price(pro_supplier_product.id,pro_supplier_product.discount) AS discount"), DB::raw("get_sale_price(pro_supplier_product.id,pro_supplier_product.saleprice) AS saleprice"), "market_supplier.name AS myname", "pro_product.cid_series", "pro_supplier_product.cid_supplier", "pro_product.id", "pro_product.id AS myid", "pro_product.name", "pro_product.isprice", "pro_supplier_product.stock_num", "pro_product.is_shopping"))->whereRaw("pro_product.id ={$id} AND pro_product.status='1' AND pro_product.is_status_cate='1' AND pro_product.is_status_series='1'  ")->join("pro_supplier_product", function ($join) {
         $join->on("pro_product.id", "=", "pro_supplier_product.cid_product");
     })->join("market_supplier", function ($join) {
         $join->on("market_supplier.id", "=", "pro_supplier_product.cid_supplier");
     })->first());
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id ID of the page to show
  * @return \Illuminate\Http\Response
  */
 public function show($adID, $id)
 {
     $match = ['id' => $id, 'deleted' => 0];
     $page = Page::where($match)->first();
     // one to one only return 1
     if ($page == null) {
         return redirect()->route('dashboard.advert.edit', [$adID])->with('message', 'Error: Could not find page');
     }
     $pageData = $page->PageData->where('id', $page->page_data_id)->orderBy('heading', 'ASC')->first();
     $advert = Advert::find($adID);
     if ($advert == null) {
         return redirect()->route('dashboard.advert.edit', [$adID])->with('message', 'Error: Advert removed before update');
     }
     $background = Background::find($advert->background_id);
     if ($background == null) {
         return redirect()->route('dashboard.advert.edit', [$adID])->with('message', 'Error: Background removed before update');
     }
     $data = array('page' => $page, 'pageData' => $pageData, 'activeTemplate' => $page->Template, 'templates' => Template::all(), 'advertBackground' => $background);
     return view('pages/pageeditor', $data);
 }
 public function templateEditor(Template $templatesModel, $name, $id)
 {
     $template = Template::find($id);
     $templates = $templatesModel->getTemplate();
     return view('order.template_editor')->with('template', $template)->with('templates', $templates);
 }
Beispiel #25
0
 public function getEdit($id)
 {
     $vote = Vote::find($id);
     $templates = Template::orderBy('id')->get();
     return view('vote.edit', ['title' => '编辑' . $vote->title, 'vote' => $vote, 'templates' => $templates]);
 }
 public function templates()
 {
     $templates = Template::all(['id', 'name', 'thumbnail']);
     return response()->json($templates->toArray(), 200);
 }
Beispiel #27
0
<?php

use App\TopicData;
use App\Template;
if (isset($_POST['id']) && !empty($_POST['id'])) {
    $data = new TopicData();
    if ($data->update($_POST)) {
        header('Location: /index.php');
        exit;
    } else {
        echo 'An error occurred';
        exit;
    }
}
if (!isset($_GET['id']) || empty($_GET['id'])) {
    echo 'You did not pass in an ID.';
    exit;
}
$data = new TopicData();
$topic = $data->getTopic($_GET['id']);
if ($topic === false) {
    echo 'Topic not found!';
    exit;
}
$template = new Template('../views/base.phtml');
$template->render('../views/index/edit.phtml', ['topic' => $topic]);
 public function showContent($id)
 {
     $template = Template::find($id);
     return \View::make('admin.template.content_template')->withTemplate($template);
 }
 /**
  * Filter templates by criteria
  * @param \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function filter(Request $request)
 {
     $user = Session::get('user');
     // Get request inputs
     $btnFindTemplate = $request->input('btnFindTemplate');
     $btnFindAll = $request->input('btnFindAll');
     $templateName = $request->input('txtTemplateName');
     $templateClass = $request->input('txtTemplateClass');
     $templateDuration = $request->input('numTemplateDuration');
     $templates = Template::all();
     // Check which action to perform
     if (isset($btnFindTemplate)) {
         $filtered = collect([]);
         // First filter by name
         if ($templateName != null) {
             $filtered = $templates->filter(function ($item) use($templateName) {
                 if (strpos($item->name, $templateName) !== false) {
                     // Get rough match
                     return true;
                 }
             });
         }
         // If no results found filter by class name
         if ($templateClass != null) {
             if ($filtered->count() == 0) {
                 $filtered = $templates->filter(function ($item) use($templateClass) {
                     if (strpos($item->class_name, $templateClass) !== false) {
                         // Get rough match
                         return true;
                     }
                 });
             }
         }
         // Again if no result found filter by duration
         if ($filtered->count() == 0) {
             $filtered = $templates->filter(function ($item) use($templateDuration) {
                 if ($item->duration == $templateDuration) {
                     return true;
                 }
             });
         }
         $templates = $filtered;
     } else {
         if (isset($btnFindAll)) {
             // Reset search fields
             $templateName = null;
             $templateClass = null;
             $templateDuration = null;
         } else {
             abort(401, 'Un-authorised');
         }
     }
     $data = array('user' => $user, 'templates' => $templates);
     return view('pages/templatesEditor', $data);
 }
Beispiel #30
-2
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $pagesAll = Page::all();
     $articlesAll = Article::all();
     $templatesAll = Template::all();
     $contentAreasAll = ContentArea::all();
     $content_areas = ContentArea::lists('name', 'id');
     $pages = Page::lists('name', 'id');
     $article = Article::findOrFail($id);
     return view('site.edit', compact('article', 'pages', 'content_areas', 'pagesAll', 'articlesAll', 'templatesAll', 'contentAreasAll'));
 }