Jump to content

fastsol

Moderators
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by fastsol

  1. My local setup is WAMP and I don't know of anything specific that I changed on that setup to allow more than 32M of memory. My local setting is 128M in the ini file.
  2. Any ideas as to where on a system running WHM that I could find such a setting? I already called my host and the only thing they looked at was the ini setting.
  3. Yes I know. This is the blade file code: @extends('layouts.admin') @section('content') @include('layouts.partials.form-errors') <div class="row"> <div class="col-lg-2"> <a href="{{ route('admin.quotes.appointments.phone.create') }}" class="mr-4">Add Install Time</a> </div> <div class="col-lg-2"> <a href="{{ route('admin.quotes.appointments.off') }}" class="mr-4">Take Days Off</a> </div> <div class="col-lg-5"> <form action="{{ route('admin.quotes.appointments.index') }}" method="get" class="form-inline mb-2"> <input type="text" name="date" class="form-control datepicker mb-2" placeholder="Search Date" value="{{ request('date') }}"> <button class="btn btn-primary mt-0 ml-2 mb-2">Search</button> </form> </div> </div> @if($search) {!! alert('warning', 'Currently in Search Mode') !!} @endif @if($appointments->count()) <div id="backtotop">Back To Top</div> <form action="{{ route('admin.quotes.appointments.purchased') }}" method="post" id="mark-as-done"> @include('helpers.previous_page_input_full_url') @csrf <button class="btn btn-primary float-right mb-2">Mark Checked Installs As Done</button> @adminTable(['headings' => ['Date', 'Name', 'Vehicle', 'Product / Notes', 'Actions']]) @foreach($appointments->chunk(5) as $chunks) @foreach($chunks as $appointment) <tr> <td> @php $color = $appointment->install_time->lessThan(\Carbon\Carbon::tomorrow()) ? 'text-danger' : ($appointment->install_time->lessThan(\Carbon\Carbon::tomorrow()->addDay()) ? 'text-primary' : '') @endphp <span class="{{ $color }}">{{ $appointment->install_time->format(config('sitespec.scheduler.install_time_display_format')) }}</span> </td> <td> @if($appointment->deposit) <div class="customer-name"> <a href="{{ searchByUrl($appointment->deposit->quote->customer->name) }}" data-toggle="tooltip" data-placement="bottom" title="{{ $appointment->deposit->quote->customer->phone }}"> {{ $appointment->deposit->quote->customer->name }} @if($appointment->deposit->quote->customer->gift_name) &nbsp;{!! GIFT_ICON !!} @endif </a> <div class="customer-details"> {{ $appointment->deposit->quote->customer->phone }} @if($appointment->deposit->quote->customer->gift_name) <br><br> {{ $appointment->deposit->quote->customer->gift_name }} {!! $appointment->deposit->quote->customer->gift_phone ? '<br>'.$appointment->deposit->quote->customer->gift_phone : '' !!} {!! $appointment->deposit->quote->customer->gift_date ? '<br>'.$appointment->deposit->quote->customer->gift_date->format('m-d-Y') : '' !!} @endif </div> </div> @elseif(optional($appointment->phoneAppointment)->customer) <a href="{{ searchByUrl($appointment->phoneAppointment->customer) }}"> {{ $appointment->phoneAppointment->customer }} </a> @endif </td> <td class="text-center"> @if($appointment->deposit) {{ $appointment->deposit->quote->customer->strippedVehicle }} @if($appointment->deposit->quote->customer->vyear->wires->count()) <a href="{{ route('admin.wires.show', $appointment->deposit->quote->customer->vyear) }}">{!! INFO_ICON !!}</a> @else {!! RED_X !!} @endif @elseif(optional($appointment->phoneAppointment)->vehicle) {{ $appointment->phoneAppointment->vehicle }} @endif </td> <td class="text-center"> @if($appointment->deposit) {{ $appointment->deposit->quote->changedProduct->count() ? $appointment->deposit->quote->changedProduct->first()->name : $appointment->deposit->product->name }} @elseif(optional($appointment->phoneAppointment)->product) {{ $appointment->phoneAppointment->product->name }} @endif {{ $appointment->notes ? ' - '.$appointment->notes : '' }} </td> @php $bg = ($appointment->deposit && !$appointment->deposit->quote->purchased && now() > $appointment->install_time->addHour(2)) ? 'bg-warning' : ''; @endphp <td class="text-center text-md {{ $bg }}"> <a href="{{ $appointment->deposit ? route('admin.quotes.appointments.app.edit', $appointment->deposit) : route('admin.quotes.appointments.phone.edit', $appointment) }}" class="mr-2"> {!! EDIT_ICON !!} </a> @if($appointment->deposit && $appointment->deposit->quote->purchased) {!! CHECK_MARK !!} @else <a href="javascript:void(0)" class="delete_record mr-2" data-url="{{ route('admin.quotes.appointments.destroy', $appointment) }}" data-toggle="modal" data-target="#destroy_confirmation">{!! GARBAGE_ICON !!}</a> @if($appointment->deposit) <div class="custom-control custom-checkbox custom-control-inline"> <input type="checkbox" class="custom-control-input" id="purchased{{ $appointment->id }}" name="purchased[]" value="{{ $appointment->deposit->id }}"> <label class="custom-control-label" for="purchased{{ $appointment->id }}"></label> </div> @endif @endif </td> </tr> @endforeach @endforeach @endadminTable </form> @include('partials.modals.destroy_confirmation') @else {!! alert('warning', 'No Appointments scheduled at this time.') !!} @endif @endsection @section('scripts') <script> $(function () { $('[data-toggle="tooltip"]').tooltip() }); </script> @endsection And this is the query: $appointments = Appointment::with( 'deposit.quote.customer.vmake', 'deposit.quote.customer.vmodel', 'deposit.quote.customer.vyear.wires', 'phoneAppointment.product', 'deposit.product', 'deposit.quote.changedProduct' ) ->where(function($query) use($validator) { return $this->appointmentWhere($query, $validator); }) ->whereNull('cancelled') ->orderBy('install_time') ->get(); As you can see I'm loading a fair number of relationships. The query is in the Controller. The problem comes when it tries to render the blade file. It will get so far in rendering and then error out of memory. I'm using the chunk method but even setting the chunk to 5 or less doesn't solve the problem. I imagine the problem is arrising from trying to access the deep relationship data on so many lines multiple times. I've also tried something like this but it too didn't help. @php $customer = $appointment->deposit->quote->customer; @endphp <div class="customer-name"> <a href="{{ searchByUrl($customer->name) }}" data-toggle="tooltip" data-placement="bottom" title="{{ $customer->phone }}"> {{ $customer->name }} @if($customer->gift_name) &nbsp;{!! GIFT_ICON !!} @endif </a> <div class="customer-details"> {{ $customer->phone }} @if($customer->gift_name) <br><br> {{ $customer->gift_name }} {!! $customer->gift_phone ? '<br>'.$customer->gift_phone : '' !!} {!! $customer->gift_date ? '<br>'.$customer->gift_date->format('m-d-Y') : '' !!} @endif </div> </div> That was to reduce the number of relationship dives to get at the data.
  4. So I have a page that is loading a good amount of models and then looping those in the blade file. The issue I am trying to fix is on my hosting server I keep getting this error Symfony\Component\Debug\Exception\FatalErrorExceptionGET /admin/quotes/appointments Allowed memory size of 33554432 bytes exhausted (tried to allocate 53248 bytes This only happens on my hosting server which is a dedicated server with 8GB of meomry and the php.ini file is set to 500M already. BUT on my local laptop where I only have 128M set in the ini file and run the exact same data on the page it loads just fine. Why is the memory having an issue on my hosting server but not local that is set at a lower limit? I've already tried running the loop with the chunk method but it hasn't helped. I'm not having an N+1 issue either cause debugbar shows the same number of queries ran no matter how big the data set I pull from the db. This is a critical page in my site and it's busy season right now, so this is a very bad thing to have happen. Luckily it only affects one page in the admin area so my customers aren't affected by it.
  5. round was the one thing I didn't try, Thank you! This gives the correct result. $price = '278.53'; $cents = $price * 100; $end_result = (int)round($cents); // Gives me 27853 as expected. also works for 278.59 I knew the issue was a precision thing, I just couldn't find the right combination of functions to make it work. In the end it was so simple (as I figured it would be).
  6. So I am trying to take a string value of dollars (posted from a form) and times it by 100 to get the cents Integer value of the dollars. For some reason if I do this with something like 278.53 I end up with 27852. Same concept for 278.59 ends up as 27858. I don't understand why or how to make it work. I've tried many things and nothing has made it work. $price = '278.53'; // posted from the form $cents = $price * 100; // converting to cents. end_result = (int)$cents // This will end up being 27852 not 27853.
  7. Cool, got it now. Had to do it on the domain specific ini.
  8. I forgot to restart Apache. Check it now.
  9. I changed the php.ini for the entire server, so hopefully that has fixed it. Let me know either way and I can edit the domain specific ini if needed.
  10. I have fixed the clickhjacking issue (I believe) based on recommendations from online sources. The php version I will look into and verify the implications of updating before proceeding there. Any other suggestions on my original post?
  11. So I currently have my business website that I have spent the last 7 years building and tweaking the heck out of to do exactly what I want. The site itself works perfectly for me, but I have recently decided to offer a version of the site to other fellow business owners within my industry through a subscription fee. The desire from other owners to use the site has been great, so I need to figure out how to do a few things. As like most sites are built, mine was not intended to be used by more than one location of business. I plan to use a slightly more generic domain name for the subscription version so that I can hopefully group everyone on to the one domain and use variables/cookies/sessions to determine what content to show based on the location the customer chooses. Honestly I have come up with a couple ways to achieve that goal but I don't think any of those ways will allow for SEO for each location subscribed. Here is where I feel that my concept differs from most sites that have multiple locations on one domain. I sell remote car starters and so would my subscribers. But the subscribers are all independent business owners themselves across the nation that all do business their own way and have different pricing for their area. So the main "content" of the sites pages (products page, faq page, contact page) would all be the same across the subscribers but the specific pricing for products and specific contact info would be different per business (all driven by databases). I figured I would make a landing page for first time visitors that don't have a cookie or session stored, where they would choose a location closest to them to browse products from. That part is simple. The list would come from a database, no big deal. The hard part is figuring out how to proceed from that point and redirecting them with some sort of $_GET or session/cookie to keep on their browser but also in a way that google bots can follow and index the business specific info. Google bots don't carry session or cookies through their crawl, so it would leave me with GET vars only it seems. Well if I did that, I would have to change a crap ton of code and every link to also have that GET. This next part I know many of you will say is a bad schema but again without literally changing hundreds of queries through out the site I see no other way. I would replicate the database for each business so they each can control their own stuff. Now I would only replicate the necessary parts of the database and create other tables as needed. For example the products db I wouldn't replicate that cause I don't need all the data of each product, but rather a new table that links them and allows certain aspects to be changed for the business at hand, like pricing. One key point I should mention is that the main database would be the one running my site, all the other databases would be on the same server, so I can connect to them all very easily across domains. The idea I had with this is that based on the business selected on the landing page, I would set a db var that connects to the db for that business along with having a preset connection to my main site. So I would basically have 2 db connections through out the site that pull certain info from each db. Business specific from the one db and common info from the main db. At this time I don't feel this is a bad idea as I already do it for another site I made for my industry and it works great and functions without a single issue. A big reason I felt replicating the db was "decent" idea is the only other way I know how to achieve this is to replicate the entire file system for each business and use subdomains or sufolders in the url. Well them I'm really screwed if I have to update a file cause I'd have to update across possibly 100 subfolders. If I had to update across 100 databases it's not as bad or time consuming. So in the end, how do I go about making this in a way that SEO is just as good as if it was a single location site, but not do it in a way that I have to recode half the files or all the queries that run it? I'm looking for some good, knowledgeable info here. Hopefully I have described enough that you can see the challenges I am facing. Maybe I'm overthinking this whole thing or maybe I am way off base on how to go about it. Here is my site http://remotelystartedmn.com The domain I would use for subscribers is remotelystarted.com (no mn on the end).
  12. Take hints from what Psycho said above. I also thought you may need to be able to check the value on the fly as people switch between options. $("#ap").change(function(){ if($('#ap option:selected').text() == "Default option") { alert('Please choose a valid option'); } });
  13. Something like this, untested. Best thing to do is asign a valid id to the select box so you can target it much easier. In my example I simply called it "ap". $("#ap").prepend("<option value='' selected='selected'>Default option</option>"); if($('#ap option:selected').text() == "Default option") { alert('Please choose a valid option'); }
  14. This is also known as Chained Select Boxes. Have you googled it at all? There are tons of tutorials on the subject. The jquery is pretty straight forward for basic usage.
  15. Great! When it comes to upload security, there is a crap ton of bad tutorials and bad advice on the web. There are a number of ways to check an image when uploading, but other files types are a lot more tricky generally. There might be some mp3 specific classes someone has built that may help in ensuring the file is a mp3 and doesn't contain other malicious stuff. Honestly I know nothing about mp3 files other than they are music, so I have no idea if malicious code can even be embedded within the file itself like it can in an image file. In the end, don't rely on one tutorial. You need to research many many of them and take the best notes from them to understand how to protect your site based on what you are doing.
  16. post your current code.
  17. Ok well that still indicates the file move is failing. Did you do the code change I posted above?
  18. Just remove the max file size input in the html form, it's not needed anyway once you get a proper php security code built. Are you interested in learning php security for this project or are you simply trying to get a working upload function on your website? If you just need it wot work, you can pm me and I can give you a good upload class I built that makes it super easy to upload things with proper security.
  19. The issue is in the move_uploaded_file is failing, but only because of the / at the beginning of your $uploadfile. Should be this instead. $uploaddir = 'uploads/music'; // Notice the removal of the / in front of uploads/music $uploadfile = $uploaddir.'/' . basename($_FILES['fileToUpload']['name']); Also, I hope this is just testing code and not actually going to be used on a live website. There is absolutely zero security in this code, so anyone could literally upload an malicious file they wanted.
  20. FTP is not needed for what you are trying to do, that's a completely different thing. Please post your current code so we can see where the issue may be.
  21. In this block else{ // No error found! Move uploaded files if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$name)) $count++; // Number of successfully uploaded file } Add {} to your if(), then make an array to store all the $path.$name that are moved. Then below use a foreach to build an actual full path link to each file and insert it into the email where you want. $moved_files = array(); else{ // No error found! Move uploaded files if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$name)) { $count++; // Number of successfully uploaded file $moved_files[] = $path.$name; } } $full_paths = ''; $domain_path = 'http://domain.com/'; foreach($moved_files as $m) { $full_paths .= $domain_path.$m."\n\n"; } $message = "Please find below links to file transfer from : " . $from . "(" . $from_email . ") \n\n The following message was included with the files : " . $comment . "\n\n Links here : " . $full_paths . "\n\n Regards Adlantic Team "; That should get you started.
  22. I use EZ Texting on my site to send out messages in an automated fashion but I don't have anything setup for incoming messages so I can't comment on the ability to do that with these guys. Pricing for what I do is very reasonable.
  23. Yeah if the image file size was large from way back then, it probably makes sense to do it the way you are. Otherwise in todays time it would be best to just photoshop the image and save it for web to keep the file size down and then there are also compression things that can be done, all without making 2 of the same images.
  24. Why even bother serving 2 different images based on device. Unless the original image is just way to high a file size. The better way is to simply allow the image to scale down automatically via css. Then the image will just shrink when it's container is smaller than the image. Unless I am unclear as to why you are wanting to change the images in the first place. Something like this img { height: auto; max-width: 100%; }
  25. You need to get rid of the css height on this div <div class="su-column-inner su-clearfix"> And then put each of the <a> tags in the div into their own div. When you remove the height of the div I said, the Events image doesn't line up right cause you are placing it relative to the parent div rather than the <a> like you think you are.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.