Exemplo n.º 1
0
 public static function generate_html($data)
 {
     $root_url = dirname($_SERVER['PHP_SELF']);
     $returnhtml = "\n                      <table class='table table-bordered table-hover table-striped'>\n                      <thead>\n                      <tr>\n                      <th class='text-center'>ดำเนินการ</th>\n                      <th class='text-center'>ชื่อบริษัท</th>\n                      <th class='text-center'>Hashtag</th>\n                      <th class='text-center'>ข้อความ</th>\n                      <th class='text-center'>สร้างโดย</th>\n                      <th class='text-center'>วันที่สร้าง</th>\n                      <th class='text-center'>มอบหมายให้</th>\n                      </tr>\n                      </thead>\n                      <tbody>";
     if (isset($data)) {
         if (count($data) == 0) {
             $returnhtml .= "<tr>\n                                <td class='text-center' colspan='7'>ไม่พบข้อมูล</td>\n                            </tr>";
         } else {
             foreach ($data as $record) {
                 $returnhtml .= "<tr><td class='text-center vcenter'>\n                              <a target='_blank' href='" . $root_url . "/detail_call_report/" . $record['id'] . "'><i class='fa fa-eye fa-lg text-primary'></i></a>\n                              <a target='_blank' href='" . $root_url . "/edit_call_report/" . $record['id'] . "'><i class='fa fa-edit fa-lg text-danger'></i></a>\n                              </td><td class='text-center vcenter'>" . $record['company_name'] . "</td><td class='text-center vcenter'>" . $record['Hashtag'] . "</td><td class='text-center vcenter'>" . $record['comment'] . "</td><td class='text-center vcenter'>" . $record['created_by'] . "</td><td class='text-center vcenter'>" . Date_time::convert_to_thai_format($record['created_at']) . "</td><td class='text-center vcenter'>" . $record['assigned'] . "</td></tr>";
             }
         }
     }
     $returnhtml .= "</tbody>\n                      </table>\n                      ";
     return $returnhtml;
 }
Exemplo n.º 2
0
@extends('Member.master')
@section('content')
<?php 
use App\Http\Controllers\Assignment\AssignManage;
use App\Http\Controllers\MainControllers\Date_time;
$id = Route::Input('assign_id');
$status = Route::Input('status');
$root_url = dirname($_SERVER['PHP_SELF']);
$event_data = AssignManage::getdata_response($id);
$textstatus = AssignManage::getstatus_response($status);
if (isset($event_data)) {
    $eventname = $event_data["event_name"];
    $eventday = Date_time::convert_to_thai_format($event_data["event_date"]);
} else {
    $eventname = "";
    $eventday = "";
}
?>

@if(!isset($event_data))
<script>
var fullpath = window.location.href;
var rootpath = window.location.origin;
var splite_path = fullpath.split('/');
var subdomain = splite_path[3];
var url = rootpath+'/'+subdomain + '/';
window.location = url;
</script>
@endif

<!-- Show login -->
Exemplo n.º 3
0
 public static function getdata($id, $method, $value)
 {
     $call_report = call_reportDB::where('id', '=', $id)->first();
     if (count($call_report) > 0) {
         switch ($value) {
             case "customer_id":
                 $returndata = "[" . $call_report->customer->id . "] " . $call_report->customer->symbol . " - " . $call_report->customer->name;
                 break;
             case "hashtag":
                 $returndata = $call_report->hashtag;
                 break;
             case "comment":
                 $returndata = $call_report->comment;
                 break;
             case "assigned_id":
                 if (isset($call_report->assingto->id)) {
                     $returndata = "[" . $call_report->assingto->id . "] " . $call_report->assingto->nickname . " - " . $call_report->assingto->name . " " . $call_report->assingto->surname;
                 } else {
                     $returndata = "";
                 }
                 break;
             case "created_by":
                 $returndata = "[" . $call_report->createdby->id . "] " . $call_report->createdby->nickname . " - " . $call_report->createdby->name . " " . $call_report->createdby->surname;
                 break;
             case "created_at":
                 $returndata = Date_time::convert_to_thai_format($call_report->created_at);
                 break;
         }
         return $returndata;
     }
 }