From: alex Date: Wed, 8 Jan 2020 04:26:31 +0000 (-0800) Subject: removed really old php project X-Git-Tag: v1.0.0~14 X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=2af97c97da3b82236f62d518337dbe303e3baf74;p=workouts removed really old php project --- diff --git a/Dockerfile b/Dockerfile index 9a05d14..d2fd9b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ COPY package-lock.json . COPY src/ src/ COPY test/ test/ COPY index.html . +COPY workouts.json . COPY webpack.config.js . COPY webpack.dev.config.js . COPY webpack.prod.config.js . @@ -23,6 +24,6 @@ RUN if [ "${BUILD_CONFIGURATION}" = "prod" ]; \ then npm run build; \ fi -# RUN npm run test +RUN npm run test ENTRYPOINT npm run start \ No newline at end of file diff --git a/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php b/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php deleted file mode 100644 index c113ad0..0000000 --- a/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php +++ /dev/null @@ -1,133 +0,0 @@ - \ No newline at end of file diff --git a/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php~ b/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php~ deleted file mode 100644 index 13703fd..0000000 --- a/old/WorkoutManagementAttributesManager/AttributesManagerRow/AttributesManagerRow.php~ +++ /dev/null @@ -1,92 +0,0 @@ - \ No newline at end of file diff --git a/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php b/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php deleted file mode 100644 index e89cc97..0000000 --- a/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php +++ /dev/null @@ -1,27 +0,0 @@ - - \ No newline at end of file diff --git a/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php~ b/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php~ deleted file mode 100644 index 461d7ef..0000000 --- a/old/WorkoutManagementAttributesManager/WorkoutManagementAttributesManager.php~ +++ /dev/null @@ -1,31 +0,0 @@ - - \ No newline at end of file diff --git a/old/WorkoutManagementDaysAgoTableData/WorkoutManagementDaysAgoTableData.php b/old/WorkoutManagementDaysAgoTableData/WorkoutManagementDaysAgoTableData.php deleted file mode 100644 index e31bf55..0000000 --- a/old/WorkoutManagementDaysAgoTableData/WorkoutManagementDaysAgoTableData.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php b/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php deleted file mode 100644 index 8785b46..0000000 --- a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php +++ /dev/null @@ -1,107 +0,0 @@ - - \ No newline at end of file diff --git a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php~ b/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php~ deleted file mode 100644 index 344cac4..0000000 --- a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTable.php~ +++ /dev/null @@ -1,108 +0,0 @@ - - \ No newline at end of file diff --git a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php b/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php deleted file mode 100644 index 34cad12..0000000 --- a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php +++ /dev/null @@ -1,81 +0,0 @@ - \ No newline at end of file diff --git a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php~ b/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php~ deleted file mode 100644 index 55b6ff3..0000000 --- a/old/WorkoutManagementWorkoutTable/WorkoutManagementWorkoutTableRows/WorkoutManagementWorkoutTableRows.php~ +++ /dev/null @@ -1,89 +0,0 @@ - \ No newline at end of file diff --git a/old/class.module_workout_management.php b/old/class.module_workout_management.php deleted file mode 100644 index d5257e1..0000000 --- a/old/class.module_workout_management.php +++ /dev/null @@ -1,232 +0,0 @@ -table_verify($this->get_required_module_table_data()))){ - self::log_error(self::MODULE_NAME." required tables verification failed."); - } - //Options: Module Name,linked module path,quick_tool_icon (font awesome icon class) - //Default is array ("",NULL,NULL) - $options = array (self::MODULE_NAME,NULL,"fa fa-bolt fa-lg"); - if(!($this->module_check(__FILE__,$options))){ - self::log_error(self::MODULE_NAME." module not loaded correctly."); - } - if(!($this->public_check($this->fields_marked_public,__FILE__))){ - self::log_error(self::MODULE_NAME." public fields not correctly implemented."); - } - } - - //Start required methods - public function cron_tasks () { - //Insert any methods here to run every 30 minutes, make sure to return TRUE - return TRUE; - } - - public function get_header () { - //Add any extra javascript scripts/css required to header - $return = $this->get_default_header(); - if((stripos($return,"")!==FALSE)&&(stripos($return,"")==strlen($return)-7)){ - if((is_array($this->header_scripts))&&(count($this->header_scripts)>0)){ - $return = rtrim($return,""); - foreach($this->header_scripts as $i=>$v){ - if($v['sri']!=""){ - $return .= "\n"; - } - else { - $return .= "\n"; - } - } - $return .= ""; - } - $stylesheets = $this->get_stylesheets(); - if($stylesheets!=""){ - $return = rtrim($return,""); - $return .= $stylesheets; - $return .= ""; - } - } - return $return; - } - - public function get_required_module_table_data ($type = "all") { - $tables = $this->required_table_structure; - foreach($tables as $name=>$rows){ - //Double check blockchain tracking row and delete once found - if(!((isset($rows[0]))&&(($rows[0]===0)||($rows[0]===1)))){ - unset($tables[$name]); - self::log_error(sprintf("Table structure data for `%s` not formatted correctly.%s",$name)); - continue; - } - if(($rows[0]===0)&&($type!="all")){ - unset($tables[$name]); - } - else { - unset($rows[0]); - $tables[$name] = array_values($rows); - } - } - return $tables; - } - - public function get_stylesheets () { - //Generate stylesheet (s) - $return = ""; - if(file_exists(__DIR__.DIRECTORY_SEPARATOR."style.css")){ - $return .= "\n"; - } - foreach($this->stylesheets as $i=>$v){ - $return .= "\n"; - } - return $return; - } - - public function load_module ($get_header = NULL,$module_file = NULL,$generate_menu = FALSE) { - //Add 3rd parameter bool (TRUE to generate menu, FALSE or omit to not) - //Check to see if this has been called from child module - if(($get_header===NULL)||($module_file===NULL)){ - if(!(parent::load_module($this->get_header(),__DIR__.DIRECTORY_SEPARATOR.$this->module_file,TRUE))){ - return FALSE; - } - } - else { - if(!(parent::load_module($get_header,$module_file,$generate_menu))){ - return FALSE; - } - } - return TRUE; - } - //End required methods - - //Start custom methods - protected function build_sortby ($sort = array(),$order = array()) { - $return = " ORDER BY"; - $valid_fields = array( - "c" => array (//Fields in/derived from workout_count (always abbreviated `c` in SQL) - "comments_count", - "date", - "last_done", - "times_done" - ), - "w" => array (//Fields in/derived from `workouts` (always abbreviated `w` in SQL) - "workout_name", - "workout_attributes", - "comments" - ), - "a" => array (//Fields in `worktous_attributes` (always abbreviated `a` in SQL) - "attribute_num", - "attribute_name", - "attribute_label", - ) - ); - foreach($sort as $f=>$type) { - if(strpos($f,"workout_attributes")!==FALSE){ - continue; - } - if(!((in_array($f,$valid_fields["c"]))||(in_array($f,$valid_fields["w"]))||(in_array($f,$valid_fields["a"])))){ - unset($sort[$f]); - } - } - foreach($order as $i=>$f){ - if(in_array($f,$valid_fields["c"])){ - if($f=="comments_count"){ - $f="comments"; - $sort[$f]=$sort["comments_count"]; - } - $return .= sprintf(" `c`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(strpos($f,"workout_attributes")!==FALSE){ - $return .= sprintf(" SUBSTRING(`w`.`workout_attributes`,%d,1) %s,",((int) substr($f,19))+1,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(in_array($f,$valid_fields["w"])){ - $return .= sprintf(" `w`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(in_array($f,$valid_fields["a"])){ - $return .= sprintf(" `a`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - } - $return = rtrim($return,","); - if($return==" ORDER BY"){ - return ""; - } - else { - return $return; - } - } - //End custom methods - - //Start required table structure data - //Use the following code to generate table data - /* - $data = array(0 => 0);//Change to 1 if tracked by blockchain - $query = "DESCRIBE `%%TABLE_NAME%%`;"; - $result = mysqli_query($db,$query) or die(mysqli_error($db)); - while($row = mysqli_fetch_assoc($result)){ - $data[]=$row; - } - exit("
".var_export($data)."
"); - */ - private $required_table_structure = array ( - "workouts" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'siid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'workout_name', 'Type' => 'varchar(50)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'workout_attributes', 'Type' => 'varchar(30)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workouts_attributes" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'attribute_num', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'attribute_name', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'attribute_label', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workout_count" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'wid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'date', 'Type' => 'date', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ) - ); - //End required table structure data - - //Start public fields - //Fields in this area will be added to the public table so that they will be displayed in the public feed area - //Format of each row: 0 => array ("table" => "", "title_field" => "", "description_field" => "","denotes_public_field" => "","denotes_public_value"=>"" ) - private $fields_marked_public = array ( - - ); - //End public fields - - //Header Variable (each row contains info linking to a javascript script used by the module and inserted into the header) - //Format of each row: 0 => array ("type" => "", "src" => "", "sri" => "") - private $header_scripts = array ( - - ); - - //Extra stylesheet information (each row contains a stylesheet to be loaded with the module - //Format for each row: 0 => array ( "href" => "", "rel"=> "", "type"=>"" ) - private $stylesheets = array ( - - ); - - //Main file to load -- fill in and update - private $module_file = "workout_management.php"; - -} \ No newline at end of file diff --git a/old/class.module_workout_management.php~ b/old/class.module_workout_management.php~ deleted file mode 100644 index 088c0ae..0000000 --- a/old/class.module_workout_management.php~ +++ /dev/null @@ -1,227 +0,0 @@ -table_verify($this->get_required_module_table_data()))){ - self::log_error(self::MODULE_NAME." required tables verification failed."); - } - //Options: Module Name,linked module path,quick_tool_icon (font awesome icon class) - //Default is array ("",NULL,NULL) - $options = array (self::MODULE_NAME,NULL,"fa fa-bolt fa-lg"); - if(!($this->module_check(__FILE__,$options))){ - self::log_error(self::MODULE_NAME." module not loaded correctly."); - } - if(!($this->public_check($this->fields_marked_public,__FILE__))){ - self::log_error(self::MODULE_NAME." public fields not correctly implemented."); - } - } - - //Start required methods - public function cron_tasks () { - //Insert any methods here to run every 30 minutes, make sure to return TRUE - return TRUE; - } - - public function get_header () { - //Add any extra javascript scripts/css required to header - $return = $this->get_default_header(); - if((stripos($return,"")!==FALSE)&&(stripos($return,"")==strlen($return)-7)){ - if((is_array($this->header_scripts))&&(count($this->header_scripts)>0)){ - $return = rtrim($return,""); - foreach($this->header_scripts as $i=>$v){ - if($v['sri']!=""){ - $return .= "\n"; - } - else { - $return .= "\n"; - } - } - $return .= ""; - } - $stylesheets = $this->get_stylesheets(); - if($stylesheets!=""){ - $return = rtrim($return,""); - $return .= $stylesheets; - $return .= ""; - } - } - return $return; - } - - public function get_required_module_table_data ($type = "all") { - $tables = $this->required_table_structure; - foreach($tables as $name=>$rows){ - //Double check blockchain tracking row and delete once found - if(!((isset($rows[0]))&&(($rows[0]===0)||($rows[0]===1)))){ - unset($tables[$name]); - self::log_error(sprintf("Table structure data for `%s` not formatted correctly.%s",$name)); - continue; - } - if(($rows[0]===0)&&($type!="all")){ - unset($tables[$name]); - } - else { - unset($rows[0]); - $tables[$name] = array_values($rows); - } - } - return $tables; - } - - public function get_stylesheets () { - //Generate stylesheet (s) - $return = ""; - if(file_exists(__DIR__.DIRECTORY_SEPARATOR."style.css")){ - $return .= "\n"; - } - foreach($this->stylesheets as $i=>$v){ - $return .= "\n"; - } - return $return; - } - - public function load_module ($get_header = NULL,$module_file = NULL,$generate_menu = FALSE) { - //Add 3rd parameter bool (TRUE to generate menu, FALSE or omit to not) - //Check to see if this has been called from child module - if(($get_header===NULL)||($module_file===NULL)){ - if(!(parent::load_module($this->get_header(),__DIR__.DIRECTORY_SEPARATOR.$this->module_file,TRUE))){ - return FALSE; - } - } - else { - if(!(parent::load_module($get_header,$module_file,$generate_menu))){ - return FALSE; - } - } - return TRUE; - } - //End required methods - - //Start custom methods - protected function build_sortby ($sort = array(),$order = array()) { - $return = " ORDER BY"; - $valid_fields = array( - "c" => array (//Fields in/derived from workout_count (always abbreviated `c` in SQL) - "date", - "last_done", - "times_done" - ), - "w" => array (//Fields in/derived from `workouts` (always abbreviated `w` in SQL) - "workout_name", - "workout_attributes", - "comments" - ), - "a" => array (//Fields in `worktous_attributes` (always abbreviated `a` in SQL) - "attribute_num", - "attribute_name", - "attribute_label", - ) - ); - foreach($sort as $f=>$type) { - if(strpos($f,"workout_attributes")!==FALSE){ - continue; - } - if(!((in_array($f,$valid_fields["c"]))||(in_array($f,$valid_fields["w"]))||(in_array($f,$valid_fields["a"])))){ - unset($sort[$f]); - } - } - foreach($order as $i=>$f){ - if(in_array($f,$valid_fields["c"])){ - $return .= sprintf(" `c`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(strpos($f,"workout_attributes")!==FALSE){ - $return .= sprintf(" SUBSTRING(`w`.`workout_attributes`,%d,1) %s,",((int) substr($f,19))+1,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(in_array($f,$valid_fields["w"])){ - $return .= sprintf(" `w`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - else if(in_array($f,$valid_fields["a"])){ - $return .= sprintf(" `a`.`%s` %s,",$f,($sort[$f]=="ASC")?"ASC":"DESC"); - } - } - $return = rtrim($return,","); - if($return==" ORDER BY"){ - return ""; - } - else { - return $return; - } - } - //End custom methods - - //Start required table structure data - //Use the following code to generate table data - /* - $data = array(0 => 0);//Change to 1 if tracked by blockchain - $query = "DESCRIBE `%%TABLE_NAME%%`;"; - $result = mysqli_query($db,$query) or die(mysqli_error($db)); - while($row = mysqli_fetch_assoc($result)){ - $data[]=$row; - } - exit("
".var_export($data)."
"); - */ - private $required_table_structure = array ( - "workouts" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'siid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'workout_name', 'Type' => 'varchar(50)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'workout_attributes', 'Type' => 'varchar(30)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workouts_attributes" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'attribute_num', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'attribute_name', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'attribute_label', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workout_count" => array ( - 0 => 1, - 1 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 2 => array ( 'Field' => 'wid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'date', 'Type' => 'date', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ) - ); - //End required table structure data - - //Start public fields - //Fields in this area will be added to the public table so that they will be displayed in the public feed area - //Format of each row: 0 => array ("table" => "", "title_field" => "", "description_field" => "","denotes_public_field" => "","denotes_public_value"=>"" ) - private $fields_marked_public = array ( - - ); - //End public fields - - //Header Variable (each row contains info linking to a javascript script used by the module and inserted into the header) - //Format of each row: 0 => array ("type" => "", "src" => "", "sri" => "") - private $header_scripts = array ( - - ); - - //Extra stylesheet information (each row contains a stylesheet to be loaded with the module - //Format for each row: 0 => array ( "href" => "", "rel"=> "", "type"=>"" ) - private $stylesheets = array ( - - ); - - //Main file to load -- fill in and update - private $module_file = "workout_management.php"; - -} \ No newline at end of file diff --git a/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php b/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php deleted file mode 100644 index cc21535..0000000 --- a/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php +++ /dev/null @@ -1,82 +0,0 @@ - \ No newline at end of file diff --git a/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php~ b/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php~ deleted file mode 100644 index 5fe64d5..0000000 --- a/old/recent_workouts/RecentWorkoutsTableRow/RecentWorkoutsTableRow.php~ +++ /dev/null @@ -1,92 +0,0 @@ - \ No newline at end of file diff --git a/old/recent_workouts/class.module_recent_workouts.php b/old/recent_workouts/class.module_recent_workouts.php deleted file mode 100644 index b78bd75..0000000 --- a/old/recent_workouts/class.module_recent_workouts.php +++ /dev/null @@ -1,154 +0,0 @@ -table_verify($this->get_required_module_table_data()))){ - self::log_error(self::MODULE_NAME." required tables verification failed."); - } - //Options: Module Name,linked module path,quick_tool_icon (font awesome icon class) - //Default is array ("",NULL,NULL) - $options = array (self::MODULE_NAME,"workout_management/",NULL); - if(!($this->module_check(__FILE__,$options))){ - self::log_error(self::MODULE_NAME." module not loaded correctly."); - } - if(!($this->public_check($this->fields_marked_public,__FILE__))){ - self::log_error(self::MODULE_NAME." public fields not correctly implemented."); - } - } - - //Start required methods - public function cron_tasks () { - //Insert any methods here to run every 30 minutes, make sure to return TRUE - return TRUE; - } - - public function get_header () { - //Add any extra javascript scripts/css required to header - $return = $this->get_default_header(); - if((stripos($return,"")!==FALSE)&&(stripos($return,"")==strlen($return)-7)){ - if((is_array($this->header_scripts))&&(count($this->header_scripts)>0)){ - $return = rtrim($return,""); - foreach($this->header_scripts as $i=>$v){ - if($v['sri']!=""){ - $return .= "\n"; - } - else { - $return .= "\n"; - } - } - $return .= ""; - } - $stylesheets = $this->get_stylesheets(); - if($stylesheets!=""){ - $return = rtrim($return,""); - $return .= $stylesheets; - $return .= ""; - } - } - return $return; - } - - public function get_required_module_table_data ($type = "all") { - $tables = $this->required_table_structure; - foreach($tables as $name=>$rows){ - //Double check blockchain tracking row and delete once found - if(!((isset($rows[0]))&&(($rows[0]===0)||($rows[0]===1)))){ - unset($tables[$name]); - self::log_error(sprintf("Table structure data for `%s` not formatted correctly.%s",$name)); - continue; - } - if(($rows[0]===0)&&($type!="all")){ - unset($tables[$name]); - } - else { - unset($rows[0]); - $tables[$name] = array_values($rows); - } - } - return $tables; - } - - public function get_stylesheets () { - //Generate stylesheet (s) - $return = ""; - if(file_exists(__DIR__.DIRECTORY_SEPARATOR."style.css")){ - $return .= "\n"; - } - foreach($this->stylesheets as $i=>$v){ - $return .= "\n"; - } - return $return; - } - - public function load_module ($get_header = NULL,$module_file = NULL,$generate_menu = FALSE) { - //Add 3rd parameter bool (TRUE to generate menu, FALSE or omit to not) - //Check to see if this has been called from child module - if(($get_header===NULL)||($module_file===NULL)){ - if(!(parent::load_module($this->get_header(),__DIR__.DIRECTORY_SEPARATOR.$this->module_file,TRUE))){ - return FALSE; - } - } - else { - if(!(parent::load_module($get_header,$module_file,$generate_menu))){ - return FALSE; - } - } - return TRUE; - } - //End required methods - - //Start custom methods - - //End custom methods - - //Start required table structure data - //Use the following code to generate table data - /* - $data = array(0 => 0);//Change to 1 if tracked by blockchain - $query = "DESCRIBE `%%TABLE_NAME%%`;"; - $result = mysqli_query($db,$query) or die(mysqli_error($db)); - while($row = mysqli_fetch_assoc($result)){ - $data[]=$row; - } - exit("
".var_export($data)."
"); - */ - private $required_table_structure = array ( - - ); - //End required table structure data - - //Start public fields - //Fields in this area will be added to the public table so that they will be displayed in the public feed area - //Format of each row: 0 => array ("table" => "", "title_field" => "", "description_field" => "","denotes_public_field" => "","denotes_public_value"=>"" ) - private $fields_marked_public = array ( - - ); - //End public fields - - //Header Variable (each row contains info linking to a javascript script used by the module and inserted into the header) - //Format of each row: 0 => array ("type" => "", "src" => "", "sri" => "") - private $header_scripts = array ( - 0 => array ("type" => "text/javascript", "src" => "js/custom/datepicker.js", "sri" => "sha384-AbJvjf2C2pgqlpImUmOmuW/mmbyLeKADFVtJynfREH6mETlFGqjxUyXLbDcVy7RY") - ); - - //Extra stylesheet information (each row contains a stylesheet to be loaded with the module - //Format for each row: 0 => array ( "href" => "", "rel"=> "", "type"=>"" ) - private $stylesheets = array ( - 0 => array ("href" => "js/custom/datepicker.css", "rel" => "stylesheet", "type" => "text/css") - ); - - //Main file to load -- fill in and update - private $module_file = "recent_workouts.php"; - -} \ No newline at end of file diff --git a/old/recent_workouts/class.module_recent_workouts.php~ b/old/recent_workouts/class.module_recent_workouts.php~ deleted file mode 100644 index 953da84..0000000 --- a/old/recent_workouts/class.module_recent_workouts.php~ +++ /dev/null @@ -1,154 +0,0 @@ -table_verify($this->get_required_module_table_data()))){ - self::log_error(self::MODULE_NAME." required tables verification failed."); - } - //Options: Module Name,linked module path,quick_tool_icon (font awesome icon class) - //Default is array ("",NULL,NULL) - $options = array (self::MODULE_NAME,"workout_management/",NULL); - if(!($this->module_check(__FILE__,$options))){ - self::log_error(self::MODULE_NAME." module not loaded correctly."); - } - if(!($this->public_check($this->fields_marked_public,__FILE__))){ - self::log_error(self::MODULE_NAME." public fields not correctly implemented."); - } - } - - //Start required methods - public function cron_tasks () { - //Insert any methods here to run every 30 minutes, make sure to return TRUE - return TRUE; - } - - public function get_header () { - //Add any extra javascript scripts/css required to header - $return = $this->get_default_header(); - if((stripos($return,"")!==FALSE)&&(stripos($return,"")==strlen($return)-7)){ - if((is_array($this->header_scripts))&&(count($this->header_scripts)>0)){ - $return = rtrim($return,""); - foreach($this->header_scripts as $i=>$v){ - if($v['sri']!=""){ - $return .= "\n"; - } - else { - $return .= "\n"; - } - } - $return .= ""; - } - $stylesheets = $this->get_stylesheets(); - if($stylesheets!=""){ - $return = rtrim($return,""); - $return .= $stylesheets; - $return .= ""; - } - } - return $return; - } - - public function get_required_module_table_data ($type = "all") { - $tables = $this->required_table_structure; - foreach($tables as $name=>$rows){ - //Double check blockchain tracking row and delete once found - if(!((isset($rows[0]))&&(($rows[0]===0)||($rows[0]===1)))){ - unset($tables[$name]); - self::log_error(sprintf("Table structure data for `%s` not formatted correctly.%s",$name)); - continue; - } - if(($rows[0]===0)&&($type!="all")){ - unset($tables[$name]); - } - else { - unset($rows[0]); - $tables[$name] = array_values($rows); - } - } - return $tables; - } - - public function get_stylesheets () { - //Generate stylesheet (s) - $return = ""; - if(file_exists(__DIR__.DIRECTORY_SEPARATOR."style.css")){ - $return .= "\n"; - } - foreach($this->stylesheets as $i=>$v){ - $return .= "\n"; - } - return $return; - } - - public function load_module ($get_header = NULL,$module_file = NULL,$generate_menu = FALSE) { - //Add 3rd parameter bool (TRUE to generate menu, FALSE or omit to not) - //Check to see if this has been called from child module - if(($get_header===NULL)||($module_file===NULL)){ - if(!(parent::load_module($this->get_header(),__DIR__.DIRECTORY_SEPARATOR.$this->module_file,TRUE))){ - return FALSE; - } - } - else { - if(!(parent::load_module($get_header,$module_file,$generate_menu))){ - return FALSE; - } - } - return TRUE; - } - //End required methods - - //Start custom methods - - //End custom methods - - //Start required table structure data - //Use the following code to generate table data - /* - $data = array(0 => 0);//Change to 1 if tracked by blockchain - $query = "DESCRIBE `%%TABLE_NAME%%`;"; - $result = mysqli_query($db,$query) or die(mysqli_error($db)); - while($row = mysqli_fetch_assoc($result)){ - $data[]=$row; - } - exit("
".var_export($data)."
"); - */ - private $required_table_structure = array ( - - ); - //End required table structure data - - //Start public fields - //Fields in this area will be added to the public table so that they will be displayed in the public feed area - //Format of each row: 0 => array ("table" => "", "title_field" => "", "description_field" => "","denotes_public_field" => "","denotes_public_value"=>"" ) - private $fields_marked_public = array ( - - ); - //End public fields - - //Header Variable (each row contains info linking to a javascript script used by the module and inserted into the header) - //Format of each row: 0 => array ("type" => "", "src" => "", "sri" => "") - private $header_scripts = array ( - - ); - - //Extra stylesheet information (each row contains a stylesheet to be loaded with the module - //Format for each row: 0 => array ( "href" => "", "rel"=> "", "type"=>"" ) - private $stylesheets = array ( - - ); - - //Main file to load -- fill in and update - private $module_file = "recent_workouts.php"; - -} \ No newline at end of file diff --git a/old/recent_workouts/recent_workouts.php b/old/recent_workouts/recent_workouts.php deleted file mode 100644 index d95d197..0000000 --- a/old/recent_workouts/recent_workouts.php +++ /dev/null @@ -1,106 +0,0 @@ -
-

Recent Workouts

-
-
- - - diff --git a/old/recent_workouts/recent_workouts.php~ b/old/recent_workouts/recent_workouts.php~ deleted file mode 100644 index 168b045..0000000 --- a/old/recent_workouts/recent_workouts.php~ +++ /dev/null @@ -1,72 +0,0 @@ -
-

Recent Workouts

-
-
- - - diff --git a/old/recent_workouts/recent_workouts_data.php b/old/recent_workouts/recent_workouts_data.php deleted file mode 100644 index 820b951..0000000 --- a/old/recent_workouts/recent_workouts_data.php +++ /dev/null @@ -1,49 +0,0 @@ -db; - $tosend = array("raw"=>array(),"workouts"=>array()); - $_POST['filter']="%".$_POST['filter']."%"; - $sortby = ((isset($_POST['sorting']))&&(isset($_POST['order'])))?$this->build_sortby($_POST['sorting'],$_POST['order']):"";//build_sortby is from class_workout_management.php - $stmt = $db->prepare(sprintf("SELECT `c`.`id`,`c`.`wid`,`c`.`date`,`c`.`comments` as `comments_count`,`w`.`workout_name` FROM `workout_count` as `c` INNER JOIN `workouts` as `w` ON `c`.`wid`=`w`.`siid` WHERE `workout_name` LIKE ? OR `c`.`comments` LIKE ? %s LIMIT 100",$sortby)); - $stmt->bind_param('ss',$_POST['filter'],$_POST['filter']); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$wid,$date,$comments,$name); - while($stmt->fetch()){ - $tosend["raw"][]=array("id"=>$id,"wid"=>$wid,"date"=>$date,"comments"=>$comments,"workout_name"=>$name); - } - $stmt->close(); - $stmt = $db->prepare("SELECT `id`,`workout_name`,`comments` FROM `workouts` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$name,$comments); - while($stmt->fetch()){ - $tosend["workouts"][$id]=array("id"=>$id,"workout_name"=>$name,"comments"=>$comments); - } - $stmt->close(); - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/recent_workouts/recent_workouts_data.php~ b/old/recent_workouts/recent_workouts_data.php~ deleted file mode 100644 index 9f551a8..0000000 --- a/old/recent_workouts/recent_workouts_data.php~ +++ /dev/null @@ -1,49 +0,0 @@ -db; - $tosend = array("raw"=>array(),"workouts"=>array()); - $_POST['filter']="%".$_POST['filter']."%"; - $sortby = ((isset($_POST['sorting']))&&(isset($_POST['order'])))?$this->build_sortby($_POST['sorting'],$_POST['order']):"";//build_sortby is from class_workout_management.php - $stmt = $db->prepare(sprintf("SELECT `c`.`id`,`c`.`wid`,`c`.`date`,`c`.`comments` as `comments_count`,`w`.`workout_name` FROM `workout_count` as `c` INNER JOIN `workouts` as `w` ON `c`.`wid`=`w`.`siid` WHERE `workout_name` LIKE ? %s LIMIT 100",$sortby)); - $stmt->bind_param('s',$_POST['filter']); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$wid,$date,$comments,$name); - while($stmt->fetch()){ - $tosend["raw"][]=array("id"=>$id,"wid"=>$wid,"date"=>$date,"comments"=>$comments,"workout_name"=>$name); - } - $stmt->close(); - $stmt = $db->prepare("SELECT `id`,`workout_name`,`comments` FROM `workouts` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$name,$comments); - while($stmt->fetch()){ - $tosend["workouts"][$id]=array("id"=>$id,"workout_name"=>$name,"comments"=>$comments); - } - $stmt->close(); - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/recent_workouts/recent_workouts_delete.php b/old/recent_workouts/recent_workouts_delete.php deleted file mode 100644 index 9e5e253..0000000 --- a/old/recent_workouts/recent_workouts_delete.php +++ /dev/null @@ -1,32 +0,0 @@ -db; - $stmt = $db->prepare("DELETE FROM `workout_count` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$_POST['id']); - $content = array("DELETE","workout_count",array($_POST['id'])); - if(!($this->database_query($stmt,$content,"DELETE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/recent_workouts/recent_workouts_edit.php b/old/recent_workouts/recent_workouts_edit.php deleted file mode 100644 index ef88063..0000000 --- a/old/recent_workouts/recent_workouts_edit.php +++ /dev/null @@ -1,32 +0,0 @@ -db; - $stmt = $db->prepare("UPDATE `workout_count` SET `wid`=?,`comments`=?,`date`=? WHERE `id`=? LIMIT 1;"); - $stmt->bind_param('issi',$_POST['wid'],$_POST['comments'],$_POST['date'],$_POST['id']); - $content = array("UPDATE","workout_count",array("wid","comments","date"),array($_POST['wid'],$_POST['comments'],$_POST['date'])); - if(!($this->database_query($stmt,$content,"UPDATE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/recent_workouts/style.css b/old/recent_workouts/style.css deleted file mode 100644 index 7d891fb..0000000 --- a/old/recent_workouts/style.css +++ /dev/null @@ -1,87 +0,0 @@ -/*Page - Recent Workouts*/ -table.recent-workouts-table { - width:100%; - font:12px/18px Arial, Sans-serif; - color:#333; - background-color:#fff; - border-spacing:0; - margin:10px 0 15px; - text-align:left; -} - -table.recent-workouts-table > thead > tr > th { - -webkit-user-select:none; - font:bold 12px/18px Arial, Sans-serif; - color:#000; - background-color:#fff; - border-collapse:collapse; - border-bottom:#ccc 2px solid; - cursor:pointer; - white-space:normal; -} - -table.recent-workouts-table > thead > tr > th.sortedby { - border-bottom:#000 2px solid; -} - -table.recent-workouts-table > thead > tr > th > i { - padding:4px; - float:right; -} - -table.recent-workouts-table > tbody > tr > td { - border-bottom:#ccc 1px solid; - padding:4px; - vertical-align:top; -} - -table.recent-workouts-table > tbody > tr.odd > td { - background-color:#dfdfdf; -} - -table.recent-workouts-table > tbody > tr.even > td { - background-color:#efefef; -} - -table.recent-workouts-table > tbody > tr:hover > td, -table.recent-workouts-table > tbody > tr.odd > td:hover, -table.recent-workouts-table > tbody > tr.even > td:hover { - background: #fff; - color: #000; -} - -select.recent-workouts-table-select,input.recent-workouts-table-input { - padding:4px; - width:100%; - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; -} - -textarea.recent-workouts-table-textarea { - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; - width:100%; - resize:none; -} - -div.recent-workouts-table-delete-container { - background-color:inherit; - position:absolute; - right:-1.5px; - top:-46px; -} - -div.recent-workouts-loading-div { - width:100%; - box-sizing:border-box; - padding:5%; - text-align:center; -} \ No newline at end of file diff --git a/old/structure.php~ b/old/structure.php~ deleted file mode 100644 index f2185f6..0000000 --- a/old/structure.php~ +++ /dev/null @@ -1,40 +0,0 @@ - array ( - 0 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 1 => array ( 'Field' => 'userid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 2 => array ( 'Field' => 'siid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'workout_name', 'Type' => 'varchar(50)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'workout_attributes', 'Type' => 'varchar(30)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workouts_attributes" => array ( - 0 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 1 => array ( 'Field' => 'userid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 2 => array ( 'Field' => 'attribute_num', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'attribute_name', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'attribute_label', 'Type' => 'varchar(255)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 6 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ), - "workout_count" => array ( - 0 => array ( 'Field' => 'id', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => 'auto_increment', ), - 1 => array ( 'Field' => 'userid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 2 => array ( 'Field' => 'wid', 'Type' => 'int(11)', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 3 => array ( 'Field' => 'date', 'Type' => 'date', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 4 => array ( 'Field' => 'comments', 'Type' => 'text', 'Null' => 'NO', 'Key' => '', 'Default' => NULL, 'Extra' => '', ), - 5 => array ( 'Field' => 'modified', 'Type' => 'timestamp', 'Null' => 'NO', 'Key' => '', 'Default' => 'CURRENT_TIMESTAMP', 'Extra' => 'on update CURRENT_TIMESTAMP', ), - ) -); - -?> \ No newline at end of file diff --git a/old/style.css b/old/style.css deleted file mode 100644 index 2bd4b6b..0000000 --- a/old/style.css +++ /dev/null @@ -1,157 +0,0 @@ -/*Page - Workout Management */ -table#daysago { - border:1px solid black; - text-align:center; - border-collapse:collapse; - margin-top:4px; -} - -div.wm-attr-manager-div { - -} - -div.wm-attr-manager-container { - width:50vw; - position:relative; -} - -div.wm-attr-manager-container > div { - display:block; - border:1px solid black; - box-sizing:border-box; - width:70%; - height:5vh; - line-height:5vh; - position:absolute; - cursor:move; -} - -div.wm-attr-manager-container > div.editable > input { - pointer-events:auto; - border:2px ridge lightgreen; -} - -div.wm-attr-manager-container > div > input { - pointer-events:none; - border:none; -} - -div.wm-attr-manager-container > div > i { - display:none; -} - -div.wm-attr-manager-container > div:hover > i,div.wm-attr-manager-container > div.editable > i { - float:right; - display:inline-block; - margin-right:5px; - cursor:pointer; -} - -table.workout-management-table { - width:100%; - font:12px/18px Arial, Sans-serif; - color:#333; - background-color:#fff; - border-spacing:0; - margin:10px 0 15px; - text-align:left; -} - -table.workout-management-table > thead > tr > th { - -webkit-user-select:none; - font:bold 12px/18px Arial, Sans-serif; - color:#000; - background-color:#fff; - border-collapse:collapse; - border-bottom:#ccc 2px solid; - cursor:pointer; - white-space:normal; -} - -table.workout-management-table > thead > tr > th.sortedby { - border-bottom:#000 2px solid; -} - -table.workout-management-table > thead > tr > th > i { - padding:4px; - float:right; -} - -table.workout-management-table > tbody > tr > td { - border-bottom:#ccc 1px solid; - padding:4px; - vertical-align:top; -} - -table.workout-management-table > tbody > tr.odd > td { - background-color:#dfdfdf; -} - -table.workout-management-table > tbody > tr.even > td { - background-color:#efefef; -} - -table.workout-management-table > tbody > tr:hover > td, -table.workout-management-table > tbody > tr.odd > td:hover, -table.workout-management-table > tbody > tr.even > td:hover { - background: #fff; - color: #000; -} - -input.workout-management-table-input,select.workout-management-table-select { - padding:4px; - width:100%; - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; -} - -input.workout-management-table-input-toggles { - padding:4px; - width:30px; - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; -} - -textarea.workout-management-table-comments { - background-color:inherit; - border:none; - resize:none; - width:100%; - padding:0; - margin:0; - font-size:inherit; - font:inherit; - box-sizing:border-box; -} - -td.inputok { - position:relative; -} - -tr:hover > td.inputok > div > div.workout-management-table-delete-container { - display:block; -} - -div.workout-management-table-delete-container { - display:none; - background-color:inherit; - position:absolute; - right:0; - top:0; - cursor:pointer; -} - -div.workout-management-loading-div { - width:100%; - box-sizing:border-box; - padding:5%; - text-align:center; -} \ No newline at end of file diff --git a/old/style.css~ b/old/style.css~ deleted file mode 100644 index 972f006..0000000 --- a/old/style.css~ +++ /dev/null @@ -1,147 +0,0 @@ -/*Page - Workout Management */ -table#daysago { - border:1px solid black; - text-align:center; - border-collapse:collapse; - margin-top:4px; -} - -div.wm-attr-manager-div { - -} - -div.wm-attr-manager-container { - width:50vw; - position:relative; -} - -div.wm-attr-manager-container > div { - display:block; - border:1px solid black; - box-sizing:border-box; - width:70%; - height:5vh; - line-height:5vh; - position:absolute; - cursor:move; -} - -div.wm-attr-manager-container > div.editable > input { - pointer-events:auto; - border:2px ridge lightgreen; -} - -div.wm-attr-manager-container > div > input { - pointer-events:none; - border:none; -} - -div.wm-attr-manager-container > div > i { - display:none; -} - -div.wm-attr-manager-container > div:hover > i,div.wm-attr-manager-container > div.editable > i { - float:right; - display:inline-block; - margin-right:5px; - cursor:pointer; -} - -table.workout-management-table { - width:100%; - font:12px/18px Arial, Sans-serif; - color:#333; - background-color:#fff; - border-spacing:0; - margin:10px 0 15px; - text-align:left; -} - -table.workout-management-table > thead > tr > th { - -webkit-user-select:none; - font:bold 12px/18px Arial, Sans-serif; - color:#000; - background-color:#fff; - border-collapse:collapse; - border-bottom:#ccc 2px solid; - cursor:pointer; - white-space:normal; -} - -table.workout-management-table > thead > tr > th.sortedby { - border-bottom:#000 2px solid; -} - -table.workout-management-table > thead > tr > th > i { - padding:4px; - float:right; -} - -table.workout-management-table > tbody > tr > td { - border-bottom:#ccc 1px solid; - padding:4px; - vertical-align:top; -} - -table.workout-management-table > tbody > tr.odd > td { - background-color:#dfdfdf; -} - -table.workout-management-table > tbody > tr.even > td { - background-color:#efefef; -} - -table.workout-management-table > tbody > tr:hover > td, -table.workout-management-table > tbody > tr.odd > td:hover, -table.workout-management-table > tbody > tr.even > td:hover { - background: #fff; - color: #000; -} - -input.workout-management-table-input,select.workout-management-table-select { - padding:4px; - width:100%; - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; -} - -input.workout-management-table-input-toggles { - padding:4px; - width:30px; - background-color:inherit; - border:none; - font-size:inherit; - font:inherit; - display:block; - box-sizing:border-box; -} - -textarea.workout-management-table-comments { - background-color:inherit; - border:none; - resize:none; - width:100%; - padding:0; - margin:0; - font-size:inherit; - font:inherit; - box-sizing:border-box; -} - -div.workout-management-table-delete-container { - background-color:inherit; - position:absolute; - right:-1.5px; - top:-47px; -} - -div.workout-management-loading-div { - width:100%; - box-sizing:border-box; - padding:5%; - text-align:center; -} \ No newline at end of file diff --git a/old/workout_management.php b/old/workout_management.php deleted file mode 100644 index 02aa150..0000000 --- a/old/workout_management.php +++ /dev/null @@ -1,57 +0,0 @@ -

Workout Management

-
- - - \ No newline at end of file diff --git a/old/workout_management.php~ b/old/workout_management.php~ deleted file mode 100644 index c4a369b..0000000 --- a/old/workout_management.php~ +++ /dev/null @@ -1,59 +0,0 @@ -

Workout Management

-
- - - \ No newline at end of file diff --git a/old/workout_management_add_attribute.php b/old/workout_management_add_attribute.php deleted file mode 100644 index 6f6df60..0000000 --- a/old/workout_management_add_attribute.php +++ /dev/null @@ -1,40 +0,0 @@ -db; - $stmt = $db->prepare("SELECT IFNULL(MAX(`attribute_num`)+1,0) FROM `workouts_attributes` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($max); - $stmt->fetch(); - $stmt->close(); - $stmt = $db->prepare("INSERT INTO `workouts_attributes` (attribute_num,attribute_name,attribute_label,comments) VALUES (?,'New Attribute','Attribute Label','New Attribute')"); - $stmt->bind_param('i',$max); - $content = array("INSERT","workouts_attributes",array("attribute_num","attribute_name","attribute_label","comments"),array($max,"New Attribute","Attribute Label","New Attribute")); - if(!($this->database_query($stmt,$content,"INSERT",NULL))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_add_new.php b/old/workout_management_add_new.php deleted file mode 100644 index c915ee1..0000000 --- a/old/workout_management_add_new.php +++ /dev/null @@ -1,48 +0,0 @@ -db; - $stmt = $db->prepare("SELECT RPAD('',(SELECT COUNT(*) as `count` FROM `workouts_attributes` WHERE 1),'0') FROM `workouts_attributes` WHERE 1 LIMIT 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($attr); - $stmt->fetch(); - $stmt->close(); - $stmt = $db->prepare("SELECT IFNULL(MAX(`siid`)+1,0) FROM `workouts` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($max); - $stmt->fetch(); - $stmt->close(); - $stmt = $db->prepare("INSERT INTO `workouts` (`siid`,`workout_name`,`workout_attributes`,`comments`) VALUES (?,'New Workout',?,'New Workout')"); - $stmt->bind_param('is',$max,$attr); - $content = array("INSERT","workouts",array("siid","workout_name","workout_attributes","comments"),array($max,"New Workout",$attr,"New Workout")); - if(!($this->database_query($stmt,$content,"INSERT",NULL))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_add_new.php~ b/old/workout_management_add_new.php~ deleted file mode 100644 index 9344165..0000000 --- a/old/workout_management_add_new.php~ +++ /dev/null @@ -1,53 +0,0 @@ -db; - $stmt = $db->prepare("SELECT COUNT(*) as `count` FROM `workouts_attributes` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($count); - $stmt->fetch(); - $stmt->close(); - $attr = ""; - while($i<$count){ - $attr.="0"; - $i++; - } - $stmt = $db->prepare("SELECT IFNULL(MAX(`siid`)+1,0) FROM `workouts` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($max); - $stmt->fetch(); - $stmt->close(); - $stmt = $db->prepare("INSERT INTO `workouts` (`siid`,`workout_name`,`workout_attributes`,`comments`) VALUES (?,'New Workout',?,'New Workout')"); - $stmt->bind_param('is',$max,$attr); - $content = array("INSERT","workouts",array("siid","workout_name","workout_attributes","comments"),array($max,"New Workout",$attr,"New Workout")); - if(!($this->database_query($stmt,$content,"INSERT",NULL))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_attribute_delete.php b/old/workout_management_attribute_delete.php deleted file mode 100644 index f371d8d..0000000 --- a/old/workout_management_attribute_delete.php +++ /dev/null @@ -1,86 +0,0 @@ -db; - $stmt = $db->prepare("SELECT `attribute_num` FROM `workouts_attributes` WHERE `id`=?"); - $stmt->bind_param('i',$_POST['id']); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($num); - $stmt->fetch(); - $stmt->close(); - $stmt = $db->prepare("DELETE FROM `workouts_attributes` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$_POST['id']); - $content = array("DELETE","workouts_attributes",$_POST['id']); - if(!($this->database_query($stmt,$content,"DELETE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - $stmt = $db->prepare("SELECT `id`,`attribute_num` FROM `workouts_attributes` WHERE `attribute_num`>?"); - $stmt->bind_param('i',$num); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$attrnum); - $data = array(); - while($stmt->fetch()){ - $data[$id]=$attrnum-1; - } - $stmt->close(); - foreach($data as $id=>$newnum){ - $stmt = $db->prepare("UPDATE `workouts_attributes` SET `attribute_num`=? WHERE `id`=? LIMIT 1"); - $stmt->bind_param('ii',$newnum,$id); - $content = array("UPDATE","workouts_attributes",array("attribute_num"),array($newnum)); - if(!($this->database_query($stmt,$content,"UPDATE",$id))){ - self::log_error("Database query failed."); - return FALSE; - } - } - $stmt = $db->prepare("SELECT `id`,`workout_attributes` FROM `workouts` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$attrs); - $toset = array(); - while($stmt->fetch()){ - $toset[$id]=str_split($attrs); - } - $stmt->close(); - foreach($toset as $k=>$attrs){ - unset($attrs[$num]); - $toset[$k]=implode("",$attrs); - } - foreach($toset as $k=>$attrs){ - $stmt = $db->prepare("UPDATE `workouts` SET `workout_attributes`=? WHERE `id`=? LIMIT 1"); - $stmt->bind_param('si',$attrs,$k); - $content = array("UPDATE","workouts",array("workout_attributes"),array($attrs)); - if(!($this->database_query($stmt,$content,"UPDATE",$k))){ - self::log_error("Database query failed."); - return FALSE; - } - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_attribute_save.php b/old/workout_management_attribute_save.php deleted file mode 100644 index 7dc41df..0000000 --- a/old/workout_management_attribute_save.php +++ /dev/null @@ -1,32 +0,0 @@ -db; - $stmt = $db->prepare("UPDATE `workouts_attributes` SET `attribute_name`=?,`attribute_label`=?,`comments`=? WHERE `id`=? LIMIT 1"); - $stmt->bind_param('sssi',$_POST['name'],$_POST['label'],$_POST['comments'],$_POST['id']); - $content = array("UPDATE","workouts_attributes",array("attribute_name","attribute_label","comments"),array($_POST['name'],$_POST['label'],$_POST['comments'])); - if(!($this->database_query($stmt,$content,"UPDATE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_attributes_reorder.php b/old/workout_management_attributes_reorder.php deleted file mode 100644 index 2c4496f..0000000 --- a/old/workout_management_attributes_reorder.php +++ /dev/null @@ -1,61 +0,0 @@ -db; - $stmt = $db->prepare("SELECT `id`,`attribute_num` FROM `workouts_attributes` WHERE 1 ORDER BY `attribute_num` ASC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$num); - $data = array(); - while($stmt->fetch()){ - $data[$num]=$id; - } - $stmt->close(); - $initial=$data; - $key=$data[$_POST['attrnum']]; - unset($data[$_POST['attrnum']]); - $data = array_values($data); - if($_POST['vd']<0){ - $diff = ceil($_POST['vd']); - $pos = (($_POST['attrnum']+$diff)<0)?0:$_POST['attrnum']+$diff; - } - else { - $diff = floor($_POST['vd']); - $pos = $_POST['attrnum']+$diff; - } - array_splice($data,$pos,0,$key); - $data = array_values($data); - foreach($initial as $key=>$value){ - if($value!=$data[$key]){ - $stmt = $db->prepare("UPDATE `workouts_attributes` SET `attribute_num`=? WHERE `id`=? LIMIT 1"); - $stmt->bind_param('ii',$key,$data[$key]); - $content = array("UPDATE","workouts_attributes",array("attribute_num"),array($key)); - if(!($this->database_query($stmt,$content,"UPDATE",$data[$key]))){ - self::log_error("Database query failed."); - return FALSE; - } - } - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_data.php b/old/workout_management_data.php deleted file mode 100644 index d85a847..0000000 --- a/old/workout_management_data.php +++ /dev/null @@ -1,82 +0,0 @@ -db; - $tosend = array("hash"=>"","recent"=>array(),"attributes"=>array()); - $stmt = $db->prepare("SELECT md5(CONCAT_WS('%%',`c`.`id`,`c`.`wid`,`c`.`date`,`c`.`comments`,`c`.`modified`)) FROM `workout_count` as `c` WHERE 1 UNION SELECT md5(CONCAT_WS('%%',`w`.`id`,`w`.`siid`,`w`.`workout_name`,`w`.`workout_attributes`,`w`.`comments`,`w`.`modified`)) FROM `workouts` as `w` WHERE 1 UNION SELECT md5(CONCAT_WS('%%',`a`.`id`,`a`.`attribute_num`,`a`.`attribute_name`,`a`.`attribute_label`,`a`.`comments`,`a`.`modified`)) FROM `workouts_attributes` as `a` WHERE 1"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($hash); - while($stmt->fetch()){ - $tosend['hash']=($tosend['hash']=="")?$hash:md5($hash.$tosend['hash']); - } - $stmt->close(); - $stmt = $db->prepare("SELECT `id`,`attribute_num`,`attribute_name`,`attribute_label`,`comments` FROM `workouts_attributes` WHERE 1 ORDER BY `attribute_num` ASC;"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$num,$name,$label,$comments); - while($stmt->fetch()){ - $tosend['attributes'][$num]=array("id"=>$id,"attribute_num"=>$num,"attribute_name"=>$name,"attribute_label"=>$label,"comments"=>$comments); - $tosend['recent'][$num]=NULL; - } - $stmt->close(); - $stmt = $db->prepare("SELECT `w`.`workout_attributes`,MAX(`c`.`date`) as `last_done` FROM `workouts` as `w` LEFT JOIN `workout_count` as `c` ON `w`.`siid`=`c`.`wid` WHERE 1 GROUP BY `w`.`siid` ORDER BY `last_done` DESC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($attrs,$last); - while($stmt->fetch()){ - $temp = str_split($attrs); - while(count($temp)close(); - ksort($tosend['recent']); - $i=0; - foreach($tosend['recent'] as $key=>$val){ - $now = time(); - $tosend['recent'][$key] = ($val!=NULL)?floor(($now-strtotime($val))/(60*60*24)):"N/A"; - } - $tosend["recent"]=$tosend['recent']; - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_data.php~ b/old/workout_management_data.php~ deleted file mode 100644 index 257ae97..0000000 --- a/old/workout_management_data.php~ +++ /dev/null @@ -1,83 +0,0 @@ -db; - $tosend = array("recent"=>array(),"attributes"=>array()); - $stmt = $db->prepare("SELECT `id`,`attribute_num`,`attribute_name`,`attribute_label`,`comments` FROM `workouts_attributes` WHERE 1 ORDER BY `attribute_num` ASC;"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$num,$name,$label,$comments); - while($stmt->fetch()){ - $tosend['attributes'][$num]=array("id"=>$id,"attribute_num"=>$num,"attribute_name"=>$name,"attribute_label"=>$label,"comments"=>$comments); - $tosend['recent'][$num]=NULL; - } - $stmt->close(); - $stmt = $db->prepare("SELECT `w`.`id`,`w`.`siid`,`w`.`workout_name`,`w`.`workout_attributes`,`w`.`comments`,MAX(`workout_count`.`date`) as `last_done`,COUNT(`workout_count`.`wid`) as `times_done` FROM `workouts` as `w` LEFT JOIN `workout_count` ON `w`.`siid`=`workout_count`.`wid` WHERE 1 GROUP BY `w`.`siid` ORDER BY `last_done` DESC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$siid,$name,$attrs,$comments,$last,$times); - while($stmt->fetch()){ - $tosend['raw'][$id]=array("id"=>$id,"siid"=>$siid,"name"=>$name,"attrs"=>array(),"comments"=>$comments,"last"=>$last,"times"=>$times); - $temp = str_split($attrs); - while(count($temp)close(); - ksort($tosend['recent']); - $i=0; - foreach($tosend['recent'] as $key=>$val){ - $now = time(); - $tosend['recent'][$key] = ($val!=NULL)?floor(($now-strtotime($val))/(60*60*24)):"N/A"; - } - $tosend["recent"]=$tosend['recent']; - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_delete.php b/old/workout_management_delete.php deleted file mode 100644 index 2f548a5..0000000 --- a/old/workout_management_delete.php +++ /dev/null @@ -1,53 +0,0 @@ -db; - $stmt = $db->prepare("DELETE FROM `workouts` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$_POST['id']); - $content = array("DELETE","workouts",array($_POST['id'])); - if(!($this->database_query($stmt,$content,"DELETE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - $stmt = $db->prepare("SELECT `id` FROM `workout_count` WHERE `wid`=?"); - $stmt->bind_param('i',$_POST['id']); - $todelete = array(); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id); - while($stmt->fetch()){ - $todelete[]=$id; - } - $stmt->close(); - foreach($todelete as $i=>$id){ - $stmt = $db->prepare("DELETE FROM `workout_count` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$id); - $content = array("DELETE","workout_count",array($id)); - if(!($this->database_query($stmt,$content,"DELETE",$id))){ - self::log_error("Database query failed."); - return FALSE; - } - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_delete.php~ b/old/workout_management_delete.php~ deleted file mode 100644 index 1cd6778..0000000 --- a/old/workout_management_delete.php~ +++ /dev/null @@ -1,54 +0,0 @@ -db; - $stmt = $db->prepare("DELETE FROM `workouts` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$_POST['id']); - $content = array("DELETE","workouts",array($_POST['id'])); - if(!($this->database_query($stmt,$content,"DELETE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - $stmt->close(); - $stmt = $db->prepare("SELECT `id` FROM `workout_count` WHERE `wid`=?"); - $stmt->bind_param('i',$_POST['id']); - $todelete = array(); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id); - while($stmt->fetch()){ - $todelete[]=$id; - } - $stmt->close(); - foreach($todelete as $i=>$id){ - $stmt = $db->prepare("DELETE FROM `workout_count` WHERE `id`=? LIMIT 1"); - $stmt->bind_param('i',$id); - $content = array("DELETE","workout_count",array($id)); - if(!($this->database_query($stmt,$content,"DELETE",$id))){ - self::log_error("Database query failed."); - return FALSE; - } - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_edit.php b/old/workout_management_edit.php deleted file mode 100644 index 94b976a..0000000 --- a/old/workout_management_edit.php +++ /dev/null @@ -1,36 +0,0 @@ -db; - foreach($_POST['attributes'] as $k=>$v){ - $_POST['attributes'][$k]=($v=="Yes")?"1":"0"; - } - $_POST['attributes']=implode($_POST['attributes']); - $stmt = $db->prepare("UPDATE `workouts` SET `workout_attributes`=?,`workout_name`=?,`comments`=? WHERE `id`=? LIMIT 1"); - $stmt->bind_param('sssi',$_POST['attributes'],$_POST['workout_name'],$_POST['comments'],$_POST['id']); - $content = array("UPDATE","workouts",array("workout_attributes","workout_name","comments"),array($_POST['attributes'],$_POST['workout_name'],$_POST['comments'])); - if(!($this->database_query($stmt,$content,"UPDATE",$_POST['id']))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_options_change.php b/old/workout_management_options_change.php deleted file mode 100644 index 8c37432..0000000 --- a/old/workout_management_options_change.php +++ /dev/null @@ -1,44 +0,0 @@ -db; - if(($_POST['field']=="workout")&&($_POST['value']=="added")){ - if(!($this->option_delete("date","workout_management"))){ - self::log_error("Option delete failed."); - return FALSE; - } - if(!($this->option_delete("wid","workout_management"))){ - self::log_error("Option delete failed."); - return FALSE; - } - if(!($this->option_delete("comments","workout_management"))){ - self::log_error("Option delete failed."); - return FALSE; - } - } - else { - if((isset($_POST['value']))&&(isset($_POST['field']))){ - $this->option_set($_POST['field'],$_POST['value'],"workout_management"); - } - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_quick_tools_add_new_workout.php b/old/workout_management_quick_tools_add_new_workout.php deleted file mode 100644 index ba6ed13..0000000 --- a/old/workout_management_quick_tools_add_new_workout.php +++ /dev/null @@ -1,32 +0,0 @@ -db; - $stmt = $db->prepare("INSERT INTO `workout_count`(`wid`, `date`, `comments`) VALUES (?,?,?)"); - $stmt->bind_param('iss',$_POST['wid'],$_POST['date'],$_POST['comments']); - $content=array("INSERT","workout_count",array("wid","date","comments"),array($_POST['wid'],$_POST['date'],$_POST['comments'])); - if(!($this->database_query($stmt,$content,"INSERT",NULL))){ - self::log_error("Database query failed."); - return FALSE; - } - echo "success"; - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_quick_tools_data.php b/old/workout_management_quick_tools_data.php deleted file mode 100644 index 6ca838f..0000000 --- a/old/workout_management_quick_tools_data.php +++ /dev/null @@ -1,36 +0,0 @@ -db; - $tosend = array("workouts"=>array(),"options"=>array()); - $stmt = $db->prepare("SELECT `id`,`siid`,`workout_name`,`workout_attributes`,`comments` FROM `workouts` WHERE 1 ORDER BY `workout_name` ASC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$siid,$name,$attrs,$comments); - while($stmt->fetch()){ - $tosend["workouts"][]=array("id"=>$id,"siid"=>$siid,"workout_name"=>$name,"workout_attributes"=>$attrs,"comments"=>$comments); - } - $tosend['options']=$this->page_options_get("workout_management"); - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_quick_tools_data.php~ b/old/workout_management_quick_tools_data.php~ deleted file mode 100644 index 2feeb0c..0000000 --- a/old/workout_management_quick_tools_data.php~ +++ /dev/null @@ -1,36 +0,0 @@ -db; - $tosend = array("workouts"=>array(),"options"=>array()); - $stmt = $db->prepare("SELECT `id`,`workout_name`,`workout_attributes`,`comments` FROM `workouts` WHERE 1 ORDER BY `workout_name` ASC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$name,$attrs,$comments); - while($stmt->fetch()){ - $tosend["workouts"][]=array("id"=>$id,"workout_name"=>$name,"workout_attributes"=>$attrs,"comments"=>$comments); - } - $tosend['options']=$this->page_options_get("workout_management"); - echo json_encode($tosend); - return TRUE; - } - -} - -?> \ No newline at end of file diff --git a/old/workout_management_table_data.php b/old/workout_management_table_data.php deleted file mode 100644 index ff3cff5..0000000 --- a/old/workout_management_table_data.php +++ /dev/null @@ -1,56 +0,0 @@ -db; - $tosend = array("raw"=>array(),"hash"=>""); - $sortby = ((isset($_POST['sorting']))&&(isset($_POST['order'])))?$this->build_sortby($_POST['sorting'],$_POST['order']):"";//build_sortby is from class_workout_management.php - $stmt = $db->prepare(sprintf("SELECT md5(CONCAT_WS('%%',`w`.`id`,`w`.`siid`,`w`.`workout_name`,RPAD(`w`.`workout_attributes`,(SELECT COUNT(*) FROM `workouts_attributes`),'0'),`w`.`comments`,MAX(`c`.`date`),COUNT(`c`.`wid`))) FROM `workouts` as `w` LEFT JOIN `workout_count` as `c` ON `w`.`siid`=`c`.`wid` WHERE 1 GROUP BY `w`.`siid`%s",$sortby)); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($hash); - while($stmt->fetch()){ - $tosend['hash']=($tosend['hash']=="")?$hash:md5($hash.$tosend['hash']); - } - $stmt->close(); - $stmt = $db->prepare(sprintf("SELECT `w`.`id`,`w`.`siid`,`w`.`workout_name`,RPAD(`w`.`workout_attributes`,(SELECT COUNT(*) FROM `workouts_attributes`),'0') as `workout_attributes`,`w`.`comments`,MAX(`c`.`date`) as `last_done`,COUNT(`c`.`wid`) as `times_done` FROM `workouts` as `w` LEFT JOIN `workout_count` as `c` ON `w`.`siid`=`c`.`wid` WHERE 1 GROUP BY `w`.`siid`%s",$sortby)); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$siid,$name,$attrs,$comments,$last,$times); - while($stmt->fetch()){ - $row = array("id"=>$id,"siid"=>$siid,"name"=>$name,"attrs"=>array(),"comments"=>$comments,"last"=>$last,"times"=>$times); - $temp = str_split($attrs); - for($i=0;$i \ No newline at end of file diff --git a/old/workout_management_table_data.php~ b/old/workout_management_table_data.php~ deleted file mode 100644 index 247e6b1..0000000 --- a/old/workout_management_table_data.php~ +++ /dev/null @@ -1,47 +0,0 @@ -db; - $tosend = array("raw"=>array(),"hash"=>""); - $stmt = $db->prepare("SELECT `w`.`id`,`w`.`siid`,`w`.`workout_name`,`w`.`workout_attributes`,`w`.`comments`,MAX(`workout_count`.`date`) as `last_done`,COUNT(`workout_count`.`wid`) as `times_done` FROM `workouts` as `w` LEFT JOIN `workout_count` ON `w`.`siid`=`workout_count`.`wid` WHERE 1 GROUP BY `w`.`siid` ORDER BY `last_done` DESC"); - if(!($stmt->execute())){ - self::log_error(mysqli_stmt_error($stmt)); - return FALSE; - } - $stmt->bind_result($id,$siid,$name,$attrs,$comments,$last,$times); - while($stmt->fetch()){ - $temp = str_split($attrs); - while(count($temp) \ No newline at end of file