Explorar el Código

start rating dynamic bugfix

master
patrick hace 6 años
padre
commit
9969154e58
Se han modificado 2 ficheros con 4 adiciones y 22 borrados
  1. +2
    -2
      js/bts_timesheet.js
  2. +2
    -20
      ts.php

+ 2
- 2
js/bts_timesheet.js Ver fichero

@@ -261,6 +261,7 @@
var self = this;
this.el.find("div.brating span").click(function(){
var r = $(this).attr('data-rating');
self.data.rating = r;
self.set_rating(r);
})
@@ -286,7 +287,7 @@
this.set_staff(data.staff);
this.set_client(data.client);
this.set_ack(data.ack);
this.set_rating(data.rating);
//save to html element
this.data = data;
this.el.data({job:this, data:data});
@@ -378,7 +379,6 @@
set_rating(num){
if (!(1 <= num && num <=5))
return;
this.data.rating=num;
this.el.find('div.brating span').each(function(i,e){
var rating = $(e).attr('data-rating');
var rating = parseInt(rating);

+ 2
- 20
ts.php Ver fichero

@@ -96,29 +96,10 @@ class AcareOffice{
staff VARCHAR(45) NULL,
client VARCHAR(45) NULL,
ack TINYINT(4) NULL,
rating INT NULL DEFAULT 0,
rating INT(4) NULL DEFAULT 0,
PRIMARY KEY (id)
) $charset_collate;";
// $sql = "CREATE TABLE $table_name (
// id int(64) NOT NULL AUTO_INCREMENT,
// paid tinyint(4) DEFAULT NULL,
// referal varchar(45) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
// clientid int(64) NOT NULL,
// loanamount float DEFAULT NULL,
// settledate date DEFAULT NULL,
// loanterm mediumint(10) DEFAULT NULL,
// commissionrate float DEFAULT NULL,
// commission float DEFAULT NULL,
// trailrate float DEFAULT NULL,
// trail float DEFAULT NULL,
// paydate date DEFAULT NULL,
// brokerid int(64) NOT NULL,
// status tinyint(4) NOT NULL,
// notes varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
// PRIMARY KEY (id)
// ) $charset_collate;";
//create database
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
@@ -450,6 +431,7 @@ class AcareOffice{
'staff'=> $s->staff,
'client'=> $s->client,
'ack' => $s->ack,
'rating' =>$s->rating,
);
}
}

Cargando…
Cancelar
Guardar