Initial Commit

This commit is contained in:
Frank John Begornia
2019-03-06 20:32:31 +08:00
commit 562f03488a
2123 changed files with 780991 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
class TemplatesModel extends Model {
function selectTemplates($id){
$i = DB::table('templates')->where('SportsId', '=', $id)->get();
return $i;
}
function selectTemplateTypes(){
$i = DB::table('template_types')->get();
return $i;
}
function selectTemplateLastId(){
$i = DB::table('templates')->orderBy('Id', 'DESC')->first();
return $i;
}
function insertNewTempalte($data){
$i = DB::table('templates')->insert($data);
return $i;
}
function insertTempaltePaths($data){
$i = DB::table('template_paths')->insert($data);
return $i;
}
function selectTemplate($tempCode){
$i = DB::table('templates')->where('TemplateCode', '=', $tempCode)->get();
return $i;
}
function selectTemplatePaths($tempCode){
$i = DB::table('template_paths')->where('TemplateCode', '=', $tempCode)->get();
return $i;
}
function updateNewTemplate($data, $templatecode){
$i = DB::table('templates')->where('TemplateCode', $templatecode)->update($data);
return $i;
}
function updateTemplatePaths($data, $Id){
// $i = DB::table('template_paths')->where([
// ['TemplateCode', '=', $templatecode],
// ['Type', '=', $data['Type']],
// ['Side', '=', $data['Side']]
// ])->update($data);
$i = DB::table('template_paths')->where('Id', '=', $Id)->update($data);
return $i;
}
}