помогите пожалуйста.
скачал виджет
http://xdan.ru/Samij-udobnij-DateTimePicker.html то что нужно , установил, настроил но он не правильно выдает выбранную дату. мне нужна хотябы подсказка где искать, в коде mysql, в коде виджета или в php где все выводится.
дам код на всякий свой
Вот так показывает
http://joxi.ru/0xUvU_3JTJALdEcPZPE
вот форма
<h3>Make notes</h3>
<p style="visibility:hidden;" id='countNote'><?php echo $count; ?></p>
<input type="submit" value="Add Note" onclick="addNote();">
<form action="addnote.php" method="post" id="noteForm">
<input type="submit" value="OK">
<input type="text" name="order_id" value="<?php echo $order_id; ?>" style="visibility:hidden;">
<input type="text" name="user_id" value="<?php echo $user_id; ?>" style="visibility:hidden;">
<?
for($i = 1; $i <= $count; $i++){
$array_tasks = mysql_fetch_array($result_tasks);
echo
"<input name='id{$i}' value ='{$array_tasks['id']}' style='visibility:hidden;'>
<br>
<input type='text' name='note{$i}' value ='{$array_tasks['text']}'>
<input size='16' type='text' name='date{$i}' value='{$array_tasks['active_date']}' class='form_datetime'>
<a href='delete_note.php?user_id=$user_id&order_id=$order_id&product_id={$array_tasks['id']}' >Delete</a>";
}
обработчик
<?php
if(isset($_POST['order_id'])){
$order_id = $_POST['order_id'];
$user_id = $_POST['user_id'];
$conn = mysql_connect("localhost", "root","") or die('Could not connect to server: '.mysql_error());
$db = mysql_select_db('adminka');
$x = 1;
while(isset($_POST['note'.$x])){
$item = $_POST['note'.$x];
$note_date = $_POST['date'.$x];
// echo "in while ".$x;
if(isset($_POST['id'.$x])){
// echo "in if update ";
$note_id = $_POST['id'.$x];
$sql = "update tasks set text='$item' , active_date = '$note_date' where id=$note_id";
mysql_query($sql);
// echo mysql_error();
$sql = "select ord.number as NUMBER, usr.login as LOGIN from orders ord, users usr where ord.user_id=usr.id and ord.id= $order_id" ;
$result = mysql_query($sql);
$arr1 = mysql_fetch_array($result);
$order_number = $arr1['NUMBER'];
$user_login = $arr1['LOGIN'];
// log to history
$text = "Admin updated task $item with status to order $order_number of the user $user_login";
$sql = "insert into order_history(order_id, text) values ($order_id,'$text')";
mysql_query($sql);
// end hist
} else{
//echo "in else insert".$item;
$sql = "insert into tasks(order_id, text, active_date) values ($order_id,'$item' ,'$note_date')";
mysql_query($sql);
// echo mysql_error();
$sql = "select ord.number as NUMBER, usr.login as LOGIN from orders ord, users usr where ord.user_id=usr.id and ord.id= $order_id" ;
$result = mysql_query($sql);
$arr1 = mysql_fetch_array($result);
$order_number = $arr1['NUMBER'];
$user_login = $arr1['LOGIN'];
// log to history
$text = "Admin added new task $item with status to order $order_number of the user $user_login";
$sql = "insert into order_history(order_id, text) values ($order_id,'$text')";
mysql_query($sql);
// end hist
}
$x++;
}
header("Location: user_orders.php?id=$user_id&order_id=$order_id");
}
?>