Skip to content

Commit

Permalink
mail
Browse files Browse the repository at this point in the history
  • Loading branch information
thaerfayyad committed Mar 24, 2021
1 parent 1ae3353 commit 9690cd4
Show file tree
Hide file tree
Showing 23 changed files with 388 additions and 587 deletions.
25 changes: 3 additions & 22 deletions app/Http/Controllers/Site/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public function index()

$max_x = DB::table('charts')->max('x');
$max_y = DB::table('charts')->max('y');

$name = DB::table('charts')->max('name');

$lables = Chart::select('created_at')->get();
// dd($lables);
$datasss['xaxis'] = '[';
$datasss['yaxis'] = '[';
$labels = '[';
foreach ($chart as $index=>$item){
$aa = "'".$item->created_at->format('M d H:m:s')."'";
$aa = "'".$item->name."'"; //created_at->format('M d H:m:s')
$datasss['xaxis'] .="$item->x,";
$datasss['yaxis'] .="$item->y,";
$labels .="$aa,";
Expand All @@ -54,25 +54,6 @@ public function index()
$datasss['yaxis'] .= ']';
$labels .= ']';

// return $labels;

/////////////////////////////
// $row_data = '[';

// for($i = 1 ; $i < $column_num ; $i++){
// for($j = 2 ; $j < $row_num; $j++){
// // dd ($array[$j][$i]);
// if($row_data == '[' ){
// // return $array[$j][$i];
// $row_data = $row_data .$array[$j][$i];
// }else{
// $row_data = $row_data.",".$array[$j][$i];
// }
// }
// $rows[$i] = $row_data.']';
// $row_data = '[';
// }


$chartFormate = ChartFormat::find(1);
// dd($chartFormate->chart);
Expand Down Expand Up @@ -145,7 +126,7 @@ public function index()
// }]
// }";
//return $data;
$items = Post::all();
$items = Post::all()->take(5);
$books = Book::all()->take(5);

return view('site.index' ,compact('items','books' ,'ChatBlade','lab'));
Expand Down
39 changes: 32 additions & 7 deletions app/Http/Controllers/Site/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
namespace App\Http\Controllers\Site;

use App\Http\Controllers\Controller;
use App\Mail\userMailVerification;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use auth;
use Illuminate\Support\Facades\Mail;

class UserController extends Controller
{
Expand Down Expand Up @@ -35,16 +37,13 @@ public function getLogIn()
}
protected function userLogin(Request $request)
{
// make validations
// dd($request->all());
// return $request;
$request->validate([
'email' => 'required|email',
'password' => 'required',
'email' => 'required',
'password' => 'required|min:6',
]);

$remember_me = $request->has('remember_me') ? true : false;
if (auth()->guard('web')->attempt(['email' => $request->input("email"), 'password' => $request->input("password")], $remember_me)) {
// notify()->success('تم الدخول بنجاح ');
return redirect()->route('index');
}
// notify()->error('خطا في البيانات برجاء المجاولة مجدا ');
Expand All @@ -70,12 +69,38 @@ public function store(Request $request)
$user ->type = $request->input('type');
$user ->password = bcrypt($request->password);
$user ->save();
if (auth()->guard('web')->attempt(['email' => $request->input("email"), 'password' => $request->input("password")])) {
$remember_me = $request->has('remember_me') ? true : false;


if (auth()->guard('web')->attempt(['email' => $request->input("email"), 'password' => $request->input("password")], $remember_me)) {
// notify()->success('تم الدخول بنجاح ');
return redirect()->route('index');
}
// notify()->error('خطا في البيانات برجاء المجاولة مجدا ');
return redirect()->back()->with(['error' => 'incorrect information ']);

}
public function edit($id)
{
$user = User::findOrFail($id);
return view('site.user.profile',compact('user'));
}

public function update(Request $request ,$id)
{
$user = User::findOrFail($id);

if( $request->password != Null) {
$user->password = Hash::make($request->password);
}


$user->name =$request->name;
$user->save();

$mail = Mail::to($user)->send(new userMailVerification());
return redirect()->route('index')
->with('success', 'User updated successfully');
}

public function LogOut()
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/admin/resourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function store(Request $request)
'title' => 'required',
'link' => 'required',
'filed' => 'required',
'icon' => 'required',

]);
$resources = new Resource();
$resources->title =$request ->title;
Expand Down
35 changes: 35 additions & 0 deletions app/Mail/userMailVerification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class userMailVerification extends Mailable
{
use Queueable, SerializesModels;

/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}


/**
* Build the message.
*
* @return $this
*/
public function build()
{

return $this->from('[email protected]')->view('auth.verify'); //'mails.approved'
}
}
2 changes: 1 addition & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;

Expand Down
Binary file added public/site/img/images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/icons/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/icons/images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions resources/views/admin/statistics/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">X</th>
<th scope="col">Y</th>
<th scope="col">Action</th>
Expand All @@ -35,6 +36,7 @@
@foreach ($charts as $index=>$chart)
<tr class="delete_{{ $chart->id }}">
<th scope="row">{{ $index+1 }}</th>
<td>{{ $chart->name }}</td>
<td>{{ $chart->x }}</td>
<td>{{ $chart->y }}</td>
<td>
Expand All @@ -47,6 +49,10 @@
</div>
<div class="col-4" >
<div style="padding: 2% 2% 2% 2%">
<div class="form-group">
<label for="x-axis"> Name Axis</label>
<input type="text" class="form-control" id="name" placeholder="enter-x-axis">
</div>
<div class="form-group">
<label for="x-axis"> X Axis</label>
<input type="text" class="form-control" id="x-axis" placeholder="enter-x-axis">
Expand Down Expand Up @@ -89,6 +95,7 @@
//ajax for insert data
$("#myInsert").click( function(){
var name = $("#name").val();
var x = $("#x-axis").val();
var y = $("#y-axis").val();
Expand All @@ -102,6 +109,9 @@
if(y == '' && x == '' ){
swal("Warning!", "Please insert value of y and x", "warning");
}
if(y == '' && name == '' ){
swal("Warning!", "Please insert value of y and name", "warning");
}
if( x != '' && y != ''){
Expand All @@ -112,12 +122,14 @@
"_token": "{{ csrf_token() }}",
x:x,
y:y,
name:name,
},
success:function(response){
swal("success!", "success", "success");
var tr =
` <tr>
<th scope="row">${response.index}</th>
<td>${response.success.name}</td>
<td>${response.success.x}</td>
<td>${response.success.y}</td>
<td>
Expand Down
123 changes: 123 additions & 0 deletions resources/views/mails/approved.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0;">
<meta name="format-detection" content="telephone=no"/>
<!-- Responsive Mobile-First Email Template by Konstantin Savchenko, 2015.
http://seetahscc.org/ar/ -->
<style>
/* Reset styles */
body { direction: rtl; margin: 0; padding: 0; min-width: 100%; width: 100% !important; height: 100% !important;}
body, table, td, div, p, a { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; border-spacing: 0; }
img { border: 0; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }
#outlook a { padding: 0; }
.ReadMsgBody { width: 100%; } .ExternalClass { width: 100%; }
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Extra floater space for advanced mail clients only */
@media all and (max-width: 600px) {
.floater { width: 320px; }
}
/* Set color for auto links (addresses, dates, etc.) */
a, a:hover {
color: #f1f5f9;
}
.footer a, .footer a:hover {
color: #999999;
}
</style>
<!-- MESSAGE SUBJECT -->
</head>
<!-- BODY -->
<!-- Set message background color (twice) and text color (twice) -->
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0" marginwidth="0" marginheight="0" width="100%" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; height: 100%; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%;
background-color: #FFFFFF;
color: #000000;"
bgcolor="#FFFFFF"
text="#000000">
<!-- SECTION / BACKGROUND -->
<!-- Set section background color -->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%;" class="background">
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;"
bgcolor="#f1f5f9">
<!-- WRAPPER -->
<!-- Set wrapper width (twice) -->
<table border="0" cellpadding="0" cellspacing="0" align="center"
width="600" style="border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;
max-width: 600px;" class="wrapper">
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%;
padding-top: 20px;">
<!-- PREHEADER -->
<!-- LOGO -->
<a target="_blank" style="text-decoration: none;"
href="http://seetahscc.org/ar/"><img border="0" vspace="0" hspace="0"
src="https://www.seetahscc.org/uploads/website/img/1568629530-logo.png"
width="150"
alt="Logo" title="Logo" style="
color: #000000;
font-size: 10px; margin: 0; padding: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none; display: block;" /></a>
</td>
</tr>
<!-- HEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td align="center" valign="top" style="direction:rtl; border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 24px; font-weight: bold; line-height: 130%;
padding-top: 20px;
color: #121c4e;
font-family: sans-serif;" class="header">
<hr>
عضو جديد
</td>
</tr>
<!-- SUBHEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td align="center" valign="top" style="direction:rtl; border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-bottom: 3px; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 18px; font-weight: 300; line-height: 150%;
padding-top: 5px;
color: #13a89e;
font-family: sans-serif;" class="subheader">
الاسم:
<strong style="color:#a97d51">(hhh)</strong>.
</td>
</tr>
<!-- BUTTON -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%;
padding-top: 25px;
padding-bottom: 35px;" class="button">
<a
href="http://seetahscc.org/ar/" target="_blank" style="text-decoration: underline;">
<table border="0" cellpadding="0" cellspacing="0" align="center" style="max-width: 240px; min-width: 120px; border-collapse: collapse; border-spacing: 0; padding: 0;">
<tr>
<td align="center" valign="middle" style="padding: 12px 24px; margin: 0; text-decoration: underline; border-collapse: collapse; border-spacing: 0; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px;"
bgcolor="#0B5073">
<a target="_blank" style="text-decoration: underline;
color: #FFFFFF; font-family: sans-serif; font-size: 17px; font-weight: 400; line-height: 120%;"
href="http://seetahscc.org/ar/">
تابع من هنا
</a>
</td></tr></table></a>
</td>
</tr>
<tr>
<td align="right" valign="top" style="direction:rtl; border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-bottom: 3px; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 18px; font-weight: 300; line-height: 150%;
padding-top: 5px;
color: #13a89e;
font-family: sans-serif;" class="subheader">
<hr>
شكراًً,
<br/>
{{ config('app.name') }}
</td>
</tr>
<!-- End of WRAPPER -->
</table>
<!-- SECTION / BACKGROUND -->
<!-- Set section background color -->
</td>
</tr>
</table>
</body>
</html>
Loading

0 comments on commit 9690cd4

Please sign in to comment.