Reputation: 65
I am using Laravel 8 with Livewire version 2. but when I create wire:model="name"
i cannot received $name
variable value in my component
blade.php
<div>
<input type="text" wire:model="name">
Hi! My name is {{ $name }}
</div>
comment.php
class Comment extends Component
{
public $name;
public function render()
{
return view('livewire.comment');
}
}
Upvotes: 2
Views: 2687
Reputation: 65
import os
import datetime
import win32com.client
# Define the folder where attachments will be saved
attachment_folder = 'path/to/your/attachment/folder'
# Ensure the attachment folder exists
if not os.path.exists(attachment_folder):
os.makedirs(attachment_folder)
# Get today's date
today = datetime.datetime.now().date()
# Initialize Outlook application
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
# Access the 'one to one' folder in the inbox
inbox = outlook.GetDefaultFolder(6) # 6 refers to the inbox
one_to_one_folder = None
for folder in inbox.Folders:
if folder.Name == 'one to one':
one_to_one_folder = folder
break
if not one_to_one_folder:
print("The 'one to one' folder was not found in the inbox.")
exit()
# Loop through the emails in the folder
for message in one_to_one_folder.Items:
if message.Subject.startswith("Experience portal report system") and message.ReceivedTime.date() == today:
attachments = message.Attachments
for attachment in attachments:
attachment.SaveAsFile(os.path.join(attachment_folder, attachment.FileName))
print(f"Attachments from email '{message.Subject}' saved to '{attachment_folder}'.")
print("Script completed.")
Upvotes: 0
Reputation: 65
import os
import glob
import pandas as pd
# Get the current directory
current_directory = os.path.dirname(os.path.abspath(__file__))
# List to hold the summary data
summary_data = []
# Read all CSV files in the current directory
csv_files = glob.glob(os.path.join(current_directory, '*.csv'))
for csv_file in csv_files:
# Read the CSV file
df = pd.read_csv(csv_file)
# Extract the peak call number
peak_call_number = df.iloc[0]['Number']
# Get the server name from the file name
server_name = os.path.basename(csv_file).replace('.csv', '')
# Append the data to the summary list
summary_data.append({
'Server': server_name,
'Peak Calls': peak_call_number
})
# Create a summary DataFrame
summary_df = pd.DataFrame(summary_data)
# Generate HTML table
html_table = summary_df.to_html(index=False)
# Define the HTML structure with the table embedded
html_content = f"""
<!DOCTYPE html>
<html>
<head>
<title>Server Peak Call Numbers</title>
<style>
table {{
width: 50%;
border-collapse: collapse;
margin: 25px 0;
font-size: 18px;
text-align: left;
}}
th, td {{
padding: 12px;
border-bottom: 1px solid #ddd;
}}
th {{
background-color: #f2f2f2;
}}
</style>
</head>
<body>
<h2>Server Peak Call Numbers</h2>
{html_table}
</body>
</html>
"""
# Save the HTML content to a file
html_file_path = os.path.join(current_directory, 'server_peak_call_numbers.html')
with open(html_file_path, 'w') as file:
file.write(html_content)
print(f"HTML file created: {html_file_path}")
Upvotes: 0
Reputation: 65
resolved, I was using 2 divs. forgot that it should use only 1 root Element
Upvotes: 4