Pulling date of user's last purchase in drupal - drupal-6

So I'm working on a project where I need to pull specifically the last purchase a user has made in ubercart and output the date plus a year on a specific page. I'm pretty lost as to how to go about this, the project was being handled by a coworker who quit and I don't have a whole bunch of drupal experience.

SELECT MAX(FROM_UNIXTIME(created)) AS last_purchase_date FROM uc_orders WHERE uid = YOUR_USER_ID

Related

How to get last modified date of a website?

I'm working on a crawler project, in my project I need the last modified date of the website to be added as important information. Is there any way to do this?

How do I update a field on one SharePoint 2013 list, based on another list

I recently created a holiday approval form and workflow on SharePoint. It works fine, however our HR department are having to update peoples "remaining days" as I cannot work out how to update this through the workflow.
I have an InfoPath form on SharePoint and use SharePoint designer for my workflow. What it is, is someone would request a holiday through the form. For example, lets say someone asked for 4 days off and they have a balance of 20 days. What we want is for this to update their "remaining days" to 16 whilst on Pending Approval.
If the holiday request is rejected, is it possible to then add the 4 back on... since these wont be used. So now their remaining days will be 20 days again.
If it is approved however, i would like for the "remaining days" to stay at 16.
I hope this makes sense. I have read through a lot of sites trying to find the answer, but SharePoint designer workflow goes beyond my understanding when I add "update list".
Any help is appreciated,
Thanks
Jamie
I imagine that both Balance and the number of requested days are metadada, so in SharePoint Designer Workflows, first of all you should do the calculation using the action "Calculate":
After the calculation, you'll use the action "Update Item", to update the current item, and for the field "Balance" you set the output variable "calc" from the previous action:

Modify SharePoint view of lookup field that can have multiple values

I am trying SharePoint for first time. So please be nice to me. Here is what I am trying to do.
Lets say I have a List where I have values as shown below
Lesson Days
----------------------
Tennis Monday,Wednesday
Swim Saturday
Golf Sunday,Saturday.
Above Days is lookup field that can take multiple values.
How can I modify the view to look as below
Lesson Days
----------------------
Tennis Monday
Wednesday
Swim Saturday
Golf Monday
Sunday
Saturday
Looks like we can code, but I have no idea how to do this.
Also it would be awsome if we have sequence number for multiple values. Something like this
Lesson Days
----------------------
Tennis 1.Monday
2.Wednesday
Swim 1.Saturday
Golf 1.Monday
2.Sunday
3.Saturday
Edit: Based on further search looks like I need to do Client side rendering. I found this link
SharePoint 2013 Client Side Rendering: List Views
I am still struggling to understand this. Need much simple example on how to do this. Will appreciate any hint/help on getting this started.
To start this might help. Using Sample 1, changing the field name and the render function you can easily get the view version without sequence.
If you want a custom order on the days you have to change the EditForm for your days field to change the way the user inserts the days. That will be the hard part since if you do so, you have to either get the values for the lookup field by urself (using the javascript client api or rest calls) or use the default sharepoint lookupfield and customize it (I would not recommend this). To save the custom values back to the days field this example will help (using the registerGetValueCallback function)
You can include your script with a script webpart on the view page/edit page or use the jslink property on the webpart property section miscellaneous to include a javascript file containing the csr code.

SharePoint Office 365 - Starting the ID field at 50,000 which incrementally grows

I would like to premise that I am not a coder, and have limited SharePoint experience. Nonetheless, I have a task at work to create a new tool for a group at work. This tool will allow them to track things through its life-cycle. The old tool will stop being used once they hit the 49,999th record. At that point we will transition to SharePoint. The prior numbers will live with those records and we will be unable to start back at the number 1.
My goal is to have an ID field for each record that incrementally grows starting from the number 50,000.
I tried creating a new calculated formula field that does 50,000 plus the ID but it does not work effectively. There tends to be a lag. The lag can be anywhere from 5 minutes to a day or two. In turn, I need an alternative option.
With a friends coaching, I am messing with SharePoint designer to automatically create a record once one is deleted and delete one every time one is created. However, this times out occasionally. Even more so, it is extremely slow. It will take me a week or so to get to 50,000. Does anyone have any experience or expertise to assist me? It is very appreciated.
The way I did it was to create another field and used that in all my views. Update it through a SharePoint Designer workflow on create - set the field to ID+50000, for example, or whatever you need. Maybe give it a bit of a buffer and set it to ID+51000. By the time the workflow is running the ID has been created and you can use it in a workflow.
If you are going to be moving your old records to the list, you can change the workflow to only update the new field if it's blank. That way you can save the original ids.

Send notification/email 7 days before given date

I have table with employees. It contains some information and also date of birth. Is it possible to send notification/email (directly from excel) let's say 7 days in advance to know that he/she will have birthday soon?
I found some tutorials, but all require Visual Basic. Unfortunately, it is for my sister without any knowledge of programming.
Yes, it is possible to do this via Word's mail merge feature. But since this would require quite a few manual steps (presumably on a daily/weekly basis), I'm afraid it's not what your sister is after. You could code a similar feature in VBA but that would still require her to open the document regularly to run the macro so perhaps it would be quicker and simpler to just check a filtered employee list.
If you want a closer look at mail merge, try this. You could use a helper column to identify which birthdays are close (e.g. using this) and filter on that column, then you show only those whose birthdays are in the next x days.

Resources