使用JQuery在模态弹出窗口上显示Php blob图像

时间:2016-11-12 03:41:33

标签: javascript php jquery laravel

我一直试图打电话给模态弹出

CREATE FUNCTION [dbo].[funcGetAllStaffCollectiveAttendanceByMonth]
(
@Month nvarchar(9)
)
RETURNS TABLE
AS
RETURN
(
Declare @StartDate DATE,
@EndDate DATE

;WITH CteMonths(n, m) AS(
    SELECT 1, 'January' UNION ALL
    SELECT 2, 'February' UNION ALL
    SELECT 3, 'March' UNION ALL
    SELECT 4, 'April' UNION ALL
    SELECT 5, 'May' UNION ALL
    SELECT 6, 'June' UNION ALL
    SELECT 7, 'July' UNION ALL
    SELECT 8, 'August' UNION ALL
    SELECT 9, 'September' UNION ALL
    SELECT 10, 'October' UNION ALL
    SELECT 11, 'November' UNION ALL
    SELECT 12, 'December'
  )
SELECT @StartDate = DATEADD(MONTH, n - 1, DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0)), 
@EndDate = DATEADD(DAY, -1, DATEADD(MONTH, n, DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0)))
FROM CteMonths
WHERE m = @month

SELECT
    StaffAttendance.StaffId,
    DATENAME(MONTH, @StartDate) AS [ForMonth], @StartDate AS StartDate, @EndDate AS EndDate,
    (DATEDIFF(dd, @StartDate, @EndDate) + 1)-(DATEDIFF(wk, @StartDate, @EndDate) * 1)-(CASE WHEN DATENAME(dw, @StartDate) = 'Sunday' THEN 1 ELSE 0 END) AS TotalWorkingDays,
    SUM(StaffAttendance.AttendanceStatusId) AS TotalDaysWorked
    FROM StaffAttendance 
    WHERE [Date] BETWEEN @StartDate AND @EndDate AND StaffAttendance.AttendanceStatusId = 1 GROUP BY StaffAttendance.StaffId
END
)

现在在我的HTML中

<div class="image content">
    <div class="ui medium image">
      <img style="max-width:400px;" src="" id="imgretprd">
      <br/>
      <div class="ui tiny images" style="width:500px;" align="left">
        </div>
</div>
</div>

我想在点击功能上方弹出上面的模态中调用此处检索到的图像。

我尝试使用此代码

<img id="imgretprdlist{{$product->productId}}" src="data:image/png;base64,{{base64_encode($image_prod->Blob1)}}"/>

但那不起作用。它只显示我的空白。我哪里错了?

任何答案都将不胜感激。

0 个答案:

没有答案