Code Duplication    Length = 14-14 lines in 2 locations

caffeinated/admin/new/pricing/Pricing_Admin_Page.core.php 2 locations

@@ 786-799 (lines=14) @@
783
			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
784
			// cycle thru checkboxes
785
			while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) {
786
				if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID) ) ) {
787
					$success = 0;
788
				} else {
789
					$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
790
					if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
791
						//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
792
						if ( $PRC_deleted ) {
793
							$ticket->_remove_relation_to($PRC_ID, 'Price');
794
						} else {
795
							$ticket->_add_relation_to($PRC_ID, 'Price');
796
						}
797
						$ticket->save();
798
					}
799
				}
800
			}
801
802
		} else {
@@ 805-818 (lines=14) @@
802
		} else {
803
			// grab single id and delete
804
			$PRC_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0;
805
			if ( empty( $PRC_ID ) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID) ) {
806
				$success = 0;
807
			} else {
808
				$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
809
				if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
810
					//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
811
					if ( $PRC_deleted ) {
812
						$ticket->_remove_relation_to($PRC_ID, 'Price');
813
					} else {
814
						$ticket->_add_relation_to($PRC_ID, 'Price');
815
					}
816
					$ticket->save();
817
				}
818
			}
819
820
		}
821
		$query_args = array(