Joomla datepicker storing todays date why is it so? - joomla

When I select the date from calendar Joomla datepicker JHTML::Calendar(), it is storing the current (today's) date to the database. What could be the problem? I want to store the value users select from datapicker otherwise default today's date...
Here is my code so far:
<td>
<?php echo JHTML::calendar(date("d-m-y"),'revdate', 'date', '%Y-%m-%d',array('size'=>'8','maxlength'=>'10','class'=>' validate[\'required\']',)); ?>
</td>

Related

Load automatically the rows in TabularForm Yii2

Iam trying to make this:
I need that when I create a new poll, it loads the aspects and a dropdown with the valorations choices list from the database like this:
I have a table for aspects, and another for valorations, which is a number from 1 to 5.
Normally, when I create a new poll i have to add manually all the rows and select the aspect and the valoration, but in this way its too much job, so i want it to load all the aspects and it would just need to set the valoration for each row and save it. thanks and sorry for my english
As far as I can understand your query, you want something like this:
You have a database table: Aspects (which I expect has static data)
You have a database table: valorat.(which I expect has static data of 1-5)
Now, whenever you create a new poll, it should automatically populate itself with the aspects and valoration dropdown table.
If I am right, you can try the following logic,
You can run the following logic
//run a loop for each aspect row fetched from database
<?php foreach($aspects as $value): ?>
<tr>
<td>
//here goes the id
</td>
<td>
<?= $value ?> //here goes your aspect value
</td>
<td>
<select>
//here run a loop for valorations you fetched from database
<?php foreach($valoration as $key=>$value): ?>
<option value="<?=$key?>"><?= $value ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
In this way, you can achieve the desired table with the aspects and valoration.
If you are using the Yii2 grid view, it is far more simple than this. But without looking at your code and database tables, I can't give you more.
Thank You!! I hope you will get some idea how to do this.

how to change the color of row or column in backpack dashboard?

This is my client admin panel
What i want to do know when the expire month comes that column will become red automatically otherwise it stay green.
in your view
#php
$currentdate=strtotime(date('Y/m/d'));
$exp_date=strtotime($expiry_date);
if($currentdate > $exp_date)
{ //not expired
$color="#539E05";
}
else
{
//expired
$color="#EA2C12";
}
#endphp
<td style="color: {{$color}}">{{$expiry_date}}</td>
i don't know your html structure looks like so i assumed that expiry date exist in span tag

Magento: Inventory increment qty attribute per store

I have one simple question.
My problem is:
Is there are any free extensions that could turn "Enable Qty Increments" and "Qty Increments" from global scope to store view?
Also I have found this question inventory settings
It's have some kind of answer, but I need to confirm this.
If there are no free extension that could fulfill my needs, do I need to write my own extension (as answer in previous link says) or there is an easy way to change scope from global to store view. ?
My Magento version is CE 1.9.1.0
What you could do to achieve the same thing is create a new product text attribute called pack_size, give it a per store view scope, then set the order quantity against it per product, per store view.
Then, in your addtocart.phtml file, here;
app/design/frontend/XXX/YYY/template/catalog/product/view/addtocart.phtml
Where XXX YYY is the name of your theme, and replace the quantity input box with;
<?php $pack = $_product->getData('pack_size'); ?>
<?php if(($pack == 1) || (!$pack)) { ?>
<input type="text" name="qty" id="qty" maxlength="4" value="1" />
<?php } else { ?>
<select name="qty" id="qty" maxlength="12">
<?php
$countme = 1;
while ($countme < 101) {
echo '<option value="'.($pack*$countme).'">'.($pack*$countme).'</option>';
$countme++; } ?>
</select>
Now if the value of pack_offer is set and greater than 1, the user will only be able to choose a multiple of that qty.
Depending on your theme, you may also need to implement this in the cart page.

Add class to timezone select box in CodeIgniter

By doing <?php $this->load->helper('date'); echo timezone_menu('UM8'); ?> I can get a bunch
of helpful timezone options in a select box from CI which generated as:
<select name="timezones">
<option value="UM12">(UTC -12:00) Baker/Howland Island</option>
<option value="UM11">(UTC -11:00) Samoa Time Zone, Niue</option>
...
</select>
However, I want to add a class (for example, <select name="timezones" class="form-control">) to that select box to inherit style from Bootstrap3. Anyone knows how to do this?
The second parameter sets the class(es) for the select element.
timezone_menu('UM8', 'form-control');
This is covered in the CI Date Helper documentation

Kendo DateTimePicker Manual Entry

I'd like to be able to manually enter a date into the dateTime picker and have it persist to the control.
Example Code: http://jsfiddle.net/awDA4/39/
<script src="http://cdn.kendostatic.com/2013.1.514/js/kendo.all.min.js"></script>
<div>
<input id="datepicker" style="width:200px" />
</div>
$(document).ready(function() {
$("#datepicker").kendoDateTimePicker();
});
Say you enter a date by hand into the control like '08/08/2013'
If you then post the form the start of time (01/01/0001) date is sent
If you pick a time from the time drop down it reverts to the current date
Any ideas what I might be doing wrong?
I thought about marking the input as readonly/disabled but surely you should be able to allow users to type a date by hand.
I needed to include additional parseFormats when initializing the DateTimePicker
$(document).ready(function() {
$("#datepicker").kendoDateTimePicker({
parseFormats: ["MMMM yyyy", "HH:mm", "MM/dd/yyyy"] //format also will be added to parseFormats
});
MM/dd/yyyy was added and I can now manually key in dates with that format

Resources