$qry="1";
  // search filters
  if (IsSet($this->user_id)) {
   $user_id=$this->user_id;
   $qry.=" AND USER_ID='".$this->user_id."'";
  } else {
   global $user_id;
  }

  global $added_to;
  if ($added_to) {
   $qry.=" AND TO_DAYS(ADDED)<=TO_DAYS('".toDBDate($added_to)."')";
  }
  global $added_from;
  if ($added_from) {
   $qry.=" AND TO_DAYS(ADDED)>=TO_DAYS('".toDBDate($added_from)."')";
  }




  // QUERY READY
  global $save_qry;
  if ($save_qry) {
   $qry=$session->data['userlog_qry'];
  } else {
   $session->data['userlog_qry']=$qry;
  }
  if (!$qry) $qry="1";
  // FIELDS ORDER
  global $sortby;
 $rec['TITLE'] = $title;
 if ($rec['TITLE'] == '') {
     $out['ERR_TITLE'] = 1;
     $ok = 0;
 }
 //updating 'NOTES' (text)
 global $notes;
 $rec['NOTES'] = $notes;
 //updating 'DUE' (date)
 global $due;
 $rec['DUE'] = toDBDate($due);
 //updating 'ADDED' (datetime)
 global $added_date;
 global $added_minutes;
 global $added_hours;
 $rec['ADDED'] = toDBDate($added_date) . " {$added_hours}:{$added_minutes}:00";
 //updating 'IS_TASK' (int)
 global $is_task;
 $rec['IS_TASK'] = (int) $is_task;
 //updating 'IS_NODATE' (int)
 global $is_nodate;
 $rec['IS_NODATE'] = (int) $is_nodate;
 //updating 'IS_REPEATING' (int)
 global $is_repeating;
 $rec['IS_REPEATING'] = (int) $is_repeating;
 //updating 'REPEAT_TYPE' (select)
 global $repeat_type;
 $rec['REPEAT_TYPE'] = $repeat_type;
 //updating 'WEEK_DAYS' (varchar)
 global $week_days;
 $rec['WEEK_DAYS'] = $week_days;
Beispiel #3
0
 global $title;
 $rec['TITLE'] = $title;
 if ($rec['TITLE'] == '') {
     $out['ERR_TITLE'] = 1;
     $ok = 0;
 }
 //updating 'Category' (select)
 if (isset($this->category_id)) {
     $rec['CATEGORY_ID'] = $this->category_id;
 } else {
     global $category_id;
     $rec['CATEGORY_ID'] = $category_id;
 }
 //updating 'EXPIRE_DATE' (date)
 global $expire_date;
 $rec['EXPIRE_DATE'] = toDBDate($expire_date);
 //updating 'EXPIRE_DEFAULT' (int)
 global $expire_default;
 $rec['EXPIRE_DEFAULT'] = (int) $expire_default;
 //updating 'UPDATED' (datetime)
 /*
 global $updated_date;
 global $updated_minutes;
 global $updated_hours;
 $rec['UPDATED']=toDBDate($updated_date)." $updated_hours:$updated_minutes:00";
 */
 //updating 'QTY' (int)
 global $qty;
 $rec['QTY'] = (int) $qty;
 //updating 'MIN_QTY' (int)
 global $min_qty;
  $rec['TITLE']=$title;
  if ($rec['TITLE']=='') {
   $out['ERR_TITLE']=1;
   $ok=0;
  }
 //updating 'NOTES' (text)
  global $notes;
  $rec['NOTES']=$notes;
 //updating 'DUE' (date)
  global $due;
  $rec['DUE']=toDBDate($due);
 //updating 'ADDED' (datetime)
  global $added_date;
  global $added_minutes;
  global $added_hours;
  $rec['ADDED']=toDBDate($added_date)." $added_hours:$added_minutes:00";
 //updating 'IS_TASK' (int)
  global $is_task;
  $rec['IS_TASK']=(int)$is_task;
 //updating 'IS_NODATE' (int)
  global $is_nodate;
  $rec['IS_NODATE']=(int)$is_nodate;
 //updating 'IS_REPEATING' (int)
  global $is_repeating;
  $rec['IS_REPEATING']=(int)$is_repeating;
 //updating 'REPEAT_TYPE' (select)
  global $repeat_type;
  $rec['REPEAT_TYPE']=$repeat_type;
 //updating 'WEEK_DAYS' (varchar)
  global $week_days;
  $rec['WEEK_DAYS']=$week_days;
    global $system_name;
    $rec['SYSTEM_NAME'] = $system_name;
    //updating 'CODE_TYPE' (int)
    global $code_type;
    $rec['CODE_TYPE'] = (int) $code_type;
    //updating 'CODE' (text)
    global $code;
    $rec['CODE'] = $code;
    //updating 'XML' (varchar)
    global $xml;
    $rec['XML'] = $xml;
    //updating 'UPDATED' (datetime)
    global $updated_date;
    global $updated_minutes;
    global $updated_hours;
    $rec['UPDATED'] = toDBDate($updated_date) . " {$updated_hours}:{$updated_minutes}:00";
    //UPDATING RECORD
    if ($ok) {
        if ($rec['ID']) {
            SQLUpdate($table_name, $rec);
            // update
        } else {
            $new_rec = 1;
            $rec['ID'] = SQLInsert($table_name, $rec);
            // adding new record
        }
        $out['OK'] = 1;
    } else {
        $out['ERR'] = 1;
    }
}
   $rec['SCRIPT_ID']=$this->script_id;
  } else {
  global $script_id;
  $rec['SCRIPT_ID']=$script_id;
  }
 //updating 'CODE' (text)
  global $code;
  $rec['CODE']=$code;
 //updating 'LOG' (text)
  global $log;
  $rec['LOG']=$log;
 //updating 'EXECUTED' (datetime)
  global $executed_date;
  global $executed_minutes;
  global $executed_hours;
  $rec['EXECUTED']=toDBDate($executed_date)." $executed_hours:$executed_minutes:00";
 //UPDATING RECORD
  if ($ok) {
   if ($rec['ID']) {
    SQLUpdate($table_name, $rec); // update
   } else {
    $new_rec=1;
    $rec['ID']=SQLInsert($table_name, $rec); // adding new record
   }
   $out['OK']=1;
  } else {
   $out['ERR']=1;
  }
 }
 //options for 'LOCATION_ID' (select)
 $tmp=SQLSelect("SELECT ID, TITLE FROM gpslocations ORDER BY TITLE");
        $rec['SCRIPT_ID'] = $this->script_id;
    } else {
        global $script_id;
        $rec['SCRIPT_ID'] = $script_id;
    }
    //updating 'CODE' (text)
    global $code;
    $rec['CODE'] = $code;
    //updating 'LOG' (text)
    global $log;
    $rec['LOG'] = $log;
    //updating 'EXECUTED' (datetime)
    global $executed_date;
    global $executed_minutes;
    global $executed_hours;
    $rec['EXECUTED'] = toDBDate($executed_date) . " {$executed_hours}:{$executed_minutes}:00";
    //UPDATING RECORD
    if ($ok) {
        if ($rec['ID']) {
            SQLUpdate($table_name, $rec);
            // update
        } else {
            $new_rec = 1;
            $rec['ID'] = SQLInsert($table_name, $rec);
            // adding new record
        }
        $out['OK'] = 1;
    } else {
        $out['ERR'] = 1;
    }
}
 //updating 'WINDOW' (varchar)
  global $window;
  $rec['WINDOW']=$window;
 //updating 'DETAILS' (text)
  global $details;
  $rec['DETAILS']=$details;
 //updating 'ADDED' (datetime)
  global $added_date;
  global $added_minutes;
  global $added_hours;
  $rec['ADDED']=toDBDate($added_date)." $added_hours:$added_minutes:00";
 //updating 'EXPIRE' (datetime)
  global $expire_date;
  global $expire_minutes;
  global $expire_hours;
  $rec['EXPIRE']=toDBDate($expire_date)." $expire_hours:$expire_minutes:00";
 //updating 'PROCESSED' (int)
  global $processed;
  $rec['PROCESSED']=(int)$processed;
 //UPDATING RECORD
  if ($ok) {
   if ($rec['ID']) {
    SQLUpdate($table_name, $rec); // update
   } else {
    $new_rec=1;
    $rec['ID']=SQLInsert($table_name, $rec); // adding new record
   }
   $out['OK']=1;
  } else {
   $out['ERR']=1;
  }
Beispiel #9
0
 //updating 'WINDOW' (varchar)
 global $window;
 $rec['WINDOW'] = $window;
 //updating 'DETAILS' (text)
 global $details;
 $rec['DETAILS'] = $details;
 //updating 'ADDED' (datetime)
 global $added_date;
 global $added_minutes;
 global $added_hours;
 $rec['ADDED'] = toDBDate($added_date) . " {$added_hours}:{$added_minutes}:00";
 //updating 'EXPIRE' (datetime)
 global $expire_date;
 global $expire_minutes;
 global $expire_hours;
 $rec['EXPIRE'] = toDBDate($expire_date) . " {$expire_hours}:{$expire_minutes}:00";
 //updating 'PROCESSED' (int)
 global $processed;
 $rec['PROCESSED'] = (int) $processed;
 //UPDATING RECORD
 if ($ok) {
     if ($rec['ID']) {
         SQLUpdate($table_name, $rec);
         // update
     } else {
         $new_rec = 1;
         $rec['ID'] = SQLInsert($table_name, $rec);
         // adding new record
     }
     $out['OK'] = 1;
 } else {